15 #include "inc_openmp.h" 66 integer,
parameter :: il = 1
67 integer,
parameter :: ic = 2
68 integer,
parameter :: ip = 3
69 integer,
parameter :: id = 4
70 integer,
parameter :: iss= 5
71 integer,
parameter :: ig = 6
72 integer,
parameter :: ih = 7
85 basename_org, & ! [IN]
103 integer,
intent(in) :: xs, xe
104 integer,
intent(in) :: ys, ye
105 integer,
intent(in) :: dims(:)
106 integer,
intent(in) :: it
107 integer,
intent(in) :: rank
108 integer,
intent(in) :: handle
109 character(len=*),
intent(in) :: basename_org
110 real(RP),
intent(in) :: dens_org(:,:,:)
111 real(RP),
intent(inout) :: qtrc_org(:,:,:,:)
115 real(RP) :: sigma_sdf(4)
116 real(RP) :: r0_sdf(4)
117 real(RP) :: n0_sdf(4)
118 real(RP) :: rho_sdf(4)
119 character(len=11),
parameter :: fname_micpara=
"micpara.dat" 120 character(len=H_SHORT) :: mp_type_outer =
"NONE" 121 character(len=H_SHORT) :: mp_type_inner =
"NONE" 123 namelist / param_atmos_phy_mp_bin2bulk / &
131 real(RP),
allocatable :: read3di(:,:,:)
132 real(RP),
allocatable :: qc_tmp(:,:,:)
133 real(RP),
allocatable :: qr_tmp(:,:,:)
134 real(RP),
allocatable :: qi_tmp(:,:,:)
135 real(RP),
allocatable :: qs_tmp(:,:,:)
136 real(RP),
allocatable :: qg_tmp(:,:,:)
138 integer :: fid_micpara
139 real(RP) :: coef0, coef1, coef2
140 real(RP) :: tmp_hyd, n_hyd, lambda_hyd
141 real(RP) :: dummy(
nbin ), radc(
nbin )
142 integer :: k, i, j, iq, iqa, ierr
143 integer :: nnbin, nnspc, nn
147 coef0 = 4.0_rp/3.0_rp*pi
148 coef1 = 4.0_rp/3.0_rp*sqrt(pi/2.0_rp)
151 sigma_sdf(1) = 0.2_rp
152 sigma_sdf(2) = 0.35_rp
153 sigma_sdf(3) = 0.35_rp
154 sigma_sdf(4) = 0.35_rp
156 r0_sdf(2) = 2.61e-6_rp
158 r0_sdf(4) = 2.61e-6_rp
159 n0_sdf(1) = 8.0e+6_rp
161 n0_sdf(3) = 3.0e+6_rp
162 n0_sdf(4) = 4.0e+6_rp
165 rho_sdf(3) = 100.0_rp
166 rho_sdf(4) = 400.0_rp
170 allocate( qc_tmp(dims(1)+2,dims(2),dims(3)) )
171 allocate( qr_tmp(dims(1)+2,dims(2),dims(3)) )
172 allocate( qi_tmp(dims(1)+2,dims(2),dims(3)) )
173 allocate( qs_tmp(dims(1)+2,dims(2),dims(3)) )
174 allocate( qg_tmp(dims(1)+2,dims(2),dims(3)) )
177 read(
io_fid_conf,nml=param_atmos_phy_mp_bin2bulk,iostat=ierr)
179 write(*,*)
'xxx Not found namelist PARAM_ATMOS_PHY_MP_BIN2BULK. Check!' 181 elseif( ierr > 0 )
then 182 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_MP_BIN2BULK. Check!' 187 if( trim(mp_type_inner) /=
"SUZUKI10" )
then 188 write(*,*)
'xxx MP_TYPE_INNER should be SUZUKI10 Check!' 189 write(*,*)
'Now MP_TYPE_INNER set as ', mp_type_inner
196 open ( fid_micpara, file = fname_micpara, form =
'formatted', status =
'old', iostat=ierr )
201 read( fid_micpara,* ) nnspc, nnbin
203 if( nnbin /=
nbin )
then 204 write(*,*)
'xxx nbin in inc_tracer and nbin in micpara.dat is different check!' 211 read( fid_micpara,* ) nn, dummy( iq ), radc( iq )
213 "Radius of ", iq,
"th cloud bin (bin center)= ", radc( iq ) ,
"[m]" 216 close ( fid_micpara )
220 write(*,*)
'xxx micpara.dat does not exist. check!' 225 call fileread( read3di(:,:,:), basename_org,
"QV", it, rank )
227 qtrc_org(k+2,xs:xe,ys:ye,
i_qv) = read3di(:,:,k)
230 if( trim(mp_type_outer) ==
"KESSLER" )
then 233 if(
io_l )
write(
io_fid_log,*)
'+++ SDF of Bin model is created from' 234 if(
io_l )
write(
io_fid_log,*)
'+++ Kessler type Bulk microphysical model' 236 call fileread( read3di(:,:,:), basename_org,
"QC", it, rank )
238 qc_tmp(k+2,xs:xe,ys:ye) = read3di(:,:,k)
241 call fileread( read3di(:,:,:), basename_org,
"QR", it, rank )
243 qr_tmp(k+2,xs:xe,ys:ye) = read3di(:,:,k)
251 dummy(iq) = coef1 / sigma_sdf(1) * dwatr * radc( iq )**3 &
253 - ( log( radc(iq) )-log( r0_sdf(1) ) )**2*0.5_rp &
254 / sigma_sdf(1) / sigma_sdf(1) &
260 tmp_hyd = tmp_hyd + dummy(iq)
263 coef2 = ( qc_tmp(k+2,i,j)+qr_tmp(k+2,i,j) ) &
264 / ( tmp_hyd + ( 0.50_rp - sign(0.50_rp,tmp_hyd-eps) ) )
266 qtrc_org(k+2,i,j,
qs_mp+iq) = coef2 * dummy(iq)
273 elseif( trim(mp_type_outer) ==
"TOMITA08" )
then 276 if(
io_l )
write(
io_fid_log,*)
'+++ SDF of Bin model is created from' 277 if(
io_l )
write(
io_fid_log,*)
'+++ TOMITA08 Bulk microphysical model' 279 call fileread( read3di(:,:,:), basename_org,
"QC", it, rank )
281 qc_tmp(k+2,xs:xe,ys:ye) = read3di(:,:,k)
291 call fileread( read3di(:,:,:), basename_org,
"QR", it, rank )
293 qr_tmp(k+2,xs:xe,ys:ye) = read3di(:,:,k)
296 call fileread( read3di(:,:,:), basename_org,
"QI", it, rank )
298 qi_tmp(k+2,xs:xe,ys:ye) = read3di(:,:,k)
301 call fileread( read3di(:,:,:), basename_org,
"QS", it, rank )
303 qs_tmp(k+2,xs:xe,ys:ye) = read3di(:,:,k)
306 call fileread( read3di(:,:,:), basename_org,
"QG", it, rank )
308 qg_tmp(k+2,xs:xe,ys:ye) = read3di(:,:,k)
318 dummy(iq) = coef1 / sigma_sdf(1) * rho_sdf(1) * radc( iq )**3 &
320 - ( log( radc(iq) )-log( r0_sdf(1) ) )**2*0.5_rp &
321 / sigma_sdf(1) / sigma_sdf(1) &
327 tmp_hyd = tmp_hyd + dummy(iq)
331 qc_tmp(k+2,i,j)+qr_tmp(k+2,i,j) &
332 + qs_tmp(k+2,i,j)+qi_tmp(k+2,i,j) &
335 / ( tmp_hyd + ( 0.50_rp - sign(0.50_rp,tmp_hyd-eps) ) )
337 qtrc_org(k+2,i,j,
qs_mp+(il-1)*
nbin+iq) = coef2 * dummy(iq)
344 elseif(
nspc == 7 )
then 352 dummy(iq) = coef1 / sigma_sdf(1) * rho_sdf(1) * radc( iq )**3 &
354 - ( log( radc(iq) )-log( r0_sdf(1) ) )**2*0.5_rp &
355 / sigma_sdf(1) / sigma_sdf(1) &
361 tmp_hyd = tmp_hyd + dummy(iq)
364 coef2 = ( qc_tmp(k+2,i,j)+qr_tmp(k+2,i,j) ) &
365 / ( tmp_hyd + ( 0.50_rp - sign(0.50_rp,tmp_hyd-eps) ) )
367 qtrc_org(k+2,i,j,
qs_mp+(il-1)*
nbin+iq) = coef2 * dummy(iq)
372 dummy(iq) = coef1 / sigma_sdf(2) * rho_sdf(2) * radc( iq )**3 &
374 - ( log( radc(iq) )-log( r0_sdf(2) ) )**2*0.5_rp &
375 / sigma_sdf(2) / sigma_sdf(2) &
381 tmp_hyd = tmp_hyd + dummy(iq)
384 coef2 = qi_tmp(k+2,i,j) &
385 / ( tmp_hyd + ( 0.50_rp - sign(0.50_rp,tmp_hyd-eps) ) )
387 qtrc_org(k+2,i,j,
qs_mp+(ip-1)*
nbin+iq) = coef2 * dummy(iq)
391 n_hyd = coef0 * n0_sdf(3) * rho_sdf(3)
392 lambda_hyd = ( pi * rho_sdf(3) / 6.0_rp *n0_sdf(3) *
sf_gamma(4.0_rp) &
393 / ( qs_tmp(k+2,i,j) &
394 + (0.50_rp-sign(0.50_rp,qs_tmp(k+2,i,j)-eps)) &
397 dummy(iq) = n_hyd * radc( iq )**3 &
398 * exp( -lambda_hyd * 0.5_rp * radc( iq ) )
402 tmp_hyd = tmp_hyd + dummy(iq)
405 coef2 = qs_tmp(k+2,i,j) &
406 / ( tmp_hyd + ( 0.50_rp - sign(0.50_rp,tmp_hyd-eps) ) )
408 qtrc_org(k+2,i,j,
qs_mp+(iss-1)*
nbin+iq) = coef2 * dummy(iq)
412 n_hyd = coef0 * n0_sdf(4) * rho_sdf(4)
413 lambda_hyd = ( pi * rho_sdf(4) / 6.0_rp *n0_sdf(4) *
sf_gamma(4.0_rp) &
414 / ( qg_tmp(k+2,i,j) &
415 + (0.50_rp-sign(0.50_rp,qg_tmp(k+2,i,j)-eps)) &
418 dummy(iq) = n_hyd * radc( iq )**3 &
419 * exp( -lambda_hyd * 0.5_rp * radc( iq ) )
423 tmp_hyd = tmp_hyd + dummy(iq)
426 coef2 = qg_tmp(k+2,i,j) &
427 / ( tmp_hyd + ( 0.50_rp - sign(0.50_rp,tmp_hyd-eps) ) )
429 qtrc_org(k+2,i,j,
qs_mp+(ig-1)*
nbin+iq) = coef2 * dummy(iq)
438 elseif( trim(mp_type_outer) ==
"SN14" )
then 440 write(*,*)
'SN14 is not supported for MP_TYPE_OUTER now' 441 write(*,*)
'Please wait' 444 elseif( trim(mp_type_outer) ==
"SUZUKI10" )
then 447 if(
io_l )
write(
io_fid_log,*)
'+++ SDF of Bin model is created directory' 453 qtrc_org(k+2,xs:xe,ys:ye,iqa) = read3di(:,:,k)
459 write(*,*)
'MP_TYPE_OUTER should be KESSLER, TOMITA08, or SUZUKI10' 460 write(*,*)
'Please check! Now MP_TYPE_OUTER set as ', mp_type_outer
465 deallocate( read3di )
integer, public comm_datatype
datatype of variable
subroutine, public prc_mpistop
Abort MPI.
module ATMOSPHERE / Physics Cloud Microphysics - Convert
real(rp), parameter, public const_dwatr
density of water [kg/m3]
integer, dimension(2), public parent_jmax
parent max number in y-direction
module GRID (nesting system)
logical, public io_l
output log or not? (this process)
real(rp) function, public sf_gamma(x)
Gamma function.
module ATMOSPHERE / Physics Cloud Microphysics
subroutine, public atmos_phy_mp_bulk2bin(xs, xe, ys, ye, dims, it, rank, handle, basename_org, dens_org, qtrc_org)
Bulk to Bin.
character(len=h_short), dimension(:), pointer, public atmos_phy_mp_name
real(rp), parameter, public const_dice
density of ice [kg/m3]
real(rp), public const_undef
logical, public io_nml
output log or not? (for namelist, this process)
integer function, public io_get_available_fid()
search & get available file ID
subroutine, public atmos_phy_mp_bin2bulk
Bin to Bulk.
integer, parameter, public prc_masterrank
master process in each communicator
integer, public prc_myrank
process num in local communicator
integer, dimension(2), public parent_imax
parent max number in x-direction
real(rp), public const_eps
small number
real(rp), public const_pi
pi
integer, public io_fid_conf
Config file ID.
integer, public io_fid_log
Log file ID.
module Spectran Bin Microphysics
integer, public io_fid_nml
Log file ID (only for output namelist)