88 mpp_multi, mpp_single, mpp_close, mpp_get_times
93 horiz_interp_type,
assignment(=)
97 open_namelist_file, open_ieee32_file, &
98 mpp_pe, close_file, lowercase, mpp_root_pe, &
130 #include<file_version.h> 141 integer :: year, month, day
144 interface assignment(=)
148 interface operator (==)
152 interface operator (/=)
156 interface operator (>)
246 type(horiz_interp_type) :: hintrp, hintrp2
247 real,
pointer :: data1(:,:) =>null(), &
250 logical :: use_climo, use_annual
251 logical :: i_am_initialized=.false.
262 integer,
parameter ::
maxc = 128
408 subroutine get_amip_sst (Time, Interp, sst, err_msg, lon_model, lat_model)
413 real,
intent(out) :: sst(:,:)
414 character(len=*),
optional,
intent(out) :: err_msg
416 real,
dimension(mobs,nobs) :: sice
418 integer :: year1, year2, month1, month2
420 type(
date_type) :: date1, date2, udate1, udate2
423 integer :: tod(3),dum(3)
426 real,
intent(in),
dimension(:,:),
optional :: lon_model, lat_model
428 integer :: i, j, mobs_sst, nobs_sst
431 character(len=4) :: yyyy
432 integer :: nrecords, ierr, k, yr, mo, dy
434 integer,
dimension(:),
allocatable :: ryr, rmo, rdy
435 character(len=30) :: time_unit
436 real,
dimension(:),
allocatable :: timeval
437 character(len=maxc) :: ncfilename
441 if(
present(err_msg)) err_msg =
'' 442 if(.not.interp%I_am_initialized)
then 443 if(
fms_error_handler(
'get_amip_sst',
'The amip_interp_type variable is not initialized',err_msg))
return 452 call get_date(time,dum(1),dum(2),dum(3),tod(1),tod(2),tod(3))
474 call time_interp (amip_time, fmonth, year1, year2, month1, month2)
476 if (interp % use_climo)
then 479 if (interp % use_annual)
then 493 if (date1 /= interp % Date1)
then 495 if (date1 == interp % Date2)
then 496 interp % Date1 = interp % Date2
497 interp % data1 = interp % data2
506 interp % Date1 = date1
512 if (date2 /= interp % Date2)
then 519 interp % Date2 = date2
525 call close_file (
unit)
526 if (
verbose > 0 .and. mpp_pe() == 0) &
528 interp % Date1, udate1, &
529 interp % Date2, udate2, fmonth)
535 sst = interp % data1 + fmonth * (interp % data2 - interp % data1)
561 call get_date(amip_time,jhctod(1),jhctod(2),jhctod(3),jhctod(4),jhctod(5),jhctod(6))
562 if (mpp_pe() == mpp_root_pe())
write(*,200)
'amip_interp_mod: use_daily = T, Amip_Time = ',jhctod(1),jhctod(2),jhctod(3),jhctod(4),jhctod(5),jhctod(6)
564 yr = jhctod(1); mo = jhctod(2); dy = jhctod(3)
566 write (yyyy,
'(i4)') jhctod(1)
570 time_unit =
'days since 1978-01-01 00:00:00' 572 mobs_sst = 1440; nobs_sst = 720
576 lon_model, lat_model, interp_method=
"bilinear" )
579 if ( (.NOT. file_exist(ncfilename)) )
call mpp_error (
'amip_interp_mod', &
580 'cannot find daily SST input data file: '//trim(ncfilename), note)
582 if (file_exist(ncfilename))
then 583 if (mpp_pe() == mpp_root_pe())
call mpp_error (
'amip_interp_mod', &
584 'Reading NetCDF formatted daily SST from: '//trim(ncfilename), note)
588 if (nrecords < 1)
call mpp_error(
'amip_interp_mod', &
589 'Invalid number of SST records in daily SST data file: '//trim(ncfilename), fatal)
590 allocate(timeval(nrecords), ryr(nrecords), rmo(nrecords), rdy(nrecords))
592 call mpp_open(
unit, ncfilename, mpp_rdonly, mpp_netcdf, mpp_multi, mpp_single )
593 call mpp_get_times(
unit, timeval)
607 call get_date(udate,jhctod(1),jhctod(2),jhctod(3),jhctod(4),jhctod(5),jhctod(6))
608 ryr(k) = jhctod(1); rmo(k) = jhctod(2); rdy(k) = jhctod(3)
610 if ( yr == ryr(k) .and. mo == rmo(k) .and. dy == rdy(k) ) ierr = 0
615 if (mpp_pe() == 0)
then 616 print *,
'JHC: k =', k
617 print *,
'JHC: ryr(k) rmo(k) rdy(k)',ryr(k), rmo(k), rdy(k)
618 print *,
'JHC: yr mo dy ',yr, mo, dy
621 if (ierr .ne. 0)
call mpp_error(
'amip_interp_mod', &
622 'Model time is out of range not in SST data: '//trim(ncfilename), fatal)
629 if (file_exist(ncfilename))
then 656 200
format(a35, 6(i5,1x))
657 300
format(a35, 3(f7.3,2x))
679 do i = 1,
size(sst,1)
680 do j = 1,
size(sst,2)
681 call random_number(pert)
682 sst(i,j) = sst(i,j) +
sst_pert*((pert-0.5)*2)
706 real,
intent(out) :: ice(:,:)
707 character(len=*),
optional,
intent(out) :: err_msg
709 real,
dimension(mobs,nobs) :: sice, temp
711 integer :: year1, year2, month1, month2
713 type(
date_type) :: date1, date2, udate1, udate2
716 integer :: tod(3),dum(3)
718 if(
present(err_msg)) err_msg =
'' 719 if(.not.interp%I_am_initialized)
then 720 if(
fms_error_handler(
'get_amip_ice',
'The amip_interp_type variable is not initialized',err_msg))
return 729 call get_date(time,dum(1),dum(2),dum(3),tod(1),tod(2),tod(3))
750 call time_interp (amip_time, fmonth, year1, year2, month1, month2)
753 if (interp % use_climo)
then 756 if (interp % use_annual)
then 768 if (date1 /= interp % Date1)
then 770 if (date1 == interp % Date2)
then 771 interp % Date1 = interp % Date2
772 interp % data1 = interp % data2
789 interp % Date1 = date1
795 if (date2 /= interp % Date2)
then 810 interp % Date2 = date2
817 call close_file (
unit)
818 if (
verbose > 0 .and. mpp_pe() == 0) &
820 interp % Date1, udate1, &
821 interp % Date2, udate2, fmonth)
828 ice = interp % data1 + fmonth * (interp % data2 - interp % data1)
851 interp_method )
result (Interp)
853 real,
intent(in),
dimension(:) :: lon, lat
854 logical,
intent(in),
dimension(:,:) :: mask
855 character(len=*),
intent(in),
optional :: interp_method
856 logical,
intent(in),
optional :: use_climo, use_annual
862 interp % use_climo = .false.
863 if (
present(use_climo)) interp % use_climo = use_climo
864 interp % use_annual = .false.
865 if (
present(use_annual)) interp % use_annual = use_annual
868 call error_mesg (
'amip_interp_new_1d',
'use_climo mismatch', fatal)
871 call error_mesg (
'amip_interp_new_1d',
'use_annual(climo) mismatch', fatal)
873 interp % Date1 =
date_type( -99, -99, -99 )
874 interp % Date2 =
date_type( -99, -99, -99 )
880 lon, lat, interp_method= interp_method )
882 allocate ( interp % data1 (
size(lon(:))-1,
size(lat(:))-1), &
883 interp % data2 (
size(lon(:))-1,
size(lat(:))-1) )
885 interp%I_am_initialized = .true.
901 interp_method )
result (Interp)
903 real,
intent(in),
dimension(:,:) :: lon, lat
904 logical,
intent(in),
dimension(:,:) :: mask
905 character(len=*),
intent(in),
optional :: interp_method
906 logical,
intent(in),
optional :: use_climo, use_annual
912 interp % use_climo = .false.
913 if (
present(use_climo)) interp % use_climo = use_climo
914 interp % use_annual = .false.
915 if (
present(use_annual)) interp % use_annual = use_annual
918 call error_mesg (
'amip_interp_new_2d',
'use_climo mismatch', fatal)
921 call error_mesg (
'amip_interp_new_2d',
'use_annual(climo) mismatch', fatal)
923 interp % Date1 =
date_type( -99, -99, -99 )
924 interp % Date2 =
date_type( -99, -99, -99 )
930 lon, lat, interp_method = interp_method)
932 allocate ( interp % data1 (
size(lon,1),
size(lat,2)), &
933 interp % data2 (
size(lon,1),
size(lat,2)))
935 interp%I_am_initialized = .true.
944 integer ::
unit,io,ierr
952 #ifdef INTERNAL_FILE_NML 956 if ( file_exist(
'input.nml'))
then 957 unit = open_namelist_file( )
958 ierr=1;
do while (ierr /= 0)
959 read (
unit, nml=amip_interp_nml, iostat=io, end=10)
962 10
call close_file (
unit)
967 call write_version_number(
"AMIP_INTERP_MOD", version)
970 if (mpp_pe() == 0)
then 971 write (
unit,nml=amip_interp_nml)
973 call close_file (
unit)
988 if (lowercase(trim(
data_set)) ==
'amip1')
then 994 call error_mesg (
'amip_interp_init',
'using AMIP 1 sst', note)
996 else if (lowercase(trim(
data_set)) ==
'amip2')
then 1003 if (mpp_pe() == 0) &
1004 call error_mesg (
'amip_interp_init',
'using AMIP 2 sst', note)
1006 else if (lowercase(trim(
data_set)) ==
'hurrell')
then 1013 if (mpp_pe() == 0) &
1014 call error_mesg (
'amip_interp_init',
'using HURRELL sst', note)
1017 else if (lowercase(trim(
data_set)) ==
'daily')
then 1022 if (mpp_pe() == 0) &
1023 call error_mesg (
'amip_interp_init',
'using AVHRR daily sst', note)
1026 else if (lowercase(trim(
data_set)) ==
'reynolds_eof')
then 1031 if (mpp_pe() == 0) &
1033 'using NCEP Reynolds Historical Reconstructed SST', note)
1035 else if (lowercase(trim(
data_set)) ==
'reynolds_oi')
then 1041 if (.not.
allocated (
sst_ncep))
then 1045 if (.not.
allocated (
sst_anom))
then 1054 if (mpp_pe() == 0) &
1055 call error_mesg (
'amip_interp_init',
'using Reynolds OI SST', &
1059 call error_mesg (
'amip_interp_init',
'the value of the & 1060 &namelist parameter DATA_SET being used is not allowed', fatal)
1063 if (
verbose > 1 .and. mpp_pe() == 0) &
1102 if(
associated(interp%data1))
deallocate(interp%data1)
1103 if(
associated(interp%data2))
deallocate(interp%data2)
1108 interp%I_am_initialized = .false.
1120 real :: hpie, dlon, dlat, wb, sb
1128 dlon = 4.*hpie/float(
mobs); wb = -0.5*dlon
1130 lon_bnd(i) = wb + dlon * float(i-1)
1134 dlat = 2.*hpie/float(
nobs-1); sb = -hpie + 0.5*dlat
1137 lat_bnd(j) = sb + dlat * float(j-2)
1146 real :: hpie, dlon, dlat, wb, sb
1158 dlon = 4.*hpie/float(
mobs); wb = 0.0
1161 lon_bnd(i) = wb + dlon * float(i-1)
1165 dlat = 2.*hpie/float(
nobs); sb = -hpie
1168 lat_bnd(j) = sb + dlat * float(j-1)
1176 integer :: i, j, mobs_sst, nobs_sst
1177 real :: hpie, dlon, dlat, wb, sb
1187 dlon = 4.*hpie/float(mobs_sst); wb = 0.0
1189 do i = 2, mobs_sst+1
1190 lon_bnd(i) = wb + dlon * float(i-1)
1194 dlat = 2.*hpie/float(nobs_sst); sb = -hpie
1197 lat_bnd(j) = sb + dlat * float(j-1)
1206 integer,
intent(in):: nx, ny
1207 integer,
intent(in):: n1, n2
1208 real,
intent(in) :: dat1(nx,ny)
1209 real,
intent(out):: dat2(n1,n2)
1212 real:: lon1(nx), lat1(ny)
1213 real:: lon2(n1), lat2(n2)
1214 real:: dx1, dy1, dx2, dy2
1216 real:: a1, b1, c1, c2, c3, c4
1217 integer i1, i2, jc, i0, j0, it, jt
1232 lon1(i) = 0.5*dx1 +
real(i-1)*dx1
1235 lat1(j) = -90. + 0.5*dy1 +
real(j-1)*dy1
1243 lon2(i) = 0.5*dx2 +
real(i-1)*dx2
1246 lat2(j) = -90. + 0.5*dy2 +
real(j-1)*dy2
1253 if ( yc<lat1(1) )
then 1256 elseif ( yc>lat1(ny) )
then 1261 if ( yc>=lat1(j0) .and. yc<=lat1(j0+1) )
then 1264 b1 = (yc-lat1(jc)) / dy1
1274 if ( xc>lon1(nx) )
then 1276 a1 = (xc-lon1(nx)) / dx1
1277 elseif ( xc<lon1(1) )
then 1279 a1 = (xc+360.-lon1(nx)) / dx1
1282 if ( xc>=lon1(i0) .and. xc<=lon1(i0+1) )
then 1285 a1 = (xc-lon1(i1)) / dx1
1293 if ( a1<-0.001 .or. a1>1.001 .or. b1<-0.001 .or. b1>1.001 )
then 1294 write(*,*) i,j,a1, b1
1295 call mpp_error(fatal,
'a2a bilinear interpolation')
1298 c1 = (1.-a1) * (1.-b1)
1304 dat2(i,j) = c1*dat1(i1,jc) + c2*dat1(i2,jc) + c3*dat1(i2,jc+1) + c4*dat1(i1,jc+1)
1341 integer,
intent(out) :: nlon, nlat
1382 real,
intent(out) :: blon(:), blat(:)
1383 logical,
intent(out) :: mask(:,:)
1389 if (
size(blon(:)) /=
mobs+1 .or.
size(blat(:)) /=
nobs+1) &
1390 call error_mesg (
'get_sst_grid_boundary in amip_interp_mod', &
1391 'invalid argument dimensions', fatal)
1410 character(len=*),
intent(in) :: type
1413 real,
intent(out) :: dat(mobs,nobs)
1414 real :: tmp_dat(360,180)
1416 real (R4_KIND) :: dat4(mobs,nobs)
1417 integer(I2_KIND) :: idat(mobs,nobs)
1418 integer :: nrecords, yr, mo, dy, ierr, k
1419 integer,
dimension(:),
allocatable :: ryr, rmo, rdy
1420 character(len=38) :: mesg
1421 character(len=maxc) :: ncfilename, ncfieldname
1426 if(
type(1:3) ==
'sst') then
1428 else if(
type(1:3) ==
'ice') then
1430 if (lowercase(trim(
data_set)) ==
'amip2' .or. &
1431 lowercase(trim(
data_set)) ==
'hurrell' .or. &
1432 lowercase(trim(
data_set)) ==
'daily') ncfieldname =
'ice' 1437 if ( (.NOT. file_exist(ncfilename)) )
then 1441 date % month <=
curr_date % month )
then 1442 if (
verbose > 1 .and. mpp_pe() == 0) &
1443 print *,
' rewinding unit = ',
unit 1447 if (
unit == -1)
then 1448 if (
type(1:3) ==
'sst') then
1450 else if (
type(1:3) ==
'ice') then
1459 if (
verbose > 2 .and. mpp_pe() == 0) &
1460 print *,
'looking for date = ', date
1465 if (file_exist(ncfilename))
then 1466 if (mpp_pe() == mpp_root_pe())
call mpp_error (
'amip_interp_mod', &
1467 'Reading NetCDF formatted input data file: '//trim(ncfilename), note)
1468 call read_data (ncfilename,
'nrecords', nrecords, no_domain=.true.)
1469 if (nrecords < 1)
call mpp_error(
'amip_interp_mod', &
1470 'Invalid number of SST records in SST datafile: '//trim(ncfilename), fatal)
1471 allocate(ryr(nrecords), rmo(nrecords), rdy(nrecords))
1472 call read_data(ncfilename,
'yr', ryr, no_domain=.true.)
1473 call read_data(ncfilename,
'mo', rmo, no_domain=.true.)
1474 call read_data(ncfilename,
'dy', rdy, no_domain=.true.)
1477 yr = ryr(k); mo = rmo(k)
1480 if (
verbose > 2 .and. mpp_pe() == 0) &
1481 print *,
'....... checking ', adate
1482 if (date == adate) ierr = 0
1483 if (yr == 0 .and. mo == date%month) ierr = 0
1486 if (ierr .ne. 0)
call mpp_error(
'amip_interp_mod', &
1487 'Model time is out of range not in SST data: '//trim(ncfilename), fatal)
1488 deallocate(ryr, rmo, rdy)
1494 if (mpp_pe() == mpp_root_pe())
call mpp_error (
'amip_interp_mod', &
1495 'Reading native formatted input data file: '//trim(
data_set), note)
1499 if (lowercase(trim(
data_set)) ==
'amip2' .or. lowercase(trim(
data_set)) ==
'hurrell')
then 1500 read (
unit, end=10) yr, mo, dat4
1503 read (
unit, end=10) yr, mo, dy, idat
1508 if (
verbose > 2 .and. mpp_pe() == 0) &
1509 print *,
'....... checking ', adate
1512 if (date == adate)
exit 1513 if (date%month == mo .and. date%day == dy .and. date%year == yr )
exit 1515 if (yr == 0 .and. date % month == mo)
exit 1530 if (yr == 0 .or. mo == 0)
then 1536 (
'read_record in amip_interp_mod', &
1537 'climo data read when NO climo data requested', fatal)
1542 if (file_exist(ncfilename))
then 1544 call read_data(ncfilename, ncfieldname, tmp_dat, timelevel=k, no_domain=.true.)
1546 if ( mobs/=360 .or. nobs/=180 )
then 1549 dat(:,:) = tmp_dat(:,:)
1552 call read_data(ncfilename, ncfieldname, dat, timelevel=k, no_domain=.true.)
1554 idat = nint(dat*100.)
1559 if (
type(1:3) ==
'ice') then
1561 if (lowercase(trim(
data_set)) /=
'amip2' .and. lowercase(trim(
data_set)) /=
'hurrell')
then 1570 else if (
type(1:3) ==
'sst') then
1572 if (lowercase(trim(
data_set)) /=
'amip2' .and. lowercase(trim(
data_set)) /=
'hurrell')
then 1573 dat =
real(idat)*0.01 + TFREEZE
1580 10
write (mesg, 20)
unit 1581 call error_mesg (
'read_record in amip_interp_mod', mesg, fatal)
1583 20
format (
'end of file reading unit ',i2,
' (sst data)')
1591 character(len=*),
intent(in) :: type
1592 real,
intent(inout) :: dat(:,:)
1594 if (
type(1:3) ==
'ice') then
1595 dat =
min(
max(dat,0.0),1.0)
1596 else if (
type(1:3) ==
'sst') then
1604 function date_equals (Left, Right)
result (answer)
1608 if (left % year == right % year .and. &
1609 left % month == right % month .and. &
1610 left % day == right % day )
then 1624 if (left % year == right % year .and. &
1625 left % month == right % month .and. &
1626 left % day == right % day )
then 1636 function date_gt (Left, Right)
result (answer)
1639 integer :: i, dif(3)
1641 dif(1) = left%year - right%year
1642 dif(2) = left%month - right%month
1643 dif(3) = left%day - right%day
1646 if (dif(i) == 0) cycle
1647 if (dif(i) < 0)
exit 1648 if (dif(i) > 0)
then 1659 Date2, Udate2, fmonth)
1662 type(
date_type),
intent(in) :: date1, udate1, date2, udate2
1663 real,
intent(in) :: fmonth
1665 integer :: year, month, day, hour, minute, second
1667 call get_date (time, year, month, day, hour, minute, second)
1669 write (*,10) year,month,day, hour,minute,second
1671 write (*,30) date1, udate1
1672 write (*,40) date2, udate2
1674 10
format (/,
' date(y/m/d h:m:s) = ',i4,2(
'/',i2.2),1x,2(i2.2,
':'),i2.2)
1675 20
format (
' fmonth = ',f9.7)
1676 30
format (
' date1(y/m/d) = ',i4,2(
'/',i2.2),6x, &
1677 'used = ',i4,2(
'/',i2.2),6x )
1678 40
format (
' date2(y/m/d) = ',i4,2(
'/',i2.2),6x, &
1679 'used = ',i4,2(
'/',i2.2),6x )
1688 real,
intent(out) :: ice(mobs,nobs), sst(mobs,nobs)
1690 real :: tpi, fdate, eps, ph, sph, sph2, ts
1705 eps = sin( tpi*(fdate-
tlag) ) *
tann 1713 ts =
teq -
tdif*sph2 - eps*sph
1732 type(amip_interp_type),
intent(inout) :: amip_interp_out
1733 type(amip_interp_type),
intent(in) :: amip_interp_in
1735 if(.not.amip_interp_in%I_am_initialized)
then 1736 call mpp_error(fatal,
'amip_interp_type_eq: amip_interp_type variable on right hand side is unassigned')
1739 amip_interp_out%Hintrp = amip_interp_in%Hintrp
1740 amip_interp_out%data1 => amip_interp_in%data1
1741 amip_interp_out%data2 => amip_interp_in%data2
1742 amip_interp_out%Date1 = amip_interp_in%Date1
1743 amip_interp_out%Date2 = amip_interp_in%Date2
1744 amip_interp_out%Date1 = amip_interp_in%Date1
1745 amip_interp_out%Date2 = amip_interp_in%Date2
1746 amip_interp_out%use_climo = amip_interp_in%use_climo
1747 amip_interp_out%use_annual = amip_interp_in%use_annual
1748 amip_interp_out%I_am_initialized = .true.
subroutine, public get_date(time, year, month, day, hour, minute, second, tick, err_msg)
character(len=maxc) file_name_ice
logical function date_equals(Left, Right)
subroutine get_sst_grid_size(nlon, nlat)
integer, dimension(3) amip_date
subroutine a2a_bilinear(nx, ny, dat1, n1, n2, dat2)
subroutine, public amip_interp_init()
subroutine amip_interp_type_eq(amip_interp_out, amip_interp_in)
subroutine set_sst_grid_edges_amip1
subroutine get_sst_grid_boundary(blon, blat, mask)
real, dimension(:), allocatable lon_bnd
subroutine, public horiz_interp_del(Interp)
logical function date_gt(Left, Right)
logical function date_not_equals(Left, Right)
subroutine, public amip_interp_del(Interp)
subroutine clip_data(type, dat)
logical function, public fms_error_handler(routine, message, err_msg)
real, dimension(:,:), allocatable temp1
type(time_type) function, public get_cal_time(time_increment, units, calendar, permit_calendar_conversion)
subroutine, public get_amip_sst(Time, Interp, sst, err_msg, lon_model, lat_model)
integer function, public check_nml_error(IOSTAT, NML_NAME)
real, parameter big_number
logical module_is_initialized
character(len=input_str_length), dimension(:), allocatable, target, public input_nml_file
real, parameter, public pi
Ratio of circle circumference to diameter [N/A].
subroutine set_sst_grid_edges_daily(mobs_sst, nobs_sst)
type(date_type) curr_date
************************************************************************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
subroutine, public field_size(filename, fieldname, siz, field_found, domain, no_domain)
real, dimension(:,:), allocatable temp2
logical, public forecast_mode
real, parameter, public tfreeze
Freezing temperature of fresh water [K].
logical, public use_ncep_sst
real function, public fraction_of_year(Time)
subroutine, public horiz_interp_init
real, dimension(:,:), allocatable tempamip
real, dimension(:), allocatable lat_bnd
real, dimension(:,:), allocatable, public sst_ncep
type(amip_interp_type) function amip_interp_new_1d(lon, lat, mask, use_climo, use_annual, interp_method)
subroutine print_dates(Time, Date1, Udate1, Date2, Udate2, fmonth)
subroutine read_record(type, Date, Adate, dat)
subroutine zonal_sst(Time, ice, sst)
integer(i2_kind) ice_crit
character(len=16) date_out_of_range
real, dimension(:,:), allocatable, public sst_anom
subroutine, public error_mesg(routine, message, level)
subroutine set_sst_grid_edges_oi
character(len=24) data_set
subroutine, public get_amip_ice(Time, Interp, ice, err_msg)
character(len=6) sst_pert_type
type(amip_interp_type) function amip_interp_new_2d(lon, lat, mask, use_climo, use_annual, interp_method)
character(len=maxc) file_name_sst