File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -525,6 +525,10 @@ class CommonModelOptions(FrozenConfigurable):
525525 trait = Unicode (),
526526 default_value = [],
527527 help = "Fields to export in HDF5 format" ).tag (config = True )
528+ fields_to_export_netcdf = List (
529+ trait = Unicode (),
530+ default_value = [],
531+ help = "Fields to export in NetCDF format" ).tag (config = True )
528532 verbose = Integer (0 , help = "Verbosity level" ).tag (config = True )
529533 linear_drag_coefficient = FiredrakeScalarExpression (
530534 None , allow_none = True , help = r"""
@@ -743,10 +747,6 @@ class ModelOptions2d(CommonModelOptions):
743747 2D solver supports 'dg' or 'cg'.""" ).tag (config = True )
744748 use_supg_tracer = Bool (
745749 False , help = "Use SUPG stabilisation in tracer advection" ).tag (config = True )
746- fields_to_export_netcdf = List (
747- trait = Unicode (),
748- default_value = [],
749- help = "Fields to export in NetCDF format" ).tag (config = True )
750750
751751 def __init__ (self , * args , ** kwargs ):
752752 self .tracer = OrderedDict ()
Original file line number Diff line number Diff line change @@ -887,6 +887,15 @@ def create_exporters(self):
887887 verbose = self .options .verbose > 0 ,
888888 preproc_funcs = self ._field_preproc_funcs )
889889 self .exporters ['hdf5' ] = e
890+ nc_dir = os .path .join (self .options .output_directory , 'nc' )
891+ e = exporter .ExportManager (nc_dir ,
892+ self .options .fields_to_export_netcdf ,
893+ self .fields ,
894+ field_metadata ,
895+ export_type = 'netcdf' ,
896+ verbose = self .options .verbose > 0 ,
897+ preproc_funcs = self ._field_preproc_funcs )
898+ self .exporters ['netcdf' ] = e
890899
891900 self ._isfrozen = True
892901
You can’t perform that action at this time.
0 commit comments