mom_io module reference
This module contains I/O framework code.
Data Types
Type that stores information that can be used to create a non-decomposed axis. |
|
Type for describing a 3-d variable for output. |
|
Type that stores for a global file attribute. |
Functions/Subroutines
|
|
|
|
This routine opens an existing NetCDF file for output. |
|
Return the index of sdtout if called from the root PE, or 0 for other PEs. |
|
This function determines how many time levels a variable has in a file. |
|
get_var_sizes returns the number and size of dimensions associate with a variable in a file. Usually only the root PE does the read, and then the information is broadcast |
|
read_var_sizes returns the number and size of dimensions associated with a variable in a file. If the variable is not in the file the returned sizes are all 0 and ndims is -1. Every processor for which this is called does the reading. |
|
Read a real scalar variable from a netCDF file with the root PE, and broadcast the results to all the other PEs. |
|
Read a 1-d real variable from a netCDF file with the root PE, and broadcast the results to all the other PEs. |
|
Read a integer scalar variable from a netCDF file with the root PE, and broadcast the results to all the other PEs. |
|
Read a 1-d integer variable from a netCDF file with the root PE, and broadcast the results to all the other PEs. |
|
Read a 2d array from a netCDF input file and save to a variable. |
|
Read a character-string global or variable attribute. |
|
Read a 32-bit integer global or variable attribute. |
|
Read a 64-bit integer global or variable attribute. |
|
Read a real global or variable attribute. |
|
Open a netcdf file for reading, with error handling. |
|
Close a netcdf file that had been opened for reading, with error handling. |
|
get_varid finds the netcdf handle for the potentially case-insensitive variable name in a file |
|
Verify that a file contains a named variable with the expected units. |
|
Returns a vardesc type whose elements have been filled with the provided fields. |
|
This routine modifies the named elements of a vardesc type. |
|
Store information that can be used to create an axis in a subsequent call to create_file. |
|
Delete the information in an array of |
|
Retrieve the information from an |
|
Store information that can be used to create an attribute in a subsequent call to create_file. |
|
Delete the information in an array of |
|
This function returns the CMOR standard name given a CMOR longname, based on the standard pattern of character conversions. |
|
This routine queries vardesc. |
|
Read a scalar from file using infrastructure I/O. |
|
Read a scalar integer from file using infrastructure I/O. |
|
Read a 1d array from file using infrastructure I/O. |
|
Read a 1d integer array from file using infrastructure I/O. |
|
Read a 2d array from file using infrastructure I/O. |
|
Read a 2d array (which might have halos) from a file using native netCDF I/O. |
|
Read a 2d region array from file using infrastructure I/O. |
|
Read a 3d array from file using infrastructure I/O. |
|
Read a 3d region array from file using infrastructure I/O. |
|
Read a 4d array from file using infrastructure I/O. |
|
Read a 2d vector tuple from file using infrastructure I/O. |
|
Read a 3d vector tuple from file using infrastructure I/O. |
|
Write a 4d field to an output file, potentially with rotation. |
|
Write a 3d field to an output file, potentially with rotation. |
|
Write a 2d field to an output file, potentially with rotation. |
|
Write a 1d field to an output file. |
|
Write a 0d field to an output file. |
|
Write a 4d field to an output file, potentially with rotation. |
|
Write a 3d field to an output file, potentially with rotation. |
|
Write a 2d field to an output file, potentially with rotation. |
|
Write a 1d field to an output file. |
|
Write a 0d field to an output file. |
|
Given filename and fieldname, this subroutine returns the size of the field in the file. |
|
Copies a string. |
|
Returns a name with "%#E" or "%E" replaced with the ensemble member number. |
|
Provide a string to append to filenames, to differentiate ensemble members, for example. |
|
Write a file version number to the log file or other output file. |
|
Open a single namelist file that is potentially readable by all PEs. |
|
Checks the iostat argument that is returned after reading a namelist variable and writes a message if there is an error. |
|
Initialize the MOM_io module. |
|
Returns the dimension variable information for a netCDF variable. |
Detailed Description
This file contains a number of subroutines that manipulate NetCDF files and handle input and output of fields. These subroutines, along with their purpose, are:
create_file: create a new file and set up structures that are needed for subsequent output and write out the coordinates.
reopen_file: reopen an existing file for writing and set up structures that are needed for subsequent output.
open_input_file: open the indicated file for reading only.
close_file: close an open file.
synch_file: flush the buffers, completing all pending output.
write_field: write a field to an open file.
write_time: write a value of the time axis to an open file.
read_data: read a variable from an open file.
read_time: read a time from an open file.
name_output_file: provide a name for an output file based on a name root and the time of the output.
find_input_file: find a file that has been previously written by MOM and named by name_output_file and open it for reading.
handle_error: write an error code and quit.
Type Documentation
- type mom_io/axis_info
Type that stores information that can be used to create a non-decomposed axis.
- Type fields:
% name ::
character(len=32), privateThe name of this axis for use in files.% longname ::
character(len=256), privateA longer name describing this axis.% units ::
character(len=48), privateThe units of the axis labels.% cartesian ::
character(len=8), privateA variable indicating which direction this axis corresponds with. Valid values include ‘X’, ‘Y’, ‘Z’, ‘T’, and ‘N’ for none.% sense ::
integer, privateThis is 1 for axes whose values increase upward, or -1 if they increase downward. The default, 0, is ignored.% ax_size ::
integer, privateThe number of elements in this axis.% ax_data ::
real, dimension(:), allocatable, privateThe values of the data on the axis [arbitrary].
- type mom_io/vardesc
Type for describing a 3-d variable for output.
- Type fields:
% name ::
character(len=64)Variable name in a NetCDF file.% units ::
character(len=48)Physical dimensions of the variable.% longname ::
character(len=240)Long name of the variable.% hor_grid ::
character(len=8)Horizontal grid: u, v, h, q, Cu, Cv, T, Bu, or 1.% z_grid ::
character(len=8)Vertical grid: L, i, or 1.% t_grid ::
character(len=8)Time description: s, p, or 1.% cmor_field_name ::
character(len=64)CMOR name.% cmor_units ::
character(len=64)CMOR physical dimensions of the variable.% cmor_longname ::
character(len=240)CMOR long name of the variable.% conversion ::
realfor unit conversions, such as needed to convert from intensive to extensive [various] or [a A-1 ~> 1] to undo internal dimensional rescaling% dim_names ::
character(len=32), dimension(5)The names in the file of the axes for this variable.% position ::
integerAn integer encoding the horizontal position, it may CENTER, CORNER, EAST_FACE, NORTH_FACE, or 0.% extra_axes ::
type(axis_info), dimension(5)dimensions other than space-time
Function/Subroutine Documentation
- subroutine mom_io/create_file(IO_handle, filename, vars, novars, fields, threading, timeunit, G, dG, GV, checksums, extra_axes, global_atts)
create_MOM_filewrapper for the legacy file handle,file_type. NOTE: This function may be removed in a future release.- Parameters:
io_handle :: [inout] Handle for a files or fileset that is to be opened or reopened for writing
filename ::
filename[in] full path to the file to createvars ::
vars[in] structures describing fields written to filenamenovars ::
novars[in] number of fields written to filenamefields ::
fields[inout] array of fieldtypes for each variablethreading ::
threading[in] SINGLE_FILE or MULTIPLEtimeunit ::
timeunit[in] length of the units for time [s]. The default value is 86400.0, for 1 day.g :: [in] ocean horizontal grid structure; G or dG is required if the new file uses any horizontal grid axes.
dg :: [in] dynamic horizontal grid structure; G or dG is required if the new file uses any horizontal grid axes.
gv :: [in] ocean vertical grid structure, which is ! required if the new file uses any vertical grid axes.
checksums ::
checksums[in] checksums of varsextra_axes ::
extra_axes[in] Types with information about some axes that might be used in this fileglobal_atts ::
global_atts[in] Global attributes to write to this file
- Call to:
- subroutine mom_io/create_mom_file(IO_handle, filename, vars, novars, fields, threading, timeunit, G, dG, GV, checksums, extra_axes, global_atts)
- Parameters:
io_handle :: [inout] Handle for a files or fileset that is to be opened or reopened for writing
filename ::
filename[in] full path to the file to createvars ::
vars[in] structures describing fields written to filenamenovars ::
novars[in] number of fields written to filenamefields ::
fields[inout] array of fieldtypes for each variablethreading ::
threading[in] SINGLE_FILE or MULTIPLEtimeunit ::
timeunit[in] length of the units for time [s]. The default value is 86400.0, for 1 day.g :: [in] ocean horizontal grid structure; G or dG is required if the new file uses any horizontal grid axes.
dg :: [in] dynamic horizontal grid structure; G or dG is required if the new file uses any horizontal grid axes.
gv :: [in] ocean vertical grid structure, which is required if the new file uses any vertical grid axes.
checksums ::
checksums[in] checksums of varsextra_axes ::
extra_axes[in] Types with information aboutglobal_atts ::
global_atts[in] Global attributes to write to this file
- Call to:
mom_string_functions::lowercasemom_error_handler::mom_errorposition_from_horgrid- Called from:
create_filemom_harmonic_analysis::ha_writereopen_mom_filemom_self_attr_load::sal_init
- subroutine mom_io/reopen_file(IO_handle, filename, vars, novars, fields, threading, timeunit, G, dG, GV, extra_axes, global_atts)
reopen_MOM_filewrapper for the legacy file handle,file_type. NOTE: This function may be removed in a future release.- Parameters:
io_handle :: [inout] Handle for a file or fileset that is to be opened or reopened for writing
filename ::
filename[in] full path to the file to createvars ::
vars[in] structures describing fields written to filenamenovars ::
novars[in] number of fields written to filenamefields ::
fields[inout] array of fieldtypes for each variablethreading ::
threading[in] SINGLE_FILE or MULTIPLEtimeunit ::
timeunit[in] length of the units for time [s]. The default value is 86400.0, for 1 day.g :: [in] ocean horizontal grid structure; G or dG is required if a new file uses any horizontal grid axes.
dg :: [in] dynamic horizontal grid structure; G or dG is required if a new file uses any horizontal grid axes.
gv :: [in] ocean vertical grid structure, which is required if a new file uses any vertical grid axes.
extra_axes ::
extra_axes[in] Types with information about some axes that might be used in this fileglobal_atts ::
global_atts[in] Global attributes to write to this file
- Call to:
- subroutine mom_io/reopen_mom_file(IO_handle, filename, vars, novars, fields, threading, timeunit, G, dG, GV, extra_axes, global_atts)
This routine opens an existing NetCDF file for output. If it does not find the file, a new file is created. It also sets up structures that describe this file and the variables that will later be written to this file.
- Parameters:
io_handle :: [inout] Handle for a file or fileset that is to be opened or reopened for writing
filename ::
filename[in] full path to the file to createvars ::
vars[in] structures describing fields written to filenamenovars ::
novars[in] number of fields written to filenamefields ::
fields[inout] array of fieldtypes for each variablethreading ::
threading[in] SINGLE_FILE or MULTIPLEtimeunit ::
timeunit[in] length of the units for time [s]. The default value is 86400.0, for 1 day.g :: [in] ocean horizontal grid structure; G or dG is required if a new file uses any horizontal grid axes.
dg :: [in] dynamic horizontal grid structure; G or dG is required if a new file uses any horizontal grid axes.
gv :: [in] ocean vertical grid structure, which is required if a new file uses any vertical grid axes.
extra_axes ::
extra_axes[in] Types with information about some axes that might be used in this fileglobal_atts ::
global_atts[in] Global attributes to write to this file
- Call to:
- Called from:
- function mom_io/stdout_if_root()
Return the index of sdtout if called from the root PE, or 0 for other PEs.
- Call to:
stdout- Called from:
mom_surface_forcing_gfdl::ice_ocn_bnd_type_chksumocean_model_mod::ocean_public_type_chksum
- function mom_io/num_timelevels(filename, varname, min_dims)
This function determines how many time levels a variable has in a file.
- Parameters:
filename ::
filename[in] name of the file to readvarname ::
varname[in] variable whose number of time levels are to be returnedmin_dims ::
min_dims[in] The minimum number of dimensions a variable must have if it has a time dimension. If the variable has 1 less dimension than this, then 0 is returned.
- Return:
undefined :: number of time levels varname has in filename
- Call to:
- Called from:
- subroutine mom_io/get_var_sizes(filename, varname, ndims, sizes, match_case, caller, all_read, dim_names, ncid_in)
get_var_sizes returns the number and size of dimensions associate with a variable in a file. Usually only the root PE does the read, and then the information is broadcast
- Parameters:
filename ::
filename[in] Name of the file to read, used here in messagesvarname ::
varname[in] The variable name, used here for messagesndims ::
ndims[out] The number of dimensions to the variablesizes ::
sizes[out] The dimension sizes, or 0 for extra valuesmatch_case ::
match_case[in] If false, allow for variables name matches to be case insensitive, but take a perfect match if found. The default is true.caller ::
caller[in] The name of a calling routine for use in error messagesall_read ::
all_read[in] If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then it broadcasts the results.dim_names ::
dim_names[out] The names of the dimensions for this variablencid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routine.
- Call to:
- Called from:
- subroutine mom_io/read_var_sizes(filename, varname, ndims, sizes, match_case, caller, dim_names, ncid_in)
read_var_sizes returns the number and size of dimensions associated with a variable in a file. If the variable is not in the file the returned sizes are all 0 and ndims is -1. Every processor for which this is called does the reading.
- Parameters:
filename ::
filename[in] Name of the file to read, used here in messagesvarname ::
varname[in] The variable name, used here for messagesndims ::
ndims[out] The number of dimensions to the variablesizes ::
sizes[out] The dimension sizes, or 0 for extra valuesmatch_case ::
match_case[in] If false, allow for variables name matches to be case insensitive, but take a perfect match if found. The default is true.caller ::
caller[in] The name of a calling routine for use in error messagesdim_names ::
dim_names[out] The names of the dimensions for this variablencid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routine.
- Call to:
close_file_to_readget_varidmom_error_handler::mom_erroropen_file_to_read- Called from:
- subroutine mom_io/read_variable_0d(filename, varname, var, ncid_in, scale)
Read a real scalar variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.
- Parameters:
filename ::
filename[in] The name of the file to readvarname ::
varname[in] The variable name of the data in the filevar ::
var[inout] The scalar into which to read the data in arbitrary units [A ~> a]ncid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routinescale ::
scale[in] A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]
- subroutine mom_io/read_variable_1d(filename, varname, var, ncid_in, scale)
Read a 1-d real variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.
- Parameters:
filename ::
filename[in] The name of the file to readvarname ::
varname[in] The variable name of the data in the filevar ::
var[inout] The 1-d array into which to read the data in arbitrary units [A ~> a]ncid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routinescale ::
scale[in] A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]
- subroutine mom_io/read_variable_0d_int(filename, varname, var, ncid_in)
Read a integer scalar variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.
- Parameters:
filename ::
filename[in] The name of the file to readvarname ::
varname[in] The variable name of the data in the filevar ::
var[inout] The scalar into which to read the datancid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routine.
- subroutine mom_io/read_variable_1d_int(filename, varname, var, ncid_in)
Read a 1-d integer variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.
- Parameters:
filename ::
filename[in] The name of the file to readvarname ::
varname[in] The variable name of the data in the filevar ::
var[inout] The 1-d array into which to read the datancid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routine.
- subroutine mom_io/read_variable_2d(filename, varname, var, start, nread, ncid_in)
Read a 2d array from a netCDF input file and save to a variable.
Start and nread lenths may exceed var rank. This allows for reading slices of larger arrays.
Previous versions of the model required a time axis on IO fields. This constraint was dropped in later versions. As a result, versions both with and without a time axis now exist. In order to support all such versions, we use a reshaped version of start and nread in order to read the variable as it exists in the file.
Certain constraints are still applied to start and nread in order to ensure that varname is a valid 2d array, or contains valid 2d slices.
I/O occurs only on the root PE, and data is broadcast to other ranks. Due to potentially large memory communication and storage, this subroutine should only be used when domain-decomposition is unavaialable.
- Parameters:
filename ::
filename[in] Name of file to be readvarname ::
varname[in] Name of variable to be readvar ::
var[out] Output array of variable [arbitrary]start ::
start[in] Starting index on each axis.nread ::
nread[in] Number of values to be read along each axisncid_in ::
ncid_in[in] netCDF ID of an opened file. If absent, the file is opened and closed within this routine.
- subroutine mom_io/read_variable_3d(filename, varname, var, start, nread, ncid_in)
- Parameters:
filename ::
filename[in] Name of file to be readvarname ::
varname[in] Name of variable to be readvar ::
var[out] Output array of variable [arbitrary]start ::
start[in] Starting index on each axis.nread ::
nread[in] Number of values to be read along each axisncid_in ::
ncid_in[in] netCDF ID of an opened file. If absent, the file is opened and closed within this routine.
- subroutine mom_io/read_attribute_str(filename, attname, att_val, varname, found, all_read, ncid_in)
Read a character-string global or variable attribute.
- Parameters:
filename ::
filename[in] Name of the file to readattname ::
attname[in] Name of the attribute to readatt_val ::
att_val[out] The value of the attributevarname ::
varname[in] The name of the variable whose attribute will be read. If missing, read a global attribute.found ::
found[out] Returns true if the attribute is foundall_read ::
all_read[in] If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then broadcasts the results.ncid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routine.
- subroutine mom_io/read_attribute_int32(filename, attname, att_val, varname, found, all_read, ncid_in)
Read a 32-bit integer global or variable attribute.
- Parameters:
filename ::
filename[in] Name of the file to readattname ::
attname[in] Name of the attribute to readatt_val ::
att_val[out] The value of the attributevarname ::
varname[in] The name of the variable whose attribute will be read. If missing, read a global attribute.found ::
found[out] Returns true if the attribute is foundall_read ::
all_read[in] If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then broadcasts the results.ncid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routine.
- subroutine mom_io/read_attribute_int64(filename, attname, att_val, varname, found, all_read, ncid_in)
Read a 64-bit integer global or variable attribute.
- Parameters:
filename ::
filename[in] Name of the file to readattname ::
attname[in] Name of the attribute to readatt_val ::
att_val[out] The value of the attributevarname ::
varname[in] The name of the variable whose attribute will be read. If missing, read a global attribute.found ::
found[out] Returns true if the attribute is foundall_read ::
all_read[in] If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then broadcasts the results.ncid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routine.
- subroutine mom_io/read_attribute_real(filename, attname, att_val, varname, found, all_read, ncid_in)
Read a real global or variable attribute.
- Parameters:
filename ::
filename[in] Name of the file to readattname ::
attname[in] Name of the attribute to readatt_val ::
att_val[out] The value of the attribute [arbitrary]varname ::
varname[in] The name of the variable whose attribute will be read. If missing, read a global attribute.found ::
found[out] Returns true if the attribute is foundall_read ::
all_read[in] If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then broadcasts the results.ncid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routine.
- subroutine mom_io/open_file_to_read(filename, ncid, success)
Open a netcdf file for reading, with error handling.
- Parameters:
filename ::
filename[in] path and name of the file to open for readingncid ::
ncid[out] The netcdf handle for the filesuccess ::
success[out] Returns true if the file was opened, or if this argument is not present, failure is fatal error.
- Call to:
- Called from:
get_var_axes_infomom_io::read_attribute::read_attribute_int32mom_io::read_attribute::read_attribute_int64mom_io::read_attribute::read_attribute_realmom_io::read_attribute::read_attribute_strread_var_sizesmom_io::read_variable::read_variable_0dmom_io::read_variable::read_variable_0d_intmom_io::read_variable::read_variable_1dmom_io::read_variable::read_variable_1d_intmom_io::read_variable::read_variable_2dmom_io::read_variable::read_variable_3dmom_tracer_z_init::read_z_edgesverify_variable_units
- subroutine mom_io/close_file_to_read(ncid, filename)
Close a netcdf file that had been opened for reading, with error handling.
- Parameters:
ncid ::
ncid[inout] The netcdf handle for the file to closefilename ::
filename[in] path and name of the file to close
- Call to:
- Called from:
get_var_axes_infomom_io::read_attribute::read_attribute_int32mom_io::read_attribute::read_attribute_realmom_io::read_attribute::read_attribute_strread_var_sizesmom_io::read_variable::read_variable_0dmom_io::read_variable::read_variable_0d_intmom_io::read_variable::read_variable_1dmom_io::read_variable::read_variable_1d_intmom_io::read_variable::read_variable_2dmom_io::read_variable::read_variable_3dmom_tracer_z_init::read_z_edges
- subroutine mom_io/get_varid(varname, ncid, filename, varid, match_case, found)
get_varid finds the netcdf handle for the potentially case-insensitive variable name in a file
- Parameters:
varname ::
varname[in] The name of the variable that is being soughtncid ::
ncid[in] The open netcdf handle for the filefilename ::
filename[in] name of the file to read, used here in messagesvarid ::
varid[out] The netcdf handle for the variablematch_case ::
match_case[in] If false, allow for variables name matches to be case insensitive, but take a perfect match if found. The default is true.found ::
found[out] Returns true if the attribute is found
- Call to:
mom_string_functions::lowercasemom_error_handler::mom_error- Called from:
mom_io::read_attribute::read_attribute_int32mom_io::read_attribute::read_attribute_int64mom_io::read_attribute::read_attribute_realmom_io::read_attribute::read_attribute_strread_var_sizesmom_io::read_variable::read_variable_0dmom_io::read_variable::read_variable_0d_intmom_io::read_variable::read_variable_1dmom_io::read_variable::read_variable_1d_intmom_io::read_variable::read_variable_2dmom_io::read_variable::read_variable_3d
- subroutine mom_io/verify_variable_units(filename, varname, expected_units, msg, ierr, alt_units)
Verify that a file contains a named variable with the expected units.
- Parameters:
filename ::
filename[in] File namevarname ::
varname[in] Variable nameexpected_units ::
expected_units[in] Expected units of variablemsg ::
msg[inout] Message to use for errorsierr ::
ierr[out] True if an error occursalt_units ::
alt_units[in] Alterate acceptable units of variable
- Call to:
- Called from:
- function mom_io/var_desc(name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, cmor_longname, conversion, caller, position, dim_names, extra_axes, fixed)
Returns a vardesc type whose elements have been filled with the provided fields. The argument name is required, while the others are optional and have default values that are empty strings or are appropriate for a 3-d tracer field at the tracer cell centers.
- Parameters:
name ::
name[in] variable nameunits ::
units[in] variable unitslongname ::
longname[in] variable long namehor_grid ::
hor_grid[in] A character string indicating the horizontal position of this variablez_grid ::
z_grid[in] variable vertical staggeringt_grid ::
t_grid[in] time description: s, p, or 1cmor_field_name ::
cmor_field_name[in] CMOR namecmor_units ::
cmor_units[in] CMOR physical dimensions of variablecmor_longname ::
cmor_longname[in] CMOR long nameconversion ::
conversion[in] for unit conversions, such as needed to convert from intensive to extensive [various] or [a A-1 ~> 1]caller ::
caller[in] The calling routine for error messagesposition ::
position[in] A coded integer indicating the horizontal position of this variable if it has such dimensions. Valid values include CORNER, CENTER, EAST_FACE NORTH_FACE, and 0 for no horizontal dimensions.dim_names ::
dim_names[in] The names of the dimensions of this variableextra_axes ::
extra_axes[in] dimensions other than space-timefixed ::
fixed[in] If true, this does not evolve with time
- Return:
undefined :: vardesc type that is created
- Call to:
- Called from:
mom_harmonic_analysis::ha_writemom_oda_incupd::output_oda_incupd_incadvection_test_tracer::register_advection_test_tracermom_barotropic::register_barotropic_restartsboundary_impulse_tracer::register_boundary_impulse_tracermom_cfc_cap::register_cfc_capdome_tracer::register_dome_tracerregional_dyes::register_dye_tracerdyed_obc_tracer::register_dyed_obc_tracerideal_age_example::register_ideal_age_tracerisomip_tracer::register_isomip_tracermarbl_tracers::register_marbl_tracersnw2_tracers::register_nw2_tracersmom_ocmip2_cfc::register_ocmip2_cfcoil_tracer::register_oil_tracerpseudo_salt_tracer::register_pseudo_salt_tracermom_dynamics_split_rk2::register_restarts_dyn_split_rk2mom_dynamics_split_rk2b::register_restarts_dyn_split_rk2brgc_tracer::register_rgc_tracermom_self_attr_load::sal_initmom_set_visc::set_visc_register_restartsuser_tracer_example::user_register_tracer_examplemom_wave_interface::waves_register_restartsmom_hybgen_regrid::write_hybgen_coord_filemom_coord_initialization::write_vertgrid_file
- subroutine mom_io/modify_vardesc(vd, name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, cmor_longname, conversion, caller, position, dim_names, extra_axes)
This routine modifies the named elements of a vardesc type. All arguments are optional, except the vardesc type to be modified.
- Parameters:
vd ::
vd[inout] vardesc type that is modifiedname ::
name[in] name of variableunits ::
units[in] units of variablelongname ::
longname[in] long name of variablehor_grid ::
hor_grid[in] horizontal staggering of variablez_grid ::
z_grid[in] vertical staggering of variablet_grid ::
t_grid[in] time description: s, p, or 1cmor_field_name ::
cmor_field_name[in] CMOR namecmor_units ::
cmor_units[in] CMOR physical dimensions of variablecmor_longname ::
cmor_longname[in] CMOR long nameconversion ::
conversion[in] A multiplicative factor for unit conversions, such as needed to convert from intensive to extensive or dimensional consistency testing [various] or [a A-1 ~> 1]caller ::
caller[in] The calling routine for error messagesposition ::
position[in] A coded integer indicating the horizontal position of this variable if it has such dimensions. Valid values include CORNER, CENTER, EAST_FACE NORTH_FACE, and 0 for no horizontal dimensions.dim_names ::
dim_names[in] The names of the dimensions of this variableextra_axes ::
extra_axes[in] dimensions other than space-time
- Call to:
mom_error_handler::mom_errorposition_from_horgridsafe_string_copy- Called from:
- function mom_io/position_from_horgrid(hor_grid)
- Parameters:
hor_grid ::
hor_grid[in] horizontal staggering of variable- Called from:
- subroutine mom_io/set_axis_info(axis, name, units, longname, ax_size, ax_data, cartesian, sense)
Store information that can be used to create an axis in a subsequent call to create_file.
- Parameters:
axis ::
axis[inout] A type with information about a named axisname ::
name[in] The name of this axis for use in filesunits ::
units[in] The units of the axis labelslongname ::
longname[in] Long name of the axis variableax_size ::
ax_size[in] The number of elements in this axisax_data ::
ax_data[in] The values of the data on the axis [arbitrary]cartesian ::
cartesian[in] A variable indicating which direction this axis axis corresponds with. Valid values include ‘X’, ‘Y’, ‘Z’, ‘T’, and ‘N’ (the default) for none.sense ::
sense[in] This is 1 for axes whose values increase upward, or -1 if they increase downward. The default, 0, is ignored.
- Call to:
- Called from:
mom_streaming_filter::filt_registermom_interpolate::get_external_field_infoget_var_axes_infoquery_vardescmom_internal_tides::register_int_tide_restarts
- subroutine mom_io/delete_axis_info(axes)
Delete the information in an array of
axis_info()types and deallocate memory in them. types and deallocate memory in them.- Parameters:
axes ::
axes[inout] An array with information about named axes
- subroutine mom_io/get_axis_info(axis, name, longname, units, cartesian, ax_size, ax_data)
Retrieve the information from an
axis_info()type. type.- Parameters:
axis ::
axis[in] An axis typename ::
name[out] The axis name.longname ::
longname[out] The axis longname.units ::
units[out] The axis units.cartesian ::
cartesian[out] The cartesian attribute of the axis [X,Y,Z,T].ax_size ::
ax_size[out] The size of the axis.ax_data ::
ax_data[out] The axis label data [arbitrary]
- subroutine mom_io/set_attribute_info(attribute, name, str_value)
Store information that can be used to create an attribute in a subsequent call to create_file.
- Parameters:
attribute ::
attribute[inout] A type with information about a named attributename ::
name[in] The name of this attribute for use in filesstr_value ::
str_value[in] The value of this attribute
- subroutine mom_io/delete_attribute_info(atts)
Delete the information in an array of
attribute_info()types and deallocate memory in them. types and deallocate memory in them.- Parameters:
atts ::
atts[inout] An array of global attributes
- function mom_io/cmor_long_std(longname)
This function returns the CMOR standard name given a CMOR longname, based on the standard pattern of character conversions.
- Parameters:
longname ::
longname[in] The CMOR longname being converted- Return:
undefined :: The CMOR standard name generated from longname
- Call to:
- Called from:
- subroutine mom_io/query_vardesc(vd, name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, cmor_longname, conversion, caller, extra_axes, position, dim_names)
This routine queries vardesc.
- Parameters:
vd ::
vd[in] vardesc type that is queriedname ::
name[out] name of variableunits ::
units[out] units of variablelongname ::
longname[out] long name of variablehor_grid ::
hor_grid[out] horizontal staggering of variablez_grid ::
z_grid[out] verticle staggering of variablet_grid ::
t_grid[out] time description: s, p, or 1cmor_field_name ::
cmor_field_name[out] CMOR namecmor_units ::
cmor_units[out] CMOR physical dimensions of variablecmor_longname ::
cmor_longname[out] CMOR long nameconversion ::
conversion[out] for unit conversions, such as needed to convert from intensive to extensive [various] or [a A-1 ~> 1]caller ::
caller[in] calling routine?extra_axes ::
extra_axes[out] dimensions other than space-timeposition ::
position[out] A coded integer indicating the horizontal position of this variable if it has such dimensions. Valid values include CORNER, CENTER, EAST_FACE NORTH_FACE, and 0 for no horizontal dimensions.dim_names ::
dim_names[out] The names of the dimensions of this variable
- Call to:
- Called from:
advection_test_tracer::advection_test_stockboundary_impulse_tracer::boundary_impulse_stockmom_cfc_cap::cfc_cap_stockregional_dyes::dye_stockideal_age_example::ideal_age_stockadvection_test_tracer::initialize_advection_test_tracerboundary_impulse_tracer::initialize_boundary_impulse_tracerdome_tracer::initialize_dome_tracerdyed_obc_tracer::initialize_dyed_obc_tracerideal_age_example::initialize_ideal_age_tracerisomip_tracer::initialize_isomip_tracermarbl_tracers::initialize_marbl_tracersoil_tracer::initialize_oil_tracerpseudo_salt_tracer::initialize_pseudo_salt_tracerrgc_tracer::initialize_rgc_tracermarbl_tracers::marbl_tracers_stockmom_ocmip2_cfc::ocmip2_cfc_stockoil_tracer::oil_stockpseudo_salt_tracer::pseudo_salt_stockboundary_impulse_tracer::register_boundary_impulse_tracerregional_dyes::register_dye_tracerideal_age_example::register_ideal_age_tracermarbl_tracers::register_marbl_tracersoil_tracer::register_oil_tracerpseudo_salt_tracer::register_pseudo_salt_tracermom_tracer_registry::register_traceruser_tracer_example::user_initialize_traceruser_tracer_example::user_tracer_stock
- subroutine mom_io/mom_read_data_0d(filename, fieldname, data, timelevel, scale, MOM_Domain, global_file, file_may_be_4d)
Read a scalar from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namedata ::
data[inout] Field value in arbitrary units [A ~> a]timelevel ::
timelevel[in] Time level to read in filescale ::
scale[in] A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]mom_domain :: [in] Model domain decomposition
global_file ::
global_file[in] If true, read from a single filefile_may_be_4d ::
file_may_be_4d[in] If true, fields may be stored as 4d arrays in the file.
- subroutine mom_io/mom_read_data_0d_int(filename, fieldname, data, timelevel)
Read a scalar integer from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namedata ::
data[inout] Field valuetimelevel ::
timelevel[in] Time level to read in file
- subroutine mom_io/mom_read_data_1d(filename, fieldname, data, timelevel, scale, MOM_Domain, global_file, file_may_be_4d)
Read a 1d array from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namedata ::
data[inout] Field value in arbitrary units [A ~> a]timelevel ::
timelevel[in] Time level to read in filescale ::
scale[in] A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]mom_domain :: [in] Model domain decomposition
global_file ::
global_file[in] If true, read from a single filefile_may_be_4d ::
file_may_be_4d[in] If true, fields may be stored as 4d arrays in the file.
- subroutine mom_io/mom_read_data_1d_int(filename, fieldname, data, timelevel)
Read a 1d integer array from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namedata ::
data[inout] Field valuetimelevel ::
timelevel[in] Time level to read in file
- subroutine mom_io/mom_read_data_2d(filename, fieldname, data, MOM_Domain, timelevel, position, scale, global_file, file_may_be_4d, turns)
Read a 2d array from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namedata ::
data[inout] Field value in arbitrary units [A ~> a]mom_domain :: [in] Model domain decomposition
timelevel ::
timelevel[in] Time level to read in fileposition ::
position[in] Grid positioning flagscale ::
scale[in] A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]global_file ::
global_file[in] If true, read from a single filefile_may_be_4d ::
file_may_be_4d[in] If true, fields may be stored as 4d arrays in the file.turns ::
turns[in] Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.
- subroutine mom_io/read_netcdf_data_2d(filename, fieldname, values, MOM_Domain, timelevel, position, rescale, turns)
Read a 2d array (which might have halos) from a file using native netCDF I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namevalues ::
values[inout] Field values read from the file. It would be intent(out) but for the need to preserve any initialized values in the halo regions.mom_domain :: [in] Model domain decomposition
timelevel ::
timelevel[in] Time level to read in fileposition ::
position[in] Grid positioning flagrescale ::
rescale[in] Rescale factor, omitting this is the same as setting it to 1.turns ::
turns[in] Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.
- subroutine mom_io/mom_read_data_2d_region(filename, fieldname, data, start, nread, MOM_domain, no_domain, scale, turns)
Read a 2d region array from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namedata ::
data[inout] Field value in arbitrary units [A ~> a]start ::
start[in] Starting index for each axis. In 2d, start(3:4) must be 1.nread ::
nread[in] Number of values to read along each axis. In 2d, nread(3:4) must be 1.mom_domain :: [in] Model domain decomposition
no_domain ::
no_domain[in] If true, field does not use domain decomposion.scale ::
scale[in] A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]turns ::
turns[in] Number of quarter turns from input to model grid
- subroutine mom_io/mom_read_data_3d(filename, fieldname, data, MOM_Domain, timelevel, position, scale, global_file, file_may_be_4d, turns)
Read a 3d array from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namedata ::
data[inout] Field value in arbitrary units [A ~> a]mom_domain :: [in] Model domain decomposition
timelevel ::
timelevel[in] Time level to read in fileposition ::
position[in] Grid positioning flagscale ::
scale[in] A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]global_file ::
global_file[in] If true, read from a single filefile_may_be_4d ::
file_may_be_4d[in] If true, fields may be stored as 4d arrays in the file.turns ::
turns[in] Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.
- subroutine mom_io/mom_read_data_3d_region(filename, fieldname, data, start, nread, MOM_domain, no_domain, scale, turns)
Read a 3d region array from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namedata ::
data[inout] Field value in arbitrary units [A ~> a]start ::
start[in] Starting index for each axis.nread ::
nread[in] Number of values to read along each axis.mom_domain :: [in] Model domain decomposition
no_domain ::
no_domain[in] If true, field does not use domain decomposion.scale ::
scale[in] A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]turns ::
turns[in] Number of quarter turns from input to model grid
- subroutine mom_io/mom_read_data_4d(filename, fieldname, data, MOM_Domain, timelevel, position, scale, global_file, turns)
Read a 4d array from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenamefieldname ::
fieldname[in] Field variable namedata ::
data[inout] Field value in arbitrary units [A ~> a]mom_domain :: [in] Model domain decomposition
timelevel ::
timelevel[in] Time level to read in fileposition ::
position[in] Grid positioning flagscale ::
scale[in] A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]global_file ::
global_file[in] If true, read from a single fileturns ::
turns[in] Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.
- subroutine mom_io/mom_read_vector_2d(filename, u_fieldname, v_fieldname, u_data, v_data, MOM_Domain, timelevel, stagger, scalar_pair, scale, turns)
Read a 2d vector tuple from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenameu_fieldname ::
u_fieldname[in] Field variable name in uv_fieldname ::
v_fieldname[in] Field variable name in vu_data ::
u_data[inout] Field value at u points in arbitrary units [A ~> a]v_data ::
v_data[inout] Field value at v points in arbitrary units [A ~> a]mom_domain :: [in] Model domain decomposition
timelevel ::
timelevel[in] Time level to read in filestagger ::
stagger[in] Grid staggering flagscalar_pair ::
scalar_pair[in] True if tuple is not a vectorscale ::
scale[in] A scaling factor that the vector is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]turns ::
turns[in] Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.
- subroutine mom_io/mom_read_vector_3d(filename, u_fieldname, v_fieldname, u_data, v_data, MOM_Domain, timelevel, stagger, scalar_pair, scale, turns)
Read a 3d vector tuple from file using infrastructure I/O.
- Parameters:
filename ::
filename[in] Input filenameu_fieldname ::
u_fieldname[in] Field variable name in uv_fieldname ::
v_fieldname[in] Field variable name in vu_data ::
u_data[inout] Field value in u in arbitrary units [A ~> a]v_data ::
v_data[inout] Field value in v in arbitrary units [A ~> a]mom_domain :: [in] Model domain decomposition
timelevel ::
timelevel[in] Time level to read in filestagger ::
stagger[in] Grid staggering flagscalar_pair ::
scalar_pair[in] True if tuple is not a vectorscale ::
scale[in] A scaling factor that the vector is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]turns ::
turns[in] Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.
- subroutine mom_io/mom_write_field_legacy_4d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)
Write a 4d field to an output file, potentially with rotation.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatamom_domain :: [in] The MOM_Domain that describes the decomposition
field ::
field[inout] Unrotated field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]tile_count ::
tile_count[in] PEs per tile (default: 1)fill_value ::
fill_value[in] Missing data fill value in the units used in the file [a]turns ::
turns[in] Number of quarter-turns to rotate the datascale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/mom_write_field_legacy_3d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)
Write a 3d field to an output file, potentially with rotation.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatamom_domain :: [in] The MOM_Domain that describes the decomposition
field ::
field[inout] Unrotated field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]tile_count ::
tile_count[in] PEs per tile (default: 1)fill_value ::
fill_value[in] Missing data fill value in the units used in the file [a]turns ::
turns[in] Number of quarter-turns to rotate the datascale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/mom_write_field_legacy_2d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)
Write a 2d field to an output file, potentially with rotation.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatamom_domain :: [in] The MOM_Domain that describes the decomposition
field ::
field[inout] Unrotated field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]tile_count ::
tile_count[in] PEs per tile (default: 1)fill_value ::
fill_value[in] Missing data fill valueturns ::
turns[in] Number of quarter-turns to rotate the datascale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/mom_write_field_legacy_1d(IO_handle, field_md, field, tstamp, fill_value, scale, unscale, zero_zeros)
Write a 1d field to an output file.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatafield ::
field[in] Field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]fill_value ::
fill_value[in] Missing data fill value [a]scale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/mom_write_field_legacy_0d(IO_handle, field_md, field, tstamp, fill_value, scale, unscale, zero_zeros)
Write a 0d field to an output file.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatafield ::
field[in] Field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]fill_value ::
fill_value[in] Missing data fill value [a]scale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/mom_write_field_4d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)
Write a 4d field to an output file, potentially with rotation.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatamom_domain :: [in] The MOM_Domain that describes the decomposition
field ::
field[inout] Unrotated field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]tile_count ::
tile_count[in] PEs per tile (default: 1)fill_value ::
fill_value[in] Missing data fill value [a]turns ::
turns[in] Number of quarter-turns to rotate the datascale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/mom_write_field_3d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)
Write a 3d field to an output file, potentially with rotation.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatamom_domain :: [in] The MOM_Domain that describes the decomposition
field ::
field[inout] Unrotated field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]tile_count ::
tile_count[in] PEs per tile (default: 1)fill_value ::
fill_value[in] Missing data fill value [a]turns ::
turns[in] Number of quarter-turns to rotate the datascale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/mom_write_field_2d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)
Write a 2d field to an output file, potentially with rotation.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatamom_domain :: [in] The MOM_Domain that describes the decomposition
field ::
field[inout] Unrotated field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]tile_count ::
tile_count[in] PEs per tile (default: 1)fill_value ::
fill_value[in] Missing data fill value [a]turns ::
turns[in] Number of quarter-turns to rotate the datascale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/mom_write_field_1d(IO_handle, field_md, field, tstamp, fill_value, scale, unscale, zero_zeros)
Write a 1d field to an output file.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatafield ::
field[in] Field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]fill_value ::
fill_value[in] Missing data fill value [a]scale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/mom_write_field_0d(IO_handle, field_md, field, tstamp, fill_value, scale, unscale, zero_zeros)
Write a 0d field to an output file.
- Parameters:
io_handle :: [inout] Handle for a file that is open for writing
field_md ::
field_md[in] Field type with metadatafield ::
field[in] Field to write in arbitrary units [A ~> a]tstamp ::
tstamp[in] Model timestamp, often in [days]fill_value ::
fill_value[in] Missing data fill value [a]scale ::
scale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for outputunscale ::
unscale[in] A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.zero_zeros ::
zero_zeros[in] If present and true, convert negative zeros into ordinary signless zeros.
- subroutine mom_io/field_size(filename, fieldname, sizes, field_found, no_domain, ndims, ncid_in)
Given filename and fieldname, this subroutine returns the size of the field in the file.
- Parameters:
filename ::
filename[in] The name of the file to readfieldname ::
fieldname[in] The name of the variable whose sizes are returnedsizes ::
sizes[inout] The sizes of the variable in each dimensionfield_found ::
field_found[out] This indicates whether the field was found in the input file. Without this argument, there is a fatal error if the field is not found.no_domain ::
no_domain[in] If present and true, do not check for file names with an appended tile number. If ndims is present, the default changes to true.ndims ::
ndims[out] The number of dimensions to the variablencid_in ::
ncid_in[in] The netCDF ID of an open file. If absent, the file is opened and closed within this routine.
- Call to:
- subroutine mom_io/safe_string_copy(str1, str2, fieldnm, caller)
Copies a string.
- Parameters:
str1 ::
str1[in] The string being copiedstr2 ::
str2[out] The string being copied intofieldnm ::
fieldnm[in] The name of the field for error messagescaller ::
caller[in] The calling routine for error messages
- Call to:
- Called from:
- function mom_io/ensembler(name, ens_no_in)
Returns a name with “%#E” or “%E” replaced with the ensemble member number.
- Parameters:
name ::
name[in] The name to be modifiedens_no_in ::
ens_no_in[in] The number of the current ensemble member
- Return:
undefined :: The name encoded with the ensemble number
- Call to:
- subroutine mom_io/get_filename_appendix(suffix)
Provide a string to append to filenames, to differentiate ensemble members, for example.
- Parameters:
suffix ::
suffix[out] A string to append to filenames- Called from:
mom_diag_mediator::diag_mediator_initmom_is_diag_mediator::mom_is_diag_mediator_init
- subroutine mom_io/write_version_number(version, tag, unit)
Write a file version number to the log file or other output file.
- Parameters:
version ::
version[in] A string that contains the routine name and versiontag ::
tag[in] A tag name to add to the messageunit ::
unit[in] An alternate unit number for output
- function mom_io/open_namelist_file(file)
Open a single namelist file that is potentially readable by all PEs.
- Parameters:
file ::
file[in] The file to open, by default “input.nml”- Return:
undefined :: The opened unit number of the namelist file
- Called from:
- function mom_io/check_nml_error(IOstat, nml_name)
Checks the iostat argument that is returned after reading a namelist variable and writes a message if there is an error.
- Parameters:
iostat :: [in] An I/O status field from a namelist read call
nml_name ::
nml_name[in] The name of the namelist
- Return:
undefined :: A copy of IOstat that is returned to preserve legacy function behavior
- Called from:
- subroutine mom_io/mom_io_init(param_file)
Initialize the MOM_io module.
- Parameters:
param_file ::
param_file[in] structure indicating the open file to parse for model parameter values.
- subroutine mom_io/get_var_axes_info(filename, fieldname, axes_info)
Returns the dimension variable information for a netCDF variable.
- Parameters:
filename ::
filename[in] A filename from which to readfieldname ::
fieldname[in] The name of the field to readaxes_info ::
axes_info[inout] A returned array of field axis information
- Call to:
close_file_to_readmom_error_handler::mom_erroropen_file_to_readset_axis_info