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

Fix label allocation in register_netcdf_ functions. #262

Merged
merged 1 commit into from
Nov 6, 2023
Merged
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
6 changes: 5 additions & 1 deletion src/framework/MOM_netcdf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ function register_netcdf_field(handle, label, axes, longname, units) &
allocate(dimids(size(axes)))
dimids(:) = [(axes(i)%dimid, i = 1, size(axes))]

field%label = label

! Determine the corresponding netCDF data type
! TODO: Support a `pack`-like argument
select case (kind(1.0))
Expand All @@ -225,7 +227,7 @@ function register_netcdf_field(handle, label, axes, longname, units) &
case (real64)
xtype = NF90_DOUBLE
case default
call MOM_error(FATAL, "register_netcdf_axis: Unknown kind(real).")
call MOM_error(FATAL, "register_netcdf_field: Unknown kind(real).")
end select

! Register the field variable
Expand Down Expand Up @@ -293,6 +295,8 @@ function register_netcdf_axis(handle, label, units, longname, points, &
"Axis must either have explicit points or be a time axis ('T').")
endif

axis%label = label

if (present(points)) then
axis_size = size(points)
allocate(axis%points(axis_size))
Expand Down