Skip to content

Commit

Permalink
read explicit "string" attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyuan-jiang committed Sep 11, 2024
1 parent 74fce3a commit a6606b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ 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.
- 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
- Added Fortran interface to UDUNITS2
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 a6606b5

Please sign in to comment.