Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read explicit "string" type of an attribute of a netcdf variable #3026

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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