mom_netcdf module reference¶
MOM6 interface to netCDF operations.
Data Types¶
netCDF file abstraction |
|
Dimension axis for a netCDF file. |
|
Field variable for a netCDF file. |
Functions/Subroutines¶
Close an opened netCDF file. |
|
Flush buffered output to the netCDF file. |
|
Change netCDF mode of handle from ‘define’ to ‘write’. |
|
Register a netCDF variable. |
|
Create an axis and associated dimension in a netCDF file. |
|
Write a 4D array to a compatible netCDF field. |
|
Write a 3D array to a compatible netCDF field. |
|
Write a 2D array to a compatible netCDF field. |
|
Write a 1D array to a compatible netCDF field. |
|
Write a scalar to a compatible netCDF field. |
|
Write axis points to associated netCDF variable. |
|
Write a global attribute to a netCDF file. |
|
Get the number of dimensions, variables, and timesteps in a netCDF file. |
|
Get the metadata of the registered fields in a netCDF file. |
|
Return the name of a file from a netCDF handle. |
|
Read the values of a field from a netCDF file. |
|
Set the current timestep of an open netCDF file. |
|
Check netCDF function return codes, report the error log, and abort the run. |
Detailed Description¶
MOM6 interface to netCDF operations.
Type Documentation¶
-
type
mom_netcdf/netcdf_file_type¶ netCDF file abstraction
- Type fields:
%ncid[integer,private] :: netCDF file ID%filename[character (len=:),allocatable, private] :: netCDF filename%define_mode[logical,private] :: True if file is in define mode.%time_id[integer,private] :: Time axis variable ID.%time[real,private] :: Current model time.%time_level[integer,private] :: Current time level for output.
-
type
mom_netcdf/netcdf_axis¶ Dimension axis for a netCDF file.
- Type fields:
%label[character (len=:),allocatable, public] :: Axis label name.%points[real(:),allocatable, private] :: Grid points along the axis.%dimid[integer,private] :: netCDF dimension ID associated with axis%varid[integer,private] :: netCDF variable ID associated with axis
-
type
mom_netcdf/netcdf_field¶ Field variable for a netCDF file.
- Type fields:
%label[character (len=:),allocatable, public] :: Variable name.%varid[integer,private] :: netCDF variable ID for field
Function/Subroutine Documentation¶
-
subroutine
mom_netcdf/open_netcdf_file(handle, filename, mode)¶ - Parameters:
handle :: [inout] netCDF file handle
filename :: [in] netCDF filename
mode :: [in] Input MOM I/O mode
- Call to:
check_netcdf_callmom_error_handler::mom_errorwrite_netcdf_attribute
-
subroutine
mom_netcdf/close_netcdf_file(handle)¶ Close an opened netCDF file.
- Call to:
-
subroutine
mom_netcdf/flush_netcdf_file(handle)¶ Flush buffered output to the netCDF file.
- Call to:
-
subroutine
mom_netcdf/enable_netcdf_write(handle)¶ Change netCDF mode of handle from ‘define’ to ‘write’.
- Call to:
- Called from:
write_netcdf_axismom_netcdf::write_netcdf_field::write_netcdf_field_0dmom_netcdf::write_netcdf_field::write_netcdf_field_1dmom_netcdf::write_netcdf_field::write_netcdf_field_2dmom_netcdf::write_netcdf_field::write_netcdf_field_3dmom_netcdf::write_netcdf_field::write_netcdf_field_4d
-
function
mom_netcdf/register_netcdf_field(handle, label, axes, longname, units) [type(netcdf_field)]¶ Register a netCDF variable.
- Parameters:
handle :: [in] netCDF file handle
label :: [in] netCDF field name in the file
axes :: [in] Axes along which field is defined
longname :: [in] Long name of the netCDF field
units :: [in] Field units of measurement
- Return:
undefined :: netCDF field
- Call to:
-
function
mom_netcdf/register_netcdf_axis(handle, label, units, longname, points, cartesian, sense) [type(netcdf_axis)]¶ Create an axis and associated dimension in a netCDF file.
- Parameters:
handle :: [inout] netCDF file handle
label :: [in] netCDF axis name in the file
units :: [in] Axis units of measurement
longname :: [in] Long name of the axis
points :: [in] Values of axis points (for fixed axes)
cartesian :: [in] Character denoting axis direction: X, Y, Z, T, or N for none
sense :: [in] Axis direction; +1 if axis increases upward or -1 if downward
- Return:
undefined :: netCDF coordinate axis
- Call to:
-
subroutine
mom_netcdf/write_netcdf_field_4d(handle, field, values, time)¶ Write a 4D array to a compatible netCDF field.
- Parameters:
handle :: [inout] netCDF file handle
field :: [in] Field metadata
values :: [in] Field values
time :: [in] Timestep index to write data
-
subroutine
mom_netcdf/write_netcdf_field_3d(handle, field, values, time)¶ Write a 3D array to a compatible netCDF field.
- Parameters:
handle :: [inout] netCDF file handle
field :: [in] Field metadata
values :: [in] Field values
time :: [in] Timestep index to write data
-
subroutine
mom_netcdf/write_netcdf_field_2d(handle, field, values, time)¶ Write a 2D array to a compatible netCDF field.
- Parameters:
handle :: [inout] netCDF file handle
field :: [in] Field metadata
values :: [in] Field values
time :: [in] Timestep index to write data
-
subroutine
mom_netcdf/write_netcdf_field_1d(handle, field, values, time)¶ Write a 1D array to a compatible netCDF field.
- Parameters:
handle :: [inout] netCDF file handle
field :: [in] Field metadata
values :: [in] Field values
time :: [in] Timestep index to write data
-
subroutine
mom_netcdf/write_netcdf_field_0d(handle, field, scalar, time)¶ Write a scalar to a compatible netCDF field.
- Parameters:
handle :: [inout] netCDF file handle
field :: [in] Field metadata
scalar :: [in] Field values
time :: [in] Timestep index to write data
-
subroutine
mom_netcdf/write_netcdf_axis(handle, axis)¶ Write axis points to associated netCDF variable.
- Parameters:
handle :: [inout] netCDF file handle
axis :: [in] field variable
- Call to:
-
subroutine
mom_netcdf/write_netcdf_attribute(handle, label, attribute)¶ Write a global attribute to a netCDF file.
- Parameters:
handle :: [in] netCDF file handle
label :: [in] File attribute
attribute :: [in] File attribute value
- Call to:
- Called from:
-
subroutine
mom_netcdf/get_netcdf_size(handle, ndims, nvars, nsteps)¶ Get the number of dimensions, variables, and timesteps in a netCDF file.
- Parameters:
handle :: [in] netCDF input file
ndims :: [out] number of dimensions in the file
nvars :: [out] number of variables in the file
nsteps :: [out] number of values in the file’s unlimited axis
- Call to:
-
subroutine
mom_netcdf/get_netcdf_fields(handle, axes, fields)¶ Get the metadata of the registered fields in a netCDF file.
- Parameters:
handle :: [inout] netCDF file handle
axes :: [inout] netCDF file axes
fields :: [inout] netCDF file fields
- Call to:
check_netcdf_callnulltime
-
function
mom_netcdf/get_netcdf_filename(handle) [character(len=:)]¶ Return the name of a file from a netCDF handle.
- Parameters:
handle :: [in] A netCDF file handle
- Return:
undefined :: The name of the file that this handle refers to.
-
subroutine
mom_netcdf/read_netcdf_field(handle, field, values, bounds)¶ Read the values of a field from a netCDF file.
- Call to:
- Called from:
-
subroutine
mom_netcdf/update_netcdf_timestep(handle, time)¶ Set the current timestep of an open netCDF file.
- Parameters:
handle :: [inout] netCDF file handle
time :: [in] New model time
- Call to:
- Called from:
mom_netcdf::write_netcdf_field::write_netcdf_field_0dmom_netcdf::write_netcdf_field::write_netcdf_field_1dmom_netcdf::write_netcdf_field::write_netcdf_field_2dmom_netcdf::write_netcdf_field::write_netcdf_field_3dmom_netcdf::write_netcdf_field::write_netcdf_field_4d
-
subroutine
mom_netcdf/check_netcdf_call(ncerr, header, message)¶ Check netCDF function return codes, report the error log, and abort the run.
- Parameters:
ncerr :: [in] netCDF error code
header :: [in] Message header (usually calling subroutine)
message :: [in] Error message (usually action which instigated the error)
- Call to:
- Called from:
close_netcdf_fileenable_netcdf_writeflush_netcdf_fileget_netcdf_fieldsget_netcdf_sizeopen_netcdf_fileread_netcdf_fieldregister_netcdf_axisregister_netcdf_fieldupdate_netcdf_timestepwrite_netcdf_attributewrite_netcdf_axismom_netcdf::write_netcdf_field::write_netcdf_field_0dmom_netcdf::write_netcdf_field::write_netcdf_field_1dmom_netcdf::write_netcdf_field::write_netcdf_field_2dmom_netcdf::write_netcdf_field::write_netcdf_field_3dmom_netcdf::write_netcdf_field::write_netcdf_field_4d