Skip to content

Commit

Permalink
Merge pull request #3026 from GEOS-ESM/feature/wjiang/read_string_att…
Browse files Browse the repository at this point in the history
…ribute

read explicit "string" type of an attribute of a netcdf variable
  • Loading branch information
tclune authored Sep 12, 2024
2 parents f335c5d + 43cc8a6 commit 0fe9a5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed


- Added ability to read the attribute with explicit type "string" of a netcdf variable.
- Start implementing changes for vertical regridding in ExtData
- Add ability to connect export of the MAPL hierachy to ExtData via CAP.rc file
- Added new driver, CapDriver.x, to excerise the MAPL_Cap with the configuratable component also used by ExtDataDriver.x
Expand Down
10 changes: 6 additions & 4 deletions pfio/NetCDF4_FileFormatter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ subroutine put_var_attributes(this, var, varid, unusable, rc)
iter = attributes%begin()
do while (iter /= attributes%end())
attr_name => iter%key()

p_attribute => iter%value()
shp = p_attribute%get_shape()
if (size(shp) == 0) then ! scalar
Expand Down Expand Up @@ -1079,9 +1078,12 @@ subroutine inq_var_attributes(this, var, varid, unusable, rc)
call var%add_attribute(trim(attr_name), str)
deallocate(str)
case (NF90_STRING)
!W.Y. Note: pfio does not support variable's string attribute
! It only supports global 1-d string attribute
cycle
!$omp critical
status = pfio_get_att_string(this%ncid, varid, trim(attr_name), str)
!$omp end critical
_VERIFY(status)
call var%add_attribute(trim(attr_name), str)
deallocate(str)
case default
_RETURN(_FAILURE)
end select
Expand Down

0 comments on commit 0fe9a5e

Please sign in to comment.