3 !***********************************************************************
4 !* GNU Lesser General Public License
6 !* This file
is part of the GFDL Flexible Modeling System (FMS).
8 !* FMS
is free software: you can redistribute it and/or modify it under
9 !* the terms of the GNU Lesser General Public License as published by
10 !* the Free Software Foundation, either
version 3 of the License, or (at
11 !* your option) any later
version.
13 !* FMS
is distributed in the hope that it
will be useful, but WITHOUT
14 !* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 !* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 !* You should have
received a copy of the GNU Lesser General Public
19 !* License along with FMS. If
not, see <http:
20 !***********************************************************************
22 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28 #undef MPP_READ_2DDECOMP_2D_ 29 #undef READ_RECORD_CORE_ 30 #define READ_RECORD_CORE_ read_record_core 32 #define READ_RECORD_ read_record 33 #define MPP_READ_2DDECOMP_2D_ mpp_read_2ddecomp_r2d 34 #undef MPP_READ_2DDECOMP_3D_ 35 #define MPP_READ_2DDECOMP_3D_ mpp_read_2ddecomp_r3d 36 #undef MPP_READ_2DDECOMP_4D_ 37 #define MPP_READ_2DDECOMP_4D_ mpp_read_2ddecomp_r4d 39 #define MPP_TYPE_ real 43 #undef READ_RECORD_CORE_ 44 #define READ_RECORD_CORE_ read_record_core_r8 46 #define READ_RECORD_ read_record_r8 47 #undef MPP_READ_2DDECOMP_2D_ 48 #define MPP_READ_2DDECOMP_2D_ mpp_read_2ddecomp_r2d_r8 49 #undef MPP_READ_2DDECOMP_3D_ 50 #define MPP_READ_2DDECOMP_3D_ mpp_read_2ddecomp_r3d_r8 51 #undef MPP_READ_2DDECOMP_4D_ 52 #define MPP_READ_2DDECOMP_4D_ mpp_read_2ddecomp_r4d_r8 54 #define MPP_TYPE_ real(DOUBLE_KIND) 58 #undef MPP_READ_COMPRESSED_1D_ 59 #define MPP_READ_COMPRESSED_1D_ mpp_read_compressed_r1d 60 #undef MPP_READ_COMPRESSED_2D_ 61 #define MPP_READ_COMPRESSED_2D_ mpp_read_compressed_r2d 62 #undef MPP_READ_COMPRESSED_3D_ 63 #define MPP_READ_COMPRESSED_3D_ mpp_read_compressed_r3d 65 #define MPP_TYPE_ real 70 ! <SUBROUTINE NAME=
"mpp_read_r4D" INTERFACE=
"mpp_read">
71 ! <IN NAME=
"unit" TYPE=
"integer"></IN>
72 ! <IN NAME=
"field" TYPE=
"type(fieldtype)"></IN>
73 ! <INOUT NAME=
"data" TYPE=
"real" DIM=
"(:,:,:,:)"></INOUT>
74 ! <IN NAME=
"tindex" TYPE=
"integer"></IN>
76 subroutine mpp_read_r4D(
unit,
field, data, tindex)
79 real, intent(inout) :: data(:,:,:,:)
80 integer, intent(in), optional :: tindex
83 end subroutine mpp_read_r4D
86 ! <SUBROUTINE NAME=
"mpp_read_r3D" INTERFACE=
"mpp_read">
87 ! <IN NAME=
"unit" TYPE=
"integer"></IN>
88 ! <IN NAME=
"field" TYPE=
"type(fieldtype)"></IN>
89 ! <INOUT NAME=
"data" TYPE=
"real" DIM=
"(:,:,:)"></INOUT>
90 ! <IN NAME=
"tindex" TYPE=
"integer"></IN>
92 subroutine mpp_read_r3D(
unit,
field, data, tindex)
95 real, intent(inout) :: data(:,:,:)
96 integer, intent(in), optional :: tindex
99 end subroutine mpp_read_r3D
101 subroutine mpp_read_r2D(
unit,
field, data, tindex )
104 real, intent(inout) :: data(:,:)
105 integer, intent(in), optional :: tindex
108 end subroutine mpp_read_r2D
110 subroutine mpp_read_r1D(
unit,
field, data, tindex )
113 real, intent(inout) :: data(:)
114 integer, intent(in), optional :: tindex
117 end subroutine mpp_read_r1D
119 subroutine mpp_read_r0D(
unit,
field, data, tindex )
122 real, intent(inout) :: data
123 integer, intent(in), optional :: tindex
129 end subroutine mpp_read_r0D
134 real, intent(inout) :: data(:,:)
138 "mpp_io_read.inc(mpp_read_region_r2D): size of start and nread must be 4")
140 if(
size(data,1) .NE. nread(1) .OR.
size(data,2) .NE. nread(2)) then
141 call
mpp_error( FATAL,
'mpp_io_read.inc(mpp_read_block_r2D): size mismatch between data and nread')
143 if(nread(3) .NE. 1 .OR. nread(4) .NE. 1) call
mpp_error(FATAL, &
144 "mpp_io_read.inc(mpp_read_region_r2D): nread(3) and nread(4) must be 1")
145 call read_record_core(
unit,
field, nread(1)*nread(2), data,
start, nread)
150 end subroutine mpp_read_region_r2D
155 real, intent(inout) :: data(:,:,:)
159 "mpp_io_read.inc(mpp_read_region_r3D): size of start and nread must be 4")
161 if(
size(data,1) .NE. nread(1) .OR.
size(data,2) .NE. nread(2) .OR.
size(data,3) .NE. nread(3) ) then
162 call
mpp_error( FATAL,
'mpp_io_read.inc(mpp_read_block_r3D): size mismatch between data and nread')
165 "mpp_io_read.inc(mpp_read_region_r3D): nread(4) must be 1")
166 call read_record_core(
unit,
field, nread(1)*nread(2)*nread(3), data,
start, nread)
169 end subroutine mpp_read_region_r3D
172 subroutine mpp_read_region_r2D_r8(
unit,
field, data,
start, nread)
179 "mpp_io_read.inc(mpp_read_region_r2D_r8): size of start and nread must be 4")
181 if(
size(data,1).NE.nread(1) .OR.
size(data,2).NE.nread(2)) then
182 call
mpp_error( FATAL,
'mpp_io_read.inc(mpp_read_block_r2D_r8): size mismatch between data and nread')
184 if(nread(3) .NE. 1 .OR. nread(4) .NE. 1) call
mpp_error(FATAL, &
185 "mpp_io_read.inc(mpp_read_region_r2D_r8): nread(3) and nread(4) must be 1")
186 call read_record_core_r8(
unit,
field, nread(1)*nread(2), data,
start, nread)
189 end subroutine mpp_read_region_r2D_r8
191 subroutine mpp_read_region_r3D_r8(
unit,
field, data,
start, nread)
194 real(kind=
DOUBLE_KIND), intent(inout) :: data(:,:,:)
198 "mpp_io_read.inc(mpp_read_region_r3D_r8): size of start and nread must be 4")
200 if(
size(data,1).NE.nread(1) .OR.
size(data,2).NE.nread(2) .OR.
size(data,3).NE.nread(3) ) then
201 call
mpp_error( FATAL,
'mpp_io_read.inc(mpp_read_block_r3D_r8): size mismatch between data and nread')
204 "mpp_io_read.inc(mpp_read_region_r3D_r8): nread(4) must be 1")
205 call read_record_core_r8(
unit,
field, nread(1)*nread(2)*nread(3), data,
start, nread)
208 end subroutine mpp_read_region_r3D_r8
214 subroutine mpp_read_text(
unit,
field, data, level )
217 character(
len=*), intent(inout) :: data
218 integer, intent(in), optional :: level
227 if(
mpp_file(
unit)%threading.EQ.MPP_SINGLE .AND.
pe.NE.mpp_root_pe() )return
231 if(present(level)) lev = level
233 if(
verbose )print
'(a,2i6,2i5)',
'MPP_READ: PE, unit, %id, level =',
pe,
unit,
mpp_file(
unit)%
id, lev
239 'mpp_io(mpp_read_text): the first dimension size is greater than data length')
242 if(lev .NE. 1) call
mpp_error(FATAL,
'mpp_io(mpp_read_text): level should be 1 when ndim is 1')
246 call
mpp_error(FATAL,
'mpp_io(mpp_read_text): level out of range, level/max_level=' 251 call
mpp_error( FATAL,
'MPP_READ: ndim of text field should be at most 2')
254 if(
verbose )print
'(a,2i6,i6,12i4)',
'mpp_read_text: PE, unit, nwords, start, axsiz=',
pe,
unit,
len(data),
start, axsiz
264 do
n = 1, len_trim(
text)
270 call
mpp_error( FATAL,
'mpp_read_text: the field type should be NF_CHAR' )
273 call
mpp_error( FATAL,
'Currently dont support non-NetCDF mpp read' )
277 call
mpp_error( FATAL,
'mpp_read_text currently requires use_netCDF option' )
280 end subroutine mpp_read_text
282 ! <SUBROUTINE NAME=
"mpp_read_meta">
288 ! This routine
is used to read the <LINK SRC=
"#metadata">metadata</LINK>
289 ! describing the contents of
a file. Each file can contain any number of
291 !
one time axis can be defined
per file). The basic metadata defined <LINK
292 ! SRC=
"#metadata">above</LINK> for <TT>axistype</TT> and
293 ! <TT>fieldtype</TT> are stored in <TT>
mpp_io_mod</TT> and
294 ! can be accessed outside of <TT>
mpp_io_mod</TT> using calls to
295 ! <TT>mpp_get_info</TT>, <TT>mpp_get_atts</TT>,
296 ! <TT>mpp_get_vars</TT> and
297 ! <TT>mpp_get_times</TT>.
300 ! call mpp_read_meta(
unit)
302 ! <IN NAME=
"unit" TYPE=
"integer"> </IN>
304 ! <TT>mpp_read_meta</TT> must be called prior to <TT>mpp_read</TT>.
311 ! with the exception of the (variable) data
is stored. Attributes
312 ! are supplied to the user by get_info,get_atts,get_axes and get_fields
314 ! every
PE is eligible to call mpp_read_meta
318 ! This
is temporary fix for MOM6 reopen_file issue.
323 character(
len=128) ::
name, attname, unlimname, attval, bounds_name
324 logical :: isdim, found_bounds, get_time_info
326 character(
len=64) :: checksum_char
334 get_time_info = .TRUE.
349 !
if no recdim exists, recdimid = -1
350 ! variable
id of unlimdim and
length 352 if( recdim.NE.-1 )then
362 allocate(dimids(
ndim))
388 ! allocate
space for att data and assign
392 if (
len.gt.MAX_ATT_LENGTH) then
393 call
mpp_error(NOTE,'GLOBAL ATT too
long -
not reading this metadata')
403 ! store integers in
float arrays
407 if ( istat .ne. 0 ) then
408 write(
text,'(A)') istat
412 allocate(i2vals(
len), STAT=istat)
413 if ( istat .ne. 0 ) then
414 write(
text,'(A)') istat
415 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array i2vals. STAT = "&
425 if ( istat .ne. 0 ) then
426 write(
text,'(A)') istat
430 allocate(ivals(
len), STAT=istat)
431 if ( istat .ne. 0 ) then
432 write(
text,'(A)') istat
433 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array ivals. STAT = "&
445 if ( istat .ne. 0 ) then
446 write(
text,'(A)') istat
450 allocate(rvals(
len), STAT=istat)
451 if ( istat .ne. 0 ) then
452 write(
text,'(A)') istat
453 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array rvals. STAT = "&
463 if ( istat .ne. 0 ) then
464 write(
text,'(A)') istat
468 allocate(r8vals(
len), STAT=istat)
469 if ( istat .ne. 0 ) then
470 write(
text,'(A)') istat
471 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array r8vals. STAT = "&
529 if ( istat .ne. 0 ) then
530 write(
text,'(A)') istat
534 allocate(ivals(
len), STAT=istat)
535 if ( istat .ne. 0 ) then
536 write(
text,'(A)') istat
537 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array ivals. STAT = "&
546 if ( istat .ne. 0 ) then
547 write(
text,'(A)') istat
549 & "NF_FLOAT
case. STAT = "
551 allocate(rvals(
len), STAT=istat)
552 if ( istat .ne. 0 ) then
553 write(
text,'(A)') istat
554 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array rvals. STAT = "&
563 if ( istat .ne. 0 ) then
564 write(
text,'(A)') istat
566 & "NF_DOUBLE
case. STAT = "
568 allocate(r8vals(
len), STAT=istat)
569 if ( istat .ne. 0 ) then
570 write(
text,'(A)') istat
571 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array r8vals. STAT = "&
580 else
if(get_time_info) then
584 if ( istat .ne. 0 ) then
585 write(
text,'(A)') istat
591 allocate(rvals(
len), STAT=istat)
592 if ( istat .ne. 0 ) then
593 write(
text,'(A)') istat
594 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array rvals. STAT = "&
597 !z1l read from
root pe and broadcast to other processor.
598 !In the future we
will modify the code
if there
is performance issue for very high MPI ranks.
599 if(mpp_pe()==mpp_root_pe()) then
603 call mpp_broadcast(rvals,
len, mpp_root_pe())
607 allocate(r8vals(
len), STAT=istat)
608 if ( istat .ne. 0 ) then
609 write(
text,'(A)') istat
610 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array r8vals. STAT = "&
613 !z1l read from
root pe and broadcast to other processor.
614 !In the future we
will modify the code
if there
is performance issue for very high MPI ranks.
615 if(mpp_pe()==mpp_root_pe()) then
619 call mpp_broadcast(r8vals,
len, mpp_root_pe())
645 if (
len.gt.MAX_ATT_LENGTH) call
mpp_error(FATAL,'DIM ATT too
long')
650 ! store integers in
float arrays
654 if ( istat .ne. 0 ) then
655 write(
text,'(A)') istat
657 & "NF_SHORT CASE. STAT = "
659 allocate(i2vals(
len), STAT=istat)
660 if ( istat .ne. 0 ) then
661 write(
text,'(A)') istat
662 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array i2vals. STAT = "&
665 error=NF_GET_ATT_INT2(
ncid,
i,trim(attname),i2vals);
670 &%Axis(dimid)%Att(
j)%fatt
674 if ( istat .ne. 0 ) then
675 write(
text,'(A)') istat
677 & "NF_INT CASE. STAT = "
679 allocate(ivals(
len), STAT=istat)
680 if ( istat .ne. 0 ) then
681 write(
text,'(A)') istat
682 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array ivals. STAT = "&
685 error=NF_GET_ATT_INT(
ncid,
i,trim(attname),ivals);
689 print *, 'AXIS ',trim(
mpp_file(
unit)%Axis(dimid)%
name),' ATT ',trim(attname),' ',&
694 if ( istat .ne. 0 ) then
695 write(
text,'(A)') istat
697 & "NF_FLOAT CASE. STAT = "
699 allocate(rvals(
len), STAT=istat)
700 if ( istat .ne. 0 ) then
701 write(
text,'(A)') istat
702 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array rvals. STAT = "&
705 error=NF_GET_ATT_REAL(
ncid,
i,trim(attname),rvals);
709 print *, 'AXIS ',trim(
mpp_file(
unit)%Axis(dimid)%
name),' ATT ',trim(attname),' ',&
714 if ( istat .ne. 0 ) then
715 write(
text,'(A)') istat
717 & "NF_DOUBLE CASE. STAT = "
719 allocate(r8vals(
len), STAT=istat)
720 if ( istat .ne. 0 ) then
721 write(
text,'(A)') istat
722 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array r8vals. STAT = "&
725 error=NF_GET_ATT_DOUBLE(
ncid,
i,trim(attname),r8vals);
729 print *, 'AXIS ',trim(
mpp_file(
unit)%Axis(dimid)%
name),' ATT ',trim(attname),' ',&
736 select
case(trim(attname))
741 case('cartesian_axis')
771 else
if( attval.
eq.'
up' )then
787 found_bounds = .
false.
792 found_bounds = .
true.
796 !-- loop through all the
fields to locate bounds_name
797 if( found_bounds ) then
798 found_bounds = .
false.
802 found_bounds = .
true.
810 if( .
not. found_bounds ) then
813 if(trim(
name) == trim(bounds_name)) then
814 found_bounds = .
true.
828 allocate(ivals(2*
len), STAT=istat)
829 if ( istat .ne. 0 ) then
830 write(
text,'(A)') istat
840 allocate(rvals(2*
len), STAT=istat)
841 if ( istat .ne. 0 ) then
842 write(
text,'(A)') istat
852 allocate(r8vals(2*
len), STAT=istat)
853 if ( istat .ne. 0 ) then
854 write(
text,'(A)') istat
871 if (found_bounds) then
879 ! assign variable
info 898 ! determine packing attribute based on NetCDF variable
type 911 call
mpp_error( FATAL, 'Invalid variable
type in NetCDF file' )
923 mpp_file(
unit)%Var(nv)%time_axis_index =
j !dimids(
j). z1l: Should be
j.
924 !This
will cause problem when appending to existed file.
930 ! assign variable atts
951 print *, 'Var ',nv,' ATT ',trim(attname),' ',
mpp_file(
unit)%Var(nv)%Att(
j)%catt(1:
len)
952 ! store integers as
float internally
955 if ( istat .ne. 0 ) then
956 write(
text,'(A)') istat
958 & "NF_SHORT CASE. STAT = "
960 allocate(i2vals(
len), STAT=istat)
961 if ( istat .ne. 0 ) then
962 write(
text,'(A)') istat
963 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array i2vals. STAT = "&
966 error=NF_GET_ATT_INT2(
ncid,
i,trim(attname),i2vals)
970 print *, 'Var ',nv,' ATT ',trim(attname),' ',
mpp_file(
unit)%Var(nv)%Att(
j)%fatt
974 if ( istat .ne. 0 ) then
975 write(
text,'(A)') istat
977 & "NF_INT CASE. STAT = "
979 allocate(ivals(
len), STAT=istat)
980 if ( istat .ne. 0 ) then
981 write(
text,'(A)') istat
982 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array ivals. STAT = "&
985 error=NF_GET_ATT_INT(
ncid,
i,trim(attname),ivals)
989 print *, 'Var ',nv,' ATT ',trim(attname),' ',
mpp_file(
unit)%Var(nv)%Att(
j)%fatt
993 if ( istat .ne. 0 ) then
994 write(
text,'(A)') istat
996 & "NF_FLOAT CASE. STAT = "
998 allocate(rvals(
len), STAT=istat)
999 if ( istat .ne. 0 ) then
1000 write(
text,'(A)') istat
1001 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array rvals. STAT = "&
1004 error=NF_GET_ATT_REAL(
ncid,
i,trim(attname),rvals)
1008 print *, 'Var ',nv,' ATT ',trim(attname),' ',
mpp_file(
unit)%Var(nv)%Att(
j)%fatt
1012 if ( istat .ne. 0 ) then
1013 write(
text,'(A)') istat
1015 & "NF_DOUBLE CASE. STAT = "
1017 allocate(r8vals(
len), STAT=istat)
1018 if ( istat .ne. 0 ) then
1019 write(
text,'(A)') istat
1020 call
mpp_error(FATAL, "
mpp_io_mod(mpp_read_meta): Unable to allocate temporary array r8vals. STAT = "&
1023 error=NF_GET_ATT_DOUBLE(
ncid,
i,trim(attname),r8vals)
1027 print *, 'Var ',nv,' ATT ',trim(attname),' ',
mpp_file(
unit)%Var(nv)%Att(
j)%fatt
1030 call
mpp_error( FATAL, 'Invalid data
type for variable att' )
1033 select
case (trim(attname))
1055 ! Scan checksum attribute for , delimiter. If found implies multiple
time levels.
1059 last = len_trim(checksum_char)
1060 is = index (trim(checksum_char),",") ! A value of 0 implies only 1 checksum value
1061 do while ((
is > 0) .and. (
is < (
last-15)))
1062 is =
is + scan(checksum_char(
is:
last), "," ) ! move starting pointer after ","
1063 num_checksumf = num_checksumf + 1
1066 do
k = 1, num_checksumf
1067 read (checksum_char(
is:
is+15),'(Z16)') checksumf
1069 is =
is + 17 ! Move index past the ,
1074 enddo !
end variable loop
1076 call
mpp_error( FATAL, 'MPP READ CURRENTLY DOES NOT SUPPORT NON-NETCDF' )
1081 call
mpp_error( FATAL,
'MPP_READ currently requires use_netCDF option' )
1084 end subroutine mpp_read_meta
1087 function cut0(
string)
1089 character(
len=*), intent(in) :: string
1093 i = index(string,achar(0))
1100 subroutine mpp_get_tavg_info(
unit,
field,
fields, tstamp, tstart, tend, tavg)
1105 real, intent(inout),
dimension(:) :: tstamp, tstart, tend, tavg
1106 !balaji: added because mpp_read can only read default reals
1107 ! when running with -
r4 this
will read
a default real and then cast
double 1108 real :: t_default_real
1112 logical :: tavg_info_exists
1118 'size mismatch in mpp_get_tavg_info')
1121 call
mpp_error(FATAL,
'size mismatch in mpp_get_tavg_info')
1127 tavg_info_exists = .
false.
1133 tavg_info_exists = .
true.
1139 if (tavg_info_exists) then
1142 do
m = 1,
size(tstart(:))
1144 tstart(
m) = t_default_real
1148 do
m = 1,
size(tend(:))
1150 tend(
m) = t_default_real
1154 do
m = 1,
size(tavg(:))
1156 tavg(
m) = t_default_real
1163 end subroutine mpp_get_tavg_info
1165 !#######################################################################
************************************************************************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:! ***********************************************************************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! MPP_TRANSMIT !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine MPP_TRANSMIT_(put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)!a message-passing routine intended to be reminiscent equally of both MPI and SHMEM!put_data and get_data are contiguous MPP_TYPE_ arrays!at each call, your put_data array is put to to_pe 's get_data! your get_data array is got from from_pe 's put_data!i.e we assume that typically(e.g updating halo regions) each PE performs a put _and_ a get!special PE designations:! NULL_PE:to disable a put or a get(e.g at boundaries)! ANY_PE:if remote PE for the put or get is to be unspecific! ALL_PES:broadcast and collect operations(collect not yet implemented)!ideally we would not pass length, but this f77-style call performs better(arrays passed by address, not descriptor)!further, this permits< length > contiguous words from an array of any rank to be passed(avoiding f90 rank conformance check)!caller is responsible for completion checks(mpp_sync_self) before and after integer, intent(in) ::put_len, to_pe, get_len, from_pe MPP_TYPE_, intent(in) ::put_data(*) MPP_TYPE_, intent(out) ::get_data(*) logical, intent(in), optional ::block integer, intent(in), optional ::tag integer, intent(out), optional ::recv_request, send_request logical ::block_comm integer ::i MPP_TYPE_, allocatable, save ::local_data(:) !local copy used by non-parallel code(no SHMEM or MPI) integer ::comm_tag integer ::rsize if(.NOT.module_is_initialized) call mpp_error(FATAL, 'MPP_TRANSMIT:You must first call mpp_init.') if(to_pe.EQ.NULL_PE .AND. from_pe.EQ.NULL_PE) return block_comm=.true. if(PRESENT(block)) block_comm=block if(debug) then call SYSTEM_CLOCK(tick) write(stdout_unit,'(a, i18, a, i6, a, 2i6, 2i8)')&'T=', tick, ' PE=', pe, ' MPP_TRANSMIT begin:to_pe, from_pe, put_len, get_len=', to_pe, from_pe, put_len, get_len end if comm_tag=DEFAULT_TAG if(present(tag)) comm_tag=tag!do put first and then get if(to_pe.GE.0 .AND. to_pe.LT.npes) then!use non-blocking sends if(debug .and.(current_clock.NE.0)) call SYSTEM_CLOCK(start_tick)!z1l:truly non-blocking send.! if(request(to_pe).NE.MPI_REQUEST_NULL) then !only one message from pe-> to_pe in queue *PE waiting for to_pe ! call error else get_len so only do gets but you cannot have a pure get with MPI call a get means do a wait to ensure put on remote PE is complete error call increase mpp_nml request_multiply call MPP_TRANSMIT get_len end if return end subroutine MPP_TRANSMIT_ ! MPP_BROADCAST ! subroutine but that doesn t allow !broadcast to a subset of PEs This version will
type(ext_fieldtype), dimension(:), pointer, save, private field
*f90 *************************************************************************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 MPP_UPDATE_NEST_FINE_2D_(field, nest_domain, wbuffer, ebuffer, sbuffer, nbuffer, &flags, complete, position, extra_halo, name, tile_count) MPP_TYPE_, intent(in) ::field(:,:) type(nest_domain_type), intent(inout) ::nest_domain MPP_TYPE_, intent(inout) ::wbuffer(:,:) MPP_TYPE_, intent(inout) ::ebuffer(:,:) MPP_TYPE_, intent(inout) ::sbuffer(:,:) MPP_TYPE_, intent(inout) ::nbuffer(:,:) integer, intent(in), optional ::flags logical, intent(in), optional ::complete integer, intent(in), optional ::position integer, intent(in), optional ::extra_halo character(len= *), intent(in), optional ::name integer, intent(in), optional ::tile_count MPP_TYPE_ ::field3D(size(field, 1), size(field, 2), 1) MPP_TYPE_ ::wbuffer3D(size(wbuffer, 1), size(wbuffer, 2), 1) MPP_TYPE_ ::ebuffer3D(size(ebuffer, 1), size(ebuffer, 2), 1) MPP_TYPE_ ::sbuffer3D(size(sbuffer, 1), size(sbuffer, 2), 1) MPP_TYPE_ ::nbuffer3D(size(nbuffer, 1), size(nbuffer, 2), 1) pointer(ptr, field3D) pointer(ptr_w, wbuffer3D) pointer(ptr_e, ebuffer3D) pointer(ptr_s, sbuffer3D) pointer(ptr_n, nbuffer3D) ptr=LOC(field) ptr_w=LOC(wbuffer) ptr_e=LOC(ebuffer) ptr_s=LOC(sbuffer) ptr_n=LOC(nbuffer) call mpp_update_nest_fine(field3D, nest_domain, wbuffer3D, ebuffer3D, sbuffer3D, nbuffer3D, &flags, complete, position, extra_halo, name, tile_count) returnend subroutine MPP_UPDATE_NEST_FINE_2D_subroutine MPP_UPDATE_NEST_FINE_3D_(field, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, &flags, complete, position, extra_halo, name, tile_count) MPP_TYPE_, intent(in) ::field(:,:,:) type(nest_domain_type), intent(inout) ::nest_domain MPP_TYPE_, intent(inout) ::wbuffer(:,:,:) MPP_TYPE_, intent(inout) ::ebuffer(:,:,:) MPP_TYPE_, intent(inout) ::sbuffer(:,:,:) MPP_TYPE_, intent(inout) ::nbuffer(:,:,:) integer, intent(in), optional ::flags logical, intent(in), optional ::complete integer, intent(in), optional ::position integer, intent(in), optional ::extra_halo character(len= *), intent(in), optional ::name integer, intent(in), optional ::tile_count MPP_TYPE_ ::d_type type(nestSpec), pointer ::update=> set_mismatch integer ::tile update_position nbuffersz l_size integer
l_size ! loop over number of fields ke do je do i
l_size ! loop over number of fields ke do je do ie to PE
integer natt
No description.
************************************************************************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=> unit
type(atttype), save, public default_att
integer, parameter, public noleap
integer function read_record(fid, aerosol)
integer, parameter, public no
character(len=128) error_msg
************************************************************************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 MPP_WRITE_UNLIMITED_AXIS_1D_(unit, field, domain, data, nelems_io) integer, intent(in) ::unit type(fieldtype), intent(inout) ::field type(domain2D), intent(inout) ::domain MPP_TYPE_, intent(inout) ::data(:) integer, intent(in) ::nelems_io(:) ! number of compressed elements from each ! member of the io_domain. It MUST have the ! same order as the io_domain pelist. integer, allocatable ::pelist(:) integer ::i, j, nelems, npes type(domain2d), pointer ::io_domain=> allocatable
character(len=256) function cut0(string)
integer, parameter, public up
subroutine, public copy(self, rhs)
integer, private calendar_type
************************************************************************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:! ***********************************************************************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! MPP_TRANSMIT !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine MPP_TRANSMIT_(put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)!a message-passing routine intended to be reminiscent equally of both MPI and SHMEM!put_data and get_data are contiguous MPP_TYPE_ arrays!at each call, your put_data array is put to to_pe 's get_data! your get_data array is got from from_pe 's put_data!i.e we assume that typically(e.g updating halo regions) each PE performs a put _and_ a get!special PE designations:! NULL_PE:to disable a put or a get(e.g at boundaries)! ANY_PE:if remote PE for the put or get is to be unspecific! ALL_PES:broadcast and collect operations(collect not yet implemented)!ideally we would not pass length, but this f77-style call performs better(arrays passed by address, not descriptor)!further, this permits< length > contiguous words from an array of any rank to be passed(avoiding f90 rank conformance check)!caller is responsible for completion checks(mpp_sync_self) before and after integer, intent(in) ::put_len, to_pe, get_len, from_pe MPP_TYPE_, intent(in) ::put_data(*) MPP_TYPE_, intent(out) ::get_data(*) logical, intent(in), optional ::block integer, intent(in), optional ::tag integer, intent(out), optional ::recv_request, send_request logical ::block_comm integer ::i MPP_TYPE_, allocatable, save ::local_data(:) !local copy used by non-parallel code(no SHMEM or MPI) integer ::comm_tag integer ::rsize if(.NOT.module_is_initialized) call mpp_error(FATAL, 'MPP_TRANSMIT:You must first call mpp_init.') if(to_pe.EQ.NULL_PE .AND. from_pe.EQ.NULL_PE) return block_comm=.true. if(PRESENT(block)) block_comm=block if(debug) then call SYSTEM_CLOCK(tick) write(stdout_unit,'(a, i18, a, i6, a, 2i6, 2i8)')&'T=', tick, ' PE=', pe, ' MPP_TRANSMIT begin:to_pe, from_pe, put_len, get_len=', to_pe, from_pe, put_len, get_len end if comm_tag=DEFAULT_TAG if(present(tag)) comm_tag=tag!do put first and then get if(to_pe.GE.0 .AND. to_pe.LT.npes) then!use non-blocking sends if(debug .and.(current_clock.NE.0)) call SYSTEM_CLOCK(start_tick)!z1l:truly non-blocking send.! if(request(to_pe).NE.MPI_REQUEST_NULL) then !only one message from pe-> to_pe in queue *PE waiting for to_pe ! call error else get_len so only do gets but you cannot have a pure get with MPI call a get means do a wait to ensure put on remote PE is complete error call increase mpp_nml request_multiply call MPP_TRANSMIT end
integer(long), parameter true
type(field_mgr_type), dimension(max_fields), private fields
*f90 *************************************************************************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:! ***********************************************************************! this routine is used to retrieve scalar boundary data for symmetric domain. subroutine MPP_GET_BOUNDARY_2D_(field, domain, ebuffer, sbuffer, wbuffer, nbuffer, flags, &position, complete, tile_count) type(domain2D), intent(in) ::domain MPP_TYPE_, intent(in) ::field(:,:) MPP_TYPE_, intent(inout), optional ::ebuffer(:), sbuffer(:), wbuffer(:), nbuffer(:) integer, intent(in), optional ::flags, position, tile_count logical, intent(in), optional ::complete MPP_TYPE_ ::field3D(size(field, 1), size(field, 2), 1) MPP_TYPE_, allocatable, dimension(:,:) ::ebuffer2D, sbuffer2D, wbuffer2D, nbuffer2D integer ::xcount, ycount integer ::ntile logical ::need_ebuffer, need_sbuffer, need_wbuffer, need_nbuffer integer(LONG_KIND), dimension(MAX_DOMAIN_FIELDS, MAX_TILES), save ::f_addrs=-9999 integer(LONG_KIND), dimension(4, MAX_DOMAIN_FIELDS, MAX_TILES), save ::b_addrs=-9999 integer, save ::bsize(4)=0, isize=0, jsize=0, ksize=0, pos, list=0, l_size=0, upflags integer ::buffer_size(4) integer ::max_ntile, tile, update_position, ishift, jshift logical ::do_update, is_complete, set_mismatch character(len=3) ::text MPP_TYPE_ ::d_type type(overlapSpec), pointer ::bound=> NULL() ntile
character(len=32) units
No description.
integer, parameter, public double
type(diag_axis_type), dimension(:), allocatable, save axes
integer, parameter, public none
integer(long), parameter false
l_size ! loop over number of fields ke do j
integer ntime
No description.
l_size ! loop over number of fields ke do je do ie to je n if(.NOT. d_comm%R_do_buf(list)) cycle from_pe
logical module_is_initialized
character(len=128) version
real(double), parameter zero
l_size ! loop over number of fields ke do je do ie to is
integer, parameter, public global
************************************************************************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=> mpp_file(unit)%id
integer nvar
No description.
************************************************************************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:! ***********************************************************************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! MPP_TRANSMIT !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine MPP_TRANSMIT_(put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)!a message-passing routine intended to be reminiscent equally of both MPI and SHMEM!put_data and get_data are contiguous MPP_TYPE_ arrays!at each call, your put_data array is put to to_pe 's get_data! your get_data array is got from from_pe 's put_data!i.e we assume that typically(e.g updating halo regions) each PE performs a put _and_ a get!special PE designations:! NULL_PE:to disable a put or a get(e.g at boundaries)! ANY_PE:if remote PE for the put or get is to be unspecific! ALL_PES:broadcast and collect operations(collect not yet implemented)!ideally we would not pass length, but this f77-style call performs better(arrays passed by address, not descriptor)!further, this permits< length > contiguous words from an array of any rank to be passed(avoiding f90 rank conformance check)!caller is responsible for completion checks(mpp_sync_self) before and after integer, intent(in) ::put_len, to_pe, get_len, from_pe MPP_TYPE_, intent(in) ::put_data(*) MPP_TYPE_, intent(out) ::get_data(*) logical, intent(in), optional ::block integer, intent(in), optional ::tag integer, intent(out), optional ::recv_request, send_request logical ::block_comm integer ::i MPP_TYPE_, allocatable, save ::local_data(:) !local copy used by non-parallel code(no SHMEM or MPI) integer ::comm_tag integer ::rsize if(.NOT.module_is_initialized) call mpp_error(FATAL, 'MPP_TRANSMIT:You must first call mpp_init.') if(to_pe.EQ.NULL_PE .AND. from_pe.EQ.NULL_PE) return block_comm=.true. if(PRESENT(block)) block_comm=block if(debug) then call SYSTEM_CLOCK(tick) write(stdout_unit,'(a, i18, a, i6, a, 2i6, 2i8)')&'T=', tick, ' PE=', pe, ' MPP_TRANSMIT begin:to_pe, from_pe, put_len, get_len=', to_pe, from_pe, put_len, get_len end if comm_tag=DEFAULT_TAG if(present(tag)) comm_tag=tag!do put first and then get if(to_pe.GE.0 .AND. to_pe.LT.npes) then!use non-blocking sends if(debug .and.(current_clock.NE.0)) call SYSTEM_CLOCK(start_tick)!z1l:truly non-blocking send.! if(request(to_pe).NE.MPI_REQUEST_NULL) then !only one message from pe-> to_pe in queue *PE waiting for to_pe ! call error else get_len so only do gets but you cannot have a pure get with MPI call a get means do a wait to ensure put on remote PE is complete error call increase mpp_nml request_multiply call MPP_TRANSMIT get_len end if return end subroutine MPP_TRANSMIT_ ! MPP_BROADCAST ! subroutine but that doesn t allow !broadcast to a subset of PEs This version and mpp_transmit will remain !backward compatible intent(inout) MPP_BROADCAST length
subroutine, private initialize
************************************************************************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 start
subroutine, public info(self)
************************************************************************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:! ***********************************************************************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! MPP_TRANSMIT !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine MPP_TRANSMIT_(put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)!a message-passing routine intended to be reminiscent equally of both MPI and SHMEM!put_data and get_data are contiguous MPP_TYPE_ arrays!at each call, your put_data array is put to to_pe 's get_data! your get_data array is got from from_pe 's put_data!i.e we assume that typically(e.g updating halo regions) each PE performs a put _and_ a get!special PE designations:! NULL_PE:to disable a put or a get(e.g at boundaries)! ANY_PE:if remote PE for the put or get is to be unspecific! ALL_PES:broadcast and collect operations(collect not yet implemented)!ideally we would not pass length, but this f77-style call performs better(arrays passed by address, not descriptor)!further, this permits< length > contiguous words from an array of any rank to be passed(avoiding f90 rank conformance check)!caller is responsible for completion checks(mpp_sync_self) before and after integer, intent(in) ::put_len, to_pe, get_len, from_pe MPP_TYPE_, intent(in) ::put_data(*) MPP_TYPE_, intent(out) ::get_data(*) logical, intent(in), optional ::block integer, intent(in), optional ::tag integer, intent(out), optional ::recv_request, send_request logical ::block_comm integer ::i MPP_TYPE_, allocatable, save ::local_data(:) !local copy used by non-parallel code(no SHMEM or MPI) integer ::comm_tag integer ::rsize if(.NOT.module_is_initialized) call mpp_error(FATAL, 'MPP_TRANSMIT:You must first call mpp_init.') if(to_pe.EQ.NULL_PE .AND. from_pe.EQ.NULL_PE) return block_comm=.true. if(PRESENT(block)) block_comm=block if(debug) then call SYSTEM_CLOCK(tick) write(stdout_unit,'(a, i18, a, i6, a, 2i6, 2i8)')&'T=', tick, ' PE=', pe, ' MPP_TRANSMIT begin:to_pe, from_pe, put_len, get_len=', to_pe, from_pe, put_len, get_len end if comm_tag=DEFAULT_TAG if(present(tag)) comm_tag=tag!do put first and then get if(to_pe.GE.0 .AND. to_pe.LT.npes) then!use non-blocking sends if(debug .and.(current_clock.NE.0)) call SYSTEM_CLOCK(start_tick)!z1l:truly non-blocking send.! if(request(to_pe).NE.MPI_REQUEST_NULL) then !only one message from pe-> to_pe in queue *PE waiting for to_pe ! call error else get_len so only do gets but you cannot have a pure get with MPI call mpp_error(FATAL, 'MPP_TRANSMIT:you cannot transmit to ANY_PE using MPI.') else if(to_pe.NE.NULL_PE) then !no other valid cases except NULL_PE call mpp_error(FATAL
type(axistype), save, public default_axis
************************************************************************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 case
integer, parameter, public down
************************************************************************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=> id
subroutine calendar(year, month, day, hour)
integer sense
No description.
integer, parameter, public no_calendar
integer, parameter, public unknown
real(double), parameter one
logical function received(this, seqno)
type(field_def), target, save root
type(axistype), save time_axis
No description.
type(tms), dimension(nblks), private last
************************************************************************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)
************************************************************************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:! ***********************************************************************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! MPP_TRANSMIT !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine MPP_TRANSMIT_(put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)!a message-passing routine intended to be reminiscent equally of both MPI and SHMEM!put_data and get_data are contiguous MPP_TYPE_ arrays!at each call, your put_data array is put to to_pe 's get_data! your get_data array is got from from_pe 's put_data!i.e we assume that typically(e.g updating halo regions) each PE performs a put _and_ a get!special PE designations:! NULL_PE:to disable a put or a get(e.g at boundaries)! ANY_PE:if remote PE for the put or get is to be unspecific! ALL_PES:broadcast and collect operations(collect not yet implemented)!ideally we would not pass length, but this f77-style call performs better(arrays passed by address, not descriptor)!further, this permits< length > contiguous words from an array of any rank to be passed(avoiding f90 rank conformance check)!caller is responsible for completion checks(mpp_sync_self) before and after integer, intent(in) ::put_len, to_pe, get_len, from_pe MPP_TYPE_, intent(in) ::put_data(*) MPP_TYPE_, intent(out) ::get_data(*) logical, intent(in), optional ::block integer, intent(in), optional ::tag integer, intent(out), optional ::recv_request, send_request logical ::block_comm integer ::i MPP_TYPE_, allocatable, save ::local_data(:) !local copy used by non-parallel code(no SHMEM or MPI) integer ::comm_tag integer ::rsize if(.NOT.module_is_initialized) call mpp_error(FATAL, 'MPP_TRANSMIT:You must first call mpp_init.') if(to_pe.EQ.NULL_PE .AND. from_pe.EQ.NULL_PE) return block_comm=.true. if(PRESENT(block)) block_comm=block if(debug) then call SYSTEM_CLOCK(tick) write(stdout_unit,'(a, i18, a, i6, a, 2i6, 2i8)')&'T=', tick, ' PE=', pe, ' MPP_TRANSMIT begin:to_pe, from_pe, put_len, get_len=', to_pe, from_pe, put_len, get_len end if comm_tag=DEFAULT_TAG if(present(tag)) comm_tag=tag!do put first and then get if(to_pe.GE.0 .AND. to_pe.LT.npes) then!use non-blocking sends if(debug .and.(current_clock.NE.0)) call SYSTEM_CLOCK(start_tick)!z1l:truly non-blocking send.! if(request(to_pe).NE.MPI_REQUEST_NULL) then !only one message from pe-> to_pe in queue *PE waiting for to_pe ! call error else get_len so only do gets but you cannot have a pure get with MPI call a get means do a wait to ensure put on remote PE is complete error call increase mpp_nml request_multiply call MPP_TRANSMIT get_len end if return end subroutine MPP_TRANSMIT_ ! MPP_BROADCAST ! subroutine but that doesn t allow !broadcast to a subset of PEs This version and mpp_transmit will remain !backward compatible intent(inout) a
*f90 *************************************************************************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 MPP_UPDATE_NEST_FINE_2D_(field, nest_domain, wbuffer, ebuffer, sbuffer, nbuffer, &flags, complete, position, extra_halo, name, tile_count) MPP_TYPE_, intent(in) ::field(:,:) type(nest_domain_type), intent(inout) ::nest_domain MPP_TYPE_, intent(inout) ::wbuffer(:,:) MPP_TYPE_, intent(inout) ::ebuffer(:,:) MPP_TYPE_, intent(inout) ::sbuffer(:,:) MPP_TYPE_, intent(inout) ::nbuffer(:,:) integer, intent(in), optional ::flags logical, intent(in), optional ::complete integer, intent(in), optional ::position integer, intent(in), optional ::extra_halo character(len= *), intent(in), optional ::name integer, intent(in), optional ::tile_count MPP_TYPE_ ::field3D(size(field, 1), size(field, 2), 1) MPP_TYPE_ ::wbuffer3D(size(wbuffer, 1), size(wbuffer, 2), 1) MPP_TYPE_ ::ebuffer3D(size(ebuffer, 1), size(ebuffer, 2), 1) MPP_TYPE_ ::sbuffer3D(size(sbuffer, 1), size(sbuffer, 2), 1) MPP_TYPE_ ::nbuffer3D(size(nbuffer, 1), size(nbuffer, 2), 1) pointer(ptr, field3D) pointer(ptr_w, wbuffer3D) pointer(ptr_e, ebuffer3D) pointer(ptr_s, sbuffer3D) pointer(ptr_n, nbuffer3D) ptr=LOC(field) ptr_w=LOC(wbuffer) ptr_e=LOC(ebuffer) ptr_s=LOC(sbuffer) ptr_n=LOC(nbuffer) call mpp_update_nest_fine(field3D, nest_domain, wbuffer3D, ebuffer3D, sbuffer3D, nbuffer3D, &flags, complete, position, extra_halo, name, tile_count) returnend subroutine MPP_UPDATE_NEST_FINE_2D_subroutine MPP_UPDATE_NEST_FINE_3D_(field, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, &flags, complete, position, extra_halo, name, tile_count) MPP_TYPE_, intent(in) ::field(:,:,:) type(nest_domain_type), intent(inout) ::nest_domain MPP_TYPE_, intent(inout) ::wbuffer(:,:,:) MPP_TYPE_, intent(inout) ::ebuffer(:,:,:) MPP_TYPE_, intent(inout) ::sbuffer(:,:,:) MPP_TYPE_, intent(inout) ::nbuffer(:,:,:) integer, intent(in), optional ::flags logical, intent(in), optional ::complete integer, intent(in), optional ::position integer, intent(in), optional ::extra_halo character(len= *), intent(in), optional ::name integer, intent(in), optional ::tile_count MPP_TYPE_ ::d_type type(nestSpec), pointer ::update=> dimension(MAX_DOMAIN_FIELDS)
character(len=1), parameter space
*f90 *************************************************************************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 not
real missing_value
No description.
************************************************************************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=> time_level
subroutine, public read_time(times, units, calendar)
real(fp), parameter scale_factor
real per
Longitude of perihelion with respect to autumnal equinox in NH [degrees].
type(fieldtype), save, public default_field
character(len=len(cs)) function lowercase(cs)
integer, parameter, public information
integer ndim
No description.