Skip to content

Commit f2bf174

Browse files
tclunelizziel
andauthored
Update to extdata2g compatibility with non-CF inputs (#4802)
* Change standard_name to long_name for non-cf file compatibility in extdata2g * Updated changelog Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu> --------- Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu> Co-authored-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
1 parent fface8f commit f2bf174

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- ESMA_cmake v4.37.0
2424
- Add `Coverage` CMake build type
2525
- Update CTest configuration for Coverage tests
26+
- Changed standard_name to long_name in handling of non-CF dimensionless vertical coordinate in ExtData2G
2627

2728
### Removed
2829

vertical/VerticalCoordinate.F90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function new_verticalCoordinate(metadata, var_name, rc) result(vertical_coord)
6464
class(CoordinateVariable), pointer :: coord_var
6565
character(len=:), pointer :: dim_name
6666
logical :: is_vertical_coord_var, has_pressure_units, has_height_units
67-
character(len=:), allocatable :: lev_name, temp_units, formula_terms, standard_name, bounds_var, ak_name, bk_name, ps_name, source_file
67+
character(len=:), allocatable :: lev_name, temp_units, formula_terms, standard_name, long_name, bounds_var, ak_name, bk_name, ps_name, source_file
6868
type(NETCDF4_FileFormatter) :: file_formatter
6969
real, allocatable :: temp_ak(:,:), temp_bk(:,:)
7070

@@ -110,16 +110,16 @@ function new_verticalCoordinate(metadata, var_name, rc) result(vertical_coord)
110110
! for backwards compatibility with non-cf files
111111
if ((.not. coord_var%is_attribute_present("positive")) .and. &
112112
(.not. has_pressure_units)) then
113-
standard_name = coord_var%get_attribute_string("standard_name")
113+
long_name = coord_var%get_attribute_string("long_name")
114114
! metadata combinations that imply integer levels
115-
if ( any(standard_name == ["level ", "levels"]) .and. &
115+
if ( any(long_name == ["level ", "levels"]) .and. &
116116
any(temp_units == ["1 ", "level"])) then
117117
vertical_coord%positive = "up"
118118
if (vertical_coord%levels(1) >= vertical_coord%levels(2)) then
119119
vertical_coord%positive = "down"
120120
endif
121121
else
122-
_FAIL('lev positive attribute not in file and no rule defined for setting it from standard_name and units')
122+
_FAIL('lev positive attribute not in file and no rule defined for setting it from long_name and units')
123123
endif
124124
endif
125125

0 commit comments

Comments
 (0)