84#if !defined PARALLEL_IO && defined DISTRIBUTE
90 integer,
intent(in) :: ng, model, ncid
92 character (len=*),
intent(in) :: ncname
96 logical :: Cgrid = .true.
98 integer :: LBi, UBi, LBj, UBj
99 integer :: i, j, k, ibry, ilev, itrc, status, varid
102 integer,
dimension(2) :: ibuffer
104 integer :: ifield = 0
109 real(r8),
dimension(NT(ng)) :: diff
111 real(r8),
dimension(NT(ng)) :: nudg
112 real(r8),
dimension(NT(ng),4) :: Tobc
115 real(r8),
dimension(Nstation(ng)) :: Zpos, wrk
118 character (len=*),
parameter :: MyFile = &
119 & __FILE__//
", wrt_info_nf90"
123 IF (ncid.ne.
xtr(ng)%ncid)
THEN
124 lbi=lbound(
grid(ng)%h,dim=1)
125 ubi=ubound(
grid(ng)%h,dim=1)
126 lbj=lbound(
grid(ng)%h,dim=2)
127 ubj=ubound(
grid(ng)%h,dim=2)
130 lbi=lbound(extract(ng)%h,dim=1)
131 ubi=ubound(extract(ng)%h,dim=1)
132 lbj=lbound(extract(ng)%h,dim=2)
133 ubj=ubound(extract(ng)%h,dim=2)
149 &
ntimes(ng), (/0/), (/0/), &
159 &
dt(ng), (/0/), (/0/), &
164 &
dtfast(ng), (/0/), (/0/), &
173#ifdef RBL4DVAR_FCT_SENSITIVITY
185#if defined HDF5 && defined DEFLATE
203 &
nhis(ng), (/0/), (/0/), &
214 &
nxtr(ng), (/0/), (/0/), &
230 &
nrst(ng), (/0/), (/0/), &
234#if defined AVERAGES || \
235 (defined ad_averages && defined adjoint) || \
236 (defined rp_averages && defined tl_ioms) || \
237 (defined tl_averages && defined tangent)
239 &
ntsavg(ng), (/0/), (/0/), &
244 &
navg(ng), (/0/), (/0/), &
256 &
nadj(ng), (/0/), (/0/), &
268 &
ntlm(ng), (/0/), (/0/), &
278#ifdef ADJUST_BOUNDARY
280 &
nobc(ng), (/0/), (/0/), &
285#if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
287 &
nsff(ng), (/0/), (/0/), &
309 &
ngst, (/0/), (/0/), &
314 &
nev, (/0/), (/0/), &
319 &
ncv, (/0/), (/0/), &
331 &
ntsdia(ng), (/0/), (/0/), &
336 &
ndia(ng), (/0/), (/0/), &
348 &
nsta(ng), (/0/), (/0/), &
365#if defined POWER_LAW && defined SOLVE3D
376 &
fbeta, (/0/), (/0/), &
388#if defined SOLVE3D && defined TS_DIF2
401# if defined TANGENT || defined TL_IOMS
410#if defined SOLVE3D && defined TS_DIF4
415 & diff, (/1/), (/
nt(ng)/), &
424 & diff, (/1/), (/
nt(ng)/), &
429# if defined TANGENT || defined TL_IOMS
434 & diff, (/1/), (/
nt(ng)/), &
453# if defined TANGENT || defined TL_IOMS
474# if defined TANGENT || defined TL_IOMS
482#if defined SOLVE3D && (defined MY25_MIXING || defined GLS_MIXING)
485 &
tkenu2(ng), (/0/), (/0/), &
492 &
tkenu4(ng)**2, (/0/), (/0/), &
498#if defined UV_VIS2 || defined UV_VIS4
505#if (defined TS_DIF2 || defined TS_DIF4) && defined SOLVE3D
526# if defined MY25_MIXING || defined GLS_MIXING
538# ifdef FORWARD_MIXING
549# if defined TANGENT || defined TL_IOMS
563# if defined TANGENT || defined TL_IOMS
575 &
rdrg(ng), (/0/), (/0/), &
580 &
rdrg2(ng), (/0/), (/0/), &
586 &
zob(ng), (/0/), (/0/), &
591 &
zos(ng), (/0/), (/0/), &
596#if defined SOLVE3D && defined GLS_MIXING
601 &
gls_p(ng), (/0/), (/0/), &
606 &
gls_m(ng), (/0/), (/0/), &
611 &
gls_n(ng), (/0/), (/0/), &
621 &
gls_c1(ng), (/0/), (/0/), &
626 &
gls_c2(ng), (/0/), (/0/), &
709 & nudg, (/1/), (/
nt(ng)/), &
742 tobc(itrc,ibry)=
tobc_in(itrc,ng,ibry)
746 & tobc, (/1,1/), (/
nt(ng),4/), &
752 tobc(itrc,ibry)=
tobc_out(itrc,ng,ibry)
756 & tobc, (/1,1/), (/
nt(ng),4/), &
776 &
rho0, (/0/), (/0/), &
780#if defined SOLVE3D && defined PROPAGATOR
787#if defined SOLVE3D && \
790 &
r0(ng), (/0/), (/0/), &
795 &
tcoef(ng), (/0/), (/0/), &
800 &
scoef(ng), (/0/), (/0/), &
824 &
gamma2(ng), (/0/), (/0/), &
833 &
luvsrc(ng), (/0/), (/0/), &
838 &
lwsrc(ng), (/0/), (/0/), &
860 &
lm2clm(ng), (/0/), (/0/), &
866 &
lm3clm(ng), (/0/), (/0/), &
905# ifdef ADJUST_BOUNDARY
911# ifndef I4DVAR_ANA_SENSITIVITY
917# ifdef WEAK_CONSTRAINT
930 &
lritz, (/0/), (/0/), &
934# ifdef WEAK_CONSTRAINT
943# if defined POSTERIOR_EOFS && defined WEAK_CONSTRAINT
948# if defined ARRAY_MODES || \
949 defined i4dvar_ana_sensitivity || \
950 defined rbl4dvar_ana_sensitivity || \
951 defined rbl4dvar_fct_sensitivity || \
952 defined r4dvar_ana_sensitivity
957# ifndef I4DVAR_ANA_SENSITIVITY
985 &
hgamma(1), (/0/), (/0/), &
989# ifdef WEAK_CONSTRAINT
991 &
hgamma(2), (/0/), (/0/), &
996# ifdef ADJUST_BOUNDARY
998 &
hgamma(3), (/0/), (/0/), &
1003# ifdef ADJUST_STFLUX
1005 &
hgamma(4), (/0/), (/0/), &
1012 &
vgamma(1), (/0/), (/0/), &
1016# ifdef WEAK_CONSTRAINT
1018 &
vgamma(2), (/0/), (/0/), &
1023# ifdef ADJUST_BOUNDARY
1025 &
vgamma(3), (/0/), (/0/), &
1057# ifdef ADJUST_BOUNDARY
1073# ifdef RPM_RELAXATION
1092# ifdef BALANCE_OPERATOR
1093# ifdef ZETA_ELLIPTIC
1095 &
nbico(ng), (/0/), (/0/), &
1130 & sigma_max(:,ng), (/1/), (/
nstatevar(ng)/), &
1135 & sigma_ml(:,ng), (/1/), (/
nstatevar(ng)/), &
1140 & sigma_do(:,ng), (/1/), (/
nstatevar(ng)/), &
1145 & sigma_dz(:,ng), (/1/), (/
nstatevar(ng)/), &
1151 & mld_uniform(ng), (/0/), (/0/), &
1158#if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
1159 defined opt_observations || defined sensitivity_4dvar || \
1197 & (/1/), (/
nt(ng)/), &
1202 &
kstrs(ng), (/0/), (/0/), &
1207 &
kends(ng), (/0/), (/0/), &
1213#if defined FORCING_SV || defined SO_SEMI || defined STOCHASTIC_OPT
1252 & (/1/), (/
nt(ng)/), &
1272 & (/1/), (/
nt(ng)/), &
1279# ifndef SO_SEMI_WHITE
1287 &
trnorm(ng), (/0/), (/0/), &
1323 & nudg, (/1/), (/
nt(ng)/), &
1344 & nudg, (/1/), (/
nt(ng)/), &
1350#if defined BIOLOGY && defined SOLVE3D
1351# if defined BIO_FENNEL
1352# include <fennel_wrt.h>
1353# elif defined ECOSIM
1354# include <ecosim_wrt.h>
1355# elif defined HYPOXIA_SRM
1356# include <hypoxia_srm_wrt.h>
1357# elif defined NEMURO
1358# include <nemuro_wrt.h>
1359# elif defined NPZD_FRANKS
1360# include <npzd_Franks_wrt.h>
1361# elif defined NPZD_IRON
1362# include <npzd_iron_wrt.h>
1363# elif defined NPZD_POWELL
1364# include <npzd_Powell_wrt.h>
1365# elif defined RED_TIDE
1366# include <red_tide_wrt.h>
1370#if defined FLOATS && defined FLOAT_BIOLOGY
1371# if defined FLOAT_OYSTER
1372# include <oyster_floats_wrt.h>
1377# include <sediment_wrt.h>
1396 &
xl(ng), (/0/), (/0/), &
1401 &
el(ng), (/0/), (/0/), &
1420 &
theta_s(ng), (/0/), (/0/), &
1425 &
theta_b(ng), (/0/), (/0/), &
1430 &
tcline(ng), (/0/), (/0/), &
1435 &
hc(ng), (/0/), (/0/), &
1444 & (/1/), (/0/), (/0/), &
1451 &
scalars(ng)%sc_r(:), (/1/), (/
n(ng)/), &
1456 &
scalars(ng)%sc_w(0:), (/1/), (/
n(ng)+1/), &
1463 &
scalars(ng)%Cs_r(:), (/1/), (/
n(ng)/), &
1468 &
scalars(ng)%Cs_w(0:), (/1/), (/
n(ng)+1/), &
1475 IF (
nuser.gt.0)
THEN
1486 IF (ncid.eq.
sta(ng)%ncid)
THEN
1488 &
scalars(ng)%SposX(:), (/1/), &
1493 &
scalars(ng)%SposY(:), (/1/), &
1504 grid_vars :
IF (ncid.eq.
sta(ng)%ncid)
THEN
1506 grid_vars :
IF (ncid.ne.
flt(ng)%ncid)
THEN
1508#if !(defined SED_MORPH && defined SEDIMENT)
1514 IF ((ncid.ne.
sta(ng)%ncid).and. &
1515 & (ncid.ne.
xtr(ng)%ncid))
THEN
1520 & lbi, ubi, lbj, ubj, scale, &
1522 &
grid(ng) % rmask, &
1525 & setfillval = .false.)
1526 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1539 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
1544 & lbi, ubi, lbj, ubj, scale, &
1546 & extract(ng) % rmask, &
1548 & extract(ng) % h, &
1549 & setfillval = .false., &
1550 & extractfield = -1)
1551 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1565 ELSE IF (ncid.eq.
sta(ng)%ncid)
THEN
1567 & lbi, ubi, lbj, ubj, &
1568 & scale,
grid(ng)%h, &
1583 IF ((ncid.ne.
sta(ng)%ncid).and. &
1584 & (ncid.ne.
xtr(ng)%ncid))
THEN
1590 & lbi, ubi, lbj, ubj, scale, &
1592 &
grid(ng) % rmask, &
1595 & setfillval = .false.)
1596 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1609 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
1615 & lbi, ubi, lbj, ubj, scale, &
1617 & extract(ng) % rmask, &
1619 & extract(ng) % f, &
1620 & setfillval = .false., &
1621 & extractfield = -1)
1622 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1641 IF ((ncid.ne.
sta(ng)%ncid).and. &
1642 & (ncid.ne.
xtr(ng)%ncid))
THEN
1648 & lbi, ubi, lbj, ubj, scale, &
1650 &
grid(ng) % rmask, &
1653 & setfillval = .false.)
1654 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1667 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
1673 & lbi, ubi, lbj, ubj, scale, &
1675 & extract(ng) % rmask, &
1677 & extract(ng) % pm, &
1678 & setfillval = .false., &
1679 & extractfield = -1)
1680 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1697 IF ((ncid.ne.
sta(ng)%ncid).and. &
1698 & (ncid.ne.
xtr(ng)%ncid))
THEN
1704 & lbi, ubi, lbj, ubj, scale, &
1706 &
grid(ng) % rmask, &
1709 & setfillval = .false.)
1710 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1723 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
1729 & lbi, ubi, lbj, ubj, scale, &
1731 & extract(ng) % rmask, &
1733 & extract(ng) % pn, &
1734 & setfillval = .false., &
1735 & extractfield = -1)
1736 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1757 IF ((ncid.ne.
sta(ng)%ncid).and. &
1758 & (ncid.ne.
xtr(ng)%ncid))
THEN
1763 & lbi, ubi, lbj, ubj, scale, &
1765 &
grid(ng) % rmask, &
1767 &
grid(ng) % lonr, &
1768 & setfillval = .false.)
1770 & __line__, myfile))
THEN
1783 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
1788 & lbi, ubi, lbj, ubj, scale, &
1790 & extract(ng) % rmask, &
1792 & extract(ng) % lonr, &
1793 & setfillval = .false., &
1794 & extractfield = -1)
1796 & __line__, myfile))
THEN
1810 ELSE IF (ncid.eq.
sta(ng)%ncid)
THEN
1812 & lbi, ubi, lbj, ubj, &
1813 & scale,
grid(ng)%lonr, &
1820 & __line__, myfile))
RETURN
1827 IF ((ncid.ne.
sta(ng)%ncid).and. &
1828 & (ncid.ne.
xtr(ng)%ncid))
THEN
1833 & lbi, ubi, lbj, ubj, scale, &
1835 &
grid(ng) % rmask, &
1837 &
grid(ng) % latr, &
1838 & setfillval = .false.)
1840 & __line__, myfile))
THEN
1853 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
1858 & lbi, ubi, lbj, ubj, scale, &
1860 & extract(ng) % rmask, &
1862 & extract(ng) % latr, &
1863 & setfillval = .false., &
1864 & extractfield = -1)
1866 & __line__, myfile))
THEN
1880 ELSE IF (ncid.eq.
sta(ng)%ncid)
THEN
1882 & lbi, ubi, lbj, ubj, &
1883 & scale,
grid(ng)%latr, &
1890 & __line__, myfile))
RETURN
1899 IF ((ncid.ne.
sta(ng)%ncid).and. &
1900 & (ncid.ne.
xtr(ng)%ncid))
THEN
1905 & lbi, ubi, lbj, ubj, scale, &
1907 &
grid(ng) % rmask, &
1910 & setfillval = .false.)
1912 & __line__, myfile))
THEN
1925 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
1930 & lbi, ubi, lbj, ubj, scale, &
1932 & extract(ng) % rmask, &
1934 & extract(ng) % xr, &
1935 & setfillval = .false., &
1936 & extractfield = -1)
1938 & __line__, myfile))
THEN
1952 ELSE IF (ncid.eq.
sta(ng)%ncid)
THEN
1954 & lbi, ubi, lbj, ubj, &
1955 & scale,
grid(ng)%xr, &
1962 & __line__, myfile))
RETURN
1969 IF ((ncid.ne.
sta(ng)%ncid).and. &
1970 & (ncid.ne.
xtr(ng)%ncid))
THEN
1975 & lbi, ubi, lbj, ubj, scale, &
1977 &
grid(ng) % rmask, &
1980 & setfillval = .false.)
1982 & __line__, myfile))
THEN
1995 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2000 & lbi, ubi, lbj, ubj, scale, &
2002 & extract(ng) % rmask, &
2004 & extract(ng) % yr, &
2005 & setfillval = .false., &
2006 & extractfield = -1)
2008 & __line__, myfile))
THEN
2022 ELSE IF (ncid.eq.
sta(ng)%ncid)
THEN
2024 & lbi, ubi, lbj, ubj, &
2025 & scale,
grid(ng)%yr, &
2032 & __line__, myfile))
RETURN
2042 IF ((ncid.ne.
sta(ng)%ncid).and. &
2043 & (ncid.ne.
xtr(ng)%ncid))
THEN
2049 & lbi, ubi, lbj, ubj, scale, &
2051 &
grid(ng) % umask, &
2053 &
grid(ng) % lonu, &
2054 & setfillval = .false.)
2056 & __line__, myfile))
THEN
2069 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2075 & lbi, ubi, lbj, ubj, scale, &
2077 & extract(ng) % umask, &
2079 & extract(ng) % lonu, &
2080 & setfillval = .false., &
2081 & extractfield = -1)
2083 & __line__, myfile))
THEN
2100 IF ((ncid.ne.
sta(ng)%ncid).and. &
2101 & (ncid.ne.
xtr(ng)%ncid))
THEN
2107 & lbi, ubi, lbj, ubj, scale, &
2109 &
grid(ng) % umask, &
2111 &
grid(ng) % latu, &
2112 & setfillval = .false.)
2114 & __line__, myfile))
THEN
2127 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2133 & lbi, ubi, lbj, ubj, scale, &
2135 & extract(ng) % umask, &
2137 & extract(ng) % latu, &
2138 & setfillval = .false., &
2139 & extractfield = -1)
2141 & __line__, myfile))
THEN
2160 IF ((ncid.ne.
sta(ng)%ncid).and. &
2161 & (ncid.ne.
xtr(ng)%ncid))
THEN
2167 & lbi, ubi, lbj, ubj, scale, &
2169 &
grid(ng) % umask, &
2172 & setfillval = .false.)
2174 & __line__, myfile))
THEN
2187 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2193 & lbi, ubi, lbj, ubj, scale, &
2195 & extract(ng) % umask, &
2197 & extract(ng) % xu, &
2198 & setfillval = .false., &
2199 & extractfield = -1)
2201 & __line__, myfile))
THEN
2218 IF ((ncid.ne.
sta(ng)%ncid).and. &
2219 & (ncid.ne.
xtr(ng)%ncid))
THEN
2225 & lbi, ubi, lbj, ubj, scale, &
2227 &
grid(ng) % umask, &
2230 & setfillval = .false.)
2232 & __line__, myfile))
THEN
2245 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2251 & lbi, ubi, lbj, ubj, scale, &
2253 & extract(ng) % umask, &
2255 & extract(ng) % yu, &
2256 & setfillval = .false., &
2257 & extractfield = -1)
2259 & __line__, myfile))
THEN
2280 IF ((ncid.ne.
sta(ng)%ncid).and. &
2281 & (ncid.ne.
xtr(ng)%ncid))
THEN
2287 & lbi, ubi, lbj, ubj, scale, &
2289 &
grid(ng) % vmask, &
2291 &
grid(ng) % lonv, &
2292 & setfillval = .false.)
2294 & __line__, myfile))
THEN
2307 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2313 & lbi, ubi, lbj, ubj, scale, &
2315 & extract(ng) % vmask, &
2317 & extract(ng) % lonv, &
2318 & setfillval = .false., &
2319 & extractfield = -1)
2321 & __line__, myfile))
THEN
2338 IF ((ncid.ne.
sta(ng)%ncid).and. &
2339 & (ncid.ne.
xtr(ng)%ncid))
THEN
2345 & lbi, ubi, lbj, ubj, scale, &
2347 &
grid(ng) % vmask, &
2349 &
grid(ng) % latv, &
2350 & setfillval = .false.)
2352 & __line__, myfile))
THEN
2365 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2371 & lbi, ubi, lbj, ubj, scale, &
2373 & extract(ng) % vmask, &
2375 & extract(ng) % latv, &
2376 & setfillval = .false., &
2377 & extractfield = -1)
2379 & __line__, myfile))
THEN
2398 IF ((ncid.ne.
sta(ng)%ncid).and. &
2399 & (ncid.ne.
xtr(ng)%ncid))
THEN
2405 & lbi, ubi, lbj, ubj, scale, &
2407 &
grid(ng) % vmask, &
2410 & setfillval = .false.)
2412 & __line__, myfile))
THEN
2425 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2431 & lbi, ubi, lbj, ubj, scale, &
2433 & extract(ng) % vmask, &
2435 & extract(ng) % xv, &
2436 & setfillval = .false., &
2437 & extractfield = -1)
2439 & __line__, myfile))
THEN
2456 IF ((ncid.ne.
sta(ng)%ncid).and. &
2457 & (ncid.ne.
xtr(ng)%ncid))
THEN
2463 & lbi, ubi, lbj, ubj, scale, &
2465 &
grid(ng) % vmask, &
2468 & setfillval = .false.)
2470 & __line__, myfile))
THEN
2483 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2489 & lbi, ubi, lbj, ubj, scale, &
2491 & extract(ng) % vmask, &
2493 & extract(ng) % yv, &
2494 & setfillval = .false., &
2495 & extractfield = -1)
2497 & __line__, myfile))
THEN
2518 IF ((ncid.ne.
sta(ng)%ncid).and. &
2519 & (ncid.ne.
xtr(ng)%ncid))
THEN
2525 & lbi, ubi, lbj, ubj, scale, &
2527 &
grid(ng) % pmask, &
2529 &
grid(ng) % lonp, &
2530 & setfillval = .false.)
2532 & __line__, myfile))
THEN
2545 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2551 & lbi, ubi, lbj, ubj, scale, &
2553 & extract(ng) % pmask, &
2555 & extract(ng) % lonp, &
2556 & setfillval = .false., &
2557 & extractfield = -1)
2559 & __line__, myfile))
THEN
2576 IF ((ncid.ne.
sta(ng)%ncid).and. &
2577 & (ncid.ne.
xtr(ng)%ncid))
THEN
2583 & lbi, ubi, lbj, ubj, scale, &
2585 &
grid(ng) % pmask, &
2587 &
grid(ng) % latp, &
2588 & setfillval = .false.)
2590 & __line__, myfile))
THEN
2603 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2609 & lbi, ubi, lbj, ubj, scale, &
2611 & extract(ng) % pmask, &
2613 & extract(ng) % latp, &
2614 & setfillval = .false., &
2615 & extractfield = -1)
2617 & __line__, myfile))
THEN
2636 IF ((ncid.ne.
sta(ng)%ncid).and. &
2637 & (ncid.ne.
xtr(ng)%ncid))
THEN
2643 & lbi, ubi, lbj, ubj, scale, &
2645 &
grid(ng) % pmask, &
2648 & setfillval = .false.)
2650 & __line__, myfile))
THEN
2663 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2669 & lbi, ubi, lbj, ubj, scale, &
2671 & extract(ng) % pmask, &
2673 & extract(ng) % xp, &
2674 & setfillval = .false., &
2675 & extractfield = -1)
2677 & __line__, myfile))
THEN
2694 IF ((ncid.ne.
sta(ng)%ncid).and. &
2695 & (ncid.ne.
xtr(ng)%ncid))
THEN
2701 & lbi, ubi, lbj, ubj, scale, &
2703 &
grid(ng) % pmask, &
2706 & setfillval = .false.)
2708 & __line__, myfile))
THEN
2721 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2727 & lbi, ubi, lbj, ubj, scale, &
2729 & extract(ng) % pmask, &
2731 & extract(ng) % yp, &
2732 & setfillval = .false., &
2733 & extractfield = -1)
2735 & __line__, myfile))
THEN
2758 IF ((ncid.ne.
sta(ng)%ncid).and. &
2759 & (ncid.ne.
xtr(ng)%ncid))
THEN
2764 & lbi, ubi, lbj, ubj, scale, &
2766 &
grid(ng) % rmask, &
2768 &
grid(ng) % angler, &
2769 & setfillval = .false.)
2770 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2783 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2788 & lbi, ubi, lbj, ubj, scale, &
2790 & extract(ng) % rmask, &
2792 & extract(ng) % angler, &
2793 & setfillval = .false., &
2794 & extractfield = -1)
2795 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2809 ELSE IF (ncid.eq.
sta(ng)%ncid)
THEN
2811 & lbi, ubi, lbj, ubj, &
2812 & scale,
grid(ng)%angler, &
2829 IF ((ncid.ne.
sta(ng)%ncid).and. &
2830 & (ncid.ne.
xtr(ng)%ncid))
THEN
2836 & lbi, ubi, lbj, ubj, scale, &
2837 &
grid(ng) % rmask, &
2838 &
grid(ng) % rmask, &
2839 & setfillval = .false.)
2840 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2853 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2859 & lbi, ubi, lbj, ubj, scale, &
2860 & extract(ng) % rmask, &
2861 & extract(ng) % rmask, &
2862 & setfillval = .false., &
2863 & extractfield = -1)
2864 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2881 IF ((ncid.ne.
sta(ng)%ncid).and. &
2882 & (ncid.ne.
xtr(ng)%ncid))
THEN
2888 & lbi, ubi, lbj, ubj, scale, &
2889 &
grid(ng) % umask, &
2890 &
grid(ng) % umask, &
2891 & setfillval = .false.)
2892 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2905 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2911 & lbi, ubi, lbj, ubj, scale, &
2912 & extract(ng) % umask, &
2913 & extract(ng) % umask, &
2914 & setfillval = .false., &
2915 & extractfield = -1)
2916 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2933 IF ((ncid.ne.
sta(ng)%ncid).and. &
2934 & (ncid.ne.
xtr(ng)%ncid))
THEN
2940 & lbi, ubi, lbj, ubj, scale, &
2941 &
grid(ng) % vmask, &
2942 &
grid(ng) % vmask, &
2943 & setfillval = .false.)
2944 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2957 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
2963 & lbi, ubi, lbj, ubj, scale, &
2964 & extract(ng) % vmask, &
2965 & extract(ng) % vmask, &
2966 & setfillval = .false., &
2967 & extractfield = -1)
2968 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2985 IF ((ncid.ne.
sta(ng)%ncid).and. &
2986 & (ncid.ne.
xtr(ng)%ncid))
THEN
2992 & lbi, ubi, lbj, ubj, scale, &
2993 &
grid(ng) % pmask, &
2994 &
grid(ng) % pmask, &
2995 & setfillval = .false.)
2996 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3009 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
3015 & lbi, ubi, lbj, ubj, scale, &
3016 & extract(ng) % pmask, &
3017 & extract(ng) % pmask, &
3018 & setfillval = .false., &
3019 & extractfield = -1)
3020 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3037#if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
3038 defined opt_observations || defined sensitivity_4dvar || \
3044 IF ((ncid.ne.
sta(ng)%ncid).and. &
3045 & (ncid.ne.
xtr(ng)%ncid))
THEN
3051 & lbi, ubi, lbj, ubj, scale, &
3053 &
grid(ng) % rmask, &
3055 &
grid(ng) % Rscope, &
3056 & setfillval = .false.)
3057 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3071 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
3077 & lbi, ubi, lbj, ubj, scale, &
3079 & extract(ng) % rmask, &
3081 & extract(ng) % Rscope, &
3082 & setfillval = .false., &
3083 & extractfield = -1)
3084 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3101 IF ((ncid.ne.
sta(ng)%ncid).and. &
3102 & (ncid.ne.
xtr(ng)%ncid))
THEN
3108 & lbi, ubi, lbj, ubj, scale, &
3110 &
grid(ng) % umask, &
3112 &
grid(ng) % Uscope, &
3113 & setfillval = .false.)
3114 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3128 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
3134 & lbi, ubi, lbj, ubj, scale, &
3136 & extract(ng) % umask, &
3138 & extract(ng) % Uscope, &
3139 & setfillval = .false., &
3140 & extractfield = -1)
3141 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3158 IF ((ncid.ne.
sta(ng)%ncid).and. &
3159 & (ncid.ne.
xtr(ng)%ncid))
THEN
3165 & lbi, ubi, lbj, ubj, scale, &
3167 &
grid(ng) % vmask, &
3169 &
grid(ng) % Vscope, &
3170 & setfillval = .false.)
3171 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3185 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
3191 & lbi, ubi, lbj, ubj, scale, &
3193 & extract(ng) % vmask, &
3195 & extract(ng) % Vscope, &
3196 & setfillval = .false., &
3197 & extractfield = -1)
3198 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3219 IF ((ncid.ne.
sta(ng)%ncid).and. &
3220 & (ncid.ne.
xtr(ng)%ncid))
THEN
3222# if defined UV_LOGDRAG || defined BBL_MODEL
3227 & lbi, ubi, lbj, ubj, scale, &
3229 &
grid(ng) % rmask, &
3231 &
grid(ng) % ZoBot, &
3232 & setfillval = .false.)
3233 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3246 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
3252 & lbi, ubi, lbj, ubj, scale, &
3254 & extract(ng) % rmask, &
3256 & extract(ng) % ZoBot, &
3257 & setfillval = .false., &
3258 & extractfield = -1)
3259 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3275 IF ((ncid.ne.
sta(ng)%ncid).and. &
3276 & (ncid.ne.
xtr(ng)%ncid))
THEN
3281 & lbi, ubi, lbj, ubj, scale, &
3283 &
grid(ng) % rmask, &
3285 &
grid(ng) % rdrag, &
3286 & setfillval = .false.)
3287 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3300 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
3305 & lbi, ubi, lbj, ubj, scale, &
3307 & extract(ng) % rmask, &
3309 & extract(ng) % rdrag, &
3310 & setfillval = .false., &
3311 & extractfield = -1)
3312 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3328 IF ((ncid.ne.
sta(ng)%ncid).and. &
3329 & (ncid.ne.
xtr(ng)%ncid))
THEN
3334 & lbi, ubi, lbj, ubj, scale, &
3336 &
grid(ng) % rmask, &
3338 &
grid(ng) % rdrag2, &
3339 & setfillval = .false.)
3340 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3353 ELSE IF (ncid.eq.
xtr(ng)%ncid)
THEN
3358 & lbi, ubi, lbj, ubj, scale, &
3360 & extract(ng) % rmask, &
3362 & extract(ng) % rdrag2, &
3363 & setfillval = .false., &
3364 & extractfield = -1)
3365 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
3392#if !defined PARALLEL_IO && defined DISTRIBUTE
3403 10
FORMAT (/,
' WRT_INFO_NF90 - error while writing variable: ',a,/, &
3404 & 17x,
'into file: ',a)
3405 20
FORMAT (/,
' WRT_INFO_NF90 - error while inquiring ID for', &
3406 &
' variable: ',a,/,17x,
'in file: ',a)
3407 30
FORMAT (/,
' WRT_INFO_NF90 - unable to synchronize to disk file:', &
3442 integer,
intent(in) :: ng, model
3444 character (len=*),
intent(in) :: ncname
3446 TYPE (File_desc_t),
intent(inout) :: pioFile
3450 logical :: Cgrid = .true.
3452 integer :: LBi, UBi, LBj, UBj
3453 integer :: i, j, k, ibry, ilev, itrc, status
3455 integer :: FileH, MY_FOUT
3457 integer :: ifield = 0
3462 real(r8),
dimension(NT(ng)) :: diff
3464 real(r8),
dimension(NT(ng)) :: nudg
3465 real(r8),
dimension(NT(ng),4) :: Tobc
3468 real(r8),
dimension(Nstation(ng)) :: Zpos, wrk
3471 character (len=*),
parameter :: MyFile = &
3472 & __FILE__//
", wrt_info_pio"
3474 TYPE (IO_desc_t),
pointer :: ioDesc
3475 TYPE (My_VarDesc) :: pioVar
3479 lbi=lbound(
grid(ng)%h,dim=1)
3480 ubi=ubound(
grid(ng)%h,dim=1)
3481 lbj=lbound(
grid(ng)%h,dim=2)
3482 ubj=ubound(
grid(ng)%h,dim=2)
3490 fileh=abs(piofile%fh)
3495 &
ntimes(ng), (/0/), (/0/), &
3496 & piofile = piofile)
3500 &
ndtfast(ng), (/0/), (/0/), &
3501 & piofile = piofile)
3505 &
dt(ng), (/0/), (/0/), &
3506 & piofile = piofile)
3510 &
dtfast(ng), (/0/), (/0/), &
3511 & piofile = piofile)
3515 &
dstart, (/0/), (/0/), &
3516 & piofile = piofile)
3519# ifdef RBL4DVAR_FCT_SENSITIVITY
3522 & piofile = piofile)
3527 & piofile = piofile)
3531# if defined HDF5 && defined DEFLATE
3534 & piofile = piofile)
3539 & piofile = piofile)
3544 & piofile = piofile)
3549 &
nhis(ng), (/0/), (/0/), &
3550 & piofile = piofile)
3554 &
ndefhis(ng), (/0/), (/0/), &
3555 & piofile = piofile)
3559 &
nrst(ng), (/0/), (/0/), &
3560 & piofile = piofile)
3563# if defined AVERAGES || \
3564 (defined ad_averages && defined adjoint) || \
3565 (defined rp_averages && defined tl_ioms) || \
3566 (defined tl_averages && defined tangent)
3568 &
ntsavg(ng), (/0/), (/0/), &
3569 & piofile = piofile)
3573 &
navg(ng), (/0/), (/0/), &
3574 & piofile = piofile)
3578 &
ndefavg(ng), (/0/), (/0/), &
3579 & piofile = piofile)
3585 &
nadj(ng), (/0/), (/0/), &
3586 & piofile = piofile)
3590 &
ndefadj(ng), (/0/), (/0/), &
3591 & piofile = piofile)
3597 &
ntlm(ng), (/0/), (/0/), &
3598 & piofile = piofile)
3602 &
ndeftlm(ng), (/0/), (/0/), &
3603 & piofile = piofile)
3607# ifdef ADJUST_BOUNDARY
3609 &
nobc(ng), (/0/), (/0/), &
3610 & piofile = piofile)
3614# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
3616 &
nsff(ng), (/0/), (/0/), &
3617 & piofile = piofile)
3624 & piofile = piofile)
3629 & piofile = piofile)
3634 & piofile = piofile)
3638 &
ngst, (/0/), (/0/), &
3639 & piofile = piofile)
3643 &
nev, (/0/), (/0/), &
3644 & piofile = piofile)
3648 &
ncv, (/0/), (/0/), &
3649 & piofile = piofile)
3654 & piofile = piofile)
3660 &
ntsdia(ng), (/0/), (/0/), &
3661 & piofile = piofile)
3665 &
ndia(ng), (/0/), (/0/), &
3666 & piofile = piofile)
3670 &
ndefdia(ng), (/0/), (/0/), &
3671 & piofile = piofile)
3677 &
nsta(ng), (/0/), (/0/), &
3678 & piofile = piofile)
3684 &
nouter, (/0/), (/0/), &
3685 & piofile = piofile)
3689 &
ninner, (/0/), (/0/), &
3690 & piofile = piofile)
3694# if defined POWER_LAW && defined SOLVE3D
3700 &
falpha, (/0/), (/0/), &
3701 & piofile = piofile)
3705 &
fbeta, (/0/), (/0/), &
3706 & piofile = piofile)
3710 &
fgamma, (/0/), (/0/), &
3711 & piofile = piofile)
3717# if defined SOLVE3D && defined TS_DIF2
3720 & piofile = piofile)
3726 & piofile = piofile)
3730# if defined TANGENT || defined TL_IOMS
3733 & piofile = piofile)
3739# if defined SOLVE3D && defined TS_DIF4
3744 & diff, (/1/), (/
nt(ng)/), &
3745 & piofile = piofile)
3753 & diff, (/1/), (/
nt(ng)/), &
3754 & piofile = piofile)
3758# if defined TANGENT || defined TL_IOMS
3763 & diff, (/1/), (/
nt(ng)/), &
3764 & piofile = piofile)
3772 & piofile = piofile)
3778 & piofile = piofile)
3782# if defined TANGENT || defined TL_IOMS
3785 & piofile = piofile)
3793 & piofile = piofile)
3799 & piofile = piofile)
3803# if defined TANGENT || defined TL_IOMS
3806 & piofile = piofile)
3811# if defined SOLVE3D && (defined MY25_MIXING || defined GLS_MIXING)
3814 &
tkenu2(ng), (/0/), (/0/), &
3815 & piofile = piofile)
3821 &
tkenu4(ng)**2, (/0/), (/0/), &
3822 & piofile = piofile)
3827# if defined UV_VIS2 || defined UV_VIS4
3830 & piofile = piofile)
3834# if (defined TS_DIF2 || defined TS_DIF4) && defined SOLVE3D
3837 & piofile = piofile)
3847 & piofile = piofile)
3851 &
akv_bak(ng), (/0/), (/0/), &
3852 & piofile = piofile)
3855# if defined MY25_MIXING || defined GLS_MIXING
3857 &
akk_bak(ng), (/0/), (/0/), &
3858 & piofile = piofile)
3862 &
akp_bak(ng), (/0/), (/0/), &
3863 & piofile = piofile)
3867# ifdef FORWARD_MIXING
3874 & piofile = piofile)
3878# if defined TANGENT || defined TL_IOMS
3881 & piofile = piofile)
3888 & piofile = piofile)
3892# if defined TANGENT || defined TL_IOMS
3895 & piofile = piofile)
3904 &
rdrg(ng), (/0/), (/0/), &
3905 & piofile = piofile)
3909 &
rdrg2(ng), (/0/), (/0/), &
3910 & piofile = piofile)
3915 &
zob(ng), (/0/), (/0/), &
3916 & piofile = piofile)
3920 &
zos(ng), (/0/), (/0/), &
3921 & piofile = piofile)
3925# if defined SOLVE3D && defined GLS_MIXING
3930 &
gls_p(ng), (/0/), (/0/), &
3931 & piofile = piofile)
3935 &
gls_m(ng), (/0/), (/0/), &
3936 & piofile = piofile)
3940 &
gls_n(ng), (/0/), (/0/), &
3941 & piofile = piofile)
3946 & piofile = piofile)
3950 &
gls_c1(ng), (/0/), (/0/), &
3951 & piofile = piofile)
3955 &
gls_c2(ng), (/0/), (/0/), &
3956 & piofile = piofile)
3960 &
gls_c3m(ng), (/0/), (/0/), &
3961 & piofile = piofile)
3965 &
gls_c3p(ng), (/0/), (/0/), &
3966 & piofile = piofile)
3971 & piofile = piofile)
3976 & piofile = piofile)
3981 & piofile = piofile)
3986 & piofile = piofile)
3991 & piofile = piofile)
3996 & piofile = piofile)
4001 & piofile = piofile)
4006 & piofile = piofile)
4012 & piofile = piofile)
4020 & piofile = piofile)
4025 & piofile = piofile)
4031 & piofile = piofile)
4038 & nudg, (/1/), (/
nt(ng)/), &
4039 & piofile = piofile)
4050 & piofile = piofile)
4055 & piofile = piofile)
4060 & piofile = piofile)
4065 & piofile = piofile)
4071 tobc(itrc,ibry)=
tobc_in(itrc,ng,ibry)
4075 & tobc, (/1,1/), (/
nt(ng),4/), &
4076 & piofile = piofile)
4081 tobc(itrc,ibry)=
tobc_out(itrc,ng,ibry)
4085 & tobc, (/1,1/), (/
nt(ng),4/), &
4086 & piofile = piofile)
4091 & piofile = piofile)
4096 & piofile = piofile)
4105 &
rho0, (/0/), (/0/), &
4106 & piofile = piofile)
4109# if defined SOLVE3D && defined PROPAGATOR
4112 & piofile = piofile)
4116# if defined SOLVE3D && \
4119 &
r0(ng), (/0/), (/0/), &
4120 & piofile = piofile)
4124 &
tcoef(ng), (/0/), (/0/), &
4125 & piofile = piofile)
4129 &
scoef(ng), (/0/), (/0/), &
4130 & piofile = piofile)
4139 &
levsfrc(ng), (/0/), (/0/), &
4140 & piofile = piofile)
4144 &
levbfrc(ng), (/0/), (/0/), &
4145 & piofile = piofile)
4153 &
gamma2(ng), (/0/), (/0/), &
4154 & piofile = piofile)
4162 &
luvsrc(ng), (/0/), (/0/), &
4163 & piofile = piofile)
4167 &
lwsrc(ng), (/0/), (/0/), &
4168 & piofile = piofile)
4177 & piofile = piofile)
4184 &
lsshclm(ng), (/0/), (/0/), &
4185 & piofile = piofile)
4189 &
lm2clm(ng), (/0/), (/0/), &
4190 & piofile = piofile)
4195 &
lm3clm(ng), (/0/), (/0/), &
4196 & piofile = piofile)
4201 & piofile = piofile)
4209 & piofile = piofile)
4215 & piofile = piofile)
4220 & piofile = piofile)
4228# ifdef ADJUST_STFLUX
4231 & piofile = piofile)
4234# ifdef ADJUST_BOUNDARY
4238 & piofile = piofile)
4241# ifndef I4DVAR_ANA_SENSITIVITY
4244 & piofile = piofile)
4247# ifdef WEAK_CONSTRAINT
4250 & piofile = piofile)
4256 & piofile = piofile)
4260 &
lritz, (/0/), (/0/), &
4261 & piofile = piofile)
4264# ifdef WEAK_CONSTRAINT
4268 & piofile = piofile)
4273# if defined POSTERIOR_EOFS && defined WEAK_CONSTRAINT
4275 &
nposti, (/0/), (/0/), &
4276 & piofile = piofile)
4278# if defined ARRAY_MODES || \
4279 defined i4dvar_ana_sensitivity || \
4280 defined rbl4dvar_ana_sensitivity || \
4281 defined rbl4dvar_fct_sensitivity || \
4282 defined r4dvar_ana_sensitivity
4285 & piofile = piofile)
4287# ifndef I4DVAR_ANA_SENSITIVITY
4290 & piofile = piofile)
4295 & piofile = piofile)
4300 &
nmethod(ng), (/0/), (/0/), &
4301 & piofile = piofile)
4305 &
rscheme(ng), (/0/), (/0/), &
4306 & piofile = piofile)
4311 & piofile = piofile)
4315 &
hgamma(1), (/0/), (/0/), &
4316 & piofile = piofile)
4319# ifdef WEAK_CONSTRAINT
4321 &
hgamma(2), (/0/), (/0/), &
4322 & piofile = piofile)
4326# ifdef ADJUST_BOUNDARY
4328 &
hgamma(3), (/0/), (/0/), &
4329 & piofile = piofile)
4333# ifdef ADJUST_STFLUX
4335 &
hgamma(4), (/0/), (/0/), &
4336 & piofile = piofile)
4342 &
vgamma(1), (/0/), (/0/), &
4343 & piofile = piofile)
4346# ifdef WEAK_CONSTRAINT
4348 &
vgamma(2), (/0/), (/0/), &
4349 & piofile = piofile)
4353# ifdef ADJUST_BOUNDARY
4355 &
vgamma(3), (/0/), (/0/), &
4356 & piofile = piofile)
4364 & piofile = piofile)
4371 & piofile = piofile)
4379 & piofile = piofile)
4386 & piofile = piofile)
4391# ifdef ADJUST_BOUNDARY
4395 & piofile = piofile)
4402 & piofile = piofile)
4407# ifdef RPM_RELAXATION
4410 & piofile = piofile)
4416 & piofile = piofile)
4421 & piofile = piofile)
4426# ifdef BALANCE_OPERATOR
4427# ifdef ZETA_ELLIPTIC
4429 &
nbico(ng), (/0/), (/0/), &
4430 & piofile = piofile)
4435 & piofile = piofile)
4440 & piofile = piofile)
4445 & piofile = piofile)
4450 & piofile = piofile)
4455 & piofile = piofile)
4464 & sigma_max(:,ng), &
4466 & piofile = piofile)
4472 & piofile = piofile)
4478 & piofile = piofile)
4484 & piofile = piofile)
4489 & mld_uniform(ng), (/0/), (/0/), &
4490 & piofile = piofile)
4496# if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
4497 defined opt_observations || defined sensitivity_4dvar || \
4505 & piofile = piofile)
4511 & piofile = piofile)
4517 & piofile = piofile)
4524 & piofile = piofile)
4530 & piofile = piofile)
4535 & (/1/), (/
nt(ng)/), &
4536 & piofile = piofile)
4540 &
kstrs(ng), (/0/), (/0/), &
4541 & piofile = piofile)
4545 &
kends(ng), (/0/), (/0/), &
4546 & piofile = piofile)
4551# if defined FORCING_SV || defined SO_SEMI || defined STOCHASTIC_OPT
4558 & piofile = piofile)
4565 & piofile = piofile)
4571 & piofile = piofile)
4579 & piofile = piofile)
4585 & piofile = piofile)
4590 & (/1/), (/
nt(ng)/), &
4591 & piofile = piofile)
4598 & piofile = piofile)
4604 & piofile = piofile)
4610 & (/1/), (/
nt(ng)/), &
4611 & piofile = piofile)
4617# ifndef SO_SEMI_WHITE
4620 & piofile = piofile)
4625 &
trnorm(ng), (/0/), (/0/), &
4626 & piofile = piofile)
4631 & piofile = piofile)
4637 & piofile = piofile)
4642 & piofile = piofile)
4649 & piofile = piofile)
4654 & piofile = piofile)
4661 & nudg, (/1/), (/
nt(ng)/), &
4662 & piofile = piofile)
4668 & piofile = piofile)
4674 & piofile = piofile)
4682 & nudg, (/1/), (/
nt(ng)/), &
4683 & piofile = piofile)
4688# if defined BIOLOGY && defined SOLVE3D
4689# if defined BIO_FENNEL
4690# include <fennel_wrt_pio.h>
4691# elif defined ECOSIM
4692# include <ecosim_wrt_pio.h>
4693# elif defined HYPOXIA_SRM
4694# include <hypoxia_srm_wrt_pio.h>
4695# elif defined NEMURO
4696# include <nemuro_wrt_pio.h>
4697# elif defined NPZD_FRANKS
4698# include <npzd_Franks_wrt_pio.h>
4699# elif defined NPZD_IRON
4700# include <npzd_iron_wrt_pio.h>
4701# elif defined NPZD_POWELL
4702# include <npzd_Powell_wrt_pio.h>
4703# elif defined RED_TIDE
4704# include <red_tide_wrt_pio.h>
4708# if defined FLOATS && defined FLOAT_BIOLOGY
4709# if defined FLOAT_OYSTER
4710# include <oyster_floats_wrt_pio.h>
4715# include <sediment_wrt_pio.h>
4728 & piofile = piofile)
4734 &
xl(ng), (/0/), (/0/), &
4735 & piofile = piofile)
4739 &
el(ng), (/0/), (/0/), &
4740 & piofile = piofile)
4749 & piofile = piofile)
4754 & piofile = piofile)
4758 &
theta_s(ng), (/0/), (/0/), &
4759 & piofile = piofile)
4763 &
theta_b(ng), (/0/), (/0/), &
4764 & piofile = piofile)
4768 &
tcline(ng), (/0/), (/0/), &
4769 & piofile = piofile)
4773 &
hc(ng), (/0/), (/0/), &
4774 & piofile = piofile)
4783 & ival, (/0/), (/0/), &
4784 & piofile = piofile)
4790 &
scalars(ng)%sc_r(:), (/1/), (/
n(ng)/), &
4791 & piofile = piofile)
4796 & (/1/), (/
n(ng)+1/), &
4797 & piofile = piofile)
4803 &
scalars(ng)%Cs_r(:), (/1/), (/
n(ng)/), &
4804 & piofile = piofile)
4809 & (/1/), (/
n(ng)+1/), &
4810 & piofile = piofile)
4816 IF (
nuser.gt.0)
THEN
4819 & piofile = piofile)
4827 IF (fileh.eq.abs(
sta(ng)%pioFile%fh))
THEN
4829 &
scalars(ng)%SposX(:), (/1/), &
4830 & (/
nstation(ng)/), piofile = piofile)
4834 &
scalars(ng)%SposY(:), (/1/), &
4835 & (/
nstation(ng)/), piofile = piofile)
4844# ifdef NO_WRITE_GRID
4845 grid_vars :
IF (fileh.eq.abs(
sta(ng)%pioFile%fh))
THEN
4847 grid_vars :
IF (fileh.ne.abs(
flt(ng)%pioFile%fh))
THEN
4849# if !(defined SED_MORPH && defined SEDIMENT)
4855 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
4861 piovar%dkind=pio_double
4864 piovar%dkind=pio_real
4868 & piovar, 0, iodesc, &
4869 & lbi, ubi, lbj, ubj, scale, &
4871 &
grid(ng) % rmask, &
4874 & setfillval = .false.)
4875 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
4890 & lbi, ubi, lbj, ubj, &
4891 & scale,
grid(ng)%h, &
4897 & piofile = piofile)
4907 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
4914 piovar%dkind=pio_double
4917 piovar%dkind=pio_real
4921 & piovar, 0, iodesc, &
4922 & lbi, ubi, lbj, ubj, scale, &
4924 &
grid(ng) % rmask, &
4927 & setfillval = .false.)
4928 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
4946 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
4953 piovar%dkind=pio_double
4956 piovar%dkind=pio_real
4960 & piovar, 0, iodesc, &
4961 & lbi, ubi, lbj, ubj, scale, &
4963 &
grid(ng) % rmask, &
4966 & setfillval = .false.)
4967 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
4983 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
4990 piovar%dkind=pio_double
4993 piovar%dkind=pio_real
4997 & piovar, 0, iodesc, &
4998 & lbi, ubi, lbj, ubj, scale, &
5000 &
grid(ng) % rmask, &
5003 & setfillval = .false.)
5004 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
5024 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5030 piovar%dkind=pio_double
5033 piovar%dkind=pio_real
5037 & piovar, 0, iodesc, &
5038 & lbi, ubi, lbj, ubj, scale, &
5040 &
grid(ng) % rmask, &
5042 &
grid(ng) % lonr, &
5043 & setfillval = .false.)
5045 & __line__, myfile))
THEN
5060 & lbi, ubi, lbj, ubj, &
5061 & scale,
grid(ng)%lonr, &
5067 & piofile = piofile)
5069 & __line__, myfile))
RETURN
5076 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5082 piovar%dkind=pio_double
5085 piovar%dkind=pio_real
5089 & piovar, 0, iodesc, &
5090 & lbi, ubi, lbj, ubj, scale, &
5092 &
grid(ng) % rmask, &
5094 &
grid(ng) % latr, &
5095 & setfillval = .false.)
5097 & __line__, myfile))
THEN
5112 & lbi, ubi, lbj, ubj, &
5113 & scale,
grid(ng)%latr, &
5119 & piofile = piofile)
5121 & __line__, myfile))
RETURN
5130 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5136 piovar%dkind=pio_double
5139 piovar%dkind=pio_real
5143 & piovar, 0, iodesc, &
5144 & lbi, ubi, lbj, ubj, scale, &
5146 &
grid(ng) % rmask, &
5149 & setfillval = .false.)
5151 & __line__, myfile))
THEN
5166 & lbi, ubi, lbj, ubj, &
5167 & scale,
grid(ng)%xr, &
5173 & piofile = piofile)
5175 & __line__, myfile))
RETURN
5182 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5188 piovar%dkind=pio_double
5191 piovar%dkind=pio_real
5195 & piovar, 0, iodesc, &
5196 & lbi, ubi, lbj, ubj, scale, &
5198 &
grid(ng) % rmask, &
5201 & setfillval = .false.)
5203 & __line__, myfile))
THEN
5218 & lbi, ubi, lbj, ubj, &
5219 & scale,
grid(ng)%yr, &
5225 & piofile = piofile)
5227 & __line__, myfile))
RETURN
5237 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5244 piovar%dkind=pio_double
5247 piovar%dkind=pio_real
5251 & piovar, 0, iodesc, &
5252 & lbi, ubi, lbj, ubj, scale, &
5254 &
grid(ng) % umask, &
5256 &
grid(ng) % lonu, &
5257 & setfillval = .false.)
5259 & __line__, myfile))
THEN
5275 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5282 piovar%dkind=pio_double
5285 piovar%dkind=pio_real
5289 & piovar, 0, iodesc, &
5290 & lbi, ubi, lbj, ubj, scale, &
5292 &
grid(ng) % umask, &
5294 &
grid(ng) % latu, &
5295 & setfillval = .false.)
5297 & __line__, myfile))
THEN
5315 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5322 piovar%dkind=pio_double
5325 piovar%dkind=pio_real
5329 & piovar, 0, iodesc, &
5330 & lbi, ubi, lbj, ubj, scale, &
5332 &
grid(ng) % umask, &
5335 & setfillval = .false.)
5337 & __line__, myfile))
THEN
5353 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5360 piovar%dkind=pio_double
5363 piovar%dkind=pio_real
5367 & piovar, 0, iodesc, &
5368 & lbi, ubi, lbj, ubj, scale, &
5370 &
grid(ng) % umask, &
5373 & setfillval = .false.)
5375 & __line__, myfile))
THEN
5395 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5402 piovar%dkind=pio_double
5405 piovar%dkind=pio_real
5409 & piovar, 0, iodesc, &
5410 & lbi, ubi, lbj, ubj, scale, &
5412 &
grid(ng) % vmask, &
5414 &
grid(ng) % lonv, &
5415 & setfillval = .false.)
5417 & __line__, myfile))
THEN
5433 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5440 piovar%dkind=pio_double
5443 piovar%dkind=pio_real
5447 & piovar, 0, iodesc, &
5448 & lbi, ubi, lbj, ubj, scale, &
5450 &
grid(ng) % vmask, &
5452 &
grid(ng) % latv, &
5453 & setfillval = .false.)
5455 & __line__, myfile))
THEN
5473 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5480 piovar%dkind=pio_double
5483 piovar%dkind=pio_real
5487 & piovar, 0, iodesc, &
5488 & lbi, ubi, lbj, ubj, scale, &
5490 &
grid(ng) % vmask, &
5493 & setfillval = .false.)
5495 & __line__, myfile))
THEN
5511 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5518 piovar%dkind=pio_double
5521 piovar%dkind=pio_real
5525 & piovar, 0, iodesc, &
5526 & lbi, ubi, lbj, ubj, scale, &
5528 &
grid(ng) % vmask, &
5531 & setfillval = .false.)
5533 & __line__, myfile))
THEN
5553 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5560 piovar%dkind=pio_double
5563 piovar%dkind=pio_real
5567 & piovar, 0, iodesc, &
5568 & lbi, ubi, lbj, ubj, scale, &
5570 &
grid(ng) % pmask, &
5572 &
grid(ng) % lonp, &
5573 & setfillval = .false.)
5575 & __line__, myfile))
THEN
5591 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5598 piovar%dkind=pio_double
5601 piovar%dkind=pio_real
5605 & piovar, 0, iodesc, &
5606 & lbi, ubi, lbj, ubj, scale, &
5608 &
grid(ng) % pmask, &
5610 &
grid(ng) % latp, &
5611 & setfillval = .false.)
5613 & __line__, myfile))
THEN
5631 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5638 piovar%dkind=pio_double
5641 piovar%dkind=pio_real
5645 & piovar, 0, iodesc, &
5646 & lbi, ubi, lbj, ubj, scale, &
5648 &
grid(ng) % pmask, &
5651 & setfillval = .false.)
5653 & __line__, myfile))
THEN
5668 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5675 piovar%dkind=pio_double
5678 piovar%dkind=pio_real
5682 & piovar, 0, iodesc, &
5683 & lbi, ubi, lbj, ubj, scale, &
5685 &
grid(ng) % pmask, &
5688 & setfillval = .false.)
5690 & __line__, myfile))
THEN
5712 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5718 piovar%dkind=pio_double
5721 piovar%dkind=pio_real
5725 & piovar, 0, iodesc, &
5726 & lbi, ubi, lbj, ubj, scale, &
5728 &
grid(ng) % rmask, &
5730 &
grid(ng) % angler, &
5731 & setfillval = .false.)
5732 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
5747 & lbi, ubi, lbj, ubj, &
5748 & scale,
grid(ng)%angler, &
5753 & piofile = piofile)
5765 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5772 piovar%dkind=pio_double
5775 piovar%dkind=pio_real
5779 & piovar, 0, iodesc, &
5780 & lbi, ubi, lbj, ubj, scale, &
5781 &
grid(ng) % rmask, &
5782 &
grid(ng) % rmask, &
5783 & setfillval = .false.)
5784 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
5800 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5807 piovar%dkind=pio_double
5810 piovar%dkind=pio_real
5814 & piovar, 0, iodesc, &
5815 & lbi, ubi, lbj, ubj, scale, &
5816 &
grid(ng) % umask, &
5817 &
grid(ng) % umask, &
5818 & setfillval = .false.)
5819 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
5835 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5842 piovar%dkind=pio_double
5845 piovar%dkind=pio_real
5849 & piovar, 0, iodesc, &
5850 & lbi, ubi, lbj, ubj, scale, &
5851 &
grid(ng) % vmask, &
5852 &
grid(ng) % vmask, &
5853 & setfillval = .false.)
5854 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
5870 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5877 piovar%dkind=pio_double
5880 piovar%dkind=pio_real
5884 & piovar, 0, iodesc, &
5885 & lbi, ubi, lbj, ubj, scale, &
5886 &
grid(ng) % pmask, &
5887 &
grid(ng) % pmask, &
5888 & setfillval = .false.)
5889 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
5905# if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
5906 defined opt_observations || defined sensitivity_4dvar || \
5912 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5919 piovar%dkind=pio_double
5922 piovar%dkind=pio_real
5926 & piovar, 0, iodesc, &
5927 & lbi, ubi, lbj, ubj, scale, &
5929 &
grid(ng) % rmask, &
5931 &
grid(ng) % Rscope, &
5932 & setfillval = .false.)
5933 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
5949 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5956 piovar%dkind=pio_double
5959 piovar%dkind=pio_real
5963 & piovar, 0, iodesc, &
5964 & lbi, ubi, lbj, ubj, scale, &
5966 &
grid(ng) % umask, &
5968 &
grid(ng) % Uscope, &
5969 & setfillval = .false.)
5970 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
5986 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
5993 piovar%dkind=pio_double
5996 piovar%dkind=pio_real
6000 & piovar, 0, iodesc, &
6001 & lbi, ubi, lbj, ubj, scale, &
6003 &
grid(ng) % vmask, &
6005 &
grid(ng) % Vscope, &
6006 & setfillval = .false.)
6007 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
6027 IF (fileh.ne.abs(
sta(ng)%pioFile%fh))
THEN
6029# if defined UV_LOGDRAG || defined BBL_MODEL
6034 piovar%dkind=pio_double
6037 piovar%dkind=pio_real
6041 & piovar, 0, iodesc, &
6042 & lbi, ubi, lbj, ubj, scale, &
6044 &
grid(ng) % rmask, &
6046 &
grid(ng) % ZoBot, &
6047 & setfillval = .false.)
6048 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
6066 piovar%dkind=pio_double
6069 piovar%dkind=pio_real
6073 & piovar, 0, iodesc, &
6074 & lbi, ubi, lbj, ubj, scale, &
6076 &
grid(ng) % rmask, &
6078 &
grid(ng) % rdrag, &
6079 & setfillval = .false.)
6080 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
6098 piovar%dkind=pio_double
6101 piovar%dkind=pio_real
6105 & piovar, 0, iodesc, &
6106 & lbi, ubi, lbj, ubj, scale, &
6108 &
grid(ng) % rmask, &
6110 &
grid(ng) % rdrag2, &
6111 & setfillval = .false.)
6112 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
6138 10
FORMAT (/,
' WRT_INFO_PIO - error while writing variable: ',a,/, &
6139 & 16x,
'into file: ',a)
6140 20
FORMAT (/,
' WRT_INFO_PIO - error while inquiring ID for', &
6141 &
' variable: ',a,/,16x,
'in file: ',a)
6142 30
FORMAT (/,
' WRT_INFO_PIO - unable to synchronize to disk file:', &