FMS
2024.03
Flexible Modeling System
|
Domain-specific I/O wrappers. More...
Data Types | |
interface | compute_global_checksum |
type | domaindimension_t |
Domain variable. More... | |
type | fmsnetcdfdomainfile_t |
netcdf domain file type. More... | |
Functions/Subroutines | |
subroutine | add_domain_attribute (fileobj, variable_name) |
Add a "domain_decomposed" attribute to the axis variables because it is required by mppnccombine. More... | |
subroutine | append_domain_decomposed_dimension (name_, position_, array, size_) |
Add a domain decomposed dimension to an array. More... | |
subroutine, public | close_domain_file (fileobj) |
Close a domain netcdf file. More... | |
character(len=32) function | compute_global_checksum_2d (fileobj, variable_name, variable_data, is_decomposed) |
@briefs Calculates a variable's checksum across all ranks in the current pelist. More... | |
character(len=32) function | compute_global_checksum_3d (fileobj, variable_name, variable_data, is_decomposed) |
@briefs Calculates a variable's checksum across all ranks in the current pelist. More... | |
character(len=32) function | compute_global_checksum_4d (fileobj, variable_name, variable_data, is_decomposed) |
@briefs Calculates a variable's checksum across all ranks in the current pelist. More... | |
subroutine | domain_offsets (data_xsize, data_ysize, domain, xpos, ypos, isd, isc, xc_size, jsd, jsc, yc_size, buffer_includes_halos, extra_x_point, extra_y_point, msg) |
Utility routine that retrieves domain indices. More... | |
subroutine, public | get_compute_domain_dimension_indices (fileobj, dimname, indices) |
Return an array of compute domain indices. More... | |
integer function | get_domain_decomposed_dimension_index (fileobj, variable_name, xory, broadcast) |
Given a variable, get the index of the "x" or "y" domain decomposed dimension. More... | |
integer function | get_domain_decomposed_index (name_, array, size_) |
Get the index of a domain decomposed dimension. More... | |
integer function | get_domain_position (name_, array, size_) |
Given a domain decomposed dimension, get its domain position. More... | |
subroutine, public | get_global_io_domain_indices (fileobj, dimname, is, ie, indices) |
Get starting/ending global indices of the I/O domain for a domain decomposed file. More... | |
subroutine, public | get_mosaic_tile_grid (grid_file, mosaic_file, domain, tile_count) |
Read a mosaic_file and get the grid filename for the current tile or for the tile specified. More... | |
logical function, public | is_dimension_registered (fileobj, dimension_name) |
Determine whether a domain-decomposed dimension has been registered to the file object. More... | |
logical function | is_variable_domain_decomposed (fileobj, variable_name, broadcast, xindex, yindex, xpos, ypos) |
Determine if a variable is "domain decomposed.". More... | |
logical function, public | open_domain_file (fileobj, path, mode, domain, nc_format, is_restart, dont_add_res_to_filename) |
Open a domain netcdf file. More... | |
subroutine, public | register_domain_decomposed_dimension (fileobj, dim_name, xory, domain_position) |
Add a dimension to a file associated with a two-dimensional domain. More... | |
subroutine, public | register_domain_variable (fileobj, variable_name, variable_type, dimensions) |
Add a domain decomposed variable. More... | |
subroutine, public | restore_domain_state (fileobj, unlim_dim_level, ignore_checksum) |
Loop through registered restart variables and read them from a netcdf file. More... | |
subroutine, public | save_domain_restart (fileobj, unlim_dim_level) |
Loop through registered restart variables and write them to a netcdf file. More... | |
Domain-specific I/O wrappers.
interface fms_netcdf_domain_io_mod::compute_global_checksum |
Definition at line 104 of file fms_netcdf_domain_io.F90.
Private Member Functions | |
compute_global_checksum_2d | |
compute_global_checksum_3d | |
compute_global_checksum_4d | |
type fms_netcdf_domain_io_mod::domaindimension_t |
Domain variable.
Definition at line 50 of file fms_netcdf_domain_io.F90.
Private Attributes | |
integer | pos |
Domain position. | |
character(len=nf90_max_name) | varname |
Variable name. | |
type fms_netcdf_domain_io_mod::fmsnetcdfdomainfile_t |
netcdf domain file type.
Definition at line 58 of file fms_netcdf_domain_io.F90.
Public Attributes | |
logical | adjust_indices |
Flag telling if indices need to be adjusted for domain-decomposed read. | |
type(dimension_information) | bc_dimensions |
information about the current dimensions for regional restart variables | |
type(compresseddimension_t), dimension(:), allocatable | compressed_dims |
"Compressed" dimension. | |
type(domain2d) | domain |
Two-dimensional domain. | |
integer | io_root |
I/O root rank of the pelist. | |
logical | is_diskless |
Flag telling whether this is a diskless file. | |
logical | is_netcdf4 |
Flag indicating if the netcdf file type is netcdf4. | |
logical, allocatable | is_open |
Allocated and set to true if opened. | |
logical | is_readonly |
Flag telling if the file is readonly. | |
logical | is_restart |
Flag telling if the this file is a restart file (that has internal pointers to data). | |
logical | is_root |
Flag telling if the current rank is the I/O root. | |
logical | mode_is_append |
character(len=256) | nc_format |
Netcdf file format. | |
integer | ncid |
Netcdf file id. | |
character(len=fms_path_len) | non_mangled_path |
Non-domain-mangled file path. | |
integer | num_compressed_dims |
Number of compressed dimensions. | |
integer | num_restart_vars |
Number of registered restart variables. | |
integer | nx |
Number of "x" dimensions. | |
integer | ny |
Number of "y" dimensions. | |
character(len=fms_path_len) | path |
File path. | |
integer, dimension(:), allocatable | pelist |
List of ranks who will communicate. | |
type(restartvariable_t), dimension(:), allocatable | restart_vars |
Array of registered restart variables. | |
integer | tile_comm =MPP_COMM_NULL |
MPI communicator used for collective reads. To be replaced with a real communicator at user request. | |
character(len=20) | time_name |
logical | use_collective = .false. |
Flag indicating if we should open the file for collective input this should be set to .true. in the user application if they want collective reads (put before open_file()) | |
type(domaindimension_t), dimension(:), allocatable | xdims |
Dimensions associated with the "x" axis of a 2d domain. | |
type(domaindimension_t), dimension(:), allocatable | ydims |
Dimensions associated with the "y" axis of a 2d domain. | |
|
private |
Add a "domain_decomposed" attribute to the axis variables because it is required by mppnccombine.
[in,out] | fileobj | File object. |
[in] | variable_name | Variable name. |
Definition at line 498 of file fms_netcdf_domain_io.F90.
|
private |
Add a domain decomposed dimension to an array.
[in] | name_ | Variable name. |
[in] | position_ | Domain position. |
[in,out] | array | Array to search through. |
[in,out] | size_ | Number of spots to look in. |
Definition at line 139 of file fms_netcdf_domain_io.F90.
subroutine, public fms_netcdf_domain_io_mod::close_domain_file | ( | type(fmsnetcdfdomainfile_t), intent(inout) | fileobj | ) |
Close a domain netcdf file.
[in,out] | fileobj | File object. |
Definition at line 429 of file fms_netcdf_domain_io.F90.
character(len=32) function compute_global_checksum_2d | ( | class(fmsnetcdfdomainfile_t), intent(in) | fileobj, |
character(len=*), intent(in) | variable_name, | ||
class(*), dimension(:,:), intent(in) | variable_data, | ||
logical, intent(out) | is_decomposed | ||
) |
@briefs Calculates a variable's checksum across all ranks in the current pelist.
[in] | fileobj | File object. |
[in] | variable_name | Variable name. |
[in] | variable_data | Data to be checksummed. |
[out] | is_decomposed | Flag telling if the variable is decomposed. |
Definition at line 27 of file compute_global_checksum.inc.
character(len=32) function compute_global_checksum_3d | ( | class(fmsnetcdfdomainfile_t), intent(in) | fileobj, |
character(len=*), intent(in) | variable_name, | ||
class(*), dimension(:,:,:), intent(in) | variable_data, | ||
logical, intent(out) | is_decomposed | ||
) |
@briefs Calculates a variable's checksum across all ranks in the current pelist.
[in] | fileobj | File object. |
[in] | variable_name | Variable name. |
[in] | variable_data | Data to be checksummed. |
[out] | is_decomposed | Flag telling if the variable is decomposed. |
Definition at line 144 of file compute_global_checksum.inc.
character(len=32) function compute_global_checksum_4d | ( | class(fmsnetcdfdomainfile_t), intent(in) | fileobj, |
character(len=*), intent(in) | variable_name, | ||
class(*), dimension(:,:,:,:), intent(in) | variable_data, | ||
logical, intent(out) | is_decomposed | ||
) |
@briefs Calculates a variable's checksum across all ranks in the current pelist.
[in] | fileobj | File object. |
[in] | variable_name | Variable name. |
[in] | variable_data | Data to be checksummed. |
[out] | is_decomposed | Flag telling if the variable is decomposed. |
Definition at line 260 of file compute_global_checksum.inc.
|
private |
Utility routine that retrieves domain indices.
[in] | data_xsize | Size of buffer's domain "x" dimension. |
[in] | data_ysize | Size of buffer's domain "y" dimension. |
[in] | domain | Parent domain. |
[in] | xpos | Variable's domain x dimension position. |
[in] | ypos | Variable's domain y dimension position. |
[out] | isd | Starting index for x dimension of data domain. |
[out] | isc | Starting index for x dimension of compute domain. |
[out] | xc_size | Size of x dimension of compute domain. |
[out] | jsd | Starting index for y dimension of data domain. |
[out] | jsc | Starting index for y dimension of compute domain. |
[out] | yc_size | Size of y dimension of compute domain. |
[out] | buffer_includes_halos | Flag telling if input buffer includes space for halos. |
[out] | extra_x_point | Flag indicating if data_array has an extra point in x |
[out] | extra_y_point | Flag indicating if data_array has an extra point in y |
[in] | msg | Message appended to fatal error |
Definition at line 756 of file fms_netcdf_domain_io.F90.
subroutine, public fms_netcdf_domain_io_mod::get_compute_domain_dimension_indices | ( | type(fmsnetcdfdomainfile_t), intent(in) | fileobj, |
character(len=*), intent(in) | dimname, | ||
integer, dimension(:), intent(inout), allocatable | indices | ||
) |
Return an array of compute domain indices.
[in] | fileobj | File object. |
[in] | dimname | Name of dimension variable. |
[in,out] | indices | Compute domain indices. |
Definition at line 717 of file fms_netcdf_domain_io.F90.
|
private |
Given a variable, get the index of the "x" or "y" domain decomposed dimension.
[in] | fileobj | File object. |
[in] | variable_name | Variable name. |
[in] | xory | String telling which dimension to look for. Valid values are "x" or "y". |
[in] | broadcast | Flag controlling whether or not the index will be broadcast to non "I/O root" ranks. The broadcast will be done by default. |
Definition at line 183 of file fms_netcdf_domain_io.F90.
|
private |
Get the index of a domain decomposed dimension.
[in] | name_ | Name. |
[in] | array | Array to search through. |
[in] | size_ | Number of spots to look in. |
Definition at line 118 of file fms_netcdf_domain_io.F90.
|
private |
Given a domain decomposed dimension, get its domain position.
[in] | name_ | Variable name. |
[in] | array | Array to search through. |
Definition at line 164 of file fms_netcdf_domain_io.F90.
subroutine, public fms_netcdf_domain_io_mod::get_global_io_domain_indices | ( | type(fmsnetcdfdomainfile_t), intent(in) | fileobj, |
character(len=*), intent(in) | dimname, | ||
integer, intent(out) | is, | ||
integer, intent(out) | ie, | ||
integer, dimension(:), intent(out), optional, allocatable | indices | ||
) |
Get starting/ending global indices of the I/O domain for a domain decomposed file.
[in] | fileobj | File object. |
[in] | dimname | Name of dimension variable. |
[out] | is | Staring index of I/O global domain. |
[out] | ie | Ending index of I/O global domain. |
[out] | indices | Global domain indices |
Definition at line 827 of file fms_netcdf_domain_io.F90.
subroutine, public fms_netcdf_domain_io_mod::get_mosaic_tile_grid | ( | character(len=*), intent(out) | grid_file, |
character(len=*), intent(in) | mosaic_file, | ||
type(domain2d), intent(in) | domain, | ||
integer, intent(in), optional | tile_count | ||
) |
Read a mosaic_file and get the grid filename for the current tile or for the tile specified.
[out] | grid_file | Filename of the grid file for the current domain tile or for tile specified in tile_count |
[in] | mosaic_file | Filename that will be read |
[in] | domain | Input domain |
[in] | tile_count | Optional argument indicating the tile you want grid file name for this is for when a pe is in more than tile. |
Definition at line 872 of file fms_netcdf_domain_io.F90.
logical function, public fms_netcdf_domain_io_mod::is_dimension_registered | ( | type(fmsnetcdfdomainfile_t), intent(in) | fileobj, |
character(len=*), intent(in) | dimension_name | ||
) |
Determine whether a domain-decomposed dimension has been registered to the file object.
[in] | fileobj | File object. |
[in] | dimension_name | Dimension name. |
Definition at line 300 of file fms_netcdf_domain_io.F90.
|
private |
Determine if a variable is "domain decomposed.".
[in] | fileobj | File object. |
[in] | variable_name | Variable name. |
[in] | broadcast | Flag controlling whether or not the index will be broadcast to non "I/O root" ranks. The broadcast will be done by default. |
[out] | xindex | The index of the domain x dimension. |
[out] | yindex | The index of the domain y dimension. |
[out] | xpos | Domain position of the x dimension. |
[out] | ypos | Domain position of the y dimension. |
Definition at line 239 of file fms_netcdf_domain_io.F90.
logical function, public fms_netcdf_domain_io_mod::open_domain_file | ( | type(fmsnetcdfdomainfile_t), intent(inout) | fileobj, |
character(len=*), intent(in) | path, | ||
character(len=*), intent(in) | mode, | ||
type(domain2d), intent(in) | domain, | ||
character(len=*), intent(in), optional | nc_format, | ||
logical, intent(in), optional | is_restart, | ||
logical, intent(in), optional | dont_add_res_to_filename | ||
) |
Open a domain netcdf file.
[in,out] | fileobj | File object. |
[in] | path | File path. |
[in] | mode | File mode. Allowed values are "read", "append", "write", or "overwrite". |
[in] | domain | Two-dimensional domain. |
[in] | nc_format | Netcdf format that new files are written as. Allowed values are: "64bit", "classic", or "netcdf4". Defaults to "64bit". |
[in] | is_restart | Flag telling if this file is a restart file. Defaults to false. |
[in] | dont_add_res_to_filename | Flag indicating not to add ".res" to the filename |
Definition at line 325 of file fms_netcdf_domain_io.F90.
subroutine, public fms_netcdf_domain_io_mod::register_domain_decomposed_dimension | ( | type(fmsnetcdfdomainfile_t), intent(inout) | fileobj, |
character(len=*), intent(in) | dim_name, | ||
character(len=*), intent(in) | xory, | ||
integer, intent(in), optional | domain_position | ||
) |
Add a dimension to a file associated with a two-dimensional domain.
[in,out] | fileobj | File object. |
[in] | dim_name | Dimension name. |
[in] | xory | Flag telling if the dimension is associated with the "x" or "y" axis of the 2d domain. Allowed values are "x" or "y". |
[in] | domain_position | Domain position. |
Definition at line 442 of file fms_netcdf_domain_io.F90.
subroutine, public fms_netcdf_domain_io_mod::register_domain_variable | ( | type(fmsnetcdfdomainfile_t), intent(inout) | fileobj, |
character(len=*), intent(in) | variable_name, | ||
character(len=*), intent(in) | variable_type, | ||
character(len=*), dimension(:), intent(in), optional | dimensions | ||
) |
Add a domain decomposed variable.
[in,out] | fileobj | File object. |
[in] | variable_name | Variable name. |
[in] | variable_type | Variable type. Allowed values are: "int", "int64", "float", or "double". |
[in] | dimensions | Dimension names. |
Definition at line 538 of file fms_netcdf_domain_io.F90.
subroutine, public fms_netcdf_domain_io_mod::restore_domain_state | ( | type(fmsnetcdfdomainfile_t), intent(inout) | fileobj, |
integer, intent(in), optional | unlim_dim_level, | ||
logical, intent(in), optional | ignore_checksum | ||
) |
Loop through registered restart variables and read them from a netcdf file.
[in,out] | fileobj | File object. |
[in] | unlim_dim_level | Unlimited dimension level. |
[in] | ignore_checksum | Checksum data integrity flag. |
Definition at line 628 of file fms_netcdf_domain_io.F90.
subroutine, public fms_netcdf_domain_io_mod::save_domain_restart | ( | type(fmsnetcdfdomainfile_t), intent(in) | fileobj, |
integer, intent(in), optional | unlim_dim_level | ||
) |
Loop through registered restart variables and write them to a netcdf file.
[in] | fileobj | File object. |
[in] | unlim_dim_level | Unlimited dimension level. |
Definition at line 560 of file fms_netcdf_domain_io.F90.