312 #ifdef use_deprecated_io
314 #define _MAX_FILE_UNITS 1024
319 use netcdf_nf_interfaces
320 use netcdf4_nf_interfaces
323 use mpp_parameter_mod,
only : mpp_wronly, mpp_rdonly, mpp_append, mpp_overwr, mpp_ascii
324 use mpp_parameter_mod,
only : mpp_ieee32, mpp_native, mpp_netcdf, mpp_sequential
325 use mpp_parameter_mod,
only : mpp_direct, mpp_single, mpp_multi, mpp_delete, mpp_collect
326 use mpp_parameter_mod,
only : mpp_debug, mpp_verbose, nullunit, nulltime, all_pes
327 use mpp_parameter_mod,
only : center, east, north, corner
328 use mpp_parameter_mod,
only : max_file_size, global_root_only, xupdate, yupdate
332 use mpp_mod,
only : mpp_clock_sync, mpp_clock_detailed, clock_routine
343 use mpp_parameter_mod,
only : mpp_fill_double,mpp_fill_int
348 use mpp_domains_mod,
only:
domainug, &
349 mpp_get_ug_io_domain, &
350 mpp_domain_ug_is_tile_root_pe, &
351 mpp_get_ug_domain_tile_id, &
352 mpp_get_ug_domain_npes, &
353 mpp_get_io_domain_ug_layout, &
354 mpp_get_ug_compute_domain, &
355 mpp_get_ug_domain_pelist
363 public :: mpp_wronly, mpp_rdonly, mpp_append, mpp_overwr, mpp_ascii, mpp_ieee32
364 public :: mpp_native, mpp_netcdf, mpp_sequential, mpp_direct, mpp_single
365 public :: mpp_multi, mpp_delete, mpp_collect
366 public :: file_type_used
367 public :: max_file_size
372 public :: default_field, default_axis, default_att
387 public :: mpp_io_init, mpp_io_exit, netcdf_err, mpp_flush,
mpp_get_maxunits, do_cf_compliance
393 public ::
mpp_read, mpp_read_meta, mpp_get_tavg_info
397 public :: mpp_open, mpp_close
402 integer FILE_TYPE_USED
403 integer,
parameter :: MAX_ATT_LENGTH = 1280
409 character(len=128) :: name
410 character(len=MAX_ATT_LENGTH) :: catt
411 real,
pointer :: fatt(:) =>null()
417 character(len=128) :: name
418 character(len=128) :: name_bounds
419 character(len=128) :: units
420 character(len=256) :: longname
421 character(len=8) :: cartesian
422 character(len=256) :: compressed
423 character(len=24) :: calendar
424 integer :: sense, len
425 type(domain1D) :: domain
426 real,
pointer :: data(:) =>null()
427 real,
pointer :: data_bounds(:) =>null()
428 integer,
pointer :: idata(:) =>null()
429 integer :: id, did,
type, natt
432 type(atttype),
pointer :: Att(:) =>null()
445 character(len=128) :: name
446 character(len=128) :: units
447 character(len=256) :: longname
448 character(len=256) :: standard_name
449 real :: min, max, missing, fill, scale, add
451 integer(i8_kind),
dimension(3) :: checksum
452 type(axistype),
pointer :: axes(:) =>null()
455 integer,
pointer :: size(:) =>null()
456 integer :: time_axis_index
457 integer :: id,
type, natt, ndim
458 type(atttype),
pointer :: Att(:) =>null()
465 character(len=256) :: name
466 integer :: action, format, access, threading, fileset, record, ncid
467 logical :: opened, initialized, nohdrs
468 integer :: time_level
469 real(r8_kind) :: time
471 logical :: write_on_this_pe
472 logical :: read_on_this_pe
473 logical :: io_domain_exist
476 real(r8_kind),
pointer :: time_values(:) =>null()
480 integer :: ndim, nvar, natt
483 type(axistype),
pointer :: axis(:) =>null()
484 type(fieldtype),
pointer :: var(:) =>null()
485 type(atttype),
pointer :: att(:) =>null()
486 type(domain2d),
pointer :: domain =>null()
489 type(domainUG),
pointer :: domain_ug => null()
501 module procedure mpp_get_axis_id
502 module procedure mpp_get_field_id
524 module procedure mpp_get_field_atts
525 module procedure mpp_get_axis_atts
595 module procedure mpp_read_2ddecomp_r2d_r4
596 module procedure mpp_read_2ddecomp_r3d_r4
597 module procedure mpp_read_2ddecomp_r4d_r4
598 module procedure mpp_read_2ddecomp_r2d_r8
599 module procedure mpp_read_2ddecomp_r3d_r8
600 module procedure mpp_read_2ddecomp_r4d_r8
601 module procedure mpp_read_region_r2d_r4
602 module procedure mpp_read_region_r3d_r4
603 module procedure mpp_read_region_r2d_r8
604 module procedure mpp_read_region_r3d_r8
605 module procedure mpp_read_r0d_r4
606 module procedure mpp_read_r1d_r4
607 module procedure mpp_read_r2d_r4
608 module procedure mpp_read_r3d_r4
609 module procedure mpp_read_r4d_r4
610 module procedure mpp_read_r0d_r8
611 module procedure mpp_read_r1d_r8
612 module procedure mpp_read_r2d_r8
613 module procedure mpp_read_r3d_r8
614 module procedure mpp_read_r4d_r8
615 module procedure mpp_read_text
648 module procedure mpp_read_distributed_ascii_r1d
649 module procedure mpp_read_distributed_ascii_i1d
650 module procedure mpp_read_distributed_ascii_a1d
690 module procedure mpp_read_compressed_r1d_r4
691 module procedure mpp_read_compressed_r2d_r4
692 module procedure mpp_read_compressed_r3d_r4
693 module procedure mpp_read_compressed_r1d_r8
694 module procedure mpp_read_compressed_r2d_r8
695 module procedure mpp_read_compressed_r3d_r8
887 module procedure mpp_write_meta_var
888 module procedure mpp_write_meta_scalar_r
889 module procedure mpp_write_meta_scalar_i
890 module procedure mpp_write_meta_axis_r1d
891 module procedure mpp_write_meta_axis_i1d
892 module procedure mpp_write_meta_axis_unlimited
893 module procedure mpp_write_meta_field
895 module procedure mpp_write_meta_global_scalar_r
896 module procedure mpp_write_meta_global_scalar_i
900 module procedure mpp_copy_meta_axis
901 module procedure mpp_copy_meta_field
902 module procedure mpp_copy_meta_global
907 module procedure mpp_modify_field_meta
908 module procedure mpp_modify_axis_meta
995 module procedure write_record_r8
996 module procedure write_record_r4
1000 module procedure mpp_write_2ddecomp_r2d_r8
1001 module procedure mpp_write_2ddecomp_r3d_r8
1002 module procedure mpp_write_2ddecomp_r4d_r8
1003 module procedure mpp_write_2ddecomp_r2d_r4
1004 module procedure mpp_write_2ddecomp_r3d_r4
1005 module procedure mpp_write_2ddecomp_r4d_r4
1006 module procedure mpp_write_r0d_r8
1007 module procedure mpp_write_r1d_r8
1008 module procedure mpp_write_r2d_r8
1009 module procedure mpp_write_r3d_r8
1010 module procedure mpp_write_r4d_r8
1011 module procedure mpp_write_r0d_r4
1012 module procedure mpp_write_r1d_r4
1013 module procedure mpp_write_r2d_r4
1014 module procedure mpp_write_r3d_r4
1015 module procedure mpp_write_r4d_r4
1016 module procedure mpp_write_axis
1061 module procedure mpp_write_compressed_r1d_r8
1062 module procedure mpp_write_compressed_r2d_r8
1063 module procedure mpp_write_compressed_r3d_r8
1064 module procedure mpp_write_compressed_r1d_r4
1065 module procedure mpp_write_compressed_r2d_r4
1066 module procedure mpp_write_compressed_r3d_r4
1099 module procedure mpp_write_unlimited_axis_r1d
1121 module procedure mpp_def_dim_nodata
1122 module procedure mpp_def_dim_int
1123 module procedure mpp_def_dim_real
1131 logical :: module_is_initialized = .false.
1132 logical :: verbose =.false.
1133 logical :: debug = .false.
1134 integer :: maxunits, unit_begin, unit_end
1135 integer :: mpp_io_stack_size=0, mpp_io_stack_hwm=0
1138 character(len=256) :: text
1140 integer :: records_per_pe
1141 integer :: mpp_read_clock=0, mpp_write_clock=0
1142 integer :: mpp_open_clock=0, mpp_close_clock=0
1146 integer :: header_buffer_val = 16384
1147 logical :: global_field_on_root_pe = .true.
1148 logical :: io_clocks_on = .false.
1149 integer :: shuffle = 0
1150 integer :: deflate = 0
1151 integer :: deflate_level = -1
1152 logical :: cf_compliance = .false.
1154 namelist /mpp_io_nml/header_buffer_val, global_field_on_root_pe, io_clocks_on, &
1155 shuffle, deflate_level, cf_compliance
1157 real(r8_kind),
allocatable :: mpp_io_stack(:)
1158 type(axistype),
save :: default_axis
1159 type(fieldtype),
save :: default_field
1160 type(atttype),
save :: default_att
1161 type(filetype),
allocatable :: mpp_file(:)
1163 integer :: pack_size
1166 #include<file_version.h>
1196 #include <mpp_io_util.inc>
1197 #include <mpp_io_misc.inc>
1198 #include <mpp_io_connect.inc>
1199 #include <mpp_io_read.inc>
1200 #include <mpp_io_write.inc>
1204 #include <mpp_io_unstructured_write.inc>
1205 #include <mpp_io_unstructured_read.inc>
1208 end module mpp_io_mod
integer function mpp_get_domain_npes(domain)
Set user stack size.
integer function mpp_get_tile_npes(domain)
Returns number of processors used on current tile.
subroutine mpp_domains_init(flags)
Initialize domain decomp package.
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, dimension(2) mpp_get_io_domain_layout(domain)
Set user stack size.
integer function mpp_get_domain_tile_root_pe(domain)
Set user stack size.
type(domain2d) function, pointer mpp_get_io_domain(domain)
Set user stack size.
subroutine mpp_get_domain_shift(domain, ishift, jshift, position)
Returns the shift value in x and y-direction according to domain position..
logical function mpp_domain_is_tile_root_pe(domain)
Returns if current pe is the root pe of the tile, if number of tiles on current pe is greater than 1,...
character(len=name_length) function mpp_get_domain_name(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....
These routines retrieve the axis specifications associated with the memory domains....
Retrieve list of PEs associated with a domain decomposition. The 1D version of this call returns an a...
Fill in a global array from domain-decomposed arrays.
Performs halo updates for a given domain.
One dimensional domain used to manage shared data access between pes.
The domain2D type contains all the necessary information to define the global, compute and data domai...
Domain information for managing data on unstructured grids.
character(len=len(mpp_file(1)%name)) function mpp_get_file_name(unit)
return the file name of corresponding unit
subroutine mpp_io_unstructured_read_r4_2d(funit, field, domain, fdata, tindex, start, nread, threading)
Read in two-dimensional data for a field associated with an unstructured mpp domain.
subroutine mpp_get_info(unit, ndim, nvar, natt, ntime)
Get some general information about a file.
subroutine mpp_get_global_atts(unit, global_atts)
Copy global file attributes for use by user.
subroutine mpp_io_unstructured_write_r8_2d(funit, field, domain, fdata, nelems_io, tstamp, default_data)
Write data for a 2D field associated with an unstructured mpp domain to a restart file.
subroutine mpp_io_set_stack_size(n)
Set the mpp_io_stack variable to be at least n LONG words long.
subroutine mpp_io_unstructured_write_r8_4d(funit, field, domain, fdata, nelems_io_in, tstamp, default_data)
Write data for a 4D field associated with an unstructured mpp domain to a restart file.
integer function mpp_get_ncid(unit)
Get netCDF ID of an open file.
integer function mpp_get_dimension_length(unit, dimname, found)
Copy variable information from file (excluding data)
subroutine mpp_get_times(unit, time_values)
Get file time data.
character(len=len(default_axis%calendar)) function mpp_get_default_calendar()
Copy variable information from file (excluding data)
subroutine mpp_io_unstructured_write_r8_3d(funit, field, domain, fdata, nelems_io, tstamp, default_data)
Write data for a 3D field associated with an unstructured mpp domain to a restart file.
real function mpp_get_att_real_scalar(att)
return the real array value of an attribute.
subroutine mpp_io_unstructured_read_r4_1d(funit, field, domain, fdata, tindex, start, nread, threading)
Read in one-dimensional data for a field associated with an unstructured mpp domain.
integer function mpp_get_maxunits()
Return the maximum number of MPP file units available.
logical function mpp_file_is_opened(unit)
return if certain file with unit is opened or not
subroutine mpp_get_fields(unit, variables)
Copy variable information from file (excluding data)
subroutine mpp_io_unstructured_read_r8_1d(funit, field, domain, fdata, tindex, start, nread, threading)
Read in one-dimensional data for a field associated with an unstructured mpp domain.
subroutine mpp_get_field_att_text(unit, fieldname, attname, attvalue)
return the attribute value of given field name
subroutine mpp_io_unstructured_write_r4_4d(funit, field, domain, fdata, nelems_io_in, tstamp, default_data)
Write data for a 4D field associated with an unstructured mpp domain to a restart file.
subroutine mpp_io_unstructured_write_r4_3d(funit, field, domain, fdata, nelems_io, tstamp, default_data)
Write data for a 3D field associated with an unstructured mpp domain to a restart file.
subroutine mpp_io_unstructured_read_r8_3d(funit, field, domain, fdata, tindex, start, nread, threading)
Read in three-dimensional data for a field associated with an unstructured mpp domain.
character(len=len(field%name)) function mpp_get_field_name(field)
return the name of an field
subroutine mpp_get_time_axis(unit, time_axis)
Copy variable information from file (excluding data)
subroutine mpp_io_unstructured_write_r4_2d(funit, field, domain, fdata, nelems_io, tstamp, default_data)
Write data for a 2D field associated with an unstructured mpp domain to a restart file.
subroutine mpp_io_unstructured_read_r4_3d(funit, field, domain, fdata, tindex, start, nread, threading)
Read in three-dimensional data for a field associated with an unstructured mpp domain.
subroutine fillin_fieldtype(field, axes, name, units, longname, min, max, missing, fill, scale, add, pack, time_method, standard_name, checksum)
Fills in a fieldtype variable, and is used with the diag_manager when using fms2_io.
subroutine mpp_write_meta_global(unit, name, rval, ival, cval, pack)
Writes a global metadata attribute to unit <unit> attribute <name> can be an real,...
integer function mpp_get_att_length(att)
return the length of an attribute.
subroutine mpp_get_axes(unit, axes, time_axis)
Copy variable information from file (excluding data)
subroutine mpp_io_unstructured_read_r8_2d(funit, field, domain, fdata, tindex, start, nread, threading)
Read in two-dimensional data for a field associated with an unstructured mpp domain.
character(len=len(att%name)) function mpp_get_att_name(att)
return the name of an attribute.
subroutine mpp_io_unstructured_write_r4_1d(funit, field, domain, fdata, nelems_io, tstamp, default_data)
Write data for a 1D field associated with an unstructured mpp domain to a restart file.
real function, dimension(size(att%fatt(:))) mpp_get_att_real(att)
return the real array value of an attribute.
logical function mpp_io_clock_on()
return mpp_io_nml variable io_clock_on
integer function mpp_get_att_type(att)
return the type of an attribute.
character(len=att%len) function mpp_get_att_char(att)
return the char value of an attribute.
subroutine mpp_io_unstructured_write_r8_1d(funit, field, domain, fdata, nelems_io, tstamp, default_data)
Write data for a 1D field associated with an unstructured mpp domain to a restart file.
Get file global metadata.
subroutine mpp_sync_self(pelist, check, request, msg_size, msg_type)
This is to check if current PE's outstanding puts are complete but we can't use shmem_fence because w...
integer function stdout()
This function returns the current standard fortran unit numbers for output.
subroutine mpp_init(flags, localcomm, test_level, alt_input_nml_path)
Initialize the mpp_mod module. Must be called before any usage.
integer function stderr()
This function returns the current standard fortran unit numbers for error messages.
integer function stdlog()
This function returns the current standard fortran unit numbers for log messages. Log messages,...
integer function mpp_npes()
Returns processor count for current pelist.
integer function mpp_pe()
Returns processor ID.
subroutine mpp_sync(pelist, do_self)
Synchronize PEs in list.
integer function mpp_clock_id(name, flags, grain)
Return an ID for a new or existing clock.
integer function stdin()
This function returns the current standard fortran unit numbers for input.
Perform parallel broadcasts.
Calculate parallel checksums.
Gather data sent from pelist onto the root pe Wrapper for MPI_gather, can be used with and without in...
Recieve data from another PE.
Send data to a receiving PE.
Basic message-passing call.