27 module fms_netcdf_unstructured_domain_io_mod
49 character(len=FMS_PATH_LEN) :: non_mangled_path
84 is_restart, dont_add_res_to_filename) &
88 character(len=*),
intent(in) :: path
89 character(len=*),
intent(in) :: mode
93 character(len=*),
intent(in),
optional :: nc_format
99 logical,
intent(in),
optional :: is_restart
102 logical,
intent(in),
optional :: dont_add_res_to_filename
106 type(
domainug),
pointer :: io_domain
107 integer :: pelist_size
108 integer,
dimension(:),
allocatable :: pelist
109 character(len=FMS_PATH_LEN) :: buf
110 character(len=FMS_PATH_LEN) :: buf2
114 io_domain => mpp_get_ug_io_domain(domain)
115 if (.not.
associated(io_domain))
then
116 call error(
"The input domain associated with the file:"//trim(fileobj%path)//
" does not have an io_domain.")
118 pelist_size = mpp_get_ug_domain_npes(io_domain)
119 allocate(pelist(pelist_size))
120 call mpp_get_ug_domain_pelist(io_domain, pelist)
123 call string_copy(buf, path)
124 if (mpp_get_ug_domain_ntiles(domain) .gt. 1)
then
125 tile_id = mpp_get_ug_domain_tile_id(domain)
132 success =
netcdf_file_open(fileobj, buf, mode, nc_format, pelist, is_restart, dont_add_res_to_filename)
134 if (.not. success)
then
136 if (mpp_get_io_domain_ug_layout(domain) .gt. 1)
then
137 tile_id = mpp_get_ug_domain_tile_id(io_domain)
138 call string_copy(buf2, buf)
143 success =
netcdf_file_open(fileobj, buf, mode, nc_format, pelist, is_restart, dont_add_res_to_filename)
147 if (.not. success)
then
154 fileobj%domain = domain
155 call string_copy(fileobj%non_mangled_path, path)
172 character(len=*),
intent(in) :: dim_name
175 integer,
dimension(:),
allocatable :: c
176 integer,
dimension(:),
allocatable :: e
178 allocate(c(
size(fileobj%pelist)))
179 allocate(e(
size(fileobj%pelist)))
180 io_domain => mpp_get_ug_io_domain(fileobj%domain)
181 call mpp_get_ug_compute_domains(io_domain, begin=c, size=e)
182 if (c(1) .ne. 1)
then
183 c(:) = c(:) - c(1) + 1
193 variable_type, dimensions, chunksizes)
196 character(len=*),
intent(in) :: variable_name
197 character(len=*),
intent(in) :: variable_type
200 character(len=*),
dimension(:),
intent(in),
optional :: dimensions
201 integer,
intent(in),
optional :: chunksizes(:)
211 integer,
intent(in),
optional :: unlim_dim_level
217 include
"register_unstructured_domain_restart_variable.inc"
218 include
"unstructured_domain_read.inc"
219 include
"unstructured_domain_write.inc"
222 end module fms_netcdf_unstructured_domain_io_mod
subroutine unstructured_domain_read_4d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_write_2d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.
subroutine register_unstructured_domain_restart_variable_4d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine unstructured_domain_read_3d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_write_3d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.
subroutine register_unstructured_domain_restart_variable_2d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine unstructured_domain_write_0d(fileobj, variable_name, variable_data, unlim_dim_level, corner)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_read_0d(fileobj, variable_name, buf, unlim_dim_level, corner, broadcast)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_write_4d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.
subroutine register_unstructured_domain_restart_variable_3d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine unstructured_domain_read_5d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_read_2d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.
subroutine register_unstructured_domain_restart_variable_1d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine register_unstructured_domain_restart_variable_5d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine unstructured_domain_write_1d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.
subroutine unstructured_domain_write_5d(fileobj, variable_name, variable_data, unlim_dim_level, corner, edge_lengths)
Wrapper to distinguish interfaces.
subroutine register_unstructured_domain_restart_variable_0d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine unstructured_domain_read_1d(fileobj, variable_name, buf, unlim_dim_level, corner, edge_lengths, broadcast)
Wrapper to distinguish interfaces.
subroutine, public error(mesg)
Print a message to stderr, then stop the program.
subroutine, public io_domain_tile_filepath_mangle(dest, source, io_domain_tile_id)
Add the I/O domain tile id to an input filepath.
logical function, public string_compare(string1, string2, ignore_case)
Compare strings.
subroutine, public domain_tile_filepath_mangle(dest, source, domain_tile_id)
Add the domain tile id to an input filepath.
subroutine, public register_unstructured_dimension(fileobj, dim_name)
Add an unstructured dimension.
logical function, public open_unstructured_domain_file(fileobj, path, mode, domain, nc_format, is_restart, dont_add_res_to_filename)
Open a netcdf file that is associated with an unstructured domain.
subroutine, public close_unstructured_domain_file(fileobj)
Wrapper to distinguish interfaces.
subroutine, public register_unstructured_domain_variable(fileobj, variable_name, variable_type, dimensions, chunksizes)
Wrapper to distinguish interfaces.
subroutine, public unstructured_write_restart(fileobj, unlim_dim_level)
Wrapper to distinguish interfaces.
Type to represent a netCDF file when on a domain decomposed unstructured grid. Used to do distributed...
Domain information for managing data on unstructured grids.
subroutine, public netcdf_file_close(fileobj)
Close a netcdf file.
subroutine, public register_compressed_dimension(fileobj, dimension_name, npes_corner, npes_nelems)
Add a compressed dimension.
subroutine, public netcdf_save_restart(fileobj, unlim_dim_level)
Loop through registered restart variables and write them to a netcdf file.
subroutine, public netcdf_add_variable(fileobj, variable_name, variable_type, dimensions, chunksizes)
Add a variable to a file.
logical function, public netcdf_file_open(fileobj, path, mode, nc_format, pelist, is_restart, dont_add_res_to_filename, tile_comm, use_collective)
Open a netcdf file.
Type to represent a netCDF file. Can be used with multiple cores but only the root pe will perform an...