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 |
Generic Interfaces
Write values to a field of 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. |
Type Documentation
- type :: netcdf_file_type
netCDF file abstraction
- Parameters
ncid
netCDF file ID
filename
netCDF filename
define_mode
True if file is in define mode.
time_id
Time axis variable ID
time
Current model time
time_level
Current time level for output
- type :: netcdf_axis
Dimension axis for a netCDF file
- Parameters
label
Axis label name
points
Grid points along the axis
dimid
netCDF dimension ID associated with axis
varid
netCDF variable ID associated with axis
- type netcdf_field
Field variable for a netCDF file
- Parameters
label
Variable name
varid
netCDF variable ID for field
Generic Interface Documentation
- interface write_netcdf_field
Write values to a field of a netCDF file
Callers call graph
Text view
mom_io_file::write_field_0d_nc → mom_netcdf::interface::write_netcdf_field
mom_io_file::write_field_1d_nc → mom_netcdf::interface::write_netcdf_field
mom_io_file::write_field_2d_nc → mom_netcdf::interface::write_netcdf_field
mom_io_file::write_field_3d_nc → mom_netcdf::interface::write_netcdf_field
mom_io_file::write_field_4d_nc → mom_netcdf::interface::write_netcdf_field
Functions/Subroutine Documentation
subroutine open_netcdf_file(handle, filename, mode)
- Parameters
handle [inout]
netCDF file handle
filename [in]
netCDF filename
mode [in]
Input MOM I/O mode
Callees call graph
External calls
- netcdf
nf90_create (netcdf::nf90_create)
nf90_open (netcdf::nf90_open)
- subroutine close_netcdf_file(handle)
Close an opened netCDF file.
External calls
- netcdf
nf90_close (netcdf::nf90_close)
- subroutine flush_netcdf_file(handle)
Flush buffered output to the netCDF file
External calls
- netcdf
nf90_sync (netcdf::nf90_sync)
- subroutine enable_netcdf_write(handle)
Change netCDF mode of handle from 'define' to 'write'.
Callers call graph
Text view
mom_netcdf::write_netcdf_axis → mom_netcdf::enable_netcdf_write
mom_netcdf::write_netcdf_field_0d → mom_netcdf::enable_netcdf_write
mom_netcdf::write_netcdf_field_1d → mom_netcdf::enable_netcdf_write
mom_netcdf::write_netcdf_field_2d → mom_netcdf::enable_netcdf_write
mom_netcdf::write_netcdf_field_3d → mom_netcdf::enable_netcdf_write
mom_netcdf::write_netcdf_field_4d → mom_netcdf::enable_netcdf_write
External calls
- netcdf
nf90_enddef (netcdf::nf90_enddef)
- function register_netcdf_field(handle, label, axes, longname, units) result(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
field
netCDF field
Callees call graph
External calls
- netcdf
nf90_def_var (netcdf::nf90_def_var)
nf90_put_att (netcdf::nf90_put_att)
- function register_netcdf_axis(handle, label, units, longname, points, cartesian, sense) result(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
axis
netCDF coordinate axis
Callees call graph
External calls
- netcdf
nf90_def_dim (netcdf::nf90_def_dim)
nf90_def_var (netcdf::nf90_def_var)
nf90_put_att (netcdf::nf90_put_att)
- subroutine 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
Callees call graph
External calls
- netcdf
nf90_put_var (netcdf::nf90_put_var)
- subroutine 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
Callees call graph
External calls
- netcdf
nf90_put_var (netcdf::nf90_put_var)
- subroutine 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
Callees call graph
External calls
- netcdf
nf90_put_var (netcdf::nf90_put_var)
- subroutine 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
Callees call graph
External calls
- netcdf
nf90_put_var (netcdf::nf90_put_var)
- subroutine 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
Callees call graph
External calls
- netcdf
nf90_put_var (netcdf::nf90_put_var)
- subroutine write_netcdf_axis(handle, axis)
Write axis points to associated netCDF variable
- Parameters
handle [inout]
netCDF file handle
axis [in]
field variable
Callees call graph
External calls
- netcdf
nf90_put_var (netcdf::nf90_put_var)
- subroutine 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
Callers call graph
External calls
- netcdf
nf90_put_att (netcdf::nf90_put_att)
- subroutine 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
External calls
- netcdf
nf90_inquire (netcdf::nf90_inquire)
nf90_inquire_dimension (netcdf::nf90_inquire_dimension)
- subroutine 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
External calls
- netcdf
nf90_get_var (netcdf::nf90_get_var)
nf90_inq_dimids (netcdf::nf90_inq_dimids)
nf90_inq_varids (netcdf::nf90_inq_varids)
nf90_inquire (netcdf::nf90_inquire)
nf90_inquire_dimension (netcdf::nf90_inquire_dimension)
nf90_inquire_variable (netcdf::nf90_inquire_variable)
- function get_netcdf_filename(handle)
Return the name of a file from a netCDF handle
- Parameters
handle [in]
A netCDF file handle
get_netcdf_filename
The name of the file that this handle refers to.
- subroutine read_netcdf_field(handle, field, values, bounds)
Read the values of a field from a netCDF file
External calls
- netcdf
nf90_get_var (netcdf::nf90_get_var)
- subroutine 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
start
Time axis start index array
rc
netCDF return code
Callers call graph
Text view
mom_netcdf::write_netcdf_field_0d → mom_netcdf::update_netcdf_timestep
mom_netcdf::write_netcdf_field_1d → mom_netcdf::update_netcdf_timestep
mom_netcdf::write_netcdf_field_2d → mom_netcdf::update_netcdf_timestep
mom_netcdf::write_netcdf_field_3d → mom_netcdf::update_netcdf_timestep
mom_netcdf::write_netcdf_field_4d → mom_netcdf::update_netcdf_timestep
External calls
- netcdf
nf90_put_var (netcdf::nf90_put_var)
- subroutine 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)
Callers call graph
Text view
mom_netcdf::close_netcdf_file → mom_netcdf::check_netcdf_call
mom_netcdf::enable_netcdf_write → mom_netcdf::check_netcdf_call
mom_netcdf::flush_netcdf_file → mom_netcdf::check_netcdf_call
mom_netcdf::get_netcdf_fields → mom_netcdf::check_netcdf_call
mom_netcdf::open_netcdf_file → mom_netcdf::check_netcdf_call
mom_netcdf::read_netcdf_field → mom_netcdf::check_netcdf_call
mom_netcdf::register_netcdf_axis → mom_netcdf::check_netcdf_call
mom_netcdf::register_netcdf_field → mom_netcdf::check_netcdf_call
mom_netcdf::update_netcdf_timestep → mom_netcdf::check_netcdf_call
mom_netcdf::write_netcdf_attribute → mom_netcdf::check_netcdf_call
mom_netcdf::write_netcdf_axis → mom_netcdf::check_netcdf_call
mom_netcdf::write_netcdf_field_0d → mom_netcdf::check_netcdf_call
mom_netcdf::write_netcdf_field_1d → mom_netcdf::check_netcdf_call
mom_netcdf::write_netcdf_field_2d → mom_netcdf::check_netcdf_call
mom_netcdf::write_netcdf_field_3d → mom_netcdf::check_netcdf_call
mom_netcdf::write_netcdf_field_4d → mom_netcdf::check_netcdf_call
External calls
- netcdf
nf90_strerror (netcdf::nf90_strerror)