24 module fms_netcdf_unstructured_domain_io_mod
37 character(len=FMS_PATH_LEN) :: non_mangled_path
72 is_restart, dont_add_res_to_filename) &
76 character(len=*),
intent(in) :: path
77 character(len=*),
intent(in) :: mode
81 character(len=*),
intent(in),
optional :: nc_format
87 logical,
intent(in),
optional :: is_restart
90 logical,
intent(in),
optional :: dont_add_res_to_filename
95 integer :: pelist_size
96 integer,
dimension(:),
allocatable :: pelist
97 character(len=FMS_PATH_LEN) :: buf
98 character(len=FMS_PATH_LEN) :: buf2
102 io_domain => mpp_get_ug_io_domain(domain)
103 if (.not.
associated(io_domain))
then
104 call error(
"The input domain associated with the file:"//trim(fileobj%path)//
" does not have an io_domain.")
106 pelist_size = mpp_get_ug_domain_npes(io_domain)
107 allocate(pelist(pelist_size))
108 call mpp_get_ug_domain_pelist(io_domain, pelist)
111 call string_copy(buf, path)
112 if (mpp_get_ug_domain_ntiles(domain) .gt. 1)
then
113 tile_id = mpp_get_ug_domain_tile_id(domain)
120 success =
netcdf_file_open(fileobj, buf, mode, nc_format, pelist, is_restart, dont_add_res_to_filename)
122 if (.not. success)
then
124 if (mpp_get_io_domain_ug_layout(domain) .gt. 1)
then
125 tile_id = mpp_get_ug_domain_tile_id(io_domain)
126 call string_copy(buf2, buf)
131 success =
netcdf_file_open(fileobj, buf, mode, nc_format, pelist, is_restart, dont_add_res_to_filename)
135 if (.not. success)
then
142 fileobj%domain = domain
143 call string_copy(fileobj%non_mangled_path, path)
160 character(len=*),
intent(in) :: dim_name
163 integer,
dimension(:),
allocatable :: c
164 integer,
dimension(:),
allocatable :: e
166 allocate(c(
size(fileobj%pelist)))
167 allocate(e(
size(fileobj%pelist)))
168 io_domain => mpp_get_ug_io_domain(fileobj%domain)
169 call mpp_get_ug_compute_domains(io_domain, begin=c, size=e)
170 if (c(1) .ne. 1)
then
171 c(:) = c(:) - c(1) + 1
181 variable_type, dimensions, chunksizes)
184 character(len=*),
intent(in) :: variable_name
185 character(len=*),
intent(in) :: variable_type
188 character(len=*),
dimension(:),
intent(in),
optional :: dimensions
189 integer,
intent(in),
optional :: chunksizes(:)
199 integer,
intent(in),
optional :: unlim_dim_level
205 include
"register_unstructured_domain_restart_variable.inc"
206 include
"unstructured_domain_read.inc"
207 include
"unstructured_domain_write.inc"
210 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.
netcdf unstructured domain file type.
Domain information for managing data on unstructured grids.
subroutine, public netcdf_file_close(fileobj)
Close a netcdf file.
logical function, public netcdf_file_open(fileobj, path, mode, nc_format, pelist, is_restart, dont_add_res_to_filename)
Open 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.