24 module fms_netcdf_domain_io_mod
 
   36 integer, 
parameter :: no_domain_decomposed_dimension = 0
 
   37 integer, 
parameter, 
public :: max_num_domain_decomposed_dims = 10
 
   38 integer, 
parameter :: variable_not_found = 0
 
   39 integer, 
parameter :: default_domain_position = center
 
   40 character(len=16), 
parameter :: domain_pos_att = 
"domain_position" 
   41 character(len=16), 
parameter :: domain_axis_att_name = 
"domain_axis" 
   42 character(len=16), 
parameter :: x = 
"x" 
   43 character(len=16), 
parameter :: y = 
"y" 
   50   character(len=nf90_max_name) :: varname
 
   67   character(len=FMS_PATH_LEN) :: non_mangled_path
 
   68   logical :: adjust_indices
 
  120   character(len=*), 
intent(in) :: name_
 
  122   integer, 
intent(in) :: size_
 
  127   index_ = variable_not_found
 
  140   character(len=*), 
intent(in) :: name_
 
  141   integer, 
intent(in) :: position_
 
  143   integer, 
intent(inout) :: size_
 
  149       call error(
"variable "//trim(name_)//
" already registered.")
 
  153   if (size_ .gt. 
size(array)) 
then 
  154     call error(
"number of domain decomposed variables exceeds limit.")
 
  156   call string_copy(array(size_)%varname, name_)
 
  157   array(size_)%pos = position_
 
  166   character(len=*), 
intent(in) :: name_
 
  168   integer, 
intent(in) :: size_
 
  172   if (dpos .ne. variable_not_found) 
then 
  173     dpos = array(dpos)%pos
 
  187   character(len=*), 
intent(in) :: variable_name
 
  188   character(len=*), 
intent(in) :: xory
 
  191   logical, 
intent(in), 
optional :: broadcast
 
  199   character(len=nf90_max_name), 
dimension(:), 
allocatable :: dim_names
 
  204   index_ = no_domain_decomposed_dimension
 
  205   if (fileobj%is_root) 
then 
  207     allocate(dim_names(ndims))
 
  217       call error(
"unrecognized xory flag value.")
 
  219     do i = 1, 
size(dim_names)
 
  225     deallocate(dim_names)
 
  227   if (
present(broadcast)) 
then 
  228     if (.not. broadcast) 
then 
  232   call mpp_broadcast(index_, fileobj%io_root, pelist=fileobj%pelist)
 
  239                                        xindex, yindex, xpos, ypos) &
 
  240   result(is_decomposed)
 
  243   character(len=*), 
intent(in) :: variable_name
 
  244   logical, 
intent(in), 
optional :: broadcast
 
  249   integer, 
intent(out), 
optional :: xindex
 
  251   integer, 
intent(out), 
optional :: yindex
 
  253   integer, 
intent(out), 
optional :: xpos
 
  254   integer, 
intent(out), 
optional :: ypos
 
  255   logical :: is_decomposed
 
  257   integer, 
dimension(2) :: indices
 
  259   character(len=nf90_max_name), 
dimension(:), 
allocatable :: dim_names
 
  262   if (
present(xindex)) 
then 
  266   if (
present(yindex)) 
then 
  269   is_decomposed = (indices(1) .ne. no_domain_decomposed_dimension) .and. &
 
  270                   (indices(2) .ne. no_domain_decomposed_dimension)
 
  271   if (is_decomposed) 
then 
  272     if (.not. 
present(xpos) .and. .not. 
present(ypos)) 
then 
  276     allocate(dim_names(ndims))
 
  279     if (
present(xpos)) 
then 
  282     if (
present(ypos)) 
then 
  285     deallocate(dim_names)
 
  287     if (
present(xpos)) 
then 
  290     if (
present(ypos)) 
then 
  300   result(is_registered)
 
  303   character(len=*), 
intent(in) :: dimension_name
 
  306   logical :: is_registered
 
  310   is_registered = .false.
 
  312   if (dpos .ne. variable_not_found) 
then 
  313     is_registered = .true.
 
  316     if (dpos .ne. variable_not_found) is_registered = .true.
 
  327   character(len=*), 
intent(in) :: path
 
  328   character(len=*), 
intent(in) :: mode
 
  331   type(
domain2d), 
intent(in) :: domain
 
  332   logical, 
intent(in), 
optional :: is_restart
 
  335   logical, 
intent(in), 
optional :: dont_add_res_to_filename
 
  338   integer :: nc_format_param
 
  339   integer :: tile_id(1)
 
  341   character(len=FMS_PATH_LEN) :: combined_filepath
 
  342   character(len=FMS_PATH_LEN) :: full_path
 
  344   logical :: dont_add_res
 
  346   integer :: domain_size
 
  349   call string_copy(fileobj%non_mangled_path, path)
 
  361     call string_copy(combined_filepath, path)
 
  367   if (
present(is_restart)) 
then 
  370   fileobj%is_restart = is_res
 
  372   dont_add_res = .false.
 
  373   if (
present(dont_add_res_to_filename)) 
then 
  374     dont_add_res = dont_add_res_to_filename
 
  377   if (is_res .and. .not. dont_add_res) 
then 
  380     call string_copy(full_path, trim(combined_filepath))
 
  383   call string_copy(fileobj%path, trim(full_path))
 
  385   nc_format_param = ior(nf90_netcdf4, nf90_mpiio)
 
  386   fileobj%is_netcdf4 = .true.
 
  388   fileobj%domain = domain
 
  392     call error(
"The use_netcdf_mpi = .true. option for reads is currently not supported")
 
  395     err = nf90_create(trim(fileobj%path), ior(nf90_noclobber, nc_format_param), fileobj%ncid, &
 
  398     err = nf90_create(trim(fileobj%path), ior(nf90_clobber, nc_format_param), fileobj%ncid, &
 
  403   allocate(fileobj%xdims(max_num_domain_decomposed_dims))
 
  405   allocate(fileobj%ydims(max_num_domain_decomposed_dims))
 
  410   allocate(fileobj%pelist(1))
 
  411   fileobj%pelist(1) = 
mpp_pe()
 
  412   fileobj%io_root = 
mpp_pe()
 
  413   fileobj%is_root = .true.
 
  415   fileobj%use_collective = .false. 
 
  416   fileobj%is_diskless = .false.
 
  418   if (fileobj%is_restart) 
then 
  419     allocate(fileobj%restart_vars(max_num_restart_vars))
 
  420     fileobj%num_restart_vars = 0
 
  425   allocate(fileobj%compressed_dims(max_num_compressed_dims))
 
  426   fileobj%num_compressed_dims = 0
 
  428   if (.not.
allocated(fileobj%is_open)) 
allocate(fileobj%is_open)
 
  429   fileobj%is_open = .true.
 
  431   fileobj%bc_dimensions%xlen = 0
 
  432   fileobj%bc_dimensions%ylen = 0
 
  433   fileobj%bc_dimensions%zlen = 0
 
  434   fileobj%bc_dimensions%cur_dim_len = 0
 
  440 function open_domain_file(fileobj, path, mode, domain, nc_format, is_restart, dont_add_res_to_filename, &
 
  441                           use_netcdf_mpi) 
result(success)
 
  444   character(len=*), 
intent(in) :: path
 
  445   character(len=*), 
intent(in) :: mode
 
  448   type(
domain2d), 
intent(in) :: domain
 
  449   character(len=*), 
intent(in), 
optional :: nc_format
 
  455   logical, 
intent(in), 
optional :: is_restart
 
  458   logical, 
intent(in), 
optional :: dont_add_res_to_filename
 
  460   logical, 
intent(in), 
optional :: use_netcdf_mpi
 
  465   integer, 
dimension(2) :: io_layout
 
  466   integer, 
dimension(1) :: tile_id
 
  467   character(len=FMS_PATH_LEN) :: combined_filepath
 
  468   type(
domain2d), 
pointer :: io_domain
 
  469   character(len=FMS_PATH_LEN) :: distributed_filepath
 
  470   integer :: pelist_size
 
  471   integer, 
dimension(:), 
allocatable :: pelist
 
  477   fileobj%use_netcdf_mpi = .false.
 
  478   if (
present(use_netcdf_mpi)) fileobj%use_netcdf_mpi = use_netcdf_mpi
 
  480   if (fileobj%use_netcdf_mpi) 
then 
  481 #ifdef NO_NC_PARALLEL4 
  482     call mpp_error(fatal, 
"NetCDF was not built with HDF5 parallel I/O features, so parallel writes are not supported. & 
  483                           &Please turn parallel writes off for the file: " // trim(path))
 
  486     if (
associated(io_domain)) 
then 
  487       call mpp_error(note, 
"NetCDF MPI is enabled: ignoring I/O domain. Only one output file will be produced.")
 
  503     call string_copy(combined_filepath, path)
 
  507   if (.not. 
associated(io_domain)) 
then 
  508     call error(
"The domain associated with the file:"//trim(path)//
" does not have an io_domain.")
 
  510   if (io_layout(1)*io_layout(2) .gt. 1) 
then 
  514     call string_copy(distributed_filepath, combined_filepath)
 
  519   allocate(pelist(pelist_size))
 
  521   fileobj%adjust_indices = .true. 
 
  524   success = 
netcdf_file_open(fileobj, distributed_filepath, mode, nc_format, pelist, &
 
  525                              is_restart, dont_add_res_to_filename)
 
  528       if (.not. 
string_compare(distributed_filepath, combined_filepath)) 
then 
  529         success2 = 
netcdf_file_open(fileobj2, combined_filepath, mode, nc_format, pelist, &
 
  530                                     is_restart, dont_add_res_to_filename)
 
  532           call error(
"The domain decomposed file:"//trim(path)// &
 
  533                    & 
" contains both combined (*.nc) and distributed files (*.nc.XXXX).")
 
  537       success = 
netcdf_file_open(fileobj, combined_filepath, mode, nc_format, pelist, &
 
  538                                  is_restart, dont_add_res_to_filename)
 
  540       if (success .and. (io_layout(1)*io_layout(2) .gt. 1)) fileobj%adjust_indices = .false.
 
  543   if (.not. success) 
then 
  549   call string_copy(fileobj%non_mangled_path, path)
 
  550   fileobj%domain = domain
 
  551   allocate(fileobj%xdims(max_num_domain_decomposed_dims))
 
  553   allocate(fileobj%ydims(max_num_domain_decomposed_dims))
 
  555   call string_copy(fileobj%non_mangled_path, path)
 
  570   deallocate(fileobj%xdims)
 
  572   deallocate(fileobj%ydims)
 
  581   character(len=*), 
intent(in) :: dim_name
 
  582   character(len=*), 
intent(in) :: xory
 
  586   integer, 
intent(in), 
optional :: domain_position
 
  589   type(
domain2d), 
pointer :: io_domain
 
  590   integer :: domain_size
 
  593   dpos = default_domain_position
 
  595     dpos = domain_position
 
  600   if (fileobj%use_netcdf_mpi) 
then 
  601     io_domain => fileobj%domain
 
  607     if (dpos .ne. center .and. dpos .ne. east) 
then 
  608       call error(
"Only domain_position=center or domain_position=EAST is supported for x dimensions."// &
 
  609                   & 
" Fix your register_axis call for file:"&
 
  610                   &//trim(fileobj%path)//
" and dimension:"//trim(dim_name))
 
  615     if (dpos .ne. center .and. dpos .ne. north) 
then 
  616       call error(
"Only domain_position=center or domain_position=NORTH is supported for y dimensions."// &
 
  617                   & 
" Fix your register_axis call for file:"&
 
  618                   &//trim(fileobj%path)//
" and dimension:"//trim(dim_name))
 
  623     call error(
"The register_axis call for file:"//trim(fileobj%path)//
" and dimension:"//trim(dim_name)// &
 
  624                & 
" has an unrecognized xory flag value:"&
 
  625                &//trim(xory)//
" only 'x' and 'y' are allowed.")
 
  627   if (fileobj%is_readonly .or. (fileobj%mode_is_append .and. 
dimension_exists(fileobj, dim_name))) 
then 
  629     if (dim_size .lt. domain_size) 
then 
  630       call error(
"dimension "//trim(dim_name)//
" in the file "//trim(fileobj%path)//
" is smaller than the size of" &
 
  631                  //
" the associated domain "//trim(xory)//
" axis.")
 
  645   character(len=*), 
intent(in) :: variable_name
 
  647   type(
domain2d), 
pointer :: io_domain
 
  653   integer, 
dimension(2) :: io_layout
 
  658   if (io_layout(1)  .eq. 1 .and. io_layout(2) .eq. 1) 
return 
  659   if (fileobj%use_netcdf_mpi) 
return 
  663   if (dpos .ne. variable_not_found) 
then 
  664     dpos = fileobj%xdims(dpos)%pos
 
  671     if (dpos .ne. variable_not_found) 
then 
  672       dpos = fileobj%ydims(dpos)%pos
 
  686   character(len=*), 
intent(in) :: variable_name
 
  687   character(len=*), 
intent(in) :: variable_type
 
  690   character(len=*), 
dimension(:), 
intent(in), 
optional :: dimensions
 
  691   integer, 
intent(in), 
optional :: chunksizes(:)
 
  693   if (.not. fileobj%is_readonly) 
then 
  695     if (
present(dimensions)) 
then 
  696       if (
size(dimensions) .eq. 1) 
then 
  709   integer, 
intent(in), 
optional :: unlim_dim_level
 
  712   character(len=32) :: chksum
 
  713   logical :: is_decomposed
 
  715   if (.not. fileobj%is_restart) 
then 
  716     call error(
"file "//trim(fileobj%path)// &
 
  717              & 
" is not a restart file. You must set is_restart=.true. in your open_file call.")
 
  721   do i = 1, fileobj%num_restart_vars
 
  722     if (
associated(fileobj%restart_vars(i)%data2d)) 
then 
  724                                        fileobj%restart_vars(i)%data2d, is_decomposed)
 
  725       if (is_decomposed) 
then 
  727                                          "checksum", chksum(1:len(chksum)), str_len=len(chksum))
 
  729     elseif (
associated(fileobj%restart_vars(i)%data3d)) 
then 
  731                                        fileobj%restart_vars(i)%data3d, is_decomposed)
 
  732       if (is_decomposed) 
then 
  734                                          "checksum", chksum(1:len(chksum)), str_len=len(chksum))
 
  736     elseif (
associated(fileobj%restart_vars(i)%data4d)) 
then 
  738                                        fileobj%restart_vars(i)%data4d, is_decomposed)
 
  739       if (is_decomposed) 
then 
  741                                          "checksum", chksum(1:len(chksum)), str_len=len(chksum))
 
  747   do i = 1, fileobj%num_restart_vars
 
  748     if (
associated(fileobj%restart_vars(i)%data0d)) 
then 
  750                            fileobj%restart_vars(i)%data0d, unlim_dim_level=unlim_dim_level)
 
  751     elseif (
associated(fileobj%restart_vars(i)%data1d)) 
then 
  753                            fileobj%restart_vars(i)%data1d, unlim_dim_level=unlim_dim_level)
 
  754     elseif (
associated(fileobj%restart_vars(i)%data2d)) 
then 
  756                            fileobj%restart_vars(i)%data2d, unlim_dim_level=unlim_dim_level)
 
  757     elseif (
associated(fileobj%restart_vars(i)%data3d)) 
then 
  759                            fileobj%restart_vars(i)%data3d, unlim_dim_level=unlim_dim_level)
 
  760     elseif (
associated(fileobj%restart_vars(i)%data4d)) 
then 
  762                            fileobj%restart_vars(i)%data4d, unlim_dim_level=unlim_dim_level)
 
  764       call error(
"This routine only accepts data that is scalar, 1d 2d 3d or 4d."//&
 
  765                  " The data sent in has an unsupported dimensionality")
 
  777   integer, 
intent(in), 
optional :: unlim_dim_level
 
  778   logical, 
intent(in), 
optional :: ignore_checksum
 
  781   character(len=32) :: chksum_in_file
 
  782   character(len=32) :: chksum
 
  783   logical :: chksum_ignore = .false. 
 
  785   logical :: is_decomposed
 
  787   if (
PRESENT(ignore_checksum)) chksum_ignore = ignore_checksum
 
  789   if (.not. fileobj%is_restart) 
then 
  790     call error(
"file "//trim(fileobj%path)// &
 
  791              & 
" is not a restart file. You must set is_restart=.true. in your open_file call.")
 
  793   do i = 1, fileobj%num_restart_vars
 
  794     if (
associated(fileobj%restart_vars(i)%data0d)) 
then 
  796                           fileobj%restart_vars(i)%data0d, unlim_dim_level=unlim_dim_level)
 
  797     elseif (
associated(fileobj%restart_vars(i)%data1d)) 
then 
  799                           fileobj%restart_vars(i)%data1d, unlim_dim_level=unlim_dim_level)
 
  800     elseif (
associated(fileobj%restart_vars(i)%data2d)) 
then 
  802                           fileobj%restart_vars(i)%data2d, unlim_dim_level=unlim_dim_level)
 
  803       if (.not.chksum_ignore) 
then 
  805                                          fileobj%restart_vars(i)%data2d, is_decomposed)
 
  809                                       "checksum", chksum_in_file)
 
  810           if (.not. 
string_compare(trim(adjustl(chksum_in_file)), trim(adjustl(chksum)))) 
then 
  811             call error(
"The checksum in the file:"//trim(fileobj%path)//
" and variable:"// &
 
  812                       & trim(fileobj%restart_vars(i)%varname)// &
 
  813                       &
" does not match the checksum calculated from the data. file:"//trim(adjustl(chksum_in_file))//&
 
  814                       &
" from data:"//trim(adjustl(chksum)))
 
  818     elseif (
associated(fileobj%restart_vars(i)%data3d)) 
then 
  820                           fileobj%restart_vars(i)%data3d, unlim_dim_level=unlim_dim_level)
 
  821       if (.not.chksum_ignore) 
then 
  823                                          fileobj%restart_vars(i)%data3d, is_decomposed)
 
  827                                       "checksum", chksum_in_file(1:len(chksum_in_file)))
 
  828           if (.not. 
string_compare(trim(adjustl(chksum_in_file)), trim(adjustl(chksum)))) 
then 
  829             call error(
"The checksum in the file:"//trim(fileobj%path)//
" and variable:"// &
 
  830                       & trim(fileobj%restart_vars(i)%varname)//&
 
  831                       &
" does not match the checksum calculated from the data. file:"//trim(adjustl(chksum_in_file))//&
 
  832                       &
" from data:"//trim(adjustl(chksum)))
 
  836     elseif (
associated(fileobj%restart_vars(i)%data4d)) 
then 
  838                           fileobj%restart_vars(i)%data4d, unlim_dim_level=unlim_dim_level)
 
  839       if (.not.chksum_ignore) 
then 
  841                                          fileobj%restart_vars(i)%data4d, is_decomposed)
 
  845                                       "checksum", chksum_in_file)
 
  846           if (.not. 
string_compare(trim(adjustl(chksum_in_file)), trim(adjustl(chksum)))) 
then 
  847             call error(
"The checksum in the file:"//trim(fileobj%path)//
" and variable:"// &
 
  848                       & trim(fileobj%restart_vars(i)%varname)//&
 
  849                       &
" does not match the checksum calculated from the data. file:"//trim(adjustl(chksum_in_file))//&
 
  850                       &
" from data:"//trim(adjustl(chksum)))
 
  855       call error(
"There is no data associated with the variable: "//trim(fileobj%restart_vars(i)%varname)//&
 
  856                  &
" and the file: "//trim(fileobj%path)//
". Check your register_restart_variable call")
 
  866   character(len=*), 
intent(in) :: dimname
 
  867   integer, 
dimension(:), 
allocatable, 
intent(inout) :: indices
 
  869   type(
domain2d), 
pointer :: io_domain
 
  877   if (dpos .ne. variable_not_found) 
then 
  878     dpos = fileobj%xdims(dpos)%pos
 
  882     if (dpos .ne. variable_not_found) 
then 
  883       dpos = fileobj%ydims(dpos)%pos
 
  886       call error(
"get_compute_domain_dimension_indices: the input dimension:"//trim(dimname)// &
 
  887                & 
" is not domain decomposed.")
 
  890   if (
allocated(indices)) 
then 
  893   allocate(indices(e-s+1))
 
  903                           isd, isc, xc_size, jsd, jsc, yc_size, &
 
  904                           buffer_includes_halos, extra_x_point, &
 
  907   integer, 
intent(in) :: data_xsize
 
  908   integer, 
intent(in) :: data_ysize
 
  909   type(
domain2d), 
intent(in) :: domain
 
  910   integer, 
intent(in) :: xpos
 
  911   integer, 
intent(in) :: ypos
 
  912   integer, 
intent(out) :: isd
 
  913   integer, 
intent(out) :: isc
 
  914   integer, 
intent(out) :: xc_size
 
  915   integer, 
intent(out) :: jsd
 
  916   integer, 
intent(out) :: jsc
 
  917   integer, 
intent(out) :: yc_size
 
  918   logical, 
intent(out) :: buffer_includes_halos
 
  919   logical, 
intent(out), 
optional :: extra_x_point
 
  920   logical, 
intent(out), 
optional :: extra_y_point
 
  921   character(len=*), 
intent(in), 
optional :: msg
 
  929   type(
domain2d), 
pointer :: io_domain
 
  941   if (
present(extra_x_point)) 
then 
  942     if ((xpos .eq. east) .and. (iec .ne. xmax)) 
then 
  943       extra_x_point = .true.
 
  945       extra_x_point = .false.
 
  952   if (
present(extra_y_point)) 
then 
  953     if ((ypos .eq. north) .and. (jec .ne. ymax)) 
then 
  954       extra_y_point = .true.
 
  956       extra_y_point = .false.
 
  960   buffer_includes_halos = (data_xsize .eq. xd_size) .and. (data_ysize .eq. yd_size)
 
  961   if (.not. buffer_includes_halos .and. data_xsize .ne. xc_size .and. data_ysize &
 
  963      print *, 
"buffer_includes_halos:", buffer_includes_halos, 
" data_xsize:", &
 
  964      data_xsize, 
" xc_size:", xc_size, 
" data_ysize:", data_ysize, 
" yc_size:", &
 
  966     call error(trim(msg)//
" The data is not on the compute domain or the data domain")
 
  976   character(len=*), 
intent(in) :: dimname
 
  977   integer, 
intent(out) :: is
 
  978   integer, 
intent(out) :: ie
 
  979   integer, 
dimension(:), 
allocatable, 
intent(out), 
optional :: indices
 
  981   type(
domain2d), 
pointer :: io_domain
 
  987   if (dpos .ne. variable_not_found) 
then 
  988     dpos = fileobj%xdims(dpos)%pos
 
  992     if (dpos .ne. variable_not_found) 
then 
  993       dpos = fileobj%ydims(dpos)%pos
 
  996       call error(
"get_global_io_domain_indices: the dimension "//trim(dimname)//
" in the file: "//trim(fileobj%path)//&
 
  997                  &
" is not domain decomposed. Check your register_axis call")
 
 1003   if (
present(indices)) 
then 
 1004     if(
allocated(indices)) 
then 
 1005       call error(
"get_global_io_domain_indices: the variable indices should not be allocated.")
 
 1007     allocate(indices(ie-is+1))
 
 1019   character(len=*), 
intent(out)          :: grid_file
 
 1022   character(len=*), 
intent(in)           :: mosaic_file
 
 1023   type(
domain2d),   
intent(in)           :: domain
 
 1024   integer,          
intent(in), 
optional :: tile_count
 
 1030   integer, 
dimension(:), 
allocatable     :: tile_id
 
 1034   if(
present(tile_count)) tile = tile_count
 
 1036   allocate(tile_id(ntileme))
 
 1040       call netcdf_read_data(fileobj, 
"gridfiles", grid_file, corner=tile_id(tile))
 
 1041       grid_file = 
'INPUT/'//trim(grid_file)
 
 1047 include 
"register_domain_restart_variable.inc" 
 1048 include 
"domain_read.inc" 
 1049 include 
"domain_write.inc" 
 1050 #include "compute_global_checksum.inc" 
 1053 end module fms_netcdf_domain_io_mod
 
subroutine domain_read_0d(fileobj, variable_name, vdata, unlim_dim_level, corner)
I/O domain root reads in a domain decomposed variable at a specific unlimited dimension level and sca...
subroutine domain_write_3d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine register_domain_restart_variable_3d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine domain_write_4d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine register_domain_restart_variable_1d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine domain_write_1d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine domain_write_5d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine register_domain_restart_variable_5d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine domain_write_0d(fileobj, variable_name, vdata, unlim_dim_level, corner)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine domain_write_2d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine domain_read_3d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
I/O domain root reads in a domain decomposed variable at a specific unlimited dimension level and sca...
subroutine register_domain_restart_variable_4d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine domain_read_1d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
I/O domain root reads in a domain decomposed variable at a specific unlimited dimension level and sca...
subroutine domain_read_2d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
I/O domain root reads in a domain decomposed variable at a specific unlimited dimension level and sca...
subroutine domain_read_4d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
I/O domain root reads in a domain decomposed variable at a specific unlimited dimension level and sca...
subroutine domain_read_5d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
I/O domain root reads in a domain decomposed variable at a specific unlimited dimension level and sca...
subroutine register_domain_restart_variable_0d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine register_domain_restart_variable_2d(fileobj, variable_name, vdata, dimensions, is_optional, chunksizes)
Add a domain decomposed variable.
subroutine, public restart_filepath_mangle(dest, source)
Add ".res" to an input file path.
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 add_domain_attribute(fileobj, variable_name)
Add a "domain_decomposed" attribute to the axis variables because it is required by mppnccombine.
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.
subroutine, public save_domain_restart(fileobj, unlim_dim_level)
Loop through registered restart variables and write them to a netcdf file.
logical function is_variable_domain_decomposed(fileobj, variable_name, broadcast, xindex, yindex, xpos, ypos)
Determine if a variable is "domain decomposed.".
logical function, public is_dimension_registered(fileobj, dimension_name)
Determine whether a domain-decomposed dimension has been registered to the file object.
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_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 register_domain_variable(fileobj, variable_name, variable_type, dimensions, chunksizes)
Add a domain decomposed variable.
logical function, public open_domain_file(fileobj, path, mode, domain, nc_format, is_restart, dont_add_res_to_filename, use_netcdf_mpi)
Open a domain netcdf 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.
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 close_domain_file(fileobj)
Close a domain netcdf file.
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.
subroutine, public restore_domain_state(fileobj, unlim_dim_level, ignore_checksum)
Loop through registered restart variables and read them from a netcdf file.
integer function open_collective_netcdf_file(fileobj, path, mode, domain, is_restart, dont_add_res_to_filename)
Open a NetCDF-4 file in parallel write mode.
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 append_domain_decomposed_dimension(name_, position_, array, size_)
Add a domain decomposed dimension to an array.
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.
subroutine, public get_compute_domain_dimension_indices(fileobj, dimname, indices)
Return an array of compute domain indices.
integer function get_domain_position(name_, array, size_)
Given a domain decomposed dimension, get its domain position.
integer function mpp_get_domain_npes(domain)
Set user stack size.
integer function mpp_get_domain_tile_commid(domain)
Set user stack size.
integer function, dimension(size(domain%tile_id(:))) mpp_get_tile_id(domain)
Returns the tile_id on current pe.
logical function mpp_domain_is_symmetry(domain)
Set user stack size.
integer function mpp_get_current_ntile(domain)
Returns number of tile on current pe.
integer function mpp_get_ntile_count(domain)
Returns number of tiles in mosaic.
integer function, dimension(2) mpp_get_io_domain_layout(domain)
Set user stack size.
type(domain2d) function, pointer mpp_get_io_domain(domain)
Set user stack size.
These routines retrieve the axis specifications associated with the compute domains....
These routines retrieve the axis specifications associated with the data domains. The domain is a der...
These routines retrieve the axis specifications associated with the global domains....
Retrieve list of PEs associated with a domain decomposition. The 1D version of this call returns an a...
The domain2D type contains all the necessary information to define the global, compute and data domai...
integer, parameter, public mpp_info_null
MPP_INFO_NULL acts as an analagous mpp-macro for MPI_INFO_NULL to share with fms2_io NetCDF4 mpi-io....
integer function mpp_pe()
Returns processor ID.
Perform parallel broadcasts.
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 netcdf_add_dimension(fileobj, dimension_name, dimension_length, is_compressed)
Add a dimension to a file.
integer function, public get_variable_num_dimensions(fileobj, variable_name, broadcast)
Get the number of dimensions a variable depends on.
subroutine, public get_dimension_size(fileobj, dimension_name, dim_size, broadcast)
Get the length of a dimension.
logical function, public dimension_exists(fileobj, dimension_name, broadcast)
Determine if a dimension exists.
logical function, public variable_att_exists(fileobj, variable_name, attribute_name, broadcast)
Determine if a variable's attribute exists.
subroutine, public get_variable_dimension_names(fileobj, variable_name, dim_names, broadcast)
Get the name of a variable's dimensions.
subroutine, public check_netcdf_code(err, msg)
Check for errors returned by netcdf.
subroutine, public netcdf_add_variable(fileobj, variable_name, variable_type, dimensions, chunksizes)
Add a variable to a file.