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

Fixes #1800. Add file name to NC4 asserts #1813

Merged
merged 3 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -10,7 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

### Added

- Added assert to NetCDF4_get_var.H to print variable name if data retrieval fails
- Add to asserts in `NetCDF4_get_var.H` to print out file if there are error getting variables

### Changed

Expand Down
4 changes: 2 additions & 2 deletions pfio/NetCDF4_get_var.H
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
status = nf90_inq_varid(this%ncid, name=var_name, varid=varid)
!$omp end critical

_ASSERT(status==0,"Variable not found: "//trim(var_name))
_ASSERT(status==0,"Variable not found: "//trim(var_name)//" in file: "//trim(this%origin_file))
!$omp critical
#if (_RANK == 0)
status = nf90_get_var(this%ncid, varid, values)
#else
status = nf90_get_var(this%ncid, varid, values, start, count)
#endif
!$omp end critical
_ASSERT(status==0,"Unable to get variable: "//trim(var_name))
_ASSERT(status==0,"Unable to get variable: "//trim(var_name)//" from file: "//trim(this%origin_file))

_RETURN(_SUCCESS)
_UNUSED_DUMMY(unusable)
Expand Down