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, privatenetCDF file ID% filename ::
character(len=:), allocatable, privatenetCDF filename% define_mode ::
logical, privateTrue if file is in define mode.% time_id ::
integer, privateTime axis variable ID.% time ::
real, privateCurrent model time.% time_level ::
integer, privateCurrent time level for output.
- type mom_netcdf/netcdf_axis
Dimension axis for a netCDF file.
- Type fields:
% label ::
character(len=:), allocatable, publicAxis label name.% points ::
real, dimension(:), allocatable, privateGrid points along the axis.% dimid ::
integer, privatenetCDF dimension ID associated with axis% varid ::
integer, privatenetCDF variable ID associated with axis
Function/Subroutine Documentation
- subroutine mom_netcdf/open_netcdf_file(handle, filename, mode)
- Parameters:
handle ::
handle[inout] netCDF file handlefilename ::
filename[in] netCDF filenamemode ::
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)
Register a netCDF variable.
- Parameters:
handle ::
handle[in] netCDF file handlelabel ::
label[in] netCDF field name in the fileaxes ::
axes[in] Axes along which field is definedlongname ::
longname[in] Long name of the netCDF fieldunits ::
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)
Create an axis and associated dimension in a netCDF file.
- Parameters:
handle ::
handle[inout] netCDF file handlelabel ::
label[in] netCDF axis name in the fileunits ::
units[in] Axis units of measurementlongname ::
longname[in] Long name of the axispoints ::
points[in] Values of axis points (for fixed axes)cartesian ::
cartesian[in] Character denoting axis direction: X, Y, Z, T, or N for nonesense ::
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 ::
handle[inout] netCDF file handlefield ::
field[in] Field metadatavalues ::
values[in] Field valuestime ::
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 ::
handle[inout] netCDF file handlefield ::
field[in] Field metadatavalues ::
values[in] Field valuestime ::
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 ::
handle[inout] netCDF file handlefield ::
field[in] Field metadatavalues ::
values[in] Field valuestime ::
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 ::
handle[inout] netCDF file handlefield ::
field[in] Field metadatavalues ::
values[in] Field valuestime ::
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 ::
handle[inout] netCDF file handlefield ::
field[in] Field metadatascalar ::
scalar[in] Field valuestime ::
time[in] Timestep index to write data
- subroutine mom_netcdf/write_netcdf_axis(handle, axis)
Write axis points to associated netCDF variable.
- Parameters:
handle ::
handle[inout] netCDF file handleaxis ::
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 ::
handle[in] netCDF file handlelabel ::
label[in] File attributeattribute ::
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 ::
handle[in] netCDF input filendims ::
ndims[out] number of dimensions in the filenvars ::
nvars[out] number of variables in the filensteps ::
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 ::
handle[inout] netCDF file handleaxes ::
axes[inout] netCDF file axesfields ::
fields[inout] netCDF file fields
- Call to:
check_netcdf_callnulltime
- function mom_netcdf/get_netcdf_filename(handle)
Return the name of a file from a netCDF handle.
- Parameters:
handle ::
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 ::
handle[inout] netCDF file handletime ::
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 ::
ncerr[in] netCDF error codeheader ::
header[in] Message header (usually calling subroutine)message ::
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