FMS 2025.01.02-dev
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. | |
subroutine | append_domain_decomposed_dimension (name_, position_, array, size_) |
Add a domain decomposed dimension to an array. | |
subroutine, public | close_domain_file (fileobj) |
Close a domain netcdf file. | |
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. | |
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. | |
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. | |
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. | |
subroutine, public | get_compute_domain_dimension_indices (fileobj, dimname, indices) |
Return an array of compute domain indices. | |
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. | |
integer function | get_domain_decomposed_index (name_, array, size_) |
Get the index of a domain decomposed dimension. | |
integer function | get_domain_position (name_, array, size_) |
Given a domain decomposed dimension, get its domain position. | |
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. | |
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. | |
logical function, public | is_dimension_registered (fileobj, dimension_name) |
Determine whether a domain-decomposed dimension has been registered to the file object. | |
logical function | is_variable_domain_decomposed (fileobj, variable_name, broadcast, xindex, yindex, xpos, ypos) |
Determine if a variable is "domain decomposed.". | |
logical function, public | open_domain_file (fileobj, path, mode, domain, nc_format, is_restart, dont_add_res_to_filename) |
Open a domain netcdf file. | |
subroutine, public | register_domain_decomposed_dimension (fileobj, dim_name, xory, domain_position) |
Add a dimension to a file associated with a two-dimensional domain. | |
subroutine, public | register_domain_variable (fileobj, variable_name, variable_type, dimensions) |
Add a domain decomposed variable. | |
subroutine, public | restore_domain_state (fileobj, unlim_dim_level, ignore_checksum) |
Loop through registered restart variables and read them from a netcdf file. | |
subroutine, public | save_domain_restart (fileobj, unlim_dim_level) |
Loop through registered restart variables and write them to a netcdf file. | |
Variables | |
integer, parameter | default_domain_position = center |
character(len=16), parameter | domain_axis_att_name = "domain_axis" |
character(len=16), parameter | domain_pos_att = "domain_position" |
integer, parameter, public | max_num_domain_decomposed_dims = 10 |
integer, parameter | variable_not_found = 0 |
character(len=16), parameter | x = "x" |
character(len=16), parameter | y = "y" |
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.
Public 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.
Public Attributes | |
integer | pos |
Domain position. | |
character(len=nf90_max_name) | varname |
Variable name. | |
integer pos |
Domain position.
Definition at line 52 of file fms_netcdf_domain_io.F90.
character(len=nf90_max_name) varname |
Variable name.
Definition at line 51 of file fms_netcdf_domain_io.F90.
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. | |
logical adjust_indices |
Flag telling if indices need to be adjusted for domain-decomposed read.
Definition at line 69 of file fms_netcdf_domain_io.F90.
|
inherited |
information about the current dimensions for regional restart variables
Definition at line 150 of file netcdf_io.F90.
|
inherited |
"Compressed" dimension.
Definition at line 146 of file netcdf_io.F90.
type(domain2d) domain |
Two-dimensional domain.
Definition at line 59 of file fms_netcdf_domain_io.F90.
|
inherited |
I/O root rank of the pelist.
Definition at line 136 of file netcdf_io.F90.
|
inherited |
Flag telling whether this is a diskless file.
Definition at line 148 of file netcdf_io.F90.
|
inherited |
Flag indicating if the netcdf file type is netcdf4.
Definition at line 133 of file netcdf_io.F90.
|
inherited |
Allocated and set to true if opened.
Definition at line 142 of file netcdf_io.F90.
|
inherited |
Flag telling if the file is readonly.
Definition at line 130 of file netcdf_io.F90.
|
inherited |
Flag telling if the this file is a restart file (that has internal pointers to data).
Definition at line 139 of file netcdf_io.F90.
|
inherited |
Flag telling if the current rank is the I/O root.
Definition at line 137 of file netcdf_io.F90.
|
inherited |
Definition at line 141 of file netcdf_io.F90.
|
inherited |
Netcdf file format.
Definition at line 132 of file netcdf_io.F90.
|
inherited |
Netcdf file id.
Definition at line 131 of file netcdf_io.F90.
character(len=fms_path_len) non_mangled_path |
Non-domain-mangled file path.
Definition at line 68 of file fms_netcdf_domain_io.F90.
|
inherited |
Number of compressed dimensions.
Definition at line 147 of file netcdf_io.F90.
|
inherited |
Number of registered restart variables.
Definition at line 145 of file netcdf_io.F90.
integer nx |
Number of "x" dimensions.
Definition at line 63 of file fms_netcdf_domain_io.F90.
integer ny |
Number of "y" dimensions.
Definition at line 67 of file fms_netcdf_domain_io.F90.
|
inherited |
File path.
Definition at line 129 of file netcdf_io.F90.
|
inherited |
List of ranks who will communicate.
Definition at line 134 of file netcdf_io.F90.
|
inherited |
Array of registered restart variables.
Definition at line 143 of file netcdf_io.F90.
|
inherited |
MPI communicator used for collective reads. To be replaced with a real communicator at user request.
Definition at line 155 of file netcdf_io.F90.
|
inherited |
Definition at line 149 of file netcdf_io.F90.
|
inherited |
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())
Definition at line 152 of file netcdf_io.F90.
type(domaindimension_t), dimension(:), allocatable xdims |
Dimensions associated with the "x" axis of a 2d domain.
Definition at line 60 of file fms_netcdf_domain_io.F90.
type(domaindimension_t), dimension(:), allocatable ydims |
Dimensions associated with the "y" axis of a 2d domain.
Definition at line 64 of file fms_netcdf_domain_io.F90.
|
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 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 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 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 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 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 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 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 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 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 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.
|
private |
Definition at line 40 of file fms_netcdf_domain_io.F90.
|
private |
Definition at line 42 of file fms_netcdf_domain_io.F90.
|
private |
Definition at line 41 of file fms_netcdf_domain_io.F90.
integer, parameter, public max_num_domain_decomposed_dims = 10 |
Definition at line 38 of file fms_netcdf_domain_io.F90.
|
private |
Definition at line 39 of file fms_netcdf_domain_io.F90.
|
private |
Definition at line 43 of file fms_netcdf_domain_io.F90.
|
private |
Definition at line 44 of file fms_netcdf_domain_io.F90.