[Dart-dev] DART/branches Revision: 13187

dart at ucar.edu dart at ucar.edu
Mon Jul 8 10:15:14 MDT 2019


nancy at ucar.edu
2019-07-08 10:15:14 -0600 (Mon, 08 Jul 2019)
869
kevin discovered that updated netcdf software on cheyenne
will no longer open our inflation files (in filter) nor
our diagnostic files (e.g. ncview, obs_diag?) because
we've given the 'lev' and 'ilev' netcdf variables a unit
of 'level' when it's really 'hPa'.  udunits throws an
error and the program exits.  i haven't found a way to
avoid this.

in the meantime, this commit adds kevin's changes to the
units attribute in the cam-fv/model_mod.f90 (changing 
'level' to 'hPa') and that should fix new files we create.

i'm not sure how we deal with older diagnostic and inflation 
files going forward.  perhaps using 'ncks' to alter that
attribute in the files?

i checked the initial and restart files CAM writes out
and they have 'hPa' as the units.  we didn't notice this
when updating the cam model_mod.f90 (where the variable
attributes are created by our code).




Modified: DART/branches/rma_trunk/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/rma_trunk/models/cam-fv/model_mod.f90	2019-07-01 21:39:07 UTC (rev 13186)
+++ DART/branches/rma_trunk/models/cam-fv/model_mod.f90	2019-07-08 16:15:14 UTC (rev 13187)
@@ -1892,7 +1892,7 @@
 ! Vertical Grid Latitudes
 call nc_define_real_variable(     ncid, 'lev', (/ 'lev' /),                                                     routine)
 call nc_add_attribute_to_variable(ncid, 'lev', 'long_name',      'hybrid level at midpoints (1000*(A+B))',      routine)
-call nc_add_attribute_to_variable(ncid, 'lev', 'units',          'level',                                       routine)
+call nc_add_attribute_to_variable(ncid, 'lev', 'units',          'hPa',                                         routine)
 call nc_add_attribute_to_variable(ncid, 'lev', 'positive',       'down',                                        routine)
 call nc_add_attribute_to_variable(ncid, 'lev', 'standard_name',  'atmosphere_hybrid_sigma_pressure_coordinate', routine)
 call nc_add_attribute_to_variable(ncid, 'lev', 'formula_terms',  'a: hyam b: hybm p0: P0 ps: PS',               routine)
@@ -1900,7 +1900,7 @@
 
 call nc_define_real_variable(     ncid, 'ilev', (/ 'ilev' /),                                                    routine)
 call nc_add_attribute_to_variable(ncid, 'ilev', 'long_name',      'hybrid level at interfaces (1000*(A+B))',     routine)
-call nc_add_attribute_to_variable(ncid, 'ilev', 'units',          'level',                                       routine)
+call nc_add_attribute_to_variable(ncid, 'ilev', 'units',          'hPa',                                         routine)
 call nc_add_attribute_to_variable(ncid, 'ilev', 'positive',       'down',                                        routine)
 call nc_add_attribute_to_variable(ncid, 'ilev', 'standard_name',  'atmosphere_hybrid_sigma_pressure_coordinate', routine)
 call nc_add_attribute_to_variable(ncid, 'ilev', 'formula_terms',  'a: hyai b: hybi p0: P0 ps: PS',               routine)


More information about the Dart-dev mailing list