53# ifdef ADJUST_BOUNDARY
57# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
66# if defined PIO_LIB && defined DISTRIBUTE
70# if defined SEDIMENT && defined SED_MORPH && defined SOLVE3D
79# ifdef ADJUST_BOUNDARY
89# ifdef ADJUST_BOUNDARY
103# ifdef ADJUST_BOUNDARY
112# ifdef ADJUST_BOUNDARY
127# if defined PIO_LIB && defined DISTRIBUTE
131# if defined PIO_LIB && defined DISTRIBUTE
143 integer,
intent(in) :: ng, tile, ifac
154 & lbi, ubi, lbj, ubj, lbij, ubij, &
155 & imins, imaxs, jmins, jmaxs, &
167 &
grid(ng) % pmon_p, &
168 &
grid(ng) % pmon_r, &
169 &
grid(ng) % pmon_u, &
170 &
grid(ng) % pnom_p, &
171 &
grid(ng) % pnom_r, &
172 &
grid(ng) % pnom_v, &
174 &
grid(ng) % pmask, &
175 &
grid(ng) % rmask, &
176 &
grid(ng) % umask, &
177 &
grid(ng) % vmask, &
184# if defined SEDIMENT && defined SED_MORPH
185 &
sedbed(ng) % bed_thick, &
195# ifdef ADJUST_BOUNDARY
205# ifdef ADJUST_WSTRESS
209# if defined ADJUST_STFLUX && defined SOLVE3D
217 &
ocean(ng) % b_zeta, &
218 &
ocean(ng) % b_ubar, &
219 &
ocean(ng) % b_vbar)
224 ELSE IF (
nmethod(ng).eq.1)
THEN
226 & lbi, ubi, lbj, ubj, lbij, ubij, &
227 & imins, imaxs, jmins, jmaxs, &
239 &
grid(ng) % pmon_p, &
240 &
grid(ng) % pmon_r, &
241 &
grid(ng) % pmon_u, &
242 &
grid(ng) % pnom_p, &
243 &
grid(ng) % pnom_r, &
244 &
grid(ng) % pnom_v, &
246 &
grid(ng) % pmask, &
247 &
grid(ng) % rmask, &
248 &
grid(ng) % umask, &
249 &
grid(ng) % vmask, &
256# if defined SEDIMENT && defined SED_MORPH
257 &
sedbed(ng) % bed_thick, &
267# ifdef ADJUST_BOUNDARY
277# ifdef ADJUST_WSTRESS
281# if defined ADJUST_STFLUX && defined SOLVE3D
289 &
ocean(ng) % b_zeta, &
290 &
ocean(ng) % b_ubar, &
291 &
ocean(ng) % b_vbar)
299 & LBi, UBi, LBj, UBj, LBij, UBij, &
300 & IminS, ImaxS, JminS, JmaxS, &
301 & nstp, nnew, ifac, &
302 & pm, om_p, om_r, om_u, om_v, &
303 & pn, on_p, on_r, on_u, on_v, &
304 & pmon_p, pmon_r, pmon_u, &
305 & pnom_p, pnom_r, pnom_v, &
315# if defined SEDIMENT && defined SED_MORPH
324# ifdef ADJUST_BOUNDARY
326 & VnormRobc, VnormUobc, VnormVobc, &
328 & HnormRobc, HnormUobc, HnormVobc, &
330# ifdef ADJUST_WSTRESS
331 & HnormSUS, HnormSVS, &
333# if defined ADJUST_STFLUX && defined SOLVE3D
337 & VnormR, VnormU, VnormV, &
339 & HnormR, HnormU, HnormV)
344 integer,
intent(in) :: ng, tile
345 integer,
intent(in) :: lbi, ubi, lbj, ubj, lbij, ubij
346 integer,
intent(in) :: imins, imaxs, jmins, jmaxs
347 integer,
intent(in) ::
nstp,
nnew, ifac
350 real(
r8),
intent(in) :: pm(lbi:,lbj:)
351 real(
r8),
intent(in) :: om_p(lbi:,lbj:)
352 real(
r8),
intent(in) :: om_r(lbi:,lbj:)
353 real(
r8),
intent(in) :: om_u(lbi:,lbj:)
354 real(
r8),
intent(in) :: om_v(lbi:,lbj:)
355 real(
r8),
intent(in) :: pn(lbi:,lbj:)
356 real(
r8),
intent(in) :: on_p(lbi:,lbj:)
357 real(
r8),
intent(in) :: on_r(lbi:,lbj:)
358 real(
r8),
intent(in) :: on_u(lbi:,lbj:)
359 real(
r8),
intent(in) :: on_v(lbi:,lbj:)
360 real(
r8),
intent(in) :: pmon_p(lbi:,lbj:)
361 real(
r8),
intent(in) :: pmon_r(lbi:,lbj:)
362 real(
r8),
intent(in) :: pmon_u(lbi:,lbj:)
363 real(
r8),
intent(in) :: pnom_p(lbi:,lbj:)
364 real(
r8),
intent(in) :: pnom_r(lbi:,lbj:)
365 real(
r8),
intent(in) :: pnom_v(lbi:,lbj:)
367 real(
r8),
intent(in) :: pmask(lbi:,lbj:)
368 real(
r8),
intent(in) :: rmask(lbi:,lbj:)
369 real(
r8),
intent(in) :: umask(lbi:,lbj:)
370 real(
r8),
intent(in) :: vmask(lbi:,lbj:)
372 real(
r8),
intent(in) :: kh(lbi:,lbj:)
374 real(
r8),
intent(in) :: kv(lbi:,lbj:,0:)
376 real(
r8),
intent(in) :: zice(lbi:,lbj:)
378# if defined SEDIMENT && defined SED_MORPH
379 real(
r8),
intent(in):: bed_thick(lbi:,lbj:,:)
381 real(
r8),
intent(inout) :: h(lbi:,lbj:)
383# ifdef ADJUST_BOUNDARY
385 real(
r8),
intent(out) :: vnormrobc(lbij:,:,:,:)
386 real(
r8),
intent(out) :: vnormuobc(lbij:,:,:)
387 real(
r8),
intent(out) :: vnormvobc(lbij:,:,:)
389 real(
r8),
intent(out) :: hnormrobc(lbij:,:)
390 real(
r8),
intent(out) :: hnormuobc(lbij:,:)
391 real(
r8),
intent(out) :: hnormvobc(lbij:,:)
393# ifdef ADJUST_WSTRESS
394 real(
r8),
intent(out) :: hnormsus(lbi:,lbj:)
395 real(
r8),
intent(out) :: hnormsvs(lbi:,lbj:)
397# if defined ADJUST_STFLUX && defined SOLVE3D
398 real(
r8),
intent(out) :: hnormstf(lbi:,lbj:,:)
401 real(
r8),
intent(out) :: vnormr(lbi:,lbj:,:,:,:)
402 real(
r8),
intent(out) :: vnormu(lbi:,lbj:,:,:)
403 real(
r8),
intent(out) :: vnormv(lbi:,lbj:,:,:)
405 real(
r8),
intent(out) :: hnormr(lbi:,lbj:,:)
406 real(
r8),
intent(out) :: hnormu(lbi:,lbj:,:)
407 real(
r8),
intent(out) :: hnormv(lbi:,lbj:,:)
409 real(
r8),
intent(out) :: hz(lbi:,lbj:,:)
410 real(
r8),
intent(out) :: z_r(lbi:,lbj:,:)
411 real(
r8),
intent(out) :: z_w(lbi:,lbj:,0:)
414 real(
r8),
intent(in) :: pm(lbi:ubi,lbj:ubj)
415 real(
r8),
intent(in) :: om_p(lbi:ubi,lbj:ubj)
416 real(
r8),
intent(in) :: om_r(lbi:ubi,lbj:ubj)
417 real(
r8),
intent(in) :: om_u(lbi:ubi,lbj:ubj)
418 real(
r8),
intent(in) :: om_v(lbi:ubi,lbj:ubj)
419 real(
r8),
intent(in) :: pn(lbi:ubi,lbj:ubj)
420 real(
r8),
intent(in) :: on_p(lbi:ubi,lbj:ubj)
421 real(
r8),
intent(in) :: on_r(lbi:ubi,lbj:ubj)
422 real(
r8),
intent(in) :: on_u(lbi:ubi,lbj:ubj)
423 real(
r8),
intent(in) :: on_v(lbi:ubi,lbj:ubj)
424 real(
r8),
intent(in) :: pmon_p(lbi:ubi,lbj:ubj)
425 real(
r8),
intent(in) :: pmon_r(lbi:ubi,lbj:ubj)
426 real(
r8),
intent(in) :: pmon_u(lbi:ubi,lbj:ubj)
427 real(
r8),
intent(in) :: pnom_p(lbi:ubi,lbj:ubj)
428 real(
r8),
intent(in) :: pnom_r(lbi:ubi,lbj:ubj)
429 real(
r8),
intent(in) :: pnom_v(lbi:ubi,lbj:ubj)
431 real(
r8),
intent(in) :: pmask(lbi:ubi,lbj:ubj)
432 real(
r8),
intent(in) :: rmask(lbi:ubi,lbj:ubj)
433 real(
r8),
intent(in) :: umask(lbi:ubi,lbj:ubj)
434 real(
r8),
intent(in) :: vmask(lbi:ubi,lbj:ubj)
436 real(
r8),
intent(in) :: kh(lbi:ubi,lbj:ubj)
438 real(
r8),
intent(in) :: kv(lbi:ubi,lbj:ubj,0:
n(ng))
440 real(
r8),
intent(in) :: zice(lbi:ubi,lbj:ubj)
442# if defined SEDIMENT && defined SED_MORPH
443 real(
r8),
intent(in):: bed_thick0(lbi:ubi,lbj:ubj,3)
445 real(
r8),
intent(inout) :: h(lbi:ubi,lbj:ubj)
447# ifdef ADJUST_BOUNDARY
449 real(
r8),
intent(out) :: vnormrobc(lbij:ubij,
n(ng),4,
nt(ng))
450 real(
r8),
intent(out) :: vnormuobc(lbij:ubij,
n(ng),4)
451 real(
r8),
intent(out) :: vnormvobc(lbij:ubij,
n(ng),4)
453 real(
r8),
intent(out) :: hnormrobc(lbij:ubij,4)
454 real(
r8),
intent(out) :: hnormuobc(lbij:ubij,4)
455 real(
r8),
intent(out) :: hnormvobc(lbij:ubij,4)
457# ifdef ADJUST_WSTRESS
458 real(
r8),
intent(out) :: hnormsus(lbi:ubi,lbj:ubj)
459 real(
r8),
intent(out) :: hnormsvs(lbi:ubi,lbj:ubj)
461# if defined ADJUST_STFLUX && defined SOLVE3D
462 real(
r8),
intent(out) :: hnormstf(lbi:ubi,lbj:ubj,
nt(ng))
465 real(
r8),
intent(out) :: vnormr(lbi:ubi,lbj:ubj,
n(ng),
nsa,
nt(ng))
466 real(
r8),
intent(out) :: vnormu(lbi:ubi,lbj:ubj,
n(ng),
nsa)
467 real(
r8),
intent(out) :: vnormv(lbi:ubi,lbj:ubj,
n(ng),
nsa)
469 real(
r8),
intent(out) :: hnormr(lbi:ubi,lbj:ubj,
nsa)
470 real(
r8),
intent(out) :: hnormu(lbi:ubi,lbj:ubj,
nsa)
471 real(
r8),
intent(out) :: hnormv(lbi:ubi,lbj:ubj,
nsa)
473 real(
r8),
intent(out) :: hz(lbi:ubi,lbj:ubj,
n(ng))
474 real(
r8),
intent(out) :: z_r(lbi:ubi,lbj:ubj,
n(ng))
475 real(
r8),
intent(out) :: z_w(lbi:ubi,lbj:ubj,0:
n(ng))
482 logical :: ldiffer, lsame
484# ifdef ADJUST_BOUNDARY
486 logical :: lconvolve(4)
489 integer :: imin, imax, jmin, jmax
490 integer :: i, ic, ifile, is, j, jc, rec
493 integer :: ubt, itrc, k, kc, ntrc
495# ifdef ADJUST_BOUNDARY
496 integer :: bmin, bmax, ijlen, ijklen
497 integer :: ib, ibry, ifield, kb
499 real(
r8),
parameter :: aspv = 0.0_r8
502 real(
r8) :: cff, compute
503 real(
r8) :: my_dot, gdotp
505 real(
r8),
dimension(LBi:UBi,LBj:UBj) :: a2d
506 real(
r8),
dimension(LBi:UBi,LBj:UBj) :: hscale
508 real(
r8),
dimension(LBi:UBi,LBj:UBj,1:N(ng)) :: a3d
509 real(
r8),
dimension(LBi:UBi,LBj:UBj,1:N(ng)) :: vscale
511# ifdef ADJUST_BOUNDARY
512 real(
r8),
dimension(LBij:UBij) :: b2d
513 real(
r8),
dimension(LBij:UBij) :: hscaleb
515 real(
r8),
dimension(LBij:UBij,1:N(ng)) :: b3d
516 real(
r8),
dimension(LBij:UBij,1:N(ng)) :: vscaleb
518 real(
r8),
dimension((UBij-LBij+1)*N(ng)) :: bwrk
524 character (len=3 ) :: op_handle
526 character (len=40 ) :: text
527 character (len=256) :: ncname
529 character (len=*),
parameter :: myfile = &
530 & __FILE__//
", normalization_tile"
532# if defined PIO_LIB && defined DISTRIBUTE
534 TYPE (io_desc_t),
pointer :: iodesc
537# include "set_bounds.h"
556 & lbi, ubi, lbj, ubj, &
557 & imins, imaxs, jmins, jmaxs, &
563# if defined SEDIMENT && defined SED_MORPH
581 file_loop :
DO ifile=1,
nsa
585 text=
'initial conditions'
586 ELSE IF (ifile.eq.2)
THEN
592 ncname=
nrm(ifile,ng)%name
593 nrm(ifile,ng)%Rindex=
nrm(ifile,ng)%Rindex+1
594 nrm(ifile,ng)%Nrec=
nrm(ifile,ng)%Nrec+1
598 SELECT CASE (
nrm(ifile,ng)%IOtype)
602 & start = (/
nrm(ifile,ng)%Rindex/), &
604 & ncid =
nrm(ifile,ng)%ncid, &
607# if defined PIO_LIB && defined DISTRIBUTE
611 & start = (/
nrm(ifile,ng)%Rindex/), &
613 & piofile =
nrm(ifile,ng)%pioFile, &
614 & piovar =
nrm(ifile,ng)%pioVar(
idtime)%vd)
627 WRITE (
stdout,20) trim(text), &
628 &
'2D normalization factors at RHO-points'
633 hscale(i,j)=1.0_r8/sqrt(om_r(i,j)*on_r(i,j))
640 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
641 & ((istr.le.ic).and.(ic.le.iend)))
THEN
642 IF (rmask(ic,jc).gt.0) compute=1.0_r8
650 IF (compute.gt.0.0_r8)
THEN
656 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
657 & ((istr.le.ic).and.(ic.le.iend)))
THEN
661 & lbi, ubi, lbj, ubj, &
662 & imins, imaxs, jmins, jmaxs, &
667 & pm, pn, pmon_u, pnom_v, &
669 & rmask, umask, vmask, &
674 a2d(i,j)=a2d(i,j)*hscale(i,j)
681 my_dot=my_dot+a2d(i,j)*a2d(i,j)
690 IF (
domain(ng)%SouthWest_Corner(tile).and. &
691 &
domain(ng)%NorthEast_Corner(tile))
THEN
710 cff=1.0_r8/sqrt(gdotp)
716 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
717 & ((istr.le.ic).and.(ic.le.iend)))
THEN
718 hnormr(ic,jc,ifile)=cff
723 & lbi, ubi, lbj, ubj, &
727 & lbi, ubi, lbj, ubj, &
733 SELECT CASE (
nrm(ifile,ng)%IOtype)
736 & lbi, ubi, lbj, ubj,
idfsur, &
737 &
nrm(ifile,ng)%ncid, &
739 &
nrm(ifile,ng)%Rindex, &
745# if defined PIO_LIB && defined DISTRIBUTE
747 IF (
nrm(ifile,ng)%pioVar(
idfsur)%dkind.eq. &
754 & lbi, ubi, lbj, ubj,
idfsur, &
755 &
nrm(ifile,ng)%pioFile, &
757 &
nrm(ifile,ng)%Rindex, &
783 WRITE (
stdout,20) trim(text), &
784 &
'2D normalization factors at U-points'
789 hscale(i,j)=1.0_r8/sqrt(om_u(i,j)*on_u(i,j))
796 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
797 & ((istr.le.ic).and.(ic.le.iend)))
THEN
798 IF (umask(ic,jc).gt.0) compute=1.0_r8
806 IF (compute.gt.0.0_r8)
THEN
812 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
813 & ((istr.le.ic).and.(ic.le.iend)))
THEN
817 & lbi, ubi, lbj, ubj, &
818 & imins, imaxs, jmins, jmaxs, &
823 & pm, pn, pmon_r, pnom_p, &
830 a2d(i,j)=a2d(i,j)*hscale(i,j)
837 my_dot=my_dot+a2d(i,j)*a2d(i,j)
847 IF (
domain(ng)%SouthWest_Corner(tile).and. &
848 &
domain(ng)%NorthEast_Corner(tile))
THEN
867 cff=1.0_r8/sqrt(gdotp)
873 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
874 & ((istr.le.ic).and.(ic.le.iend)))
THEN
875 hnormu(ic,jc,ifile)=cff
880 & lbi, ubi, lbj, ubj, &
884 & lbi, ubi, lbj, ubj, &
890 SELECT CASE (
nrm(ifile,ng)%IOtype)
893 & lbi, ubi, lbj, ubj,
idubar, &
894 &
nrm(ifile,ng)%ncid, &
896 &
nrm(ifile,ng)%Rindex, &
902# if defined PIO_LIB && defined DISTRIBUTE
904 IF (
nrm(ifile,ng)%pioVar(
idubar)%dkind.eq. &
911 & lbi, ubi, lbj, ubj,
idubar, &
912 &
nrm(ifile,ng)%pioFile, &
914 &
nrm(ifile,ng)%Rindex, &
940 WRITE (
stdout,20) trim(text), &
941 &
'2D normalization factors at V-points'
946 hscale(i,j)=1.0_r8/sqrt(om_v(i,j)*on_v(i,j))
953 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
954 & ((istr.le.ic).and.(ic.le.iend)))
THEN
955 IF (vmask(ic,jc).gt.0) compute=1.0_r8
963 IF (compute.gt.0.0_r8)
THEN
969 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
970 & ((istr.le.ic).and.(ic.le.iend)))
THEN
974 & lbi, ubi, lbj, ubj, &
975 & imins, imaxs, jmins, jmaxs, &
980 & pm, pn, pmon_p, pnom_r, &
987 a2d(i,j)=a2d(i,j)*hscale(i,j)
994 my_dot=my_dot+a2d(i,j)*a2d(i,j)
1003 IF (
domain(ng)%SouthWest_Corner(tile).and. &
1004 &
domain(ng)%NorthEast_Corner(tile))
THEN
1023 cff=1.0_r8/sqrt(gdotp)
1029 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1030 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1031 hnormv(ic,jc,ifile)=cff
1036 & lbi, ubi, lbj, ubj, &
1037 & hnormv(:,:,ifile))
1040 & lbi, ubi, lbj, ubj, &
1043 & hnormv(:,:,ifile))
1046 SELECT CASE (
nrm(ifile,ng)%IOtype)
1049 & lbi, ubi, lbj, ubj,
idvbar, &
1050 &
nrm(ifile,ng)%ncid, &
1052 &
nrm(ifile,ng)%Rindex, &
1056 & hnormv(:,:,ifile))
1058# if defined PIO_LIB && defined DISTRIBUTE
1060 IF (
nrm(ifile,ng)%pioVar(
idvbar)%dkind.eq. &
1067 & lbi, ubi, lbj, ubj,
idvbar, &
1068 &
nrm(ifile,ng)%pioFile, &
1070 &
nrm(ifile,ng)%Rindex, &
1075 & hnormv(:,:,ifile))
1098 WRITE (
stdout,20) trim(text), &
1099 &
'3D normalization factors at U-points'
1104 cff=om_u(i,j)*on_u(i,j)*0.5_r8
1106 vscale(i,j,k)=1.0_r8/sqrt(cff*(hz(i-1,j,k)+hz(i,j,k)))
1115 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1116 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1117 IF (umask(ic,jc).gt.0) compute=1.0_r8
1125 IF (compute.gt.0.0_r8)
THEN
1133 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1134 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1135 a3d(ic,jc,kc)=1.0_r8
1138 & lbi, ubi, lbj, ubj, &
1140 & imins, imaxs, jmins, jmaxs, &
1148# ifdef GEOPOTENTIAL_HCONV
1154# ifdef GEOPOTENTIAL_HCONV
1155 & pmask, rmask, umask, vmask, &
1165 a3d(i,j,k)=a3d(i,j,k)*vscale(i,j,k)
1174 my_dot=my_dot+a3d(i,j,k)*a3d(i,j,k)
1184 IF (
domain(ng)%SouthWest_Corner(tile).and. &
1185 &
domain(ng)%NorthEast_Corner(tile))
THEN
1204 cff=1.0_r8/sqrt(gdotp)
1210 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1211 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1212 vnormu(ic,jc,kc,ifile)=cff
1218 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1219 & vnormu(:,:,:,ifile))
1222 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1225 & vnormu(:,:,:,ifile))
1228 SELECT CASE (
nrm(ifile,ng)%IOtype)
1231 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1234 &
nrm(ifile,ng)%Rindex, &
1238 & vnormu(:,:,:,ifile))
1240# if defined PIO_LIB && defined DISTRIBUTE
1242 IF (
nrm(ifile,ng)%pioVar(
iduvel)%dkind.eq. &
1249 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1252 &
nrm(ifile,ng)%Rindex, &
1257 & vnormu(:,:,:,ifile))
1278 WRITE (
stdout,20) trim(text), &
1279 &
'3D normalization factors at V-points'
1284 cff=om_v(i,j)*on_v(i,j)*0.5_r8
1286 vscale(i,j,k)=1.0_r8/sqrt(cff*(hz(i,j-1,k)+hz(i,j,k)))
1295 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1296 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1297 IF (vmask(ic,jc).gt.0) compute=1.0_r8
1305 IF (compute.gt.0.0_r8)
THEN
1313 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1314 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1315 a3d(ic,jc,kc)=1.0_r8
1318 & lbi, ubi, lbj, ubj, &
1320 & imins, imaxs, jmins, jmaxs, &
1328# ifdef GEOPOTENTIAL_HCONV
1334# ifdef GEOPOTENTIAL_HCONV
1335 & pmask, rmask, umask, vmask, &
1345 a3d(i,j,k)=a3d(i,j,k)*vscale(i,j,k)
1354 my_dot=my_dot+a3d(i,j,k)*a3d(i,j,k)
1364 IF (
domain(ng)%SouthWest_Corner(tile).and. &
1365 &
domain(ng)%NorthEast_Corner(tile))
THEN
1384 cff=1.0_r8/sqrt(gdotp)
1390 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1391 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1392 vnormv(ic,jc,kc,ifile)=cff
1398 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1399 & vnormv(:,:,:,ifile))
1402 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1405 & vnormv(:,:,:,ifile))
1408 SELECT CASE (
nrm(ifile,ng)%IOtype)
1411 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1414 &
nrm(ifile,ng)%Rindex, &
1418 & vnormv(:,:,:,ifile))
1420# if defined PIO_LIB && defined DISTRIBUTE
1422 IF (
nrm(ifile,ng)%pioVar(
idvvel)%dkind.eq. &
1429 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1432 &
nrm(ifile,ng)%Rindex, &
1437 & vnormv(:,:,:,ifile))
1449 IF (
cnorm(ifile,is)) lsame=.true.
1452 WRITE (
stdout,20) trim(text), &
1453 &
'3D normalization factors at RHO-points'
1476 IF (.not.ldiffer)
THEN
1486 cff=om_r(i,j)*on_r(i,j)
1488 vscale(i,j,k)=1.0_r8/sqrt(cff*hz(i,j,k))
1494 IF (
cnorm(ifile,is))
THEN
1500 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1501 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1502 IF (rmask(ic,jc).gt.0) compute=1.0_r8
1510 IF (compute.gt.0.0_r8)
THEN
1518 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1519 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1520 a3d(ic,jc,kc)=1.0_r8
1523 & lbi, ubi, lbj, ubj, &
1525 & imins, imaxs, jmins, jmaxs,&
1533# ifdef GEOPOTENTIAL_HCONV
1539 & rmask, umask, vmask, &
1546 a3d(i,j,k)=a3d(i,j,k)*vscale(i,j,k)
1555 my_dot=my_dot+a3d(i,j,k)*a3d(i,j,k)
1565 IF (
domain(ng)%SouthWest_Corner(tile).and. &
1566 &
domain(ng)%NorthEast_Corner(tile))
THEN
1585 cff=1.0_r8/sqrt(gdotp)
1591 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
1592 & ((istr.le.ic).and.(ic.le.iend)))
THEN
1595 vnormr(ic,jc,kc,ifile,ntrc)=cff
1598 vnormr(ic,jc,kc,ifile,itrc)=cff
1608 IF (
cnorm(ifile,is))
THEN
1610 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1611 & vnormr(:,:,:,ifile,itrc))
1614 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1617 & vnormr(:,:,:,ifile,itrc))
1620 SELECT CASE (
nrm(ifile,ng)%IOtype)
1623 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1625 &
nrm(ifile,ng)%ncid, &
1627 &
nrm(ifile,ng)%Rindex, &
1631 & vnormr(:,:,:,ifile,itrc))
1633# if defined PIO_LIB && defined DISTRIBUTE
1635 IF (
nrm(ifile,ng)%pioTrc(itrc)%dkind.eq. &
1642 & lbi, ubi, lbj, ubj, 1,
n(ng), &
1644 &
nrm(ifile,ng)%pioFile, &
1645 &
nrm(ifile,ng)%pioTrc(itrc), &
1646 &
nrm(ifile,ng)%Rindex, &
1651 & vnormr(:,:,:,ifile,itrc))
1655 & __line__, myfile))
RETURN
1662# ifdef ADJUST_BOUNDARY
1671 text=
'boundary conditions'
1683 ncname=
nrm(ifile,ng)%name
1684 nrm(ifile,ng)%Rindex=
nrm(ifile,ng)%Rindex+1
1685 nrm(ifile,ng)%Nrec=
nrm(ifile,ng)%Nrec+1
1691 SELECT CASE (
nrm(ifile,ng)%IOtype)
1695 & start = (/
nrm(ifile,ng)%Rindex/), &
1697 & ncid =
nrm(ifile,ng)%ncid, &
1700# if defined PIO_LIB && defined DISTRIBUTE
1704 & start = (/
nrm(ifile,ng)%Rindex/), &
1706 & piofile =
nrm(ifile,ng)%pioFile, &
1707 & piovar =
nrm(ifile,ng)%pioVar(
idtime)%vd)
1717 WRITE (
stdout,20) trim(text), &
1718 &
'2D normalization factors at RHO-points'
1729 IF (lconvolve(ibry))
THEN
1731 hscaleb(j)=1.0_r8/sqrt(on_r(i,j))
1738 IF (lconvolve(ibry))
THEN
1740 hscaleb(i)=1.0_r8/sqrt(om_r(i,j))
1746 bounded=lconvolve(ibry).and. &
1747 & ((jstr.le.ib).and.(ib.le.jend))
1750 bounded=lconvolve(ibry).and. &
1751 & ((istr.le.ib).and.(ib.le.iend))
1766 IF (compute.gt.0.0_r8)
THEN
1774 & lbi, ubi, lbj, ubj, &
1775 & imins, imaxs, jmins, jmaxs, &
1780 & pm, pn, pmon_u, pnom_v, &
1782 & rmask, umask, vmask, &
1790 b2d(j)=b2d(j)*hscaleb(j)
1794 b2d(i)=b2d(i)*hscaleb(i)
1800 b2d(j)=b2d(j)*hscaleb(j)
1804 b2d(i)=b2d(i)*hscaleb(i)
1810 & lbi, ubi, lbj, ubj, &
1811 & imins, imaxs, jmins, jmaxs, &
1816 & pm, pn, pmon_u, pnom_v, &
1818 & rmask, umask, vmask, &
1822 cff=1.0_r8/sqrt(b2d(ib))
1828 hnormrobc(ib,ibry)=cff
1833 & hnormrobc(:,ibry))
1836 & hnormrobc(lbij:,ibry))
1843 SELECT CASE (
nrm(ifile,ng)%IOtype)
1846 &
vname(1,ifield), &
1847 & hnormrobc(lbij:,:), &
1848 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
1849 & total = (/ijlen,4,1/), &
1850 & ncid =
nrm(ifile,ng)%ncid, &
1851 & varid =
nrm(ifile,ng)%Vid(ifield))
1853# if defined PIO_LIB && defined DISTRIBUTE
1856 &
vname(1,ifield), &
1857 & hnormrobc(lbij:,:), &
1858 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
1859 & total = (/ijlen,4,1/), &
1860 & piofile =
nrm(ifile,ng)%pioFile, &
1861 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
1873 WRITE (
stdout,20) trim(text), &
1874 &
'2D normalization factors at U-points'
1885 IF (lconvolve(ibry))
THEN
1887 hscaleb(j)=1.0_r8/sqrt(on_u(i,j))
1899 IF (lconvolve(ibry))
THEN
1901 hscaleb(i)=1.0_r8/sqrt(om_u(i,j))
1907 bounded=lconvolve(ibry).and. &
1908 & ((jstr.le.ib).and.(ib.le.jend))
1911 bounded=lconvolve(ibry).and. &
1912 & ((istr.le.ib).and.(ib.le.iend))
1927 IF (compute.gt.0.0_r8)
THEN
1935 & lbi, ubi, lbj, ubj, &
1936 & imins, imaxs, jmins, jmaxs, &
1941 & pm, pn, pmon_r, pnom_p, &
1951 b2d(j)=b2d(j)*hscaleb(j)
1955 b2d(i)=b2d(i)*hscaleb(i)
1961 b2d(j)=b2d(j)*hscaleb(j)
1965 b2d(i)=b2d(i)*hscaleb(i)
1971 & lbi, ubi, lbj, ubj, &
1972 & imins, imaxs, jmins, jmaxs, &
1977 & pm, pn, pmon_r, pnom_p, &
1983 cff=1.0_r8/sqrt(b2d(ib))
1989 hnormuobc(ib,ibry)=cff
1994 & hnormuobc(:,ibry))
1997 & hnormuobc(lbij:,ibry))
2004 SELECT CASE (
nrm(ifile,ng)%IOtype)
2007 &
vname(1,ifield), &
2008 & hnormuobc(lbij:,:), &
2009 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
2010 & total = (/ijlen,4,1/), &
2011 & ncid =
nrm(ifile,ng)%ncid, &
2012 & varid =
nrm(ifile,ng)%Vid(ifield))
2014# if defined PIO_LIB && defined DISTRIBUTE
2017 &
vname(1,ifield), &
2018 & hnormuobc(lbij:,:), &
2019 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
2020 & total = (/ijlen,4,1/), &
2021 & piofile =
nrm(ifile,ng)%pioFile, &
2022 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
2033 WRITE (
stdout,20) trim(text), &
2034 &
'2D normalization factors at V-points'
2050 IF (lconvolve(ibry))
THEN
2052 hscaleb(j)=1.0_r8/sqrt(on_v(i,j))
2059 IF (lconvolve(ibry))
THEN
2061 hscaleb(i)=1.0_r8/sqrt(om_v(i,j))
2067 bounded=lconvolve(ibry).and. &
2068 & ((jstr.le.ib).and.(ib.le.jend))
2071 bounded=lconvolve(ibry).and. &
2072 & ((istr.le.ib).and.(ib.le.iend))
2087 IF (compute.gt.0.0_r8)
THEN
2095 & lbi, ubi, lbj, ubj, &
2096 & imins, imaxs, jmins, jmaxs, &
2101 & pm, pn, pmon_p, pnom_r, &
2111 b2d(j)=b2d(j)*hscaleb(j)
2115 b2d(i)=b2d(i)*hscaleb(i)
2121 b2d(j)=b2d(j)*hscaleb(j)
2125 b2d(i)=b2d(i)*hscaleb(i)
2131 & lbi, ubi, lbj, ubj, &
2132 & imins, imaxs, jmins, jmaxs, &
2137 & pm, pn, pmon_p, pnom_r, &
2143 cff=1.0_r8/sqrt(b2d(ib))
2149 hnormvobc(ib,ibry)=cff
2154 & hnormvobc(:,ibry))
2157 & hnormvobc(lbij:,ibry))
2164 SELECT CASE (
nrm(ifile,ng)%IOtype)
2167 &
vname(1,ifield), &
2168 & hnormvobc(lbij:,:), &
2169 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
2170 & total = (/ijlen,4,1/), &
2171 & ncid =
nrm(ifile,ng)%ncid, &
2172 & varid =
nrm(ifile,ng)%Vid(ifield))
2174# if defined PIO_LIB && defined DISTRIBUTE
2177 &
vname(1,ifield), &
2178 & hnormvobc(lbij:,:), &
2179 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
2180 & total = (/ijlen,4,1/), &
2181 & piofile =
nrm(ifile,ng)%pioFile, &
2182 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
2195 WRITE (
stdout,20) trim(text), &
2196 &
'3D normalization factors at U-points'
2207 IF (lconvolve(ibry))
THEN
2209 cff=on_u(i,j)*0.5_r8
2211 vscaleb(j,k)=1.0_r8/ &
2212 & sqrt(cff*(hz(i-1,j,k)+hz(i,j,k)))
2225 IF (lconvolve(ibry))
THEN
2227 cff=om_u(i,j)*0.5_r8
2229 vscaleb(i,k)=1.0_r8/ &
2230 & sqrt(cff*(hz(i-1,j,k)+hz(i,j,k)))
2238 bounded=lconvolve(ibry).and. &
2239 & ((jstr.le.ib).and.(ib.le.jend))
2242 bounded=lconvolve(ibry).and. &
2243 & ((istr.le.ib).and.(ib.le.iend))
2258 IF (compute.gt.0.0_r8)
THEN
2266 & lbi, ubi, lbj, ubj, &
2268 & imins, imaxs, jmins, jmaxs,&
2275 & pm, pn, pmon_r, pnom_p, &
2287 b3d(j,k)=b3d(j,k)*vscaleb(j,k)
2293 b3d(i,k)=b3d(i,k)*vscaleb(i,k)
2301 b3d(j,k)=b3d(j,k)*vscaleb(j,k)
2307 b3d(i,k)=b3d(i,k)*vscaleb(i,k)
2314 & lbi, ubi, lbj, ubj, &
2316 & imins, imaxs, jmins, jmaxs,&
2323 & pm, pn, pmon_r, pnom_p, &
2330 cff=1.0_r8/sqrt(b3d(ib,kb))
2336 vnormuobc(ib,kb,ibry)=cff
2341 & lbij, ubij, 1,
n(ng), &
2342 & vnormuobc(:,:,ibry))
2344 bwrk=reshape(vnormuobc(:,:,ibry), (/ijklen/))
2350 vnormuobc(ib,k,ibry)=bwrk(ic)
2359 SELECT CASE (
nrm(ifile,ng)%IOtype)
2362 &
vname(1,ifield), &
2363 & vnormuobc(lbij:,:,:), &
2364 & start = (/1,1,1,
nrm(ifile,ng)%Rindex/), &
2365 & total = (/ijlen,
n(ng),4,1/), &
2366 & ncid =
nrm(ifile,ng)%ncid, &
2367 & varid =
nrm(ifile,ng)%Vid(ifield))
2369# if defined PIO_LIB && defined DISTRIBUTE
2372 &
vname(1,ifield), &
2373 & vnormuobc(lbij:,:,:), &
2374 & start = (/1,1,1,
nrm(ifile,ng)%Rindex/), &
2375 & total = (/ijlen,
n(ng),4,1/), &
2376 & piofile =
nrm(ifile,ng)%pioFile, &
2377 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
2388 WRITE (
stdout,20) trim(text), &
2389 &
'3D normalization factors at V-points'
2405 IF (lconvolve(ibry))
THEN
2407 cff=on_v(i,j)*0.5_r8
2409 vscaleb(j,k)=1.0_r8/ &
2410 & sqrt(cff*(hz(i,j-1,k)+hz(i,j,k)))
2418 IF (lconvolve(ibry))
THEN
2420 cff=om_v(i,j)*0.5_r8
2422 vscaleb(i,k)=1.0_r8/ &
2423 & sqrt(cff*(hz(i,j-1,k)+hz(i,j,k)))
2431 bounded=lconvolve(ibry).and. &
2432 & ((jstr.le.ib).and.(ib.le.jend))
2435 bounded=lconvolve(ibry).and. &
2436 & ((istr.le.ib).and.(ib.le.iend))
2451 IF (compute.gt.0.0_r8)
THEN
2459 & lbi, ubi, lbj, ubj, &
2461 & imins, imaxs, jmins, jmaxs,&
2468 & pm, pn, pmon_p, pnom_r, &
2480 b3d(j,k)=b3d(j,k)*vscaleb(j,k)
2486 b3d(i,k)=b3d(i,k)*vscaleb(i,k)
2494 b3d(j,k)=b3d(j,k)*vscaleb(j,k)
2500 b3d(i,k)=b3d(i,k)*vscaleb(i,k)
2507 & lbi, ubi, lbj, ubj, &
2509 & imins, imaxs, jmins, jmaxs,&
2516 & pm, pn, pmon_p, pnom_r, &
2523 cff=1.0_r8/sqrt(b3d(ib,kb))
2529 vnormvobc(ib,kb,ibry)=cff
2534 & lbij, ubij, 1,
n(ng), &
2535 & vnormvobc(:,:,ibry))
2537 bwrk=reshape(vnormvobc(:,:,ibry), (/ijklen/))
2543 vnormvobc(ib,k,ibry)=bwrk(ic)
2552 SELECT CASE (
nrm(ifile,ng)%IOtype)
2555 &
vname(1,ifield), &
2556 & vnormvobc(lbij:,:,:), &
2557 & start = (/1,1,1,
nrm(ifile,ng)%Rindex/), &
2558 & total = (/ijlen,
n(ng),4,1/), &
2559 & ncid =
nrm(ifile,ng)%ncid, &
2560 & varid =
nrm(ifile,ng)%Vid(ifield))
2562# if defined PIO_LIB && defined DISTRIBUTE
2565 &
vname(1,ifield), &
2566 & vnormvobc(lbij:,:,:), &
2567 & start = (/1,1,1,
nrm(ifile,ng)%Rindex/), &
2568 & total = (/ijlen,
n(ng),4,1/), &
2569 & piofile =
nrm(ifile,ng)%pioFile, &
2570 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
2581 IF (any(
cnormb(is,:)))
THEN
2587 WRITE (
stdout,20) trim(text), &
2588 &
'3D normalization factors at RHO-points'
2598 IF (
cnormb(is,ibry))
THEN
2603 IF (lconvolve(ibry))
THEN
2607 vscaleb(j,k)=1.0_r8/sqrt(cff*hz(i,j,k))
2615 IF (lconvolve(ibry))
THEN
2619 vscaleb(i,k)=1.0_r8/sqrt(cff*hz(i,j,k))
2627 bounded=lconvolve(ibry).and. &
2628 & ((jstr.le.ib).and.(ib.le.jend))
2631 bounded=lconvolve(ibry).and. &
2632 & ((istr.le.ib).and.(ib.le.iend))
2647 IF (compute.gt.0.0_r8)
THEN
2656 & lbi, ubi, lbj, ubj, &
2666 & pm, pn, pmon_u, pnom_v, &
2668 & rmask, umask, vmask, &
2678 b3d(j,k)=b3d(j,k)*vscaleb(j,k)
2684 b3d(i,k)=b3d(i,k)*vscaleb(i,k)
2691 b3d(j,k)=b3d(j,k)*vscaleb(j,k)
2697 b3d(i,k)=b3d(i,k)*vscaleb(i,k)
2705 & lbi, ubi, lbj, ubj, &
2715 & pm, pn, pmon_u, pnom_v, &
2717 & rmask, umask, vmask, &
2722 cff=1.0_r8/sqrt(b3d(ib,kb))
2728 vnormrobc(ib,kb,ibry,itrc)=cff
2733 & lbij, ubij, 1,
n(ng), &
2734 & vnormrobc(:,:,ibry,itrc))
2736 bwrk=reshape(vnormrobc(:,:,ibry,itrc), (/ijklen/))
2742 vnormrobc(ib,k,ibry,itrc)=bwrk(ic)
2748 IF (any(
cnormb(is,:)))
THEN
2751 SELECT CASE (
nrm(ifile,ng)%IOtype)
2754 &
vname(1,ifield), &
2755 & vnormrobc(lbij:,:,:,itrc), &
2756 & start =(/1,1,1,
nrm(ifile,ng)%Rindex/), &
2757 & total = (/ijlen,
n(ng),4,1/), &
2758 & ncid =
nrm(ifile,ng)%ncid, &
2759 & varid =
nrm(ifile,ng)%Vid(ifield))
2761# if defined PIO_LIB && defined DISTRIBUTE
2764 &
vname(1,ifield), &
2765 & vnormrobc(lbij:,:,:,itrc), &
2766 & start =(/1,1,1,
nrm(ifile,ng)%Rindex/), &
2767 & total = (/ijlen,
n(ng),4,1/), &
2768 & piofile =
nrm(ifile,ng)%pioFile, &
2769 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
2781 SELECT CASE (
nrm(ifile,ng)%IOtype)
2784 &
nrm(ifile,ng)%ncid)
2785# if defined PIO_LIB && defined DISTRIBUTE
2788 &
nrm(ifile,ng)%pioFile)
2795# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
2805 text=
'surface forcing'
2809 ncname=
nrm(ifile,ng)%name
2810 nrm(ifile,ng)%Rindex=
nrm(ifile,ng)%Rindex+1
2811 nrm(ifile,ng)%Nrec=
nrm(ifile,ng)%Nrec+1
2817 SELECT CASE (
nrm(ifile,ng)%IOtype)
2821 & start = (/
nrm(ifile,ng)%Rindex/), &
2823 & ncid =
nrm(ifile,ng)%ncid, &
2826# if defined PIO_LIB && defined DISTRIBUTE
2830 & start = (/
nrm(ifile,ng)%Rindex/), &
2832 & piofile =
nrm(ifile,ng)%pioFile, &
2833 & piovar =
nrm(ifile,ng)%pioVar(
idtime)%vd)
2838# ifdef ADJUST_WSTRESS
2855 WRITE (
stdout,20) trim(text), &
2856 &
'2D normalization factors at U-stress points'
2861 hscale(i,j)=1.0_r8/sqrt(om_u(i,j)*on_u(i,j))
2868 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
2869 & ((istr.le.ic).and.(ic.le.iend)))
THEN
2870 IF (umask(ic,jc).gt.0) compute=1.0_r8
2878 IF (compute.gt.0.0_r8)
THEN
2884 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
2885 & ((istr.le.ic).and.(ic.le.iend)))
THEN
2889 & lbi, ubi, lbj, ubj, &
2890 & imins, imaxs, jmins, jmaxs, &
2895 & pm, pn, pmon_r, pnom_p, &
2902 a2d(i,j)=a2d(i,j)*hscale(i,j)
2909 my_dot=my_dot+a2d(i,j)*a2d(i,j)
2918 IF (
domain(ng)%SouthWest_Corner(tile).and. &
2919 &
domain(ng)%NorthEast_Corner(tile))
THEN
2938 cff=1.0_r8/sqrt(gdotp)
2944 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
2945 & ((istr.le.ic).and.(ic.le.iend)))
THEN
2951 & lbi, ubi, lbj, ubj, &
2955 & lbi, ubi, lbj, ubj, &
2961 SELECT CASE (
nrm(ifile,ng)%IOtype)
2964 & lbi, ubi, lbj, ubj,
idusms, &
2965 &
nrm(ifile,ng)%ncid, &
2967 &
nrm(ifile,ng)%Rindex, &
2973# if defined PIO_LIB && defined DISTRIBUTE
2975 IF (
nrm(ifile,ng)%pioVar(
idusms)%dkind.eq. &
2982 & lbi, ubi, lbj, ubj,
idusms, &
2983 &
nrm(ifile,ng)%pioFile, &
2985 &
nrm(ifile,ng)%Rindex, &
3011 WRITE (
stdout,20) trim(text), &
3012 &
'2D normalization factors at V-stress points'
3017 hscale(i,j)=1.0_r8/sqrt(om_v(i,j)*on_v(i,j))
3024 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
3025 & ((istr.le.ic).and.(ic.le.iend)))
THEN
3026 IF (vmask(ic,jc).gt.0) compute=1.0_r8
3034 IF (compute.gt.0.0_r8)
THEN
3040 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
3041 & ((istr.le.ic).and.(ic.le.iend)))
THEN
3045 & lbi, ubi, lbj, ubj, &
3046 & imins, imaxs, jmins, jmaxs, &
3051 & pm, pn, pmon_p, pnom_r, &
3058 a2d(i,j)=a2d(i,j)*hscale(i,j)
3065 my_dot=my_dot+a2d(i,j)*a2d(i,j)
3074 IF (
domain(ng)%SouthWest_Corner(tile).and. &
3075 &
domain(ng)%NorthEast_Corner(tile))
THEN
3094 cff=1.0_r8/sqrt(gdotp)
3100 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
3101 & ((istr.le.ic).and.(ic.le.iend)))
THEN
3107 & lbi, ubi, lbj, ubj, &
3111 & lbi, ubi, lbj, ubj, &
3117 SELECT CASE (
nrm(ifile,ng)%IOtype)
3120 & lbi, ubi, lbj, ubj,
idvsms, &
3121 &
nrm(ifile,ng)%ncid, &
3123 &
nrm(ifile,ng)%Rindex, &
3129# if defined PIO_LIB && defined DISTRIBUTE
3131 IF (
nrm(ifile,ng)%pioVar(
idvsms)%dkind.eq. &
3138 & lbi, ubi, lbj, ubj,
idvsms, &
3139 &
nrm(ifile,ng)%pioFile, &
3141 &
nrm(ifile,ng)%Rindex, &
3152# if defined ADJUST_STFLUX && defined SOLVE3D
3161 IF (
cnorm(rec,is)) lsame=.true.
3165 WRITE (
stdout,20) trim(text), &
3166 '2D normalization factors at RHO-points'
3187 IF (.not.ldiffer)
THEN
3197 hscale(i,j)=1.0_r8/sqrt(om_r(i,j)*on_r(i,j))
3203 IF (
cnorm(rec,is))
THEN
3208 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
3209 & ((istr.le.ic).and.(ic.le.iend)))
THEN
3210 IF (rmask(ic,jc).gt.0) compute=1.0_r8
3218 IF (compute.gt.0.0_r8)
THEN
3224 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
3225 & ((istr.le.ic).and.(ic.le.iend)))
THEN
3229 & lbi, ubi, lbj, ubj, &
3230 & imins, imaxs, jmins, jmaxs, &
3235 & pm, pn, pmon_u, pnom_v, &
3237 & rmask, umask, vmask, &
3242 a2d(i,j)=a2d(i,j)*hscale(i,j)
3248 my_dot=my_dot+a2d(i,j)*a2d(i,j)
3257 IF (
domain(ng)%SouthWest_Corner(tile).and. &
3258 &
domain(ng)%NorthEast_Corner(tile))
THEN
3277 cff=1.0_r8/sqrt(gdotp)
3283 IF (((jstr.le.jc).and.(jc.le.jend)).and. &
3284 & ((istr.le.ic).and.(ic.le.iend)))
THEN
3288 hnormstf(ic,jc,ntrc)=cff
3292 hnormstf(ic,jc,itrc)=cff
3303 IF (
cnorm(rec,is))
THEN
3305 & lbi, ubi, lbj, ubj, &
3306 & hnormstf(:,:,itrc))
3309 & lbi, ubi, lbj, ubj, &
3312 & hnormstf(:,:,itrc))
3315 SELECT CASE (
nrm(ifile,ng)%IOtype)
3318 & lbi, ubi, lbj, ubj, &
3320 &
nrm(ifile,ng)%ncid, &
3322 &
nrm(ifile,ng)%Rindex, &
3326 & hnormstf(:,:,itrc))
3328# if defined PIO_LIB && defined DISTRIBUTE
3330 IF (
nrm(ifile,ng)%pioVar(
idtsur(itrc))%dkind.eq. &
3337 & lbi, ubi, lbj, ubj, &
3339 &
nrm(ifile,ng)%pioFile, &
3341 &
nrm(ifile,ng)%Rindex, &
3346 & hnormstf(:,:,itrc))
3350 & __line__, myfile))
RETURN
3362 10
FORMAT (/,
' Error Covariance Normalization Factors: ', &
3364 20
FORMAT (4x,
'Computing',1x,a,1x,a)
3373 & LBi, UBi, LBj, UBj, LBij, UBij, &
3374 & IminS, ImaxS, JminS, JmaxS, &
3375 & nstp, nnew, ifac, &
3376 & pm, om_p, om_r, om_u, om_v, &
3377 & pn, on_p, on_r, on_u, on_v, &
3378 & pmon_p, pmon_r, pmon_u, &
3379 & pnom_p, pnom_r, pnom_v, &
3389# if defined SEDIMENT && defined SED_MORPH
3398# ifdef ADJUST_BOUNDARY
3400 & VnormRobc, VnormUobc, VnormVobc, &
3402 & HnormRobc, HnormUobc, HnormVobc, &
3404# ifdef ADJUST_WSTRESS
3405 & HnormSUS, HnormSVS, &
3407# if defined ADJUST_STFLUX && defined SOLVE3D
3411 & VnormR, VnormU, VnormV, &
3413 & HnormR, HnormU, HnormV)
3418 integer,
intent(in) :: ng, tile
3419 integer,
intent(in) :: lbi, ubi, lbj, ubj, lbij, ubij
3420 integer,
intent(in) :: imins, imaxs, jmins, jmaxs
3421 integer,
intent(in) ::
nstp,
nnew, ifac
3423# ifdef ASSUMED_SHAPE
3424 real(
r8),
intent(in) :: pm(lbi:,lbj:)
3425 real(
r8),
intent(in) :: om_p(lbi:,lbj:)
3426 real(
r8),
intent(in) :: om_r(lbi:,lbj:)
3427 real(
r8),
intent(in) :: om_u(lbi:,lbj:)
3428 real(
r8),
intent(in) :: om_v(lbi:,lbj:)
3429 real(
r8),
intent(in) :: pn(lbi:,lbj:)
3430 real(
r8),
intent(in) :: on_p(lbi:,lbj:)
3431 real(
r8),
intent(in) :: on_r(lbi:,lbj:)
3432 real(
r8),
intent(in) :: on_u(lbi:,lbj:)
3433 real(
r8),
intent(in) :: on_v(lbi:,lbj:)
3434 real(
r8),
intent(in) :: pmon_p(lbi:,lbj:)
3435 real(
r8),
intent(in) :: pmon_r(lbi:,lbj:)
3436 real(
r8),
intent(in) :: pmon_u(lbi:,lbj:)
3437 real(
r8),
intent(in) :: pnom_p(lbi:,lbj:)
3438 real(
r8),
intent(in) :: pnom_r(lbi:,lbj:)
3439 real(
r8),
intent(in) :: pnom_v(lbi:,lbj:)
3441 real(
r8),
intent(in) :: pmask(lbi:,lbj:)
3442 real(
r8),
intent(in) :: rmask(lbi:,lbj:)
3443 real(
r8),
intent(in) :: umask(lbi:,lbj:)
3444 real(
r8),
intent(in) :: vmask(lbi:,lbj:)
3446 real(
r8),
intent(in) :: kh(lbi:,lbj:)
3448 real(
r8),
intent(in) :: kv(lbi:,lbj:,0:)
3450 real(
r8),
intent(in) :: zice(lbi:,lbj:)
3452# if defined SEDIMENT && defined SED_MORPH
3453 real(
r8),
intent(in):: bed_thick(lbi:,lbj:,:)
3455 real(
r8),
intent(inout) :: h(lbi:,lbj:)
3457# ifdef ADJUST_BOUNDARY
3459 real(
r8),
intent(out) :: vnormrobc(lbij:,:,:,:)
3460 real(
r8),
intent(out) :: vnormuobc(lbij:,:,:)
3461 real(
r8),
intent(out) :: vnormvobc(lbij:,:,:)
3463 real(
r8),
intent(out) :: hnormrobc(lbij:,:)
3464 real(
r8),
intent(out) :: hnormuobc(lbij:,:)
3465 real(
r8),
intent(out) :: hnormvobc(lbij:,:)
3467# ifdef ADJUST_WSTRESS
3468 real(
r8),
intent(out) :: hnormsus(lbi:,lbj:)
3469 real(
r8),
intent(out) :: hnormsvs(lbi:,lbj:)
3471# if defined ADJUST_STFLUX && defined SOLVE3D
3472 real(
r8),
intent(out) :: hnormstf(lbi:,lbj:,:)
3475 real(
r8),
intent(out) :: vnormr(lbi:,lbj:,:,:,:)
3476 real(
r8),
intent(out) :: vnormu(lbi:,lbj:,:,:)
3477 real(
r8),
intent(out) :: vnormv(lbi:,lbj:,:,:)
3479 real(
r8),
intent(out) :: hnormr(lbi:,lbj:,:)
3480 real(
r8),
intent(out) :: hnormu(lbi:,lbj:,:)
3481 real(
r8),
intent(out) :: hnormv(lbi:,lbj:,:)
3483 real(
r8),
intent(out) :: hz(lbi:,lbj:,:)
3484 real(
r8),
intent(out) :: z_r(lbi:,lbj:,:)
3485 real(
r8),
intent(out) :: z_w(lbi:,lbj:,0:)
3488 real(
r8),
intent(in) :: pm(lbi:ubi,lbj:ubj)
3489 real(
r8),
intent(in) :: om_p(lbi:ubi,lbj:ubj)
3490 real(
r8),
intent(in) :: om_r(lbi:ubi,lbj:ubj)
3491 real(
r8),
intent(in) :: om_u(lbi:ubi,lbj:ubj)
3492 real(
r8),
intent(in) :: om_v(lbi:ubi,lbj:ubj)
3493 real(
r8),
intent(in) :: pn(lbi:ubi,lbj:ubj)
3494 real(
r8),
intent(in) :: on_p(lbi:ubi,lbj:ubj)
3495 real(
r8),
intent(in) :: on_r(lbi:ubi,lbj:ubj)
3496 real(
r8),
intent(in) :: on_u(lbi:ubi,lbj:ubj)
3497 real(
r8),
intent(in) :: on_v(lbi:ubi,lbj:ubj)
3498 real(
r8),
intent(in) :: pmon_p(lbi:ubi,lbj:ubj)
3499 real(
r8),
intent(in) :: pmon_r(lbi:ubi,lbj:ubj)
3500 real(
r8),
intent(in) :: pmon_u(lbi:ubi,lbj:ubj)
3501 real(
r8),
intent(in) :: pnom_p(lbi:ubi,lbj:ubj)
3502 real(
r8),
intent(in) :: pnom_r(lbi:ubi,lbj:ubj)
3503 real(
r8),
intent(in) :: pnom_v(lbi:ubi,lbj:ubj)
3505 real(
r8),
intent(in) :: pmask(lbi:ubi,lbj:ubj)
3506 real(
r8),
intent(in) :: rmask(lbi:ubi,lbj:ubj)
3507 real(
r8),
intent(in) :: umask(lbi:ubi,lbj:ubj)
3508 real(
r8),
intent(in) :: vmask(lbi:ubi,lbj:ubj)
3510 real(
r8),
intent(in) :: kh(lbi:ubi,lbj:ubj)
3512 real(
r8),
intent(in) :: kv(lbi:ubi,lbj:ubj,0:
n(ng))
3514 real(
r8),
intent(in) :: zice(lbi:ubi,lbj:ubj)
3516# if defined SEDIMENT && defined SED_MORPH
3517 real(
r8),
intent(in):: bed_thick(lbi:ubi,lbj:ubj,3)
3519 real(
r8),
intent(inout) :: h(lbi:ubi,lbj:ubj)
3521# ifdef ADJUST_BOUNDARY
3523 real(
r8),
intent(out) :: vnormrobc(lbij:ubij,
n(ng),4,
nt(ng))
3524 real(
r8),
intent(out) :: vnormuobc(lbij:ubij,
n(ng),4)
3525 real(
r8),
intent(out) :: vnormvobc(lbij:ubij,
n(ng),4)
3527 real(
r8),
intent(out) :: hnormrobc(lbij:ubij,4)
3528 real(
r8),
intent(out) :: hnormuobc(lbij:ubij,4)
3529 real(
r8),
intent(out) :: hnormvobc(lbij:ubij,4)
3531# ifdef ADJUST_WSTRESS
3532 real(
r8),
intent(out) :: hnormsus(lbi:ubi,lbj:ubj)
3533 real(
r8),
intent(out) :: hnormsvs(lbi:ubi,lbj:ubj)
3535# if defined ADJUST_STFLUX && defined SOLVE3D
3536 real(
r8),
intent(out) :: hnormstf(lbi:ubi,lbj:ubj,
nt(ng))
3539 real(
r8),
intent(out) :: vnormr(lbi:ubi,lbj:ubj,
n(ng),
nsa,
nt(ng))
3540 real(
r8),
intent(out) :: vnormu(lbi:ubi,lbj:ubj,
n(ng),
nsa)
3541 real(
r8),
intent(out) :: vnormv(lbi:ubi,lbj:ubj,
n(ng),
nsa)
3543 real(
r8),
intent(out) :: hnormr(lbi:ubi,lbj:ubj,
nsa)
3544 real(
r8),
intent(out) :: hnormu(lbi:ubi,lbj:ubj,
nsa)
3545 real(
r8),
intent(out) :: hnormv(lbi:ubi,lbj:ubj,
nsa)
3547 real(
r8),
intent(out) :: hz(lbi:ubi,lbj:ubj,
n(ng))
3548 real(
r8),
intent(out) :: z_r(lbi:ubi,lbj:ubj,
n(ng))
3549 real(
r8),
intent(out) :: z_w(lbi:ubi,lbj:ubj,0:
n(ng))
3556 logical :: ldiffer, lsame
3558# ifdef ADJUST_BOUNDARY
3559 logical :: lconvolve(4)
3562 integer :: i, ifile, is, iter, j, rec
3564 integer :: ubt, itrc, k
3566# ifdef ADJUST_BOUNDARY
3567 integer :: ijlen, ijklen, ib, ibry, ic, ifield
3569 integer :: start(4), total(4)
3572 real(
r8) :: aavg, amax, amin, asqr, facavg, facsqr
3573 real(
r8) :: cff, val
3575# ifdef ADJUST_BOUNDARY
3576 real(
r8) :: bavg, bmin, bmax, bsqr
3578 real(
r8),
parameter :: aspv = 0.0_r8
3581 real(
r8),
dimension(LBi:UBi,LBj:UBj) :: a2d
3582 real(
r8),
dimension(LBi:UBi,LBj:UBj) :: a2davg
3583 real(
r8),
dimension(LBi:UBi,LBj:UBj) :: a2dsqr
3584 real(
r8),
dimension(LBi:UBi,LBj:UBj) :: hscale
3585# ifdef ADJUST_BOUNDARY
3586 real(
r8),
dimension(LBij:UBij) :: b2d
3587 real(
r8),
dimension(LBij:UBij) :: b2davg
3588 real(
r8),
dimension(LBij:UBij) :: b2dsqr
3589 real(
r8),
dimension(LBij:UBij) :: hscaleb
3592 real(
r8),
dimension(LBi:UBi,LBj:UBj,1:N(ng)) :: a3d
3593 real(
r8),
dimension(LBi:UBi,LBj:UBj,1:N(ng)) :: a3davg
3594 real(
r8),
dimension(LBi:UBi,LBj:UBj,1:N(ng)) :: a3dsqr
3595 real(
r8),
dimension(LBi:UBi,LBj:UBj,1:N(ng)) :: vscale
3596# ifdef ADJUST_BOUNDARY
3597 real(
r8),
dimension(LBij:UBij,1:N(ng)) :: b3d
3598 real(
r8),
dimension(LBij:UBij,1:N(ng)) :: b3davg
3599 real(
r8),
dimension(LBij:UBij,1:N(ng)) :: b3dsqr
3600 real(
r8),
dimension(LBij:UBij,1:N(ng)) :: vscaleb
3602 real(
r8),
dimension((UBij-LBij+1)*N(ng)) :: bwrk
3607 character (len=40 ) :: text
3608 character (len=256) :: ncname
3610 character (len=*),
parameter :: myfile = &
3611 & __FILE__//
", randomization_tile"
3613# if defined PIO_LIB && defined DISTRIBUTE
3615 TYPE (io_desc_t),
pointer :: iodesc
3618# include "set_bounds.h"
3637 & lbi, ubi, lbj, ubj, &
3638 & imins, imaxs, jmins, jmaxs, &
3644# if defined SEDIMENT && defined SED_MORPH
3668 file_loop :
DO ifile=1,
nsa
3671 IF (ifile.eq.1)
THEN
3672 text=
'initial conditions'
3673 ELSE IF (ifile.eq.2)
THEN
3684 ncname=
nrm(ifile,ng)%name
3685 nrm(ifile,ng)%Rindex=
nrm(ifile,ng)%Rindex+1
3686 nrm(ifile,ng)%Nrec=
nrm(ifile,ng)%Nrec+1
3690 SELECT CASE (
nrm(ifile,ng)%IOtype)
3694 & start = (/
nrm(ifile,ng)%Rindex/), &
3696 & ncid =
nrm(ifile,ng)%ncid, &
3698# if defined PIO_LIB && defined DISTRIBUTE
3702 & start = (/
nrm(ifile,ng)%Rindex/), &
3704 & piofile =
nrm(ifile,ng)%pioFile, &
3705 & piovar =
nrm(ifile,ng)%pioVar(
idtime)%vd)
3714 WRITE (
stdout,20) trim(text), &
3715 &
'2D normalization factors at RHO-points'
3722 hscale(i,j)=1.0_r8/sqrt(om_r(i,j)*on_r(i,j))
3727 & istrr, iendr, jstrr, jendr, &
3728 & lbi, ubi, lbj, ubj, &
3732 a2d(i,j)=a2d(i,j)*hscale(i,j)
3736 & lbi, ubi, lbj, ubj, &
3737 & imins, imaxs, jmins, jmaxs, &
3742 & pm, pn, pmon_u, pnom_v, &
3744 & rmask, umask, vmask, &
3749 a2davg(i,j)=a2davg(i,j)+a2d(i,j)
3750 a2dsqr(i,j)=a2dsqr(i,j)+a2d(i,j)*a2d(i,j)
3756 aavg=facavg*a2davg(i,j)
3757 asqr=facavg*a2dsqr(i,j)
3759 IF (rmask(i,j).gt.0.0_r8)
THEN
3760 hnormr(i,j,ifile)=1.0_r8/sqrt(asqr)
3762 hnormr(i,j,ifile)=0.0_r8
3765 hnormr(i,j,ifile)=1.0_r8/sqrt(asqr)
3770 & lbi, ubi, lbj, ubj, &
3771 & hnormr(:,:,ifile))
3774 & lbi, ubi, lbj, ubj, &
3777 & hnormr(:,:,ifile))
3780 SELECT CASE (
nrm(ifile,ng)%IOtype)
3783 & lbi, ubi, lbj, ubj,
idfsur, &
3784 &
nrm(ifile,ng)%ncid, &
3786 &
nrm(ifile,ng)%Rindex, &
3790 & hnormr(:,:,ifile))
3792# if defined PIO_LIB && defined DISTRIBUTE
3794 IF (
nrm(ifile,ng)%pioVar(
idfsur)%dkind.eq. &
3801 & lbi, ubi, lbj, ubj,
idfsur, &
3802 &
nrm(ifile,ng)%pioFile, &
3804 &
nrm(ifile,ng)%Rindex, &
3809 & hnormr(:,:,ifile))
3819 WRITE (
stdout,20) trim(text), &
3820 &
'2D normalization factors at U-points'
3827 hscale(i,j)=1.0_r8/sqrt(om_u(i,j)*on_u(i,j))
3832 & istr, iendr, jstrr, jendr, &
3833 & lbi, ubi, lbj, ubj, &
3837 a2d(i,j)=a2d(i,j)*hscale(i,j)
3841 & lbi, ubi, lbj, ubj, &
3842 & imins, imaxs, jmins, jmaxs, &
3847 & pm, pn, pmon_r, pnom_p, &
3854 a2davg(i,j)=a2davg(i,j)+a2d(i,j)
3855 a2dsqr(i,j)=a2dsqr(i,j)+a2d(i,j)*a2d(i,j)
3861 aavg=facavg*a2davg(i,j)
3862 asqr=facavg*a2dsqr(i,j)
3864 IF (umask(i,j).gt.0.0_r8)
THEN
3865 hnormu(i,j,ifile)=1.0_r8/sqrt(asqr)
3867 hnormu(i,j,ifile)=0.0_r8
3870 hnormu(i,j,ifile)=1.0_r8/sqrt(asqr)
3875 & lbi, ubi, lbj, ubj, &
3876 & hnormu(:,:,ifile))
3879 & lbi, ubi, lbj, ubj, &
3882 & hnormu(:,:,ifile))
3885 SELECT CASE (
nrm(ifile,ng)%IOtype)
3888 & lbi, ubi, lbj, ubj,
idubar, &
3889 &
nrm(ifile,ng)%ncid, &
3891 &
nrm(ifile,ng)%Rindex, &
3895 & hnormu(:,:,ifile))
3897# if defined PIO_LIB && defined DISTRIBUTE
3899 IF (
nrm(ifile,ng)%pioVar(
idubar)%dkind.eq. &
3906 & lbi, ubi, lbj, ubj,
idubar, &
3907 &
nrm(ifile,ng)%pioFile, &
3909 &
nrm(ifile,ng)%Rindex, &
3914 & hnormu(:,:,ifile))
3924 WRITE (
stdout,20) trim(text), &
3925 &
'2D normalization factors at V-points'
3932 hscale(i,j)=1.0_r8/sqrt(om_v(i,j)*on_v(i,j))
3937 & istrr, iendr, jstr, jendr, &
3938 & lbi, ubi, lbj, ubj, &
3942 a2d(i,j)=a2d(i,j)*hscale(i,j)
3946 & lbi, ubi, lbj, ubj, &
3947 & imins, imaxs, jmins, jmaxs, &
3952 & pm, pn, pmon_p, pnom_r, &
3959 a2davg(i,j)=a2davg(i,j)+a2d(i,j)
3960 a2dsqr(i,j)=a2dsqr(i,j)+a2d(i,j)*a2d(i,j)
3966 aavg=facavg*a2davg(i,j)
3967 asqr=facavg*a2dsqr(i,j)
3969 IF (vmask(i,j).gt.0.0_r8)
THEN
3970 hnormv(i,j,ifile)=1.0_r8/sqrt(asqr)
3972 hnormv(i,j,ifile)=0.0_r8
3975 hnormv(i,j,ifile)=1.0_r8/sqrt(asqr)
3980 & lbi, ubi, lbj, ubj, &
3981 & hnormv(:,:,ifile))
3984 & lbi, ubi, lbj, ubj, &
3987 & hnormv(:,:,ifile))
3990 SELECT CASE (
nrm(ifile,ng)%IOtype)
3993 & lbi, ubi, lbj, ubj,
idvbar, &
3994 &
nrm(ifile,ng)%ncid, &
3996 &
nrm(ifile,ng)%Rindex, &
4000 & hnormv(:,:,ifile))
4002# if defined PIO_LIB && defined DISTRIBUTE
4004 IF (
nrm(ifile,ng)%pioVar(
idvbar)%dkind.eq. &
4011 & lbi, ubi, lbj, ubj,
idvbar, &
4012 &
nrm(ifile,ng)%pioFile, &
4014 &
nrm(ifile,ng)%Rindex, &
4019 & hnormv(:,:,ifile))
4031 WRITE (
stdout,20) trim(text), &
4032 &
'3D normalization factors at U-points'
4037 val=om_u(i,j)*on_u(i,j)*0.5_r8
4039 a3davg(i,j,k)=0.0_r8
4040 a3dsqr(i,j,k)=0.0_r8
4041 vscale(i,j,k)=1.0_r8/sqrt(val*(hz(i-1,j,k)+hz(i,j,k)))
4047 & istr, iendr, jstrr, jendr, &
4048 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4053 a3d(i,j,k)=a3d(i,j,k)*vscale(i,j,k)
4058 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4059 & imins, imaxs, jmins, jmaxs, &
4067# ifdef GEOPOTENTIAL_HCONV
4073# ifdef GEOPOTENTIAL_HCONV
4074 & pmask, rmask, umask, vmask, &
4084 a3davg(i,j,k)=a3davg(i,j,k)+a3d(i,j,k)
4085 a3dsqr(i,j,k)=a3dsqr(i,j,k)+a3d(i,j,k)*a3d(i,j,k)
4093 aavg=facavg*a3davg(i,j,k)
4094 asqr=facavg*a3dsqr(i,j,k)
4096 IF (umask(i,j).gt.0.0_r8)
THEN
4097 vnormu(i,j,k,ifile)=1.0_r8/sqrt(asqr)
4099 vnormu(i,j,k,ifile)=0.0_r8
4102 vnormu(i,j,k,ifile)=1.0_r8/sqrt(asqr)
4108 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4109 & vnormu(:,:,:,ifile))
4112 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4115 & vnormu(:,:,:,ifile))
4118 SELECT CASE (
nrm(ifile,ng)%IOtype)
4121 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4124 &
nrm(ifile,ng)%Rindex, &
4128 & vnormu(:,:,:,ifile))
4130# if defined PIO_LIB && defined DISTRIBUTE
4132 IF (
nrm(ifile,ng)%pioVar(
iduvel)%dkind.eq. &
4139 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4142 &
nrm(ifile,ng)%Rindex, &
4147 & vnormu(:,:,:,ifile))
4157 WRITE (
stdout,20) trim(text), &
4158 &
'3D normalization factors at V-points'
4163 val=om_v(i,j)*on_v(i,j)*0.5_r8
4165 a3davg(i,j,k)=0.0_r8
4166 a3dsqr(i,j,k)=0.0_r8
4167 vscale(i,j,k)=1.0_r8/sqrt(val*(hz(i,j-1,k)+hz(i,j,k)))
4173 & istrr, iendr, jstr, jendr, &
4174 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4179 a3d(i,j,k)=a3d(i,j,k)*vscale(i,j,k)
4184 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4185 & imins, imaxs, jmins, jmaxs, &
4193# ifdef GEOPOTENTIAL_HCONV
4199# ifdef GEOPOTENTIAL_HCONV
4200 & pmask, rmask, umask, vmask, &
4210 a3davg(i,j,k)=a3davg(i,j,k)+a3d(i,j,k)
4211 a3dsqr(i,j,k)=a3dsqr(i,j,k)+a3d(i,j,k)*a3d(i,j,k)
4219 aavg=facavg*a3davg(i,j,k)
4220 asqr=facavg*a3dsqr(i,j,k)
4222 IF (vmask(i,j).gt.0.0_r8)
THEN
4223 vnormv(i,j,k,ifile)=1.0_r8/sqrt(asqr)
4225 vnormv(i,j,k,ifile)=0.0_r8
4228 vnormv(i,j,k,ifile)=1.0_r8/sqrt(asqr)
4234 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4235 & vnormv(:,:,:,ifile))
4238 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4241 & vnormv(:,:,:,ifile))
4244 SELECT CASE (
nrm(ifile,ng)%IOtype)
4247 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4250 &
nrm(ifile,ng)%Rindex, &
4254 & vnormv(:,:,:,ifile))
4256# if defined PIO_LIB && defined DISTRIBUTE
4258 IF (
nrm(ifile,ng)%pioVar(
idvvel)%dkind.eq. &
4265 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4268 &
nrm(ifile,ng)%Rindex, &
4273 & vnormv(:,:,:,ifile))
4285 IF (
cnorm(ifile,is)) lsame=.true.
4288 WRITE (
stdout,20) trim(text), &
4289 &
'3D normalization factors at RHO-points'
4308 IF (.not.ldiffer)
THEN
4318 val=om_r(i,j)*on_r(i,j)
4320 vscale(i,j,k)=1.0_r8/sqrt(val*hz(i,j,k))
4326 IF (
cnorm(ifile,is))
THEN
4330 a3davg(i,j,k)=0.0_r8
4331 a3dsqr(i,j,k)=0.0_r8
4337 & istrr, iendr, jstrr, jendr, &
4338 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4343 a3d(i,j,k)=a3d(i,j,k)*vscale(i,j,k)
4348 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4349 & imins, imaxs, jmins, jmaxs, &
4357# ifdef GEOPOTENTIAL_HCONV
4363 & rmask, umask, vmask, &
4370 a3davg(i,j,k)=a3davg(i,j,k)+a3d(i,j,k)
4371 a3dsqr(i,j,k)=a3dsqr(i,j,k)+a3d(i,j,k)*a3d(i,j,k)
4379 aavg=facavg*a3davg(i,j,k)
4380 asqr=facavg*a3dsqr(i,j,k)
4382 IF (rmask(i,j).gt.0.0_r8)
THEN
4383 vnormr(i,j,k,ifile,itrc)=1.0_r8/sqrt(asqr)
4385 vnormr(i,j,k,ifile,itrc)=0.0_r8
4388 vnormr(i,j,k,ifile,itrc)=1.0_r8/sqrt(asqr)
4400 vnormr(i,j,k,ifile,itrc)=vnormr(i,j,k,ifile,1)
4408 IF (
cnorm(ifile,is))
THEN
4410 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4411 & vnormr(:,:,:,ifile,itrc))
4414 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4417 & vnormr(:,:,:,ifile,itrc))
4420 SELECT CASE (
nrm(ifile,ng)%IOtype)
4423 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4425 &
nrm(ifile,ng)%ncid, &
4427 &
nrm(ifile,ng)%Rindex, &
4431 & vnormr(:,:,:,ifile,itrc))
4433# if defined PIO_LIB && defined DISTRIBUTE
4435 IF (
nrm(ifile,ng)%pioTrc(itrc)%dkind.eq. &
4442 & lbi, ubi, lbj, ubj, 1,
n(ng), &
4444 &
nrm(ifile,ng)%pioFile, &
4445 &
nrm(ifile,ng)%pioTrc(itrc), &
4446 &
nrm(ifile,ng)%Rindex, &
4451 & vnormr(:,:,:,ifile,itrc))
4455 & __line__, myfile))
RETURN
4462# ifdef ADJUST_BOUNDARY
4471 text=
'boundary conditions'
4488 ncname=
nrm(ifile,ng)%name
4489 nrm(ifile,ng)%Rindex=
nrm(ifile,ng)%Rindex+1
4490 nrm(ifile,ng)%Nrec=
nrm(ifile,ng)%Nrec+1
4494 SELECT CASE (
nrm(ifile,ng)%IOtype)
4498 & start = (/
nrm(ifile,ng)%Rindex/), &
4500 & ncid =
nrm(ifile,ng)%ncid, &
4503# if defined PIO_LIB && defined DISTRIBUTE
4507 & start = (/
nrm(ifile,ng)%Rindex/), &
4509 & piofile =
nrm(ifile,ng)%pioFile, &
4510 & piovar =
nrm(ifile,ng)%pioVar(
idtime)%vd)
4520 WRITE (
stdout,20) trim(text), &
4521 &
'2D normalization factors at RHO-points'
4533 IF (lconvolve(ibry))
THEN
4535 hscaleb(j)=1.0_r8/sqrt(on_r(i,j))
4540 IF (lconvolve(ibry))
THEN
4542 hscaleb(i)=1.0_r8/sqrt(om_r(i,j))
4554 b2d(j)=b2d(j)*hscaleb(j)
4563 b2d(i)=b2d(i)*hscaleb(i)
4569 & lbi, ubi, lbj, ubj, &
4570 & imins, imaxs, jmins, jmaxs, &
4575 & pm, pn, pmon_u, pnom_v, &
4577 & rmask, umask, vmask, &
4580 IF (lconvolve(ibry))
THEN
4583 b2davg(j)=b2davg(j)+b2d(j)
4584 b2dsqr(j)=b2dsqr(j)+b2d(j)*b2d(j)
4588 b2davg(i)=b2davg(i)+b2d(i)
4589 b2dsqr(i)=b2dsqr(i)+b2d(i)*b2d(i)
4594 IF (lconvolve(ibry))
THEN
4597 bavg=facavg*b2davg(j)
4598 bsqr=facavg*b2dsqr(j)
4600 IF (rmask(i,j).gt.0.0_r8)
THEN
4601 hnormrobc(j,ibry)=1.0_r8/sqrt(bsqr)
4603 hnormrobc(j,ibry)=0.0_r8
4606 hnormrobc(j,ibry)=1.0_r8/sqrt(bsqr)
4611 bavg=facavg*b2davg(i)
4612 bsqr=facavg*b2dsqr(i)
4614 IF (rmask(i,j).gt.0.0_r8)
THEN
4615 hnormrobc(i,ibry)=1.0_r8/sqrt(bsqr)
4617 hnormrobc(i,ibry)=0.0_r8
4620 hnormrobc(i,ibry)=1.0_r8/sqrt(bsqr)
4627 & hnormrobc(:,ibry))
4630 & hnormrobc(lbij:,ibry))
4637 SELECT CASE (
nrm(ifile,ng)%IOtype)
4640 &
vname(1,ifield), &
4641 & hnormrobc(lbij:,:), &
4642 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
4643 & total = (/ijlen,4,1/), &
4644 & ncid =
nrm(ifile,ng)%ncid, &
4645 & varid =
nrm(ifile,ng)%Vid(ifield))
4647# if defined PIO_LIB && defined DISTRIBUTE
4650 &
vname(1,ifield), &
4651 & hnormrobc(lbij:,:), &
4652 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
4653 & total = (/ijlen,4,1/), &
4654 & piofile =
nrm(ifile,ng)%pioFile, &
4655 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
4667 WRITE (
stdout,20) trim(text), &
4668 &
'2D normalization factors at U-points'
4680 IF (lconvolve(ibry))
THEN
4682 hscaleb(j)=1.0_r8/sqrt(on_u(i,j))
4687 IF (lconvolve(ibry))
THEN
4689 hscaleb(i)=1.0_r8/sqrt(om_u(i,j))
4701 b2d(j)=b2d(j)*hscaleb(j)
4710 b2d(i)=b2d(i)*hscaleb(i)
4716 & lbi, ubi, lbj, ubj, &
4717 & imins, imaxs, jmins, jmaxs, &
4722 & pm, pn, pmon_r, pnom_p, &
4727 IF (lconvolve(ibry))
THEN
4730 b2davg(j)=b2davg(j)+b2d(j)
4731 b2dsqr(j)=b2dsqr(j)+b2d(j)*b2d(j)
4735 b2davg(i)=b2davg(i)+b2d(i)
4736 b2dsqr(i)=b2dsqr(i)+b2d(i)*b2d(i)
4741 IF (lconvolve(ibry))
THEN
4744 bavg=facavg*b2davg(j)
4745 bsqr=facavg*b2dsqr(j)
4747 IF (umask(i,j).gt.0.0_r8)
THEN
4748 hnormuobc(j,ibry)=1.0_r8/sqrt(bsqr)
4750 hnormuobc(j,ibry)=0.0_r8
4753 hnormuobc(j,ibry)=1.0_r8/sqrt(bsqr)
4758 bavg=facavg*b2davg(i)
4759 bsqr=facavg*b2dsqr(i)
4761 IF (umask(i,j).gt.0.0_r8)
THEN
4762 hnormuobc(i,ibry)=1.0_r8/sqrt(bsqr)
4764 hnormuobc(i,ibry)=0.0_r8
4767 hnormuobc(i,ibry)=1.0_r8/sqrt(bsqr)
4774 & hnormuobc(:,ibry))
4777 & hnormuobc(lbij:,ibry))
4784 SELECT CASE (
nrm(ifile,ng)%IOtype)
4787 &
vname(1,ifield), &
4788 & hnormuobc(lbij:,:), &
4789 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
4790 & total = (/ijlen,4,1/), &
4791 & ncid =
nrm(ifile,ng)%ncid, &
4792 & varid =
nrm(ifile,ng)%Vid(ifield))
4794# if defined PIO_LIB && defined DISTRIBUTE
4797 &
vname(1,ifield), &
4798 & hnormuobc(lbij:,:), &
4799 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
4800 & total = (/ijlen,4,1/), &
4801 & piofile =
nrm(ifile,ng)%pioFile, &
4802 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
4813 WRITE (
stdout,20) trim(text), &
4814 &
'2D normalization factors at V-points'
4826 IF (lconvolve(ibry))
THEN
4828 hscaleb(j)=1.0_r8/sqrt(on_v(i,j))
4833 IF (lconvolve(ibry))
THEN
4835 hscaleb(i)=1.0_r8/sqrt(om_v(i,j))
4847 b2d(j)=b2d(j)*hscaleb(j)
4856 b2d(i)=b2d(i)*hscaleb(i)
4862 & lbi, ubi, lbj, ubj, &
4863 & imins, imaxs, jmins, jmaxs, &
4868 & pm, pn, pmon_p, pnom_r, &
4873 IF (lconvolve(ibry))
THEN
4876 b2davg(j)=b2davg(j)+b2d(j)
4877 b2dsqr(j)=b2dsqr(j)+b2d(j)*b2d(j)
4881 b2davg(i)=b2davg(i)+b2d(i)
4882 b2dsqr(i)=b2dsqr(i)+b2d(i)*b2d(i)
4887 IF (lconvolve(ibry))
THEN
4890 bavg=facavg*b2davg(j)
4891 bsqr=facavg*b2dsqr(j)
4893 IF (vmask(i,j).gt.0.0_r8)
THEN
4894 hnormvobc(j,ibry)=1.0_r8/sqrt(bsqr)
4896 hnormvobc(j,ibry)=0.0_r8
4899 hnormvobc(j,ibry)=1.0_r8/sqrt(bsqr)
4904 bavg=facavg*b2davg(i)
4905 bsqr=facavg*b2dsqr(i)
4907 IF (vmask(i,j).gt.0.0_r8)
THEN
4908 hnormvobc(i,ibry)=1.0_r8/sqrt(bsqr)
4910 hnormvobc(i,ibry)=0.0_r8
4913 hnormvobc(i,ibry)=1.0_r8/sqrt(bsqr)
4920 & hnormvobc(:,ibry))
4923 & hnormvobc(lbij:,ibry))
4930 SELECT CASE (
nrm(ifile,ng)%IOtype)
4933 &
vname(1,ifield), &
4934 & hnormvobc(lbij:,:), &
4935 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
4936 & total = (/ijlen,4,1/), &
4937 & ncid =
nrm(ifile,ng)%ncid, &
4938 & varid =
nrm(ifile,ng)%Vid(ifield))
4940# if defined PIO_LIB && defined DISTRIBUTE
4943 &
vname(1,ifield), &
4944 & hnormvobc(lbij:,:), &
4945 & start = (/1,1,
nrm(ifile,ng)%Rindex/), &
4946 & total = (/ijlen,4,1/), &
4947 & piofile =
nrm(ifile,ng)%pioFile, &
4948 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
4961 WRITE (
stdout,20) trim(text), &
4962 &
'3D normalization factors at U-points'
4974 IF (lconvolve(ibry))
THEN
4976 val=on_u(i,j)*0.5_r8
4978 vscaleb(j,k)=1.0_r8/ &
4979 & sqrt(val*(hz(i-1,j,k)+hz(i,j,k)))
4985 IF (lconvolve(ibry))
THEN
4987 val=om_u(i,j)*0.5_r8
4989 vscaleb(i,k)=1.0_r8/ &
4990 & sqrt(val*(hz(i-1,j,k)+hz(i,j,k)))
5000 & lbij, ubij, 1,
n(ng), &
5004 b3d(j,k)=b3d(j,k)*vscaleb(j,k)
5011 & lbij, ubij, 1,
n(ng), &
5015 b3d(i,k)=b3d(i,k)*vscaleb(i,k)
5022 & lbi, ubi, lbj, ubj, 1,
n(ng), &
5023 & imins, imaxs, jmins, jmaxs, &
5037 IF (lconvolve(ibry))
THEN
5041 b3davg(j,k)=b3davg(j,k)+b3d(j,k)
5042 b3dsqr(j,k)=b3dsqr(j,k)+b3d(j,k)*b3d(j,k)
5048 b3davg(i,k)=b3davg(i,k)+b3d(i,k)
5049 b3dsqr(i,k)=b3dsqr(i,k)+b3d(i,k)*b3d(i,k)
5055 IF (lconvolve(ibry))
THEN
5059 bavg=facavg*b3davg(j,k)
5060 bsqr=facavg*b3dsqr(j,k)
5062 IF (umask(i,j).gt.0.0_r8)
THEN
5063 vnormuobc(j,k,ibry)=1.0_r8/sqrt(bsqr)
5065 vnormuobc(j,k,ibry)=0.0_r8
5068 vnormuobc(j,k,ibry)=1.0_r8/sqrt(bsqr)
5075 bavg=facavg*b3davg(i,k)
5076 bsqr=facavg*b3dsqr(i,k)
5078 IF (umask(i,j).gt.0.0_r8)
THEN
5079 vnormuobc(i,k,ibry)=1.0_r8/sqrt(bsqr)
5081 vnormuobc(i,k,ibry)=0.0_r8
5084 vnormuobc(i,k,ibry)=1.0_r8/sqrt(bsqr)
5091 & lbij, ubij, 1,
n(ng), &
5092 & vnormuobc(:,:,ibry))
5094 bwrk=reshape(vnormuobc(:,:,ibry), (/ijklen/))
5100 vnormuobc(ib,k,ibry)=bwrk(ic)
5109 SELECT CASE (
nrm(ifile,ng)%IOtype)
5112 &
vname(1,ifield), &
5113 & vnormuobc(lbij:,:,:), &
5114 & start = (/1,1,1,
nrm(ifile,ng)%Rindex/), &
5115 & total = (/ijlen,
n(ng),4,1/), &
5116 & ncid =
nrm(ifile,ng)%ncid, &
5117 & varid =
nrm(ifile,ng)%Vid(ifield))
5119# if defined PIO_LIB && defined DISTRIBUTE
5122 &
vname(1,ifield), &
5123 & vnormuobc(lbij:,:,:), &
5124 & start = (/1,1,1,
nrm(ifile,ng)%Rindex/), &
5125 & total = (/ijlen,
n(ng),4,1/), &
5126 & piofile =
nrm(ifile,ng)%pioFile, &
5127 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
5138 WRITE (
stdout,20) trim(text), &
5139 &
'3D normalization factors at V-points'
5151 IF (lconvolve(ibry))
THEN
5153 val=on_v(i,j)*0.5_r8
5155 vscaleb(j,k)=1.0_r8/ &
5156 & sqrt(val*(hz(i,j-1,k)+hz(i,j,k)))
5162 IF (lconvolve(ibry))
THEN
5164 val=om_v(i,j)*0.5_r8
5166 vscaleb(i,k)=1.0_r8/ &
5167 & sqrt(val*(hz(i,j-1,k)+hz(i,j,k)))
5177 & lbij, ubij, 1,
n(ng), &
5181 b3d(j,k)=b3d(j,k)*vscaleb(j,k)
5188 & lbij, ubij, 1,
n(ng), &
5192 b3d(i,k)=b3d(i,k)*vscaleb(i,k)
5199 & lbi, ubi, lbj, ubj, 1,
n(ng), &
5200 & imins, imaxs, jmins, jmaxs, &
5214 IF (lconvolve(ibry))
THEN
5218 b3davg(j,k)=b3davg(j,k)+b3d(j,k)
5219 b3dsqr(j,k)=b3dsqr(j,k)+b3d(j,k)*b3d(j,k)
5225 b3davg(i,k)=b3davg(i,k)+b3d(i,k)
5226 b3dsqr(i,k)=b3dsqr(i,k)+b3d(i,k)*b3d(i,k)
5232 IF (lconvolve(ibry))
THEN
5236 bavg=facavg*b3davg(j,k)
5237 bsqr=facavg*b3dsqr(j,k)
5239 IF (vmask(i,j).gt.0.0_r8)
THEN
5240 vnormvobc(j,k,ibry)=1.0_r8/sqrt(bsqr)
5242 vnormvobc(j,k,ibry)=0.0_r8
5245 vnormvobc(j,k,ibry)=1.0_r8/sqrt(bsqr)
5252 bavg=facavg*b3davg(i,k)
5253 bsqr=facavg*b3dsqr(i,k)
5255 IF (vmask(i,j).gt.0.0_r8)
THEN
5256 vnormvobc(i,k,ibry)=1.0_r8/sqrt(bsqr)
5258 vnormvobc(i,k,ibry)=0.0_r8
5261 vnormvobc(i,k,ibry)=1.0_r8/sqrt(bsqr)
5268 & lbij, ubij, 1,
n(ng), &
5269 & vnormvobc(:,:,ibry))
5271 bwrk=reshape(vnormvobc(:,:,ibry), (/ijklen/))
5277 vnormvobc(ib,k,ibry)=bwrk(ic)
5286 SELECT CASE (
nrm(ifile,ng)%IOtype)
5289 &
vname(1,ifield), &
5290 & vnormvobc(lbij:,:,:), &
5291 & start = (/1,1,1,
nrm(ifile,ng)%Rindex/), &
5292 & total = (/ijlen,
n(ng),4,1/), &
5293 & ncid =
nrm(ifile,ng)%ncid, &
5294 & varid =
nrm(ifile,ng)%Vid(ifield))
5296# if defined PIO_LIB && defined DISTRIBUTE
5299 &
vname(1,ifield), &
5300 & vnormvobc(lbij:,:,:), &
5301 & start = (/1,1,1,
nrm(ifile,ng)%Rindex/), &
5302 & total = (/ijlen,
n(ng),4,1/), &
5303 & piofile =
nrm(ifile,ng)%pioFile, &
5304 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
5315 IF (any(
cnormb(is,:)))
THEN
5321 WRITE (
stdout,20) trim(text), &
5322 &
'3D normalization factors at RHO-points'
5331 IF (
cnormb(is,ibry))
THEN
5338 IF (lconvolve(ibry))
THEN
5342 vscaleb(j,k)=1.0_r8/sqrt(val*hz(i,j,k))
5348 IF (lconvolve(ibry))
THEN
5352 vscaleb(i,k)=1.0_r8/sqrt(val*hz(i,j,k))
5362 & lbij, ubij, 1,
n(ng), &
5366 b3d(j,k)=b3d(j,k)*vscaleb(j,k)
5373 & lbij, ubij, 1,
n(ng), &
5377 b3d(i,k)=b3d(i,k)*vscaleb(i,k)
5384 & lbi, ubi, lbj, ubj, &
5386 & imins, imaxs, jmins, jmaxs, &
5396 & rmask, umask, vmask, &
5400 IF (lconvolve(ibry))
THEN
5404 b3davg(j,k)=b3davg(j,k)+b3d(j,k)
5405 b3dsqr(j,k)=b3dsqr(j,k)+b3d(j,k)*b3d(j,k)
5411 b3davg(i,k)=b3davg(i,k)+b3d(i,k)
5412 b3dsqr(i,k)=b3dsqr(i,k)+b3d(i,k)*b3d(i,k)
5418 IF (lconvolve(ibry))
THEN
5422 bavg=facavg*b3davg(j,k)
5423 bsqr=facavg*b3dsqr(j,k)
5425 IF (rmask(i,j).gt.0.0_r8)
THEN
5426 vnormrobc(j,k,ibry,itrc)=1.0_r8/sqrt(bsqr)
5428 vnormrobc(j,k,ibry,itrc)=0.0_r8
5431 vnormrobc(j,k,ibry,itrc)=1.0_r8/sqrt(bsqr)
5438 bavg=facavg*b3davg(i,k)
5439 bsqr=facavg*b3dsqr(i,k)
5441 IF (rmask(i,j).gt.0.0_r8)
THEN
5442 vnormrobc(i,k,ibry,itrc)=1.0_r8/sqrt(bsqr)
5444 vnormrobc(i,k,ibry,itrc)=0.0_r8
5447 vnormrobc(i,k,ibry,itrc)=1.0_r8/sqrt(bsqr)
5454 & lbij, ubij, 1,
n(ng), &
5455 & vnormrobc(:,:,ibry,itrc))
5457 bwrk=reshape(vnormrobc(:,:,ibry,itrc), (/ijklen/))
5463 vnormrobc(ib,k,ibry,itrc)=bwrk(ic)
5469 IF (any(
cnormb(is,:)))
THEN
5472 SELECT CASE (
nrm(ifile,ng)%IOtype)
5475 &
vname(1,ifield), &
5476 & vnormrobc(lbij:,:,:,itrc), &
5477 & start =(/1,1,1,
nrm(ifile,ng)%Rindex/), &
5478 & total = (/ijlen,
n(ng),4,1/), &
5479 & ncid =
nrm(ifile,ng)%ncid, &
5480 & varid =
nrm(ifile,ng)%Vid(ifield))
5482# if defined PIO_LIB && defined DISTRIBUTE
5485 &
vname(1,ifield), &
5486 & vnormrobc(lbij:,:,:,itrc), &
5487 & start =(/1,1,1,
nrm(ifile,ng)%Rindex/), &
5488 & total = (/ijlen,
n(ng),4,1/), &
5489 & piofile =
nrm(ifile,ng)%pioFile, &
5490 & piovar =
nrm(ifile,ng)%pioVar(ifield)%vd)
5502 SELECT CASE (
nrm(ifile,ng)%IOtype)
5505 &
nrm(ifile,ng)%ncid)
5506# if defined PIO_LIB && defined DISTRIBUTE
5509 &
nrm(ifile,ng)%pioFile)
5516# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
5526 text=
'surface forcing'
5535 ncname=
nrm(ifile,ng)%name
5536 nrm(ifile,ng)%Rindex=
nrm(ifile,ng)%Rindex+1
5537 nrm(ifile,ng)%Nrec=
nrm(ifile,ng)%Nrec+1
5541 SELECT CASE (
nrm(ifile,ng)%IOtype)
5545 & start = (/
nrm(ifile,ng)%Rindex/), &
5547 & ncid =
nrm(ifile,ng)%ncid, &
5550# if defined PIO_LIB && defined DISTRIBUTE
5554 & start = (/
nrm(ifile,ng)%Rindex/), &
5556 & piofile =
nrm(ifile,ng)%pioFile, &
5557 & piovar =
nrm(ifile,ng)%pioVar(
idtime)%vd)
5562# ifdef ADJUST_WSTRESS
5568 WRITE (
stdout,20) trim(text), &
5569 &
'2D normalization factors at U-points'
5576 hscale(i,j)=1.0_r8/sqrt(om_u(i,j)*on_u(i,j))
5581 & istr, iendr, jstrr, jendr, &
5582 & lbi, ubi, lbj, ubj, &
5586 a2d(i,j)=a2d(i,j)*hscale(i,j)
5590 & lbi, ubi, lbj, ubj, &
5591 & imins, imaxs, jmins, jmaxs, &
5596 & pm, pn, pmon_r, pnom_p, &
5603 a2davg(i,j)=a2davg(i,j)+a2d(i,j)
5604 a2dsqr(i,j)=a2dsqr(i,j)+a2d(i,j)*a2d(i,j)
5610 aavg=facavg*a2davg(i,j)
5611 asqr=facavg*a2dsqr(i,j)
5613 IF (umask(i,j).gt.0.0_r8)
THEN
5614 hnormsus(i,j)=1.0_r8/sqrt(asqr)
5616 hnormsus(i,j)=0.0_r8
5619 hnormsus(i,j)=1.0_r8/sqrt(asqr)
5624 & lbi, ubi, lbj, ubj, &
5628 & lbi, ubi, lbj, ubj, &
5634 SELECT CASE (
nrm(ifile,ng)%IOtype)
5637 & lbi, ubi, lbj, ubj,
idusms, &
5638 &
nrm(ifile,ng)%ncid, &
5640 &
nrm(ifile,ng)%Rindex, &
5646# if defined PIO_LIB && defined DISTRIBUTE
5648 IF (
nrm(ifile,ng)%pioVar(
idusms)%dkind.eq. &
5655 & lbi, ubi, lbj, ubj,
idusms, &
5656 &
nrm(ifile,ng)%pioFile, &
5658 &
nrm(ifile,ng)%Rindex, &
5673 WRITE (
stdout,20) trim(text), &
5674 &
'2D normalization factors at V-points'
5681 hscale(i,j)=1.0_r8/sqrt(om_v(i,j)*on_v(i,j))
5686 & istrr, iendr, jstr, jendr, &
5687 & lbi, ubi, lbj, ubj, &
5691 a2d(i,j)=a2d(i,j)*hscale(i,j)
5695 & lbi, ubi, lbj, ubj, &
5696 & imins, imaxs, jmins, jmaxs, &
5701 & pm, pn, pmon_p, pnom_r, &
5708 a2davg(i,j)=a2davg(i,j)+a2d(i,j)
5709 a2dsqr(i,j)=a2dsqr(i,j)+a2d(i,j)*a2d(i,j)
5715 aavg=facavg*a2davg(i,j)
5716 asqr=facavg*a2dsqr(i,j)
5718 IF (vmask(i,j).gt.0.0_r8)
THEN
5719 hnormsvs(i,j)=1.0_r8/sqrt(asqr)
5721 hnormsvs(i,j)=0.0_r8
5724 hnormsvs(i,j)=1.0_r8/sqrt(asqr)
5729 & lbi, ubi, lbj, ubj, &
5733 & lbi, ubi, lbj, ubj, &
5739 SELECT CASE (
nrm(ifile,ng)%IOtype)
5742 & lbi, ubi, lbj, ubj,
idvsms, &
5743 &
nrm(ifile,ng)%ncid, &
5745 &
nrm(ifile,ng)%Rindex, &
5751# if defined PIO_LIB && defined DISTRIBUTE
5753 IF (
nrm(ifile,ng)%pioVar(
idvsms)%dkind.eq. &
5760 & lbi, ubi, lbj, ubj,
idvsms, &
5761 &
nrm(ifile,ng)%pioFile, &
5763 &
nrm(ifile,ng)%Rindex, &
5774# if defined ADJUST_STFLUX && defined SOLVE3D
5783 IF (
cnorm(rec,is)) lsame=.true.
5787 WRITE (
stdout,20) trim(text), &
5788 &
'2D normalization factors at RHO-points'
5805 IF (.not.ldiffer)
THEN
5815 hscale(i,j)=1.0_r8/sqrt(om_r(i,j)*on_r(i,j))
5821 IF (
cnorm(rec,is))
THEN
5830 & istrr, iendr, jstrr, jendr, &
5831 & lbi, ubi, lbj, ubj, &
5835 a2d(i,j)=a2d(i,j)*hscale(i,j)
5839 & lbi, ubi, lbj, ubj, &
5840 & imins, imaxs, jmins, jmaxs, &
5845 & pm, pn, pmon_u, pnom_v, &
5847 & rmask, umask, vmask, &
5852 a2davg(i,j)=a2davg(i,j)+a2d(i,j)
5853 a2dsqr(i,j)=a2dsqr(i,j)+a2d(i,j)*a2d(i,j)
5859 aavg=facavg*a2davg(i,j)
5860 asqr=facavg*a2dsqr(i,j)
5862 IF (rmask(i,j).gt.0.0_r8)
THEN
5863 hnormstf(i,j,itrc)=1.0_r8/sqrt(asqr)
5865 hnormstf(i,j,itrc)=0.0_r8
5868 hnormstf(i,j,itrc)=1.0_r8/sqrt(asqr)
5880 hnormstf(i,j,itrc)=hnormstf(i,j,1)
5889 IF (
cnorm(rec,is))
THEN
5891 & lbi, ubi, lbj, ubj, &
5892 & hnormstf(:,:,itrc))
5895 & lbi, ubi, lbj, ubj, &
5898 & hnormstf(:,:,itrc))
5901 SELECT CASE (
nrm(ifile,ng)%IOtype)
5904 & lbi, ubi, lbj, ubj, &
5906 &
nrm(ifile,ng)%ncid, &
5908 &
nrm(ifile,ng)%Rindex, &
5912 & hnormstf(:,:,itrc))
5914# if defined PIO_LIB && defined DISTRIBUTE
5916 IF (
nrm(ifile,ng)%pioVar(
idtsur(itrc))%dkind.eq. &
5923 & lbi, ubi, lbj, ubj, &
5925 &
nrm(ifile,ng)%pioFile, &
5927 &
nrm(ifile,ng)%Rindex, &
5932 & hnormstf(:,:,itrc))
5936 & __line__, myfile))
RETURN
5948 10
FORMAT (/,
' Error Covariance Factors: Randomization Method',/)
5949 20
FORMAT (4x,
'Computing',1x,a,1x,a)
5958 & LBi, UBi, LBj, UBj, &
5959 & ifield, ncid, ncvarid, tindex, &
5968 integer,
intent(in) :: ng, tile, model
5969 integer,
intent(in) :: lbi, ubi, lbj, ubj
5970 integer,
intent(in) :: ifield, ncid, ncvarid, tindex
5972 character (len=*),
intent(in) :: ncname
5974# ifdef ASSUMED_SHAPE
5976 real(
r8),
intent(in) :: amask(lbi:,lbj:)
5978 real(
r8),
intent(in) :: a(lbi:,lbj:)
5981 real(
r8),
intent(in) :: amask(lbi:ubi,lbj:ubj)
5983 real(
r8),
intent(in) :: a(lbi:ubi,lbj:ubj)
5988 integer :: gfactor, gtype, status
5992 character (len=*),
parameter :: myfile = &
5993 & __FILE__//
", wrt_norm2d_nf90"
5995# include "set_bounds.h"
6008# if defined WRITE_WATER && defined MASKING
6016 gtype=gfactor*
iinfo(1,ifield,ng)
6019 & ncvarid, tindex, gtype, &
6020 & lbi, ubi, lbj, ubj, scale, &
6025 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
6043 10
FORMAT (/,
' WRT_NORM2D_NF90 - error while writing variable: ',a, &
6044 & /,19x
'into normalization NetCDF file for time record: ', &
6046 20
FORMAT (7x,
'wrote ',a, t21,
'normalization factors into record ', &
6052# if defined PIO_LIB && defined DISTRIBUTE
6056 & LBi, UBi, LBj, UBj, &
6057 & ifield, pioFile, pioVar, tindex, &
6067 integer,
intent(in) :: ng, tile, model
6068 integer,
intent(in) :: lbi, ubi, lbj, ubj
6069 integer,
intent(in) :: ifield, tindex
6071 character (len=*),
intent(in) :: ncname
6073# ifdef ASSUMED_SHAPE
6075 real(
r8),
intent(in) :: amask(lbi:,lbj:)
6077 real(
r8),
intent(in) :: a(lbi:,lbj:)
6080 real(
r8),
intent(in) :: amask(lbi:ubi,lbj:ubj)
6082 real(
r8),
intent(in) :: a(lbi:ubi,lbj:ubj)
6085 TYPE (file_desc_t),
intent(inout) :: piofile
6086 TYPE (io_desc_t),
intent(inout) :: piodesc
6095 character (len=*),
parameter :: myfile = &
6096 & __FILE__//
", wrt_norm2d_pio"
6098# include "set_bounds.h"
6112 & piovar, tindex, piodesc, &
6113 & lbi, ubi, lbj, ubj, scale, &
6118 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
6136 10
FORMAT (/,
' WRT_NORM2D_PIO - error while writing variable: ',a, &
6137 & /,18x
'into normalization NetCDF file for time record: ', &
6139 20
FORMAT (7x,
'wrote ',a, t21,
'normalization factors into record ', &
6149 & LBi, UBi, LBj, UBj, LBk, UBk, &
6150 & ifield, ncid, ncvarid, tindex, &
6159 integer,
intent(in) :: ng, tile, model
6160 integer,
intent(in) :: lbi, ubi, lbj, ubj, lbk, ubk
6161 integer,
intent(in) :: ifield, ncid, ncvarid, tindex
6163 character (len=*),
intent(in) :: ncname
6165# ifdef ASSUMED_SHAPE
6167 real(
r8),
intent(in) :: amask(lbi:,lbj:)
6169 real(
r8),
intent(in) :: a(lbi:,lbj:,lbk:)
6172 real(
r8),
intent(in) :: amask(lbi:ubi,lbj:ubj)
6174 real(
r8),
intent(in) :: a(lbi:ubi,lbj:ubj,lbk:ubk)
6179 integer :: gfactor, gtype, status
6183 character (len=*),
parameter :: myfile = &
6184 & __FILE__//
", wrt_norm3d_nf90"
6186# include "set_bounds.h"
6199# if defined WRITE_WATER && defined MASKING
6207 gtype=gfactor*
iinfo(1,ifield,ng)
6210 & ncvarid, tindex, gtype, &
6211 & lbi, ubi, lbj, ubj, lbk, ubk, scale, &
6216 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
6234 10
FORMAT (/,
' WRT_NORM3D_NF90 - error while writing variable: ',a, &
6235 & /,19x,
'into normalization NetCDF file for time record: ', &
6237 20
FORMAT (7x,
'wrote ',a, t21,
'normalization factors into record ', &
6243# if defined PIO_LIB && defined DISTRIBUTE
6247 & LBi, UBi, LBj, UBj, LBk, UBk, &
6248 & ifield, pioFile, pioVar, tindex, &
6258 integer,
intent(in) :: ng, tile, model
6259 integer,
intent(in) :: lbi, ubi, lbj, ubj, lbk, ubk
6260 integer,
intent(in) :: ifield, tindex
6262 character (len=*),
intent(in) :: ncname
6264# ifdef ASSUMED_SHAPE
6266 real(
r8),
intent(in) :: amask(lbi:,lbj:)
6268 real(
r8),
intent(in) :: a(lbi:,lbj:,lbk:)
6271 real(
r8),
intent(in) :: amask(lbi:ubi,lbj:ubj)
6273 real(
r8),
intent(in) :: a(lbi:ubi,lbj:ubj,lbk:ubk)
6276 TYPE (file_desc_t),
intent(inout) :: piofile
6277 TYPE (io_desc_t),
intent(inout) :: piodesc
6286 character (len=*),
parameter :: myfile = &
6287 & __FILE__//
", wrt_norm3d_pio"
6289# include "set_bounds.h"
6303 & piovar, tindex, piodesc, &
6304 & lbi, ubi, lbj, ubj, lbk, ubk, scale, &
6309 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
6327 10
FORMAT (/,
' WRT_NORM3D_PIO - error while writing variable: ',a, &
6328 & /,18x,
'into normalization NetCDF file for time record: ', &
6330 20
FORMAT (7x,
'wrote ',a, t21,
'normalization factors into record ', &
subroutine ad_conv_u2d_tile(ng, tile, model, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_r, pnom_p, umask, pmask, ad_a)
subroutine ad_conv_r2d_tile(ng, tile, model, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_u, pnom_v, rmask, umask, vmask, ad_a)
subroutine ad_conv_v2d_tile(ng, tile, model, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_p, pnom_r, vmask, pmask, ad_a)
subroutine ad_conv_v3d_tile(ng, tile, model, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, on_p, om_r, pmask, rmask, umask, vmask, hz, z_r, ad_a)
subroutine ad_conv_u3d_tile(ng, tile, model, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, on_r, om_p, pmask, rmask, umask, vmask, hz, z_r, ad_a)
subroutine ad_conv_r3d_tile(ng, tile, model, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, on_u, om_v, rmask, umask, vmask, hz, z_r, ad_a)
subroutine ad_conv_v2d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_p, pnom_r, vmask, pmask, ad_a)
subroutine ad_conv_u2d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_r, pnom_p, umask, pmask, ad_a)
subroutine ad_conv_r2d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_u, pnom_v, rmask, umask, vmask, ad_a)
subroutine ad_conv_r3d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, pmon_u, pnom_v, rmask, umask, vmask, hz, z_r, ad_a)
subroutine ad_conv_u3d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, pmon_r, pnom_p, umask, pmask, hz, z_r, ad_a)
subroutine ad_conv_v3d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, pmon_p, pnom_r, vmask, pmask, hz, z_r, ad_a)
subroutine dabc_v2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
subroutine dabc_u2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
subroutine dabc_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
subroutine dabc_u3d_tile(ng, tile, lbi, ubi, lbj, ubj, lbk, ubk, a)
subroutine dabc_r3d_tile(ng, tile, lbi, ubi, lbj, ubj, lbk, ubk, a)
subroutine dabc_v3d_tile(ng, tile, lbi, ubi, lbj, ubj, lbk, ubk, a)
subroutine bc_r2d_bry_tile(ng, tile, boundary, lbij, ubij, a)
subroutine bc_u2d_bry_tile(ng, tile, boundary, lbij, ubij, a)
subroutine bc_v2d_bry_tile(ng, tile, boundary, lbij, ubij, a)
subroutine bc_u3d_bry_tile(ng, tile, boundary, lbij, ubij, lbk, ubk, a)
subroutine bc_r3d_bry_tile(ng, tile, boundary, lbij, ubij, lbk, ubk, a)
subroutine bc_v3d_bry_tile(ng, tile, boundary, lbij, ubij, lbk, ubk, a)
type(t_boundary), dimension(:), allocatable boundary
type(t_forces), dimension(:), allocatable forces
integer, dimension(:,:), allocatable nhsteps
integer, dimension(:), allocatable nmethod
integer, dimension(:,:), allocatable nvsteps
real(r8), dimension(:,:), allocatable dtsizehb
real(r8), dimension(:,:), allocatable dtsizeh
integer, dimension(:,:), allocatable nvstepsb
real(r8), dimension(:,:), allocatable dtsizevb
real(r8), dimension(:,:), allocatable dtsizev
integer, dimension(:), allocatable rscheme
integer, dimension(:,:), allocatable nhstepsb
type(t_grid), dimension(:), allocatable grid
type(t_io), dimension(:,:), allocatable nrm
character(len=256) sourcefile
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
integer, dimension(:,:,:), allocatable iinfo
integer, dimension(:), allocatable istsur
subroutine, public netcdf_sync(ng, model, ncname, ncid)
type(t_ocean), dimension(:), allocatable ocean
integer, dimension(:), allocatable n
type(t_bounds), dimension(:), allocatable bounds
integer, dimension(:), allocatable ntilex
integer, parameter r3dvar
integer, parameter u3dvar
type(t_domain), dimension(:), allocatable domain
integer, dimension(:), allocatable lm
integer, parameter u2dvar
integer, dimension(:), allocatable ntilee
integer, dimension(:), allocatable nt
integer, dimension(:), allocatable mm
integer, parameter r2dvar
integer, parameter v2dvar
integer, parameter v3dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_r3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_u3dvar
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_u3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_r2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_u2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_v3dvar
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_sp_v2dvar
logical, dimension(:,:), allocatable lwrtnrm
real(dp), parameter day2sec
logical, dimension(:), allocatable ewperiodic
logical, dimension(:), allocatable nsperiodic
logical, dimension(:,:), allocatable lstflux
real(dp), dimension(:), allocatable tdays
real(r8), dimension(:,:,:), allocatable vdecay
logical, dimension(:,:), allocatable cnorm
integer, parameter isouth
integer, parameter inorth
logical, dimension(:,:), allocatable cnormb
real(r8), dimension(:,:,:), allocatable hdecay
type(t_sedbed), dimension(:), allocatable sedbed
integer, dimension(:), allocatable nnew
integer, dimension(:), allocatable nstp
subroutine mp_exchange2d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, nghost, ew_periodic, ns_periodic, a, b, c, d)
subroutine mp_exchange3d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, lbk, ubk, nghost, ew_periodic, ns_periodic, a, b, c, d)
subroutine, private wrt_norm3d_pio(ng, tile, model, ncname, lbi, ubi, lbj, ubj, lbk, ubk, ifield, piofile, piovar, tindex, piodesc, amask, a)
subroutine, public normalization(ng, tile, ifac)
subroutine, private normalization_tile(ng, tile, lbi, ubi, lbj, ubj, lbij, ubij, imins, imaxs, jmins, jmaxs, nstp, nnew, ifac, pm, om_p, om_r, om_u, om_v, pn, on_p, on_r, on_u, on_v, pmon_p, pmon_r, pmon_u, pnom_p, pnom_r, pnom_v, pmask, rmask, umask, vmask, h, zice, bed_thick, hz, z_r, z_w, kh, kv, vnormrobc, vnormuobc, vnormvobc, hnormrobc, hnormuobc, hnormvobc, hnormsus, hnormsvs, hnormstf, vnormr, vnormu, vnormv, hnormr, hnormu, hnormv)
subroutine, private wrt_norm2d_pio(ng, tile, model, ncname, lbi, ubi, lbj, ubj, ifield, piofile, piovar, tindex, piodesc, amask, a)
subroutine, private wrt_norm3d_nf90(ng, tile, model, ncname, lbi, ubi, lbj, ubj, lbk, ubk, ifield, ncid, ncvarid, tindex, amask, a)
subroutine, private wrt_norm2d_nf90(ng, tile, model, ncname, lbi, ubi, lbj, ubj, ifield, ncid, ncvarid, tindex, amask, a)
subroutine, private randomization_tile(ng, tile, lbi, ubi, lbj, ubj, lbij, ubij, imins, imaxs, jmins, jmaxs, nstp, nnew, ifac, pm, om_p, om_r, om_u, om_v, pn, on_p, on_r, on_u, on_v, pmon_p, pmon_r, pmon_u, pnom_p, pnom_r, pnom_v, pmask, rmask, umask, vmask, h, zice, bed_thick, hz, z_r, z_w, kh, kv, vnormrobc, vnormuobc, vnormvobc, hnormrobc, hnormuobc, hnormvobc, hnormsus, hnormsvs, hnormstf, vnormr, vnormu, vnormv, hnormr, hnormu, hnormv)
subroutine, public set_depth_tile(ng, tile, model, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nstp, nnew, h, zice, zt_avg1, hz, z_r, z_w)
logical function, public founderror(flag, noerr, line, routine)
subroutine tl_conv_u2d_tile(ng, tile, model, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_r, pnom_p, umask, pmask, tl_a)
subroutine tl_conv_r2d_tile(ng, tile, model, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_u, pnom_v, rmask, umask, vmask, tl_a)
subroutine tl_conv_v2d_tile(ng, tile, model, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_p, pnom_r, vmask, pmask, tl_a)
subroutine tl_conv_u3d_tile(ng, tile, model, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, on_r, om_p, pmask, rmask, umask, vmask, hz, z_r, tl_a)
subroutine tl_conv_v3d_tile(ng, tile, model, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, on_p, om_r, pmask, rmask, umask, vmask, hz, z_r, tl_a)
subroutine tl_conv_r3d_tile(ng, tile, model, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, on_u, om_v, rmask, umask, vmask, hz, z_r, tl_a)
subroutine tl_conv_v2d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_p, pnom_r, vmask, pmask, tl_a)
subroutine tl_conv_u2d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_r, pnom_p, umask, pmask, tl_a)
subroutine tl_conv_r2d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nghost, nhsteps, dtsizeh, kh, pm, pn, pmon_u, pnom_v, rmask, umask, vmask, tl_a)
subroutine tl_conv_v3d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, pmon_p, pnom_r, vmask, pmask, hz, z_r, tl_a)
subroutine tl_conv_u3d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, pmon_r, pnom_p, umask, pmask, hz, z_r, tl_a)
subroutine tl_conv_r3d_bry_tile(ng, tile, model, boundary, edge, lbij, ubij, lbi, ubi, lbj, ubj, lbk, ubk, imins, imaxs, jmins, jmaxs, nghost, nhsteps, nvsteps, dtsizeh, dtsizev, kh, kv, pm, pn, pmon_u, pnom_v, rmask, umask, vmask, hz, z_r, tl_a)
subroutine, public white_noise3d(ng, model, gtype, rscheme, imin, imax, jmin, jmax, lbi, ubi, lbj, ubj, lbk, ubk, rmin, rmax, r)
subroutine, public white_noise3d_bry(ng, tile, model, boundary, rscheme, imin, imax, lbij, ubij, lbk, ubk, rmin, rmax, r)
subroutine, public white_noise2d_bry(ng, tile, model, boundary, rscheme, imin, imax, lbij, ubij, rmin, rmax, r)
subroutine, public white_noise2d(ng, model, gtype, rscheme, imin, imax, jmin, jmax, lbi, ubi, lbj, ubj, rmin, rmax, r)