21 integer,
intent(in) :: ng, tile
25 character (len=*),
parameter :: MyFile = &
34 & lbi, ubi, lbj, ubj, &
35 & imins, imaxs, jmins, jmaxs)
45 & LBi, UBi, LBj, UBj, &
46 & IminS, ImaxS, JminS, JmaxS)
52# if defined FORWARD_READ && defined SOLVE3D
56# ifdef SENSITIVITY_4DVAR
90 integer,
intent(in) :: ng, tile
91 integer,
intent(in) :: LBi, UBi, LBj, UBj
92 integer,
intent(in) :: IminS, ImaxS, JminS, JmaxS
97 logical :: update = .false.
102 integer :: ILB, IUB, JLB, JUB
103 integer :: i, ic, itrc, j, k, my_tile
105 real(r8) :: cff, cff1, cff2
107 character (len=*),
parameter :: MyFile = &
108 & __FILE__//
", ad_set_data_tile"
110# include "set_bounds.h"
115 ilb=
bounds(ng)%LBi(my_tile)
116 iub=
bounds(ng)%UBi(my_tile)
117 jlb=
bounds(ng)%LBj(my_tile)
118 jub=
bounds(ng)%UBj(my_tile)
134 & lbi, ubi, lbj, ubj, &
142# if (defined BULK_FLUXES && !defined FORWARD_FLUXES) || \
144 (defined shortwave && defined
ana_srflux && defined albedo)
154 & lbi, ubi, lbj, ubj, &
162# if (defined BULK_FLUXES && !defined FORWARD_FLUXES) || \
164 (defined shortwave && defined
ana_srflux && defined albedo)
174 & lbi, ubi, lbj, ubj, &
192 & lbi, ubi, lbj, ubj, &
198# if defined DIURNAL_SRFLUX && !defined FORWARD_FLUXES
207# if (defined BULK_FLUXES && !defined FORWARD_FLUXES) && \
215 & lbi, ubi, lbj, ubj, &
222# if defined LONGWAVE_OUT && \
223 (defined bulk_fluxes &&
230 & lbi, ubi, lbj, ubj, &
237# if (defined BULK_FLUXES && !defined FORWARD_FLUXES) || \
248 & lbi, ubi, lbj, ubj, &
255 & lbi, ubi, lbj, ubj, &
271 cff1=
forces(ng)%Uwind(i,j)*
grid(ng)%CosAngler(i,j)+ &
272 &
forces(ng)%Vwind(i,j)*
grid(ng)%SinAngler(i,j)
273 cff2=
forces(ng)%Vwind(i,j)*
grid(ng)%CosAngler(i,j)- &
274 &
forces(ng)%Uwind(i,j)*
grid(ng)%SinAngler(i,j)
275 forces(ng)%Uwind(i,j)=cff1
276 forces(ng)%Vwind(i,j)=cff2
282 & lbi, ubi, lbj, ubj, &
285 & lbi, ubi, lbj, ubj, &
291 & lbi, ubi, lbj, ubj, &
302# if defined BULK_FLUXES && !defined FORWARD_FLUXES
312 & lbi, ubi, lbj, ubj, &
320# if !defined BULK_FLUXES || defined FORWARD_FLUXES
330 & lbi, ubi, lbj, ubj, &
349 & lbi, ubi, lbj, ubj, &
360 & lbi, ubi, lbj, ubj, &
376 & lbi, ubi, lbj, ubj, &
392# if !(defined EMINUSP || defined FORWARD_FLUXES || \
393 defined frc_coupling || defined srelaxation)
395 & lbi, ubi, lbj, ubj, &
401# elif (defined EMINUSP || defined FORWARD_FLUXES || \
402 defined frc_coupling)
404 & lbi, ubi, lbj, ubj, &
412# if defined SCORRECTION || defined SRELAXATION
422 & lbi, ubi, lbj, ubj, &
438 & lbi, ubi, lbj, ubj, &
446# if defined BIOLOGY || defined SEDIMENT || defined T_PASSIVE
457 & lbi, ubi, lbj, ubj, &
458 &
forces(ng)%stfluxG(:,:,:,itrc), &
459 &
forces(ng)%stflux (:,:,itrc), &
468 & lbi, ubi, lbj, ubj, &
469 &
forces(ng)%btfluxG(:,:,:,itrc), &
470 &
forces(ng)%btflux (:,:,itrc), &
478# if !defined BULK_FLUXES || defined FORWARD_FLUXES || \
489 & lbi, ubi, lbj, ubj, &
496 & lbi, ubi, lbj, ubj, &
512 cff1=
forces(ng)%sustr(i,j)*
grid(ng)%CosAngler(i,j)+ &
513 &
forces(ng)%svstr(i,j)*
grid(ng)%SinAngler(i,j)
514 cff2=
forces(ng)%svstr(i,j)*
grid(ng)%CosAngler(i,j)- &
515 &
forces(ng)%sustr(i,j)*
grid(ng)%SinAngler(i,j)
516 forces(ng)%sustr(i,j)=cff1
517 forces(ng)%svstr(i,j)=cff2
523 & lbi, ubi, lbj, ubj, &
526 & lbi, ubi, lbj, ubj, &
532 & lbi, ubi, lbj, ubj, &
543# if (defined BULK_FLUXES && !defined FORWARD_FLUXES) || \
544 defined ecosim || defined atm_press
556 & lbi, ubi, lbj, ubj, &
575 & lbi, ubi, lbj, ubj, &
591 &
grid(ng)%angler(i,j)
598 & lbi, ubi, lbj, ubj, &
604 & lbi, ubi, lbj, ubj, &
614 & lbi, ubi, lbj, ubj, &
623 & lbi, ubi, lbj, ubj, &
630# ifdef WAVES_TOP_PERIOD
632 & lbi, ubi, lbj, ubj, &
633 &
forces(ng)%Pwave_topG, &
639# ifdef WAVES_BOT_PERIOD
641 & lbi, ubi, lbj, ubj, &
642 &
forces(ng)%Pwave_botG, &
650 & lbi, ubi, lbj, ubj, &
657# if defined TKE_WAVEDISS
659 & lbi, ubi, lbj, ubj, &
660 &
forces(ng)%Wave_dissipG, &
661 &
forces(ng)%Wave_dissip, &
666# if defined SVENDSEN_ROLLER
668 & lbi, ubi, lbj, ubj, &
669 &
forces(ng)%Wave_breakG, &
670 &
forces(ng)%Wave_break, &
677# if defined ECOSIM && defined SOLVE3D
706 IF (
domain(ng)%SouthWest_Test(tile))
THEN
729 & 1,
nsrc(ng),
n(ng), &
730 &
sources(ng) % TsrcG(:,:,:,itrc), &
731 &
sources(ng) % Tsrc(:,:,itrc), &
750 IF (
domain(ng)%SouthWest_Test(tile))
THEN
795 IF (
domain(ng)%Western_Edge(tile))
THEN
798 IF (
boundary(ng)%zeta_west(j).le.cff)
THEN
813 IF (
domain(ng)%Eastern_Edge(tile))
THEN
816 IF (
boundary(ng)%zeta_east(j).le.cff)
THEN
831 IF (
domain(ng)%Southern_Edge(tile))
THEN
834 IF (
boundary(ng)%zeta_south(i).le.cff)
THEN
849 IF (
domain(ng)%Northern_Edge(tile))
THEN
852 IF (
boundary(ng)%zeta_north(i).le.cff)
THEN
873 IF (
domain(ng)%SouthWest_Test(tile))
THEN
957 IF (
domain(ng)%SouthWest_Test(tile))
THEN
960 & 0,
mm(ng)+1,
n(ng), &
969 & 1,
mm(ng)+1,
n(ng), &
978 & 0,
mm(ng)+1,
n(ng), &
987 & 1,
mm(ng)+1,
n(ng), &
996 & 1,
lm(ng)+1,
n(ng), &
1005 & 0,
lm(ng)+1,
n(ng), &
1014 & 1,
lm(ng)+1,
n(ng), &
1023 & 0,
lm(ng)+1,
n(ng), &
1039 IF (
domain(ng)%SouthWest_Test(tile))
THEN
1043 & jlb, jub,
n(ng), 0,
mm(ng)+1,
n(ng), &
1044 &
boundary(ng) % tG_west(:,:,:,itrc), &
1045 &
boundary(ng) % t_west(:,:,itrc), &
1048 & __line__, myfile))
RETURN
1053 & jlb, jub,
n(ng), 0,
mm(ng)+1,
n(ng), &
1054 &
boundary(ng) % tG_east(:,:,:,itrc), &
1055 &
boundary(ng) % t_east(:,:,itrc), &
1058 & __line__, myfile))
RETURN
1063 & ilb, iub,
n(ng), 0,
lm(ng)+1,
n(ng), &
1064 &
boundary(ng) % tG_south(:,:,:,itrc), &
1065 &
boundary(ng) % t_south(:,:,itrc), &
1068 & __line__, myfile))
RETURN
1073 & ilb, iub,
n(ng), 0,
lm(ng)+1,
n(ng), &
1074 &
boundary(ng) % tG_north(:,:,:,itrc), &
1075 &
boundary(ng) % t_north(:,:,itrc), &
1078 & __line__, myfile))
RETURN
1095 & lbi, ubi, lbj, ubj, &
1112 & lbi, ubi, lbj, ubj, &
1113 &
clima(ng)%ubarclmG, &
1114 &
clima(ng)%ubarclm, &
1119 & lbi, ubi, lbj, ubj, &
1120 &
clima(ng)%vbarclmG, &
1121 &
clima(ng)%vbarclm, &
1138 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1139 &
clima(ng)%uclmG, &
1145 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1146 &
clima(ng)%vclmG, &
1167 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1168 &
clima(ng)%tclmG(:,:,:,:,ic), &
1169 &
clima(ng)%tclm (:,:,:,ic), &
1187 & lbi, ubi, lbj, ubj, &
1188 &
ocean(ng)%zetaG, &
1189 &
ocean(ng)%zeta(:,:,k), &
1206 & lbi, ubi, lbj, ubj, &
1207 &
ocean(ng)%ubarG, &
1208 &
ocean(ng)%ubar(:,:,k), &
1213 & lbi, ubi, lbj, ubj, &
1214 &
ocean(ng)%vbarG, &
1215 &
ocean(ng)%vbar(:,:,k), &
1226 & lbi, ubi, lbj, ubj, &
1227 &
ocean(ng)%rzetaG, &
1228 &
ocean(ng)%rzeta(:,:,k), &
1233 & lbi, ubi, lbj, ubj, &
1234 &
ocean(ng)%rubarG, &
1235 &
ocean(ng)%rubar(:,:,k), &
1240 & lbi, ubi, lbj, ubj, &
1241 &
ocean(ng)%rvbarG, &
1242 &
ocean(ng)%rvbar(:,:,k), &
1253 & lbi, ubi, lbj, ubj, &
1260 & lbi, ubi, lbj, ubj, &
1267 & lbi, ubi, lbj, ubj, &
1274 & lbi, ubi, lbj, ubj, &
1284 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1286 &
ocean(ng)%u(:,:,:,k), &
1291 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1293 &
ocean(ng)%v(:,:,:,k), &
1304 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1306 &
ocean(ng)%ru(:,:,:,k), &
1311 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1313 &
ocean(ng)%rv(:,:,:,k), &
1324 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1325 &
ocean(ng)%tG(:,:,:,:,itrc), &
1326 &
ocean(ng)%t(:,:,:,k,itrc), &
1332# ifdef FORWARD_MIXING
1338 & lbi, ubi, lbj, ubj, 0,
n(ng), &
1339 &
mixing(ng)%AktG(:,:,:,:,itrc), &
1340 &
mixing(ng)%Akt(:,:,:,itrc), &
1346 & lbi, ubi, lbj, ubj, 0,
n(ng), &
1353# if defined MY25_MIXING_NOT_YET || defined GLS_MIXING_NOT_YET
1359 & lbi, ubi, lbj, ubj, 0,
n(ng), &
1361 &
mixing(ng)%tke(:,:,:,k), &
1370 & lbi, ubi, lbj, ubj, 0,
n(ng), &
1372 &
mixing(ng)%gls(:,:,:,k), &
1380 & lbi, ubi, lbj, ubj, 0,
n(ng), &
1389 & lbi, ubi, lbj, ubj, 0,
n(ng), &
1395# ifdef GLS_MIXING_NOT_YET
1400 & lbi, ubi, lbj, ubj, 0,
n(ng), &
1408# ifdef LMD_MIXING_NOT_YET
1413 & lbi, ubi, lbj, ubj, &
1420# ifdef LMD_BKPP_NOT_YET
1425 & lbi, ubi, lbj, ubj, &
1432# ifdef LMD_NONLOCAL_NOT_YET
1438 & lbi, ubi, lbj, ubj, 0,
n(ng), &
1439 &
mixing(ng)%ghatsG(:,:,:,:,itrc), &
1440 &
mixing(ng)%ghat(:,:,:,itrc), &
1448# if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
1449 defined opt_observations || defined sensitivity_4dvar || \
1458# ifdef SENSITIVITY_4DVAR
1463 & lbi, ubi, lbj, ubj, &
1464 &
clima(ng)%zeta_adsG, &
1465 &
clima(ng)%zeta_ads, &
1474 & lbi, ubi, lbj, ubj, &
1475 &
clima(ng)%ubar_adsG, &
1476 &
clima(ng)%ubar_ads, &
1483 & lbi, ubi, lbj, ubj, &
1484 &
clima(ng)%vbar_adsG, &
1485 &
clima(ng)%vbar_ads, &
1496 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1497 &
clima(ng)%u_adsG, &
1498 &
clima(ng)%u_ads, &
1505 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1506 &
clima(ng)%v_adsG, &
1507 &
clima(ng)%v_ads, &
1514 & lbi, ubi, lbj, ubj, 0,
n(ng), &
1515 &
clima(ng)%wvel_adsG, &
1516 &
clima(ng)%wvel_ads, &
1526 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1527 &
clima(ng)%t_adsG(:,:,:,:,itrc), &
1528 &
clima(ng)%t_ads(:,:,:,itrc), &
1534# ifdef SENSITIVITY_4DVAR
1539# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS || \
1540 defined ad_sensitivity || defined i4dvar_ana_sensitivity || \
1541 defined opt_observations || defined sensitivity_4dvar || \
1552 forces(ng)%ad_sustr(i,j)=0.0_r8
1553 forces(ng)%ad_svstr(i,j)=0.0_r8
1560 forces(ng)%ad_stflx(i,j,itrc)=0.0_r8
1561 forces(ng)%ad_btflx(i,j,itrc)=0.0_r8
1568 forces(ng)%ad_srflx(i,j)=0.0_r8
1575 forces(ng)%ad_lhflx(i,j)=0.0_r8
1576 forces(ng)%ad_shflx(i,j)=0.0_r8
1577 forces(ng)%ad_lrflx(i,j)=0.0_r8
1579 forces(ng)%ad_evap(i,j)=0.0_r8
subroutine ad_set_data(ng, tile)
subroutine ad_set_data_tile(ng, tile, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs)
subroutine ana_spinning(ng, tile, model)
subroutine ana_fsobc(ng, tile, model)
subroutine ana_wwave(ng, tile, model)
subroutine ana_sst(ng, tile, model)
subroutine ana_m3obc(ng, tile, model)
subroutine ana_dqdsst(ng, tile, model)
subroutine ana_tclima(ng, tile, model)
subroutine ana_btflux(ng, tile, model, itrc)
subroutine ana_ssh(ng, tile, model)
subroutine ana_m2obc(ng, tile, model)
subroutine ana_tobc(ng, tile, model)
subroutine ana_sss(ng, tile, model)
subroutine ana_psource(ng, tile, model)
subroutine ana_winds(ng, tile, model)
subroutine ana_srflux(ng, tile, model)
subroutine ana_smflux(ng, tile, model)
subroutine ana_pair(ng, tile, model)
subroutine ana_m2clima(ng, tile, model)
subroutine ana_tair(ng, tile, model)
subroutine ana_m3clima(ng, tile, model)
subroutine ana_stflux(ng, tile, model, itrc)
subroutine ana_rain(ng, tile, model)
subroutine ana_specir(ng, tile, model)
subroutine ana_humid(ng, tile, model)
subroutine ana_cloud(ng, tile, model)
subroutine mp_boundary(ng, model, imin, imax, lbi, ubi, lbk, ubk, update, a)
subroutine exchange_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
subroutine exchange_u2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
subroutine exchange_v2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
type(t_boundary), dimension(:), allocatable boundary
type(t_clima), dimension(:), allocatable clima
type(t_coupling), dimension(:), allocatable coupling
type(t_forces), dimension(:), allocatable forces
logical, dimension(:), allocatable lsen4dvar
type(t_grid), dimension(:), allocatable grid
type(t_mixing), dimension(:), allocatable mixing
integer, dimension(2) iddiff
integer, dimension(4) idu3bc
integer, dimension(4) idzbry
integer, dimension(4) idu2bc
logical, dimension(:,:,:), allocatable linfo
integer, dimension(:), allocatable idrtrc
integer, dimension(:), allocatable idtbot
integer, dimension(:), allocatable idtsur
integer, dimension(:), allocatable idtclm
integer, dimension(:), allocatable idtvar
integer, dimension(:), allocatable istvar
integer, dimension(4) idv3bc
integer, dimension(2) idghat
integer, dimension(:,:,:), allocatable iinfo
integer, dimension(:), allocatable idtads
integer, dimension(4) idv2bc
integer, dimension(:,:), allocatable idtbry
type(t_ocean), dimension(:), allocatable ocean
type(t_lbc), dimension(:,:,:), allocatable ad_lbc
integer, dimension(:), allocatable n
type(t_bounds), dimension(:), allocatable bounds
type(t_domain), dimension(:), allocatable domain
integer, dimension(:), allocatable lm
integer, dimension(:), allocatable nt
integer, dimension(:), allocatable mm
logical, dimension(:), allocatable luvsrc
logical, dimension(:,:), allocatable ltracersrc
real(r8), dimension(:), allocatable dcrit
logical, dimension(:), allocatable lprocessobc
logical, dimension(:), allocatable ewperiodic
logical, dimension(:), allocatable nsperiodic
logical, dimension(:), allocatable lm3clm
logical, dimension(:), allocatable lsshclm
logical, dimension(:), allocatable lwsrc
integer, parameter isouth
type(t_scalars), dimension(:), allocatable scalars
logical, dimension(:), allocatable lm2clm
logical, dimension(:,:), allocatable ltracerclm
integer, parameter inorth
type(t_sources), dimension(:), allocatable sources
integer, dimension(:), allocatable nsrc
subroutine mp_exchange2d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, nghost, ew_periodic, ns_periodic, a, b, c, d)
subroutine mp_exchange3d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, lbk, ubk, nghost, ew_periodic, ns_periodic, a, b, c, d)
subroutine set_2dfldr_tile(ng, tile, model, ifield, lbi, ubi, lbj, ubj, finp, fout, update, setbc)
subroutine set_3dfldr_tile(ng, tile, model, ifield, lbi, ubi, lbj, ubj, lbk, ubk, finp, fout, update, setbc)
logical function, public founderror(flag, noerr, line, routine)
subroutine set_ngfldr(ng, model, ifield, lbi, ubi, ubj, istr, iend, jrec, finp, fout, update)
recursive subroutine wclock_off(ng, model, region, line, routine)
recursive subroutine wclock_on(ng, model, region, line, routine)