41 integer,
public,
parameter :: ATMOS_PHY_BL_MYNN_JMAPPLIB_NTRACER = 4
42 character(len=H_SHORT),
public :: ATMOS_PHY_BL_MYNN_JMAPPLIB_NAME(4) = &
43 (/
'TKE_MYNN',
'TSQ_MYNN',
'QSQ_MYNN',
'COV_MYNN' /)
44 character(len=H_LONG),
public :: ATMOS_PHY_BL_MYNN_JMAPPLIB_DESC(4) = &
45 (/
'doubled turbulent kinetic energy (MYNN) ', &
46 'sub-grid variance of liquid water potential temperature (MYNN) ', &
47 'sub-grid variance of total water content (MYNN) ', &
48 'sub-grid covariance of liquid water potential temperature and total water content (MYNN)' /)
49 character(len=H_SHORT),
public :: ATMOS_PHY_BL_MYNN_JMAPPLIB_UNITS(4) = &
50 (/
'm2/s2 ',
'K2 ',
'kg2/kg2',
'K kg ' /)
52 integer,
public,
parameter :: atmos_phy_bl_mynn_jmapplib_ntracer = 0
53 character(len=H_SHORT),
public :: atmos_phy_bl_mynn_jmapplib_name(1) = (/
'' /)
54 character(len=H_LONG),
public :: atmos_phy_bl_mynn_jmapplib_desc(1) = (/
'' /)
55 character(len=H_SHORT),
public :: atmos_phy_bl_mynn_jmapplib_units(1) = (/
'' /)
67 integer,
private,
parameter :: i_tke = 1
68 integer,
private,
parameter :: i_tsq = 2
69 integer,
private,
parameter :: i_qsq = 3
70 integer,
private,
parameter :: i_cov = 4
72 integer,
private :: ke_pbl
74 character(len=3),
private :: atmos_phy_bl_mynn_jmapplib_level =
"3"
75 logical,
private :: atmos_phy_bl_mynn_jmapplib_shcu_buoy_flag = .true.
76 real(
rp),
private :: atmos_phy_bl_mynn_jmapplib_pbl_max = 1.e+99_rp
77 real(
rp),
private :: atmos_phy_bl_mynn_jmapplib_shcu_max = 1.e+99_rp
78 real(
rp),
private :: atmos_phy_bl_mynn_jmapplib_sgm_min_fct = 0.09_rp
80 namelist / param_atmos_phy_bl_mynn_jmapplib / &
81 atmos_phy_bl_mynn_jmapplib_level, &
82 atmos_phy_bl_mynn_jmapplib_shcu_buoy_flag, &
83 atmos_phy_bl_mynn_jmapplib_pbl_max, &
84 atmos_phy_bl_mynn_jmapplib_shcu_max, &
85 atmos_phy_bl_mynn_jmapplib_sgm_min_fct
97 dt, PBL_MAX, SHCU_MAX )
103 use pbl_const,
only: &
105 use pbl_parm,
only: &
107 use pbl_grid,
only: &
109 use pbl_mym_option,
only: &
111 use pbl_mym_option_symbol,
only: &
114 use pbl_mym_parm,
only: &
116 use pbl_mym_const,
only: &
121 integer,
intent(in) ::
ka,
ks,
ke
123 real(
rp),
intent(in) :: cz(
ka)
125 real(
dp),
intent(in),
optional :: dt
126 real(
rp),
intent(in),
optional :: pbl_max
127 real(
rp),
intent(in),
optional :: shcu_max
132 integer :: nz_pbl, nz_shcu
139 log_info(
"ATMOS_PHY_BL_MYNN_JMAPPLIB_setup",*)
'Setup'
140 log_info(
"ATMOS_PHY_BL_MYNN_JMAPPLIB_setup",*)
'Mellor-Yamada Nakanishi-Niino scheme implemented in the JMA Physics Process Library'
143 if (
present(pbl_max) ) atmos_phy_bl_mynn_jmapplib_pbl_max = pbl_max
144 if (
present(shcu_max) ) atmos_phy_bl_mynn_jmapplib_shcu_max = shcu_max
148 read(
io_fid_conf,nml=param_atmos_phy_bl_mynn_jmapplib,iostat=ierr)
150 log_error(
"ATMOS_PHY_BL_MYNN_JMAPPLIB_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_BL_MYNN_JMAPPLIB. Check!'
153 log_nml(param_atmos_phy_bl_mynn_jmapplib)
159 if ( atmos_phy_bl_mynn_jmapplib_pbl_max >= cz(
k) )
then
162 if ( atmos_phy_bl_mynn_jmapplib_shcu_max >= cz(
k) )
then
166 nz_pbl = ke_pbl -
ks + 1
167 nz_shcu = min(ke_shcu -
ks + 1, nz_pbl)
170 call pbl_const_ini(pref_in = pre00, timestep_in = real(dt,
rp), e_emit_in = e_emit)
172 call pbl_grid_ini(nz_pbl, shcu_levels_in = nz_shcu)
174 select case ( atmos_phy_bl_mynn_jmapplib_level )
176 call pbl_mym_option_ini(levflag_in = mymodel3, l_shcu_buoy_in = atmos_phy_bl_mynn_jmapplib_shcu_buoy_flag)
179 call pbl_mym_option_ini(levflag_in = mymodel25, l_shcu_buoy_in = atmos_phy_bl_mynn_jmapplib_shcu_buoy_flag)
181 log_error(
"ATMOS_PHY_BL_MYNN_JMAPPLIB_setup",*)
'only level 2.5 and 3 are supported at this moment'
185 call pbl_mym_parm_ini(my_sgm_min_fct_in = atmos_phy_bl_mynn_jmapplib_sgm_min_fct)
186 call pbl_mym_const_ini
190 log_error(
"ATMOS_PHY_BL_MYNN_JMAPPLIB_setup",*)
'To use "MYNN-JMAPPLIB", compile SCALE with "SCALE_ENABLE_JMAPPLIB=T" option.'
212 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
213 DENS, U, V, POTT, PROG, &
216 SFC_DENS, SFC_PRES, &
217 SFLX_MU, SFLX_MV, SFLX_SH, SFLX_QV, &
220 RHOU_t, RHOV_t, RHOT_t, RHOQV_t, &
231 use pbl_mym_main,
only: &
232 pbl_mym_main_level3, &
234 use pbl_coupler,
only: &
235 pbl_coupler_flx_force_tend_run
236 use pbl_diag,
only: &
241 integer,
intent(in) ::
ka,
ks,
ke
242 integer,
intent(in) ::
ia,
is,
ie
243 integer,
intent(in) ::
ja,
js,
je
245 real(
rp),
intent(in) :: dens (
ka,
ia,
ja)
246 real(
rp),
intent(in) :: u (
ka,
ia,
ja)
247 real(
rp),
intent(in) :: v (
ka,
ia,
ja)
248 real(
rp),
intent(in) :: pott (
ka,
ia,
ja)
249 real(
rp),
intent(in) :: prog (
ka,
ia,
ja,atmos_phy_bl_mynn_jmapplib_ntracer)
250 real(
rp),
intent(in) :: pres (
ka,
ia,
ja)
251 real(
rp),
intent(in) :: exner (
ka,
ia,
ja)
252 real(
rp),
intent(in) :: qdry (
ka,
ia,
ja)
253 real(
rp),
intent(in) :: qv (
ka,
ia,
ja)
254 real(
rp),
intent(in) :: qc (
ka,
ia,
ja)
255 real(
rp),
intent(in) :: qi (
ka,
ia,
ja)
256 real(
rp),
intent(in) :: sfc_dens(
ia,
ja)
257 real(
rp),
intent(in) :: sfc_pres(
ia,
ja)
258 real(
rp),
intent(in) :: sflx_mu (
ia,
ja)
259 real(
rp),
intent(in) :: sflx_mv (
ia,
ja)
260 real(
rp),
intent(in) :: sflx_sh (
ia,
ja)
261 real(
rp),
intent(in) :: sflx_qv (
ia,
ja)
262 real(
rp),
intent(in) :: us (
ia,
ja)
263 real(
rp),
intent(in) :: rlmo (
ia,
ja)
265 real(
rp),
intent(in) :: cz(
ka,
ia,
ja)
266 real(
rp),
intent(in) :: fz(0:
ka,
ia,
ja)
267 real(
rp),
intent(in) :: f2h(
ka,2,
ia,
ja)
268 real(
dp),
intent(in) :: dt
270 real(
rp),
intent(out) :: rhou_t (
ka,
ia,
ja)
271 real(
rp),
intent(out) :: rhov_t (
ka,
ia,
ja)
272 real(
rp),
intent(out) :: rhot_t (
ka,
ia,
ja)
273 real(
rp),
intent(out) :: rhoqv_t(
ka,
ia,
ja)
274 real(
rp),
intent(out) :: rprog_t(
ka,
ia,
ja,atmos_phy_bl_mynn_jmapplib_ntracer)
275 real(
rp),
intent(out) :: nu (
ka,
ia,
ja)
276 real(
rp),
intent(out) :: kh (
ka,
ia,
ja)
277 real(
rp),
intent(out) :: zi (
ia,
ja)
278 real(
rp),
intent(out) :: sflx_buoy (
ia,
ja)
283 real(
rp) :: qke(
ks:ke_pbl)
284 real(
rp) :: qv_lc(
ks:ke_pbl)
285 real(
rp) :: qc_lc(
ks:ke_pbl)
286 real(
rp) :: qi_lc(
ks:ke_pbl)
287 real(
rp) :: dens_lc(
ks:ke_pbl)
288 real(
rp) :: dfm(
ks:ke_pbl)
289 real(
rp) :: dfh(
ks:ke_pbl)
290 real(
rp) :: taux_ex(
ks:ke_pbl)
291 real(
rp) :: tauy_ex(
ks:ke_pbl)
292 real(
rp) :: ftl_ex(
ks:ke_pbl)
293 real(
rp) :: fqw_ex(
ks:ke_pbl)
294 real(
rp) :: tend_qke(
ks:ke_pbl)
295 real(
rp) :: tend_tsq(
ks:ke_pbl)
296 real(
rp) :: tend_qsq(
ks:ke_pbl)
297 real(
rp) :: tend_cov(
ks:ke_pbl)
298 real(
rp) :: tend_u(
ks:ke_pbl)
299 real(
rp) :: tend_v(
ks:ke_pbl)
300 real(
rp) :: tend_pt(
ks:ke_pbl)
301 real(
rp) :: tend_qv(
ks:ke_pbl)
302 real(
rp) :: z_f(
ks:ke_pbl)
303 real(
rp) :: dz_f(
ks:ke_pbl)
304 real(
rp) :: rdz_f(
ks:ke_pbl)
305 real(
rp) :: rdz_h(
ks:ke_pbl)
306 real(
rp) :: h2f_m(
ks:ke_pbl)
307 real(
rp) :: h2f_p(
ks:ke_pbl)
309 real(
rp) :: rho_ov_rhoa
322 log_progress(*)
"atmosphere / physics / pbl / MYNN-JMAPPLIB"
336 qke(
k) = prog(
k,i,j,i_tke) * 2.0_rp
337 rho_ov_rhoa = 1.0_rp / ( qdry(
k,i,j) + qv(
k,i,j) )
338 qv_lc(
k) = qv(
k,i,j) * rho_ov_rhoa
339 qc_lc(
k) = qc(
k,i,j) * rho_ov_rhoa
340 qi_lc(
k) = qi(
k,i,j) * rho_ov_rhoa
341 z_f(
k) = cz(
k,i,j) - fz(
ks-1,i,j)
342 dz_f(
k) = fz(
k,i,j) - fz(
k-1,i,j)
343 rdz_f(
k) = 1.0_rp / dz_f(
k)
344 rdz_h(
k) = 1.0_rp / ( cz(
k+1,i,j) - cz(
k,i,j) )
347 cptot = cpdry + sflx_qv(i,j) * (
cp_vapor - cpdry )
349 sflx_u = sflx_mu(i,j) / sfc_dens(i,j)
350 sflx_v = sflx_mv(i,j) / sfc_dens(i,j)
351 sflx_pt = sflx_sh(i,j) / ( cptot * exner(
ks,i,j) * sfc_dens(i,j) )
352 sflx_q = sflx_qv(i,j) / sfc_dens(i,j)
354 select case ( atmos_phy_bl_mynn_jmapplib_level )
356 call pbl_mym_main_level3( &
357 sflx_u, sflx_v, sflx_pt, sflx_q, &
358 us(i,j), rlmo(i,j), sfc_pres(i,j), &
359 u(
ks:ke_pbl,i,j), v(
ks:ke_pbl,i,j), pott(
ks:ke_pbl,i,j), &
360 qv_lc, qc_lc, qi_lc, pres(
ks:ke_pbl,i,j), exner(
ks:ke_pbl,i,j), &
361 qke(:), prog(
ks:ke_pbl,i,j,i_tsq), prog(
ks:ke_pbl,i,j,i_qsq), prog(
ks:ke_pbl,i,j,i_cov), &
362 z_f, dz_f, rdz_f, rdz_h, f2h(
ks:ke_pbl,2,i,j), f2h(
ks:ke_pbl,1,i,j), h2f_m, h2f_p, &
364 dfm(:), dfh(:), tend_qke(:), tend_tsq(:), tend_qsq(:), tend_cov(:), &
365 taux_ex, tauy_ex, ftl_ex, fqw_ex, &
366 l_e = l(
ks:ke_pbl,i,j), tke_dis = diss(
ks:ke_pbl,i,j), tsq_dis=dummy(
ks:ke_pbl,i,j) )
368 call pbl_mym_main_level25( &
369 sflx_u, sflx_v, sflx_pt, sflx_q, &
370 us(i,j), rlmo(i,j), sfc_pres(i,j), &
371 u(
ks:ke_pbl,i,j), v(
ks:ke_pbl,i,j), pott(
ks:ke_pbl,i,j), &
372 qv_lc, qc_lc, qi_lc, pres(
ks:ke_pbl,i,j), exner(
ks:ke_pbl,i,j), &
373 qke(:), prog(
ks:ke_pbl,i,j,i_tsq), prog(
ks:ke_pbl,i,j,i_qsq), prog(
ks:ke_pbl,i,j,i_cov), &
374 z_f, dz_f, rdz_f, rdz_h, f2h(
ks:ke_pbl,2,i,j), f2h(
ks:ke_pbl,1,i,j), h2f_m, h2f_p, &
376 dfm(:), dfh(:), tend_qke(:), tend_tsq(:), tend_qsq(:), tend_cov(:), &
377 taux_ex, tauy_ex, ftl_ex, fqw_ex, &
378 l_e = l(
ks:ke_pbl,i,j), tke_dis = diss(
ks:ke_pbl,i,j), tsq_dis=dummy(
ks:ke_pbl,i,j) )
380 tend_tsq(
k) = ( tend_tsq(
k) - prog(
k,i,j,i_tsq) ) / dt
381 tend_qsq(
k) = ( tend_qsq(
k) - prog(
k,i,j,i_qsq) ) / dt
382 tend_cov(
k) = ( tend_cov(
k) - prog(
k,i,j,i_cov) ) / dt
387 dens_lc(
k) = dens(
k,i,j) * ( qdry(
k,i,j) + qv(
k,i,j) )
390 call pbl_coupler_flx_force_tend_run( &
391 sfc_dens(i,j), sflx_u, sflx_v, sflx_pt, sflx_q, &
392 dfm(:), dfh(:), dens_lc(:), &
393 taux_ex, tauy_ex, ftl_ex, fqw_ex, &
394 f2h(
ks:ke_pbl,2,i,j), f2h(
ks:ke_pbl,1,i,j), rdz_f, rdz_h, &
395 tend_u, tend_v, tend_pt, tend_qv )
398 rhou_t(
k,i,j) = tend_u(
k) * dens(
k,i,j)
399 rhov_t(
k,i,j) = tend_v(
k) * dens(
k,i,j)
400 rhot_t(
k,i,j) = tend_pt(
k) * dens(
k,i,j)
401 rhoqv_t(
k,i,j) = tend_qv(
k) * dens(
k,i,j) * ( qdry(
k,i,j) + qv(
k,i,j) )
402 rprog_t(
k,i,j,i_tke) = tend_qke(
k) * dens(
k,i,j) * 0.5_rp
403 rprog_t(
k,i,j,i_tsq) = tend_tsq(
k) * dens(
k,i,j)
404 rprog_t(
k,i,j,i_qsq) = tend_qsq(
k) * dens(
k,i,j)
405 rprog_t(
k,i,j,i_cov) = tend_cov(
k) * dens(
k,i,j)
407 rhou_t(
ks,i,j) = rhou_t(
ks,i,j) - sflx_mu(i,j) * rdz_f(
ks)
408 rhov_t(
ks,i,j) = rhov_t(
ks,i,j) - sflx_mv(i,j) * rdz_f(
ks)
409 rhot_t(
ks,i,j) = rhot_t(
ks,i,j) - sflx_pt * sfc_dens(i,j) * rdz_f(
ks)
410 rhoqv_t(
ks,i,j) = rhoqv_t(
ks,i,j) - sflx_qv(i,j) * rdz_f(
ks)
412 rhou_t(
k,i,j) = 0.0_rp
413 rhov_t(
k,i,j) = 0.0_rp
414 rhot_t(
k,i,j) = 0.0_rp
415 rhoqv_t(
k,i,j) = 0.0_rp
416 rprog_t(
k,i,j,i_tke) = 0.0_rp
417 rprog_t(
k,i,j,i_tsq) = 0.0_rp
418 rprog_t(
k,i,j,i_qsq) = 0.0_rp
419 rprog_t(
k,i,j,i_cov) = 0.0_rp
422 nu(
ks-1,i,j) = 0.0_rp
423 kh(
ks-1,i,j) = 0.0_rp
425 nu(
k,i,j) = dfm(
k+1) * f2h(
k,1,i,j) + dfm(
k) * f2h(
k,2,i,j)
426 kh(
k,i,j) = dfh(
k+1) * f2h(
k,1,i,j) + dfh(
k) * f2h(
k,2,i,j)
433 call pbl_diag_pbl_height( &
434 sflx_pt, us(i,j), rlmo(i,j), &
435 u(
ks:ke_pbl,i,j), v(
ks:ke_pbl,i,j), pott(
ks:ke_pbl,i,j), qv_lc, z_f, &
442 l(ke_pbl+1:
ke,:,:) = undef
443 call file_history_in(l(:,:,:),
'L_mix_MYNN',
'minxing length',
'm', fill_halo=.true.)
445 diss(
ks:ke_pbl,:,:) = - diss(
ks:ke_pbl,:,:)
446 diss(ke_pbl+1:
ke,:,:) = undef
447 call file_history_in(diss(:,:,:),
'TKE_diss_MYNN',
'TKE dissipation',
'm2/s3', fill_halo=.true.)