15 #include "inc_openmp.h" 55 qflx_sgs_momz, qflx_sgs_momx, qflx_sgs_momy, &
56 qflx_sgs_rhot, qflx_sgs_rhoq, &
57 RHOQ_t, nu_C, Ri, Pr, &
58 MOMZ, MOMX, MOMY, RHOT, DENS, QTRC, N2, &
59 SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_Q, &
60 GSQRT, J13G, J23G, J33G, MAPF, dt )
66 real(RP),
intent(out) :: qflx_sgs_momz(KA,IA,JA,3)
67 real(RP),
intent(out) :: qflx_sgs_momx(KA,IA,JA,3)
68 real(RP),
intent(out) :: qflx_sgs_momy(KA,IA,JA,3)
69 real(RP),
intent(out) :: qflx_sgs_rhot(KA,IA,JA,3)
70 real(RP),
intent(out) :: qflx_sgs_rhoq(KA,IA,JA,3,QA)
72 real(RP),
intent(inout) :: RHOQ_t (KA,IA,JA,QA)
74 real(RP),
intent(out) :: nu_C (KA,IA,JA)
75 real(RP),
intent(out) :: Ri (KA,IA,JA)
76 real(RP),
intent(out) :: Pr (KA,IA,JA)
78 real(RP),
intent(in) :: MOMZ (KA,IA,JA)
79 real(RP),
intent(in) :: MOMX (KA,IA,JA)
80 real(RP),
intent(in) :: MOMY (KA,IA,JA)
81 real(RP),
intent(in) :: RHOT (KA,IA,JA)
82 real(RP),
intent(in) :: DENS (KA,IA,JA)
83 real(RP),
intent(in) :: QTRC (KA,IA,JA,QA)
84 real(RP),
intent(in) :: N2 (KA,IA,JA)
86 real(RP),
intent(in) :: SFLX_MW (IA,JA)
87 real(RP),
intent(in) :: SFLX_MU (IA,JA)
88 real(RP),
intent(in) :: SFLX_MV (IA,JA)
89 real(RP),
intent(in) :: SFLX_SH (IA,JA)
90 real(RP),
intent(in) :: SFLX_Q (IA,JA,QA)
92 real(RP),
intent(in) :: GSQRT (KA,IA,JA,7)
93 real(RP),
intent(in) :: J13G (KA,IA,JA,7)
94 real(RP),
intent(in) :: J23G (KA,IA,JA,7)
95 real(RP),
intent(in) :: J33G
96 real(RP),
intent(in) :: MAPF (IA,JA,2,4)
97 real(DP),
intent(in) :: dt
107 real(RP),
intent(in) :: CDZ(KA)
108 real(RP),
intent(in) :: CDX(IA)
109 real(RP),
intent(in) :: CDY(JA)
110 real(RP),
intent(in) :: CZ (KA,IA,JA)
114 procedure(tb),
pointer ::
sgs_tb => null()
115 procedure(tb),
pointer :: pbl_tb => null()
117 procedure(
su),
pointer :: sgs_tb_setup => null()
118 procedure(
su),
pointer :: pbl_tb_setup => null()
124 real(RP),
private :: atmos_phy_tb_hybrid_sgs_dx = 100.0_rp
125 real(RP),
private :: atmos_phy_tb_hybrid_pbl_dx = 500.0_rp
127 real(RP),
private,
allocatable :: frac_sgs (:,:)
128 real(RP),
private,
allocatable :: frac_pbl (:,:)
129 real(RP),
private,
allocatable :: frac_sgs_tke(:,:)
130 real(RP),
private,
allocatable :: frac_pbl_tke(:,:)
132 integer,
private :: i_tke_sgs, i_tke_pbl
153 character(len=*),
intent(in) :: tb_type
154 integer,
intent(out) :: i_tke_out
156 character(len=H_SHORT) :: atmos_phy_tb_hybrid_sgs_type =
'SMAGORINSKY' 157 character(len=H_SHORT) :: atmos_phy_tb_hybrid_pbl_type =
'MYNN' 159 namelist / param_atmos_phy_tb_hybrid / &
160 atmos_phy_tb_hybrid_sgs_dx, &
161 atmos_phy_tb_hybrid_pbl_dx, &
162 atmos_phy_tb_hybrid_sgs_type, &
163 atmos_phy_tb_hybrid_pbl_type
169 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[Turbulence Tracer] / Categ[ATMOS PHYSICS] / Origin[SCALElib]' 170 if(
io_l )
write(
io_fid_log,*)
'*** Tracers for SGS-parameterization hybrid Model' 172 if ( tb_type /=
'HYBRID' )
then 173 write(*,*)
'xxx ATMOS_PHY_TB_TYPE is not HYBRID. Check!' 179 read(
io_fid_conf,nml=param_atmos_phy_tb_hybrid,iostat=ierr)
181 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 182 elseif( ierr > 0 )
then 183 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_TB_HYBRID. Check!' 188 select case( atmos_phy_tb_hybrid_sgs_type )
191 atmos_phy_tb_hybrid_sgs_type, &
196 write(*,*)
'xxx ATMOS_PHY_TB_HYBRID_SGS_TYPE is invalid' 200 select case( atmos_phy_tb_hybrid_pbl_type )
203 atmos_phy_tb_hybrid_pbl_type, &
208 write(*,*)
'xxx ATMOS_PHY_TB_HYBRID_PBL_TYPE is invalid' 212 i_tke_out = i_tke_pbl
223 real(RP),
intent(in) :: cdz(
ka)
224 real(RP),
intent(in) :: cdx(
ia)
225 real(RP),
intent(in) :: cdy(
ja)
226 real(RP),
intent(in) :: cz (
ka,
ia,
ja)
234 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[Turbulence] / Categ[ATMOS PHYSICS] / Origin[SCALElib]' 235 if(
io_l )
write(
io_fid_log,*)
'*** SGS-parameterization hybrid Model' 237 call sgs_tb_setup( cdz, cdx, cdy, cz )
238 call pbl_tb_setup( cdz, cdx, cdy, cz )
240 allocate( frac_sgs(
ia,
ja) )
241 allocate( frac_pbl(
ia,
ja) )
242 allocate( frac_sgs_tke(
ia,
ja) )
243 allocate( frac_pbl_tke(
ia,
ja) )
247 dxy = sqrt( 0.5_rp * ( cdx(i)**2 + cdy(j)**2 ) )
249 frac_pbl(i,j) = ( dxy - atmos_phy_tb_hybrid_sgs_dx ) / ( atmos_phy_tb_hybrid_pbl_dx - atmos_phy_tb_hybrid_sgs_dx )
250 frac_pbl(i,j) = min( 1.0_rp, max( 0.0_rp, frac_pbl(i,j) ) )
251 frac_sgs(i,j) = 1.0_rp - frac_pbl(i,j)
260 qflx_sgs_momz, qflx_sgs_momx, qflx_sgs_momy, &
261 qflx_sgs_rhot, qflx_sgs_rhoq, &
264 MOMZ, MOMX, MOMY, RHOT, DENS, QTRC, N2, &
265 SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_Q, &
266 GSQRT, J13G, J23G, J33G, MAPF, dt )
274 real(RP),
intent(out) :: qflx_sgs_momz(
ka,
ia,
ja,3)
275 real(RP),
intent(out) :: qflx_sgs_momx(
ka,
ia,
ja,3)
276 real(RP),
intent(out) :: qflx_sgs_momy(
ka,
ia,
ja,3)
277 real(RP),
intent(out) :: qflx_sgs_rhot(
ka,
ia,
ja,3)
278 real(RP),
intent(out) :: qflx_sgs_rhoq(
ka,
ia,
ja,3,
qa)
280 real(RP),
intent(inout) :: rhoq_t (
ka,
ia,
ja,
qa)
282 real(RP),
intent(out) :: nu (
ka,
ia,
ja)
283 real(RP),
intent(out) :: pr (
ka,
ia,
ja)
284 real(RP),
intent(out) :: ri (
ka,
ia,
ja)
286 real(RP),
intent(in) :: momz (
ka,
ia,
ja)
287 real(RP),
intent(in) :: momx (
ka,
ia,
ja)
288 real(RP),
intent(in) :: momy (
ka,
ia,
ja)
289 real(RP),
intent(in) :: rhot (
ka,
ia,
ja)
290 real(RP),
intent(in) :: dens (
ka,
ia,
ja)
291 real(RP),
intent(in) :: qtrc (
ka,
ia,
ja,
qa)
292 real(RP),
intent(in) :: n2 (
ka,
ia,
ja)
294 real(RP),
intent(in) :: sflx_mw (
ia,
ja)
295 real(RP),
intent(in) :: sflx_mu (
ia,
ja)
296 real(RP),
intent(in) :: sflx_mv (
ia,
ja)
297 real(RP),
intent(in) :: sflx_sh (
ia,
ja)
298 real(RP),
intent(in) :: sflx_q (
ia,
ja,
qa)
300 real(RP),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
301 real(RP),
intent(in) :: j13g (
ka,
ia,
ja,7)
302 real(RP),
intent(in) :: j23g (
ka,
ia,
ja,7)
303 real(RP),
intent(in) :: j33g
304 real(RP),
intent(in) :: mapf (
ia,
ja,2,4)
305 real(DP),
intent(in) :: dt
307 real(RP) :: w_qflx_sgs_momz(
ka,
ia,
ja,3,2)
308 real(RP) :: w_qflx_sgs_momx(
ka,
ia,
ja,3,2)
309 real(RP) :: w_qflx_sgs_momy(
ka,
ia,
ja,3,2)
310 real(RP) :: w_qflx_sgs_rhot(
ka,
ia,
ja,3,2)
311 real(RP) :: w_qflx_sgs_rhoq(
ka,
ia,
ja,3,
qa,2)
313 real(RP) :: w_nu (
ka,
ia,
ja,2)
314 real(RP) :: w_ri (
ka,
ia,
ja,2)
315 real(RP) :: w_pr (
ka,
ia,
ja,2)
317 integer :: k, i, j, iq
320 call sgs_tb( w_qflx_sgs_momz(:,:,:,:,1), w_qflx_sgs_momx(:,:,:,:,1), &
321 w_qflx_sgs_momy(:,:,:,:,1), w_qflx_sgs_rhot(:,:,:,:,1), &
322 w_qflx_sgs_rhoq(:,:,:,:,:,1), &
324 w_nu(:,:,:,1), w_ri(:,:,:,1), w_pr(:,:,:,1), &
325 momz, momx, momy, rhot, dens, qtrc, n2, &
326 sflx_mw, sflx_mu, sflx_mv, sflx_sh, sflx_q, &
327 gsqrt, j13g, j23g, j33g, mapf, dt )
329 call pbl_tb( w_qflx_sgs_momz(:,:,:,:,2), w_qflx_sgs_momx(:,:,:,:,2), &
330 w_qflx_sgs_momy(:,:,:,:,2), w_qflx_sgs_rhot(:,:,:,:,2), &
331 w_qflx_sgs_rhoq(:,:,:,:,:,2), &
333 w_nu(:,:,:,2), w_ri(:,:,:,2), w_pr(:,:,:,2), &
334 momz, momx, momy, rhot, dens, qtrc, n2, &
335 sflx_mw, sflx_mu, sflx_mv, sflx_sh, sflx_q, &
336 gsqrt, j13g, j23g, j33g, mapf, dt )
343 qflx_sgs_momz(k,i,j,
zdir) = w_qflx_sgs_momz(k,i,j,
zdir,1) * frac_sgs(i,j) &
344 + w_qflx_sgs_momz(k,i,j,
zdir,2) * frac_pbl(i,j)
345 qflx_sgs_momz(k,i,j,
xdir) = w_qflx_sgs_momz(k,i,j,
xdir,1)
346 qflx_sgs_momz(k,i,j,
ydir) = w_qflx_sgs_momz(k,i,j,
ydir,1)
354 qflx_sgs_momx(k,i,j,
zdir) = w_qflx_sgs_momx(k,i,j,
zdir,1) * frac_sgs(i,j) &
355 + w_qflx_sgs_momx(k,i,j,
zdir,2) * frac_pbl(i,j)
356 qflx_sgs_momx(k,i,j,
xdir) = w_qflx_sgs_momx(k,i,j,
xdir,1)
357 qflx_sgs_momx(k,i,j,
ydir) = w_qflx_sgs_momx(k,i,j,
ydir,1)
365 qflx_sgs_momy(k,i,j,
zdir) = w_qflx_sgs_momy(k,i,j,
zdir,1) * frac_sgs(i,j) &
366 + w_qflx_sgs_momy(k,i,j,
zdir,2) * frac_pbl(i,j)
367 qflx_sgs_momy(k,i,j,
xdir) = w_qflx_sgs_momy(k,i,j,
xdir,1)
368 qflx_sgs_momy(k,i,j,
ydir) = w_qflx_sgs_momy(k,i,j,
ydir,1)
376 qflx_sgs_rhot(k,i,j,
zdir) = w_qflx_sgs_rhot(k,i,j,
zdir,1) * frac_sgs(i,j) &
377 + w_qflx_sgs_rhot(k,i,j,
zdir,2) * frac_pbl(i,j)
378 qflx_sgs_rhot(k,i,j,
xdir) = w_qflx_sgs_rhot(k,i,j,
xdir,1)
379 qflx_sgs_rhot(k,i,j,
ydir) = w_qflx_sgs_rhot(k,i,j,
ydir,1)
390 if ( iq == i_tke_sgs .or. iq == i_tke_pbl )
then 391 qflx_sgs_rhoq(:,:,:,:,iq) = 0.0_rp
399 qflx_sgs_rhoq(k,i,j,
zdir,iq) = w_qflx_sgs_rhoq(k,i,j,
zdir,iq,1) * frac_sgs(i,j) &
400 + w_qflx_sgs_rhoq(k,i,j,
zdir,iq,2) * frac_pbl(i,j)
401 qflx_sgs_rhoq(k,i,j,
xdir,iq) = w_qflx_sgs_rhoq(k,i,j,
xdir,iq,1)
402 qflx_sgs_rhoq(k,i,j,
ydir,iq) = w_qflx_sgs_rhoq(k,i,j,
ydir,iq,1)
412 nu(k,i,j) = w_nu(k,i,j,1) * frac_sgs(i,j) &
413 + w_nu(k,i,j,2) * frac_pbl(i,j)
421 ri(k,i,j) = w_ri(k,i,j,1) * frac_sgs(i,j) &
422 + w_ri(k,i,j,2) * frac_pbl(i,j)
430 pr(k,i,j) = w_pr(k,i,j,1) * frac_sgs(i,j) &
431 + w_pr(k,i,j,2) * frac_pbl(i,j)
module ATMOSPHERE / Physics Turbulence
subroutine, public prc_mpistop
Abort MPI.
logical, public io_l
output log or not? (this process)
integer, parameter, public zdir
integer, parameter, public ydir
integer, public ke
end point of inner domain: z, local
integer, parameter, public xdir
subroutine, public atmos_phy_tb_smg_setup(CDZ, CDX, CDY, CZ)
Setup.
logical, dimension(qa_max), public tracer_advc
subroutine, public atmos_phy_tb_mynn_setup(CDZ, CDX, CDY, CZ)
Setup.
subroutine, public check(current_line, v)
Undefined value checker.
real(rp), public const_undef
logical, public io_nml
output log or not? (for namelist, this process)
module ATMOSPHERE / Physics Turbulence
integer, public ia
of whole cells: x, local, with HALO
procedure(tb), pointer sgs_tb
integer, public ka
of whole cells: z, local, with HALO
subroutine, public atmos_phy_tb_hybrid_config(TB_TYPE, I_TKE_out)
Config.
subroutine, public atmos_phy_tb_mynn(qflx_sgs_momz, qflx_sgs_momx, qflx_sgs_momy, qflx_sgs_rhot, qflx_sgs_rhoq, RHOQ_t, Nu, Ri, Pr, MOMZ, MOMX, MOMY, RHOT, DENS, QTRC, N2_in, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_Q, GSQRT, J13G, J23G, J33G, MAPF, dt)
real(rp), public const_grav
standard acceleration of gravity [m/s2]
integer, parameter, public const_undef2
undefined value (INT2)
subroutine, public atmos_phy_tb_mynn_config(TYPE_TB, I_TKE_out)
Config.
subroutine, public atmos_phy_tb_hybrid_setup(CDZ, CDX, CDY, CZ)
Setup.
integer, public ks
start point of inner domain: z, local
subroutine, public atmos_phy_tb_smg(qflx_sgs_momz, qflx_sgs_momx, qflx_sgs_momy, qflx_sgs_rhot, qflx_sgs_rhoq, RHOQ_t, Nu, Ri, Pr, MOMZ, MOMX, MOMY, RHOT, DENS, QTRC, N2, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_Q, GSQRT, J13G, J23G, J33G, MAPF, dt)
integer, public io_fid_conf
Config file ID.
subroutine, public atmos_phy_tb_hybrid(qflx_sgs_momz, qflx_sgs_momx, qflx_sgs_momy, qflx_sgs_rhot, qflx_sgs_rhoq, RHOQ_t, Nu, Ri, Pr, MOMZ, MOMX, MOMY, RHOT, DENS, QTRC, N2, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_Q, GSQRT, J13G, J23G, J33G, MAPF, dt)
integer, public io_fid_log
Log file ID.
module ATMOSPHERE / Physics Turbulence
subroutine, public atmos_phy_tb_smg_config(TYPE_TB, I_TKE_out)
Config.
integer, public io_fid_nml
Log file ID (only for output namelist)
integer, public ja
of whole cells: y, local, with HALO