157#ifdef ADJUST_BOUNDARY
160 & LBi, UBi, LBj, UBj)
167 integer,
intent(in) :: ng, model, tile
168#ifdef ADJUST_BOUNDARY
169 integer,
intent(in) :: lbij, ubij
171 integer,
intent(in) :: lbi, ubi, lbj, ubj
175 integer :: fcount, gfactor, gtype, ifield, status
177 integer :: i, itrc, j, k
182 real(r8),
allocatable :: ur2d(:,:)
183 real(r8),
allocatable :: vr2d(:,:)
185 real(r8),
allocatable :: wr3d(:,:,:)
188 character (len=*),
parameter :: myfile = &
189 & __FILE__//
", wrt_his_nf90"
191# include "set_bounds.h"
204#if defined WRITE_WATER && defined MASKING
212 his(ng)%Rindex=
his(ng)%Rindex+1
214 his(ng)%Nrec(fcount)=
his(ng)%Nrec(fcount)+1
236 & (/
his(ng)%Rindex/), (/1/), &
237 & ncid =
his(ng)%ncid, &
249 &
his(ng)%Rindex, gtype, &
250 & lbi, ubi, lbj, ubj, scale, &
252 &
grid(ng) % pmask, &
254 &
grid(ng) % pmask_wet, &
255 & setfillval = .false.)
256 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
271 &
his(ng)%Rindex, gtype, &
272 & lbi, ubi, lbj, ubj, scale, &
274 &
grid(ng) % rmask, &
276 &
grid(ng) % rmask_wet, &
277 & setfillval = .false.)
278 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
293 &
his(ng)%Rindex, gtype, &
294 & lbi, ubi, lbj, ubj, scale, &
296 &
grid(ng) % umask, &
298 &
grid(ng) % umask_wet, &
299 & setfillval = .false.)
300 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
315 &
his(ng)%Rindex, gtype, &
316 & lbi, ubi, lbj, ubj, scale, &
318 &
grid(ng) % vmask, &
320 &
grid(ng) % vmask_wet, &
321 & setfillval = .false.)
322 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
340 &
his(ng)%Rindex, gtype, &
341 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
343 &
grid(ng) % rmask, &
346 & setfillval = .false.)
347 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
365 grid(ng)%z_v(i,j,k)=0.5_r8*(
grid(ng)%z_r(i-1,j,k)+ &
366 &
grid(ng)%z_r(i ,j,k))
372 &
his(ng)%Rindex, gtype, &
373 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
375 &
grid(ng) % umask, &
378 & setfillval = .false.)
379 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
397 grid(ng)%z_v(i,j,k)=0.5_r8*(
grid(ng)%z_r(i,j-1,k)+ &
398 &
grid(ng)%z_r(i,j ,k))
404 &
his(ng)%Rindex, gtype, &
405 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
407 &
grid(ng) % vmask, &
410 & setfillval = .false.)
411 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
428 &
his(ng)%Rindex, gtype, &
429 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
431 &
grid(ng) % rmask, &
434 & setfillval = .false.)
435 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
453 &
his(ng)%Rindex, gtype, &
454 & lbi, ubi, lbj, ubj, scale, &
456 &
grid(ng) % rmask, &
459 &
ocean(ng) % zeta(:,:,kout), &
460 & setfillval = .false.)
462 &
ocean(ng) % zeta(:,:,kout))
464 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
472#if defined FORWARD_WRITE && defined FORWARD_RHS
475 &
his(ng)%Rindex, gtype, &
476 & lbi, ubi, lbj, ubj, scale, &
478 &
grid(ng) % rmask, &
480 &
ocean(ng) % rzeta(:,:,kout))
481 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
491#ifdef ADJUST_BOUNDARY
501 & lbij, ubij,
nbrec(ng), scale, &
502 &
boundary(ng) % zeta_obc(lbij:,:,:, &
504 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
523 &
his(ng)%Rindex, gtype, &
524 & lbi, ubi, lbj, ubj, scale, &
526 &
grid(ng) % umask_full, &
528 &
ocean(ng) % ubar(:,:,kout))
529 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
541 &
his(ng)%Rindex, gtype, &
542 & lbi, ubi, lbj, ubj, scale, &
544 &
grid(ng) % umask_full, &
546 &
ocean(ng) % rubar(:,:,kout))
547 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
560 &
his(ng)%Rindex, gtype, &
561 & lbi, ubi, lbj, ubj, scale, &
563 &
grid(ng) % umask_full, &
566 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
577 &
his(ng)%Rindex, gtype, &
578 & lbi, ubi, lbj, ubj, scale, &
580 &
grid(ng) % umask_full, &
583 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
593 &
his(ng)%Rindex, gtype, &
594 & lbi, ubi, lbj, ubj, scale, &
596 &
grid(ng) % umask_full, &
599 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
610#ifdef ADJUST_BOUNDARY
620 & lbij, ubij,
nbrec(ng), scale, &
621 &
boundary(ng) % ubar_obc(lbij:,:,:, &
623 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
642 &
his(ng)%Rindex, gtype, &
643 & lbi, ubi, lbj, ubj, scale, &
645 &
grid(ng) % vmask_full, &
647 &
ocean(ng) % vbar(:,:,kout))
648 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
660 &
his(ng)%Rindex, gtype, &
661 & lbi, ubi, lbj, ubj, scale, &
663 &
grid(ng) % vmask_full, &
665 &
ocean(ng) % rvbar(:,:,kout))
666 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
679 &
his(ng)%Rindex, gtype, &
680 & lbi, ubi, lbj, ubj, scale, &
682 &
grid(ng) % vmask_full, &
685 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
696 &
his(ng)%Rindex, gtype, &
697 & lbi, ubi, lbj, ubj, scale, &
699 &
grid(ng) % vmask_full, &
702 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
712 &
his(ng)%Rindex, gtype, &
713 & lbi, ubi, lbj, ubj, scale, &
715 &
grid(ng) % vmask_full, &
718 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
729#ifdef ADJUST_BOUNDARY
739 & lbij, ubij,
nbrec(ng), scale, &
740 &
boundary(ng) % vbar_obc(lbij:,:,:, &
742 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
758 IF (.not.
allocated(ur2d))
THEN
759 allocate (ur2d(lbi:ubi,lbj:ubj))
760 ur2d(lbi:ubi,lbj:ubj)=0.0_r8
762 IF (.not.
allocated(vr2d))
THEN
763 allocate (vr2d(lbi:ubi,lbj:ubj))
764 vr2d(lbi:ubi,lbj:ubj)=0.0_r8
767 & lbi, ubi, lbj, ubj, &
768 &
grid(ng) % CosAngler, &
769 &
grid(ng) % SinAngler, &
771 &
grid(ng) % rmask_full, &
773 &
ocean(ng) % ubar(:,:,kout), &
774 &
ocean(ng) % vbar(:,:,kout), &
781 &
his(ng)%Rindex, gtype, &
782 & lbi, ubi, lbj, ubj, scale, &
784 &
grid(ng) % rmask_full, &
787 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
798 &
his(ng)%Rindex, gtype, &
799 & lbi, ubi, lbj, ubj, scale, &
801 &
grid(ng) % rmask_full, &
804 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
825 &
his(ng)%Rindex, gtype, &
826 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
828 &
grid(ng) % umask_full, &
830 &
ocean(ng) % u(:,:,:,nout))
831 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
839# if defined FORWARD_WRITE && defined FORWARD_RHS
842 &
his(ng)%Rindex, gtype, &
843 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
845 &
grid(ng) % umask_full, &
847 &
ocean(ng) % ru(:,:,:,nout))
848 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
858# ifdef ADJUST_BOUNDARY
868 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
869 &
boundary(ng) % u_obc(lbij:,:,:,:, &
871 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
890 &
his(ng)%Rindex, gtype, &
891 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
893 &
grid(ng) % vmask_full, &
895 &
ocean(ng) % v(:,:,:,nout))
896 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
904# if defined FORWARD_WRITE && defined FORWARD_RHS
907 &
his(ng)%Rindex, gtype, &
908 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
910 &
grid(ng) % vmask_full, &
912 &
ocean(ng) % rv(:,:,:,nout))
913 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
923# ifdef ADJUST_BOUNDARY
933 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
934 &
boundary(ng) % v_obc(lbij:,:,:,:, &
936 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
955 &
his(ng)%Rindex, gtype, &
956 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
958 &
grid(ng) % rmask_full, &
961 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
976 &
his(ng)%Rindex, gtype, &
977 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
979 &
grid(ng) % rmask_full, &
982 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
995 IF (.not.
allocated(wr3d))
THEN
996 allocate (wr3d(lbi:ubi,lbj:ubj,0:
n(ng)))
997 wr3d(lbi:ubi,lbj:ubj,0:
n(ng))=0.0_r8
1001 CALL scale_omega (ng, tile, lbi, ubi, lbj, ubj, 0,
n(ng), &
1008 &
his(ng)%Rindex, gtype, &
1009 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1011 &
grid(ng) % rmask, &
1014 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1025# ifdef OMEGA_IMPLICIT
1030 IF (.not.
allocated(wr3d))
THEN
1031 allocate (wr3d(lbi:ubi,lbj:ubj,0:
n(ng)))
1032 wr3d(lbi:ubi,lbj:ubj,0:
n(ng))=0.0_r8
1036 CALL scale_omega (ng, tile, lbi, ubi, lbj, ubj, 0,
n(ng), &
1043 &
his(ng)%Rindex, gtype, &
1044 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1046 &
grid(ng) % rmask, &
1049 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1068 &
his(ng)%Rindex, gtype, &
1069 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1071 &
grid(ng) % rmask, &
1074 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1091 &
his(ng)%Tid(itrc), &
1092 &
his(ng)%Rindex, gtype, &
1093 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
1095 &
grid(ng) % rmask, &
1097 &
ocean(ng) % t(:,:,:,nout,itrc))
1098 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1110# ifdef ADJUST_BOUNDARY
1119 &
vname(1,ifield), &
1120 &
his(ng)%Vid(ifield), &
1122 & lbij, ubij, 1,
n(ng),
nbrec(ng), &
1124 &
boundary(ng) % t_obc(lbij:,:,:,:, &
1126 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1145 &
his(ng)%Rindex, gtype, &
1146 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
1148 &
grid(ng) % rmask, &
1151 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1169 &
his(ng)%Rindex, gtype, &
1170 & lbi, ubi, lbj, ubj, scale, &
1172 &
grid(ng) % rmask, &
1175 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1194 &
his(ng)%Rindex, gtype, &
1195 & lbi, ubi, lbj, ubj, scale, &
1197 &
grid(ng) % rmask, &
1200 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1210# if defined FORWARD_WRITE && defined LMD_NONLOCAL
1220 &
his(ng)%Rindex, gtype, &
1221 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1223 &
grid(ng) % rmask, &
1225 &
mixing(ng) % ghats(:,:,:,i))
1226 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1245 &
his(ng)%Rindex, gtype, &
1246 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1248 &
grid(ng) % rmask, &
1251 & setfillval = .false.)
1252 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1269 &
his(ng)%Rindex, gtype, &
1270 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1272 &
grid(ng) % rmask, &
1275 & setfillval = .false.)
1276 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1294 &
his(ng)%Rindex, gtype, &
1295 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1297 &
grid(ng) % rmask, &
1300 & setfillval = .false.)
1301 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1311# if defined GLS_MIXING || defined MY25_MIXING
1320 &
his(ng)%Rindex, gtype, &
1321 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1323 &
grid(ng) % rmask, &
1325 &
mixing(ng) % tke(:,:,:,nout), &
1326 & setfillval = .false.)
1327 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1335# ifdef FORWARD_WRITE
1340 &
his(ng)%Rindex, gtype, &
1341 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1343 &
grid(ng) % rmask, &
1346 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1364 &
his(ng)%Rindex, gtype, &
1365 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1367 &
grid(ng) % rmask, &
1369 &
mixing(ng) % gls(:,:,:,nout), &
1370 & setfillval = .false.)
1371 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1379# ifdef FORWARD_WRITE
1384 &
his(ng)%Rindex, gtype, &
1385 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1387 &
grid(ng) % rmask, &
1390 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1399# if defined FORWARD_WRITE && defined GLS_MIXING
1404 &
his(ng)%Rindex, gtype, &
1405 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
1407 &
grid(ng) % rmask, &
1410 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1421# if defined BULK_FLUXES || defined ECOSIM || defined ATM_PRESS
1430 &
his(ng)%Rindex, gtype, &
1431 & lbi, ubi, lbj, ubj, scale, &
1433 &
grid(ng) % rmask, &
1436 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1446# if defined BULK_FLUXES
1455 &
his(ng)%Rindex, gtype, &
1456 & lbi, ubi, lbj, ubj, scale, &
1458 &
grid(ng) % rmask, &
1461 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1471# if defined BULK_FLUXES || defined ECOSIM
1480 &
his(ng)%Rindex, gtype, &
1481 & lbi, ubi, lbj, ubj, scale, &
1483 &
grid(ng) % rmask, &
1486 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1501 &
his(ng)%Rindex, gtype, &
1502 & lbi, ubi, lbj, ubj, scale, &
1504 &
grid(ng) % rmask, &
1507 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1520 IF (.not.
allocated(ur2d))
THEN
1521 allocate (ur2d(lbi:ubi,lbj:ubj))
1522 ur2d(lbi:ubi,lbj:ubj)=0.0_r8
1524 IF (.not.
allocated(vr2d))
THEN
1525 allocate (vr2d(lbi:ubi,lbj:ubj))
1526 vr2d(lbi:ubi,lbj:ubj)=0.0_r8
1529 & lbi, ubi, lbj, ubj, &
1530 &
grid(ng) % CosAngler, &
1531 &
grid(ng) % SinAngler, &
1533 &
grid(ng) % rmask_full, &
1543 &
his(ng)%Rindex, gtype, &
1544 & lbi, ubi, lbj, ubj, scale, &
1546 &
grid(ng) % rmask, &
1549 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1562 &
his(ng)%Rindex, gtype, &
1563 & lbi, ubi, lbj, ubj, scale, &
1565 &
grid(ng) % rmask, &
1568 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1585 IF (itrc.eq.
itemp)
THEN
1591 ELSE IF (itrc.eq.
isalt)
THEN
1597 &
his(ng)%Rindex, gtype, &
1598 & lbi, ubi, lbj, ubj, scale, &
1600 &
grid(ng) % rmask, &
1602 &
forces(ng) % stflx(:,:,itrc))
1603 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1615# if defined BULK_FLUXES || defined FRC_COUPLING
1624 &
his(ng)%Rindex, gtype, &
1625 & lbi, ubi, lbj, ubj, scale, &
1627 &
grid(ng) % rmask, &
1630 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1647 &
his(ng)%Rindex, gtype, &
1648 & lbi, ubi, lbj, ubj, scale, &
1650 &
grid(ng) % rmask, &
1653 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1670 &
his(ng)%Rindex, gtype, &
1671 & lbi, ubi, lbj, ubj, scale, &
1673 &
grid(ng) % rmask, &
1676 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1697 &
his(ng)%Rindex, gtype, &
1698 & lbi, ubi, lbj, ubj, scale, &
1700 &
grid(ng) % rmask, &
1703 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1720 &
his(ng)%Rindex, gtype, &
1721 & lbi, ubi, lbj, ubj, scale, &
1723 &
grid(ng) % rmask, &
1726 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1745 &
his(ng)%Rindex, gtype, &
1746 & lbi, ubi, lbj, ubj, scale, &
1748 &
grid(ng) % rmask, &
1751 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1769 &
his(ng)%Rindex, gtype, &
1770 & lbi, ubi, lbj, ubj, scale, &
1772 &
grid(ng) % rmask, &
1775 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1798 &
his(ng)%Rindex, gtype, &
1799 & lbi, ubi, lbj, ubj, scale, &
1801 &
grid(ng) % umask, &
1804 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1825 &
his(ng)%Rindex, gtype, &
1826 & lbi, ubi, lbj, ubj, scale, &
1828 &
grid(ng) % vmask, &
1831 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1848 &
his(ng)%Rindex, gtype, &
1849 & lbi, ubi, lbj, ubj, scale, &
1851 &
grid(ng) % umask, &
1854 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1871 &
his(ng)%Rindex, gtype, &
1872 & lbi, ubi, lbj, ubj, scale, &
1874 &
grid(ng) % vmask, &
1877 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1887#if (defined BBL_MODEL || defined WAVES_OUTPUT) && defined SOLVE3D
1894 & lbi, ubi, lbj, ubj, &
1899#if defined ICE_MODEL && defined SOLVE3D
1905 CALL ice_wrt_nf90 (ng, model, tile, &
1906 & lbi, ubi, lbj, ubj, &
1911#if defined SEDIMENT && defined SOLVE3D
1918 & lbi, ubi, lbj, ubj, &
1923#if defined WEC_VF && defined SOLVE3D
1929 CALL wec_wrt_nf90 (ng, model, tile, &
1930 & lbi, ubi, lbj, ubj, &
1943 10
FORMAT (2x,
'WRT_HIS_NF90 - writing history', t42, &
1946 &
'fields (Index=',i1,
',',i1,
') in record = ',i0,t92,i2.2)
1948 &
'fields (Index=',i1,
',',i1,
') in record = ',i0)
1952 &
'fields (Index=',i1,
') in record = ',i0,t92,i2.2)
1954 &
'fields (Index=',i1,
') in record = ',i0)
1957 20
FORMAT (/,
' WRT_HIS_NF90 - error while writing variable: ',a, &
1958 & /,16x,
'into history NetCDF file for time record: ',i0)
1967# ifdef ADJUST_BOUNDARY
1970 & LBi, UBi, LBj, UBj)
1977 integer,
intent(in) :: ng, model, tile
1978# ifdef ADJUST_BOUNDARY
1979 integer,
intent(in) :: lbij, ubij
1981 integer,
intent(in) :: lbi, ubi, lbj, ubj
1985 integer :: fcount, ifield, status
1987 integer :: i, itrc, j, k
1992 real(r8),
allocatable :: ur2d(:,:)
1993 real(r8),
allocatable :: vr2d(:,:)
1995 real(r8),
allocatable :: wr3d(:,:,:)
1998 character (len=*),
parameter :: myfile = &
1999 & __FILE__//
", wrt_his_pio"
2001 TYPE (io_desc_t),
pointer :: iodesc
2003# include "set_bounds.h"
2015 his(ng)%Rindex=
his(ng)%Rindex+1
2017 his(ng)%Nrec(fcount)=
his(ng)%Nrec(fcount)+1
2039 & (/
his(ng)%Rindex/), (/1/), &
2040 & piofile =
his(ng)%pioFile, &
2049 IF (
his(ng)%pioVar(
idpwet)%dkind.eq.pio_double)
THEN
2058 & lbi, ubi, lbj, ubj, scale, &
2060 &
grid(ng) % pmask, &
2062 &
grid(ng) % pmask_wet, &
2063 & setfillval = .false.)
2064 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2076 IF (
his(ng)%pioVar(
idrwet)%dkind.eq.pio_double)
THEN
2085 & lbi, ubi, lbj, ubj, scale, &
2087 &
grid(ng) % rmask, &
2089 &
grid(ng) % rmask_wet, &
2090 & setfillval = .false.)
2091 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2103 IF (
his(ng)%pioVar(
iduwet)%dkind.eq.pio_double)
THEN
2112 & lbi, ubi, lbj, ubj, scale, &
2114 &
grid(ng) % umask, &
2116 &
grid(ng) % umask_wet, &
2117 & setfillval = .false.)
2118 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2130 IF (
his(ng)%pioVar(
idvwet)%dkind.eq.pio_double)
THEN
2139 & lbi, ubi, lbj, ubj, scale, &
2141 &
grid(ng) % vmask, &
2143 &
grid(ng) % vmask_wet, &
2144 & setfillval = .false.)
2145 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2160 IF (
his(ng)%pioVar(
idpthr)%dkind.eq.pio_double)
THEN
2169 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2171 &
grid(ng) % rmask, &
2174 & setfillval = .false.)
2175 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2192 grid(ng)%z_v(i,j,k)=0.5_r8*(
grid(ng)%z_r(i-1,j,k)+ &
2193 &
grid(ng)%z_r(i ,j,k))
2197 IF (
his(ng)%pioVar(
idpthu)%dkind.eq.pio_double)
THEN
2206 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2208 &
grid(ng) % umask, &
2211 & setfillval = .false.)
2212 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2229 grid(ng)%z_v(i,j,k)=0.5_r8*(
grid(ng)%z_r(i,j-1,k)+ &
2230 &
grid(ng)%z_r(i,j ,k))
2234 IF (
his(ng)%pioVar(
idpthv)%dkind.eq.pio_double)
THEN
2243 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2245 &
grid(ng) % vmask, &
2248 & setfillval = .false.)
2249 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2263 IF (
his(ng)%pioVar(
idpthw)%dkind.eq.pio_double)
THEN
2272 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
2274 &
grid(ng) % rmask, &
2277 & setfillval = .false.)
2278 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2293 IF (
his(ng)%pioVar(
idfsur)%dkind.eq.pio_double)
THEN
2302 & lbi, ubi, lbj, ubj, scale, &
2304 &
grid(ng) % rmask, &
2307 &
ocean(ng) % zeta(:,:,kout), &
2308 & setfillval = .false.)
2310 &
ocean(ng) % zeta(:,:,kout))
2312 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2321# if defined FORWARD_WRITE && defined FORWARD_RHS
2323 IF (
his(ng)%pioVar(
idrzet)%dkind.eq.pio_double)
THEN
2332 & lbi, ubi, lbj, ubj, scale, &
2334 &
grid(ng) % rmask, &
2336 &
ocean(ng) % rzeta(:,:,kout))
2337 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2348# ifdef ADJUST_BOUNDARY
2360 &
his(ng)%pioFile, &
2365 & lbij, ubij,
nbrec(ng), scale, &
2366 &
boundary(ng) % zeta_obc(lbij:,:,:, &
2368 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2384 IF (
his(ng)%pioVar(
idubar)%dkind.eq.pio_double)
THEN
2393 & lbi, ubi, lbj, ubj, scale, &
2395 &
grid(ng) % umask_full, &
2397 &
ocean(ng) % ubar(:,:,kout))
2398 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2407# ifdef FORWARD_WRITE
2410 IF (
his(ng)%pioVar(
idru2d)%dkind.eq.pio_double)
THEN
2419 & lbi, ubi, lbj, ubj, scale, &
2421 &
grid(ng) % umask_full, &
2423 &
ocean(ng) % rubar(:,:,kout))
2424 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2436 IF (
his(ng)%pioVar(
idruct)%dkind.eq.pio_double)
THEN
2445 & lbi, ubi, lbj, ubj, scale, &
2447 &
grid(ng) % umask_full, &
2450 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2460 IF (
his(ng)%pioVar(
idufx1)%dkind.eq.pio_double)
THEN
2469 & lbi, ubi, lbj, ubj, scale, &
2471 &
grid(ng) % umask_full, &
2474 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2483 IF (
his(ng)%pioVar(
idufx2)%dkind.eq.pio_double)
THEN
2492 & lbi, ubi, lbj, ubj, scale, &
2494 &
grid(ng) % umask_full, &
2497 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2509# ifdef ADJUST_BOUNDARY
2521 &
his(ng)%pioFile, &
2526 & lbij, ubij,
nbrec(ng), scale, &
2527 &
boundary(ng) % ubar_obc(lbij:,:,:, &
2529 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2545 IF (
his(ng)%pioVar(
idvbar)%dkind.eq.pio_double)
THEN
2554 & lbi, ubi, lbj, ubj, scale, &
2556 &
grid(ng) % vmask_full, &
2558 &
ocean(ng) % vbar(:,:,kout))
2559 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2568# ifdef FORWARD_WRITE
2571 IF (
his(ng)%pioVar(
idrv2d)%dkind.eq.pio_double)
THEN
2580 & lbi, ubi, lbj, ubj, scale, &
2582 &
grid(ng) % vmask_full, &
2584 &
ocean(ng) % rvbar(:,:,kout))
2585 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2597 IF (
his(ng)%pioVar(
idrvct)%dkind.eq.pio_double)
THEN
2606 & lbi, ubi, lbj, ubj, scale, &
2608 &
grid(ng) % vmask_full, &
2611 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2621 IF (
his(ng)%pioVar(
idvfx1)%dkind.eq.pio_double)
THEN
2630 & lbi, ubi, lbj, ubj, scale, &
2632 &
grid(ng) % vmask_full, &
2635 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2644 IF (
his(ng)%pioVar(
idvfx2)%dkind.eq.pio_double)
THEN
2653 & lbi, ubi, lbj, ubj, scale, &
2655 &
grid(ng) % vmask_full, &
2658 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2670# ifdef ADJUST_BOUNDARY
2682 &
his(ng)%pioFile, &
2687 & lbij, ubij,
nbrec(ng), scale, &
2688 &
boundary(ng) % vbar_obc(lbij:,:,:, &
2690 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2706 IF (.not.
allocated(ur2d))
THEN
2707 allocate (ur2d(lbi:ubi,lbj:ubj))
2708 ur2d(lbi:ubi,lbj:ubj)=0.0_r8
2710 IF (.not.
allocated(vr2d))
THEN
2711 allocate (vr2d(lbi:ubi,lbj:ubj))
2712 vr2d(lbi:ubi,lbj:ubj)=0.0_r8
2715 & lbi, ubi, lbj, ubj, &
2716 &
grid(ng) % CosAngler, &
2717 &
grid(ng) % SinAngler, &
2719 &
grid(ng) % rmask_full, &
2721 &
ocean(ng) % ubar(:,:,kout), &
2722 &
ocean(ng) % vbar(:,:,kout), &
2726 IF (
his(ng)%pioVar(
idu2de)%dkind.eq.pio_double)
THEN
2735 & lbi, ubi, lbj, ubj, scale, &
2737 &
grid(ng) % rmask_full, &
2740 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2749 IF (
his(ng)%pioVar(
idv2dn)%dkind.eq.pio_double)
THEN
2758 & lbi, ubi, lbj, ubj, scale, &
2760 &
grid(ng) % rmask_full, &
2763 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2781 IF (
his(ng)%pioVar(
iduvel)%dkind.eq.pio_double)
THEN
2790 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2792 &
grid(ng) % umask_full, &
2794 &
ocean(ng) % u(:,:,:,nout))
2795 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2804# if defined FORWARD_WRITE && defined FORWARD_RHS
2806 IF (
his(ng)%pioVar(
idru3d)%dkind.eq.pio_double)
THEN
2815 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2817 &
grid(ng) % umask_full, &
2819 &
ocean(ng) % ru(:,:,:,nout))
2820 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2831# ifdef ADJUST_BOUNDARY
2843 &
his(ng)%pioFile, &
2848 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
2849 &
boundary(ng) % u_obc(lbij:,:,:,:, &
2851 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2867 IF (
his(ng)%pioVar(
idvvel)%dkind.eq.pio_double)
THEN
2876 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2878 &
grid(ng) % vmask_full, &
2880 &
ocean(ng) % v(:,:,:,nout))
2881 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2890# if defined FORWARD_WRITE && defined FORWARD_RHS
2892 IF (
his(ng)%pioVar(
idrv3d)%dkind.eq.pio_double)
THEN
2901 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2903 &
grid(ng) % vmask_full, &
2905 &
ocean(ng) % rv(:,:,:,nout))
2906 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2917# ifdef ADJUST_BOUNDARY
2929 &
his(ng)%pioFile, &
2934 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
2935 &
boundary(ng) % v_obc(lbij:,:,:,:, &
2937 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2953 IF (
his(ng)%pioVar(
idu3de)%dkind.eq.pio_double)
THEN
2962 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2964 &
grid(ng) % rmask_full, &
2967 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2980 IF (
his(ng)%pioVar(
idv3dn)%dkind.eq.pio_double)
THEN
2989 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
2991 &
grid(ng) % rmask_full, &
2994 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3007 IF (.not.
allocated(wr3d))
THEN
3008 allocate (wr3d(lbi:ubi,lbj:ubj,0:
n(ng)))
3009 wr3d(lbi:ubi,lbj:ubj,0:
n(ng))=0.0_r8
3012 CALL scale_omega (ng, tile, lbi, ubi, lbj, ubj, 0,
n(ng), &
3018 IF (
his(ng)%pioVar(
idovel)%dkind.eq.pio_double)
THEN
3027 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3029 &
grid(ng) % rmask, &
3032 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3043# ifdef OMEGA_IMPLICIT
3048 IF (.not.
allocated(wr3d))
THEN
3049 allocate (wr3d(lbi:ubi,lbj:ubj,0:
n(ng)))
3050 wr3d(lbi:ubi,lbj:ubj,0:
n(ng))=0.0_r8
3053 CALL scale_omega (ng, tile, lbi, ubi, lbj, ubj, 0,
n(ng), &
3059 IF (
his(ng)%pioVar(
idovil)%dkind.eq.pio_double)
THEN
3068 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3070 &
grid(ng) % rmask, &
3073 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3089 IF (
his(ng)%pioVar(
idwvel)%dkind.eq.pio_double)
THEN
3098 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3100 &
grid(ng) % rmask, &
3103 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3118 IF (
his(ng)%pioTrc(itrc)%dkind.eq.pio_double)
THEN
3124 &
his(ng)%pioTrc(itrc), &
3127 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
3129 &
grid(ng) % rmask, &
3131 &
ocean(ng) % t(:,:,:,nout,itrc))
3132 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3144# ifdef ADJUST_BOUNDARY
3152 IF (
his(ng)%pioVar(ifield)%dkind.eq.pio_double)
THEN
3158 &
his(ng)%pioFile, &
3159 &
vname(1,ifield), &
3160 &
his(ng)%pioVar(ifield), &
3163 & lbij, ubij, 1,
n(ng),
nbrec(ng), &
3165 &
boundary(ng) % t_obc(lbij:,:,:,:, &
3167 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3183 IF (
his(ng)%pioVar(
iddano)%dkind.eq.pio_double)
THEN
3192 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
3194 &
grid(ng) % rmask, &
3197 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3213 IF (
his(ng)%pioVar(
idhsbl)%dkind.eq.pio_double)
THEN
3222 & lbi, ubi, lbj, ubj, scale, &
3224 &
grid(ng) % rmask, &
3227 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3243 IF (
his(ng)%pioVar(
idhbbl)%dkind.eq.pio_double)
THEN
3252 & lbi, ubi, lbj, ubj, scale, &
3254 &
grid(ng) % rmask, &
3257 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3267# if defined FORWARD_WRITE && defined LMD_NONLOCAL
3274 IF (
his(ng)%pioVar(
idghat(i))%dkind.eq.pio_double)
THEN
3283 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3285 &
grid(ng) % rmask, &
3287 &
mixing(ng) % ghats(:,:,:,i))
3288 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3304 IF (
his(ng)%pioVar(
idvvis)%dkind.eq.pio_double)
THEN
3313 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3315 &
grid(ng) % rmask, &
3318 & setfillval = .false.)
3319 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3333 IF (
his(ng)%pioVar(
idtdif)%dkind.eq.pio_double)
THEN
3342 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3344 &
grid(ng) % rmask, &
3347 & setfillval = .false.)
3348 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3364 IF (
his(ng)%pioVar(
idsdif)%dkind.eq.pio_double)
THEN
3373 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3375 &
grid(ng) % rmask, &
3378 & setfillval = .false.)
3379 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3389# if defined GLS_MIXING || defined MY25_MIXING
3395 IF (
his(ng)%pioVar(
idmtke)%dkind.eq.pio_double)
THEN
3404 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3406 &
grid(ng) % rmask, &
3408 &
mixing(ng) % tke(:,:,:,nout), &
3409 & setfillval = .false.)
3410 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3419# ifdef FORWARD_WRITE
3422 IF (
his(ng)%pioVar(
idvmkk)%dkind.eq.pio_double)
THEN
3431 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3433 &
grid(ng) % rmask, &
3436 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3451 IF (
his(ng)%pioVar(
idmtls)%dkind.eq.pio_double)
THEN
3460 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3462 &
grid(ng) % rmask, &
3464 &
mixing(ng) % gls(:,:,:,nout), &
3465 & setfillval = .false.)
3466 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3475# ifdef FORWARD_WRITE
3477 IF (
his(ng)%pioVar(
idvmls)%dkind.eq.pio_double)
THEN
3487 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3489 &
grid(ng) % rmask, &
3492 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3501# if defined FORWARD_WRITE && defined GLS_MIXING
3504 IF (
his(ng)%pioVar(
idvmkp)%dkind.eq.pio_double)
THEN
3513 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
3515 &
grid(ng) % rmask, &
3518 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3529# if defined BULK_FLUXES || defined ECOSIM || defined ATM_PRESS
3535 IF (
his(ng)%pioVar(
idpair)%dkind.eq.pio_double)
THEN
3544 & lbi, ubi, lbj, ubj, scale, &
3546 &
grid(ng) % rmask, &
3549 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3559# if defined BULK_FLUXES
3565 IF (
his(ng)%pioVar(
idtair)%dkind.eq.pio_double)
THEN
3574 & lbi, ubi, lbj, ubj, scale, &
3576 &
grid(ng) % rmask, &
3579 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3589# if defined BULK_FLUXES || defined ECOSIM
3595 IF (
his(ng)%pioVar(
iduair)%dkind.eq.pio_double)
THEN
3604 & lbi, ubi, lbj, ubj, scale, &
3606 &
grid(ng) % rmask, &
3609 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3621 IF (
his(ng)%pioVar(
idvair)%dkind.eq.pio_double)
THEN
3630 & lbi, ubi, lbj, ubj, scale, &
3632 &
grid(ng) % rmask, &
3635 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3648 IF (.not.
allocated(ur2d))
THEN
3649 allocate (ur2d(lbi:ubi,lbj:ubj))
3650 ur2d(lbi:ubi,lbj:ubj)=0.0_r8
3652 IF (.not.
allocated(vr2d))
THEN
3653 allocate (vr2d(lbi:ubi,lbj:ubj))
3654 vr2d(lbi:ubi,lbj:ubj)=0.0_r8
3657 & lbi, ubi, lbj, ubj, &
3658 &
grid(ng) % CosAngler, &
3659 &
grid(ng) % SinAngler, &
3661 &
grid(ng) % rmask_full, &
3668 IF (
his(ng)%pioVar(
iduaie)%dkind.eq.pio_double)
THEN
3677 & lbi, ubi, lbj, ubj, scale, &
3679 &
grid(ng) % rmask, &
3682 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3692 IF (
his(ng)%pioVar(
idvain)%dkind.eq.pio_double)
THEN
3701 & lbi, ubi, lbj, ubj, scale, &
3703 &
grid(ng) % rmask, &
3706 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3723 IF (itrc.eq.
itemp)
THEN
3729 ELSE IF (itrc.eq.
isalt)
THEN
3732 IF (
his(ng)%pioVar(
idtsur(itrc))%dkind.eq.pio_double)
THEN
3741 & lbi, ubi, lbj, ubj, scale, &
3743 &
grid(ng) % rmask, &
3745 &
forces(ng) % stflx(:,:,itrc))
3746 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3758# if defined BULK_FLUXES || defined FRC_COUPLING
3764 IF (
his(ng)%pioVar(
idlhea)%dkind.eq.pio_double)
THEN
3773 & lbi, ubi, lbj, ubj, scale, &
3775 &
grid(ng) % rmask, &
3778 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3792 IF (
his(ng)%pioVar(
idshea)%dkind.eq.pio_double)
THEN
3801 & lbi, ubi, lbj, ubj, scale, &
3803 &
grid(ng) % rmask, &
3806 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3820 IF (
his(ng)%pioVar(
idlrad)%dkind.eq.pio_double)
THEN
3829 & lbi, ubi, lbj, ubj, scale, &
3831 &
grid(ng) % rmask, &
3834 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3852 IF (
his(ng)%pioVar(
idevap)%dkind.eq.pio_double)
THEN
3861 & lbi, ubi, lbj, ubj, scale, &
3863 &
grid(ng) % rmask, &
3866 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3880 IF (
his(ng)%pioVar(
idrain)%dkind.eq.pio_double)
THEN
3889 & lbi, ubi, lbj, ubj, scale, &
3891 &
grid(ng) % rmask, &
3894 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3910 IF (
his(ng)%pioVar(
idempf)%dkind.eq.pio_double)
THEN
3919 & lbi, ubi, lbj, ubj, scale, &
3921 &
grid(ng) % rmask, &
3924 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3940 IF (
his(ng)%pioVar(
idsrad)%dkind.eq.pio_double)
THEN
3949 & lbi, ubi, lbj, ubj, scale, &
3951 &
grid(ng) % rmask, &
3954 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
3974 IF (
his(ng)%pioVar(
idusms)%dkind.eq.pio_double)
THEN
3983 & lbi, ubi, lbj, ubj, scale, &
3985 &
grid(ng) % umask, &
3988 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
4006 IF (
his(ng)%pioVar(
idvsms)%dkind.eq.pio_double)
THEN
4015 & lbi, ubi, lbj, ubj, scale, &
4017 &
grid(ng) % vmask, &
4020 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
4034 IF (
his(ng)%pioVar(
idubms)%dkind.eq.pio_double)
THEN
4043 & lbi, ubi, lbj, ubj, scale, &
4045 &
grid(ng) % umask, &
4048 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
4062 IF (
his(ng)%pioVar(
idvbms)%dkind.eq.pio_double)
THEN
4071 & lbi, ubi, lbj, ubj, scale, &
4073 &
grid(ng) % vmask, &
4076 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
4086# if (defined BBL_MODEL || defined WAVES_OUTPUT) && defined SOLVE3D
4093 & lbi, ubi, lbj, ubj, &
4098# if defined ICE_MODEL && defined SOLVE3D
4104 CALL ice_wrt_pio (ng, model, tile, &
4105 & lbi, ubi, lbj, ubj, &
4110# if defined SEDIMENT && defined SOLVE3D
4117 & lbi, ubi, lbj, ubj, &
4122# if defined WEC_VF && defined SOLVE3D
4128 CALL wec_wrt_pio (ng, model, tile, &
4129 & lbi, ubi, lbj, ubj, &
4142 10
FORMAT (2x,
'WRT_HIS_PIO - writing history', t42, &
4145 &
'fields (Index=',i1,
',',i1,
') in record = ',i0,t92,i2.2)
4147 &
'fields (Index=',i1,
',',i1,
') in record = ',i0)
4151 &
'fields (Index=',i1,
') in record = ',i0,t92,i2.2)
4153 &
'fields (Index=',i1,
') in record = ',i0)
4156 20
FORMAT (/,
' WRT_HIS_PIO - error while writing variable: ',a, &
4157 & /,15x,
'into history NetCDF file for time record: ',i0)