127# ifdef ADJUST_BOUNDARY
130 & LBi, UBi, LBj, UBj)
137 integer,
intent(in) :: ng, model, tile
138# ifdef ADJUST_BOUNDARY
139 integer,
intent(in) :: lbij, ubij
141 integer,
intent(in) :: lbi, ubi, lbj, ubj
145 integer :: fcount, gfactor, gtype, status
147 integer :: i, itrc, j, k
153 character (len=*),
parameter :: myfile = &
154 & __FILE__//
", tl_wrt_his_nf90"
167# if defined WRITE_WATER && defined MASKING
175 tlm(ng)%Rindex=
tlm(ng)%Rindex+1
177 tlm(ng)%Nrec(fcount)=
tlm(ng)%Nrec(fcount)+1
199 tlm(ng)%Rindex=mod(
tlm(ng)%Rindex-1,2)+1
211 & (/
tlm(ng)%Rindex/), (/1/), &
212 & ncid =
tlm(ng)%ncid, &
216# ifdef ADJUST_WSTRESS
226 &
tlm(ng)%Rindex, gtype, &
227 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
229 &
grid(ng) % umask, &
232 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
247 &
tlm(ng)%Rindex, gtype, &
248 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
250 &
grid(ng) % vmask, &
253 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
262# if defined ADJUST_STFLUX && defined SOLVE3D
274 &
tlm(ng)%Rindex, gtype, &
275 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
277 &
grid(ng) % rmask, &
280 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
291# if defined FORCING_SV || defined STOCHASTIC_OPT || \
292 defined hessian_so || defined hessian_fsv
301 &
tlm(ng)%Rindex, gtype, &
302 & lbi, ubi, lbj, ubj, scale, &
304 &
grid(ng) % umask, &
307 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
324 &
tlm(ng)%Rindex, gtype, &
325 & lbi, ubi, lbj, ubj, scale, &
327 &
grid(ng) % vmask, &
330 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
350 &
tlm(ng)%Rindex, gtype, &
351 & lbi, ubi, lbj, ubj, scale, &
353 &
grid(ng) % rmask, &
355 &
forces(ng) % tl_stflx(:,:,itrc))
356 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
378 &
tlm(ng)%Rindex, gtype, &
379 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
381 &
grid(ng) % rmask, &
383 &
grid(ng) % tl_z_r, &
384 & setfillval = .false.)
385 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
402 &
tlm(ng)%Rindex, gtype, &
403 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
405 &
grid(ng) % rmask, &
407 &
grid(ng) % tl_z_w, &
408 & setfillval = .false.)
409 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
427 &
tlm(ng)%Rindex, gtype, &
428 & lbi, ubi, lbj, ubj, scale, &
430 &
grid(ng) % rmask, &
433 &
ocean(ng) % tl_zeta(:,:,kout), &
434 & setfillval = .false.)
437 &
ocean(ng) % f_zeta(:,:))
439 &
ocean(ng) % tl_zeta(:,:,kout))
442 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
451# if defined FORWARD_WRITE && defined FORWARD_RHS
455 &
tlm(ng)%Rindex, gtype, &
456 & lbi, ubi, lbj, ubj, scale, &
458 &
grid(ng) % rmask, &
460 &
ocean(ng) % tl_rzeta(:,:,kout))
461 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
472# ifdef ADJUST_BOUNDARY
482 & lbij, ubij,
nbrec(ng), scale, &
483 &
boundary(ng) % tl_zeta_obc(lbij:,:,:, &
485 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
504 &
tlm(ng)%Rindex, gtype, &
505 & lbi, ubi, lbj, ubj, scale, &
507 &
grid(ng) % umask_full, &
510 &
ocean(ng) % f_ubar(:,:))
512 &
ocean(ng) % tl_ubar(:,:,kout))
514 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
528 &
tlm(ng)%Rindex, gtype, &
529 & lbi, ubi, lbj, ubj, scale, &
531 &
grid(ng) % umask_full, &
533 &
ocean(ng) % tl_rubar(:,:,kout))
534 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
548 &
tlm(ng)%Rindex, gtype, &
549 & lbi, ubi, lbj, ubj, scale, &
551 &
grid(ng) % umask_full, &
554 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
566 &
tlm(ng)%Rindex, gtype, &
567 & lbi, ubi, lbj, ubj, scale, &
569 &
grid(ng) % umask_full, &
572 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
583 &
tlm(ng)%Rindex, gtype, &
584 & lbi, ubi, lbj, ubj, scale, &
586 &
grid(ng) % umask_full, &
589 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
601# ifdef ADJUST_BOUNDARY
611 & lbij, ubij,
nbrec(ng), scale, &
612 &
boundary(ng) % tl_ubar_obc(lbij:,:,:, &
614 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
633 &
tlm(ng)%Rindex, gtype, &
634 & lbi, ubi, lbj, ubj, scale, &
636 &
grid(ng) % vmask_full, &
639 &
ocean(ng) % f_vbar(:,:))
641 &
ocean(ng) % tl_vbar(:,:,kout))
643 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
657 &
tlm(ng)%Rindex, gtype, &
658 & lbi, ubi, lbj, ubj, scale, &
660 &
grid(ng) % vmask_full, &
662 &
ocean(ng) % tl_rvbar(:,:,kout))
663 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
677 &
tlm(ng)%Rindex, gtype, &
678 & lbi, ubi, lbj, ubj, scale, &
680 &
grid(ng) % vmask_full, &
683 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
695 &
tlm(ng)%Rindex, gtype, &
696 & lbi, ubi, lbj, ubj, scale, &
698 &
grid(ng) % vmask_full, &
701 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
712 &
tlm(ng)%Rindex, gtype, &
713 & lbi, ubi, lbj, ubj, scale, &
715 &
grid(ng) % vmask_full, &
718 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
730# ifdef ADJUST_BOUNDARY
740 & lbij, ubij,
nbrec(ng), scale, &
741 &
boundary(ng) % tl_vbar_obc(lbij:,:,:, &
743 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
763 &
tlm(ng)%Rindex, gtype, &
764 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
766 &
grid(ng) % umask_full, &
769 &
ocean(ng) % f_u(:,:,:))
771 &
ocean(ng) % tl_u(:,:,:,nout))
773 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
782# if defined FORWARD_WRITE && defined FORWARD_RHS
786 &
tlm(ng)%Rindex, gtype, &
787 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
789 &
grid(ng) % umask_full, &
791 &
ocean(ng) % tl_ru(:,:,:,nout))
792 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
803# ifdef ADJUST_BOUNDARY
813 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
814 &
boundary(ng) % tl_u_obc(lbij:,:,:,:, &
816 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
835 &
tlm(ng)%Rindex, gtype, &
836 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
838 &
grid(ng) % vmask_full, &
841 &
ocean(ng) % f_v(:,:,:))
843 &
ocean(ng) % tl_v(:,:,:,nout))
845 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
854# if defined FORWARD_WRITE && defined FORWARD_RHS
858 &
tlm(ng)%Rindex, gtype, &
859 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
861 &
grid(ng) % vmask_full, &
863 &
ocean(ng) % tl_rv(:,:,:,nout))
864 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
875# ifdef ADJUST_BOUNDARY
885 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
886 &
boundary(ng) % tl_v_obc(lbij:,:,:,:, &
888 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
899# ifdef UV_DESTAGGERED
908 &
tlm(ng)%Rindex, gtype, &
909 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
911 &
grid(ng) % rmask_full, &
914 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
929 &
tlm(ng)%Rindex, gtype, &
930 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
932 &
grid(ng) % rmask_full, &
935 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
953 &
tlm(ng)%Tid(itrc), &
954 &
tlm(ng)%Rindex, gtype, &
955 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
957 &
grid(ng) % rmask, &
960 &
ocean(ng) % f_t(:,:,:,itrc))
962 &
ocean(ng) % tl_t(:,:,:,nout,itrc))
964 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
976# ifdef ADJUST_BOUNDARY
987 & lbij, ubij, 1,
n(ng),
nbrec(ng), &
989 &
boundary(ng) % tl_t_obc(lbij:,:,:,:, &
991 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1011 &
tlm(ng)%Rindex, gtype, &
1012 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
1014 &
grid(ng) % rmask, &
1016 &
ocean(ng) % tl_rho)
1017 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1027# if defined FORWARD_MIXING && \
1028 (defined bvf_mixing || defined gls_mixing || \
1029 defined lmd_mixing || defined my25_mixing)
1038 &
tlm(ng)%Rindex, gtype, &
1039 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1041 &
grid(ng) % rmask, &
1043# ifdef WEAK_CONSTRAINT
1048 & setfillval = .false.)
1049 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1066 &
tlm(ng)%Rindex, gtype, &
1067 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1069 &
grid(ng) % rmask, &
1071# ifdef WEAK_CONSTRAINT
1076 & setfillval = .false.)
1077 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1096 &
tlm(ng)%Rindex, gtype, &
1097 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1099 &
grid(ng) % rmask, &
1101# ifdef WEAK_CONSTRAINT
1106 & setfillval = .false.)
1107 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1117# if defined GLS_MIXING_NOT_YET || defined MY25_MIXING_NOT_YET
1126 &
tlm(ng)%Rindex, gtype, &
1127 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1129 &
grid(ng) % rmask, &
1131 &
mixing(ng) % tl_tke(:,:,:,nout), &
1132 & setfillval = .false.)
1133 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1146 &
tlm(ng)%Rindex, gtype, &
1147 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1149 &
grid(ng) % rmask, &
1152 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1169 &
tlm(ng)%Rindex, gtype, &
1170 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1172 &
grid(ng) % rmask, &
1174 &
mixing(ng) % tl_gls(:,:,:,nout), &
1175 & setfillval = .false.)
1176 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1189 &
tlm(ng)%Rindex, gtype, &
1190 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1192 &
grid(ng) % rmask, &
1194 &
mixing(ng) % tl_Lscale)
1195 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1209 &
tlm(ng)%Rindex, gtype, &
1210 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1212 &
grid(ng) % rmask, &
1215 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1237 10
FORMAT (2x,
'TL_WRT_HIS_NF90 - writing history', t42, &
1240 &
'fields (Index=',i1,
',',i1,
') in record = ',i0,t92,i2.2)
1242 &
'fields (Index=',i1,
',',i1,
') in record = ',i0)
1246 &
'fields (Index=',i1,
') in record = ',i0,t92,i2.2)
1248 &
'fields (Index=',i1,
') in record = ',i0)
1251 20
FORMAT (/,
' TL_WRT_HIS_NF90 - error while writing variable: ',a, &
1252 & /,19x,
'into tangent NetCDF file for time record: ',i0)
1261# ifdef ADJUST_BOUNDARY
1264 & LBi, UBi, LBj, UBj)
1271 integer,
intent(in) :: ng, model, tile
1272# ifdef ADJUST_BOUNDARY
1273 integer,
intent(in) :: lbij, ubij
1275 integer,
intent(in) :: lbi, ubi, lbj, ubj
1279 integer :: fcount, ifield, status
1281 integer :: i, itrc, j, k
1287 character (len=*),
parameter :: myfile = &
1288 & __FILE__//
", tl_wrt_his_pio"
1290 TYPE (io_desc_t),
pointer :: iodesc
1302 tlm(ng)%Rindex=
tlm(ng)%Rindex+1
1304 tlm(ng)%Nrec(fcount)=
tlm(ng)%Nrec(fcount)+1
1326 tlm(ng)%Rindex=mod(
tlm(ng)%Rindex-1,2)+1
1338 & (/
tlm(ng)%Rindex/), (/1/), &
1339 & piofile =
tlm(ng)%pioFile, &
1343# ifdef ADJUST_WSTRESS
1350 IF (
tlm(ng)%pioVar(
idusms)%dkind.eq.pio_double)
THEN
1358 &
tlm(ng)%Rindex, iodesc, &
1359 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1361 &
grid(ng) % umask, &
1364 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1376 IF (
tlm(ng)%pioVar(
idvsms)%dkind.eq.pio_double)
THEN
1384 &
tlm(ng)%Rindex, iodesc, &
1385 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1387 &
grid(ng) % vmask, &
1390 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1399# if defined ADJUST_STFLUX && defined SOLVE3D
1408 IF (
tlm(ng)%pioVar(
idtsur(itrc))%dkind.eq.pio_double)
THEN
1416 &
tlm(ng)%Rindex, iodesc, &
1417 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1419 &
grid(ng) % rmask, &
1422 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1433# if defined FORCING_SV || defined STOCHASTIC_OPT || \
1434 defined hessian_so || defined hessian_fsv
1440 IF (
tlm(ng)%pioVar(
idusms)%dkind.eq.pio_double)
THEN
1448 &
tlm(ng)%Rindex, iodesc, &
1449 & lbi, ubi, lbj, ubj, scale, &
1451 &
grid(ng) % umask, &
1454 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1468 IF (
tlm(ng)%pioVar(
idvsms)%dkind.eq.pio_double)
THEN
1476 &
tlm(ng)%Rindex, iodesc, &
1477 & lbi, ubi, lbj, ubj, scale, &
1479 &
grid(ng) % vmask, &
1482 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1499 IF (
tlm(ng)%pioVar(
idtsur(itrc))%dkind.eq.pio_double)
THEN
1507 &
tlm(ng)%Rindex, iodesc, &
1508 & lbi, ubi, lbj, ubj, scale, &
1510 &
grid(ng) % rmask, &
1512 &
forces(ng) % tl_stflx(:,:,itrc))
1513 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1532 IF (
his(ng)%pioVar(
idpthr)%dkind.eq.pio_double)
THEN
1541 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
1543 &
grid(ng) % rmask, &
1545 &
grid(ng) % tl_z_r, &
1546 & setfillval = .false.)
1547 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1561 IF (
his(ng)%pioVar(
idpthw)%dkind.eq.pio_double)
THEN
1570 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1572 &
grid(ng) % rmask, &
1574 &
grid(ng) % tl_z_w, &
1575 & setfillval = .false.)
1576 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1591 IF (
tlm(ng)%pioVar(
idfsur)%dkind.eq.pio_double)
THEN
1599 &
tlm(ng)%Rindex, iodesc, &
1600 & lbi, ubi, lbj, ubj, scale, &
1602 &
grid(ng) % rmask, &
1605 &
ocean(ng) % tl_zeta(:,:,kout), &
1606 & setfillval = .false.)
1609 &
ocean(ng) % f_zeta(:,:))
1611 &
ocean(ng) % tl_zeta(:,:,kout))
1614 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1623# if defined FORWARD_WRITE && defined FORWARD_RHS
1625 IF (
tlm(ng)%pioVar(
idrzet)%dkind.eq.pio_double)
THEN
1633 &
tlm(ng)%Rindex, iodesc, &
1634 & lbi, ubi, lbj, ubj, scale, &
1636 &
grid(ng) % rmask, &
1638 &
ocean(ng) % tl_rzeta(:,:,kout))
1639 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1650# ifdef ADJUST_BOUNDARY
1657 IF (
tlm(ng)%pioVar(ifield)%dkind.eq.pio_double)
THEN
1664 &
tlm(ng)%pioFile, &
1665 &
vname(1,ifield), &
1666 &
tlm(ng)%pioVar(ifield), &
1667 &
tlm(ng)%Rindex, iodesc, &
1668 & lbij, ubij,
nbrec(ng), scale, &
1669 &
boundary(ng) % tl_zeta_obc(lbij:,:,:, &
1671 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1686 IF (
tlm(ng)%pioVar(
idubar)%dkind.eq.pio_double)
THEN
1694 &
tlm(ng)%Rindex, iodesc, &
1695 & lbi, ubi, lbj, ubj, scale, &
1697 &
grid(ng) % umask_full, &
1700 &
ocean(ng) % f_ubar(:,:))
1702 &
ocean(ng) % tl_ubar(:,:,kout))
1704 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1713# ifdef FORWARD_WRITE
1716 IF (
tlm(ng)%pioVar(
idru2d)%dkind.eq.pio_double)
THEN
1724 &
tlm(ng)%Rindex, iodesc, &
1725 & lbi, ubi, lbj, ubj, scale, &
1727 &
grid(ng) % umask_full, &
1729 &
ocean(ng) % tl_rubar(:,:,kout))
1730 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1742 IF (
tlm(ng)%pioVar(
idruct)%dkind.eq.pio_double)
THEN
1750 &
tlm(ng)%Rindex, iodesc, &
1751 & lbi, ubi, lbj, ubj, scale, &
1753 &
grid(ng) % umask_full, &
1756 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1766 IF (
tlm(ng)%pioVar(
idufx1)%dkind.eq.pio_double)
THEN
1774 &
tlm(ng)%Rindex, iodesc, &
1775 & lbi, ubi, lbj, ubj, scale, &
1777 &
grid(ng) % umask_full, &
1780 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1789 IF (
tlm(ng)%pioVar(
idufx2)%dkind.eq.pio_double)
THEN
1797 &
tlm(ng)%Rindex, iodesc, &
1798 & lbi, ubi, lbj, ubj, scale, &
1800 &
grid(ng) % umask_full, &
1803 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1815# ifdef ADJUST_BOUNDARY
1822 IF (
tlm(ng)%pioVar(ifield)%dkind.eq.pio_double)
THEN
1829 &
tlm(ng)%pioFile, &
1830 &
vname(1,ifield), &
1831 &
tlm(ng)%pioVar(ifield), &
1832 &
tlm(ng)%Rindex, iodesc, &
1833 & lbij, ubij,
nbrec(ng), scale, &
1834 &
boundary(ng) % tl_ubar_obc(lbij:,:,:, &
1836 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1851 IF (
tlm(ng)%pioVar(
idvbar)%dkind.eq.pio_double)
THEN
1859 &
tlm(ng)%Rindex, iodesc, &
1860 & lbi, ubi, lbj, ubj, scale, &
1862 &
grid(ng) % vmask_full, &
1865 &
ocean(ng) % f_vbar(:,:))
1867 &
ocean(ng) % tl_vbar(:,:,kout))
1869 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1878# ifdef FORWARD_WRITE
1881 IF (
tlm(ng)%pioVar(
idrv2d)%dkind.eq.pio_double)
THEN
1889 &
tlm(ng)%Rindex, iodesc, &
1890 & lbi, ubi, lbj, ubj, scale, &
1892 &
grid(ng) % vmask_full, &
1894 &
ocean(ng) % tl_rvbar(:,:,kout))
1895 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1907 IF (
tlm(ng)%pioVar(
idrvct)%dkind.eq.pio_double)
THEN
1915 &
tlm(ng)%Rindex, iodesc, &
1916 & lbi, ubi, lbj, ubj, scale, &
1918 &
grid(ng) % vmask_full, &
1921 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1931 IF (
tlm(ng)%pioVar(
idvfx1)%dkind.eq.pio_double)
THEN
1939 &
tlm(ng)%Rindex, iodesc, &
1940 & lbi, ubi, lbj, ubj, scale, &
1942 &
grid(ng) % vmask_full, &
1945 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1954 IF (
tlm(ng)%pioVar(
idvfx2)%dkind.eq.pio_double)
THEN
1962 &
tlm(ng)%Rindex, iodesc, &
1963 & lbi, ubi, lbj, ubj, scale, &
1965 &
grid(ng) % vmask_full, &
1968 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1980# ifdef ADJUST_BOUNDARY
1987 IF (
tlm(ng)%pioVar(ifield)%dkind.eq.pio_double)
THEN
1994 &
tlm(ng)%pioFile, &
1995 &
vname(1,ifield), &
1996 &
tlm(ng)%pioVar(ifield), &
1997 &
tlm(ng)%Rindex, iodesc, &
1998 & lbij, ubij,
nbrec(ng), scale, &
1999 &
boundary(ng) % tl_vbar_obc(lbij:,:,:, &
2001 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2017 IF (
tlm(ng)%pioVar(
iduvel)%dkind.eq.pio_double)
THEN
2025 &
tlm(ng)%Rindex, iodesc, &
2026 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2028 &
grid(ng) % umask_full, &
2031 &
ocean(ng) % f_u(:,:,:))
2033 &
ocean(ng) % tl_u(:,:,:,nout))
2035 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2044# if defined FORWARD_WRITE && defined FORWARD_RHS
2046 IF (
tlm(ng)%pioVar(
idru3d)%dkind.eq.pio_double)
THEN
2054 &
tlm(ng)%Rindex, iodesc, &
2055 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2057 &
grid(ng) % umask_full, &
2059 &
ocean(ng) % tl_ru(:,:,:,nout))
2060 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2071# ifdef ADJUST_BOUNDARY
2078 IF (
tlm(ng)%pioVar(ifield)%dkind.eq.pio_double)
THEN
2085 &
tlm(ng)%pioFile, &
2086 &
vname(1,ifield), &
2087 &
tlm(ng)%pioVar(ifield), &
2088 &
tlm(ng)%Rindex, iodesc, &
2089 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
2090 &
boundary(ng) % tl_u_obc(lbij:,:,:,:, &
2092 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2107 IF (
tlm(ng)%pioVar(
idvvel)%dkind.eq.pio_double)
THEN
2115 &
tlm(ng)%Rindex, iodesc, &
2116 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2118 &
grid(ng) % vmask_full, &
2121 &
ocean(ng) % f_v(:,:,:))
2123 &
ocean(ng) % tl_v(:,:,:,nout))
2125 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2134# if defined FORWARD_WRITE && defined FORWARD_RHS
2136 IF (
tlm(ng)%pioVar(
idrv3d)%dkind.eq.pio_double)
THEN
2144 &
tlm(ng)%Rindex, iodesc, &
2145 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2147 &
grid(ng) % vmask_full, &
2149 &
ocean(ng) % tl_rv(:,:,:,nout))
2150 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2161# ifdef ADJUST_BOUNDARY
2168 IF (
tlm(ng)%pioVar(ifield)%dkind.eq.pio_double)
THEN
2175 &
tlm(ng)%pioFile, &
2176 &
vname(1,ifield), &
2177 &
tlm(ng)%pioVar(ifield), &
2178 &
tlm(ng)%Rindex, iodesc, &
2179 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
2180 &
boundary(ng) % tl_v_obc(lbij:,:,:,:, &
2182 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2192# ifdef UV_DESTAGGERED
2198 IF (
tlm(ng)%pioVar(
idu3de)%dkind.eq.pio_double)
THEN
2207 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2209 &
grid(ng) % rmask_full, &
2211 &
ocean(ng) % tl_ua)
2212 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2225 IF (
tlm(ng)%pioVar(
idv3dn)%dkind.eq.pio_double)
THEN
2234 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2236 &
grid(ng) % rmask_full, &
2238 &
ocean(ng) % tl_va)
2239 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2255 IF (
tlm(ng)%pioTrc(itrc)%dkind.eq.pio_double)
THEN
2262 &
tlm(ng)%pioTrc(itrc), &
2263 &
tlm(ng)%Rindex, iodesc, &
2264 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2266 &
grid(ng) % rmask, &
2269 &
ocean(ng) % f_t(:,:,:,itrc))
2271 &
ocean(ng) % tl_t(:,:,:,nout,itrc))
2273 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2285# ifdef ADJUST_BOUNDARY
2293 IF (
tlm(ng)%pioVar(ifield)%dkind.eq.pio_double)
THEN
2300 &
tlm(ng)%pioFile, &
2301 &
vname(1,ifield), &
2302 &
tlm(ng)%pioVar(ifield), &
2303 &
tlm(ng)%Rindex, iodesc, &
2304 & lbij, ubij, 1,
n(ng),
nbrec(ng), &
2306 &
boundary(ng) % tl_t_obc(lbij:,:,:,:, &
2308 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2324 IF (
tlm(ng)%pioVar(
iddano)%dkind.eq.pio_double)
THEN
2332 &
tlm(ng)%Rindex, iodesc, &
2333 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2335 &
grid(ng) % rmask, &
2337 &
ocean(ng) % tl_rho)
2338 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2348# if defined FORWARD_MIXING && \
2349 (defined bvf_mixing || defined gls_mixing || \
2350 defined lmd_mixing || defined my25_mixing)
2356 IF (
tlm(ng)%pioVar(
idvvis)%dkind.eq.pio_double)
THEN
2364 &
tlm(ng)%Rindex, iodesc, &
2365 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
2367 &
grid(ng) % rmask, &
2369# ifdef WEAK_CONSTRAINT
2374 & setfillval = .false.)
2375 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2389 IF (
tlm(ng)%pioVar(
idtdif)%dkind.eq.pio_double)
THEN
2397 &
tlm(ng)%Rindex, iodesc, &
2398 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
2400 &
grid(ng) % rmask, &
2402# ifdef WEAK_CONSTRAINT
2407 & setfillval = .false.)
2408 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2424 IF (
tlm(ng)%pioVar(
idsdif)%dkind.eq.pio_double)
THEN
2432 &
tlm(ng)%Rindex, iodesc, &
2433 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
2435 &
grid(ng) % rmask, &
2437# ifdef WEAK_CONSTRAINT
2442 & setfillval = .false.)
2443 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2453# if defined GLS_MIXING_NOT_YET || defined MY25_MIXING_NOT_YET
2459 IF (
tlm(ng)%pioVar(
idmtke)%dkind.eq.pio_double)
THEN
2467 &
tlm(ng)%Rindex, iodesc, &
2468 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
2470 &
grid(ng) % rmask, &
2472 &
mixing(ng) % tl_tke(:,:,:,nout), &
2473 & setfillval = .false.)
2474 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2484 IF (
tlm(ng)%pioVar(
idvmkk)%dkind.eq.pio_double)
THEN
2492 &
tlm(ng)%Rindex, iodesc, &
2493 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
2495 &
grid(ng) % rmask, &
2498 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2512 IF (
tlm(ng)%pioVar(idmtld)%dkind.eq.pio_double)
THEN
2520 &
tlm(ng)%Rindex, iodesc, &
2521 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
2523 &
grid(ng) % rmask, &
2525 &
mixing(ng) % tl_gls(:,:,:,nout), &
2526 & setfillval = .false.)
2527 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2537 IF (
tlm(ng)%pioVar(
idvmls)%dkind.eq.pio_double)
THEN
2545 &
tlm(ng)%Rindex, iodesc, &
2546 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
2548 &
grid(ng) % rmask, &
2550 &
mixing(ng) % tl_Lscale)
2551 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2563 IF (
tlm(ng)%pioVar(
idvmkp)%dkind.eq.pio_double)
THEN
2571 &
tlm(ng)%Rindex, iodesc, &
2572 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
2574 &
grid(ng) % rmask, &
2577 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2599 10
FORMAT (2x,
'TL_WRT_HIS_PIO - writing history', t42, &
2602 &
'fields (Index=',i1,
',',i1,
') in record = ',i0,t92,i2.2)
2604 &
'fields (Index=',i1,
',',i1,
') in record = ',i0)
2608 &
'fields (Index=',i1,
') in record = ',i0,t92,i2.2)
2610 &
'fields (Index=',i1,
') in record = ',i0)
2613 20
FORMAT (/,
' TL_WRT_HIS_PIO - error while writing variable: ',a, &
2614 & /,19x,
'into tangent NetCDF file for time record: ',i0)