54 profile_isa => atmos_profile_isa
56 hydrometeor_lhv => atmos_hydrometeor_lhv
58 hydrostatic_buildrho => atmos_hydrostatic_buildrho, &
59 hydrostatic_buildrho_atmos => atmos_hydrostatic_buildrho_atmos, &
60 hydrostatic_buildrho_bytemp => atmos_hydrostatic_buildrho_bytemp
62 saturation_pres2qsat_all => atmos_saturation_pres2qsat_all, &
63 saturation_psat_all => atmos_saturation_psat_all
107 integer,
public,
parameter ::
i_rico = 15
122 integer,
public,
parameter ::
i_real = 25
136 private :: bubble_setup
137 private :: sbmaero_setup
138 private :: aerosol_setup
140 private :: mkinit_planestate
141 private :: mkinit_tracerbubble
142 private :: mkinit_coldbubble
143 private :: mkinit_lambwave
144 private :: mkinit_gravitywave
145 private :: mkinit_khwave
146 private :: mkinit_turbulence
147 private :: mkinit_cavityflow
148 private :: mkinit_mountainwave
149 private :: mkinit_barocwave
151 private :: mkinit_warmbubble
152 private :: mkinit_supercell
153 private :: mkinit_squallline
154 private :: mkinit_wk1982
155 private :: mkinit_dycoms2_rf01
156 private :: mkinit_dycoms2_rf02
157 private :: mkinit_rico
158 private :: mkinit_bomex
160 private :: mkinit_landcouple
161 private :: mkinit_oceancouple
162 private :: mkinit_urbancouple
163 private :: mkinit_seabreeze
164 private :: mkinit_heatisland
166 private :: mkinit_dycoms2_rf02_dns
168 private :: mkinit_real
170 private :: mkinit_grayzone
172 private :: mkinit_boxaero
173 private :: mkinit_warmbubbleaero
179 integer,
private,
parameter :: niter_rh = 4
180 real(
rp),
private,
parameter :: thetastd = 300.0_rp
182 real(
rp),
private,
allocatable :: pres (:,:,:)
183 real(
rp),
private,
allocatable :: temp (:,:,:)
184 real(
rp),
private,
allocatable :: pott (:,:,:)
185 real(
rp),
private,
allocatable :: psat (:,:,:)
186 real(
rp),
private,
allocatable :: qv (:,:,:)
187 real(
rp),
private,
allocatable :: qc (:,:,:)
188 real(
rp),
private,
allocatable :: nc (:,:,:)
189 real(
rp),
private,
allocatable :: velx (:,:,:)
190 real(
rp),
private,
allocatable :: vely (:,:,:)
191 real(
rp),
private,
allocatable :: ptrc (:,:,:)
193 real(
rp),
private,
allocatable :: pres_sfc(:,:)
194 real(
rp),
private,
allocatable :: temp_sfc(:,:)
195 real(
rp),
private,
allocatable :: pott_sfc(:,:)
196 real(
rp),
private,
allocatable :: qsat_sfc(:,:)
197 real(
rp),
private,
allocatable :: qv_sfc (:,:)
198 real(
rp),
private,
allocatable :: qc_sfc (:,:)
200 real(
rp),
private,
allocatable :: rndm (:,:,:)
201 real(
rp),
private,
allocatable,
target :: bubble (:,:,:)
202 real(
rp),
private,
allocatable,
target :: rect (:,:,:)
203 real(
rp),
private,
allocatable :: gan (:)
212 character(len=H_SHORT) :: mkinit_initname =
'NONE'
214 namelist / param_mkinit / &
221 log_info(
"MKINIT_setup",*)
'Setup'
227 log_info(
"MKINIT_setup",*)
'Not found namelist. Default used.'
228 elseif( ierr > 0 )
then
229 log_error(
"MKINIT_setup",*)
'Not appropriate names in namelist PARAM_MKINIT. Check!'
232 log_nml(param_mkinit)
234 allocate( pres(
ka,
ia,
ja) )
235 allocate( temp(
ka,
ia,
ja) )
236 allocate( pott(
ka,
ia,
ja) )
237 allocate( psat(
ka,
ia,
ja) )
241 allocate( velx(
ka,
ia,
ja) )
242 allocate( vely(
ka,
ia,
ja) )
243 allocate( ptrc(
ka,
ia,
ja) )
245 allocate( pres_sfc(
ia,
ja) )
246 allocate( temp_sfc(
ia,
ja) )
247 allocate( pott_sfc(
ia,
ja) )
248 allocate( qsat_sfc(
ia,
ja) )
249 allocate( qv_sfc(
ia,
ja) )
250 allocate( qc_sfc(
ia,
ja) )
252 allocate( rndm(
ka,
ia,
ja) )
253 allocate( bubble(
ka,
ia,
ja) )
254 allocate( rect(
ka,
ia,
ja) )
258 select case(trim(mkinit_initname))
300 case(
'INTERPORATION')
317 case(
'DYCOMS2_RF02_DNS')
325 case(
'WARMBUBBLEAERO')
333 log_error(
"MKINIT_setup",*)
'Unsupported TYPE:', trim(mkinit_initname)
347 log_info(
"MKINIT_finalize",*)
'Finalize'
362 deallocate( pres_sfc )
363 deallocate( temp_sfc )
364 deallocate( pott_sfc )
365 deallocate( qsat_sfc )
378 subroutine mkinit( output )
391 logical,
intent(out) :: output
396 logical :: convert_qtrc
397 integer ::
k, i, j, iq
402 log_progress(*)
'skip making initial data'
406 log_progress(*)
'start making initial data'
422 pres_sfc(:,:) = undef
423 temp_sfc(:,:) = undef
424 pott_sfc(:,:) = undef
425 qsat_sfc(:,:) = undef
444 qtrc(:,:,:,:) = undef
446 qhyd(:,:,:,:) = 0.0_rp
448 qnum(:,:,:,:) = 0.0_rp
454 convert_qtrc = .true.
458 call mkinit_planestate
460 call mkinit_tracerbubble
462 call mkinit_coldbubble
466 call mkinit_gravitywave
470 call mkinit_turbulence
472 call mkinit_mountainwave
474 call mkinit_warmbubble
476 call mkinit_supercell
478 call mkinit_squallline
482 call mkinit_dycoms2_rf01
484 call mkinit_dycoms2_rf02
490 call mkinit_planestate
491 call mkinit_oceancouple
493 call mkinit_planestate
494 call mkinit_landcouple
496 call mkinit_planestate
497 call mkinit_urbancouple
499 call mkinit_planestate
500 call mkinit_oceancouple
501 call mkinit_landcouple
502 call mkinit_urbancouple
504 call mkinit_planestate
505 call mkinit_warmbubble
506 call mkinit_oceancouple
507 call mkinit_landcouple
508 call mkinit_urbancouple
510 call mkinit_planestate
511 call mkinit_seabreeze
513 call mkinit_planestate
514 call mkinit_heatisland
516 call mkinit_dycoms2_rf02_dns
519 convert_qtrc = .false.
525 call mkinit_warmbubbleaero
527 call mkinit_cavityflow
529 call mkinit_barocwave
531 log_error(
"MKINIT",*)
'Unsupported TYPE:',
mkinit_type
539 qhyd(:,:,:,
i_hc) = qc(:,:,:)
541 qnum(:,:,:,
i_hc) = nc(:,:,:)
544 qv(:,:,:), qhyd(:,:,:,:), &
553 call sbmaero_setup( convert_qtrc )
557 if ( iq > 0 )
qtrc(:,:,:,iq) = ptrc(:,:,:)
565 if (
qtrc(
k,i,j,iq) == undef )
then
566 qtrc(
k,i,j,iq) = 0.0_rp
576 log_progress(*)
'end making initial data'
587 subroutine bubble_setup
593 logical :: bbl_eachnode = .false.
594 real(
rp) :: bbl_cz = 2.e3_rp
595 real(
rp) :: bbl_cx = 2.e3_rp
596 real(
rp) :: bbl_cy = 2.e3_rp
597 real(
rp) :: bbl_rz = 0.0_rp
598 real(
rp) :: bbl_rx = 0.0_rp
599 real(
rp) :: bbl_ry = 0.0_rp
600 character(len=H_SHORT) :: bbl_functype =
'COSBELL'
602 namelist / param_bubble / &
612 real(
rp) :: cz_offset
613 real(
rp) :: cx_offset
614 real(
rp) :: cy_offset
615 real(
rp) :: distx, disty, distz
617 real(
rp) :: domain_rx, domain_ry
625 log_info(
"BUBBLE_setup",*)
'Setup'
631 log_info(
"BUBBLE_setup",*)
'Not found namelist. Default used.'
632 elseif( ierr > 0 )
then
633 log_error(
"BUBBLE_setup",*)
'Not appropriate names in namelist PARAM_BUBBLE. Check!'
636 log_nml(param_bubble)
638 if ( abs(bbl_rz*bbl_rx*bbl_ry) <= 0.0_rp )
then
639 log_info(
"BUBBLE_setup",*)
'no bubble'
641 bubble(:,:,:) = 0.0_rp
649 if ( bbl_eachnode )
then
653 domain_rx = fx(
ie) - fx(
is-1)
654 domain_ry = fy(
je) - fy(
js-1)
672 distz = ( (cz(
k)-cz_offset-bbl_cz)/bbl_rz )**2
674 distx = min( ( (cx(i)-cx_offset-bbl_cx )/bbl_rx )**2, &
675 ( (cx(i)-cx_offset-bbl_cx-domain_rx)/bbl_rx )**2, &
676 ( (cx(i)-cx_offset-bbl_cx+domain_rx)/bbl_rx )**2 )
678 disty = min( ( (cy(j)-cy_offset-bbl_cy )/bbl_ry )**2, &
679 ( (cy(j)-cy_offset-bbl_cy-domain_ry)/bbl_ry )**2, &
680 ( (cy(j)-cy_offset-bbl_cy+domain_ry)/bbl_ry )**2 )
682 select case(bbl_functype)
684 bubble(
k,i,j) = cos( 0.5_rp*pi*sqrt( min(distz+distx+disty,1.0_rp) ) )**2
686 bubble(
k,i,j) = exp( -(distz+distx+disty) )
689 log_error(
"BUBBLE_setup",*)
'Not appropriate BBL_functype. Check!', bbl_functype
691 log_error(
"BUBBLE_setup",*)
'Not appropriate BBL_functype. Check!', trim(bbl_functype)
704 end subroutine bubble_setup
714 logical :: RCT_eachnode = .false.
715 real(RP) :: RCT_CZ = 2.e3_rp
716 real(RP) :: RCT_CX = 2.e3_rp
717 real(RP) :: RCT_CY = 2.e3_rp
718 real(RP) :: RCT_RZ = 2.e3_rp
719 real(RP) :: RCT_RX = 2.e3_rp
720 real(RP) :: RCT_RY = 2.e3_rp
722 namelist / param_rect / &
731 real(RP) :: CZ_offset
732 real(RP) :: CX_offset
733 real(RP) :: CY_offset
741 log_info(
"RECT_setup",*)
'Setup'
747 log_error(
"RECT_setup",*)
'Not found namelist. Check!'
749 elseif( ierr > 0 )
then
750 log_error(
"RECT_setup",*)
'Not appropriate names in namelist PARAM_RECT. Check!'
759 if ( rct_eachnode )
then
775 dist = 2.0_rp * max( &
776 abs(cz(k) - cz_offset - rct_cz)/rct_rz, &
777 abs(cx(i) - cx_offset - rct_cx)/rct_rx, &
778 abs(cy(j) - cy_offset - rct_cy)/rct_ry &
780 if ( dist <= 1.0_rp )
then
795 subroutine aerosol_setup
808 real(RP),
parameter :: d_min_def = 1.e-9_rp
809 real(RP),
parameter :: d_max_def = 1.e-5_rp
810 integer,
parameter :: n_kap_def = 1
811 real(RP),
parameter :: k_min_def = 0.e0_rp
812 real(RP),
parameter :: k_max_def = 1.e0_rp
814 real(RP) :: ccn_init = 50.e+6_rp
816 real(RP) :: m0_init = 0.0_rp
817 real(RP) :: dg_init = 80.e-9_rp
818 real(RP) :: sg_init = 1.6_rp
820 real(RP) :: d_min_inp(3) = d_min_def
821 real(RP) :: d_max_inp(3) = d_max_def
822 real(RP) :: k_min_inp(3) = k_min_def
823 real(RP) :: k_max_inp(3) = k_max_def
824 integer :: n_kap_inp(3) = n_kap_def
826 real(RP) :: qdry(KA,IA,JA)
828 namelist / param_aero / &
845 log_info(
"AEROSOL_setup",*)
'Setup'
851 log_info(
"AEROSOL_setup",*)
'Not found namelist. Default used!'
852 elseif( ierr > 0 )
then
853 log_error(
"AEROSOL_setup",*)
'Not appropriate names in namelist PARAM_AERO. Check!'
862 qdry(:,:,:) = 1.0_rp - qv(:,:,:) - qc(:,:,:)
890 ccn(:,:,:) = ccn_init
897 end subroutine aerosol_setup
901 subroutine sbmaero_setup( convert_qtrc )
911 logical,
intent(inout) :: convert_qtrc
913 integer :: iq, i, j, k
918 if ( .not. convert_qtrc )
return
925 qtrc(k,i,j,
i_qv) = qv(k,i,j) + qc(k,i,j)
932 if (
nccn /= 0 )
then
947 convert_qtrc = .false.
950 end subroutine sbmaero_setup
953 function faero( f0,r0,x,alpha,rhoa )
958 real(
rp),
intent(in) :: x, f0, r0, alpha, rhoa
963 rad = ( exp(x) * 3.0_rp / 4.0_rp / pi / rhoa )**(1.0_rp/3.0_rp)
965 faero = f0 * (rad/r0)**(-alpha)
984 real(RP) :: FLX_rain = 0.0_rp
985 real(RP) :: FLX_snow = 0.0_rp
986 real(RP) :: FLX_IR_dn = 0.0_rp
987 real(RP) :: FLX_NIR_dn = 0.0_rp
988 real(RP) :: FLX_VIS_dn = 0.0_rp
990 namelist / param_mkinit_flux / &
1003 read(
io_fid_conf,nml=param_mkinit_flux,iostat=ierr)
1005 log_info(
"flux_setup",*)
'Not found namelist. Default used.'
1006 elseif( ierr > 0 )
then
1007 log_error(
"flux_setup",*)
'Not appropriate names in namelist PARAM_MKINIT_FLUX. Check!'
1010 log_nml(param_mkinit_flux)
1015 sflx_rain(i,j) = flx_rain
1016 sflx_snow(i,j) = flx_snow
1018 sflx_lw_up(i,j) = 0.0_rp
1019 sflx_lw_dn(i,j) = flx_ir_dn
1020 sflx_sw_up(i,j) = 0.0_rp
1021 sflx_sw_dn(i,j) = flx_nir_dn + flx_vis_dn
1046 real(RP) :: LND_TEMP
1047 real(RP) :: LND_WATER = 0.15_rp
1048 real(RP) :: LND_ICE = 0.00_rp
1049 real(RP) :: SFC_TEMP
1050 real(RP) :: SFC_albedo_LW = 0.01_rp
1051 real(RP) :: SFC_albedo_SW = 0.20_rp
1053 namelist / param_mkinit_land / &
1069 read(
io_fid_conf,nml=param_mkinit_land,iostat=ierr)
1071 log_info(
"land_setup",*)
'Not found namelist. Default used.'
1072 elseif( ierr > 0 )
then
1073 log_error(
"land_setup",*)
'Not appropriate names in namelist PARAM_MKINIT_LAND. Check!'
1076 log_nml(param_mkinit_land)
1126 real(RP) :: OCN_TEMP
1127 real(RP) :: OCN_SALT = 0.0_rp
1128 real(RP) :: OCN_UVEL = 0.0_rp
1129 real(RP) :: OCN_VVEL = 0.0_rp
1130 real(RP) :: ICE_TEMP
1131 real(RP) :: ICE_MASS = 0.0_rp
1132 real(RP) :: SFC_TEMP
1133 real(RP) :: SFC_albedo_LW = 0.04_rp
1134 real(RP) :: SFC_albedo_SW = 0.05_rp
1135 real(RP) :: SFC_Z0M = 1.e-4_rp
1136 real(RP) :: SFC_Z0H = 1.e-4_rp
1137 real(RP) :: SFC_Z0E = 1.e-4_rp
1139 namelist / param_mkinit_ocean / &
1157 ice_temp = 271.35_rp
1162 read(
io_fid_conf,nml=param_mkinit_ocean,iostat=ierr)
1164 log_info(
"ocean_setup",*)
'Not found namelist. Default used.'
1165 elseif( ierr > 0 )
then
1166 log_error(
"ocean_setup",*)
'Not appropriate names in namelist PARAM_MKINIT_OCEAN. Check!'
1169 log_nml(param_mkinit_ocean)
1222 real(RP) :: URB_ROOF_TEMP
1223 real(RP) :: URB_BLDG_TEMP
1224 real(RP) :: URB_GRND_TEMP
1225 real(RP) :: URB_CNPY_TEMP
1226 real(RP) :: URB_CNPY_HMDT = 0.0_rp
1227 real(RP) :: URB_CNPY_WIND = 0.0_rp
1228 real(RP) :: URB_ROOF_LAYER_TEMP
1229 real(RP) :: URB_BLDG_LAYER_TEMP
1230 real(RP) :: URB_GRND_LAYER_TEMP
1231 real(RP) :: URB_ROOF_RAIN = 0.0_rp
1232 real(RP) :: URB_BLDG_RAIN = 0.0_rp
1233 real(RP) :: URB_GRND_RAIN = 0.0_rp
1234 real(RP) :: URB_SFC_TEMP
1235 real(RP) :: URB_ALB_LW = 0.10_rp
1236 real(RP) :: URB_ALB_SW = 0.20_rp
1238 namelist / param_mkinit_urban / &
1245 urb_roof_layer_temp, &
1246 urb_bldg_layer_temp, &
1247 urb_grnd_layer_temp, &
1258 urb_roof_temp = thetastd
1259 urb_bldg_temp = thetastd
1260 urb_grnd_temp = thetastd
1261 urb_cnpy_temp = thetastd
1262 urb_roof_layer_temp = thetastd
1263 urb_bldg_layer_temp = thetastd
1264 urb_grnd_layer_temp = thetastd
1265 urb_sfc_temp = thetastd
1269 read(
io_fid_conf,nml=param_mkinit_urban,iostat=ierr)
1271 log_info(
"urban_setup",*)
'Not found namelist. Default used.'
1272 elseif( ierr > 0 )
then
1273 log_error(
"urban_setup",*)
'Not appropriate names in namelist PARAM_MKINIT_URBAN. Check!'
1276 log_nml(param_mkinit_urban)
1319 real(RP) :: TKE_CONST
1320 real(RP) :: Zi_CONST
1322 namelist / param_mkinit_tke / &
1335 read(
io_fid_conf,nml=param_mkinit_tke,iostat=ierr)
1337 log_info(
"tke_setup",*)
'Not found namelist. Default used.'
1338 elseif( ierr > 0 )
then
1339 log_error(
"tke_setup",*)
'Not appropriate names in namelist PARAM_MKINIT_TKE. Check!'
1342 log_nml(param_mkinit_tke)
1344 if (
i_tke > 0 )
then
1376 DENS, VELX, VELY, POTT, QV )
1381 real(RP),
intent(out) :: DENS(KA)
1382 real(RP),
intent(out) :: VELX(KA)
1383 real(RP),
intent(out) :: VELY(KA)
1384 real(RP),
intent(out) :: POTT(KA)
1385 real(RP),
intent(out) :: QV (KA)
1387 real(RP) :: TEMP(KA)
1388 real(RP) :: PRES(KA)
1391 character(len=H_LONG) :: ENV_IN_SOUNDING_file =
''
1393 integer,
parameter :: EXP_klim = 100
1396 real(RP) :: SFC_THETA
1397 real(RP) :: SFC_PRES
1400 real(RP) :: EXP_z (EXP_klim+1)
1401 real(RP) :: EXP_pott(EXP_klim+1)
1402 real(RP) :: EXP_qv (EXP_klim+1)
1403 real(RP) :: EXP_u (EXP_klim+1)
1404 real(RP) :: EXP_v (EXP_klim+1)
1406 real(RP) :: fact1, fact2
1410 character(len=H_LONG) :: fname
1412 logical :: converged
1415 real(RP) :: work1(KA)
1416 real(RP) :: work2(KA)
1417 real(RP) :: work3(KA)
1422 namelist / param_mkinit_sounding / &
1423 env_in_sounding_file
1427 read(
io_fid_conf,nml=param_mkinit_sounding,iostat=ierr)
1430 log_info(
"read_sounding",*)
'Not found namelist. Default used.'
1431 elseif( ierr > 0 )
then
1432 log_error(
"read_sounding",*)
'Not appropriate names in namelist PARAM_MKINIT_SOUNDING. Check!'
1435 log_nml(param_mkinit_sounding)
1440 log_info(
"read_sounding",*)
'Input sounding file:', trim(fname)
1443 form =
'formatted', &
1447 if ( ierr /= 0 )
then
1448 log_error(
"read_sounding",*)
'[mod_mkinit/read_sounding] Input file not found!'
1452 read(fid,*) sfc_pres, sfc_theta, sfc_qv
1454 log_info(
"read_sounding",*)
'+ Surface pressure [hPa]', sfc_pres
1455 log_info(
"read_sounding",*)
'+ Surface pot. temp [K]', sfc_theta
1456 log_info(
"read_sounding",*)
'+ Surface water vapor [g/kg]', sfc_qv
1459 read(fid,*,iostat=ierr) exp_z(k), exp_pott(k), exp_qv(k), exp_u(k), exp_v(k)
1460 if ( ierr /= 0 )
exit
1468 exp_pott(1) = sfc_theta
1472 exp_z(exp_kmax+1) = 100.e3_rp
1473 exp_pott(exp_kmax+1) = exp_pott(exp_kmax)
1474 exp_qv(exp_kmax+1) = exp_qv(exp_kmax)
1475 exp_u(exp_kmax+1) = exp_u(exp_kmax)
1476 exp_v(exp_kmax+1) = exp_v(exp_kmax)
1478 do k = 1, exp_kmax+1
1479 exp_qv(k) = exp_qv(k) * 1.e-3_rp
1483 pres_sfc(:,:) = sfc_pres * 1.e2_rp
1484 pott_sfc(:,:) = sfc_theta
1486 qv_sfc(:,:) = sfc_qv * 1.e-3_rp
1491 do kref = 2, exp_kmax+1
1492 if ( cz(k) > exp_z(kref-1) &
1493 .AND. cz(k) <= exp_z(kref ) )
then
1495 fact1 = ( exp_z(kref) - cz(k) ) / ( exp_z(kref)-exp_z(kref-1) )
1496 fact2 = ( cz(k) - exp_z(kref-1) ) / ( exp_z(kref)-exp_z(kref-1) )
1498 pott(k) = exp_pott(kref-1) * fact1 &
1499 + exp_pott(kref ) * fact2
1500 qv(k) = exp_qv(kref-1) * fact1 &
1501 + exp_qv(kref ) * fact2
1502 velx(k) = exp_u(kref-1) * fact1 &
1503 + exp_u(kref ) * fact2
1504 vely(k) = exp_v(kref-1) * fact1 &
1505 + exp_v(kref ) * fact2
1514 call hydrostatic_buildrho( ka,
ks,
ke, &
1515 pott(:), qv(:), qc(:), &
1516 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
1519 work1(:), work2(:), work3(:), &
1521 dens(:), temp(:), pres(:), temp_sfc(1,1), &
1529 subroutine mkinit_planestate
1535 real(RP) :: SFC_THETA
1536 real(RP) :: SFC_PRES
1537 real(RP) :: SFC_RH = 0.0_rp
1539 real(RP) :: ENV_THETA
1540 real(RP) :: ENV_TLAPS = 0.0_rp
1541 real(RP) :: ENV_U = 0.0_rp
1542 real(RP) :: ENV_V = 0.0_rp
1543 real(RP) :: ENV_RH = 0.0_rp
1545 real(RP) :: RANDOM_THETA = 0.0_rp
1546 real(RP) :: RANDOM_U = 0.0_rp
1547 real(RP) :: RANDOM_V = 0.0_rp
1548 real(RP) :: RANDOM_RH = 0.0_rp
1550 namelist / param_mkinit_planestate / &
1565 integer :: k, i, j, itr
1569 log_info(
"MKINIT_planestate",*)
'Setup initial state'
1571 sfc_theta = thetastd
1573 env_theta = thetastd
1577 read(
io_fid_conf,nml=param_mkinit_planestate,iostat=ierr)
1580 log_info(
"MKINIT_planestate",*)
'Not found namelist. Default used.'
1581 elseif( ierr > 0 )
then
1582 log_error_cont(*)
'Not appropriate names in namelist PARAM_MKINIT_PLANESTATE. Check!'
1585 log_nml(param_mkinit_planestate)
1591 pott_sfc(i,j) = sfc_theta
1592 pres_sfc(i,j) = sfc_pres
1597 if ( env_theta < 0.0_rp )
then
1599 call profile_isa(
ka,
ks,
ke, &
1613 pott(k,i,j) = env_theta + env_tlaps * real_cz(k,i,j)
1623 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
1624 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
1625 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
1626 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
1628 call random_uniform(rndm)
1632 pott_sfc(i,j) = pott_sfc(i,j) + ( rndm(
ks-1,i,j) * 2.0_rp - 1.0_rp ) * random_theta
1635 pott(k,i,j) = pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_theta
1648 temp_sfc(:,:), pres_sfc(:,:), &
1651 call random_uniform(rndm)
1655 qv_sfc(i,j) = max( 0.0_rp, sfc_rh + ( rndm(
ks-1,i,j) * 2.0_rp - 1.0_rp ) * random_rh ) * 1.e-2_rp * qsat_sfc(i,j)
1663 do itr = 1, niter_rh
1672 qv(k,i,j) = max( 0.0_rp, env_rh + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_rh ) * 1.e-2_rp * psat(k,i,j) / (
dens(k,i,j) * rvap * temp(k,i,j) )
1680 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
1681 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
1682 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
1683 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
1687 call comm_vars8(
dens(:,:,:), 1 )
1688 call comm_wait (
dens(:,:,:), 1 )
1690 call random_uniform(rndm)
1696 momx(k,i,j) = ( env_u + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_u ) &
1697 * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
1703 call random_uniform(rndm)
1709 momy(k,i,j) = ( env_v + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_v ) &
1710 * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
1721 momz(k,i,j) = 0.0_rp
1722 rhot(k,i,j) = pott(k,i,j) *
dens(k,i,j)
1731 end subroutine mkinit_planestate
1735 subroutine mkinit_tracerbubble
1740 real(RP) :: SFC_THETA
1741 real(RP) :: SFC_PRES
1743 real(RP) :: ENV_THETA
1744 real(RP) :: ENV_U = 0.0_rp
1745 real(RP) :: ENV_V = 0.0_rp
1747 character(len=H_SHORT) :: SHAPE_PTracer =
'BUBBLE'
1748 real(RP) :: BBL_PTracer = 1.0_rp
1749 namelist / param_mkinit_tracerbubble / &
1758 real(RP),
pointer :: shapeFac(:,:,:) => null()
1760 logical :: converged
1763 real(RP) :: work1(KA)
1764 real(RP) :: work2(KA)
1765 real(RP) :: work3(KA)
1773 log_info(
"MKINIT_tracerbubble",*)
'Setup initial state'
1775 sfc_theta = thetastd
1777 env_theta = thetastd
1781 read(
io_fid_conf,nml=param_mkinit_tracerbubble,iostat=ierr)
1784 log_info(
"MKINIT_tracerbubble",*)
'Not found namelist. Default used.'
1785 elseif( ierr > 0 )
then
1786 log_error(
"MKINIT_tracerbubble",*)
'Not appropriate names in namelist PARAM_MKINIT_TRACERBUBBLE. Check!'
1789 log_nml(param_mkinit_tracerbubble)
1793 pres_sfc(1,1) = sfc_pres
1794 pott_sfc(1,1) = sfc_theta
1799 pott(k,1,1) = env_theta
1804 call hydrostatic_buildrho( ka,
ks,
ke, &
1805 pott(:,1,1), qv(:,1,1), qc(:,1,1), &
1806 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
1809 work1(:), work2(:), work3(:), &
1811 dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1), &
1820 momz(k,i,j) = 0.0_rp
1823 rhot(k,i,j) = pott(k,1,1) *
dens(k,1,1)
1830 select case(shape_ptracer)
1838 log_error(
"MKINIT_tracerbubble",*)
'SHAPE_PTracer=', trim(shape_ptracer),
' cannot be used on advect. Check!'
1846 ptrc(k,i,j) = bbl_ptracer * shapefac(k,i,j)
1855 end subroutine mkinit_tracerbubble
1867 subroutine mkinit_coldbubble
1871 real(RP) :: SFC_THETA
1872 real(RP) :: SFC_PRES
1874 real(RP) :: ENV_THETA
1876 real(RP) :: BBL_TEMP = -15.0_rp
1878 namelist / param_mkinit_coldbubble / &
1886 logical :: converged
1889 real(RP) :: work1(KA)
1890 real(RP) :: work2(KA)
1891 real(RP) :: work3(KA)
1899 log_info(
"MKINIT_coldbubble",*)
'Setup initial state'
1901 sfc_theta = thetastd
1903 env_theta = thetastd
1907 read(
io_fid_conf,nml=param_mkinit_coldbubble,iostat=ierr)
1910 log_info(
"MKINIT_coldbubble",*)
'Not found namelist. Default used.'
1911 elseif( ierr > 0 )
then
1912 log_error(
"MKINIT_coldbubble",*)
'Not appropriate names in namelist PARAM_MKINIT_COLDBUBBLE. Check!'
1915 log_nml(param_mkinit_coldbubble)
1917 rovcp = rdry / cpdry
1921 pres_sfc(1,1) = sfc_pres
1922 pott_sfc(1,1) = sfc_theta
1927 pott(k,1,1) = env_theta
1932 call hydrostatic_buildrho( ka,
ks,
ke, &
1933 pott(:,1,1), qv(:,1,1), qc(:,1,1), &
1934 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
1937 work1(:), work2(:), work3(:), &
1939 dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1), &
1948 momz(k,i,j) = 0.0_rp
1949 momx(k,i,j) = 0.0_rp
1950 momy(k,i,j) = 0.0_rp
1953 rhot(k,i,j) =
dens(k,1,1) * ( pott(k,1,1) &
1954 + bbl_temp * ( p00/pres(k,1,1) )**rovcp * bubble(k,i,j) )
1961 end subroutine mkinit_coldbubble
1965 subroutine mkinit_lambwave
1969 real(RP) :: SFC_PRES
1971 real(RP) :: ENV_U = 0.0_rp
1972 real(RP) :: ENV_V = 0.0_rp
1973 real(RP) :: ENV_TEMP = 300.0_rp
1975 real(RP) :: BBL_PRES = 100._rp
1977 namelist / param_mkinit_lambwave / &
1991 log_info(
"MKINIT_lambwave",*)
'Setup initial state'
1997 read(
io_fid_conf,nml=param_mkinit_lambwave,iostat=ierr)
2000 log_info(
"MKINIT_lambwave",*)
'Not found namelist. Default used.'
2001 elseif( ierr > 0 )
then
2002 log_error(
"MKINIT_lambwave",*)
'Not appropriate names in namelist PARAM_MKINIT_LAMBWAVE. Check!'
2005 log_nml(param_mkinit_lambwave)
2007 rovcp = rdry / cpdry
2014 dens(k,i,j) = sfc_pres/(rdry*env_temp) * exp( - grav/(rdry*env_temp) * cz(k) )
2015 momz(k,i,j) = 0.0_rp
2020 pres(k,i,j) =
dens(k,i,j) * env_temp * rdry + bbl_pres * bubble(k,i,j)
2022 rhot(k,i,j) =
dens(k,i,j) * env_temp * ( p00/pres(k,i,j) )**rovcp
2029 end subroutine mkinit_lambwave
2034 subroutine mkinit_gravitywave
2038 real(RP) :: SFC_THETA
2039 real(RP) :: SFC_PRES
2041 real(RP) :: ENV_U = 20.0_rp
2042 real(RP) :: ENV_V = 0.0_rp
2043 real(RP) :: ENV_BVF = 0.01_rp
2045 real(RP) :: BBL_THETA = 0.01_rp
2047 namelist / param_mkinit_gravitywave / &
2055 logical :: converged
2058 real(RP) :: work1(KA)
2059 real(RP) :: work2(KA)
2060 real(RP) :: work3(KA)
2068 log_info(
"MKINIT_gravitywave",*)
'Setup initial state'
2070 sfc_theta = thetastd
2075 read(
io_fid_conf,nml=param_mkinit_gravitywave,iostat=ierr)
2078 log_info(
"MKINIT_gravitywave",*)
'Not found namelist. Default used.'
2079 elseif( ierr > 0 )
then
2080 log_error(
"MKINIT_gravitywave",*)
'Not appropriate names in namelist PARAM_MKINIT_GRAVITYWAVE. Check!'
2083 log_nml(param_mkinit_gravitywave)
2087 pres_sfc(1,1) = sfc_pres
2088 pott_sfc(1,1) = sfc_theta
2093 pott(k,1,1) = sfc_theta * exp( env_bvf*env_bvf / grav * cz(k) )
2098 call hydrostatic_buildrho( ka,
ks,
ke, &
2099 pott(:,1,1), qv(:,1,1), qc(:,1,1), &
2100 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
2103 work1(:), work2(:), work3(:), &
2105 dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1), &
2114 momz(k,i,j) = 0.0_rp
2119 rhot(k,i,j) =
dens(k,1,1) * ( pott(k,1,1) + bbl_theta * bubble(k,i,j) )
2127 end subroutine mkinit_gravitywave
2131 subroutine mkinit_khwave
2135 real(RP) :: SFC_THETA
2136 real(RP) :: SFC_PRES
2138 real(RP) :: ENV_L1_ZTOP = 1900.0_rp
2139 real(RP) :: ENV_L3_ZBOTTOM = 2100.0_rp
2140 real(RP) :: ENV_L1_THETA = 300.0_rp
2141 real(RP) :: ENV_L3_THETA = 301.0_rp
2142 real(RP) :: ENV_L1_U = 0.0_rp
2143 real(RP) :: ENV_L3_U = 20.0_rp
2145 real(RP) :: RANDOM_U = 0.0_rp
2147 namelist / param_mkinit_khwave / &
2160 logical :: converged
2163 real(RP) :: work1(KA)
2164 real(RP) :: work2(KA)
2165 real(RP) :: work3(KA)
2173 log_info(
"MKINIT_khwave",*)
'Setup initial state'
2175 sfc_theta = thetastd
2180 read(
io_fid_conf,nml=param_mkinit_khwave,iostat=ierr)
2183 log_info(
"MKINIT_khwave",*)
'Not found namelist. Default used.'
2184 elseif( ierr > 0 )
then
2185 log_error(
"MKINIT_khwave",*)
'Not appropriate names in namelist PARAM_MKINIT_KHWAVE. Check!'
2188 log_nml(param_mkinit_khwave)
2192 pres_sfc(1,1) = sfc_pres
2193 pott_sfc(1,1) = sfc_theta
2198 fact = ( cz(k)-env_l1_ztop ) / ( env_l3_zbottom-env_l1_ztop )
2199 fact = max( min( fact, 1.0_rp ), 0.0_rp )
2201 pott(k,1,1) = env_l1_theta * ( 1.0_rp - fact ) &
2202 + env_l3_theta * ( fact )
2207 call hydrostatic_buildrho( ka,
ks,
ke, &
2208 pott(:,1,1), qv(:,1,1), qc(:,1,1), &
2209 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
2212 work1(:), work2(:), work3(:), &
2214 dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1), &
2223 momz(k,i,j) = 0.0_rp
2224 momy(k,i,j) = 0.0_rp
2225 rhot(k,i,j) =
dens(k,1,1) * pott(k,1,1)
2231 call random_uniform(rndm)
2237 fact = ( cz(k)-env_l1_ztop ) / ( env_l3_zbottom-env_l1_ztop )
2238 fact = max( min( fact, 1.0_rp ), 0.0_rp )
2240 momx(k,i,j) = ( env_l1_u * ( 1.0_rp - fact ) &
2241 + env_l3_u * ( fact ) &
2242 + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_u &
2250 end subroutine mkinit_khwave
2254 subroutine mkinit_turbulence
2260 real(RP) :: SFC_THETA
2261 real(RP) :: SFC_PRES
2262 real(RP) :: SFC_RH = 0.0_rp
2264 real(RP) :: ENV_THETA
2265 real(RP) :: ENV_TLAPS = 4.e-3_rp
2266 real(RP) :: ENV_U = 5.0_rp
2267 real(RP) :: ENV_V = 0.0_rp
2268 real(RP) :: ENV_RH = 0.0_rp
2270 real(RP) :: RANDOM_THETA = 1.0_rp
2271 real(RP) :: RANDOM_U = 0.0_rp
2272 real(RP) :: RANDOM_V = 0.0_rp
2273 real(RP) :: RANDOM_RH = 0.0_rp
2275 namelist / param_mkinit_turbulence / &
2289 logical :: converged
2292 real(RP) :: work1(KA)
2293 real(RP) :: work2(KA)
2294 real(RP) :: work3(KA)
2298 integer :: k, i, j, itr
2302 log_info(
"MKINIT_turbulence",*)
'Setup initial state'
2304 sfc_theta = thetastd
2306 env_theta = thetastd
2310 read(
io_fid_conf,nml=param_mkinit_turbulence,iostat=ierr)
2313 log_info(
"MKINIT_turbulence",*)
'Not found namelist. Default used.'
2314 elseif( ierr > 0 )
then
2315 log_error(
"MKINIT_turbulence",*)
'Not appropriate names in namelist PARAM_MKINIT_TURBULENCE. Check!'
2318 log_nml(param_mkinit_turbulence)
2322 pres_sfc(1,1) = sfc_pres
2323 pott_sfc(1,1) = sfc_theta
2328 pott(k,1,1) = env_theta + env_tlaps * cz(k)
2333 call hydrostatic_buildrho( ka,
ks,
ke, &
2334 pott(:,1,1), qv(:,1,1), qc(:,1,1), &
2335 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
2338 work1(:), work2(:), work3(:), &
2340 dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1), &
2343 call random_uniform(rndm)
2347 pres_sfc(i,j) = sfc_pres
2348 pott_sfc(i,j) = sfc_theta + ( rndm(
ks-1,i,j) * 2.0_rp - 1.0_rp ) * random_theta
2351 pott(k,i,j) = env_theta + env_tlaps * cz(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_theta
2358 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
2359 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
2360 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
2361 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
2366 temp_sfc(:,:), pres_sfc(:,:), &
2369 call random_uniform(rndm)
2374 qv_sfc(i,j) = min( 0.0_rp, sfc_rh + ( rndm(
ks-1,i,j) * 2.0_rp - 1.0_rp ) * random_rh ) * 1.e-2_rp * qsat_sfc(1,1)
2379 do itr = 1, niter_rh
2389 qv(k,i,j) = min( 0.0_rp, env_rh + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_rh ) * 1.e-2_rp * psat(k,i,j) / (
dens(k,i,j) * rvap * temp(k,i,j) )
2397 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
2398 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
2399 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
2400 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
2404 call comm_vars8(
dens(:,:,:), 1 )
2405 call comm_wait (
dens(:,:,:), 1 )
2407 call random_uniform(rndm)
2413 momx(k,i,j) = ( env_u + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_u ) &
2414 * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
2420 call random_uniform(rndm)
2426 momy(k,i,j) = ( env_v + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_v ) &
2427 * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
2438 momz(k,i,j) = 0.0_rp
2439 rhot(k,i,j) = pott(k,i,j) *
dens(k,i,j)
2446 end subroutine mkinit_turbulence
2450 subroutine mkinit_cavityflow
2454 real(RP) :: REYNOLDS_NUM = 1.d03
2455 real(RP) :: MACH_NUM = 3.d-2
2456 real(RP) :: Ulid = 1.d01
2457 real(RP) :: PRES0 = 1.d05
2459 namelist / param_mkinit_cavityflow / &
2475 log_info(
"MKINIT_cavityflow",*)
'Setup initial state'
2479 read(
io_fid_conf,nml=param_mkinit_cavityflow,iostat=ierr)
2482 log_info(
"MKINIT_cavityflow",*)
'Not found namelist. Default used.'
2483 elseif( ierr > 0 )
then
2484 log_error(
"MKINIT_cavityflow",*)
'Not appropriate names in namelist PARAM_MKINIT_CAVITYFLOW. Check!'
2487 log_nml(param_mkinit_cavityflow)
2489 gam = cpdry / ( cpdry - rdry )
2490 cs2 = ( ulid / mach_num )**2
2491 temp = cs2 / ( gam * rdry )
2492 dens0 = pres0 / ( rdry * temp )
2494 log_info(
"MKINIT_cavityflow",*)
"DENS = ", dens0
2495 log_info(
"MKINIT_cavityflow",*)
"PRES = ", pres0
2496 log_info(
"MKINIT_cavityflow",*)
"TEMP = ",
rhot(10,10,4)/dens0, temp
2497 log_info(
"MKINIT_cavityflow",*)
"Ulid = ", ulid
2498 log_info(
"MKINIT_cavityflow",*)
"Cs = ", sqrt(cs2)
2506 momz(k,i,j) = 0.0_rp
2507 momx(k,i,j) = 0.0_rp
2508 momy(k,i,j) = 0.0_rp
2510 rhot(k,i,j) = p00/rdry * (p00/pres0)**((rdry - cpdry)/cpdry)
2521 end subroutine mkinit_cavityflow
2525 subroutine mkinit_mountainwave
2529 real(RP) :: SFC_THETA
2530 real(RP) :: SFC_PRES
2532 real(RP) :: ENV_U = 0.0_rp
2533 real(RP) :: ENV_V = 0.0_rp
2535 real(RP) :: SCORER = 2.e-3_rp
2536 real(RP) :: BBL_PTracer = 0.0_rp
2538 namelist / param_mkinit_mountainwave / &
2546 real(RP) :: Ustar2, N2
2553 log_info(
"MKINIT_mountainwave",*)
'Setup initial state'
2555 sfc_theta = thetastd
2560 read(
io_fid_conf,nml=param_mkinit_mountainwave,iostat=ierr)
2563 log_info(
"MKINIT_mountainwave",*)
'Not found namelist. Default used.'
2564 elseif( ierr > 0 )
then
2565 log_error(
"MKINIT_mountainwave",*)
'Not appropriate names in namelist PARAM_MKINIT_MOUNTAINWAVE. Check!'
2568 log_nml(param_mkinit_mountainwave)
2574 pres_sfc(i,j) = sfc_pres
2575 pott_sfc(i,j) = sfc_theta
2584 ustar2 = env_u * env_u + env_v * env_v
2585 n2 = ustar2 * (scorer*scorer)
2587 pott(k,i,j) = sfc_theta * exp( n2 / grav * real_cz(k,i,j) )
2595 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
2596 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
2597 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
2598 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
2606 momz(k,i,j) = 0.0_rp
2609 rhot(k,i,j) = pott(k,i,j) *
dens(k,i,j)
2616 if ( bbl_ptracer > 0.0_rp )
then
2621 ptrc(k,i,j) = bbl_ptracer * bubble(k,i,j)
2629 end subroutine mkinit_mountainwave
2636 subroutine mkinit_barocwave
2651 real(RP) :: REF_TEMP = 288.e0_rp
2652 real(RP) :: REF_PRES = 1.e5_rp
2653 real(RP) :: LAPSE_RATE = 5.e-3_rp
2656 real(RP) :: Phi0Deg = 45.e0_rp
2659 real(RP) :: U0 = 35.e0_rp
2660 real(RP) :: b = 2.e0_rp
2664 real(RP) :: Up = 1.e0_rp
2665 real(RP) :: Lp = 600.e3_rp
2666 real(RP) :: Xc = 2000.e3_rp
2667 real(RP) :: Yc = 2500.e3_rp
2669 namelist / param_mkinit_barocwave / &
2670 ref_temp, ref_pres, lapse_rate, &
2675 real(RP) :: f0, beta0
2677 real(RP) :: geopot(KA,IA,JA)
2678 real(RP) :: eta(KA,IA,JA)
2679 real(RP) :: temp(KA,IA,JA)
2685 real(RP) :: temp_vfunc
2686 real(RP) :: geopot_hvari
2688 logical :: converged
2696 real(RP) :: work1(KA)
2697 real(RP) :: work2(KA)
2698 real(RP) :: work3(KA)
2703 integer,
parameter :: ITRMAX = 1000
2704 real(RP),
parameter :: CONV_EPS = 1e-15_rp
2708 log_info(
"MKINIT_barocwave",*)
'Setup initial state'
2712 read(
io_fid_conf,nml=param_mkinit_barocwave,iostat=ierr)
2715 log_info(
"MKINIT_barocwave",*)
'Not found namelist. Default used.'
2716 elseif( ierr > 0 )
then
2717 log_error(
"MKINIT_barocwave",*)
'Not appropriate names in namelist PARAM_MKINIT_BAROCWAVE. Check!'
2720 log_nml(param_mkinit_barocwave)
2725 f0 = 2.0_rp*ohm*sin(phi0deg*pi/180.0_rp)
2726 beta0 = (2.0_rp*ohm/rplanet)*cos(phi0deg*pi/180.0_rp)
2735 eta(:,:,:) = 1.0e-8_rp
2749 yphase = 2.0_rp*pi*y/ly
2752 geopot_hvari = 0.5_rp*u0*( &
2753 (f0 - beta0*y0)*(y - 0.5_rp*ly*(1.0_rp + sin(yphase)/pi)) &
2754 + 0.5_rp*beta0*( y**2 - ly*y/pi*sin(yphase) - 0.5_rp*(ly/pi)**2*(cos(yphase) + 1.0_rp) &
2759 pres_sfc(i,j) = ref_pres
2760 pott_sfc(i,j) = ref_temp - geopot_hvari/rdry
2767 do while( abs(del_eta) > conv_eps )
2768 ln_eta = log(eta(k,i,j))
2770 temp_vfunc = eta(k,i,j)**(rdry*lapse_rate/grav)
2772 ref_temp*temp_vfunc &
2773 + geopot_hvari/rdry*(2.0_rp*(ln_eta/b)**2 - 1.0_rp)*exp(-(ln_eta/b)**2)
2775 ref_temp*grav/lapse_rate*(1.0_rp - temp_vfunc) &
2776 + geopot_hvari*ln_eta*exp(-(ln_eta/b)**2)
2778 del_eta = - ( - grav*cz(k) + geopot(k,i,j) ) &
2779 & *( - eta(k,i,j)/(rdry*temp(k,i,j)) )
2781 eta(k,i,j) = eta(k,i,j) + del_eta
2784 if ( itr > itrmax )
then
2785 log_error(
"MKINIT_barocwave",*)
"Fail the convergence of iteration. Check!"
2786 log_error_cont(*)
"* (X,Y,Z)=", cx(i), cy(j), cz(k)
2787 log_error_cont(*)
"itr=", itr,
"del_eta=", del_eta,
"eta=", eta(k,i,j),
"temp=", temp(k,i,j)
2796 pres(k,i,j) = eta(k,i,j)*ref_pres
2797 dens(k,i,j) = pres(k,i,j)/(rdry*temp(k,i,j))
2798 pott(k,i,j) = temp(k,i,j)*eta(k,i,j)**(-rdry/cpdry)
2804 call hydrostatic_buildrho( ka,
ks,
ke, &
2805 pott(:,i,j), qv(:,i,j), qc(:,i,j), &
2806 pres_sfc(i,j), pott_sfc(i,j), qv_sfc(i,j), qc_sfc(i,j), &
2807 real_cz(:,i,j), real_fz(:,i,j), &
2809 work1(:), work2(:), work3(:), &
2811 dens(:,i,j), temp(:,i,j), pres(:,i,j), temp_sfc(i,j), &
2813 if ( .not. converged )
then
2814 log_error(
"MKINIT_barocwave",*)
"failed to obtain a state in hydrostatic balance", i, j
2837 eta(k,
is,j) = pres(k,
is,j)/ref_pres
2838 ln_eta = log(eta(k,
is,j))
2839 yphase = 2.0_rp*pi*cy(j)/ly
2844 if ( i .ne.
is )
then
2846 pres(k,i,j) = pres(k,
is,j)
2852 momx(k,i,j) =
dens(k,
is,j)*(-u0*sin(0.5_rp*yphase)**2*ln_eta*exp(-(ln_eta/b)**2))
2859 momy(:,:,:) = 0.0_rp
2860 momz(:,:,:) = 0.0_rp
2872 +
dens(k,i,j)* up*exp( - ((fx(i) - xc)**2 + (cy(j) - yc)**2)/lp**2 )
2881 end subroutine mkinit_barocwave
2885 subroutine mkinit_warmbubble
2891 real(RP) :: SFC_THETA
2892 real(RP) :: SFC_PRES
2893 real(RP) :: SFC_RH = 80.0_rp
2895 real(RP) :: ENV_U = 0.0_rp
2896 real(RP) :: ENV_V = 0.0_rp
2897 real(RP) :: ENV_RH = 80.0_rp
2898 real(RP) :: ENV_L1_ZTOP = 1.e3_rp
2899 real(RP) :: ENV_L2_ZTOP = 14.e3_rp
2900 real(RP) :: ENV_L2_TLAPS = 4.e-3_rp
2901 real(RP) :: ENV_L3_TLAPS = 3.e-2_rp
2903 real(RP) :: BBL_THETA = 1.0_rp
2905 namelist / param_mkinit_warmbubble / &
2917 logical :: converged
2920 real(RP) :: work1(KA)
2921 real(RP) :: work2(KA)
2922 real(RP) :: work3(KA)
2926 integer :: k, i, j, itr
2930 log_info(
"MKINIT_warmbubble",*)
'Setup initial state'
2933 log_error(
"MKINIT_warmbubble",*)
'QV is not registered'
2937 sfc_theta = thetastd
2942 read(
io_fid_conf,nml=param_mkinit_warmbubble,iostat=ierr)
2945 log_info(
"MKINIT_warmbubble",*)
'Not found namelist. Default used.'
2946 elseif( ierr > 0 )
then
2947 log_error(
"MKINIT_warmbubble",*)
'Not appropriate names in namelist PARAM_MKINIT_WARMBUBBLE. Check!'
2950 log_nml(param_mkinit_warmbubble)
2954 pres_sfc(1,1) = sfc_pres
2955 pott_sfc(1,1) = sfc_theta
2961 if ( cz(k) <= env_l1_ztop )
then
2962 pott(k,1,1) = sfc_theta
2963 elseif( cz(k) < env_l2_ztop )
then
2964 pott(k,1,1) = pott(k-1,1,1) + env_l2_tlaps * ( cz(k)-cz(k-1) )
2966 pott(k,1,1) = pott(k-1,1,1) + env_l3_tlaps * ( cz(k)-cz(k-1) )
2972 call hydrostatic_buildrho( ka,
ks,
ke, &
2973 pott(:,1,1), qv(:,1,1), qc(:,1,1), &
2974 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
2977 work1(:), work2(:), work3(:), &
2979 dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1), &
2983 call saturation_pres2qsat_all( temp_sfc(1,1), pres_sfc(1,1), &
2986 qv_sfc(1,1) = sfc_rh * 1.e-2_rp * qsat_sfc(1,1)
2989 do itr = 1, niter_rh
2990 call saturation_psat_all( ka,
ks,
ke, &
2995 if( cz(k) <= env_l2_ztop )
then
2996 qv(k,1,1) = env_rh * 1.e-2_rp * psat(k,1,1) / (
dens(k,1,1) * rvap * temp(k,1,1) )
3004 call hydrostatic_buildrho( ka,
ks,
ke, &
3005 pott(:,1,1), qv(:,1,1), qc(:,1,1), &
3006 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
3009 work1(:), work2(:), work3(:), &
3011 dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1), &
3021 momz(k,i,j) = 0.0_rp
3026 rhot(k,i,j) =
dens(k,1,1) * ( pott(k,1,1) + bbl_theta * bubble(k,i,j) )
3028 qv(k,i,j) = qv(k,1,1)
3037 end subroutine mkinit_warmbubble
3041 subroutine mkinit_supercell
3047 real(RP) :: VELX(KA)
3048 real(RP) :: VELY(KA)
3049 real(RP) :: POTT(KA)
3050 real(RP) :: QV1D(KA)
3053 real(RP) :: BBL_THETA = 3.d0
3055 namelist / param_mkinit_supercell / &
3063 log_info(
"MKINIT_supercell",*)
'Setup initial state'
3066 log_error(
"MKINIT_supercell",*)
'QV is not registered'
3072 read(
io_fid_conf,nml=param_mkinit_supercell,iostat=ierr)
3075 log_info(
"MKINIT_supercell",*)
'Not found namelist. Default used.'
3076 elseif( ierr > 0 )
then
3077 log_error(
"MKINIT_supercell",*)
'Not appropriate names in namelist PARAM_MKINIT_SUPERCELL. Check!'
3080 log_nml(param_mkinit_supercell)
3089 dens(k,i,j) = rho(k)
3090 momz(k,i,j) = 0.0_rp
3091 momx(k,i,j) = rho(k) * velx(k)
3092 momy(k,i,j) = rho(k) * vely(k)
3095 rhot(k,i,j) = rho(k) * ( pott(k) + bbl_theta * bubble(k,i,j) )
3106 end subroutine mkinit_supercell
3110 subroutine mkinit_squallline
3116 real(RP) :: VELX(KA)
3117 real(RP) :: VELY(KA)
3118 real(RP) :: POTT(KA)
3119 real(RP) :: QV1D(KA)
3121 real(RP) :: RANDOM_THETA = 0.01_rp
3122 real(RP) :: OFFSET_velx = 12.0_rp
3123 real(RP) :: OFFSET_vely = -2.0_rp
3125 namelist / param_mkinit_squallline / &
3135 log_info(
"MKINIT_squallline",*)
'Setup initial state'
3138 log_error(
"MKINIT_squallline",*)
'QV is not registered'
3144 read(
io_fid_conf,nml=param_mkinit_squallline,iostat=ierr)
3147 log_info(
"MKINIT_squallline",*)
'Not found namelist. Default used.'
3148 elseif( ierr > 0 )
then
3149 log_error(
"MKINIT_squallline",*)
'Not appropriate names in namelist PARAM_MKINIT_SQUALLLINE. Check!'
3152 log_nml(param_mkinit_squallline)
3156 call random_uniform(rndm)
3162 dens(k,i,j) = rho(k)
3163 momz(k,i,j) = 0.0_rp
3164 momx(k,i,j) = ( velx(k) - offset_velx ) * rho(k)
3165 momy(k,i,j) = ( vely(k) - offset_vely ) * rho(k)
3166 rhot(k,i,j) = rho(k) * ( pott(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_theta )
3176 end subroutine mkinit_squallline
3180 subroutine mkinit_wk1982
3186 real(RP) :: SFC_THETA = 300.0_rp
3187 real(RP) :: SFC_PRES
3189 real(RP) :: TR_Z = 12000.0_rp
3190 real(RP) :: TR_THETA = 343.0_rp
3191 real(RP) :: TR_TEMP = 213.0_rp
3192 real(RP) :: SHEAR_Z = 3000.0_rp
3193 real(RP) :: SHEAR_U = 15.0_rp
3194 real(RP) :: QV0 = 14.0_rp
3196 real(RP) :: BBL_THETA = 3.d0
3198 namelist / param_mkinit_wk1982 / &
3209 real(RP) :: rh (KA,IA,JA)
3210 real(RP) :: rh_sfc( IA,JA)
3213 integer :: k, i, j, itr
3217 log_info(
"MKINIT_wk1982",*)
'Setup initial state'
3220 log_error(
"MKINIT_wk1982",*)
'QV is not registered'
3227 read(
io_fid_conf,nml=param_mkinit_wk1982,iostat=ierr)
3229 log_info(
"MKINIT_wk1982",*)
'Not found namelist. Default used.'
3230 elseif( ierr > 0 )
then
3231 log_error(
"MKINIT_wk1982",*)
'Not appropriate names in namelist PARAM_MKINIT_WK1982. Check!'
3234 log_nml(param_mkinit_wk1982)
3240 pres_sfc(i,j) = sfc_pres
3241 pott_sfc(i,j) = sfc_theta
3244 if ( real_cz(k,i,j) <= tr_z )
then
3245 pott(k,i,j) = pott_sfc(i,j) &
3246 + ( tr_theta - pott_sfc(i,j) ) * ( real_cz(k,i,j) / tr_z )**1.25_rp
3248 pott(k,i,j) = tr_theta * exp( grav * ( real_cz(k,i,j) - tr_z ) / cpdry / tr_temp )
3257 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
3258 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
3259 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
3260 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
3268 rh_sfc(i,j) = 1.0_rp - 0.75_rp * ( real_fz(
ks-1,i,j) / tr_z )**1.25_rp
3271 if ( real_cz(k,i,j) <= tr_z )
then
3272 rh(k,i,j) = 1.0_rp - 0.75_rp * ( real_cz(k,i,j) / tr_z )**1.25_rp
3282 qv0 = qv0 / ( 1.0_rp + qv0 )
3284 call saturation_pres2qsat_all( ia,
isb,
ieb, ja,
jsb,
jeb, &
3285 temp_sfc(:,:), pres_sfc(:,:), &
3290 qv_sfc(i,j) = min( rh_sfc(i,j) * qsat_sfc(i,j), qv0 )
3295 do itr = 1, niter_rh
3303 qv(k,i,j) = min( rh(k,i,j) * psat(k,i,j) / (
dens(k,i,j) * rdry * temp(k,i,j) ), qv0 )
3311 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
3312 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
3313 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
3314 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
3319 log_info(
"MKINIT_wk1982",*) k, real_cz(k,
is,
js), pres(k,
is,
js), pott(k,
is,
js), rh(k,
is,
js), qv(k,
is,
js)*1000
3322 call comm_vars8(
dens(:,:,:), 1 )
3323 call comm_wait (
dens(:,:,:), 1 )
3330 momx(k,i,j) = shear_u * tanh( real_cz(k,i,j) / shear_z ) &
3331 * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
3342 momy(k,i,j) = 0.0_rp
3343 momz(k,i,j) = 0.0_rp
3344 rhot(k,i,j) = pott(k,i,j) *
dens(k,i,j)
3347 rhot(k,i,j) =
dens(k,i,j) * ( pott(k,i,j) + bbl_theta * bubble(k,i,j) )
3358 end subroutine mkinit_wk1982
3362 subroutine mkinit_dycoms2_rf01
3374 real(RP) :: PERTURB_AMP = 0.0_rp
3375 integer :: RANDOM_LIMIT = 5
3376 integer :: RANDOM_FLAG = 0
3379 logical :: USE_LWSET = .false.
3381 namelist / param_mkinit_rf01 / &
3387 real(RP) :: potl(KA,IA,JA)
3388 real(RP) :: LHV (KA,IA,JA)
3396 real(RP) :: qdry, Rtot, CPtot
3402 pi2 = atan(1.0_rp) * 2.0_rp
3405 log_info(
"MKINIT_DYCOMS2_RF01",*)
'Setup initial state'
3410 log_error(
"MKINIT_DYCOMS2_RF01",*)
'QV is not registered'
3414 read(
io_fid_conf,nml=param_mkinit_rf01,iostat=ierr)
3416 log_info(
"MKINIT_DYCOMS2_RF01",*)
'Not found namelist. Default used.'
3417 elseif( ierr > 0 )
then
3418 log_error(
"MKINIT_DYCOMS2_RF01",*)
'Not appropriate names in namelist PARAM_MKINIT_RF01. Check!'
3421 log_nml(param_mkinit_rf01)
3423 if ( use_lwset )
then
3436 pres_sfc(i,j) = 1017.8e2_rp
3437 pott_sfc(i,j) = 289.0_rp
3440 velx(k,i,j) = 7.0_rp
3441 vely(k,i,j) = -5.5_rp
3442 if ( cz(k) < 820.0_rp )
then
3443 potl(k,i,j) = 289.0_rp - grav / cpdry * cz(k) * geop_sw
3444 elseif( cz(k) <= 860.0_rp )
then
3445 sint = sin( pi2 * ( cz(k)-840.0_rp ) / 20.0_rp ) * 0.5_rp
3446 potl(k,i,j) = ( 289.0_rp - grav / cpdry * cz(k) * geop_sw ) * (0.5_rp-sint) &
3447 + ( 297.5_rp+sign(abs(cz(k)-840.0_rp)**(1.0_rp/3.0_rp),cz(k)-840.0_rp) &
3448 - grav / cpdry * cz(k) * geop_sw ) * (0.5_rp+sint)
3450 potl(k,i,j) = 297.5_rp + ( cz(k)-840.0_rp )**(1.0_rp/3.0_rp) &
3451 - grav / cpdry * cz(k) * geop_sw
3461 potl(:,:,:), qv(:,:,:), qc(:,:,:), &
3462 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
3463 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
3464 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
3470 qv_sfc(i,j) = 9.0e-3_rp
3473 if ( cz(k) < 820.0_rp )
then
3475 elseif( cz(k) <= 860.0_rp )
then
3476 sint = sin( pi2 * ( cz(k)-840.0_rp ) / 20.0_rp ) * 0.5_rp
3477 qall = 9.0e-3_rp * (0.5_rp-sint) &
3478 + 1.5e-3_rp * (0.5_rp+sint)
3479 elseif( cz(k) <= 5000.0_rp )
then
3485 if ( cz(k) <= 600.0_rp )
then
3487 elseif( cz(k) < 820.0_rp )
then
3488 fact = ( cz(k)-600.0_rp ) / ( 840.0_rp-600.0_rp )
3489 qc(k,i,j) = 0.45e-3_rp * fact
3490 elseif( cz(k) <= 860.0_rp )
then
3491 sint = sin( pi2 * ( cz(k)-840.0_rp ) / 20.0_rp ) * 0.5_rp
3492 fact = ( cz(k)-600.0_rp ) / ( 840.0_rp-600.0_rp )
3493 qc(k,i,j) = 0.45e-3_rp * fact * (0.5_rp-sint)
3498 qv(k,i,j) = qall - qc(k,i,j)
3506 temp(:,:,:), lhv(:,:,:) )
3512 temp(k,i,j) = temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j)
3513 qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
3514 rtot = rdry * qdry + rvap * qv(k,i,j)
3515 cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
3516 pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
3524 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
3525 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
3526 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
3527 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
3539 call comm_vars8(
dens(:,:,:), 1 )
3540 call comm_wait (
dens(:,:,:), 1 )
3542 call random_uniform(rndm)
3548 if ( random_flag == 2 .and. k <= random_limit )
then
3549 momz(k,i,j) = ( ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3550 * 0.5_rp * (
dens(k+1,i,j) +
dens(k,i,j) )
3552 momz(k,i,j) = 0.0_rp
3559 call random_uniform(rndm)
3565 if ( random_flag == 2 .AND. k <= random_limit )
then
3566 momx(k,i,j) = ( velx(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3567 * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
3569 momx(k,i,j) = velx(k,i,j) * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
3576 call random_uniform(rndm)
3582 if ( random_flag == 2 .AND. k <= random_limit )
then
3583 momy(k,i,j) = ( vely(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3584 * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
3586 momy(k,i,j) = vely(k,i,j) * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
3593 call random_uniform(rndm)
3599 if ( random_flag == 1 .and. k <= random_limit )
then
3600 rhot(k,i,j) = ( pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3603 rhot(k,i,j) = pott(k,i,j) *
dens(k,i,j)
3614 if ( qc(k,i,j) > 0.0_rp )
then
3615 nc(k,i,j) = 120.e6_rp /
dens(k,i,j)
3626 end subroutine mkinit_dycoms2_rf01
3630 subroutine mkinit_dycoms2_rf02
3642 real(RP) :: PERTURB_AMP = 0.0_rp
3643 integer :: RANDOM_LIMIT = 5
3644 integer :: RANDOM_FLAG = 0
3648 namelist / param_mkinit_rf02 / &
3653 real(RP) :: potl(KA,IA,JA)
3654 real(RP) :: LHV (KA,IA,JA)
3660 real(RP) :: qdry, Rtot, CPtot
3666 pi2 = atan(1.0_rp) * 2.0_rp
3668 log_info(
"MKINIT_DYCOMS2_RF02",*)
'Setup initial state'
3671 log_error(
"MKINIT_DYCOMS2_RF02",*)
'QV is not registered'
3676 read(
io_fid_conf,nml=param_mkinit_rf02,iostat=ierr)
3678 log_info(
"MKINIT_DYCOMS2_RF02",*)
'Not found namelist. Default used.'
3679 elseif( ierr > 0 )
then
3680 log_error(
"MKINIT_DYCOMS2_RF02",*)
'Not appropriate names in namelist PARAM_MKINIT_RF02. Check!'
3683 log_nml(param_mkinit_rf02)
3688 call random_uniform(rndm)
3693 pres_sfc(i,j) = 1017.8e2_rp
3694 pott_sfc(i,j) = 288.3_rp
3697 velx(k,i,j) = 3.0_rp + 4.3 * cz(k)*1.e-3_rp
3698 vely(k,i,j) = -9.0_rp + 5.6 * cz(k)*1.e-3_rp
3700 if ( cz(k) < 775.0_rp )
then
3701 potl(k,i,j) = 288.3_rp
3702 else if ( cz(k) <= 815.0_rp )
then
3703 sint = sin( pi2 * (cz(k) - 795.0_rp)/20.0_rp )
3704 potl(k,i,j) = 288.3_rp * (1.0_rp-sint)*0.5_rp &
3705 + ( 295.0_rp+sign(abs(cz(k)-795.0_rp)**(1.0_rp/3.0_rp),cz(k)-795.0_rp) ) &
3706 * (1.0_rp+sint)*0.5_rp
3708 potl(k,i,j) = 295.0_rp + ( cz(k)-795.0_rp )**(1.0_rp/3.0_rp)
3717 potl(:,:,:), qv(:,:,:), qc(:,:,:), &
3718 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
3719 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
3720 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
3726 qv_sfc(i,j) = 9.45e-3_rp
3729 if ( cz(k) < 775.0_rp )
then
3731 else if ( cz(k) <= 815.0_rp )
then
3732 sint = sin( pi2 * (cz(k) - 795.0_rp)/20.0_rp )
3733 qall = 9.45e-3_rp * (1.0_rp-sint)*0.5_rp + &
3734 ( 5.e-3_rp - 3.e-3_rp * ( 1.0_rp - exp( (795.0_rp-cz(k))/500.0_rp ) ) ) * (1.0_rp+sint)*0.5_rp
3736 qall = 5.e-3_rp - 3.e-3_rp * ( 1.0_rp - exp( (795.0_rp-cz(k))/500.0_rp ) )
3739 if( cz(k) < 400.0_rp )
then
3741 elseif( cz(k) < 775.0_rp )
then
3742 fact = ( cz(k)-400.0_rp ) / ( 795.0_rp-400.0_rp )
3743 qc(k,i,j) = 0.65e-3_rp * fact
3744 elseif( cz(k) <= 815.0_rp )
then
3745 sint = sin( pi2 * ( cz(k)-795.0_rp )/20.0_rp )
3746 fact = ( cz(k)-400.0_rp ) / ( 795.0_rp-400.0_rp )
3747 qc(k,i,j) = 0.65e-3_rp * fact * (1.0_rp-sint) * 0.5_rp
3751 qv(k,i,j) = qall - qc(k,i,j)
3759 temp(:,:,:), lhv(:,:,:) )
3765 temp(k,i,j) = temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j)
3766 qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
3767 rtot = rdry * qdry + rvap * qv(k,i,j)
3768 cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
3769 pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
3777 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
3778 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
3779 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
3780 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
3792 call comm_vars8(
dens(:,:,:), 1 )
3793 call comm_wait (
dens(:,:,:), 1 )
3795 call random_uniform(rndm)
3801 if( random_flag == 2 .and. k <= random_limit )
then
3802 momz(k,i,j) = ( 0.0_rp + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3803 * 0.5_rp * (
dens(k+1,i,j) +
dens(k,i,j) )
3805 momz(k,i,j) = 0.0_rp
3812 call random_uniform(rndm)
3818 if( random_flag == 2 .and. k <= random_limit )
then
3819 momx(k,i,j) = ( velx(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3820 * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
3822 momx(k,i,j) = ( velx(k,i,j) ) * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
3829 call random_uniform(rndm)
3835 if( random_flag == 2 .and. k <= random_limit )
then
3836 momy(k,i,j) = ( vely(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3837 * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
3839 momy(k,i,j) = vely(k,i,j) * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
3846 call random_uniform(rndm)
3852 if( random_flag == 1 .and. k <= random_limit )
then
3853 rhot(k,i,j) = ( pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3856 rhot(k,i,j) = pott(k,i,j) *
dens(k,i,j)
3867 if ( qc(k,i,j) > 0.0_rp )
then
3868 nc(k,i,j) = 55.0e6_rp /
dens(k,i,j)
3879 end subroutine mkinit_dycoms2_rf02
3883 subroutine mkinit_dycoms2_rf02_dns
3895 real(RP) :: ZB = 750.0_rp
3897 real(RP) :: CONST_U = 0.0_rp
3898 real(RP) :: CONST_V = 0.0_rp
3899 real(RP) :: PRES_ZB = 93060.0_rp
3900 real(RP) :: PERTURB_AMP = 0.0_rp
3901 integer :: RANDOM_LIMIT = 5
3902 integer :: RANDOM_FLAG = 0
3906 namelist / param_mkinit_rf02_dns / &
3907 zb, const_u, const_v,pres_zb,&
3912 real(RP) :: potl(KA,IA,JA)
3913 real(RP) :: LHV (KA,IA,JA)
3919 real(RP) :: qdry, Rtot, CPtot
3925 pi2 = atan(1.0_rp) * 2.0_rp
3928 log_info(
"MKINIT_DYCOMS2_RF02_DNS",*)
'Setup initial state'
3931 log_error(
"MKINIT_DYCOMS2_RF02_DNS",*)
'QV is not registered'
3936 read(
io_fid_conf,nml=param_mkinit_rf02_dns,iostat=ierr)
3938 log_info(
"MKINIT_DYCOMS2_RF02_DNS",*)
'Not found namelist. Default used.'
3939 elseif( ierr > 0 )
then
3940 log_error(
"MKINIT_DYCOMS2_RF02_DNS",*)
'Not appropriate names in namelist PARAM_MKINIT_RF02_DNS. Check!'
3943 log_nml(param_mkinit_rf02_dns)
3948 call random_uniform(rndm)
3953 pres_sfc(i,j) = pres_zb
3959 velx(k,i,j) = const_u
3960 vely(k,i,j) = const_v
3963 if ( zb+cz(k) <= 795.0_rp )
then
3964 potl(k,i,j) = 288.3_rp
3974 potl(k,i,j) = 295.0_rp + ( zb+cz(k)-795.0_rp )**(1.0_rp/3.0_rp)
3975 qall = 5.e-3_rp - 3.e-3_rp * ( 1.0_rp - exp( (795.0_rp-(zb+cz(k)))/500.0_rp ) )
3978 if( zb+cz(k) < 400.0_rp )
then
3980 elseif( zb+cz(k) <= 795.0_rp )
then
3981 fact = ( (zb+cz(k))-400.0_rp ) / ( 795.0_rp-400.0_rp )
3982 qc(k,i,j) = 0.8e-3_rp * fact
3986 qv(k,i,j) = qall - qc(k,i,j)
3997 pott_sfc(:,:) = potl(
ks,:,:)-0.5*(potl(
ks+1,:,:)-potl(
ks,:,:))
3998 qv_sfc(:,:) = qv(
ks,:,:)-0.5*(qv(
ks+1,:,:)-qv(
ks,:,:))
3999 qc_sfc(:,:) = qc(
ks,:,:)-0.5*(qc(
ks+1,:,:)-qc(
ks,:,:))
4004 potl(:,:,:), qv(:,:,:), qc(:,:,:), &
4005 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
4006 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
4007 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
4010 temp(:,:,:), lhv(:,:,:) )
4016 temp(k,i,j) = temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j)
4017 qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
4018 rtot = rdry * qdry + rvap * qv(k,i,j)
4019 cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
4020 pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
4028 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
4029 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
4030 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
4031 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
4043 call comm_vars8(
dens(:,:,:), 1 )
4044 call comm_wait (
dens(:,:,:), 1 )
4046 call random_uniform(rndm)
4052 if( random_flag == 2 .and. k <= random_limit )
then
4053 momz(k,i,j) = ( 0.0_rp + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4054 * 0.5_rp * (
dens(k+1,i,j) +
dens(k,i,j) )
4056 momz(k,i,j) = 0.0_rp
4064 call random_uniform(rndm)
4070 if( random_flag == 2 .and. k <= random_limit )
then
4071 momx(k,i,j) = ( velx(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4072 * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
4074 momx(k,i,j) = ( velx(k,i,j) ) * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
4082 call random_uniform(rndm)
4088 if( random_flag == 2 .and. k <= random_limit )
then
4089 momy(k,i,j) = ( vely(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4090 * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
4092 momy(k,i,j) = vely(k,i,j) * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
4099 call random_uniform(rndm)
4105 if( random_flag == 1 .and. k <= random_limit )
then
4106 rhot(k,i,j) = ( pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4109 rhot(k,i,j) = pott(k,i,j) *
dens(k,i,j)
4120 if ( qc(k,i,j) > 0.0_rp )
then
4121 nc(k,i,j) = 55.0e6_rp /
dens(k,i,j)
4132 end subroutine mkinit_dycoms2_rf02_dns
4136 subroutine mkinit_rico
4148 real(RP):: PERTURB_AMP_PT = 0.1_rp
4149 real(RP):: PERTURB_AMP_QV = 2.5e-5_rp
4151 namelist / param_mkinit_rico / &
4155 real(RP) :: LHV (KA,IA,JA)
4156 real(RP) :: potl(KA,IA,JA)
4160 real(RP) :: qdry, Rtot, CPtot
4167 log_info(
"MKINIT_RICO",*)
'Setup initial state'
4170 log_error(
"MKINIT_RICO",*)
'QV is not registered'
4175 read(
io_fid_conf,nml=param_mkinit_rico,iostat=ierr)
4177 log_info(
"MKINIT_RICO",*)
'Not found namelist. Default used.'
4178 elseif( ierr > 0 )
then
4179 log_error(
"MKINIT_RICO",*)
'Not appropriate names in namelist PARAM_MKINIT_RICO. Check!'
4182 log_nml(param_mkinit_rico)
4191 pres_sfc(i,j) = 1015.4e2_rp
4192 pott_sfc(i,j) = 297.9_rp
4196 if ( cz(k) < 740.0_rp )
then
4197 potl(k,i,j) = 297.9_rp
4199 fact = ( cz(k)-740.0_rp ) * ( 317.0_rp-297.9_rp ) / ( 4000.0_rp-740.0_rp )
4200 potl(k,i,j) = 297.9_rp + fact
4204 if ( cz(k) <= 4000.0_rp )
then
4205 fact = ( cz(k)-0.0_rp ) * ( -1.9_rp+9.9_rp ) / ( 4000.0_rp-0.0_rp )
4206 velx(k,i,j) = -9.9_rp + fact
4207 vely(k,i,j) = -3.8_rp
4209 velx(k,i,j) = -1.9_rp
4210 vely(k,i,j) = -3.8_rp
4220 potl(:,:,:), qv(:,:,:), qc(:,:,:), &
4221 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
4222 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
4223 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
4229 qv_sfc(i,j) = 16.0e-3_rp
4233 if ( cz(k) <= 740.0_rp )
then
4234 fact = ( cz(k)-0.0_rp ) * ( 13.8e-3_rp-16.0e-3_rp ) / ( 740.0_rp-0.0_rp )
4235 qall = 16.0e-3_rp + fact
4236 elseif ( cz(k) <= 3260.0_rp )
then
4237 fact = ( cz(k)-740.0_rp ) * ( 2.4e-3_rp-13.8e-3_rp ) / ( 3260.0_rp-740.0_rp )
4238 qall = 13.8e-3_rp + fact
4239 elseif( cz(k) <= 4000.0_rp )
then
4240 fact = ( cz(k)-3260.0_rp ) * ( 1.8e-3_rp-2.4e-3_rp ) / ( 4000.0_rp-3260.0_rp )
4241 qall = 2.4e-3_rp + fact
4246 qv(k,i,j) = qall - qc(k,i,j)
4254 temp(:,:,:), lhv(:,:,:) )
4260 temp(k,i,j) = temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j)
4261 qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
4262 rtot = rdry * qdry + rvap * qv(k,i,j)
4263 cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
4264 pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
4272 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
4273 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
4274 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
4275 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
4288 call comm_vars8(
dens(:,:,:), 1 )
4289 call comm_wait (
dens(:,:,:), 1 )
4295 momz(k,i,j) = 0.0_rp
4306 momx(k,i,j) = velx(k,i,j) * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
4317 momy(k,i,j) = vely(k,i,j) * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
4323 call random_uniform(rndm)
4329 rhot(k,i,j) = ( pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp )*perturb_amp_pt ) *
dens(k,i,j)
4335 call random_uniform(rndm)
4340 qv(k,i,j) = qv(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp_qv
4350 if ( qc(k,i,j) > 0.0_rp )
then
4351 nc(k,i,j) = 70.e6_rp /
dens(k,i,j)
4362 end subroutine mkinit_rico
4366 subroutine mkinit_bomex
4378 real(RP):: PERTURB_AMP_PT = 0.1_rp
4379 real(RP):: PERTURB_AMP_QV = 2.5e-5_rp
4381 namelist / param_mkinit_bomex / &
4385 real(RP) :: LHV (KA,IA,JA)
4386 real(RP) :: potl(KA,IA,JA)
4390 real(RP) :: qdry, Rtot, CPtot
4397 log_info(
"MKINIT_BOMEX",*)
'Setup initial state'
4400 log_error(
"MKINIT_BOMEX",*)
'QV is not registered'
4405 read(
io_fid_conf,nml=param_mkinit_bomex,iostat=ierr)
4407 log_info(
"MKINIT_BOMEX",*)
'Not found namelist. Default used.'
4408 elseif( ierr > 0 )
then
4409 log_error(
"MKINIT_BOMEX",*)
'Not appropriate names in namelist PARAM_MKINIT_BOMEX. Check!'
4412 log_nml(param_mkinit_bomex)
4421 pres_sfc(i,j) = 1015.e2_rp
4422 pott_sfc(i,j) = 299.1_rp
4426 if ( cz(k) < 520.0_rp )
then
4427 potl(k,i,j) = 298.7_rp
4428 elseif( cz(k) < 1480.0_rp )
then
4429 fact = ( cz(k)-520.0_rp ) * ( 302.4_rp-298.7_rp ) / ( 1480.0_rp-520.0_rp )
4430 potl(k,i,j) = 298.7_rp + fact
4431 elseif( cz(k) < 2000.0_rp )
then
4432 fact = ( cz(k)-1480.0_rp ) * ( 308.2_rp-302.4_rp ) / ( 2000.0_rp-1480.0_rp )
4433 potl(k,i,j) = 302.4_rp + fact
4435 fact = ( cz(k)-2000.0_rp ) * 3.65e-3_rp
4436 potl(k,i,j) = 308.2_rp + fact
4440 if ( cz(k) <= 700.0_rp )
then
4441 velx(k,i,j) = -8.75_rp
4442 vely(k,i,j) = 0.0_rp
4444 fact = 1.8e-3_rp * ( cz(k)-700.0_rp )
4445 velx(k,i,j) = -8.75_rp + fact
4446 vely(k,i,j) = 0.0_rp
4456 potl(:,:,:), qv(:,:,:), qc(:,:,:), &
4457 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
4458 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
4459 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
4465 qv_sfc(i,j) = 22.45e-3_rp
4469 if ( cz(k) <= 520.0_rp )
then
4470 fact = ( cz(k)-0.0_rp ) * ( 16.3e-3_rp-17.0e-3_rp ) / ( 520.0_rp-0.0_rp )
4471 qall = 17.0e-3_rp + fact
4472 elseif ( cz(k) <= 1480.0_rp )
then
4473 fact = ( cz(k)-520.0_rp ) * ( 10.7e-3_rp-16.3e-3_rp ) / ( 1480.0_rp-520.0_rp )
4474 qall = 16.3e-3_rp + fact
4475 elseif( cz(k) <= 2000.0_rp )
then
4476 fact = ( cz(k)-1480.0_rp ) * ( 4.2e-3_rp-10.7e-3_rp ) / ( 2000.0_rp-1480.0_rp )
4477 qall = 10.7e-3_rp + fact
4479 fact = ( cz(k)-2000.0_rp ) * ( -1.2e-6_rp )
4480 qall = 4.2e-3_rp + fact
4483 qv(k,i,j) = qall - qc(k,i,j)
4491 temp(:,:,:), lhv(:,:,:) )
4497 qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
4498 rtot = rdry * qdry + rvap * qv(k,i,j)
4499 cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
4500 pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
4508 pott(:,:,:), qv(:,:,:), qc(:,:,:), &
4509 pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), &
4510 real_cz(:,:,:), real_fz(:,:,:), area(:,:), &
4511 dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) )
4524 call comm_vars8(
dens(:,:,:), 1 )
4525 call comm_wait (
dens(:,:,:), 1 )
4531 momz(k,i,j) = 0.0_rp
4542 momx(k,i,j) = velx(k,i,j) * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
4553 momy(k,i,j) = vely(k,i,j) * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
4559 call random_uniform(rndm)
4565 if( cz(k) <= 1600.0_rp )
then
4566 rhot(k,i,j) = ( pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp_pt ) *
dens(k,i,j)
4568 rhot(k,i,j) = pott(k,i,j) *
dens(k,i,j)
4575 call random_uniform(rndm)
4581 if( cz(k) <= 1600.0_rp )
then
4582 qv(k,i,j) = qv(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp_qv
4593 if ( qc(k,i,j) > 0.0_rp )
then
4594 nc(k,i,j) = 70.e6_rp /
dens(k,i,j)
4605 end subroutine mkinit_bomex
4609 subroutine mkinit_oceancouple
4613 log_info(
"MKINIT_oceancouple",*)
'Setup initial state'
4620 end subroutine mkinit_oceancouple
4624 subroutine mkinit_landcouple
4628 log_info(
"MKINIT_landcouple",*)
'Setup initial state'
4635 end subroutine mkinit_landcouple
4639 subroutine mkinit_urbancouple
4643 log_info(
"MKINIT_urbancouple",*)
'Setup initial state'
4650 end subroutine mkinit_urbancouple
4654 subroutine mkinit_seabreeze
4667 real(RP) :: LAND_SIZE
4669 namelist / param_mkinit_seabreeze / &
4677 log_info(
"MKINIT_seabreeze",*)
'Setup initial state'
4683 read(
io_fid_conf,nml=param_mkinit_seabreeze,iostat=ierr)
4686 log_info(
"MKINIT_seabreeze",*)
'Not found namelist. Default used.'
4687 elseif( ierr > 0 )
then
4688 log_error(
"MKINIT_seabreeze",*)
'Not appropriate names in namelist PARAM_MKINIT_SEABREEZE. Check!'
4691 log_nml(param_mkinit_seabreeze)
4703 if ( abs( cx(i) - domain_center_x ) < land_size )
then
4720 end subroutine mkinit_seabreeze
4724 subroutine mkinit_heatisland
4740 log_info(
"MKINIT_heatisland",*)
'Setup initial state'
4755 if ( cx(i) >= dist * 4.0_rp &
4756 .AND. cx(i) < dist * 5.0_rp )
then
4772 end subroutine mkinit_heatisland
4776 subroutine mkinit_grayzone
4782 real(RP) :: VELX(KA)
4783 real(RP) :: VELY(KA)
4784 real(RP) :: POTT(KA)
4785 real(RP) :: QV1D(KA)
4787 real(RP) :: PERTURB_AMP = 0.0_rp
4788 integer :: RANDOM_LIMIT = 0
4789 integer :: RANDOM_FLAG = 0
4793 namelist / param_mkinit_grayzone / &
4803 log_info(
"MKINIT_grayzone",*)
'Setup initial state'
4806 log_error(
"MKINIT_grayzone",*)
'QV is not registered'
4812 read(
io_fid_conf,nml=param_mkinit_grayzone,iostat=ierr)
4815 log_info(
"MKINIT_grayzone",*)
'Not found namelist. Default used.'
4816 elseif( ierr > 0 )
then
4817 log_error(
"MKINIT_grayzone",*)
'Not appropriate names in namelist PARAM_MKINIT_GRAYZONE. Check!'
4820 log_nml(param_mkinit_grayzone)
4830 dens(k,i,j) = rho(k)
4852 call random_uniform(rndm)
4858 if ( random_flag == 2 .and. k <= random_limit )
then
4859 momz(k,i,j) = ( ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4860 * 0.5_rp * (
dens(k+1,i,j) +
dens(k,i,j) )
4862 momz(k,i,j) = 0.0_rp
4869 call random_uniform(rndm)
4875 if ( random_flag == 2 .AND. k <= random_limit )
then
4876 momx(k,i,j) = ( velx(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4877 * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
4879 momx(k,i,j) = velx(k) * 0.5_rp * (
dens(k,i+1,j) +
dens(k,i,j) )
4886 call random_uniform(rndm)
4892 if ( random_flag == 2 .AND. k <= random_limit )
then
4893 momy(k,i,j) = ( vely(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4894 * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
4896 momy(k,i,j) = vely(k) * 0.5_rp * (
dens(k,i,j+1) +
dens(k,i,j) )
4903 call random_uniform(rndm)
4909 if ( random_flag == 1 .and. k <= random_limit )
then
4910 rhot(k,i,j) = ( pott(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4913 rhot(k,i,j) = pott(k) *
dens(k,i,j)
4921 end subroutine mkinit_grayzone
4925 subroutine mkinit_boxaero
4936 atmos_thermodyn_rhot2temp_pres
4941 real(RP) :: init_dens = 1.12_rp
4942 real(RP) :: init_temp = 298.18_rp
4943 real(RP) :: init_pres = 1.e+5_rp
4944 real(RP) :: init_ssliq = 0.01_rp
4946 namelist / param_mkinit_boxaero / &
4952 real(RP) :: rtot (KA,IA,JA)
4953 real(RP) :: cvtot(KA,IA,JA)
4954 real(RP) :: cptot(KA,IA,JA)
4957 integer :: i, j, k, ierr
4961 log_info(
"MKINIT_boxaero",*)
'For [Box model of aerosol],'
4962 log_info(
"MKINIT_boxaero",*)
'ATMOS_PHY_AE_TYPE should be KAJINO13. Stop! ', trim(
atmos_phy_ae_type)
4967 log_error(
"MKINIT_boxaero",*)
'QV is not registered'
4972 log_info(
"MKINIT_boxaero",*)
'Setup initial state'
4976 read(
io_fid_conf,nml=param_mkinit_boxaero,iostat=ierr)
4978 log_info(
"MKINIT_boxaero",*)
'Not found namelist. Default used.'
4979 elseif( ierr > 0 )
then
4980 log_error(
"MKINIT_boxaero",*)
'Not appropriate names in namelist PARAM_MKINIT_BOXAERO. Check!'
4983 log_nml(param_mkinit_boxaero)
4985 call saturation_pres2qsat_all( init_temp, init_pres, qsat )
4994 dens(k,i,j) = init_dens
4995 momx(k,i,j) = 0.0_rp
4996 momy(k,i,j) = 0.0_rp
4997 momz(k,i,j) = 0.0_rp
4998 pott(k,i,j) = init_temp * ( p00/init_pres )**(rdry/cpdry)
4999 rhot(k,i,j) = init_dens * pott(k,i,j)
5001 qv(k,i,j) = ( init_ssliq + 1.0_rp ) * qsat
5003 qdry = 1.0 - qv(k,i,j)
5004 rtot(k,i,j) = rdry * qdry + rvap * qv(i,i,j)
5005 cvtot(k,i,j) = cvdry * qdry + cvvap * qv(i,i,j)
5006 cptot(k,i,j) = cpdry * qdry + cpvap * qv(i,i,j)
5012 call atmos_thermodyn_rhot2temp_pres( ka, 1, ka, ia, 1, ia, ja, 1, ja, &
5014 rtot(:,:,:), cvtot(:,:,:), cptot(:,:,:), &
5015 temp(:,:,:), pres(:,:,:) )
5020 end subroutine mkinit_boxaero
5024 subroutine mkinit_warmbubbleaero
5030 real(RP) :: SFC_THETA
5031 real(RP) :: SFC_PRES
5032 real(RP) :: SFC_RH = 80.0_rp
5034 real(RP) :: ENV_U = 0.0_rp
5035 real(RP) :: ENV_V = 0.0_rp
5036 real(RP) :: ENV_RH = 80.0_rp
5037 real(RP) :: ENV_L1_ZTOP = 1.e3_rp
5038 real(RP) :: ENV_L2_ZTOP = 14.e3_rp
5039 real(RP) :: ENV_L2_TLAPS = 4.e-3_rp
5040 real(RP) :: ENV_L3_TLAPS = 3.e-2_rp
5042 real(RP) :: BBL_THETA = 1.0_rp
5044 namelist / param_mkinit_warmbubble / &
5056 logical :: converged
5059 real(RP) :: work1(KA)
5060 real(RP) :: work2(KA)
5061 real(RP) :: work3(KA)
5065 integer :: k, i, j, itr
5069 log_info(
"MKINIT_warmbubbleaero",*)
'Setup initial state'
5072 log_error(
"MKINIT_warmbubbleaero",*)
'QV is not registerd'
5077 sfc_theta = thetastd
5082 read(
io_fid_conf,nml=param_mkinit_warmbubble,iostat=ierr)
5085 log_info(
"MKINIT_warmbubbleaero",*)
'Not found namelist. Default used.'
5086 elseif( ierr > 0 )
then
5087 log_error(
"MKINIT_warmbubbleaero",*)
'Not appropriate names in namelist PARAM_MKINIT_WARMBUBBLE. Check!'
5090 log_nml(param_mkinit_warmbubble)
5094 pres_sfc(1,1) = sfc_pres
5095 pott_sfc(1,1) = sfc_theta
5101 if ( cz(k) <= env_l1_ztop )
then
5102 pott(k,1,1) = sfc_theta
5103 elseif( cz(k) < env_l2_ztop )
then
5104 pott(k,1,1) = pott(k-1,1,1) + env_l2_tlaps * ( cz(k)-cz(k-1) )
5106 pott(k,1,1) = pott(k-1,1,1) + env_l3_tlaps * ( cz(k)-cz(k-1) )
5112 call hydrostatic_buildrho( ka,
ks,
ke, &
5113 pott(:,1,1), qv(:,1,1), qc(:,1,1), &
5114 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
5117 work1(:), work2(:), work3(:), &
5119 dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1), &
5123 call saturation_pres2qsat_all( temp_sfc(1,1), pres_sfc(1,1), &
5126 qv_sfc(1,1) = sfc_rh * 1.e-2_rp * qsat_sfc(1,1)
5129 do itr = 1, niter_rh
5130 call saturation_psat_all( ka,
ks,
ke, &
5135 if( cz(k) <= env_l2_ztop )
then
5136 qv(k,1,1) = env_rh * 1.e-2_rp * psat(k,1,1) / (
dens(k,1,1) * rvap * temp(k,1,1) )
5144 call hydrostatic_buildrho( ka,
ks,
ke, &
5145 pott(:,1,1), qv(:,1,1), qc(:,1,1), &
5146 pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), &
5149 work1(:), work2(:), work3(:), &
5151 dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1), &
5161 momz(k,i,j) = 0.0_rp
5166 rhot(k,i,j) =
dens(k,1,1) * ( pott(k,1,1) + bbl_theta * bubble(k,i,j) )
5168 qv(k,i,j) = qv(k,1,1)
5177 end subroutine mkinit_warmbubbleaero
5181 subroutine mkinit_real
5201 end subroutine mkinit_real