23 #if defined DEBUG || defined QUICKDEBUG
53 real(RP),
private,
parameter :: OneOverThree = 1.0_rp / 3.0_rp
55 real(RP),
private :: ATMOS_PHY_TB_DNS_NU = 1.512e-5_rp
57 real(RP),
private :: ATMOS_PHY_TB_DNS_MU = 1.512e-5_rp
59 logical,
private :: twoD
60 integer,
private :: ISn, IEp
73 character(len=*),
intent(in) :: type_tb
74 integer,
intent(out) :: i_tke_out
78 log_info(
"ATMOS_PHY_TB_dns_config",*)
'Setup'
79 log_info(
"ATMOS_PHY_TB_dns_config",*)
'Tracers for Deardorff (1980) 1.5th TKE Model'
81 if ( type_tb /=
'DNS' )
then
82 log_error(
"ATMOS_PHY_TB_dns_config",*)
'ATMOS_PHY_TB_TYPE is not DNS. Check!'
97 real(rp),
intent(in) :: cdz(
ka)
98 real(rp),
intent(in) :: cdx(
ia)
99 real(rp),
intent(in) :: cdy(
ja)
100 real(rp),
intent(in) :: cz (
ka,
ia,
ja)
102 namelist / param_atmos_phy_tb_dns / &
103 atmos_phy_tb_dns_nu, &
110 log_info(
"ATMOS_PHY_TB_dns_setup",*)
'Setup'
111 log_info(
"ATMOS_PHY_TB_dns_setup",*)
'Eddy Viscocity Model for DNS'
115 read(
io_fid_conf,nml=param_atmos_phy_tb_dns,iostat=ierr)
117 log_info(
"ATMOS_PHY_TB_dns_setup",*)
'Not found namelist. Default used.'
118 elseif( ierr > 0 )
then
119 log_error(
"ATMOS_PHY_TB_dns_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_TB_DNS. Check!'
122 log_nml(param_atmos_phy_tb_dns)
138 qflx_sgs_MOMZ, qflx_sgs_MOMX, qflx_sgs_MOMY, &
139 qflx_sgs_rhot, qflx_sgs_rhoq, &
140 RHOQ_t, nu, Ri, Pr, &
141 MOMZ, MOMX, MOMY, POTT, DENS, QTRC, N2, &
142 SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_Q, &
143 FZ, FDZ, RCDZ, RFDZ, CDX, FDX, CDY, FDY, &
144 GSQRT, J13G, J23G, J33G, MAPF, dt )
155 real(rp),
intent(out) :: qflx_sgs_momz(
ka,
ia,
ja,3)
156 real(rp),
intent(out) :: qflx_sgs_momx(
ka,
ia,
ja,3)
157 real(rp),
intent(out) :: qflx_sgs_momy(
ka,
ia,
ja,3)
158 real(rp),
intent(out) :: qflx_sgs_rhot(
ka,
ia,
ja,3)
159 real(rp),
intent(out) :: qflx_sgs_rhoq(
ka,
ia,
ja,3,
qa)
161 real(rp),
intent(inout) :: rhoq_t(
ka,
ia,
ja,
qa)
163 real(rp),
intent(out) :: nu(
ka,
ia,
ja)
164 real(rp),
intent(out) :: ri(
ka,
ia,
ja)
165 real(rp),
intent(out) :: pr(
ka,
ia,
ja)
167 real(rp),
intent(in) :: momz(
ka,
ia,
ja)
168 real(rp),
intent(in) :: momx(
ka,
ia,
ja)
169 real(rp),
intent(in) :: momy(
ka,
ia,
ja)
170 real(rp),
intent(in) :: pott(
ka,
ia,
ja)
171 real(rp),
intent(in) :: dens(
ka,
ia,
ja)
172 real(rp),
intent(in) :: qtrc(
ka,
ia,
ja,
qa)
173 real(rp),
intent(in) :: n2(
ka,
ia,
ja)
175 real(rp),
intent(in) :: sflx_mw(
ia,
ja)
176 real(rp),
intent(in) :: sflx_mu(
ia,
ja)
177 real(rp),
intent(in) :: sflx_mv(
ia,
ja)
178 real(rp),
intent(in) :: sflx_sh(
ia,
ja)
179 real(rp),
intent(in) :: sflx_q (
ia,
ja,
qa)
181 real(rp),
intent(in) :: fz (0:
ka,
ia,
ja)
182 real(rp),
intent(in) :: fdz (
ka-1)
183 real(rp),
intent(in) :: rcdz (
ka)
184 real(rp),
intent(in) :: rfdz (
ka-1)
185 real(rp),
intent(in) :: cdx (
ia)
186 real(rp),
intent(in) :: fdx (
ia-1)
187 real(rp),
intent(in) :: cdy (
ja)
188 real(rp),
intent(in) :: fdy (
ja-1)
190 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
191 real(rp),
intent(in) :: j13g (
ka,
ia,
ja,7)
192 real(rp),
intent(in) :: j23g (
ka,
ia,
ja,7)
193 real(rp),
intent(in) :: j33g
194 real(rp),
intent(in) :: mapf (
ia,
ja,2,4)
195 real(
dp),
intent(in) :: dt
198 real(rp) :: s33_c(
ka,
ia,
ja)
199 real(rp) :: s11_c(
ka,
ia,
ja)
200 real(rp) :: s22_c(
ka,
ia,
ja)
201 real(rp) :: s31_c(
ka,
ia,
ja)
202 real(rp) :: s12_c(
ka,
ia,
ja)
203 real(rp) :: s23_c(
ka,
ia,
ja)
204 real(rp) :: s12_z(
ka,
ia,
ja)
205 real(rp) :: s23_x(
ka,
ia,
ja)
206 real(rp) :: s31_y(
ka,
ia,
ja)
219 integer ::
k, i, j, iq
231 log_progress(*)
'atmosphere / physics / turbulence / DNS'
235 qflx_sgs_momz(:,:,:,:) = undef
236 qflx_sgs_momx(:,:,:,:) = undef
237 qflx_sgs_momy(:,:,:,:) = undef
238 qflx_sgs_rhot(:,:,:,:) = undef
239 qflx_sgs_rhoq(:,:,:,:,:) = undef
254 kh(:,:,:) = atmos_phy_tb_dns_mu
260 call calc_strain_tensor( &
261 s33_c, s11_c, s22_c, &
262 s31_c, s12_c, s23_c, &
263 s12_z, s23_x, s31_y, &
265 dens, momz, momx, momy, &
266 gsqrt, j13g, j23g, j33g, mapf )
286 qflx_sgs_momz(
k,i,j,
zdir) = dens(
k,i,j) * ( &
287 - 2.0_rp * atmos_phy_tb_dns_nu &
288 * ( s33_c(
k,i,j) - ( s22_c(
k,i,j) + s33_c(
k,i,j) ) * oneoverthree ) )
298 qflx_sgs_momz(
k,i,j,
zdir) = dens(
k,i,j) * ( &
299 - 2.0_rp * atmos_phy_tb_dns_nu &
300 * ( s33_c(
k,i,j) - ( s11_c(
k,i,j) + s22_c(
k,i,j) + s33_c(
k,i,j) ) * oneoverthree ) )
311 qflx_sgs_momz(
ks,i,j,
zdir) = 0.0_rp
312 qflx_sgs_momz(
ke,i,j,
zdir) = 0.0_rp
319 if ( .not. twod )
then
325 qflx_sgs_momz(
k,i,j,
xdir) = - 0.5_rp &
326 * ( dens(
k,i,j)+dens(
k+1,i,j)+dens(
k,i+1,j)+dens(
k+1,i+1,j) ) &
327 * atmos_phy_tb_dns_nu &
342 qflx_sgs_momz(
k,i,j,
ydir) = - 0.5_rp &
343 * ( dens(
k,i,j)+dens(
k+1,i,j)+dens(
k,i,j+1)+dens(
k+1,i,j+1) ) &
344 * atmos_phy_tb_dns_nu &
356 if ( .not. twod )
then
367 qflx_sgs_momx(
k,i,j,
zdir) = - 0.5_rp &
368 * ( dens(
k,i,j)+dens(
k+1,i,j)+dens(
k,i+1,j)+dens(
k+1,i+1,j) ) &
369 * atmos_phy_tb_dns_nu &
381 qflx_sgs_momx(
ks-1,i,j,
zdir) = 0.0_rp
382 qflx_sgs_momx(
ke ,i,j,
zdir) = 0.0_rp
394 qflx_sgs_momx(
k,i,j,
xdir) = dens(
k,i,j) * ( &
395 - 2.0_rp * atmos_phy_tb_dns_nu &
396 * ( s11_c(
k,i,j) - ( s11_c(
k,i,j) + s22_c(
k,i,j) + s33_c(
k,i,j) ) * oneoverthree ) )
409 qflx_sgs_momx(
k,i,j,
ydir) = - 0.5_rp &
410 * ( dens(
k,i,j)+dens(
k,i+1,j)+dens(
k,i,j+1)+dens(
k,i+1,j+1) ) &
411 * atmos_phy_tb_dns_nu &
433 qflx_sgs_momy(
k,i,j,
zdir) = - 0.5_rp &
434 * ( dens(
k,i,j)+dens(
k+1,i,j)+dens(
k,i,j+1)+dens(
k+1,i,j+1) ) &
435 * atmos_phy_tb_dns_nu &
447 qflx_sgs_momy(
ks-1,i,j,
zdir) = 0.0_rp
448 qflx_sgs_momy(
ke ,i,j,
zdir) = 0.0_rp
455 if ( .not. twod )
then
461 qflx_sgs_momy(
k,i,j,
xdir) = - 0.5_rp &
462 * ( dens(
k,i,j)+dens(
k,i+1,j)+dens(
k,i,j+1)+dens(
k,i+1,j+1) ) &
463 * atmos_phy_tb_dns_nu &
479 qflx_sgs_momy(
k,i,j,
ydir) = dens(
k,i,j) * ( &
480 - 2.0_rp * atmos_phy_tb_dns_nu &
481 * ( s22_c(
k,i,j) - ( s22_c(
k,i,j) + s33_c(
k,i,j) ) * oneoverthree ) )
492 qflx_sgs_momy(
k,i,j,
ydir) = dens(
k,i,j) * ( &
493 - 2.0_rp * atmos_phy_tb_dns_nu &
494 * ( s22_c(
k,i,j) - ( s11_c(
k,i,j) + s22_c(
k,i,j) + s33_c(
k,i,j) ) * oneoverthree ) )
506 call calc_flux_phi( &
508 dens, pott, kh, 1.0_rp, &
509 gsqrt, j13g, j23g, j33g, mapf, &
528 call calc_flux_phi( &
529 qflx_sgs_rhoq(:,:,:,:,iq), &
530 dens, qtrc(:,:,:,iq), kh, 1.0_rp, &
531 gsqrt, j13g, j23g, j33g, mapf, &