FMS  2024.03
Flexible Modeling System
fms_io_mod

Module for writing and reading restart data via NetCDF files. More...

Functions/Subroutines

logical(int_kind) function fms_io_unstructured_field_exist (file_name, field_name, domain)
 Return a flag indicating whether the inputted field exists in the inputted file, where the file is associated with an unstructured mpp domain. More...
 
subroutine fms_io_unstructured_file_unit (filename, funit, domain)
 Find the file unit for an inputted file, searching for its variants. If the file is not found, then throw a fatal error. More...
 
subroutine fms_io_unstructured_get_field_size (filename, fieldname, field_dimension_sizes, domain, field_found)
 Get the size of the dimensions of a field from a file associated with an unstructured mpp domain. More...
 
logical(int_kind) function fms_io_unstructured_get_file_name (orig_file, actual_file, read_dist, domain)
 For an inputted file name, check if it or any of its variants exist. For a file named "foo", variants checked (in order) include: More...
 
subroutine fms_io_unstructured_get_file_unit (filename, funit, index_file, read_dist, domain)
 Return the file unit and index in the "files_read" module array for the inputted file. If the file does not currently exist in the "files_read" array (i.e., it is not currenly open), then open it. More...
 
integer(int_kind) function fms_io_unstructured_register_restart_field_i_0d (fileObj, filename, fieldname, fdata_0d, domain, mandatory, data_default, longname, units, read_only, restart_owns_data)
 Add an integer scalar field to a restart object (restart_file_type). Return the index of the inputted field in the fileObjvar array. More...
 
integer(int_kind) function fms_io_unstructured_register_restart_field_i_1d (fileObj, filename, fieldname, fdata_1d, fdata_1d_axes, domain, mandatory, data_default, longname, units, read_only, restart_owns_data)
 Add an integer 1D field to a restart object (restart_file_type), where the field is assumed to be along the unstructured axis. Return the index of the inputted field in the fileObjvar array. More...
 
integer(int_kind) function fms_io_unstructured_register_restart_field_i_2d (fileObj, filename, fieldname, fdata_2d, fdata_2d_axes, domain, mandatory, data_default, longname, units, read_only, restart_owns_data)
 Add an integer 2D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis and the field's 2nd axis is assumed to be along the z-axis. Return the index of the inputted field in the fileObjvar array. More...
 
integer(int_kind) function fms_io_unstructured_register_restart_field_r8_2d (fileObj, filename, fieldname, fdata_2d, fdata_2d_axes, domain, mandatory, data_default, longname, units, read_only, restart_owns_data)
 Add a double_kind 2D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis and the field's 2nd axis is assumed to be along the z-axis. Return the index of the inputted field in the fileObjvar array. More...
 
integer(int_kind) function fms_io_unstructured_register_restart_field_r8_3d (fileObj, filename, fieldname, fdata_3d, fdata_3d_axes, domain, mandatory, data_default, longname, units, read_only, restart_owns_data)
 Add a double_kind 3D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis, the fields's second axis is assumed to be along the z-axis, and the field's third axis is assumed to be along the cc-axis (???). Return the index of the inputted field in the fileObjvar array. More...
 
integer(int_kind) function fms_io_unstructured_register_restart_field_r_0d (fileObj, filename, fieldname, fdata_0d, domain, mandatory, data_default, longname, units, read_only, restart_owns_data)
 Add a real scalar field to a restart object (restart_file_type). Return the index of the inputted field in the fileObjvar array. More...
 
integer(int_kind) function fms_io_unstructured_register_restart_field_r_1d (fileObj, filename, fieldname, fdata_1d, fdata_1d_axes, domain, mandatory, data_default, longname, units, read_only, restart_owns_data)
 Add a real 1D field to a restart object (restart_file_type), where the field is assumed to be along the unstructured axis. Return the index of the inputted field in the fileObjvar array. More...
 
integer(int_kind) function fms_io_unstructured_register_restart_field_r_2d (fileObj, filename, fieldname, fdata_2d, fdata_2d_axes, domain, mandatory, data_default, longname, units, read_only, restart_owns_data)
 Add a real 2D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis and the field's 2nd axis is assumed to be along the z-axis. Return the index of the inputted field in the fileObjvar array. More...
 
integer(int_kind) function fms_io_unstructured_register_restart_field_r_3d (fileObj, filename, fieldname, fdata_3d, fdata_3d_axes, domain, mandatory, data_default, longname, units, read_only, restart_owns_data)
 Add a real 3D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis, the fields's second axis is assumed to be along the z-axis, and the field's third axis is assumed to be along the cc-axis (???). Return the index of the inputted field in the fileObjvar array. More...
 
subroutine fms_io_unstructured_save_restart (fileObj, time_stamp, directory, append, time_level)
 Write out metadata and data for axes and fields to a restart file associated with an unstructured mpp domain. More...
 
subroutine fms_io_unstructured_setup_one_field (fileObj, filename, fieldname, field_dimension_order, field_dimension_sizes, index_field, domain, mandatory, data_default, longname, units, read_only, owns_data)
 Add a field to a restart object (restart_file_type). Return the index of the inputted field in the fileObjvar array. More...
 
subroutine fms_io_unstructured_read_r_scalar (filename, fieldname, fdata, domain, timelevel, start, nread, threading)
 Read in a scalar field from a file associated with an unstructured mpp domain. More...
 
subroutine fms_io_unstructured_read_r_1d (filename, fieldname, fdata, domain, timelevel, start, nread, threading)
 Read in a one dimensional "compressed" field from a file associated with an unstructured mpp domain. More...
 
subroutine fms_io_unstructured_read_r_2d (filename, fieldname, fdata, domain, timelevel, start, nread, threading)
 Read in a two dimensional "compressed" field from a file associated with an unstructured mpp domain. More...
 
subroutine fms_io_unstructured_read_r_3d (filename, fieldname, fdata, domain, timelevel, start, nread, threading)
 Read in a three dimensional "compressed" field from a file associated with an unstructured mpp domain. More...
 
subroutine fms_io_unstructured_read_i_scalar (filename, fieldname, fdata, domain, timelevel, start, nread, threading)
 Read in a scalar field from a file associated with an unstructured mpp domain. More...
 
subroutine fms_io_unstructured_read_i_1d (filename, fieldname, fdata, domain, timelevel, start, nread, threading)
 Read in a one dimensional "compressed" field from a file associated with an unstructured mpp domain. More...
 
subroutine fms_io_unstructured_read_i_2d (filename, fieldname, fdata, domain, timelevel, start, nread, threading)
 Read in a two dimensional "compressed" field from a file associated with an unstructured mpp domain. More...
 

Detailed Description

Module for writing and reading restart data via NetCDF files.

Author
M.J. Harrison, Zhi Liang

This module is for writing and reading restart data in NetCDF format. fms_io_init must be called before the first write_data/read_data call For writing, fms_io_exit must be called after ALL write calls have been made. Typically, fms_io_init and fms_io_exit are placed in the main (driver) program while read_data and write_data can be called where needed. Presently, two combinations of threading and fileset are supported, users can choose one line of the following by setting namelist:

With the introduction of netCDF restart files, there is a need for a global switch to turn on/off netCDF restart options in all of the modules that deal with restart files. Here two more namelist variables (logical type) are introduced to fms_io

because default values of both flags are .true., the default behavior of the entire model is to use netCDF IO mode. To turn off netCDF restart, simply set fms_netcdf_restart to .false.

Function/Subroutine Documentation

◆ fms_io_unstructured_field_exist()

logical(int_kind) function fms_io_unstructured_field_exist ( character(len=*), intent(in)  file_name,
character(len=*), intent(in)  field_name,
type(domainug), intent(in)  domain 
)

Return a flag indicating whether the inputted field exists in the inputted file, where the file is associated with an unstructured mpp domain.

Parameters
[in]file_nameName of a file.
[in]field_nameName of a field.
[in]domainAn unstructured mpp domain.
Returns
Flag telling if the inputted field exists in the inputted file.

Definition at line 26 of file fms_io_unstructured_field_exist.inc.

◆ fms_io_unstructured_file_unit()

subroutine fms_io_unstructured_file_unit ( character(len=*), intent(in)  filename,
integer(int_kind), intent(out)  funit,
type(domainug), intent(in)  domain 
)

Find the file unit for an inputted file, searching for its variants. If the file is not found, then throw a fatal error.

Parameters
[in]filenameThe name of a file.
[out]funitThe file unit for the input file.
[in]domainAn unstructured mpp domain.

Definition at line 26 of file fms_io_unstructured_file_unit.inc.

◆ fms_io_unstructured_get_field_size()

subroutine fms_io_unstructured_get_field_size ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
integer, dimension(:), intent(inout)  field_dimension_sizes,
type(domainug), intent(in)  domain,
logical, intent(out), optional  field_found 
)

Get the size of the dimensions of a field from a file associated with an unstructured mpp domain.

Parameters
[in]filenameThe name of a file.
[in]fieldnameThe name of a field in the input file.
[in,out]field_dimension_sizesArray of dimension sizes for the inputted field.
[in]domainAn unstructured mpp domain associated with the input file.
[out]field_foundFlag telling if the inputted field was found in the inputted file.

Definition at line 27 of file fms_io_unstructured_get_field_size.inc.

◆ fms_io_unstructured_get_file_name()

logical(int_kind) function fms_io_unstructured_get_file_name ( character(len=*), intent(in)  orig_file,
character(len=*), intent(out)  actual_file,
logical(int_kind), intent(out)  read_dist,
type(domainug), intent(in)  domain 
)

For an inputted file name, check if it or any of its variants exist. For a file named "foo", variants checked (in order) include:

foo
foo.nc
foo.<domain_tile_id_string>.nc
foo.nc.<IO_domain_tile_id_string>
foo.<domain_tile_id_string>.nc.<IO_domain_tile_id_string>
foo.<ensemble_id>
foo.<ensemble_id>.nc
foo.<ensemble_id>.<domain_tile_id_string>.nc
foo.<ensemble_id>.nc.<IO_domain_tile_id_string>
foo.<ensemble_id>.<domain_tile_id_string>.nc.<IO_domain_tile_id_string>

If a match is found, the value true is returned for the "does_file_exist" flag. In addition, the actual file name is returned and the "read_dist" flag, which tells whether or not the filename contains the IO_domain_tile_id_string appended.

Should this be a subroutine instead of a funtion for clarity since it returns more than one value?

Parameters
[in]orig_fileThe name of file we're looking for.
[out]actual_fileName of the file we found.
[out]read_distFlag telling if the file is "distributed" (has IO domain tile id appended onto the end).
[in]domainUnstructured mpp domain.
Returns
Flag telling if the inputted file exists or one its variants.

Definition at line 45 of file fms_io_unstructured_get_file_name.inc.

◆ fms_io_unstructured_get_file_unit()

subroutine fms_io_unstructured_get_file_unit ( character(len=*), intent(in)  filename,
integer(int_kind), intent(out)  funit,
integer(int_kind), intent(out)  index_file,
logical(int_kind), intent(in)  read_dist,
type(domainug), intent(in)  domain 
)

Return the file unit and index in the "files_read" module array for the inputted file. If the file does not currently exist in the "files_read" array (i.e., it is not currenly open), then open it.

Parameters
[in]filenameName of the file to be read from.
[out]funitFile unit for the inputted file.
[out]index_fileIndex of the inputted file in the "files_read" module array.
[in]read_distFlag telling if the IO domain tile id string exists at the end of the inputted file name.
[in]domainAn unstructured mpp domain.

Definition at line 27 of file fms_io_unstructured_get_file_unit.inc.

◆ fms_io_unstructured_read_i_1d()

subroutine fms_io_unstructured_read_i_1d ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
integer, dimension(:), intent(inout)  fdata,
type(domainug), intent(in)  domain,
integer, intent(in), optional  timelevel,
integer, dimension(:), intent(in), optional  start,
integer, dimension(:), intent(in), optional  nread,
integer, intent(in), optional  threading 
)

Read in a one dimensional "compressed" field from a file associated with an unstructured mpp domain.

Parameters
[in]filenameThe name of a file.
[in]fieldnameThe name of field in the input file.
[in,out]fdataData to be read in from the file.
[in]domainUnstructured mpp domain associated with the input file.
[in]timelevelTime level at which the data is read in.
[in]startNetCDF "Corner" indices for the data.
[in]nreadNetCDF "edge lengths" for the data.
[in]threadingThreading flag.

Definition at line 393 of file fms_io_unstructured_read.inc.

◆ fms_io_unstructured_read_i_2d()

subroutine fms_io_unstructured_read_i_2d ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
integer, dimension(:,:), intent(inout)  fdata,
type(domainug), intent(in)  domain,
integer, intent(in), optional  timelevel,
integer, dimension(:), intent(in), optional  start,
integer, dimension(:), intent(in), optional  nread,
integer, intent(in), optional  threading 
)

Read in a two dimensional "compressed" field from a file associated with an unstructured mpp domain.

Parameters
[in]filenameThe name of a file.
[in]fieldnameThe name of field in the input file.
[in,out]fdataData to be read in from the file.
[in]domainUnstructured mpp domain associated with the input file.
[in]timelevelTime level at which the data is read in.
[in]startNetCDF "Corner" indices for the data.
[in]nreadNetCDF "edge lengths" for the data.
[in]threadingThreading flag.

Definition at line 435 of file fms_io_unstructured_read.inc.

◆ fms_io_unstructured_read_i_scalar()

subroutine fms_io_unstructured_read_i_scalar ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
integer, intent(inout)  fdata,
type(domainug), intent(in)  domain,
integer, intent(in), optional  timelevel,
integer, dimension(:), intent(in), optional  start,
integer, dimension(:), intent(in), optional  nread,
integer, intent(in), optional  threading 
)

Read in a scalar field from a file associated with an unstructured mpp domain.

Parameters
[in]filenameThe name of a file.
[in]fieldnameThe name of field in the input file.
[in,out]fdataData to be read in from the file.
[in]domainUnstructured mpp domain associated with the input file.
[in]timelevelTime level at which the data is read in.
[in]startNetCDF "Corner" indices for the data.
[in]nreadNetCDF "edge lengths" for the data.
[in]threadingThreading flag.

Definition at line 342 of file fms_io_unstructured_read.inc.

◆ fms_io_unstructured_read_r_1d()

subroutine fms_io_unstructured_read_r_1d ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real, dimension(:), intent(inout)  fdata,
type(domainug), intent(in)  domain,
integer, intent(in), optional  timelevel,
integer, dimension(:), intent(in), optional  start,
integer, dimension(:), intent(in), optional  nread,
integer, intent(in), optional  threading 
)

Read in a one dimensional "compressed" field from a file associated with an unstructured mpp domain.

Parameters
[in]filenameThe name of a file.
[in]fieldnameThe name of field in the input file.
[in,out]fdataData to be read in from the file.
[in]domainUnstructured mpp domain associated with the input file.
[in]timelevelTime level at which the data is read in.
[in]startNetCDF "Corner" indices for the data.
[in]nreadNetCDF "edge lengths" for the data.
[in]threadingThreading flag.

Definition at line 78 of file fms_io_unstructured_read.inc.

◆ fms_io_unstructured_read_r_2d()

subroutine fms_io_unstructured_read_r_2d ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real, dimension(:,:), intent(inout)  fdata,
type(domainug), intent(in)  domain,
integer, intent(in), optional  timelevel,
integer, dimension(:), intent(in), optional  start,
integer, dimension(:), intent(in), optional  nread,
integer, intent(in), optional  threading 
)

Read in a two dimensional "compressed" field from a file associated with an unstructured mpp domain.

Parameters
[in]filenameThe name of a file.
[in]fieldnameThe name of field in the input file.
[in,out]fdataData to be read in from the file.
[in]domainUnstructured mpp domain associated with the input file.
[in]timelevelTime level at which the data is read in.
[in]startNetCDF "Corner" indices for the data.
[in]nreadNetCDF "edge lengths" for the data.
[in]threadingThreading flag.

Definition at line 166 of file fms_io_unstructured_read.inc.

◆ fms_io_unstructured_read_r_3d()

subroutine fms_io_unstructured_read_r_3d ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real, dimension(:,:,:), intent(inout)  fdata,
type(domainug), intent(in)  domain,
integer, intent(in), optional  timelevel,
integer, dimension(:), intent(in), optional  start,
integer, dimension(:), intent(in), optional  nread,
integer, intent(in), optional  threading 
)

Read in a three dimensional "compressed" field from a file associated with an unstructured mpp domain.

Parameters
[in]filenameThe name of a file.
[in]fieldnameThe name of field in the input file.
[in,out]fdataData to be read in from the file.
[in]domainUnstructured mpp domain associated with the input file.
[in]timelevelTime level at which the data is read in.
[in]startNetCDF "Corner" indices for the data.
[in]nreadNetCDF "edge lengths" for the data.
[in]threadingThreading flag.

Definition at line 254 of file fms_io_unstructured_read.inc.

◆ fms_io_unstructured_read_r_scalar()

subroutine fms_io_unstructured_read_r_scalar ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real, intent(inout)  fdata,
type(domainug), intent(in)  domain,
integer, intent(in), optional  timelevel,
integer, dimension(:), intent(in), optional  start,
integer, dimension(:), intent(in), optional  nread,
integer, intent(in), optional  threading 
)

Read in a scalar field from a file associated with an unstructured mpp domain.

Parameters
[in]filenameThe name of a file.
[in]fieldnameThe name of field in the input file.
[in,out]fdataData to be read in from the file.
[in]domainUnstructured mpp domain associated with the input file.
[in]timelevelTime level at which the data is read in.
[in]startNetCDF "Corner" indices for the data.
[in]nreadNetCDF "edge lengths" for the data.
[in]threadingThreading flag.

Definition at line 27 of file fms_io_unstructured_read.inc.

◆ fms_io_unstructured_register_restart_field_i_0d()

integer(int_kind) function fms_io_unstructured_register_restart_field_i_0d ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
integer, intent(in), target  fdata_0d,
type(domainug), intent(in), target  domain,
logical, intent(in), optional  mandatory,
real, intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  restart_owns_data 
)

Add an integer scalar field to a restart object (restart_file_type). Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of a file.
[in]fieldnameThe name of a field.
[in]fdata_0dSome data.
[in]domainAn unstructured mpp_domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]restart_owns_dataTells if the data will be deallocated when the restart object is deallocated.
Returns
Index of the inputted field in the fileObjvar array.

Definition at line 976 of file fms_io_unstructured_register_restart_field.inc.

◆ fms_io_unstructured_register_restart_field_i_1d()

integer(int_kind) function fms_io_unstructured_register_restart_field_i_1d ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
integer, dimension(:), intent(in), target  fdata_1d,
integer(int_kind), dimension(1)  fdata_1d_axes,
type(domainug), intent(in), target  domain,
logical, intent(in), optional  mandatory,
real, intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  restart_owns_data 
)

Add an integer 1D field to a restart object (restart_file_type), where the field is assumed to be along the unstructured axis. Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of a file.
[in]fieldnameThe name of a field.
[in]fdata_1dSome data.
fdata_1d_axesAn array describing the axes for the data.
[in]domainAn unstructured mpp_domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]restart_owns_dataTells if the data will be deallocated when the restart object is deallocated.
Returns
Index of the inputted field in the fileObjvar array.

Definition at line 1093 of file fms_io_unstructured_register_restart_field.inc.

◆ fms_io_unstructured_register_restart_field_i_2d()

integer(int_kind) function fms_io_unstructured_register_restart_field_i_2d ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
integer, dimension(:,:), intent(in), target  fdata_2d,
integer(int_kind), dimension(2)  fdata_2d_axes,
type(domainug), intent(in), target  domain,
logical, intent(in), optional  mandatory,
real, intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  restart_owns_data 
)

Add an integer 2D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis and the field's 2nd axis is assumed to be along the z-axis. Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of a file.
[in]fieldnameThe name of a field.
[in]fdata_2dSome data.
fdata_2d_axesAn array describing the axes for the data.
[in]domainAn unstructured mpp_domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]restart_owns_dataTells if the data will be deallocated when the restart object is deallocated.
Returns
Index of the inputted field in the fileObjvar array.

Definition at line 1213 of file fms_io_unstructured_register_restart_field.inc.

◆ fms_io_unstructured_register_restart_field_r8_2d()

integer(int_kind) function fms_io_unstructured_register_restart_field_r8_2d ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real(double_kind), dimension(:,:), intent(in), target  fdata_2d,
integer(int_kind), dimension(2)  fdata_2d_axes,
type(domainug), intent(in), target  domain,
logical, intent(in), optional  mandatory,
real(double_kind), intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  restart_owns_data 
)

Add a double_kind 2D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis and the field's 2nd axis is assumed to be along the z-axis. Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of a file.
[in]fieldnameThe name of a field.
[in]fdata_2dSome data.
fdata_2d_axesAn array describing the axes for the data.
[in]domainAn unstructured mpp_domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]restart_owns_dataTells if the data will be deallocated when the restart object is deallocated.
Returns
Index of the inputted field in the fileObjvar array.

Definition at line 616 of file fms_io_unstructured_register_restart_field.inc.

◆ fms_io_unstructured_register_restart_field_r8_3d()

integer(int_kind) function fms_io_unstructured_register_restart_field_r8_3d ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real(double_kind), dimension(:,:,:), intent(in), target  fdata_3d,
integer(int_kind), dimension(3)  fdata_3d_axes,
type(domainug), intent(in), target  domain,
logical, intent(in), optional  mandatory,
real(double_kind), intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  restart_owns_data 
)

Add a double_kind 3D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis, the fields's second axis is assumed to be along the z-axis, and the field's third axis is assumed to be along the cc-axis (???). Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of a file.
[in]fieldnameThe name of a field.
[in]fdata_3dSome data.
fdata_3d_axesAn array describing the axes for the data.
[in]domainAn unstructured mpp_domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]restart_owns_dataTells if the data will be deallocated when the restart object is deallocated.
Returns
Index of the inputted field in the fileObjvar array.

Definition at line 782 of file fms_io_unstructured_register_restart_field.inc.

◆ fms_io_unstructured_register_restart_field_r_0d()

integer(int_kind) function fms_io_unstructured_register_restart_field_r_0d ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real, intent(in), target  fdata_0d,
type(domainug), intent(in), target  domain,
logical, intent(in), optional  mandatory,
real, intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  restart_owns_data 
)

Add a real scalar field to a restart object (restart_file_type). Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of a file.
[in]fieldnameThe name of a field.
[in]fdata_0dSome data.
[in]domainAn unstructured mpp_domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]restart_owns_dataTells if the data will be deallocated when the restart object is deallocated.
Returns
Index of the inputted field in the fileObjvar array.

Definition at line 27 of file fms_io_unstructured_register_restart_field.inc.

◆ fms_io_unstructured_register_restart_field_r_1d()

integer(int_kind) function fms_io_unstructured_register_restart_field_r_1d ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real, dimension(:), intent(in), target  fdata_1d,
integer(int_kind), dimension(1)  fdata_1d_axes,
type(domainug), intent(in), target  domain,
logical, intent(in), optional  mandatory,
real, intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  restart_owns_data 
)

Add a real 1D field to a restart object (restart_file_type), where the field is assumed to be along the unstructured axis. Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of a file.
[in]fieldnameThe name of a field.
[in]fdata_1dSome data.
fdata_1d_axesAn array describing the axes for the data.
[in]domainAn unstructured mpp_domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]restart_owns_dataTells if the data will be deallocated when the restart object is deallocated.
Returns
Index of the inputted field in the fileObjvar array.

Definition at line 144 of file fms_io_unstructured_register_restart_field.inc.

◆ fms_io_unstructured_register_restart_field_r_2d()

integer(int_kind) function fms_io_unstructured_register_restart_field_r_2d ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real, dimension(:,:), intent(in), target  fdata_2d,
integer(int_kind), dimension(2)  fdata_2d_axes,
type(domainug), intent(in), target  domain,
logical, intent(in), optional  mandatory,
real, intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  restart_owns_data 
)

Add a real 2D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis and the field's 2nd axis is assumed to be along the z-axis. Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of a file.
[in]fieldnameThe name of a field.
[in]fdata_2dSome data.
fdata_2d_axesAn array describing the axes for the data.
[in]domainAn unstructured mpp_domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]restart_owns_dataTells if the data will be deallocated when the restart object is deallocated.
Returns
Index of the inputted field in the fileObjvar array.

Definition at line 264 of file fms_io_unstructured_register_restart_field.inc.

◆ fms_io_unstructured_register_restart_field_r_3d()

integer(int_kind) function fms_io_unstructured_register_restart_field_r_3d ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
real, dimension(:,:,:), intent(in), target  fdata_3d,
integer(int_kind), dimension(3)  fdata_3d_axes,
type(domainug), intent(in), target  domain,
logical, intent(in), optional  mandatory,
real, intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  restart_owns_data 
)

Add a real 3D field to a restart object (restart_file_type), where the field's 1st axis assumed to be along the unstructured axis, the fields's second axis is assumed to be along the z-axis, and the field's third axis is assumed to be along the cc-axis (???). Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of a file.
[in]fieldnameThe name of a field.
[in]fdata_3dSome data.
fdata_3d_axesAn array describing the axes for the data.
[in]domainAn unstructured mpp_domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]restart_owns_dataTells if the data will be deallocated when the restart object is deallocated.
Returns
Index of the inputted field in the fileObjvar array.

Definition at line 425 of file fms_io_unstructured_register_restart_field.inc.

◆ fms_io_unstructured_save_restart()

subroutine fms_io_unstructured_save_restart ( type(restart_file_type), intent(inout), target  fileObj,
character(len=*), intent(in), optional  time_stamp,
character(len=*), intent(in), optional  directory,
logical(int_kind), intent(in), optional  append,
real, intent(in), optional  time_level 
)

Write out metadata and data for axes and fields to a restart file associated with an unstructured mpp domain.

Parameters
[in,out]fileobjA restart object.
[in]time_stampA time stamp for the file.
[in]directoryThe directory where the restart file lives.
[in]appendFlag telling whether to append to or overwrite the restart file.
[in]time_levelA time level value (do not specify a kind value).

Definition at line 26 of file fms_io_unstructured_save_restart.inc.

◆ fms_io_unstructured_setup_one_field()

subroutine fms_io_unstructured_setup_one_field ( type(restart_file_type), intent(inout)  fileObj,
character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
integer(int_kind), dimension(:), intent(in)  field_dimension_order,
integer(int_kind), dimension(nidx), intent(in)  field_dimension_sizes,
integer(int_kind), intent(out)  index_field,
type(domainug), intent(in), target  domain,
logical(int_kind), intent(in), optional  mandatory,
real, intent(in), optional  data_default,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
logical(int_kind), intent(in), optional  read_only,
logical(int_kind), intent(in), optional  owns_data 
)

Add a field to a restart object (restart_file_type). Return the index of the inputted field in the fileObjvar array.

Parameters
[in,out]fileobjA restart object.
[in]filenameThe name of the restart file.
[in]fieldnameThe name of a field.
[in]field_dimension_orderArray telling the ordering of the dimensions for the field.
[in]field_dimension_sizesArray of sizes of the dimensions of the inputted field.
[out]index_fieldIndex of the inputted field in the fileObjvar array.
[in]domainAn unstructured mpp domain.
[in]mandatoryFlag telling if the field is mandatory for the restart.
[in]data_defaultA default value for the data.
[in]longnameA more descriptive name of the field.
[in]unitsUnits for the field.
[in]read_onlyTells whether or not the variable will be written to the restart file.
[in]owns_dataTells if the data will be deallocated when the restart object is deallocated.

Definition at line 26 of file fms_io_unstructured_setup_one_field.inc.