31# if defined ADJUST_BOUNDARY
34# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
44# if defined SEDIMENT || defined BBL_MODEL
54# ifdef ADJUST_BOUNDARY
66# if defined PIO_LIB && defined DISTRIBUTE
69# if defined ADJUST_BOUNDARY || \
70 defined adjust_wstress || defined adjust_stflux
74# if defined PIO_LIB && defined DISTRIBUTE
80# if defined PIO_LIB && defined DISTRIBUTE
88 SUBROUTINE wrt_ini (ng, tile, Tindex, OutRec)
93 integer,
intent(in) :: ng, tile, tindex
94 integer,
intent(in),
optional :: outrec
98 integer :: lbi, ubi, lbj, ubj
100 character (len=*),
parameter :: myfile = &
112 SELECT CASE (
dia(ng)%IOtype)
115 & lbi, ubi, lbj, ubj, &
118# if defined PIO_LIB && defined DISTRIBUTE
121 & lbi, ubi, lbj, ubj, &
130 10
FORMAT (
' WRT_INI - Illegal output file type, io_type = ',i0, &
131 & /,11x,
'Check KeyWord ''OUT_LIB'' in ''roms.in''.')
138 & LBi, UBi, LBj, UBj, &
146 integer,
intent(in) :: ng, tile, tindex
147 integer,
intent(in) :: lbi, ubi, lbj, ubj
149 integer,
intent(in),
optional :: outrec
153 logical :: setfillval
155 integer :: fcount, gfactor, gtype, i, itrc, status, varid
157 real(r8) :: fmin, fmax
158 real(dp) :: my_time, scale
160 character (len=15) :: tstring
161 character (len=22) :: t_code
163 character (len=*),
parameter :: myfile = &
164 & __FILE__//
", wrt_ini_nf90"
186# if defined WRITE_WATER && defined MASKING
194 IF (
PRESENT(outrec))
THEN
195 ini(ng)%Rindex=outrec
197 ini(ng)%Rindex=
ini(ng)%Rindex+1
199 fcount=
ini(ng)%Fcount
200 ini(ng)%Nrec(fcount)=
ini(ng)%Nrec(fcount)+1
209 & (/
ini(ng)%Rindex/), (/1/), &
210 & ncid =
ini(ng)%ncid, &
221 WRITE (tstring,
'(f15.4)') my_time*
sec2day
222 WRITE (
stdout,20) t_code, ng, trim(adjustl(tstring)), &
223 & trim(
ini(ng)%name),
ini(ng)%Rindex, tindex
233 &
ini(ng)%Rindex, gtype, &
234 & lbi, ubi, lbj, ubj, scale, &
236 &
grid(ng) % rmask, &
238 &
ocean(ng) % zeta(:,:,tindex), &
240 & setfillval = .false., &
242 & setfillval = setfillval, &
246 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
266 &
ini(ng)%Rindex, gtype, &
267 & lbi, ubi, lbj, ubj, scale, &
269 &
grid(ng) % umask_full, &
271 &
ocean(ng) % ubar(:,:,tindex), &
272 & setfillval = setfillval, &
275 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
295 &
ini(ng)%Rindex, gtype, &
296 & lbi, ubi, lbj, ubj, scale, &
298 &
grid(ng) % vmask_full, &
300 &
ocean(ng) % vbar(:,:,tindex), &
301 & setfillval = setfillval, &
304 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
326 &
ini(ng)%Rindex, gtype, &
327 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
329 &
grid(ng) % umask_full, &
331 &
ocean(ng) % u(:,:,:,tindex), &
332 & setfillval = setfillval, &
335 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
355 &
ini(ng)%Rindex, gtype, &
356 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
358 &
grid(ng) % vmask_full, &
360 &
ocean(ng) % v(:,:,:,tindex), &
361 & setfillval = setfillval, &
364 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
384 &
ini(ng)%Tid(itrc), &
385 &
ini(ng)%Rindex, gtype, &
386 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
388 &
grid(ng) % rmask, &
390 &
ocean(ng) % t(:,:,:,tindex,itrc), &
391 & setfillval = setfillval, &
394 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
397 & trim(
ini(ng)%name),
ini(ng)%Rindex
409# if defined BVF_MIXING || defined GLS_MIXING || \
410 defined my25_mixing || defined lmd_mixing
417 IF (
founderror(status, nf90_noerr, __line__, myfile))
RETURN
423 &
ini(ng)%Rindex, gtype, &
424 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
426 &
grid(ng) % rmask, &
429 & setfillval = .false., &
432 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
435 & trim(
ini(ng)%name),
ini(ng)%Rindex
452 IF (
founderror(status, nf90_noerr, __line__, myfile))
RETURN
458 &
ini(ng)%Rindex, gtype, &
459 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
461 &
grid(ng) % rmask, &
464 & setfillval = .false., &
467 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
470 & trim(
ini(ng)%name),
ini(ng)%Rindex
488 IF (
founderror(status, nf90_noerr, __line__, myfile))
RETURN
494 &
ini(ng)%Rindex, gtype, &
495 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
497 &
grid(ng) % rmask, &
500 & setfillval = .false., &
503 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
506 & trim(
ini(ng)%name),
ini(ng)%Rindex
528 10
FORMAT (/,
' WRT_INI_NF90 - error while writing variable: ',a, &
529 & /,16x,
'into initial NetCDF file for time record: ',i0)
530 20
FORMAT (2x,
'WRT_INI_NF90 - NLM: Writing initial state', &
531 &
' fields,',t75,a, &
532 & /,22x,
'(Grid ',i2.2,
', t = ',a,
', File: ',a, &
533 &
', Rec=',i4.4,
', Index=',i1,
')')
534 30
FORMAT (19x,
'- ',a,/,22x,
'(Min = ',1p,e15.8, &
535 &
' Max = ',1p,e15.8,
')')
540# if defined PIO_LIB && defined DISTRIBUTE
544 & LBi, UBi, LBj, UBj, &
552 integer,
intent(in) :: ng, tile, tindex
553 integer,
intent(in) :: lbi, ubi, lbj, ubj
555 integer,
intent(in),
optional :: outrec
559 logical :: setfillval
561 integer :: fcount, i, itrc, status
563 real(r8) :: fmin, fmax
564 real(dp) :: my_time, scale
566 character (len=15) :: tstring
567 character (len=22) :: t_code
569 character (len=*),
parameter :: myfile = &
570 & __FILE__//
", wrt_ini_pio"
572 TYPE (io_desc_t),
pointer :: iodesc
593 IF (
PRESENT(outrec))
THEN
594 ini(ng)%Rindex=outrec
596 ini(ng)%Rindex=
ini(ng)%Rindex+1
598 fcount=
ini(ng)%Fcount
599 ini(ng)%Nrec(fcount)=
ini(ng)%Nrec(fcount)+1
608 & (/
ini(ng)%Rindex/), (/1/), &
609 & piofile =
ini(ng)%pioFile, &
620 WRITE (tstring,
'(f15.4)') my_time*
sec2day
621 WRITE (
stdout,20) t_code, ng, trim(adjustl(tstring)), &
622 & trim(
ini(ng)%name),
ini(ng)%Rindex, tindex
629 IF (
ini(ng)%pioVar(
idfsur)%dkind.eq.pio_double)
THEN
639 & lbi, ubi, lbj, ubj, scale, &
641 &
grid(ng) % rmask, &
643 &
ocean(ng) % zeta(:,:,tindex), &
645 & setfillval = .false., &
647 & setfillval = setfillval, &
651 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
668 IF (
ini(ng)%pioVar(
idubar)%dkind.eq.pio_double)
THEN
678 & lbi, ubi, lbj, ubj, scale, &
680 &
grid(ng) % umask_full, &
682 &
ocean(ng) % ubar(:,:,tindex), &
683 & setfillval = setfillval, &
686 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
703 IF (
ini(ng)%pioVar(
idvbar)%dkind.eq.pio_double)
THEN
713 & lbi, ubi, lbj, ubj, scale, &
715 &
grid(ng) % vmask_full, &
717 &
ocean(ng) % vbar(:,:,tindex), &
718 & setfillval = setfillval, &
721 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
740 IF (
ini(ng)%pioVar(
iduvel)%dkind.eq.pio_double)
THEN
750 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
752 &
grid(ng) % umask_full, &
754 &
ocean(ng) % u(:,:,:,tindex), &
755 & setfillval = setfillval, &
758 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
775 IF (
ini(ng)%pioVar(
idfsur)%dkind.eq.pio_double)
THEN
785 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
787 &
grid(ng) % vmask_full, &
789 &
ocean(ng) % v(:,:,:,tindex), &
790 & setfillval = setfillval, &
793 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
811 IF (
ini(ng)%pioTrc(itrc)%dkind.eq.pio_double)
THEN
818 &
ini(ng)%pioTrc(itrc), &
821 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
823 &
grid(ng) % rmask, &
825 &
ocean(ng) % t(:,:,:,tindex,itrc), &
826 & setfillval = setfillval, &
829 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
832 & trim(
ini(ng)%name),
ini(ng)%Rindex
844# if defined BVF_MIXING || defined GLS_MIXING || \
845 defined my25_mixing || defined lmd_mixing
849 IF (
ini(ng)%pioVar(
idvvis)%vd%varID.le.0)
THEN
854 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
859 IF (
ini(ng)%pioVar(
idvvis)%dkind.eq.pio_double)
THEN
869 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
871 &
grid(ng) % rmask, &
874 & setfillval = .false., &
877 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
880 & trim(
ini(ng)%name),
ini(ng)%Rindex
894 IF (
ini(ng)%pioVar(
idtdif)%vd%varID.le.0)
THEN
899 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
904 IF (
ini(ng)%pioVar(
idtdif)%dkind.eq.pio_double)
THEN
914 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
916 &
grid(ng) % rmask, &
919 & setfillval = .false., &
922 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
925 & trim(
ini(ng)%name),
ini(ng)%Rindex
940 IF (
ini(ng)%pioVar(
idsdif)%vd%varID.le.0)
THEN
945 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
950 IF (
ini(ng)%pioVar(
idsdif)%dkind.eq.pio_double)
THEN
960 & lbi, ubi, lbj, ubj, 0,
n(ng), scale, &
962 &
grid(ng) % rmask, &
965 & setfillval = .false., &
968 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
971 & trim(
ini(ng)%name),
ini(ng)%Rindex
993 10
FORMAT (/,
' WRT_INI_PIO - error while writing variable: ',a, &
994 & /,15x,
'into initial NetCDF file for time record: ',i0)
995 20
FORMAT (2x,
'WRT_INI_PIO - NLM: Writing initial state', &
996 &
' fields,',t75,a, &
997 & /,22x,
'(Grid ',i2.2,
', t = ',a,
', File: ',a, &
998 &
', Rec=',i4.4,
', Index=',i1,
')')
999 30
FORMAT (19x,
'- ',a,/,22x,
'(Min = ',1p,e15.8, &
1000 &
' Max = ',1p,e15.8,
')')
1006# if defined ADJUST_BOUNDARY || \
1007 defined adjust_wstress || defined adjust_stflux
1015 integer,
intent(in) :: ng, tile, tindex, outrec
1019# ifdef ADJUST_BOUNDARY
1020 integer :: lbij, ubij
1022 integer :: lbi, ubi, lbj, ubj
1024 character (len=*),
parameter :: myfile = &
1025 & __FILE__//
", wrt_frc"
1032# ifdef ADJUST_BOUNDARY
1041 SELECT CASE (
ini(ng)%IOtype)
1044# ifdef ADJUST_BOUNDARY
1047 & lbi, ubi, lbj, ubj)
1049# if defined PIO_LIB && defined DISTRIBUTE
1052# ifdef ADJUST_BOUNDARY
1055 & lbi, ubi, lbj, ubj)
1063 10
FORMAT (
' WRT_FRC - Illegal output type, io_type = ',i0)
1070# ifdef ADJUST_BOUNDARY
1073 & LBi, UBi, LBj, UBj)
1080 integer,
intent(in) :: ng, tile, tindex, outrec
1081# ifdef ADJUST_BOUNDARY
1082 integer,
intent(in) :: lbij, ubij
1084 integer,
intent(in) :: lbi, ubi, lbj, ubj
1088 integer :: gfactor, gtype, i, itrc, status
1092 character (len=*),
parameter :: myfile = &
1093 & __FILE__//
", wrt_frc_nf90"
1116# if defined WRITE_WATER && defined MASKING
1122# ifdef ADJUST_BOUNDARY
1136 & lbij, ubij,
nbrec(ng), scale, &
1137 &
boundary(ng) % zeta_obc(lbij:,:,:, &
1139 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1157 & lbij, ubij,
nbrec(ng), scale, &
1158 &
boundary(ng) % ubar_obc(lbij:,:,:, &
1160 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1178 & lbij, ubij,
nbrec(ng), scale, &
1179 &
boundary(ng) % vbar_obc(lbij:,:,:, &
1181 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1201 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
1202 &
boundary(ng) % u_obc(lbij:,:,:,:, &
1204 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1222 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
1223 &
boundary(ng) % v_obc(lbij:,:,:,:, &
1225 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1244 & lbij, ubij, 1,
n(ng),
nbrec(ng), &
1246 &
boundary(ng) % t_obc(lbij:,:,:,:, &
1248 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1262# ifdef ADJUST_WSTRESS
1273 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1275 &
grid(ng) % umask, &
1277 &
forces(ng) % ustr(:,:,:,tindex))
1278 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1294 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1296 &
grid(ng) % vmask, &
1298 &
forces(ng) % vstr(:,:,:,tindex))
1299 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1309# if defined ADJUST_STFLUX && defined SOLVE3D
1317 IF (itrc.eq.
itemp)
THEN
1326 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1328 &
grid(ng) % rmask, &
1330 &
forces(ng) % tflux(:,:,:,tindex,itrc))
1331 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1352 10
FORMAT (2x,
'WRT_FRC_NF90 - writing forcing fields', &
1353 &
' (Outer=',i2.2, &
1355 &
', Inner=',i3.3,
', Index=',i0,
', Rec=',i0,
', Grid ', &
1358 &
', Inner=',i3.3,
', Index=',i0,
', Rec=',i0,
')')
1360 20
FORMAT (/,
' WRT_FRC_NF90 - error while writing variable: ',a, &
1361 & /,16x,
'into initial NetCDF file for time record: ',i0)
1366# if defined PIO_LIB && defined DISTRIBUTE
1370# ifdef ADJUST_BOUNDARY
1373 & LBi, UBi, LBj, UBj)
1380 integer,
intent(in) :: ng, tile, tindex, outrec
1381# ifdef ADJUST_BOUNDARY
1382 integer,
intent(in) :: lbij, ubij
1384 integer,
intent(in) :: lbi, ubi, lbj, ubj
1388 integer :: i, ifield, itrc, status
1392 character (len=*),
parameter :: myfile = &
1393 & __FILE__//
", wrt_frc_pio"
1395 TYPE (io_desc_t),
pointer :: iodesc
1415# ifdef ADJUST_BOUNDARY
1432 &
ini(ng)%pioFile, &
1436 & lbij, ubij,
nbrec(ng), scale, &
1437 &
boundary(ng) % zeta_obc(lbij:,:,:, &
1439 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1460 &
ini(ng)%pioFile, &
1464 & lbij, ubij,
nbrec(ng), scale, &
1465 &
boundary(ng) % ubar_obc(lbij:,:,:, &
1467 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1488 &
ini(ng)%pioFile, &
1492 & lbij, ubij,
nbrec(ng), scale, &
1493 &
boundary(ng) % vbar_obc(lbij:,:,:, &
1495 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1518 &
ini(ng)%pioFile, &
1522 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
1523 &
boundary(ng) % u_obc(lbij:,:,:,:, &
1525 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1546 &
ini(ng)%pioFile, &
1550 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
1551 &
boundary(ng) % v_obc(lbij:,:,:,:, &
1553 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1569 IF (
ini(ng)%pioVar(ifield)%dkind.eq.pio_double)
THEN
1576 &
ini(ng)%pioFile, &
1577 &
vname(1,ifield), &
1578 &
ini(ng)%pioVar(ifield), &
1580 & lbij, ubij, 1,
n(ng),
nbrec(ng), &
1582 &
boundary(ng) % t_obc(lbij:,:,:,:, &
1584 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1598# ifdef ADJUST_WSTRESS
1605 IF (
ini(ng)%pioVar(
idusms)%dkind.eq.pio_double)
THEN
1614 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1616 &
grid(ng) % umask, &
1618 &
forces(ng) % ustr(:,:,:,tindex))
1619 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1631 IF (
ini(ng)%pioVar(
idvsms)%dkind.eq.pio_double)
THEN
1640 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1642 &
grid(ng) % vmask, &
1644 &
forces(ng) % vstr(:,:,:,tindex))
1645 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1655# if defined ADJUST_STFLUX && defined SOLVE3D
1663 IF (itrc.eq.
itemp)
THEN
1668 IF (
ini(ng)%pioVar(
idtsur(itrc))%dkind.eq.pio_double)
THEN
1675 &
ini(ng)%pioVar(
idtsur(itrc)), outrec, &
1677 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1679 &
grid(ng) % rmask, &
1681 &
forces(ng) % tflux(:,:,:,tindex,itrc))
1682 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
1703 10
FORMAT (2x,
'WRT_FRC_PIO - writing forcing fields', &
1704 &
' (Outer=',i2.2, &
1706 &
', Inner=',i3.3,
', Index=',i0,
', Rec=',i0,
', Grid ', &
1709 &
', Inner=',i3.3,
', Index=',i0,
', Rec=',i0,
')')
1711 20
FORMAT (/,
' WRT_FRC_pio - error while writing variable: ',a, &
1712 & /,15x,
'into initial NetCDF file for time record: ',i0)
1724 integer,
intent(in) :: ng, tile, tindex, outrec
1728# ifdef ADJUST_BOUNDARY
1729 integer :: lbij, ubij
1731 integer :: lbi, ubi, lbj, ubj
1733 character (len=*),
parameter :: myfile = &
1734 & __FILE__//
", wrt_frc"
1741# ifdef ADJUST_BOUNDARY
1750 SELECT CASE (
ini(ng)%IOtype)
1753# ifdef ADJUST_BOUNDARY
1756 & lbi, ubi, lbj, ubj)
1758# if defined PIO_LIB && defined DISTRIBUTE
1761# ifdef ADJUST_BOUNDARY
1764 & lbi, ubi, lbj, ubj)
1772 10
FORMAT (
' WRT_FRC_AD - Illegal output type, io_type = ',i0)
1779# ifdef ADJUST_BOUNDARY
1782 & LBi, UBi, LBj, UBj)
1789 integer,
intent(in) :: ng, tile, tindex, outrec
1790# ifdef ADJUST_BOUNDARY
1791 integer,
intent(in) :: lbij, ubij
1793 integer,
intent(in) :: lbi, ubi, lbj, ubj
1797 integer :: gfactor, gtype, i, itrc, status
1801 character (len=*),
parameter :: myfile = &
1802 & __FILE__//
", wrt_frc_AD_nf90"
1825# if defined WRITE_WATER && defined MASKING
1831# ifdef ADJUST_BOUNDARY
1845 & lbij, ubij,
nbrec(ng), scale, &
1846 &
boundary(ng) % ad_zeta_obc(lbij:,:,:, &
1848 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1866 & lbij, ubij,
nbrec(ng), scale, &
1867 &
boundary(ng) % ad_ubar_obc(lbij:,:,:, &
1869 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1887 & lbij, ubij,
nbrec(ng), scale, &
1888 &
boundary(ng) % ad_vbar_obc(lbij:,:,:, &
1890 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1910 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
1911 &
boundary(ng) % ad_u_obc(lbij:,:,:,:, &
1913 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1931 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
1932 &
boundary(ng) % ad_v_obc(lbij:,:,:,:, &
1934 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1953 & lbij, ubij, 1,
n(ng),
nbrec(ng), &
1955 &
boundary(ng) % ad_t_obc(lbij:,:,:,:, &
1957 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
1971# ifdef ADJUST_WSTRESS
1982 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
1984 &
grid(ng) % umask, &
1986 &
forces(ng) % ad_ustr(:,:,:,tindex))
1987 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2003 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
2005 &
grid(ng) % vmask, &
2007 &
forces(ng) % ad_vstr(:,:,:,tindex))
2008 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2018# if defined ADJUST_STFLUX && defined SOLVE3D
2031 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
2033 &
grid(ng) % rmask, &
2035 &
forces(ng) % ad_tflux(:,:,:,tindex,itrc))
2036 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
2057 10
FORMAT (2x,
'WRT_FRC_AD_NF90 - writing forcing fields', &
2058 &
' (Outer=',i2.2, &
2060 &
', Inner=',i3.3,
', Index=',i0,
', Rec=',i0,
', Grid ', &
2063 &
', Inner=',i3.3,
', Index=',i0,
', Rec=',i0,
')')
2065 20
FORMAT (/,
' WRT_FRC_AD_NF90 - error while writing variable: ',a, &
2066 & /,19x,
'into initial NetCDF file for time record: ',i0)
2071# if defined PIO_LIB && defined DISTRIBUTE
2075# ifdef ADJUST_BOUNDARY
2078 & LBi, UBi, LBj, UBj)
2085 integer,
intent(in) :: ng, tile, tindex, outrec
2086# ifdef ADJUST_BOUNDARY
2087 integer,
intent(in) :: lbij, ubij
2089 integer,
intent(in) :: lbi, ubi, lbj, ubj
2093 integer :: i, ifield, itrc, status
2097 character (len=*),
parameter :: myfile = &
2098 & __FILE__//
", wrt_frc_AD_pio"
2100 TYPE (io_desc_t),
pointer :: iodesc
2120# ifdef ADJUST_BOUNDARY
2137 &
ini(ng)%pioFile, &
2141 & lbij, ubij,
nbrec(ng), scale, &
2142 &
boundary(ng) % ad_zeta_obc(lbij:,:,:, &
2144 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2165 &
ini(ng)%pioFile, &
2169 & lbij, ubij,
nbrec(ng), scale, &
2170 &
boundary(ng) % ad_ubar_obc(lbij:,:,:, &
2172 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2193 &
ini(ng)%pioFile, &
2197 & lbij, ubij,
nbrec(ng), scale, &
2198 &
boundary(ng) % ad_vbar_obc(lbij:,:,:, &
2200 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2223 &
ini(ng)%pioFile, &
2227 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
2228 &
boundary(ng) % ad_u_obc(lbij:,:,:,:, &
2230 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2251 &
ini(ng)%pioFile, &
2255 & lbij, ubij, 1,
n(ng),
nbrec(ng), scale, &
2256 &
boundary(ng) % ad_v_obc(lbij:,:,:,:, &
2258 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2274 IF (
ini(ng)%pioVar(ifield)%dkind.eq.pio_double)
THEN
2281 &
ini(ng)%pioFile, &
2285 & lbij, ubij, 1,
n(ng),
nbrec(ng), &
2287 &
boundary(ng) % ad_t_obc(lbij:,:,:,:, &
2289 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2303# ifdef ADJUST_WSTRESS
2310 IF (
ini(ng)%pioVar(
idusms)%dkind.eq.pio_double)
THEN
2319 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
2321 &
grid(ng) % umask, &
2323 &
forces(ng) % ad_ustr(:,:,:,tindex))
2324 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2336 IF (
ini(ng)%pioVar(
idvsms)%dkind.eq.pio_double)
THEN
2345 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
2347 &
grid(ng) % vmask, &
2349 &
forces(ng) % ad_vstr(:,:,:,tindex))
2350 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2360# if defined ADJUST_STFLUX && defined SOLVE3D
2369 IF (
ini(ng)%pioVar(
idtsur(itrc))%dkind.eq.pio_double)
THEN
2378 & lbi, ubi, lbj, ubj, 1,
nfrec(ng), scale, &
2380 &
grid(ng) % rmask, &
2382 &
forces(ng) % ad_tflux(:,:,:,tindex,itrc))
2383 IF (
founderror(status, pio_noerr, __line__, myfile))
THEN
2404 10
FORMAT (2x,
'WRT_FRC_AD_PIO - writing forcing fields', &
2405 &
' (Outer=',i2.2, &
2407 &
', Inner=',i3.3,
', Index=',i0,
', Rec=',i0,
', Grid ', &
2410 &
', Inner=',i3.3,
', Index=',i0,
', Rec=',i0,
')')
2412 20
FORMAT (/,
' WRT_FRC_AD_PIO - error while writing variable: ',a, &
2413 & /,19x,
'into initial NetCDF file for time record: ',i0)
subroutine, public time_string(mytime, date_string)
type(t_boundary), dimension(:), allocatable boundary
type(t_forces), dimension(:), allocatable forces
type(t_grid), dimension(:), allocatable grid
type(t_io), dimension(:), allocatable dai
type(t_io), dimension(:), allocatable ini
character(len=256) sourcefile
type(t_io), dimension(:), allocatable dia
type(t_mixing), dimension(:), allocatable mixing
integer, parameter io_nf90
integer, dimension(:), allocatable idsbry
integer, parameter io_pio
integer, dimension(:), allocatable idtsur
integer, dimension(:), allocatable idtvar
integer, dimension(:), allocatable istvar
character(len=maxlen), dimension(6, 0:nv) vname
subroutine, public netcdf_sync(ng, model, ncname, ncid)
subroutine, public netcdf_inq_varid(ng, model, ncname, myvarname, ncid, varid)
type(t_ocean), dimension(:), allocatable ocean
integer, dimension(:), allocatable n
type(t_bounds), dimension(:), allocatable bounds
integer, parameter r3dvar
integer, parameter u3dvar
integer, parameter u2dvar
integer, parameter w3dvar
integer, dimension(:), allocatable nt
integer, parameter r2dvar
integer, parameter v2dvar
integer, parameter v3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_w3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_v2dobc
type(io_desc_t), dimension(:), pointer iodesc_dp_r3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_u3dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_v2dobc
type(io_desc_t), dimension(:), pointer iodesc_sp_u2dfrc
type(io_desc_t), dimension(:), pointer iodesc_dp_v3dobc
subroutine, public pio_netcdf_sync(ng, model, ncname, piofile)
type(io_desc_t), dimension(:), pointer iodesc_sp_u2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_u3dobc
type(io_desc_t), dimension(:), pointer iodesc_sp_r3dobc
type(io_desc_t), dimension(:), pointer iodesc_dp_u3dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_u2dobc
type(io_desc_t), dimension(:), pointer iodesc_sp_r2dobc
type(io_desc_t), dimension(:), pointer iodesc_sp_r2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_u3dobc
type(io_desc_t), dimension(:), pointer iodesc_dp_u2dfrc
type(io_desc_t), dimension(:), pointer iodesc_dp_r2dobc
type(io_desc_t), dimension(:), pointer iodesc_sp_u2dobc
type(io_desc_t), dimension(:), pointer iodesc_dp_u2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_v2dfrc
type(io_desc_t), dimension(:), pointer iodesc_dp_v3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_v2dfrc
subroutine, public pio_netcdf_inq_varid(ng, model, ncname, myvarname, piofile, piovar)
type(io_desc_t), dimension(:), pointer iodesc_dp_w3dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_r2dfrc
type(io_desc_t), dimension(:), pointer iodesc_dp_v2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_v3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_r3dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_r2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_r3dobc
type(io_desc_t), dimension(:), pointer iodesc_sp_v3dobc
type(io_desc_t), dimension(:), pointer iodesc_sp_v2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_r2dfrc
real(dp), parameter day2sec
logical, dimension(:,:,:), allocatable lobc
logical, dimension(:,:), allocatable lstflux
integer, dimension(:), allocatable nfrec
real(dp), dimension(:), allocatable tdays
real(dp), parameter sec2day
integer, dimension(:), allocatable nbrec
logical function, public founderror(flag, noerr, line, routine)
subroutine, private wrt_frc_ad_pio(ng, tile, tindex, outrec, lbij, ubij, lbi, ubi, lbj, ubj)
subroutine, private wrt_frc_ad_nf90(ng, tile, tindex, outrec, lbij, ubij, lbi, ubi, lbj, ubj)
subroutine, private wrt_ini_pio(ng, tile, tindex, lbi, ubi, lbj, ubj, outrec)
subroutine, private wrt_frc_pio(ng, tile, tindex, outrec, lbij, ubij, lbi, ubi, lbj, ubj)
subroutine, public wrt_frc_ad(ng, tile, tindex, outrec)
subroutine, private wrt_ini_nf90(ng, tile, tindex, lbi, ubi, lbj, ubj, outrec)
subroutine, public wrt_ini(ng, tile, tindex, outrec)
subroutine, private wrt_frc_nf90(ng, tile, tindex, outrec, lbij, ubij, lbi, ubi, lbj, ubj)
subroutine, public wrt_frc(ng, tile, tindex, outrec)