329 #include <fms_platform.h> 330 #define _MAX_FILE_UNITS 1024 338 use mpp_mod,
only :
mpp_error, fatal, warning, note, stdin, stdout, stderr, stdlog
340 use mpp_mod,
only : mpp_init, mpp_sync, mpp_clock_id, mpp_clock_begin, mpp_clock_end
341 use mpp_mod,
only : mpp_clock_sync, mpp_clock_detailed, clock_routine
348 use mpp_domains_mod,
only :
operator( .NE. ), mpp_get_domain_shift, mpp_get_ug_compute_domains
349 use mpp_domains_mod,
only : mpp_get_io_domain, mpp_domain_is_tile_root_pe, mpp_get_domain_tile_root_pe
350 use mpp_domains_mod,
only : mpp_get_tile_id, mpp_get_tile_npes, mpp_get_io_domain_layout
358 mpp_get_ug_io_domain, &
359 mpp_domain_ug_is_tile_root_pe, &
360 mpp_get_ug_domain_tile_id, &
361 mpp_get_ug_domain_npes, &
362 mpp_get_io_domain_ug_layout, &
363 mpp_get_ug_compute_domain, &
364 mpp_get_ug_domain_pelist
371 #include <netcdf.inc> 375 public :: mpp_wronly, mpp_rdonly, mpp_append, mpp_overwr, mpp_ascii, mpp_ieee32
376 public :: mpp_native, mpp_netcdf, mpp_sequential, mpp_direct, mpp_single
377 public :: mpp_multi, mpp_delete, mpp_collect
379 public :: max_file_size
387 public :: mpp_get_iospec,
mpp_get_id, mpp_get_ncid, mpp_get_unit_range, mpp_is_valid
388 public :: mpp_set_unit_range, mpp_get_info,
mpp_get_atts, mpp_get_fields
389 public :: mpp_get_times, mpp_get_axes, mpp_get_recdimid, mpp_get_axis_data, mpp_get_axis_by_name
390 public :: mpp_io_set_stack_size, mpp_get_field_index, mpp_get_axis_index
392 public :: mpp_get_att_type, mpp_get_att_name, mpp_get_att_real, mpp_get_att_char
393 public :: mpp_get_att_real_scalar, mpp_get_axis_length, mpp_is_dist_ioroot
394 public :: mpp_get_file_name, mpp_file_is_opened, mpp_attribute_exist
395 public :: mpp_io_clock_on, mpp_get_time_axis, mpp_get_default_calendar
396 public :: mpp_get_dimension_length, mpp_get_axis_bounds
399 public :: mpp_io_init, mpp_io_exit, netcdf_err, mpp_flush, mpp_get_maxunits, do_cf_compliance
405 public ::
mpp_read, mpp_read_meta, mpp_get_tavg_info
409 public :: mpp_open, mpp_close
419 character(len=128) :: name
420 character(len=MAX_ATT_LENGTH) :: catt
421 real,
pointer :: fatt(:) =>null()
426 character(len=128) :: name
427 character(len=128) :: name_bounds
428 character(len=128) :: units
429 character(len=256) :: longname
430 character(len=8) :: cartesian
431 character(len=256) :: compressed
432 character(len=24) :: calendar
433 integer :: sense, len
435 real,
pointer :: data(:) =>null()
436 real,
pointer :: data_bounds(:) =>null()
437 integer,
pointer :: idata(:) =>null()
438 integer :: id, did,
type, natt
452 character(len=128) :: name
453 character(len=128) :: units
454 character(len=256) :: longname
455 character(len=256) :: standard_name
456 real ::
min,
max, missing, fill, scale, add
458 integer(LONG_KIND),
dimension(3) :: checksum
462 integer,
pointer ::
size(:) =>null()
463 integer :: time_axis_index
464 integer :: id,
type, natt, ndim
471 character(len=256) :: name
472 integer :: action, format, access, threading, fileset, record, ncid
473 logical :: opened, initialized, nohdrs
474 integer :: time_level
475 real(DOUBLE_KIND) :: time
477 logical :: write_on_this_pe
478 logical :: read_on_this_pe
479 logical :: io_domain_exist
482 real(DOUBLE_KIND),
pointer :: time_values(:) =>null()
486 integer :: ndim, nvar, natt
505 module procedure mpp_get_axis_id
506 module procedure mpp_get_field_id
523 module procedure mpp_get_global_atts
524 module procedure mpp_get_field_atts
525 module procedure mpp_get_axis_atts
529 module procedure mpp_get_field_att_text
595 module procedure mpp_read_2ddecomp_r2d
596 module procedure mpp_read_2ddecomp_r3d
597 module procedure mpp_read_2ddecomp_r4d
598 module procedure mpp_read_r0d
599 module procedure mpp_read_r1d
600 module procedure mpp_read_r2d
601 module procedure mpp_read_r3d
602 module procedure mpp_read_r4d
603 module procedure mpp_read_text
604 module procedure mpp_read_region_r2d
605 module procedure mpp_read_region_r3d
607 module procedure mpp_read_region_r2d_r8
608 module procedure mpp_read_region_r3d_r8
609 module procedure mpp_read_2ddecomp_r2d_r8
610 module procedure mpp_read_2ddecomp_r3d_r8
611 module procedure mpp_read_2ddecomp_r4d_r8
645 module procedure mpp_read_distributed_ascii_r1d
646 module procedure mpp_read_distributed_ascii_i1d
647 module procedure mpp_read_distributed_ascii_a1d
687 module procedure mpp_read_compressed_r1d
688 module procedure mpp_read_compressed_r2d
689 module procedure mpp_read_compressed_r3d
804 module procedure mpp_write_meta_var
805 module procedure mpp_write_meta_scalar_r
806 module procedure mpp_write_meta_scalar_i
807 module procedure mpp_write_meta_axis_r1d
808 module procedure mpp_write_meta_axis_i1d
809 module procedure mpp_write_meta_axis_unlimited
810 module procedure mpp_write_meta_field
811 module procedure mpp_write_meta_global
812 module procedure mpp_write_meta_global_scalar_r
813 module procedure mpp_write_meta_global_scalar_i
817 module procedure mpp_copy_meta_axis
818 module procedure mpp_copy_meta_field
819 module procedure mpp_copy_meta_global
824 module procedure mpp_modify_field_meta
825 module procedure mpp_modify_axis_meta
912 module procedure write_record_default
914 module procedure write_record_r8
919 module procedure mpp_write_2ddecomp_r2d
920 module procedure mpp_write_2ddecomp_r3d
921 module procedure mpp_write_2ddecomp_r4d
923 module procedure mpp_write_2ddecomp_r2d_r8
924 module procedure mpp_write_2ddecomp_r3d_r8
925 module procedure mpp_write_2ddecomp_r4d_r8
927 module procedure mpp_write_r0d
928 module procedure mpp_write_r1d
929 module procedure mpp_write_r2d
930 module procedure mpp_write_r3d
931 module procedure mpp_write_r4d
932 module procedure mpp_write_axis
977 module procedure mpp_write_compressed_r1d
978 module procedure mpp_write_compressed_r2d
979 module procedure mpp_write_compressed_r3d
1012 module procedure mpp_write_unlimited_axis_r1d
1034 module procedure mpp_def_dim_nodata
1035 module procedure mpp_def_dim_int
1036 module procedure mpp_def_dim_real
1079 #include<file_version.h> 1087 module procedure mpp_io_unstructured_write_r_1d
1088 module procedure mpp_io_unstructured_write_r_2d
1089 module procedure mpp_io_unstructured_write_r_3d
1090 module procedure mpp_io_unstructured_write_r_4d
1094 module procedure mpp_io_unstructured_read_r_1d
1095 module procedure mpp_io_unstructured_read_r_2d
1096 module procedure mpp_io_unstructured_read_r_3d
1102 #include <mpp_io_util.inc> 1103 #include <mpp_io_misc.inc> 1104 #include <mpp_io_connect.inc> 1105 #include <mpp_io_read.inc> 1106 #include <mpp_io_write.inc> 1110 #include <mpp_io_unstructured_write.inc> 1111 #include <mpp_io_unstructured_read.inc>
integer, parameter, public mpp_wronly
integer, parameter, public mpp_ieee32
type(atttype), save, public default_att
logical module_is_initialized
integer, parameter, public mpp_ascii
real(double_kind), parameter, public mpp_fill_double
integer, parameter, public nullunit
integer, parameter max_att_length
integer, parameter, public mpp_collect
integer, parameter, public corner
integer, parameter, public mpp_rdonly
integer, parameter, public mpp_delete
logical global_field_on_root_pe
integer, parameter, public global_root_only
integer, parameter, public mpp_sequential
type(filetype), dimension(:), allocatable mpp_file
integer, parameter, public yupdate
integer, parameter, public mpp_native
character(len=input_str_length), dimension(:), allocatable, target, public input_nml_file
integer, parameter, public mpp_single
integer, parameter, public mpp_debug
integer, parameter, public mpp_netcdf
integer, parameter, public center
integer, parameter, public mpp_overwr
type(axistype), save, public default_axis
integer(int_kind), parameter, public mpp_fill_int
integer, parameter, public mpp_multi
integer, parameter, public east
real(double_kind), parameter, public nulltime
integer(long_kind), parameter, public max_file_size
integer, parameter, public all_pes
integer mpp_io_stack_size
integer, parameter, public mpp_verbose
integer, parameter, public xupdate
************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************subroutine READ_RECORD_CORE_(unit, field, nwords, data, start, axsiz) integer, intent(in) ::unit type(fieldtype), intent(in) ::field integer, intent(in) ::nwords MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in) ::start(:), axsiz(:) integer(SHORT_KIND) ::i2vals(nwords)!rab used in conjunction with transfer intrinsic to determine size of a variable integer(KIND=1) ::one_byte(8) integer ::word_sz!#ifdef __sgi integer(INT_KIND) ::ivals(nwords) real(FLOAT_KIND) ::rvals(nwords)!#else! integer ::ivals(nwords)! real ::rvals(nwords)!#endif real(DOUBLE_KIND) ::r8vals(nwords) pointer(ptr1, i2vals) pointer(ptr2, ivals) pointer(ptr3, rvals) pointer(ptr4, r8vals) if(mpp_io_stack_size< nwords) call mpp_io_set_stack_size(nwords) call mpp_error(FATAL, 'MPP_READ currently requires use_netCDF option') end subroutine READ_RECORD_CORE_ subroutine READ_RECORD_(unit, field, nwords, data, time_level, domain, position, tile_count, start_in, axsiz_in)!routine that is finally called by all mpp_read routines to perform the read!a non-netCDF record contains:! field ID! a set of 4 coordinates(is:ie, js:je) giving the data subdomain! a timelevel and a timestamp(=NULLTIME if field is static)! 3D real data(stored as 1D)!if you are using direct access I/O, the RECL argument to OPEN must be large enough for the above!in a global direct access file, record position on PE is given by %record.!Treatment of timestamp:! We assume that static fields have been passed without a timestamp.! Here that is converted into a timestamp of NULLTIME.! For non-netCDF fields, field is treated no differently, but is written! with a timestamp of NULLTIME. There is no check in the code to prevent! the user from repeatedly writing a static field. integer, intent(in) ::unit, nwords type(fieldtype), intent(in) ::field MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in), optional ::time_level type(domain2D), intent(in), optional ::domain integer, intent(in), optional ::position, tile_count integer, intent(in), optional ::start_in(:), axsiz_in(:) integer, dimension(size(field%axes(:))) ::start, axsiz integer ::tlevel !, subdomain(4) integer ::i, error, is, ie, js, je, isg, ieg, jsg, jeg type(domain2d), pointer ::io_domain=> tlevel if(PRESENT(start_in) .AND. PRESENT(axsiz_in)) then if(size(start(! the data domain and compute domain must refer to the subdomain being passed ! In this ! since that attempts to gather all data on PE size(field%axes(:)) axsiz(i)
integer, parameter, public north
integer, parameter, public mpp_direct
integer header_buffer_val
type(fieldtype), save, public default_field
integer, parameter, public mpp_append
real(double_kind), dimension(:), allocatable mpp_io_stack
integer, public file_type_used
type(domain1d), save, public null_domain1d