25 module fms_netcdf_unstructured_domain_io_mod
38 character(len=FMS_PATH_LEN) :: non_mangled_path
73 is_restart, dont_add_res_to_filename) &
77 character(len=*),
intent(in) :: path
78 character(len=*),
intent(in) :: mode
82 character(len=*),
intent(in),
optional :: nc_format
88 logical,
intent(in),
optional :: is_restart
91 logical,
intent(in),
optional :: dont_add_res_to_filename
96 integer :: pelist_size
97 integer,
dimension(:),
allocatable :: pelist
98 character(len=FMS_PATH_LEN) :: buf
99 character(len=FMS_PATH_LEN) :: buf2
103 io_domain => mpp_get_ug_io_domain(domain)
104 if (.not.
associated(io_domain))
then
105 call error(
"The input domain associated with the file:"//trim(fileobj%path)//
" does not have an io_domain.")
107 pelist_size = mpp_get_ug_domain_npes(io_domain)
108 allocate(pelist(pelist_size))
109 call mpp_get_ug_domain_pelist(io_domain, pelist)
112 call string_copy(buf, path)
113 if (mpp_get_ug_domain_ntiles(domain) .gt. 1)
then
114 tile_id = mpp_get_ug_domain_tile_id(domain)
121 success =
netcdf_file_open(fileobj, buf, mode, nc_format, pelist, is_restart, dont_add_res_to_filename)
123 if (.not. success)
then
125 if (mpp_get_io_domain_ug_layout(domain) .gt. 1)
then
126 tile_id = mpp_get_ug_domain_tile_id(io_domain)
127 call string_copy(buf2, buf)
132 success =
netcdf_file_open(fileobj, buf, mode, nc_format, pelist, is_restart, dont_add_res_to_filename)
136 if (.not. success)
then
143 fileobj%domain = domain
144 call string_copy(fileobj%non_mangled_path, path)
161 character(len=*),
intent(in) :: dim_name
164 integer,
dimension(:),
allocatable :: c
165 integer,
dimension(:),
allocatable :: e
167 allocate(c(
size(fileobj%pelist)))
168 allocate(e(
size(fileobj%pelist)))
169 io_domain => mpp_get_ug_io_domain(fileobj%domain)
170 call mpp_get_ug_compute_domains(io_domain, begin=c, size=e)
171 if (c(1) .ne. 1)
then
172 c(:) = c(:) - c(1) + 1
182 variable_type, dimensions)
185 character(len=*),
intent(in) :: variable_name
186 character(len=*),
intent(in) :: variable_type
189 character(len=*),
dimension(:),
intent(in),
optional :: dimensions
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)
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.