29# ifdef ADJUST_BOUNDARY
51 integer,
intent(in) :: ng, tile, model
55 character (len=*),
parameter :: myfile = &
61 CALL wclock_on (ng, model, 12, __line__, myfile)
64 & lbi, ubi, lbj, ubj, &
65 & imins, imaxs, jmins, jmaxs, &
75 &
grid(ng) % tl_z_r, &
78 CALL wclock_off (ng, model, 12, __line__, myfile)
86 & LBi, UBi, LBj, UBj, &
87 & IminS, ImaxS, JminS, JmaxS, &
93 & Zt_avg1, tl_Zt_avg1, &
94 & tl_Hz, tl_z_r, tl_z_w)
108 integer,
intent(in) :: ng, tile, model
109 integer,
intent(in) :: lbi, ubi, lbj, ubj
110 integer,
intent(in) :: imins, imaxs, jmins, jmaxs
111 integer,
intent(in) :: nstp, nnew
114 real(r8),
intent(in) :: h(lbi:,lbj:)
116 real(r8),
intent(in) :: zice(lbi:,lbj:)
118 real(r8),
intent(in) :: zt_avg1(lbi:,lbj:)
119 real(r8),
intent(in) :: tl_zt_avg1(lbi:,lbj:)
120 real(r8),
intent(inout) :: tl_h(lbi:,lbj:)
121 real(r8),
intent(out) :: tl_hz(lbi:,lbj:,:)
122 real(r8),
intent(out) :: tl_z_r(lbi:,lbj:,:)
123 real(r8),
intent(out) :: tl_z_w(lbi:,lbj:,0:)
125 real(r8),
intent(in) :: h(lbi:ubi,lbj:ubj)
127 real(r8),
intent(in) :: zice(lbi:ubi,lbj:ubj)
129 real(r8),
intent(in) :: zt_avg1(lbi:ubi,lbj:ubj)
130 real(r8),
intent(in) :: tl_zt_avg1(lbi:ubi,lbj:ubj)
131 real(r8),
intent(inout) :: tl_h(lbi:ubi,lbj:ubj)
132 real(r8),
intent(out) :: tl_hz(lbi:ubi,lbj:ubj,
n(ng))
133 real(r8),
intent(out) :: tl_z_r(lbi:ubi,lbj:ubj,
n(ng))
134 real(r8),
intent(out) :: tl_z_w(lbi:ubi,lbj:ubj,0:
n(ng))
141 real(r8) :: cff, cff_r, cff1_r, cff2_r, cff_w, cff1_w, cff2_w
142 real(r8) :: hinv, hwater, z_r0, z_w0
143 real(r8) :: tl_cff2_r, tl_cff2_w
144 real(r8) :: tl_hinv, tl_hwater, tl_z_r0, tl_z_w0
147 real(r8),
parameter :: eps = 1.0e-14_r8
150# include "set_bounds.h"
168 tl_z_w(i,j,0)=-tl_h(i,j)
178 hwater=hwater-abs(zice(i,j))
182# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
183 tl_hinv=-hinv*hinv*tl_hwater+ &
188 z_w0=cff_w+cff1_w*hwater
189# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
190 tl_z_w0=cff1_w*tl_hwater+ &
197# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
198 tl_z_w(i,j,k)=tl_z_w0+ &
199 & tl_zt_avg1(i,j)*(1.0_r8+z_w0*hinv)+ &
200 & zt_avg1(i,j)*z_w0*tl_hinv+ &
201 & zt_avg1(i,j)*tl_z_w0*hinv- &
203 & 2.0_r8*zt_avg1(i,j)*z_w0*hinv
206 tl_z_w(i,j,k)=tl_zt_avg1(i,j)*(1.0_r8+z_w0*hinv)+ &
211 z_r0=cff_r+cff1_r*hwater
212# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
213 tl_z_r0=cff1_r*tl_hwater+ &
220# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
221 tl_z_r(i,j,k)=tl_z_r0+ &
222 & tl_zt_avg1(i,j)*(1.0_r8+z_r0*hinv)+ &
223 & zt_avg1(i,j)*z_r0*tl_hinv+ &
224 & zt_avg1(i,j)*tl_z_r0*hinv- &
226 & 2.0_r8*zt_avg1(i,j)*z_r0*hinv
229 tl_z_r(i,j,k)=tl_zt_avg1(i,j)*(1.0_r8+z_r0*hinv)+ &
240 tl_hz(i,j,k)=tl_z_w(i,j,k)-tl_z_w(i,j,k-1)
261 tl_z_w(i,j,0)=-tl_h(i,j)
271 hwater=hwater-abs(zice(i,j))
274 hinv=1.0_r8/(
hc(ng)+hwater)
275# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
276 tl_hinv=-hinv*hinv*tl_hwater+ &
282 cff2_w=(cff_w+cff1_w*hwater)*hinv
283# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
284 tl_cff2_w=cff1_w*tl_hwater*hinv+ &
285 & (cff_w+cff1_w*hwater)*tl_hinv- &
294# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
295 tl_z_w(i,j,k)=tl_zt_avg1(i,j)+ &
296 & (tl_zt_avg1(i,j)+tl_hwater)*cff2_w+ &
297 & (zt_avg1(i,j)+hwater)*tl_cff2_w- &
299 & (zt_avg1(i,j)+hwater)*cff2_w
302 tl_z_w(i,j,k)=tl_zt_avg1(i,j)+ &
303 & tl_zt_avg1(i,j)*cff2_w+ &
309 cff2_r=(cff_r+cff1_r*hwater)*hinv
310# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
311 tl_cff2_r=cff1_r*tl_hwater*hinv+ &
312 & (cff_r+cff1_r*hwater)*tl_hinv- &
321# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
322 tl_z_r(i,j,k)=tl_zt_avg1(i,j)+ &
323 & (tl_zt_avg1(i,j)+tl_hwater)*cff2_r+ &
324 & (zt_avg1(i,j)+hwater)*tl_cff2_r- &
326 & (zt_avg1(i,j)+hwater)*cff2_r
329 tl_z_r(i,j,k)=tl_zt_avg1(i,j)+ &
330 & tl_zt_avg1(i,j)*cff2_r+ &
341 tl_hz(i,j,k)=tl_z_w(i,j,k)-tl_z_w(i,j,k-1)
357 & lbi, ubi, lbj, ubj, &
364 & lbi, ubi, lbj, ubj, 0,
n(ng), &
371 & lbi, ubi, lbj, ubj, 1,
n(ng), &
378 & lbi, ubi, lbj, ubj, 1,
n(ng), &
390 & lbi, ubi, lbj, ubj, &
401 & lbi, ubi, lbj, ubj, 0,
n(ng), &
412 & lbi, ubi, lbj, ubj, 1,
n(ng), &
421# ifdef ADJUST_BOUNDARY
432 integer,
intent(in) :: ng, tile, model
436 character (len=*),
parameter :: myfile = &
437 & __FILE__//
", rp_set_depth_bry"
442 CALL wclock_on (ng, model, 12, __line__, myfile)
445 & lbi, ubi, lbj, ubj, lbij, ubij, &
446 & imins, imaxs, jmins, jmaxs, &
452 &
grid(ng) % tl_Hz_bry)
454 CALL wclock_off (ng, model, 12, __line__, myfile)
462 & LBi, UBi, LBj, UBj, LBij, UBij, &
463 & IminS, ImaxS, JminS, JmaxS, &
482 integer,
intent(in) :: ng, tile, model
483 integer,
intent(in) :: LBi, UBi, LBj, UBj, LBij, UBij
484 integer,
intent(in) :: IminS, ImaxS, JminS, JmaxS
487 real(r8),
intent(in) :: h(LBi:,LBj:)
488 real(r8),
intent(in) :: tl_h(LBi:,LBj:)
490 real(r8),
intent(in) :: zice(LBi:,LBj:)
492 real(r8),
intent(out) :: tl_Hz_bry(LBij:,:,:)
494 real(r8),
intent(in) :: h(LBi:UBi,LBj:UBj)
495 real(r8),
intent(in) :: tl_h(LBi:UBi,LBj:UBj)
497 real(r8),
intent(in) :: zice(LBi:UBi,LBj:UBj)
499 real(r8),
intent(out) :: tl_Hz_bry(LBij:UBij,N(ng),4)
504 integer :: i, ibry, j, k
506 real(r8) :: cff_w, cff1_w, cff2_w
507 real(r8) :: hinv, hwater, z_w0
508 real(r8) :: tl_cff2_w, tl_hinv, tl_hwater, tl_z_w0
510 real(r8),
dimension(0:N(ng)) :: tl_Zw
512# include "set_bounds.h"
535 &
domain(ng)%Western_Edge(tile))
THEN
540 hwater=hwater-abs(zice(i,j))
544# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
545 tl_hinv=-hinv*hinv*tl_hwater
553 z_w0=cff_w+cff1_w*hwater
554# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
555 tl_z_w0=cff1_w*tl_hwate
559# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
562 & (1.0_r8+z_w0*hinv)+ &
563 &
boundary(ng)%zeta_west(j)*z_w0*tl_hinv+ &
564 &
boundary(ng)%zeta_west(j)*tl_z_w0*hinv
566 tl_zw(k)=
boundary(ng)%tl_zeta_west(j)*(1.0_r8+z_w0*hinv)
573 tl_hz_bry(j,k,
iwest)=tl_zw(k)-tl_zw(k-1)
579 &
domain(ng)%Eastern_Edge(tile))
THEN
584 hwater=hwater-abs(zice(i,j))
588# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
589 tl_hinv=-hinv*hinv*tl_hwater
597 z_w0=cff_w+cff1_w*hwater
598# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
599 tl_z_w0=cff1_w*tl_hwater
603# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
606 & (1.0_r8+z_w0*hinv)+ &
607 &
boundary(ng)%zeta_east(j)*z_w0*tl_hinv+ &
608 &
boundary(ng)%zeta_east(j)*tl_z_w0*hinv
610 tl_zw(k)=
boundary(ng)%tl_zeta_east(j)*(1.0_r8+z_w0*hinv)
617 tl_hz_bry(j,k,
ieast)=tl_zw(k)-tl_zw(k-1)
623 &
domain(ng)%Southern_Edge(tile))
THEN
628 hwater=hwater-abs(zice(i,j))
632# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
633 tl_hinv=-hinv*hinv*tl_hwater
641 z_w0=cff_w+cff1_w*hwater
642# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
643 tl_z_w0=cff1_w*tl_hwater
647# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
650 & (1.0_r8+z_w0*hinv)+ &
651 &
boundary(ng)%zeta_south(i)*z_w0*tl_hinv+ &
652 &
boundary(ng)%zeta_south(i)*tl_z_w0*hinv
654 tl_zw(k)=
boundary(ng)%tl_zeta_south(i)*(1.0_r8+z_w0*hinv)
661 tl_hz_bry(i,k,
isouth)=tl_zw(k)-tl_zw(k-1)
667 &
domain(ng)%Northern_Edge(tile))
THEN
672 hwater=hwater-abs(zice(i,j))
676# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
677 tl_hinv=-hinv*hinv*tl_hwater
685 z_w0=cff_w+cff1_w*hwater
686# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
687 tl_z_w0=cff1_w*tl_hwater
691# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
694 & (1.0_r8+z_w0*hinv)+ &
695 &
boundary(ng)%zeta_north(i)*z_w0*tl_hinv+ &
696 &
boundary(ng)%zeta_north(i)*tl_z_w0*hinv
698 tl_zw(k)=
boundary(ng)%tl_zeta_north(i)*(1.0_r8+z_w0*hinv)
705 tl_hz_bry(i,k,
inorth)=tl_zw(k)-tl_zw(k-1)
724 &
domain(ng)%Western_Edge(tile))
THEN
729 hwater=hwater-abs(zice(i,j))
732 hinv=1.0_r8/(
hc(ng)+hwater)
733# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
734 tl_hinv=-hinv*hinv*tl_hwater
742 cff2_w=(cff_w+cff1_w*hwater)*hinv
743# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
744 tl_cff2_w=cff1_w*tl_hwater*hinv+ &
745 & (cff_w+cff1_w*hwater)*tl_hinv
750# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
751 tl_zw(k)=
boundary(ng)%tl_zeta_west(j)+ &
753 & tl_hwater)*cff2_w+ &
757 tl_zw(k)=
boundary(ng)%tl_zeta_west(j)+ &
758 &
boundary(ng)%tl_zeta_west(j)*cff2_w
765 tl_hz_bry(j,k,
iwest)=tl_zw(k)-tl_zw(k-1)
771 &
domain(ng)%Eastern_Edge(tile))
THEN
776 hwater=hwater-abs(zice(i,j))
779 hinv=1.0_r8/(
hc(ng)+hwater)
780# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
781 tl_hinv=-hinv*hinv*tl_hwater
789 cff2_w=(cff_w+cff1_w*hwater)*hinv
790# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
791 tl_cff2_w=cff1_w*tl_hwater*hinv+ &
792 & (cff_w+cff1_w*hwater)*tl_hinv
797# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
798 tl_zw(k)=
boundary(ng)%tl_zeta_east(j)+ &
800 & tl_hwater)*cff2_w+ &
804 tl_zw(k)=
boundary(ng)%tl_zeta_east(j)+ &
805 &
boundary(ng)%tl_zeta_east(j)*cff2_w
812 tl_hz_bry(j,k,
ieast)=tl_zw(k)-tl_zw(k-1)
818 &
domain(ng)%Southern_Edge(tile))
THEN
823 hwater=hwater-abs(zice(i,j))
826 hinv=1.0_r8/(
hc(ng)+hwater)
827# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
828 tl_hinv=-hinv*hinv*tl_hwater
836 cff2_w=(cff_w+cff1_w*hwater)*hinv
837# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
838 tl_cff2_w=cff1_w*tl_hwater*hinv+ &
839 & (cff_w+cff1_w*hwater)*tl_hinv
844# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
845 tl_zw(k)=
boundary(ng)%tl_zeta_south(i)+ &
847 & tl_hwater)*cff2_w+ &
851 tl_zw(k)=
boundary(ng)%tl_zeta_south(i)+ &
852 &
boundary(ng)%tl_zeta_south(i)*cff2_w
859 tl_hz_bry(i,k,
isouth)=tl_zw(k)-tl_zw(k-1)
865 &
domain(ng)%Northern_Edge(tile))
THEN
870 hwater=hwater-abs(zice(i,j))
873 hinv=1.0_r8/(
hc(ng)+hwater)
874# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
875 tl_hinv=-hinv*hinv*tl_hwater
883 cff2_w=(cff_w+cff1_w*hwater)*hinv
884# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
885 tl_cff2_w=cff1_w*tl_hwater*hinv+ &
886 & (cff_w+cff1_w*hwater)*tl_hinv
891# if defined SEDIMENT_NOT_YET && defined SED_MORPH_NOT_YET
892 tl_zw(k)=
boundary(ng)%tl_zeta_north(i)+ &
894 & tl_hwater)*cff2_w+ &
898 tl_zw(k)=
boundary(ng)%tl_zeta_north(i)+ &
899 &
boundary(ng)%tl_zeta_north(i)*cff2_w
906 tl_hz_bry(i,k,
inorth)=tl_zw(k)-tl_zw(k-1)
926 & lbij, ubij, 1, n(ng), &
929 & tl_hz_bry(:,:,ibry))
947 integer,
intent(in) :: ng, tile
951 character (len=*),
parameter :: myfile = &
952 & __FILE__//
", rp_bath"
960 & lbi, ubi, lbj, ubj, &
961 & imins, imaxs, jmins, jmaxs, &
973 & LBi, UBi, LBj, UBj, &
974 & IminS, ImaxS, JminS, JmaxS, &
988 integer,
intent(in) :: ng, tile
989 integer,
intent(in) :: lbi, ubi, lbj, ubj
990 integer,
intent(in) :: imins, imaxs, jmins, jmaxs
993 real(r8),
intent(in) :: h(lbi:,lbj:)
994 real(r8),
intent(out) :: tl_h(lbi:,lbj:)
996 real(r8),
intent(in) :: h(lbi:ubi,lbj:ubj)
997 real(r8),
intent(out) :: tl_h(lbi:ubi,lbj:ubj)
1004# include "set_bounds.h"
1019 & lbi, ubi, lbj, ubj, &
1025 & lbi, ubi, lbj, ubj, &
subroutine exchange_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
subroutine exchange_r3d_tile(ng, tile, lbi, ubi, lbj, ubj, lbk, ubk, a)
subroutine exchange_w3d_tile(ng, tile, lbi, ubi, lbj, ubj, lbk, ubk, a)
type(t_boundary), dimension(:), allocatable boundary
type(t_coupling), dimension(:), allocatable coupling
type(t_grid), dimension(:), allocatable grid
integer, dimension(:), allocatable n
type(t_bounds), dimension(:), allocatable bounds
type(t_lbc), dimension(:,:,:), allocatable tl_lbc
type(t_domain), dimension(:), allocatable domain
integer, parameter r2dvar
logical, dimension(:), allocatable ewperiodic
logical, dimension(:), allocatable nsperiodic
real(dp), dimension(:), allocatable hc
integer, parameter isouth
type(t_scalars), dimension(:), allocatable scalars
integer, parameter inorth
integer, dimension(:), allocatable vtransform
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 mp_exchange3d_bry(ng, tile, model, nvar, boundary, lbij, ubij, lbk, ubk, nghost, ew_periodic, ns_periodic, a, b, c, d)
subroutine, public rp_set_depth_bry(ng, tile, model)
subroutine, public rp_set_depth(ng, tile, model)
subroutine rp_set_depth_bry_tile(ng, tile, model, lbi, ubi, lbj, ubj, lbij, ubij, imins, imaxs, jmins, jmaxs, h, tl_h, zice, tl_hz_bry)
subroutine, public rp_bath_tile(ng, tile, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, h, tl_h)
subroutine, public rp_set_depth_tile(ng, tile, model, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, nstp, nnew, h, tl_h, zice, zt_avg1, tl_zt_avg1, tl_hz, tl_z_r, tl_z_w)
subroutine, public rp_bath(ng, tile)
recursive subroutine wclock_off(ng, model, region, line, routine)
recursive subroutine wclock_on(ng, model, region, line, routine)