Skip to content

Commit

Permalink
set %label in register_netcdf_field and register_netcdf_axis
Browse files Browse the repository at this point in the history
  • Loading branch information
alperaltuntas committed Oct 31, 2023
1 parent d363034 commit 8bfccd2
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 8bfccd2

Please sign in to comment.