SCALE-RM
mod_mkinit.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
11 #include "scalelib.h"
12 module mod_mkinit
13  !-----------------------------------------------------------------------------
14  !
15  !++ used modules
16  !
17  use scale_precision
18  use scale_io
19  use scale_prof
21  use scale_tracer
23 
24  use scale_prc, only: &
25  prc_abort
26  use scale_const, only: &
27  pi => const_pi, &
28  grav => const_grav, &
29  pstd => const_pstd, &
30  rdry => const_rdry, &
31  cpdry => const_cpdry, &
32  p00 => const_pre00, &
33  epsvap => const_epsvap
34  use scale_random, only: &
35  random_uniform
36  use scale_comm_cartesc, only: &
37  comm_vars8, &
38  comm_wait
39  use scale_atmos_grid_cartesc, only: &
40  cz => atmos_grid_cartesc_cz, &
41  cx => atmos_grid_cartesc_cx, &
42  cy => atmos_grid_cartesc_cy, &
43  fz => atmos_grid_cartesc_fz, &
44  fx => atmos_grid_cartesc_fx, &
45  fy => atmos_grid_cartesc_fy, &
46  cxg => atmos_grid_cartesc_cxg, &
47  fxg => atmos_grid_cartesc_fxg, &
50  real_cz => atmos_grid_cartesc_real_cz, &
51  real_fz => atmos_grid_cartesc_real_fz, &
53  use scale_atmos_profile, only: &
54  profile_isa => atmos_profile_isa
55  use scale_atmos_hydrometeor, only: &
56  hydrometeor_lhv => atmos_hydrometeor_lhv
57  use scale_atmos_hydrostatic, only: &
58  hydrostatic_buildrho => atmos_hydrostatic_buildrho, &
59  hydrostatic_buildrho_atmos => atmos_hydrostatic_buildrho_atmos, &
60  hydrostatic_buildrho_bytemp => atmos_hydrostatic_buildrho_bytemp
61  use scale_atmos_saturation, only: &
62  saturation_psat_all => atmos_saturation_psat_all, &
63  saturation_pres2qsat_all => atmos_saturation_pres2qsat_all, &
64  saturation_pres2qsat_liq => atmos_saturation_pres2qsat_liq
65  use mod_atmos_vars, only: &
66  dens, &
67  momx, &
68  momy, &
69  momz, &
70  rhot, &
71  qtrc
72  use mod_atmos_phy_ae_vars, only: &
73  ccn => atmos_phy_ae_ccn
74  !-----------------------------------------------------------------------------
75  implicit none
76  private
77  !-----------------------------------------------------------------------------
78  !
79  !++ Public procedure
80  !
81  public :: mkinit_setup
82  public :: mkinit
83 
84  !-----------------------------------------------------------------------------
85  !
86  !++ Public parameters & variables
87  !
88  integer, public :: mkinit_type = -1
89  integer, public, parameter :: i_ignore = 0
90 
91  integer, public, parameter :: i_planestate = 1
92  integer, public, parameter :: i_tracerbubble = 2
93  integer, public, parameter :: i_coldbubble = 3
94 
95  integer, public, parameter :: i_lambwave = 4
96  integer, public, parameter :: i_gravitywave = 5
97  integer, public, parameter :: i_khwave = 6
98  integer, public, parameter :: i_turbulence = 7
99  integer, public, parameter :: i_mountainwave = 8
100 
101  integer, public, parameter :: i_warmbubble = 9
102  integer, public, parameter :: i_supercell = 10
103  integer, public, parameter :: i_squallline = 11
104  integer, public, parameter :: i_wk1982 = 12
105  integer, public, parameter :: i_dycoms2_rf01 = 13
106  integer, public, parameter :: i_dycoms2_rf02 = 14
107  integer, public, parameter :: i_rico = 15
108 
109  integer, public, parameter :: i_interporation = 16
110 
111  integer, public, parameter :: i_landcouple = 17
112  integer, public, parameter :: i_oceancouple = 18
113  integer, public, parameter :: i_urbancouple = 19
114  integer, public, parameter :: i_triplecouple = 20
115  integer, public, parameter :: i_bubblecouple = 21
116 
117  integer, public, parameter :: i_seabreeze = 22
118  integer, public, parameter :: i_heatisland = 23
119 
120  integer, public, parameter :: i_dycoms2_rf02_dns = 24
121 
122  integer, public, parameter :: i_real = 25
123 
124  integer, public, parameter :: i_grayzone = 26
125  integer, public, parameter :: i_boxaero = 27
126  integer, public, parameter :: i_warmbubbleaero = 28
127 
128  integer, public, parameter :: i_cavityflow = 29
129  integer, public, parameter :: i_barocwave = 30
130  integer, public, parameter :: i_bomex = 31
131 
132  !-----------------------------------------------------------------------------
133  !
134  !++ Private procedure
135  !
136  private :: bubble_setup
137  private :: sbmaero_setup
138  private :: aerosol_setup
139 
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
150 
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
159 
160  private :: mkinit_landcouple
161  private :: mkinit_oceancouple
162  private :: mkinit_urbancouple
163  private :: mkinit_seabreeze
164  private :: mkinit_heatisland
165 
166  private :: mkinit_dycoms2_rf02_dns
167 
168  private :: mkinit_real
169 
170  private :: mkinit_grayzone
171 
172  private :: mkinit_boxaero
173  private :: mkinit_warmbubbleaero
174 
175  !-----------------------------------------------------------------------------
176  !
177  !++ Private parameters & variables
178  !
179  real(rp), private, parameter :: thetastd = 300.0_rp ! [K]
180 
181  real(rp), private, allocatable :: pres (:,:,:) ! pressure [Pa]
182  real(rp), private, allocatable :: temp (:,:,:) ! temperature [K]
183  real(rp), private, allocatable :: pott (:,:,:) ! potential temperature [K]
184  real(rp), private, allocatable :: qdry (:,:,:) ! dry air mass ratio [kg/kg]
185  real(rp), private, allocatable :: qsat (:,:,:) ! satulated water vapor [kg/kg]
186  real(rp), private, allocatable :: qv (:,:,:) ! water vapor [kg/kg]
187  real(rp), private, allocatable :: qc (:,:,:) ! cloud water [kg/kg]
188  real(rp), private, allocatable :: nc (:,:,:) ! cloud water number density [1/kg]
189  real(rp), private, allocatable :: velx (:,:,:) ! velocity u [m/s]
190  real(rp), private, allocatable :: vely (:,:,:) ! velocity v [m/s]
191  real(rp), private, allocatable :: ptrc (:,:,:) ! passive tracer
192 
193  real(rp), private, allocatable :: pres_sfc(:,:) ! surface pressure [Pa]
194  real(rp), private, allocatable :: temp_sfc(:,:) ! surface temperature [K]
195  real(rp), private, allocatable :: pott_sfc(:,:) ! surface potential temperature [K]
196  real(rp), private, allocatable :: psat_sfc(:,:) ! surface satulated water pressure [Pa]
197  real(rp), private, allocatable :: qsat_sfc(:,:) ! surface satulated water vapor [kg/kg]
198  real(rp), private, allocatable :: qv_sfc (:,:) ! surface water vapor [kg/kg]
199  real(rp), private, allocatable :: qc_sfc (:,:) ! surface cloud water [kg/kg]
200 
201  real(rp), private, allocatable :: rndm (:,:,:) ! random number (0-1)
202  real(rp), private, allocatable, target :: bubble (:,:,:) ! bubble factor (0-1)
203  real(rp), private, allocatable, target :: rect (:,:,:) ! rectangle factor (0-1)
204  real(rp), private, allocatable :: gan (:) ! gamma factor (0-1)
205 
206  !-----------------------------------------------------------------------------
207 contains
208  !-----------------------------------------------------------------------------
210  subroutine mkinit_setup
211  implicit none
212 
213  character(len=H_SHORT) :: mkinit_initname = 'NONE'
214 
215  namelist / param_mkinit / &
216  mkinit_initname
217 
218  integer :: ierr
219  !---------------------------------------------------------------------------
220 
221  log_newline
222  log_info("MKINIT_setup",*) 'Setup'
223 
224  !--- read namelist
225  rewind(io_fid_conf)
226  read(io_fid_conf,nml=param_mkinit,iostat=ierr)
227  if( ierr < 0 ) then !--- missing
228  log_info("MKINIT_setup",*) 'Not found namelist. Default used.'
229  elseif( ierr > 0 ) then !--- fatal error
230  log_error("MKINIT_setup",*) 'Not appropriate names in namelist PARAM_MKINIT. Check!'
231  call prc_abort
232  endif
233  log_nml(param_mkinit)
234 
235  allocate( pres(ka,ia,ja) )
236  allocate( temp(ka,ia,ja) )
237  allocate( pott(ka,ia,ja) )
238  allocate( qdry(ka,ia,ja) )
239  allocate( qsat(ka,ia,ja) )
240  allocate( qv(ka,ia,ja) )
241  allocate( qc(ka,ia,ja) )
242  allocate( nc(ka,ia,ja) )
243  allocate( velx(ka,ia,ja) )
244  allocate( vely(ka,ia,ja) )
245  allocate( ptrc(ka,ia,ja) )
246 
247  allocate( pres_sfc(ia,ja) )
248  allocate( temp_sfc(ia,ja) )
249  allocate( pott_sfc(ia,ja) )
250  allocate( psat_sfc(ia,ja) )
251  allocate( qsat_sfc(ia,ja) )
252  allocate( qv_sfc(ia,ja) )
253  allocate( qc_sfc(ia,ja) )
254 
255  allocate( rndm(ka,ia,ja) )
256  allocate( bubble(ka,ia,ja) )
257  allocate( rect(ka,ia,ja) )
258 
259 
260  select case(trim(mkinit_initname))
261  case('NONE')
263  case('PLANESTATE')
265  case('TRACERBUBBLE')
267  case('COLDBUBBLE')
269  call bubble_setup
270  case('LAMBWAVE')
272  call bubble_setup
273  case('GRAVITYWAVE')
275  call bubble_setup
276  case('KHWAVE')
278  case('TURBULENCE')
280  case('MOUNTAINWAVE')
282  call bubble_setup
283  case('WARMBUBBLE')
285  call bubble_setup
286  case('SUPERCELL')
288  call bubble_setup
289  case('SQUALLLINE')
291  case('WK1982')
293  call bubble_setup
294  case('DYCOMS2_RF01')
296  case('DYCOMS2_RF02')
298  case('RICO')
300  case('BOMEX')
302  case('INTERPORATION')
304  case('LANDCOUPLE')
306  case('OCEANCOUPLE')
308  case('URBANCOUPLE')
310  case('TRIPLECOUPLE')
312  case('BUBBLECOUPLE')
314  call bubble_setup
315  case('SEABREEZE')
317  case('HEATISLAND')
319  case('DYCOMS2_RF02_DNS')
321  case('REAL')
323  case('GRAYZONE')
325  case('BOXAERO')
327  case('WARMBUBBLEAERO')
329  call bubble_setup
330  case('CAVITYFLOW')
332  case('BAROCWAVE')
334  case default
335  log_error("MKINIT_setup",*) 'Unsupported TYPE:', trim(mkinit_initname)
336  call prc_abort
337  endselect
338 
339  return
340  end subroutine mkinit_setup
341 
342  !-----------------------------------------------------------------------------
344  subroutine mkinit( output )
345  use scale_const, only: &
347  use scale_atmos_hydrometeor, only: &
349  n_hyd, &
350  i_hc
351  use mod_atmos_phy_mp_vars, only: &
352  qs_mp, &
353  qe_mp
354  use mod_atmos_admin, only: &
356  use mod_atmos_phy_mp_driver, only: &
358  implicit none
359  logical, intent(out) :: output
360 
361  real(rp) :: qhyd(ka,ia,ja,n_hyd)
362  real(rp) :: qnum(ka,ia,ja,n_hyd)
363 
364  logical :: convert_qtrc
365  integer :: iq
366  !---------------------------------------------------------------------------
367 
368  if ( mkinit_type == i_ignore ) then
369  log_newline
370  log_progress(*) 'skip making initial data'
371  output = .false.
372  else
373  log_newline
374  log_progress(*) 'start making initial data'
375 
376  !--- Initialize variables
377  pres(:,:,:) = const_undef8
378  temp(:,:,:) = const_undef8
379  pott(:,:,:) = const_undef8
380  qsat(:,:,:) = const_undef8
381  velx(:,:,:) = const_undef8
382  vely(:,:,:) = const_undef8
383 
384  rndm(:,:,:) = const_undef8
385 
386  pres_sfc(:,:) = const_undef8
387  temp_sfc(:,:) = const_undef8
388  pott_sfc(:,:) = const_undef8
389  psat_sfc(:,:) = const_undef8
390  qsat_sfc(:,:) = const_undef8
391 
392  qv(:,:,:) = 0.0_rp
393  qc(:,:,:) = 0.0_rp
394  nc(:,:,:) = 0.0_rp
395  qv_sfc(:,:) = 0.0_rp
396  qc_sfc(:,:) = 0.0_rp
397 
398  ptrc(:,:,:) = const_undef8
399 
400 !OCL XFILL
401  qtrc(:,:,:,:) = 0.0_rp
402 !OCL XFILL
403  qhyd(:,:,:,:) = 0.0_rp
404 !OCL XFILL
405  qnum(:,:,:,:) = 0.0_rp
406 
407  call prof_rapstart('_MkInit_main',3)
408 
409  convert_qtrc = .true.
410 
411  select case(mkinit_type)
412  case(i_planestate)
413  call mkinit_planestate
414  case(i_tracerbubble)
415  call mkinit_tracerbubble
416  case(i_coldbubble)
417  call mkinit_coldbubble
418  case(i_lambwave)
419  call mkinit_lambwave
420  case(i_gravitywave)
421  call mkinit_gravitywave
422  case(i_khwave)
423  call mkinit_khwave
424  case(i_turbulence)
425  call mkinit_turbulence
426  case(i_mountainwave)
427  call mkinit_mountainwave
428  case(i_warmbubble)
429  call mkinit_warmbubble
430  case(i_supercell)
431  call mkinit_supercell
432  case(i_squallline)
433  call mkinit_squallline
434  case(i_wk1982)
435  call mkinit_wk1982
436  case(i_dycoms2_rf01)
437  call mkinit_dycoms2_rf01
438  case(i_dycoms2_rf02)
439  call mkinit_dycoms2_rf02
440  case(i_rico)
441  call mkinit_rico
442  case(i_bomex)
443  call mkinit_bomex
444  case(i_oceancouple)
445  call mkinit_planestate
446  call mkinit_oceancouple
447  case(i_landcouple)
448  call mkinit_planestate
449  call mkinit_landcouple
450  case(i_urbancouple)
451  call mkinit_planestate
452  call mkinit_urbancouple
453  case(i_triplecouple)
454  call mkinit_planestate
455  call mkinit_oceancouple
456  call mkinit_landcouple
457  call mkinit_urbancouple
458  case(i_bubblecouple)
459  call mkinit_planestate
460  call mkinit_warmbubble
461  call mkinit_oceancouple
462  call mkinit_landcouple
463  call mkinit_urbancouple
464  case(i_seabreeze)
465  call mkinit_planestate
466  call mkinit_seabreeze
467  case(i_heatisland)
468  call mkinit_planestate
469  call mkinit_heatisland
470  case(i_dycoms2_rf02_dns)
471  call mkinit_dycoms2_rf02_dns
472  case(i_real)
473  call mkinit_real
474  convert_qtrc = .false.
475  case(i_grayzone)
476  call mkinit_grayzone
477  case(i_boxaero)
478  call mkinit_boxaero
479  case(i_warmbubbleaero)
480  call mkinit_warmbubbleaero
481  case(i_cavityflow)
482  call mkinit_cavityflow
483  case(i_barocwave)
484  call mkinit_barocwave
485  case default
486  log_error("MKINIT",*) 'Unsupported TYPE:', mkinit_type
487  call prc_abort
488  endselect
489 
490  call tke_setup
491 
492  call aerosol_setup
493 
494  call sbmaero_setup( convert_qtrc ) ! [INOUT]
495 
496  ! water content
497  if ( ( .not. atmos_hydrometeor_dry ) .AND. convert_qtrc ) then
498 !OCL XFILL
499  qhyd(:,:,:,i_hc) = qc(:,:,:)
500 !OCL XFILL
501  qnum(:,:,:,i_hc) = nc(:,:,:)
502  call atmos_phy_mp_driver_qhyd2qtrc( ka, ks, ke, ia, is, ie, ja, js, je, &
503  qv(:,:,:), qhyd(:,:,:,:), & ! [IN]
504  qtrc(:,:,:,qs_mp:qe_mp), & ! [OUT]
505  qnum=qnum(:,:,:,:) ) ! [IN]
506  end if
507 
508  ! passive tracer
509  call tracer_inq_id( "PTracer", iq)
510  if ( iq > 0 ) qtrc(:,:,:,iq) = ptrc(:,:,:)
511 
512  call prof_rapend ('_MkInit_main',3)
513 
514  log_progress(*) 'end making initial data'
515 
516  output = .true.
517 
518  endif
519 
520  return
521  end subroutine mkinit
522 
523  !-----------------------------------------------------------------------------
525  subroutine bubble_setup
526  use scale_const, only: &
528  implicit none
529 
530  ! Bubble
531  logical :: bbl_eachnode = .false. ! Arrange bubble at each node? [kg/kg]
532  real(rp) :: bbl_cz = 2.e3_rp ! center location [m]: z
533  real(rp) :: bbl_cx = 2.e3_rp ! center location [m]: x
534  real(rp) :: bbl_cy = 2.e3_rp ! center location [m]: y
535  real(rp) :: bbl_rz = 0.0_rp ! bubble radius [m]: z
536  real(rp) :: bbl_rx = 0.0_rp ! bubble radius [m]: x
537  real(rp) :: bbl_ry = 0.0_rp ! bubble radius [m]: y
538  character(len=H_SHORT) :: bbl_functype = 'COSBELL' ! COSBELL or GAUSSIAN
539 
540  namelist / param_bubble / &
541  bbl_eachnode, &
542  bbl_cz, &
543  bbl_cx, &
544  bbl_cy, &
545  bbl_rz, &
546  bbl_rx, &
547  bbl_ry, &
548  bbl_functype
549 
550  real(rp) :: cz_offset
551  real(rp) :: cx_offset
552  real(rp) :: cy_offset
553  real(rp) :: distx, disty, distz
554 
555  real(rp) :: domain_rx, domain_ry
556 
557  integer :: ierr
558  integer :: k, i, j
559  !---------------------------------------------------------------------------
560 
561  log_newline
562  log_info("BUBBLE_setup",*) 'Setup'
563 
564  !--- read namelist
565  rewind(io_fid_conf)
566  read(io_fid_conf,nml=param_bubble,iostat=ierr)
567  if( ierr < 0 ) then !--- missing
568  log_info("BUBBLE_setup",*) 'Not found namelist. Default used.'
569  elseif( ierr > 0 ) then !--- fatal error
570  log_error("BUBBLE_setup",*) 'Not appropriate names in namelist PARAM_BUBBLE. Check!'
571  call prc_abort
572  endif
573  log_nml(param_bubble)
574 
575  if ( abs(bbl_rz*bbl_rx*bbl_ry) <= 0.0_rp ) then
576  log_info("BUBBLE_setup",*) 'no bubble'
577  bubble(:,:,:) = 0.0_rp
578  else
579 
580  bubble(:,:,:) = const_undef8
581 
582  if ( bbl_eachnode ) then
583  cz_offset = cz(ks)
584  cx_offset = cx(is)
585  cy_offset = cy(js)
586  domain_rx = fx(ie) - fx(is-1)
587  domain_ry = fy(je) - fy(js-1)
588  else
589  cz_offset = 0.0_rp
590  cx_offset = 0.0_rp
591  cy_offset = 0.0_rp
592  domain_rx = fxg(iag-ihalo) - fxg(ihalo)
593  domain_ry = fyg(jag-jhalo) - fyg(jhalo)
594  endif
595 
596  ! make bubble coefficient
597  do j = 1, ja
598  do i = 1, ia
599  do k = ks, ke
600 
601  distz = ( (cz(k)-cz_offset-bbl_cz)/bbl_rz )**2
602 
603  distx = min( ( (cx(i)-cx_offset-bbl_cx )/bbl_rx )**2, &
604  ( (cx(i)-cx_offset-bbl_cx-domain_rx)/bbl_rx )**2, &
605  ( (cx(i)-cx_offset-bbl_cx+domain_rx)/bbl_rx )**2 )
606 
607  disty = min( ( (cy(j)-cy_offset-bbl_cy )/bbl_ry )**2, &
608  ( (cy(j)-cy_offset-bbl_cy-domain_ry)/bbl_ry )**2, &
609  ( (cy(j)-cy_offset-bbl_cy+domain_ry)/bbl_ry )**2 )
610 
611  select case(bbl_functype)
612  case('COSBELL')
613  bubble(k,i,j) = cos( 0.5_rp*pi*sqrt( min(distz+distx+disty,1.0_rp) ) )**2
614  case('GAUSSIAN')
615  bubble(k,i,j) = exp( -(distz+distx+disty) )
616  case default
617  log_error("BUBBLE_setup",*) 'Not appropriate BBL_functype. Check!', trim(bbl_functype)
618  call prc_abort
619  end select
620  enddo
621  enddo
622  enddo
623  endif
624 
625  return
626  end subroutine bubble_setup
627 
628  !-----------------------------------------------------------------------------
630  subroutine rect_setup
631  use scale_const, only: &
633  implicit none
634 
635  ! Bubble
636  logical :: RCT_eachnode = .false. ! Arrange rectangle at each node? [kg/kg]
637  real(RP) :: RCT_CZ = 2.e3_rp ! center location [m]: z
638  real(RP) :: RCT_CX = 2.e3_rp ! center location [m]: x
639  real(RP) :: RCT_CY = 2.e3_rp ! center location [m]: y
640  real(RP) :: RCT_RZ = 2.e3_rp ! rectangle z width [m]: z
641  real(RP) :: RCT_RX = 2.e3_rp ! rectangle x width [m]: x
642  real(RP) :: RCT_RY = 2.e3_rp ! rectangle y width [m]: y
643 
644  namelist / param_rect / &
645  rct_eachnode, &
646  rct_cz, &
647  rct_cx, &
648  rct_cy, &
649  rct_rz, &
650  rct_rx, &
651  rct_ry
652 
653  real(RP) :: CZ_offset
654  real(RP) :: CX_offset
655  real(RP) :: CY_offset
656  real(RP) :: dist
657 
658  integer :: ierr
659  integer :: k, i, j
660  !---------------------------------------------------------------------------
661 
662  log_newline
663  log_info("RECT_setup",*) 'Setup'
664 
665  !--- read namelist
666  rewind(io_fid_conf)
667  read(io_fid_conf,nml=param_rect,iostat=ierr)
668  if( ierr < 0 ) then !--- missing
669  log_error("RECT_setup",*) 'Not found namelist. Check!'
670  call prc_abort
671  elseif( ierr > 0 ) then !--- fatal error
672  log_error("RECT_setup",*) 'Not appropriate names in namelist PARAM_RECT. Check!'
673  call prc_abort
674  endif
675  log_nml(param_rect)
676 
677  rect(:,:,:) = const_undef8
678 
679  if ( rct_eachnode ) then
680  cz_offset = cz(ks)
681  cx_offset = cx(is)
682  cy_offset = cy(js)
683  else
684  cz_offset = 0.0_rp
685  cx_offset = 0.0_rp
686  cy_offset = 0.0_rp
687  endif
688 
689  do j = 1, ja
690  do i = 1, ia
691  do k = ks, ke
692 
693  ! make tracer rectangle
694  dist = 2.0_rp * max( &
695  abs(cz(k) - cz_offset - rct_cz)/rct_rz, &
696  abs(cx(i) - cx_offset - rct_cx)/rct_rx, &
697  abs(cy(j) - cy_offset - rct_cy)/rct_ry &
698  & )
699  if ( dist <= 1.0_rp ) then
700  rect(k,i,j) = 1.0_rp
701  else
702  rect(k,i,j) = 0.0_rp
703  end if
704  enddo
705  enddo
706  enddo
707 
708  return
709  end subroutine rect_setup
710 
711  !-----------------------------------------------------------------------------
713  subroutine aerosol_setup
714  use mod_atmos_admin, only: &
716  use scale_atmos_phy_ae_kajino13, only: &
718  use scale_atmos_phy_ae_offline, only: &
720  use mod_atmos_phy_ae_vars, only: &
721  qa_ae, &
722  qs_ae, &
723  qe_ae
724  implicit none
725 
726  real(RP), parameter :: d_min_def = 1.e-9_rp ! default lower bound of 1st size bin
727  real(RP), parameter :: d_max_def = 1.e-5_rp ! upper bound of last size bin
728  integer, parameter :: n_kap_def = 1 ! number of kappa bins
729  real(RP), parameter :: k_min_def = 0.e0_rp ! lower bound of 1st kappa bin
730  real(RP), parameter :: k_max_def = 1.e0_rp ! upper bound of last kappa bin
731 
732  real(RP) :: ccn_init = 50.e+6_rp ! initial cloud condensation nucrei [#/m3]
733 
734  real(RP) :: m0_init = 0.0_rp ! initial total num. conc. of modes (Atk,Acm,Cor) [#/m3]
735  real(RP) :: dg_init = 80.e-9_rp ! initial number equivalen diameters of modes [m]
736  real(RP) :: sg_init = 1.6_rp ! initial standard deviation [-]
737 
738  real(RP) :: d_min_inp(3) = d_min_def
739  real(RP) :: d_max_inp(3) = d_max_def
740  real(RP) :: k_min_inp(3) = k_min_def
741  real(RP) :: k_max_inp(3) = k_max_def
742  integer :: n_kap_inp(3) = n_kap_def
743 
744  namelist / param_aero / &
745  ccn_init, &
746  m0_init, &
747  dg_init, &
748  sg_init, &
749  d_min_inp, &
750  d_max_inp, &
751  k_min_inp, &
752  k_max_inp, &
753  n_kap_inp
754 
755  integer :: ierr
756  !---------------------------------------------------------------------------
757 
758  if ( atmos_phy_ae_type /= 'OFF' .AND. atmos_phy_ae_type /= 'NONE' ) then
759 
760  log_newline
761  log_info("AEROSOL_setup",*) 'Setup'
762 
763  !--- read namelist
764  rewind(io_fid_conf)
765  read(io_fid_conf,nml=param_aero,iostat=ierr)
766  if( ierr < 0 ) then !--- missing
767  log_info("AEROSOL_setup",*) 'Not found namelist. Default used!'
768  elseif( ierr > 0 ) then !--- fatal error
769  log_error("AEROSOL_setup",*) 'Not appropriate names in namelist PARAM_AERO. Check!'
770  call prc_abort
771  endif
772  log_nml(param_aero)
773 
774  select case ( atmos_phy_ae_type )
775  case ( 'KAJINO13' )
776  qdry(:,:,:) = 1.0_rp - qv(:,:,:) - qc(:,:,:)
777  call atmos_phy_ae_kajino13_mkinit( ka, ks, ke, ia, is, ie, ja, js, je, & ! (in)
778  qa_ae, & ! (in)
779  dens(:,:,:), & ! (in)
780  temp(:,:,:), & ! (in)
781  pres(:,:,:), & ! (in)
782  qdry(:,:,:), & ! (in)
783  qv(:,:,:), & ! (in)
784  m0_init, & ! (in)
785  dg_init, & ! (in)
786  sg_init, & ! (in)
787  d_min_inp(:), & ! (in)
788  d_max_inp(:), & ! (in)
789  k_min_inp(:), & ! (in)
790  k_max_inp(:), & ! (in)
791  n_kap_inp(:), & ! (in)
792  qtrc(:,:,:,qs_ae:qe_ae), & ! (out)
793  ccn(:,:,:) ) ! (out)
794  case ( 'OFFLINE' )
795  call atmos_phy_ae_offline_mkinit ( ka, ks, ke, ia, is, ie, ja, js, je, & ! (in)
796  ccn_init, & ! (in)
797  ccn(:,:,:) ) ! (out)
798  case default
799  ccn(:,:,:) = ccn_init
800  end select
801 
802  endif
803 
804  return
805  end subroutine aerosol_setup
806 
807  !-----------------------------------------------------------------------------
809  subroutine sbmaero_setup( convert_qtrc )
810  use scale_atmos_hydrometeor, only: &
811  i_qv, &
812  qhs, &
813  qhe
814  use mod_atmos_admin, only: &
816  use scale_atmos_phy_mp_suzuki10, only: &
817  nccn, nbin
818  implicit none
819 
820  logical, intent(inout) :: convert_qtrc
821 
822  real(RP), allocatable :: xabnd(:), xactr(:)
823 
824  integer :: iq, i, j, k
825  !---------------------------------------------------------------------------
826 
827  if ( atmos_phy_mp_type /= 'SUZUKI10' ) return
828 
829  !--- Super saturated air at initial
830  do j = jsb, jeb
831  do i = isb, ieb
832  do k = ks, ke
833  qtrc(k,i,j,i_qv) = qv(k,i,j) + qc(k,i,j)
834  end do
835  end do
836  end do
837 
838  !-- Aerosol distribution
839  if ( nccn /= 0 ) then
840  do iq = 1, nccn
841  do j = jsb, jeb
842  do i = isb, ieb
843  do k = ks, ke
844  qtrc(k,i,j,qhe+iq) = gan(iq) / dens(k,i,j) ! [note] gan is never set.
845  enddo
846  enddo
847  enddo
848  enddo
849 
850  deallocate( xactr )
851  deallocate( xabnd )
852  endif
853 
854  convert_qtrc = .false.
855 
856  return
857  end subroutine sbmaero_setup
858 
859  !-----------------------------------------------------------------------------
860  function faero( f0,r0,x,alpha,rhoa )
861  use scale_const, only: &
862  pi => const_pi
863  implicit none
864 
865  real(rp), intent(in) :: x, f0, r0, alpha, rhoa
866  real(rp) :: faero
867  real(rp) :: rad
868  !---------------------------------------------------------------------------
869 
870  rad = ( exp(x) * 3.0_rp / 4.0_rp / pi / rhoa )**(1.0_rp/3.0_rp)
871 
872  faero = f0 * (rad/r0)**(-alpha)
873 
874  return
875  end function faero
876 
877  !-----------------------------------------------------------------------------
879  subroutine flux_setup
881  sflx_rain => atmos_phy_mp_sflx_rain, &
882  sflx_snow => atmos_phy_mp_sflx_snow
883  use mod_atmos_phy_rd_vars, only: &
884  sflx_lw_up => atmos_phy_rd_sflx_lw_up, &
885  sflx_lw_dn => atmos_phy_rd_sflx_lw_dn, &
886  sflx_sw_up => atmos_phy_rd_sflx_sw_up, &
887  sflx_sw_dn => atmos_phy_rd_sflx_sw_dn
888  implicit none
889 
890  ! Flux from Atmosphere
891  real(RP) :: FLX_rain = 0.0_rp ! surface rain flux [kg/m2/s]
892  real(RP) :: FLX_snow = 0.0_rp ! surface snow flux [kg/m2/s]
893  real(RP) :: FLX_IR_dn = 0.0_rp ! surface downwad radiation flux [J/m2/s]
894  real(RP) :: FLX_NIR_dn = 0.0_rp ! surface downwad radiation flux [J/m2/s]
895  real(RP) :: FLX_VIS_dn = 0.0_rp ! surface downwad radiation flux [J/m2/s]
896 
897  namelist / param_mkinit_flux / &
898  flx_rain, &
899  flx_snow, &
900  flx_ir_dn, &
901  flx_nir_dn, &
902  flx_vis_dn
903 
904  integer :: i, j
905  integer :: ierr
906  !---------------------------------------------------------------------------
907 
908  !--- read namelist
909  rewind(io_fid_conf)
910  read(io_fid_conf,nml=param_mkinit_flux,iostat=ierr)
911  if( ierr < 0 ) then !--- missing
912  log_info("flux_setup",*) 'Not found namelist. Default used.'
913  elseif( ierr > 0 ) then !--- fatal error
914  log_error("flux_setup",*) 'Not appropriate names in namelist PARAM_MKINIT_FLUX. Check!'
915  call prc_abort
916  endif
917  log_nml(param_mkinit_flux)
918 
919  do j = jsb, jeb
920  do i = isb, ieb
921  sflx_rain(i,j) = flx_rain
922  sflx_snow(i,j) = flx_snow
923 
924  sflx_lw_up(i,j) = 0.0_rp
925  sflx_lw_dn(i,j) = flx_ir_dn
926  sflx_sw_up(i,j) = 0.0_rp
927  sflx_sw_dn(i,j) = flx_nir_dn + flx_vis_dn
928  enddo
929  enddo
930 
931  return
932  end subroutine flux_setup
933 
934  !-----------------------------------------------------------------------------
936  subroutine land_setup
937  use mod_land_vars, only: &
938  land_temp, &
939  land_water, &
940  land_ice, &
941  land_sfc_temp, &
942  land_sfc_albedo, &
943  snow_flag, &
944  snow_sfc_temp, &
945  snow_swe, &
946  snow_depth, &
947  snow_dzero, &
949  implicit none
950 
951  real(RP) :: LND_TEMP ! land soil temperature [K]
952  real(RP) :: LND_WATER = 0.15_rp ! land soil moisture [m3/m3]
953  real(RP) :: LND_ICE = 0.00_rp ! land soil ice [m3/m3]
954  real(RP) :: SFC_TEMP ! land skin temperature [K]
955  real(RP) :: SFC_albedo_LW = 0.01_rp ! land surface albedo for LW (0-1)
956  real(RP) :: SFC_albedo_SW = 0.20_rp ! land surface albedo for SW (0-1)
957 
958  namelist / param_mkinit_land / &
959  lnd_temp, &
960  lnd_water, &
961  lnd_ice, &
962  sfc_temp, &
963  sfc_albedo_lw, &
964  sfc_albedo_sw
965 
966  integer :: ierr
967  !---------------------------------------------------------------------------
968 
969  lnd_temp = thetastd
970  sfc_temp = thetastd
971 
972  !--- read namelist
973  rewind(io_fid_conf)
974  read(io_fid_conf,nml=param_mkinit_land,iostat=ierr)
975  if( ierr < 0 ) then !--- missing
976  log_info("land_setup",*) 'Not found namelist. Default used.'
977  elseif( ierr > 0 ) then !--- fatal error
978  log_error("land_setup",*) 'Not appropriate names in namelist PARAM_MKINIT_LAND. Check!'
979  call prc_abort
980  endif
981  log_nml(param_mkinit_land)
982 
983  land_temp(:,:,:) = lnd_temp
984  land_water(:,:,:) = lnd_water
985  land_ice(:,:,:) = lnd_ice
986 
987  land_sfc_temp(:,:) = sfc_temp
988  land_sfc_albedo(:,:,:,i_r_ir) = sfc_albedo_lw
989  land_sfc_albedo(:,:,:,i_r_nir) = sfc_albedo_sw
990  land_sfc_albedo(:,:,:,i_r_vis) = sfc_albedo_sw
991 
992  if ( snow_flag ) then
993  !!!!! Tentative for snow model !!!!!
994  snow_sfc_temp(:,:) = 273.15_rp
995  snow_swe(:,:) = 0.0_rp
996  snow_depth(:,:) = 0.0_rp
997  snow_dzero(:,:) = 0.0_rp
998  snow_nosnowsec(:,:) = 0.0_rp
999  end if
1000 
1001  return
1002  end subroutine land_setup
1003 
1004  !-----------------------------------------------------------------------------
1006  subroutine ocean_setup
1007  use mod_ocean_vars, only: &
1008  ice_flag, &
1009  ocean_temp, &
1010  ocean_salt, &
1011  ocean_uvel, &
1012  ocean_vvel, &
1013  ocean_ocn_z0m, &
1014  ocean_ice_temp, &
1015  ocean_ice_mass, &
1016  ocean_sfc_temp, &
1017  ocean_sfc_albedo, &
1018  ocean_sfc_z0m, &
1019  ocean_sfc_z0h, &
1021  implicit none
1022 
1023  real(RP) :: OCN_TEMP ! ocean temperature [K]
1024  real(RP) :: OCN_SALT = 0.0_rp ! ocean salinity [psu]
1025  real(RP) :: OCN_UVEL = 0.0_rp ! ocean u-velocity [m/s]
1026  real(RP) :: OCN_VVEL = 0.0_rp ! ocean v-velocity [m/s]
1027  real(RP) :: ICE_TEMP ! ocean temperature [K]
1028  real(RP) :: ICE_MASS = 0.0_rp ! ocean temperature [K]
1029  real(RP) :: SFC_TEMP ! ocean skin temperature [K]
1030  real(RP) :: SFC_albedo_LW = 0.04_rp ! ocean surface albedo for LW (0-1)
1031  real(RP) :: SFC_albedo_SW = 0.05_rp ! ocean surface albedo for SW (0-1)
1032  real(RP) :: SFC_Z0M = 1.e-4_rp ! ocean surface roughness length (momentum) [m]
1033  real(RP) :: SFC_Z0H = 1.e-4_rp ! ocean surface roughness length (heat) [m]
1034  real(RP) :: SFC_Z0E = 1.e-4_rp ! ocean surface roughness length (vapor) [m]
1035 
1036  namelist / param_mkinit_ocean / &
1037  ocn_temp, &
1038  ocn_salt, &
1039  ocn_uvel, &
1040  ocn_vvel, &
1041  ice_temp, &
1042  ice_mass, &
1043  sfc_temp, &
1044  sfc_albedo_lw, &
1045  sfc_albedo_sw, &
1046  sfc_z0m, &
1047  sfc_z0h, &
1048  sfc_z0e
1049 
1050  integer :: ierr
1051  !---------------------------------------------------------------------------
1052 
1053  ocn_temp = thetastd
1054  ice_temp = 271.35_rp ! freezing point of the ocean
1055  sfc_temp = thetastd
1056 
1057  !--- read namelist
1058  rewind(io_fid_conf)
1059  read(io_fid_conf,nml=param_mkinit_ocean,iostat=ierr)
1060  if( ierr < 0 ) then !--- missing
1061  log_info("ocean_setup",*) 'Not found namelist. Default used.'
1062  elseif( ierr > 0 ) then !--- fatal error
1063  log_error("ocean_setup",*) 'Not appropriate names in namelist PARAM_MKINIT_OCEAN. Check!'
1064  call prc_abort
1065  endif
1066  log_nml(param_mkinit_ocean)
1067 
1068  ocean_temp(:,:,:) = ocn_temp
1069  ocean_salt(:,:,:) = ocn_salt
1070  ocean_uvel(:,:,:) = ocn_uvel
1071  ocean_vvel(:,:,:) = ocn_vvel
1072  ocean_ocn_z0m(:,:) = sfc_z0m
1073  ocean_sfc_temp(:,:) = sfc_temp
1074  ocean_sfc_albedo(:,:,:,i_r_ir) = sfc_albedo_lw
1075  ocean_sfc_albedo(:,:,:,i_r_nir) = sfc_albedo_sw
1076  ocean_sfc_albedo(:,:,:,i_r_vis) = sfc_albedo_sw
1077  ocean_sfc_z0m(:,:) = sfc_z0m
1078  ocean_sfc_z0h(:,:) = sfc_z0h
1079  ocean_sfc_z0e(:,:) = sfc_z0e
1080 
1081  if ( ice_flag ) then
1082  ocean_ice_temp(:,:) = ice_temp
1083  ocean_ice_mass(:,:) = ice_mass
1084  end if
1085 
1086  return
1087  end subroutine ocean_setup
1088 
1089  !-----------------------------------------------------------------------------
1091  subroutine urban_setup
1092  use mod_urban_vars, only: &
1093  urban_tr, &
1094  urban_tb, &
1095  urban_tg, &
1096  urban_tc, &
1097  urban_qc, &
1098  urban_uc, &
1099  urban_trl, &
1100  urban_tbl, &
1101  urban_tgl, &
1102  urban_rainr, &
1103  urban_rainb, &
1104  urban_raing, &
1105  urban_roff, &
1106  urban_sfc_temp, &
1108  implicit none
1109 
1110  real(RP) :: URB_ROOF_TEMP ! Surface temperature of roof [K]
1111  real(RP) :: URB_BLDG_TEMP ! Surface temperature of building [K]
1112  real(RP) :: URB_GRND_TEMP ! Surface temperature of ground [K]
1113  real(RP) :: URB_CNPY_TEMP ! Diagnostic canopy air temperature [K]
1114  real(RP) :: URB_CNPY_HMDT = 0.0_rp ! Diagnostic canopy humidity [kg/kg]
1115  real(RP) :: URB_CNPY_WIND = 0.0_rp ! Diagnostic canopy wind [m/s]
1116  real(RP) :: URB_ROOF_LAYER_TEMP ! temperature in layer of roof [K]
1117  real(RP) :: URB_BLDG_LAYER_TEMP ! temperature in layer of building [K]
1118  real(RP) :: URB_GRND_LAYER_TEMP ! temperature in layer of ground [K]
1119  real(RP) :: URB_ROOF_RAIN = 0.0_rp ! temperature in layer of roof [kg/m2]
1120  real(RP) :: URB_BLDG_RAIN = 0.0_rp ! temperature in layer of building [kg/m2]
1121  real(RP) :: URB_GRND_RAIN = 0.0_rp ! temperature in layer of ground [kg/m2]
1122  real(RP) :: URB_SFC_TEMP ! Grid average of surface temperature [K]
1123  real(RP) :: URB_ALB_LW = 0.10_rp ! Grid average of surface albedo for LW (0-1)
1124  real(RP) :: URB_ALB_SW = 0.20_rp ! Grid average of surface albedo for SW (0-1)
1125 
1126  namelist / param_mkinit_urban / &
1127  urb_roof_temp, &
1128  urb_bldg_temp, &
1129  urb_grnd_temp, &
1130  urb_cnpy_temp, &
1131  urb_cnpy_hmdt, &
1132  urb_cnpy_wind, &
1133  urb_roof_layer_temp, &
1134  urb_bldg_layer_temp, &
1135  urb_grnd_layer_temp, &
1136  urb_roof_rain, &
1137  urb_bldg_rain, &
1138  urb_grnd_rain, &
1139  urb_sfc_temp, &
1140  urb_alb_lw, &
1141  urb_alb_sw
1142 
1143  integer :: ierr
1144  !---------------------------------------------------------------------------
1145 
1146  urb_roof_temp = thetastd
1147  urb_bldg_temp = thetastd
1148  urb_grnd_temp = thetastd
1149  urb_cnpy_temp = thetastd
1150  urb_roof_layer_temp = thetastd
1151  urb_bldg_layer_temp = thetastd
1152  urb_grnd_layer_temp = thetastd
1153  urb_sfc_temp = thetastd
1154 
1155  !--- read namelist
1156  rewind(io_fid_conf)
1157  read(io_fid_conf,nml=param_mkinit_urban,iostat=ierr)
1158  if( ierr < 0 ) then !--- missing
1159  log_info("urban_setup",*) 'Not found namelist. Default used.'
1160  elseif( ierr > 0 ) then !--- fatal error
1161  log_error("urban_setup",*) 'Not appropriate names in namelist PARAM_MKINIT_URBAN. Check!'
1162  call prc_abort
1163  endif
1164  log_nml(param_mkinit_urban)
1165 
1166  urban_trl(:,:,:) = urb_roof_layer_temp
1167  urban_tbl(:,:,:) = urb_bldg_layer_temp
1168  urban_tgl(:,:,:) = urb_grnd_layer_temp
1169 
1170  urban_tr(:,:) = urb_roof_temp
1171  urban_tb(:,:) = urb_bldg_temp
1172  urban_tg(:,:) = urb_grnd_temp
1173  urban_tc(:,:) = urb_cnpy_temp
1174  urban_qc(:,:) = urb_cnpy_hmdt
1175  urban_uc(:,:) = urb_cnpy_wind
1176  urban_rainr(:,:) = urb_roof_rain
1177  urban_rainb(:,:) = urb_bldg_rain
1178  urban_raing(:,:) = urb_grnd_rain
1179  urban_sfc_temp(:,:) = urb_sfc_temp
1180  urban_sfc_albedo(:,:,:,i_r_ir) = urb_alb_lw
1181  urban_sfc_albedo(:,:,:,i_r_nir) = urb_alb_sw
1182  urban_sfc_albedo(:,:,:,i_r_vis) = urb_alb_sw
1183 
1184  return
1185  end subroutine urban_setup
1186 
1187  !-----------------------------------------------------------------------------
1189  subroutine tke_setup
1190  use scale_const, only: &
1191  eps => const_eps
1192  use mod_atmos_phy_tb_vars, only: &
1193  i_tke
1194  use mod_atmos_phy_bl_vars, only: &
1195  qs_bl => qs, &
1196  qe_bl => qe, &
1197  zi => atmos_phy_bl_zi
1198  implicit none
1199 
1200  real(RP) :: TKE_CONST
1201  real(RP) :: Zi_CONST
1202 
1203  namelist / param_mkinit_tke / &
1204  tke_const, &
1205  zi_const
1206 
1207  integer :: k, i, j
1208  integer :: ierr
1209  !---------------------------------------------------------------------------
1210 
1211  tke_const = eps
1212  zi_const = 100.0_rp
1213 
1214  !--- read namelist
1215  rewind(io_fid_conf)
1216  read(io_fid_conf,nml=param_mkinit_tke,iostat=ierr)
1217  if( ierr < 0 ) then !--- missing
1218  log_info("tke_setup",*) 'Not found namelist. Default used.'
1219  elseif( ierr > 0 ) then !--- fatal error
1220  log_error("tke_setup",*) 'Not appropriate names in namelist PARAM_MKINIT_TKE. Check!'
1221  call prc_abort
1222  endif
1223  log_nml(param_mkinit_tke)
1224 
1225  if ( i_tke > 0 ) then
1226  do j = 1, ja
1227  do i = 1, ia
1228  do k = 1, ka
1229  qtrc(k,i,j,i_tke) = tke_const
1230  enddo
1231  enddo
1232  enddo
1233  end if
1234  if ( qs_bl > 0 ) then
1235  do j = 1, ja
1236  do i = 1, ia
1237  do k = 1, ka
1238  qtrc(k,i,j,qs_bl) = tke_const
1239  qtrc(k,i,j,qs_bl+1:qe_bl) = 0.0_rp
1240  enddo
1241  enddo
1242  enddo
1243  end if
1244 
1245  do j = 1, ja
1246  do i = 1, ia
1247  zi(i,j) = zi_const
1248  end do
1249  end do
1250 
1251  return
1252  end subroutine tke_setup
1253 
1254  !-----------------------------------------------------------------------------
1256  subroutine read_sounding( &
1257  DENS, VELX, VELY, POTT, QV )
1260  implicit none
1261 
1262  real(RP), intent(out) :: DENS(KA)
1263  real(RP), intent(out) :: VELX(KA)
1264  real(RP), intent(out) :: VELY(KA)
1265  real(RP), intent(out) :: POTT(KA)
1266  real(RP), intent(out) :: QV (KA)
1267 
1268  real(RP) :: TEMP(KA)
1269  real(RP) :: PRES(KA)
1270  real(RP) :: QC (KA)
1271 
1272  character(len=H_LONG) :: ENV_IN_SOUNDING_file = ''
1273 
1274  integer, parameter :: EXP_klim = 100
1275  integer :: EXP_kmax
1276 
1277  real(RP) :: SFC_THETA ! surface potential temperature [K]
1278  real(RP) :: SFC_PRES ! surface pressure [hPa]
1279  real(RP) :: SFC_QV ! surface watervapor [g/kg]
1280 
1281  real(RP) :: EXP_z (EXP_klim+1) ! height [m]
1282  real(RP) :: EXP_pott(EXP_klim+1) ! potential temperature [K]
1283  real(RP) :: EXP_qv (EXP_klim+1) ! water vapor [g/kg]
1284  real(RP) :: EXP_u (EXP_klim+1) ! velocity u [m/s]
1285  real(RP) :: EXP_v (EXP_klim+1) ! velocity v [m/s]
1286 
1287  real(RP) :: fact1, fact2
1288  integer :: k, kref
1289  integer :: fid
1290  integer :: ierr
1291 
1292  namelist / param_mkinit_sounding / &
1293  env_in_sounding_file
1294 
1295  !--- read namelist
1296  rewind(io_fid_conf)
1297  read(io_fid_conf,nml=param_mkinit_sounding,iostat=ierr)
1298 
1299  if( ierr < 0 ) then !--- missing
1300  log_info("read_sounding",*) 'Not found namelist. Default used.'
1301  elseif( ierr > 0 ) then !--- fatal error
1302  log_error("read_sounding",*) 'Not appropriate names in namelist PARAM_MKINIT_SOUNDING. Check!'
1303  call prc_abort
1304  endif
1305  log_nml(param_mkinit_sounding)
1306 
1307  !--- prepare sounding profile
1308  log_info("read_sounding",*) 'Input sounding file:', trim(env_in_sounding_file)
1309  fid = io_get_available_fid()
1310  open( fid, &
1311  file = trim(env_in_sounding_file), &
1312  form = 'formatted', &
1313  status = 'old', &
1314  iostat = ierr )
1315 
1316  if ( ierr /= 0 ) then
1317  log_error("read_sounding",*) '[mod_mkinit/read_sounding] Input file not found!'
1318  endif
1319 
1320  !--- read sounding file till end
1321  read(fid,*) sfc_pres, sfc_theta, sfc_qv
1322 
1323  log_info("read_sounding",*) '+ Surface pressure [hPa]', sfc_pres
1324  log_info("read_sounding",*) '+ Surface pot. temp [K]', sfc_theta
1325  log_info("read_sounding",*) '+ Surface water vapor [g/kg]', sfc_qv
1326 
1327  do k = 2, exp_klim
1328  read(fid,*,iostat=ierr) exp_z(k), exp_pott(k), exp_qv(k), exp_u(k), exp_v(k)
1329  if ( ierr /= 0 ) exit
1330  enddo
1331 
1332  exp_kmax = k - 1
1333  close(fid)
1334 
1335  ! Boundary
1336  exp_z(1) = 0.0_rp
1337  exp_pott(1) = sfc_theta
1338  exp_qv(1) = sfc_qv
1339  exp_u(1) = exp_u(2)
1340  exp_v(1) = exp_v(2)
1341  exp_z(exp_kmax+1) = 100.e3_rp
1342  exp_pott(exp_kmax+1) = exp_pott(exp_kmax)
1343  exp_qv(exp_kmax+1) = exp_qv(exp_kmax)
1344  exp_u(exp_kmax+1) = exp_u(exp_kmax)
1345  exp_v(exp_kmax+1) = exp_v(exp_kmax)
1346 
1347  do k = 1, exp_kmax+1
1348  exp_qv(k) = exp_qv(k) * 1.e-3_rp ! [g/kg]->[kg/kg]
1349  enddo
1350 
1351  ! calc in dry condition
1352  pres_sfc(:,:) = sfc_pres * 1.e2_rp ! [hPa]->[Pa]
1353  pott_sfc(:,:) = sfc_theta
1354  if ( .not. atmos_hydrometeor_dry ) then
1355  qv_sfc(:,:) = sfc_qv * 1.e-3_rp ! [g/kg]->[kg/kg]
1356  end if
1357 
1358  !--- linear interpolate to model grid
1359  do k = ks, ke
1360  do kref = 2, exp_kmax+1
1361  if ( cz(k) > exp_z(kref-1) &
1362  .AND. cz(k) <= exp_z(kref ) ) then
1363 
1364  fact1 = ( exp_z(kref) - cz(k) ) / ( exp_z(kref)-exp_z(kref-1) )
1365  fact2 = ( cz(k) - exp_z(kref-1) ) / ( exp_z(kref)-exp_z(kref-1) )
1366 
1367  pott(k) = exp_pott(kref-1) * fact1 &
1368  + exp_pott(kref ) * fact2
1369  qv(k) = exp_qv(kref-1) * fact1 &
1370  + exp_qv(kref ) * fact2
1371  velx(k) = exp_u(kref-1) * fact1 &
1372  + exp_u(kref ) * fact2
1373  vely(k) = exp_v(kref-1) * fact1 &
1374  + exp_v(kref ) * fact2
1375  endif
1376  enddo
1377  enddo
1378  if ( atmos_hydrometeor_dry ) qv(:) = 0.0_rp
1379 
1380  qc(:) = 0.0_rp
1381 
1382  ! make density & pressure profile in moist condition
1383  call hydrostatic_buildrho( ka, ks, ke, &
1384  pott(:), qv(:), qc(:), & ! [IN]
1385  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
1386  cz(:), fz(:), & ! [IN]
1387  dens(:), temp(:), pres(:), temp_sfc(1,1) ) ! [OUT]
1388 
1389  return
1390  end subroutine read_sounding
1391 
1392  !-----------------------------------------------------------------------------
1394  subroutine mkinit_planestate
1395  use scale_atmos_hydrometeor, only: &
1397  implicit none
1398 
1399  ! Surface state
1400  real(RP) :: SFC_THETA ! surface potential temperature [K]
1401  real(RP) :: SFC_PRES ! surface pressure [Pa]
1402  real(RP) :: SFC_RH = 0.0_rp ! surface relative humidity [%]
1403  ! Environment state
1404  real(RP) :: ENV_THETA ! potential temperature of environment [K]
1405  real(RP) :: ENV_TLAPS = 0.0_rp ! Lapse rate of THETA [K/m]
1406  real(RP) :: ENV_U = 0.0_rp ! velocity u of environment [m/s]
1407  real(RP) :: ENV_V = 0.0_rp ! velocity v of environment [m/s]
1408  real(RP) :: ENV_RH = 0.0_rp ! relative humidity of environment [%]
1409  ! Disturbance
1410  real(RP) :: RANDOM_THETA = 0.0_rp ! amplitude of random disturbance theta
1411  real(RP) :: RANDOM_U = 0.0_rp ! amplitude of random disturbance u
1412  real(RP) :: RANDOM_V = 0.0_rp ! amplitude of random disturbance v
1413  real(RP) :: RANDOM_RH = 0.0_rp ! amplitude of random disturbance RH
1414 
1415  namelist / param_mkinit_planestate / &
1416  sfc_theta, &
1417  sfc_pres, &
1418  sfc_rh, &
1419  env_theta, &
1420  env_tlaps, &
1421  env_u, &
1422  env_v, &
1423  env_rh, &
1424  random_theta, &
1425  random_u, &
1426  random_v, &
1427  random_rh
1428 
1429  integer :: ierr
1430  integer :: k, i, j
1431  !---------------------------------------------------------------------------
1432 
1433  log_newline
1434  log_info("MKINIT_planestate",*) 'Setup initial state'
1435 
1436  sfc_theta = thetastd
1437  sfc_pres = pstd
1438  env_theta = thetastd
1439 
1440  !--- read namelist
1441  rewind(io_fid_conf)
1442  read(io_fid_conf,nml=param_mkinit_planestate,iostat=ierr)
1443 
1444  if( ierr < 0 ) then !--- missing
1445  log_info("MKINIT_planestate",*) 'Not found namelist. Default used.'
1446  elseif( ierr > 0 ) then !--- fatal error
1447  log_error_cont(*) 'Not appropriate names in namelist PARAM_MKINIT_PLANESTATE. Check!'
1448  call prc_abort
1449  endif
1450  log_nml(param_mkinit_planestate)
1451 
1452  ! calc in dry condition
1453  do j = jsb, jeb
1454  do i = isb, ieb
1455  pott_sfc(i,j) = sfc_theta
1456  pres_sfc(i,j) = sfc_pres
1457  enddo
1458  enddo
1459 
1460  if ( env_theta < 0.0_rp ) then ! use isa profile
1461 
1462  call profile_isa( ka, ks, ke, & ! [IN]
1463  ia, isb, ieb, & ! [IN]
1464  ja, jsb, jeb, & ! [IN]
1465  pott_sfc(:,:), & ! [IN]
1466  pres_sfc(:,:), & ! [IN]
1467  real_cz(:,:,:), & ! [IN]
1468  pott(:,:,:) ) ! [OUT]
1469 
1470  else
1471 
1472  do j = jsb, jeb
1473  do i = isb, ieb
1474  do k = ks, ke
1475  pott(k,i,j) = env_theta + env_tlaps * real_cz(k,i,j)
1476  enddo
1477  enddo
1478  enddo
1479 
1480  endif
1481 
1482  ! make density & pressure profile in dry condition
1483  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
1484  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
1485  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
1486  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
1487  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
1488 
1489  if ( .not. atmos_hydrometeor_dry ) then
1490 
1491  ! Calculate QV from RH.
1492  ! Note that the RH consequently obtained by following calculations is not precisely identical with the RH set by namelist,
1493  ! because the iteration is not performed in the calculation of qv and density is re-built after including moisture.
1494 
1495  call saturation_psat_all( ia, isb, ieb, ja, jsb, jeb, &
1496  temp_sfc(:,:), & ! [IN]
1497  psat_sfc(:,:) ) ! [OUT]
1498  qdry(:,:,:) = 1.0_rp - qv(:,:,:) - qc(:,:,:)
1499  call saturation_pres2qsat_all( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
1500  temp(:,:,:), pres(:,:,:), qdry(:,:,:), & ! [IN]
1501  qsat(:,:,:) ) ! [OUT]
1502 
1503  call random_uniform(rndm) ! make random
1504  do j = jsb, jeb
1505  do i = isb, ieb
1506  qsat_sfc(i,j) = epsvap * psat_sfc(i,j) / ( pres_sfc(i,j) - ( 1.0_rp-epsvap ) * psat_sfc(i,j) )
1507  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)
1508 
1509  do k = ks, ke
1510  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 * qsat(k,i,j)
1511  enddo
1512  enddo
1513  enddo
1514  end if
1515 
1516  call random_uniform(rndm) ! make random
1517  do j = jsb, jeb
1518  do i = isb, ieb
1519  pott_sfc(i,j) = pott_sfc(i,j) + ( rndm(ks-1,i,j) * 2.0_rp - 1.0_rp ) * random_theta
1520 
1521  do k = ks, ke
1522  pott(k,i,j) = pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_theta
1523  enddo
1524  enddo
1525  enddo
1526 
1527  ! make density & pressure profile in moist condition
1528  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
1529  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
1530  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
1531  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
1532  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
1533 
1534  call comm_vars8( dens(:,:,:), 1 )
1535  call comm_wait ( dens(:,:,:), 1 )
1536 
1537  call random_uniform(rndm) ! make random
1538  do j = jsb, jeb
1539  do i = isb, min(ieb,ia-1)
1540  do k = ks, ke
1541  momx(k,i,j) = ( env_u + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_u ) &
1542  * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
1543  enddo
1544  enddo
1545  enddo
1546 
1547  call random_uniform(rndm) ! make random
1548  do j = jsb, min(jeb,ja-1)
1549  do i = isb, ieb
1550  do k = ks, ke
1551  momy(k,i,j) = ( env_v + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_v ) &
1552  * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
1553  enddo
1554  enddo
1555  enddo
1556 
1557  do j = jsb, jeb
1558  do i = isb, ieb
1559  do k = ks, ke
1560  momz(k,i,j) = 0.0_rp
1561  rhot(k,i,j) = pott(k,i,j) * dens(k,i,j)
1562  enddo
1563  enddo
1564  enddo
1565 
1566  call flux_setup
1567 
1568  return
1569  end subroutine mkinit_planestate
1570 
1571  !-----------------------------------------------------------------------------
1573  subroutine mkinit_tracerbubble
1574  implicit none
1575 
1576 #ifndef DRY
1577  ! Surface state
1578  real(RP) :: SFC_THETA ! surface potential temperature [K]
1579  real(RP) :: SFC_PRES ! surface pressure [Pa]
1580  ! Environment state
1581  real(RP) :: ENV_THETA ! potential temperature of environment [K]
1582  real(RP) :: ENV_U = 0.0_rp ! velocity u of environment [m/s]
1583  real(RP) :: ENV_V = 0.0_rp ! velocity v of environment [m/s]
1584  ! Bubble
1585  character(len=H_SHORT) :: SHAPE_PTracer = 'BUBBLE' ! BUBBLE or RECT
1586  real(RP) :: BBL_PTracer = 1.0_rp ! extremum of passive tracer in bubble [kg/kg]
1587 
1588  namelist / param_mkinit_tracerbubble / &
1589  sfc_theta, &
1590  sfc_pres, &
1591  env_theta, &
1592  env_u, &
1593  env_v, &
1594  shape_ptracer, &
1595  bbl_ptracer
1596 
1597  real(RP), pointer :: shapeFac(:,:,:) => null()
1598 
1599  integer :: k, i, j
1600  integer :: ierr
1601  !---------------------------------------------------------------------------
1602 
1603  log_newline
1604  log_info("MKINIT_tracerbubble",*) 'Setup initial state'
1605 
1606  sfc_theta = thetastd
1607  sfc_pres = pstd
1608  env_theta = thetastd
1609 
1610  !--- read namelist
1611  rewind(io_fid_conf)
1612  read(io_fid_conf,nml=param_mkinit_tracerbubble,iostat=ierr)
1613 
1614  if( ierr < 0 ) then !--- missing
1615  log_info("MKINIT_tracerbubble",*) 'Not found namelist. Default used.'
1616  elseif( ierr > 0 ) then !--- fatal error
1617  log_error("MKINIT_tracerbubble",*) 'Not appropriate names in namelist PARAM_MKINIT_TRACERBUBBLE. Check!'
1618  call prc_abort
1619  endif
1620  log_nml(param_mkinit_tracerbubble)
1621 
1622  ! calc in dry condition
1623  pres_sfc(1,1) = sfc_pres
1624  pott_sfc(1,1) = sfc_theta
1625 
1626  do k = ks, ke
1627  pott(k,1,1) = env_theta
1628  enddo
1629 
1630  ! make density & pressure profile in dry condition
1631  call hydrostatic_buildrho( ka, ks, ke, &
1632  pott(:,1,1), qv(:,1,1), qc(:,1,1), & ! [IN]
1633  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
1634  cz(:), fz(:), & ! [IN]
1635  dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1) ) ! [OUT]
1636 
1637  do j = jsb, jeb
1638  do i = isb, ieb
1639  do k = ks, ke
1640  dens(k,i,j) = dens(k,1,1)
1641  momz(k,i,j) = 0.0_rp
1642  momx(k,i,j) = env_u * dens(k,1,1)
1643  momy(k,i,j) = env_v * dens(k,1,1)
1644  rhot(k,i,j) = pott(k,1,1) * dens(k,1,1)
1645  enddo
1646  enddo
1647  enddo
1648 
1649  ! make tracer bubble
1650  select case(shape_ptracer)
1651  case('BUBBLE')
1652  call bubble_setup
1653  shapefac => bubble
1654  case('RECT')
1655  call rect_setup
1656  shapefac => rect
1657  case default
1658  log_error("MKINIT_tracerbubble",*) 'SHAPE_PTracer=', trim(shape_ptracer), ' cannot be used on advect. Check!'
1659  call prc_abort
1660  end select
1661 
1662  do j = jsb, jeb
1663  do i = isb, ieb
1664  do k = ks, ke
1665  ptrc(k,i,j) = bbl_ptracer * shapefac(k,i,j)
1666  enddo
1667  enddo
1668  enddo
1669 
1670 #endif
1671 
1672  return
1673  end subroutine mkinit_tracerbubble
1674 
1675  !-----------------------------------------------------------------------------
1685  subroutine mkinit_coldbubble
1686  implicit none
1687 
1688  ! Surface state
1689  real(RP) :: SFC_THETA ! surface potential temperature [K]
1690  real(RP) :: SFC_PRES ! surface pressure [Pa]
1691  ! Environment state
1692  real(RP) :: ENV_THETA ! potential temperature of environment [K]
1693  ! Bubble
1694  real(RP) :: BBL_TEMP = -15.0_rp ! extremum of temperature in bubble [K]
1695 
1696  namelist / param_mkinit_coldbubble / &
1697  sfc_theta, &
1698  sfc_pres, &
1699  env_theta, &
1700  bbl_temp
1701 
1702  real(RP) :: RovCP
1703 
1704  integer :: ierr
1705  integer :: k, i, j
1706  !---------------------------------------------------------------------------
1707 
1708  log_newline
1709  log_info("MKINIT_coldbubble",*) 'Setup initial state'
1710 
1711  sfc_theta = thetastd
1712  sfc_pres = pstd
1713  env_theta = thetastd
1714 
1715  !--- read namelist
1716  rewind(io_fid_conf)
1717  read(io_fid_conf,nml=param_mkinit_coldbubble,iostat=ierr)
1718 
1719  if( ierr < 0 ) then !--- missing
1720  log_info("MKINIT_coldbubble",*) 'Not found namelist. Default used.'
1721  elseif( ierr > 0 ) then !--- fatal error
1722  log_error("MKINIT_coldbubble",*) 'Not appropriate names in namelist PARAM_MKINIT_COLDBUBBLE. Check!'
1723  call prc_abort
1724  endif
1725  log_nml(param_mkinit_coldbubble)
1726 
1727  rovcp = rdry / cpdry
1728 
1729  ! calc in dry condition
1730  pres_sfc(1,1) = sfc_pres
1731  pott_sfc(1,1) = sfc_theta
1732 
1733  do k = ks, ke
1734  pott(k,1,1) = env_theta
1735  enddo
1736 
1737  ! make density & pressure profile in dry condition
1738  call hydrostatic_buildrho( ka, ks, ke, &
1739  pott(:,1,1), qv(:,1,1), qc(:,1,1), & ! [IN]
1740  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
1741  cz(:), fz(:), & ! [IN]
1742  dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1) ) ! [OUT]
1743 
1744  do j = 1, ja
1745  do i = 1, ia
1746  do k = ks, ke
1747  dens(k,i,j) = dens(k,1,1)
1748  momz(k,i,j) = 0.0_rp
1749  momx(k,i,j) = 0.0_rp
1750  momy(k,i,j) = 0.0_rp
1751 
1752  ! make cold bubble
1753  rhot(k,i,j) = dens(k,1,1) * ( pott(k,1,1) &
1754  + bbl_temp * ( p00/pres(k,1,1) )**rovcp * bubble(k,i,j) )
1755  enddo
1756  enddo
1757  enddo
1758 
1759  return
1760  end subroutine mkinit_coldbubble
1761 
1762  !-----------------------------------------------------------------------------
1764  subroutine mkinit_lambwave
1765  implicit none
1766 
1767  ! Surface state
1768  real(RP) :: SFC_PRES ! surface pressure [Pa]
1769  ! Environment state
1770  real(RP) :: ENV_U = 0.0_rp ! velocity u of environment [m/s]
1771  real(RP) :: ENV_V = 0.0_rp ! velocity v of environment [m/s]
1772  real(RP) :: ENV_TEMP = 300.0_rp ! temperature of environment [K]
1773  ! Bubble
1774  real(RP) :: BBL_PRES = 100._rp ! extremum of pressure in bubble [Pa]
1775 
1776  namelist / param_mkinit_lambwave / &
1777  sfc_pres, &
1778  env_u, &
1779  env_v, &
1780  env_temp, &
1781  bbl_pres
1782 
1783  real(RP) :: RovCP
1784 
1785  integer :: ierr
1786  integer :: k, i, j
1787  !---------------------------------------------------------------------------
1788 
1789  log_newline
1790  log_info("MKINIT_lambwave",*) 'Setup initial state'
1791 
1792  sfc_pres = pstd
1793 
1794  !--- read namelist
1795  rewind(io_fid_conf)
1796  read(io_fid_conf,nml=param_mkinit_lambwave,iostat=ierr)
1797 
1798  if( ierr < 0 ) then !--- missing
1799  log_info("MKINIT_lambwave",*) 'Not found namelist. Default used.'
1800  elseif( ierr > 0 ) then !--- fatal error
1801  log_error("MKINIT_lambwave",*) 'Not appropriate names in namelist PARAM_MKINIT_LAMBWAVE. Check!'
1802  call prc_abort
1803  endif
1804  log_nml(param_mkinit_lambwave)
1805 
1806  rovcp = rdry / cpdry
1807 
1808  do j = jsb, jeb
1809  do i = isb, ieb
1810  do k = ks, ke
1811  dens(k,i,j) = sfc_pres/(rdry*env_temp) * exp( - grav/(rdry*env_temp) * cz(k) )
1812  momz(k,i,j) = 0.0_rp
1813  momx(k,i,j) = env_u * dens(k,i,j)
1814  momy(k,i,j) = env_v * dens(k,i,j)
1815 
1816  ! make pressure bubble
1817  pres(k,i,j) = dens(k,i,j) * env_temp * rdry + bbl_pres * bubble(k,i,j)
1818 
1819  rhot(k,i,j) = dens(k,i,j) * env_temp * ( p00/pres(k,i,j) )**rovcp
1820  enddo
1821  enddo
1822  enddo
1823 
1824  return
1825  end subroutine mkinit_lambwave
1826 
1827  !-----------------------------------------------------------------------------
1830  subroutine mkinit_gravitywave
1831  implicit none
1832 
1833  ! Surface state
1834  real(RP) :: SFC_THETA ! surface potential temperature [K]
1835  real(RP) :: SFC_PRES ! surface pressure [Pa]
1836  ! Environment state
1837  real(RP) :: ENV_U = 20.0_rp ! velocity u of environment [m/s]
1838  real(RP) :: ENV_V = 0.0_rp ! velocity v of environment [m/s]
1839  real(RP) :: ENV_BVF = 0.01_rp ! Brunt Vaisala frequencies of environment [1/s]
1840  ! Bubble
1841  real(RP) :: BBL_THETA = 0.01_rp ! extremum of potential temperature in bubble [K]
1842 
1843  namelist / param_mkinit_gravitywave / &
1844  sfc_theta, &
1845  sfc_pres, &
1846  env_u, &
1847  env_v, &
1848  env_bvf, &
1849  bbl_theta
1850 
1851  integer :: ierr
1852  integer :: k, i, j
1853  !---------------------------------------------------------------------------
1854 
1855  log_newline
1856  log_info("MKINIT_gravitywave",*) 'Setup initial state'
1857 
1858  sfc_theta = thetastd
1859  sfc_pres = pstd
1860 
1861  !--- read namelist
1862  rewind(io_fid_conf)
1863  read(io_fid_conf,nml=param_mkinit_gravitywave,iostat=ierr)
1864 
1865  if( ierr < 0 ) then !--- missing
1866  log_info("MKINIT_gravitywave",*) 'Not found namelist. Default used.'
1867  elseif( ierr > 0 ) then !--- fatal error
1868  log_error("MKINIT_gravitywave",*) 'Not appropriate names in namelist PARAM_MKINIT_GRAVITYWAVE. Check!'
1869  call prc_abort
1870  endif
1871  log_nml(param_mkinit_gravitywave)
1872 
1873  ! calc in dry condition
1874  pres_sfc(1,1) = sfc_pres
1875  pott_sfc(1,1) = sfc_theta
1876 
1877  do k = ks, ke
1878  pott(k,1,1) = sfc_theta * exp( env_bvf*env_bvf / grav * cz(k) )
1879  enddo
1880 
1881  ! make density & pressure profile in dry condition
1882  call hydrostatic_buildrho( ka, ks, ke, &
1883  pott(:,1,1), qv(:,1,1), qc(:,1,1), & ! [IN]
1884  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
1885  cz(:), fz(:), & ! [IN]
1886  dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1) ) ! [OUT]
1887 
1888  do j = jsb, jeb
1889  do i = isb, ieb
1890  do k = ks, ke
1891  dens(k,i,j) = dens(k,1,1)
1892  momz(k,i,j) = 0.0_rp
1893  momx(k,i,j) = env_u * dens(k,1,1)
1894  momy(k,i,j) = env_v * dens(k,1,1)
1895 
1896  ! make warm bubble
1897  rhot(k,i,j) = dens(k,1,1) * ( pott(k,1,1) + bbl_theta * bubble(k,i,j) )
1898 
1899  enddo
1900  enddo
1901  enddo
1902 
1903  return
1904  end subroutine mkinit_gravitywave
1905 
1906  !-----------------------------------------------------------------------------
1908  subroutine mkinit_khwave
1909  implicit none
1910 
1911  ! Surface state
1912  real(RP) :: SFC_THETA ! surface potential temperature [K]
1913  real(RP) :: SFC_PRES ! surface pressure [Pa]
1914  ! Environment state
1915  real(RP) :: ENV_L1_ZTOP = 1900.0_rp ! top height of the layer1 (low THETA) [m]
1916  real(RP) :: ENV_L3_ZBOTTOM = 2100.0_rp ! bottom height of the layer3 (high THETA) [m]
1917  real(RP) :: ENV_L1_THETA = 300.0_rp ! THETA in the layer1 (low THETA) [K]
1918  real(RP) :: ENV_L3_THETA = 301.0_rp ! THETA in the layer3 (high THETA) [K]
1919  real(RP) :: ENV_L1_U = 0.0_rp ! velocity u in the layer1 (low THETA) [K]
1920  real(RP) :: ENV_L3_U = 20.0_rp ! velocity u in the layer3 (high THETA) [K]
1921  ! Disturbance
1922  real(RP) :: RANDOM_U = 0.0_rp ! amplitude of random disturbance u
1923 
1924  namelist / param_mkinit_khwave / &
1925  sfc_theta, &
1926  sfc_pres, &
1927  env_l1_ztop, &
1928  env_l3_zbottom, &
1929  env_l1_theta, &
1930  env_l3_theta, &
1931  env_l1_u, &
1932  env_l3_u, &
1933  random_u
1934 
1935  real(RP) :: fact
1936 
1937  integer :: ierr
1938  integer :: k, i, j
1939  !---------------------------------------------------------------------------
1940 
1941  log_newline
1942  log_info("MKINIT_khwave",*) 'Setup initial state'
1943 
1944  sfc_theta = thetastd
1945  sfc_pres = pstd
1946 
1947  !--- read namelist
1948  rewind(io_fid_conf)
1949  read(io_fid_conf,nml=param_mkinit_khwave,iostat=ierr)
1950 
1951  if( ierr < 0 ) then !--- missing
1952  log_info("MKINIT_khwave",*) 'Not found namelist. Default used.'
1953  elseif( ierr > 0 ) then !--- fatal error
1954  log_error("MKINIT_khwave",*) 'Not appropriate names in namelist PARAM_MKINIT_KHWAVE. Check!'
1955  call prc_abort
1956  endif
1957  log_nml(param_mkinit_khwave)
1958 
1959  ! calc in dry condition
1960  pres_sfc(1,1) = sfc_pres
1961  pott_sfc(1,1) = sfc_theta
1962 
1963  do k = ks, ke
1964  fact = ( cz(k)-env_l1_ztop ) / ( env_l3_zbottom-env_l1_ztop )
1965  fact = max( min( fact, 1.0_rp ), 0.0_rp )
1966 
1967  pott(k,1,1) = env_l1_theta * ( 1.0_rp - fact ) &
1968  + env_l3_theta * ( fact )
1969  enddo
1970 
1971  ! make density & pressure profile in dry condition
1972  call hydrostatic_buildrho( ka, ks, ke, &
1973  pott(:,1,1), qv(:,1,1), qc(:,1,1), & ! [IN]
1974  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
1975  cz(:), fz(:), & ! [IN]
1976  dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1) ) ! [OUT]
1977 
1978  do j = jsb, jeb
1979  do i = isb, ieb
1980  do k = ks, ke
1981  dens(k,i,j) = dens(k,1,1)
1982  momz(k,i,j) = 0.0_rp
1983  momy(k,i,j) = 0.0_rp
1984  rhot(k,i,j) = dens(k,1,1) * pott(k,1,1)
1985  enddo
1986  enddo
1987  enddo
1988 
1989  call random_uniform(rndm) ! make random
1990  do j = jsb, jeb
1991  do i = isb, ieb
1992  do k = ks, ke
1993  fact = ( cz(k)-env_l1_ztop ) / ( env_l3_zbottom-env_l1_ztop )
1994  fact = max( min( fact, 1.0_rp ), 0.0_rp )
1995 
1996  momx(k,i,j) = ( env_l1_u * ( 1.0_rp - fact ) &
1997  + env_l3_u * ( fact ) &
1998  + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_u &
1999  ) * dens(k,i,j)
2000  enddo
2001  enddo
2002  enddo
2003 
2004  return
2005  end subroutine mkinit_khwave
2006 
2007  !-----------------------------------------------------------------------------
2009  subroutine mkinit_turbulence
2010  use scale_atmos_hydrometeor, only: &
2012  implicit none
2013 
2014  ! Surface state
2015  real(RP) :: SFC_THETA ! surface potential temperature [K]
2016  real(RP) :: SFC_PRES ! surface pressure [Pa]
2017  real(RP) :: SFC_RH = 0.0_rp ! surface relative humidity [%]
2018  ! Environment state
2019  real(RP) :: ENV_THETA ! potential temperature of environment [K]
2020  real(RP) :: ENV_TLAPS = 4.e-3_rp ! Lapse rate of THETA [K/m]
2021  real(RP) :: ENV_U = 5.0_rp ! velocity u of environment [m/s]
2022  real(RP) :: ENV_V = 0.0_rp ! velocity v of environment [m/s]
2023  real(RP) :: ENV_RH = 0.0_rp ! relative humidity of environment [%]
2024  ! Disturbance
2025  real(RP) :: RANDOM_THETA = 1.0_rp ! amplitude of random disturbance theta
2026  real(RP) :: RANDOM_U = 0.0_rp ! amplitude of random disturbance u
2027  real(RP) :: RANDOM_V = 0.0_rp ! amplitude of random disturbance v
2028  real(RP) :: RANDOM_RH = 0.0_rp ! amplitude of random disturbance RH
2029 
2030  namelist / param_mkinit_turbulence / &
2031  sfc_theta, &
2032  sfc_pres, &
2033  sfc_rh, &
2034  env_theta, &
2035  env_tlaps, &
2036  env_u, &
2037  env_v, &
2038  env_rh, &
2039  random_theta, &
2040  random_u, &
2041  random_v, &
2042  random_rh
2043 
2044  integer :: ierr
2045  integer :: k, i, j
2046  !---------------------------------------------------------------------------
2047 
2048  log_newline
2049  log_info("MKINIT_turbulence",*) 'Setup initial state'
2050 
2051  sfc_theta = thetastd
2052  sfc_pres = pstd
2053  env_theta = thetastd
2054 
2055  !--- read namelist
2056  rewind(io_fid_conf)
2057  read(io_fid_conf,nml=param_mkinit_turbulence,iostat=ierr)
2058 
2059  if( ierr < 0 ) then !--- missing
2060  log_info("MKINIT_turbulence",*) 'Not found namelist. Default used.'
2061  elseif( ierr > 0 ) then !--- fatal error
2062  log_error("MKINIT_turbulence",*) 'Not appropriate names in namelist PARAM_MKINIT_TURBULENCE. Check!'
2063  call prc_abort
2064  endif
2065  log_nml(param_mkinit_turbulence)
2066 
2067  ! calc in dry condition
2068  pres_sfc(1,1) = sfc_pres
2069  pott_sfc(1,1) = sfc_theta
2070 
2071  do k = ks, ke
2072  pott(k,1,1) = env_theta + env_tlaps * cz(k)
2073  enddo
2074 
2075  ! make density & pressure profile in dry condition
2076  call hydrostatic_buildrho( ka, ks, ke, &
2077  pott(:,1,1), qv(:,1,1), qc(:,1,1), & ! [IN]
2078  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
2079  cz(:), fz(:), & ! [IN]
2080  dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1) ) ! [OUT]
2081 
2082  if ( .not. atmos_hydrometeor_dry ) then
2083  ! calc QV from RH
2084  call saturation_psat_all( temp_sfc(1,1), & ! [IN]
2085  psat_sfc(1,1) ) ! [OUT]
2086  qdry(:,1,1) = 1.0_rp - qv(:,1,1) - qc(:,1,1)
2087  call saturation_pres2qsat_all( ka, ks, ke, &
2088  temp(:,1,1), pres(:,1,1), qdry(:,1,1), & ! [IN]
2089  qsat(:,1,1) ) ! [OUT]
2090 
2091  call random_uniform(rndm) ! make random
2092  do j = jsb, jeb
2093  do i = isb, ieb
2094  qsat_sfc(1,1) = epsvap * psat_sfc(i,j) / ( pres_sfc(i,j) - ( 1.0_rp-epsvap ) * psat_sfc(i,j) )
2095  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)
2096 
2097  do k = ks, ke
2098  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 * qsat(k,1,1)
2099  enddo
2100  enddo
2101  enddo
2102  end if
2103 
2104  call random_uniform(rndm) ! make random
2105  do j = jsb, jeb
2106  do i = isb, ieb
2107  pres_sfc(i,j) = sfc_pres
2108  pott_sfc(i,j) = sfc_theta + ( rndm(ks-1,i,j) * 2.0_rp - 1.0_rp ) * random_theta
2109 
2110  do k = ks, ke
2111  pott(k,i,j) = env_theta + env_tlaps * cz(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_theta
2112  enddo
2113  enddo
2114  enddo
2115 
2116  ! make density & pressure profile in moist condition
2117  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
2118  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
2119  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
2120  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
2121  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
2122 
2123  call comm_vars8( dens(:,:,:), 1 )
2124  call comm_wait ( dens(:,:,:), 1 )
2125 
2126  call random_uniform(rndm) ! make random
2127  do j = jsb, jeb
2128  do i = isb, ieb
2129  do k = ks, ke
2130  momx(k,i,j) = ( env_u + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_u ) &
2131  * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
2132  enddo
2133  enddo
2134  enddo
2135 
2136  call random_uniform(rndm) ! make random
2137  do j = jsb, jeb
2138  do i = isb, ieb
2139  do k = ks, ke
2140  momy(k,i,j) = ( env_v + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_v ) &
2141  * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
2142  enddo
2143  enddo
2144  enddo
2145 
2146  do j = jsb, jeb
2147  do i = isb, ieb
2148  do k = ks, ke
2149  momz(k,i,j) = 0.0_rp
2150  rhot(k,i,j) = pott(k,i,j) * dens(k,i,j)
2151  enddo
2152  enddo
2153  enddo
2154 
2155  return
2156  end subroutine mkinit_turbulence
2157 
2158  !-----------------------------------------------------------------------------
2160  subroutine mkinit_cavityflow
2161  implicit none
2162 
2163  ! Nondimenstional numbers for a cavity flow problem
2164  real(RP) :: REYNOLDS_NUM = 1.d03
2165  real(RP) :: MACH_NUM = 3.d-2
2166  real(RP) :: Ulid = 1.d01
2167  real(RP) :: PRES0 = 1.d05
2168 
2169  namelist / param_mkinit_cavityflow / &
2170  ulid , &
2171  pres0 , &
2172  reynolds_num, &
2173  mach_num
2174 
2175  real(RP) :: DENS0
2176  real(RP) :: TEMP
2177  real(RP) :: Gam
2178  real(RP) :: Cs2
2179 
2180  integer :: k, i, j
2181  integer :: ierr
2182  !---------------------------------------------------------------------------
2183 
2184  log_newline
2185  log_info("MKINIT_cavityflow",*) 'Setup initial state'
2186 
2187  !--- read namelist
2188  rewind(io_fid_conf)
2189  read(io_fid_conf,nml=param_mkinit_cavityflow,iostat=ierr)
2190 
2191  if( ierr < 0 ) then !--- missing
2192  log_info("MKINIT_cavityflow",*) 'Not found namelist. Default used.'
2193  elseif( ierr > 0 ) then !--- fatal error
2194  log_error("MKINIT_cavityflow",*) 'Not appropriate names in namelist PARAM_MKINIT_CAVITYFLOW. Check!'
2195  call prc_abort
2196  endif
2197  log_nml(param_mkinit_cavityflow)
2198 
2199  gam = cpdry / ( cpdry - rdry )
2200  cs2 = ( ulid / mach_num )**2
2201  temp = cs2 / ( gam * rdry )
2202  dens0 = pres0 / ( rdry * temp )
2203 
2204  log_info("MKINIT_cavityflow",*) "DENS = ", dens0
2205  log_info("MKINIT_cavityflow",*) "PRES = ", pres0
2206  log_info("MKINIT_cavityflow",*) "TEMP = ", rhot(10,10,4)/dens0, temp
2207  log_info("MKINIT_cavityflow",*) "Ulid = ", ulid
2208  log_info("MKINIT_cavityflow",*) "Cs = ", sqrt(cs2)
2209 
2210  do j = 1, ja
2211  do i = 1, ia
2212  do k = ks, ke
2213  dens(k,i,j) = dens0
2214  momz(k,i,j) = 0.0_rp
2215  momx(k,i,j) = 0.0_rp
2216  momy(k,i,j) = 0.0_rp
2217  pres(k,i,j) = pres0
2218  rhot(k,i,j) = p00/rdry * (p00/pres0)**((rdry - cpdry)/cpdry)
2219  enddo
2220  enddo
2221  enddo
2222 
2223  momx(ke+1:ka,:,:) = dens0 * ulid
2224 
2225  return
2226  end subroutine mkinit_cavityflow
2227 
2228  !-----------------------------------------------------------------------------
2230  subroutine mkinit_mountainwave
2231  implicit none
2232 
2233  ! Surface state
2234  real(RP) :: SFC_THETA ! surface potential temperature [K]
2235  real(RP) :: SFC_PRES ! surface pressure [Pa]
2236  ! Environment state
2237  real(RP) :: ENV_U = 0.0_rp ! velocity u of environment [m/s]
2238  real(RP) :: ENV_V = 0.0_rp ! velocity v of environment [m/s]
2239 
2240  real(RP) :: SCORER = 2.e-3_rp ! Scorer parameter (~=N/U) [1/m]
2241  real(RP) :: BBL_PTracer = 0.0_rp ! extremum of passive tracer in bubble [kg/kg]
2242 
2243  namelist / param_mkinit_mountainwave / &
2244  sfc_theta, &
2245  sfc_pres, &
2246  env_u, &
2247  env_v, &
2248  scorer, &
2249  bbl_ptracer
2250 
2251  real(RP) :: Ustar2, N2
2252 
2253  integer :: ierr
2254  integer :: k, i, j
2255  !---------------------------------------------------------------------------
2256 
2257  log_newline
2258  log_info("MKINIT_mountainwave",*) 'Setup initial state'
2259 
2260  sfc_theta = thetastd
2261  sfc_pres = pstd
2262 
2263  !--- read namelist
2264  rewind(io_fid_conf)
2265  read(io_fid_conf,nml=param_mkinit_mountainwave,iostat=ierr)
2266 
2267  if( ierr < 0 ) then !--- missing
2268  log_info("MKINIT_mountainwave",*) 'Not found namelist. Default used.'
2269  elseif( ierr > 0 ) then !--- fatal error
2270  log_error("MKINIT_mountainwave",*) 'Not appropriate names in namelist PARAM_MKINIT_MOUNTAINWAVE. Check!'
2271  call prc_abort
2272  endif
2273  log_nml(param_mkinit_mountainwave)
2274 
2275  ! calc in dry condition
2276  do j = jsb, jeb
2277  do i = isb, ieb
2278  pres_sfc(i,j) = sfc_pres
2279  pott_sfc(i,j) = sfc_theta
2280  enddo
2281  enddo
2282 
2283  do j = jsb, jeb
2284  do i = isb, ieb
2285  do k = ks, ke
2286  ustar2 = env_u * env_u + env_v * env_v
2287  n2 = ustar2 * (scorer*scorer)
2288 
2289  pott(k,i,j) = sfc_theta * exp( n2 / grav * real_cz(k,i,j) )
2290  enddo
2291  enddo
2292  enddo
2293 
2294  ! make density & pressure profile in dry condition
2295  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
2296  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
2297  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
2298  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
2299  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
2300 
2301  do j = jsb, jeb
2302  do i = isb, ieb
2303  do k = ks, ke
2304  dens(k,i,j) = dens(k,i,j)
2305  momz(k,i,j) = 0.0_rp
2306  momx(k,i,j) = env_u * dens(k,i,j)
2307  momy(k,i,j) = env_v * dens(k,i,j)
2308  rhot(k,i,j) = pott(k,i,j) * dens(k,i,j)
2309  enddo
2310  enddo
2311  enddo
2312 
2313  ! optional : add tracer bubble
2314  if ( bbl_ptracer > 0.0_rp ) then
2315  do j = jsb, jeb
2316  do i = isb, ieb
2317  do k = ks, ke
2318  ptrc(k,i,j) = bbl_ptracer * bubble(k,i,j)
2319  enddo
2320  enddo
2321  enddo
2322  endif
2323 
2324  return
2325  end subroutine mkinit_mountainwave
2326 
2327  !-----------------------------------------------------------------------------
2332  subroutine mkinit_barocwave
2333  use scale_const, only: &
2334  ohm => const_ohm, &
2335  rplanet => const_radius, &
2336  grav => const_grav
2337  use scale_prc
2338  use scale_atmos_grid_cartesc, only: &
2340  fyg => atmos_grid_cartesc_fyg
2341  use scale_atmos_hydrometeor, only: &
2343 
2344  implicit none
2345 
2346  ! Parameters for global domain size
2347  real(RP) :: Ly ! The domain size in y-direction [m]
2348 
2349  ! Parameters for inital stratification
2350  real(RP) :: REF_TEMP = 288.e0_rp ! The reference temperature [K]
2351  real(RP) :: REF_PRES = 1.e5_rp ! The reference pressure [Pa]
2352  real(RP) :: LAPSE_RATE = 5.e-3_rp ! The lapse rate [K/m]
2353 
2354  ! Parameters associated with coriolis parameter on a beta-plane
2355  real(RP) :: Phi0Deg = 45.e0_rp ! The central latitude [degree_north]
2356 
2357  ! Parameters for background zonal jet
2358  real(RP) :: U0 = 35.e0_rp ! The parameter associated with zonal jet maximum amplitude [m/s]
2359  real(RP) :: b = 2.e0_rp ! The vertical half-width [1]
2360 
2361  ! Parameters for inital perturbation of zonal wind with a Gaussian profile
2362  !
2363  real(RP) :: Up = 1.e0_rp ! The maximum amplitude of zonal wind perturbation [m/s]
2364  real(RP) :: Lp = 600.e3_rp ! The width of Gaussian profile
2365  real(RP) :: Xc = 2000.e3_rp ! The center point (x) of inital perturbation
2366  real(RP) :: Yc = 2500.e3_rp ! The center point (y) of inital perturbation
2367 
2368  namelist / param_mkinit_barocwave / &
2369  ref_temp, ref_pres, lapse_rate, &
2370  phi0deg, &
2371  u0, b, &
2372  up, lp, xc, yc
2373 
2374  real(RP) :: f0, beta0
2375 
2376  real(RP) :: geopot(KA,IA,JA)
2377  real(RP) :: eta(KA,IA,JA)
2378  real(RP) :: temp(KA,IA,JA)
2379 
2380  real(RP) :: y
2381  real(RP) :: ln_eta
2382  real(RP) :: del_eta
2383  real(RP) :: yphase
2384  real(RP) :: temp_vfunc
2385  real(RP) :: geopot_hvari
2386 
2387  integer :: ierr
2388  integer :: k, i, j
2389 
2390  integer :: itr
2391 
2392  integer, parameter :: ITRMAX = 1000
2393  real(RP), parameter :: CONV_EPS = 1e-15_rp
2394  !---------------------------------------------------------------------------
2395 
2396  log_newline
2397  log_info("MKINIT_barocwave",*) 'Setup initial state'
2398 
2399  !--- read namelist
2400  rewind(io_fid_conf)
2401  read(io_fid_conf,nml=param_mkinit_barocwave,iostat=ierr)
2402 
2403  if( ierr < 0 ) then !--- missing
2404  log_info("MKINIT_barocwave",*) 'Not found namelist. Default used.'
2405  elseif( ierr > 0 ) then !--- fatal error
2406  log_error("MKINIT_barocwave",*) 'Not appropriate names in namelist PARAM_MKINIT_BAROCWAVE. Check!'
2407  call prc_abort
2408  endif
2409  log_nml(param_mkinit_barocwave)
2410 
2411  ly = fyg(jag-jhalo) - fyg(jhalo)
2412 
2413  ! Set coriolis parameters
2414  f0 = 2.0_rp*ohm*sin(phi0deg*pi/180.0_rp)
2415  beta0 = (2.0_rp*ohm/rplanet)*cos(phi0deg*pi/180.0_rp)
2416 
2417  ! Calculate eta(=p/p_s) level corresponding to z level of each (y,z) grid point
2418  ! using Newton's iteration method
2419 
2420  eta(:,:,:) = 1.0e-8_rp ! Set first guess of eta
2421 
2422  do j = jsb, jeb
2423  do i = isb, ieb ! Note that initial fields are zonaly symmetric
2424 
2425  y = cy(j)
2426  yphase = 2.0_rp*pi*y/ly
2427 
2428  ! Calc horizontal variation of geopotential height
2429  geopot_hvari = 0.5_rp*u0*( &
2430  (f0 - beta0*y0)*(y - 0.5_rp*ly*(1.0_rp + sin(yphase)/pi)) &
2431  + 0.5_rp*beta0*( y**2 - ly*y/pi*sin(yphase) - 0.5_rp*(ly/pi)**2*(cos(yphase) + 1.0_rp) &
2432  - ly**2/3.0_rp ) &
2433  )
2434 
2435  ! Set surface pressure and temperature
2436  pres_sfc(i,j) = ref_pres
2437  pott_sfc(i,j) = ref_temp - geopot_hvari/rdry
2438 
2439  do k = ks, ke
2440  del_eta = 1.0_rp
2441 
2442  !-- The loop for iteration
2443  itr = 0
2444  do while( abs(del_eta) > conv_eps )
2445  ln_eta = log(eta(k,i,j))
2446 
2447  temp_vfunc = eta(k,i,j)**(rdry*lapse_rate/grav)
2448  temp(k,i,j) = &
2449  ref_temp*temp_vfunc &
2450  + geopot_hvari/rdry*(2.0_rp*(ln_eta/b)**2 - 1.0_rp)*exp(-(ln_eta/b)**2)
2451  geopot(k,i,j) = &
2452  ref_temp*grav/lapse_rate*(1.0_rp - temp_vfunc) &
2453  + geopot_hvari*ln_eta*exp(-(ln_eta/b)**2)
2454 
2455  del_eta = - ( - grav*cz(k) + geopot(k,i,j) ) & ! <- F
2456  & *( - eta(k,i,j)/(rdry*temp(k,i,j)) ) ! <- (dF/deta)^-1
2457 
2458  eta(k,i,j) = eta(k,i,j) + del_eta
2459  itr = itr + 1
2460 
2461  if ( itr > itrmax ) then
2462  log_error("MKINIT_barocwave",*) "Fail the convergence of iteration. Check!"
2463  log_error_cont(*) "* (X,Y,Z)=", cx(i), cy(j), cz(k)
2464  log_error_cont(*) "itr=", itr, "del_eta=", del_eta, "eta=", eta(k,i,j), "temp=", temp(k,i,j)
2465  call prc_abort
2466  end if
2467  enddo !- End of loop for iteration ----------------------------
2468 
2469  pres(k,i,j) = eta(k,i,j)*ref_pres
2470  dens(k,i,j) = pres(k,i,j)/(rdry*temp(k,i,j))
2471  pott(k,i,j) = temp(k,i,j)*eta(k,i,j)**(-rdry/cpdry)
2472 
2473  enddo
2474 
2475  ! Make density & pressure profile in dry condition using the profile of
2476  ! potential temperature calculated above.
2477  call hydrostatic_buildrho( ka, ks, ke, &
2478  pott(:,i,j), qv(:,i,j), qc(:,i,j), & ! [IN]
2479  pres_sfc(i,j), pott_sfc(i,j), qv_sfc(i,j), qc_sfc(i,j), & ! [IN]
2480  real_cz(:,i,j), real_fz(:,i,j), & ! [IN]
2481  dens(:,i,j), temp(:,i,j), pres(:,i,j), temp_sfc(i,j) ) ! [OUT]
2482  enddo
2483  enddo
2484 
2485  !-----------------------------------------------------------------------------------
2486 
2487  do j = jsb, jeb
2488  do k = ks, ke
2489 
2490  eta(k,is,j) = pres(k,is,j)/ref_pres
2491  ln_eta = log(eta(k,is,j))
2492  yphase = 2.0_rp*pi*cy(j)/ly
2493 !!$ PRES(k,IS:IE,j) = eta(k,IS,j)*REF_PRES
2494 !!$ DENS(k,IS:IE,j) = PRES(k,IS,j)/(Rdry*temp(k,IS,j))
2495  dens(k,is:ie,j) = dens(k,is,j)
2496  pres(k,is:ie,j) = pres(k,is,j)
2497  momx(k,is-1:ie,j) = dens(k,is,j)*(-u0*sin(0.5_rp*yphase)**2*ln_eta*exp(-(ln_eta/b)**2))
2498  rhot(k,is:ie,j) = dens(k,is,j)*pott(k,is,j) !temp(k,IS,j)*eta(k,IS,j)**(-Rdry/CPdry)
2499  enddo
2500  enddo
2501  momy(:,:,:) = 0.0_rp
2502  momz(:,:,:) = 0.0_rp
2503 
2504  !---------------------------------------------------------------------------------------
2505 
2506  ! Add the inital perturbation for zonal velocity
2507  do j = jsb, jeb
2508  do i = max(isb-1,1), ieb
2509  momx(ks:ke,i,j) = momx(ks:ke,i,j) &
2510  + dens(ks:ke,i,j)* up*exp( - ((fx(i) - xc)**2 + (cy(j) - yc)**2)/lp**2 )
2511  enddo
2512  enddo
2513 
2514  return
2515  end subroutine mkinit_barocwave
2516 
2517  !-----------------------------------------------------------------------------
2519  subroutine mkinit_warmbubble
2520  use scale_atmos_hydrometeor, only: &
2522  implicit none
2523 
2524  ! Surface state
2525  real(RP) :: SFC_THETA ! surface potential temperature [K]
2526  real(RP) :: SFC_PRES ! surface pressure [Pa]
2527  real(RP) :: SFC_RH = 80.0_rp ! surface relative humidity [%]
2528  ! Environment state
2529  real(RP) :: ENV_U = 0.0_rp ! velocity u of environment [m/s]
2530  real(RP) :: ENV_V = 0.0_rp ! velocity v of environment [m/s]
2531  real(RP) :: ENV_RH = 80.0_rp ! Relative Humidity of environment [%]
2532  real(RP) :: ENV_L1_ZTOP = 1.e3_rp ! top height of the layer1 (constant THETA) [m]
2533  real(RP) :: ENV_L2_ZTOP = 14.e3_rp ! top height of the layer2 (small THETA gradient) [m]
2534  real(RP) :: ENV_L2_TLAPS = 4.e-3_rp ! Lapse rate of THETA in the layer2 (small THETA gradient) [K/m]
2535  real(RP) :: ENV_L3_TLAPS = 3.e-2_rp ! Lapse rate of THETA in the layer3 (large THETA gradient) [K/m]
2536  ! Bubble
2537  real(RP) :: BBL_THETA = 1.0_rp ! extremum of temperature in bubble [K]
2538 
2539  namelist / param_mkinit_warmbubble / &
2540  sfc_theta, &
2541  sfc_pres, &
2542  env_u, &
2543  env_v, &
2544  env_rh, &
2545  env_l1_ztop, &
2546  env_l2_ztop, &
2547  env_l2_tlaps, &
2548  env_l3_tlaps, &
2549  bbl_theta
2550 
2551  integer :: ierr
2552  integer :: k, i, j
2553  !---------------------------------------------------------------------------
2554 
2555  log_newline
2556  log_info("MKINIT_warmbubble",*) 'Setup initial state'
2557 
2558  if ( atmos_hydrometeor_dry ) then
2559  log_error("MKINIT_warmbubble",*) 'QV is not registered'
2560  call prc_abort
2561  end if
2562 
2563  sfc_theta = thetastd
2564  sfc_pres = pstd
2565 
2566  !--- read namelist
2567  rewind(io_fid_conf)
2568  read(io_fid_conf,nml=param_mkinit_warmbubble,iostat=ierr)
2569 
2570  if( ierr < 0 ) then !--- missing
2571  log_info("MKINIT_warmbubble",*) 'Not found namelist. Default used.'
2572  elseif( ierr > 0 ) then !--- fatal error
2573  log_error("MKINIT_warmbubble",*) 'Not appropriate names in namelist PARAM_MKINIT_WARMBUBBLE. Check!'
2574  call prc_abort
2575  endif
2576  log_nml(param_mkinit_warmbubble)
2577 
2578  ! calc in dry condition
2579  pres_sfc(1,1) = sfc_pres
2580  pott_sfc(1,1) = sfc_theta
2581 
2582  do k = ks, ke
2583  if ( cz(k) <= env_l1_ztop ) then ! Layer 1
2584  pott(k,1,1) = sfc_theta
2585  elseif( cz(k) < env_l2_ztop ) then ! Layer 2
2586  pott(k,1,1) = pott(k-1,1,1) + env_l2_tlaps * ( cz(k)-cz(k-1) )
2587  else ! Layer 3
2588  pott(k,1,1) = pott(k-1,1,1) + env_l3_tlaps * ( cz(k)-cz(k-1) )
2589  endif
2590  enddo
2591 
2592  ! make density & pressure profile in dry condition
2593  call hydrostatic_buildrho( ka, ks, ke, &
2594  pott(:,1,1), qv(:,1,1), qc(:,1,1), & ! [IN]
2595  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
2596  cz(:), fz(:), & ! [IN]
2597  dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1) ) ! [OUT]
2598 
2599  ! calc QV from RH
2600  call saturation_psat_all( temp_sfc(1,1), & ! [IN]
2601  psat_sfc(1,1) ) ! [OUT]
2602  qsat_sfc(1,1) = epsvap * psat_sfc(1,1) / ( pres_sfc(1,1) - ( 1.0_rp-epsvap ) * psat_sfc(1,1) )
2603  qv_sfc(1,1) = sfc_rh * 1.e-2_rp * qsat_sfc(1,1)
2604  qdry(:,1,1) = 1.0_rp - qv(:,1,1) - qc(:,1,1)
2605  call saturation_pres2qsat_all( ka, ks, ke, &
2606  temp(:,1,1), pres(:,1,1), qdry(:,1,1), & ! [IN]
2607  qsat(:,1,1) ) ! [OUT]
2608  do k = ks, ke
2609  if ( cz(k) <= env_l1_ztop ) then ! Layer 1
2610  qv(k,1,1) = env_rh * 1.e-2_rp * qsat(k,1,1)
2611  elseif( cz(k) <= env_l2_ztop ) then ! Layer 2
2612  qv(k,1,1) = env_rh * 1.e-2_rp * qsat(k,1,1)
2613  else ! Layer 3
2614  qv(k,1,1) = 0.0_rp
2615  endif
2616  enddo
2617 
2618  ! make density & pressure profile in moist condition
2619  call hydrostatic_buildrho( ka, ks, ke, &
2620  pott(:,1,1), qv(:,1,1), qc(:,1,1), & ! [IN]
2621  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
2622  cz(:), fz(:), & ! [IN]
2623  dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1) ) ! [OUT]
2624 
2625  do j = jsb, jeb
2626  do i = isb, ieb
2627  do k = ks, ke
2628  dens(k,i,j) = dens(k,1,1)
2629  momz(k,i,j) = 0.0_rp
2630  momx(k,i,j) = env_u * dens(k,i,j)
2631  momy(k,i,j) = env_v * dens(k,i,j)
2632 
2633  ! make warm bubble
2634  rhot(k,i,j) = dens(k,1,1) * ( pott(k,1,1) + bbl_theta * bubble(k,i,j) )
2635 
2636  qv(k,i,j) = qv(k,1,1)
2637  enddo
2638  enddo
2639  enddo
2640 
2641  call flux_setup
2642 
2643  return
2644  end subroutine mkinit_warmbubble
2645 
2646  !-----------------------------------------------------------------------------
2648  subroutine mkinit_supercell
2649  use scale_atmos_hydrometeor, only: &
2651  implicit none
2652 
2653  real(RP) :: RHO(KA)
2654  real(RP) :: VELX(KA)
2655  real(RP) :: VELY(KA)
2656  real(RP) :: POTT(KA)
2657  real(RP) :: QV1D(KA)
2658 
2659  ! Bubble
2660  real(RP) :: BBL_THETA = 3.d0 ! extremum of temperature in bubble [K]
2661 
2662  namelist / param_mkinit_supercell / &
2663  bbl_theta
2664 
2665  integer :: ierr
2666  integer :: k, i, j
2667  !---------------------------------------------------------------------------
2668 
2669  log_newline
2670  log_info("MKINIT_supercell",*) 'Setup initial state'
2671 
2672  if ( atmos_hydrometeor_dry ) then
2673  log_error("MKINIT_supercell",*) 'QV is not registered'
2674  call prc_abort
2675  end if
2676 
2677  !--- read namelist
2678  rewind(io_fid_conf)
2679  read(io_fid_conf,nml=param_mkinit_supercell,iostat=ierr)
2680 
2681  if( ierr < 0 ) then !--- missing
2682  log_info("MKINIT_supercell",*) 'Not found namelist. Default used.'
2683  elseif( ierr > 0 ) then !--- fatal error
2684  log_error("MKINIT_supercell",*) 'Not appropriate names in namelist PARAM_MKINIT_SUPERCELL. Check!'
2685  call prc_abort
2686  endif
2687  log_nml(param_mkinit_supercell)
2688 
2689  call read_sounding( rho, velx, vely, pott, qv1d ) ! (out)
2690 
2691  do j = jsb, jeb
2692  do i = isb, ieb
2693  do k = ks, ke
2694  dens(k,i,j) = rho(k)
2695  momz(k,i,j) = 0.0_rp
2696  momx(k,i,j) = rho(k) * velx(k)
2697  momy(k,i,j) = rho(k) * vely(k)
2698 
2699  ! make warm bubble
2700  rhot(k,i,j) = rho(k) * ( pott(k) + bbl_theta * bubble(k,i,j) )
2701 
2702  qv(k,i,j) = qv1d(k)
2703  enddo
2704  enddo
2705  enddo
2706 
2707  call flux_setup
2708 
2709  return
2710  end subroutine mkinit_supercell
2711 
2712  !-----------------------------------------------------------------------------
2714  subroutine mkinit_squallline
2715  use scale_atmos_hydrometeor, only: &
2717  implicit none
2718 
2719  real(RP) :: RHO(KA)
2720  real(RP) :: VELX(KA)
2721  real(RP) :: VELY(KA)
2722  real(RP) :: POTT(KA)
2723  real(RP) :: QV1D(KA)
2724 
2725  real(RP) :: RANDOM_THETA = 0.01_rp
2726  real(RP) :: OFFSET_velx = 12.0_rp
2727  real(RP) :: OFFSET_vely = -2.0_rp
2728 
2729  namelist / param_mkinit_squallline / &
2730  random_theta, &
2731  offset_velx, &
2732  offset_vely
2733 
2734  integer :: ierr
2735  integer :: k, i, j
2736  !---------------------------------------------------------------------------
2737 
2738  log_newline
2739  log_info("MKINIT_squallline",*) 'Setup initial state'
2740 
2741  if ( atmos_hydrometeor_dry ) then
2742  log_error("MKINIT_squallline",*) 'QV is not registered'
2743  call prc_abort
2744  end if
2745 
2746  !--- read namelist
2747  rewind(io_fid_conf)
2748  read(io_fid_conf,nml=param_mkinit_squallline,iostat=ierr)
2749 
2750  if( ierr < 0 ) then !--- missing
2751  log_info("MKINIT_squallline",*) 'Not found namelist. Default used.'
2752  elseif( ierr > 0 ) then !--- fatal error
2753  log_error("MKINIT_squallline",*) 'Not appropriate names in namelist PARAM_MKINIT_SQUALLLINE. Check!'
2754  call prc_abort
2755  endif
2756  log_nml(param_mkinit_squallline)
2757 
2758  call read_sounding( rho, velx, vely, pott, qv1d ) ! (out)
2759 
2760  call random_uniform(rndm) ! make random
2761  do j = jsb, jeb
2762  do i = isb, ieb
2763  do k = ks, ke
2764  dens(k,i,j) = rho(k)
2765  momz(k,i,j) = 0.0_rp
2766  momx(k,i,j) = ( velx(k) - offset_velx ) * rho(k)
2767  momy(k,i,j) = ( vely(k) - offset_vely ) * rho(k)
2768  rhot(k,i,j) = rho(k) * ( pott(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * random_theta )
2769  qv(k,i,j) = qv1d(k)
2770  enddo
2771  enddo
2772  enddo
2773 
2774  call flux_setup
2775 
2776  return
2777  end subroutine mkinit_squallline
2778 
2779  !-----------------------------------------------------------------------------
2781  subroutine mkinit_wk1982
2782  use scale_atmos_hydrometeor, only: &
2784  implicit none
2785 
2786  ! Surface state
2787  real(RP) :: SFC_THETA = 300.0_rp ! surface pot. temperature [K]
2788  real(RP) :: SFC_PRES ! surface pressure [Pa]
2789  ! Parameter in Weisman and Klemp (1982)
2790  real(RP) :: TR_Z = 12000.0_rp ! height of tropopause [m]
2791  real(RP) :: TR_THETA = 343.0_rp ! pot. temperature at tropopause [K]
2792  real(RP) :: TR_TEMP = 213.0_rp ! temperature at tropopause [K]
2793  real(RP) :: SHEAR_Z = 3000.0_rp ! center height of shear layer [m]
2794  real(RP) :: SHEAR_U = 15.0_rp ! velocity u over the shear layer [m/s]
2795  real(RP) :: QV0 = 14.0_rp ! maximum vapor mixing ration [g/kg]
2796  ! Bubble
2797  real(RP) :: BBL_THETA = 3.d0 ! extremum of temperature in bubble [K]
2798 
2799  namelist / param_mkinit_wk1982 / &
2800  sfc_theta, &
2801  sfc_pres, &
2802  tr_z, &
2803  tr_theta, &
2804  tr_temp, &
2805  shear_z, &
2806  shear_u, &
2807  qv0, &
2808  bbl_theta
2809 
2810  real(RP) :: rh (KA,IA,JA)
2811  real(RP) :: rh_sfc( IA,JA)
2812 
2813  integer :: ierr
2814  integer :: k, i, j
2815  !---------------------------------------------------------------------------
2816 
2817  log_newline
2818  log_info("MKINIT_wk1982",*) 'Setup initial state'
2819 
2820  if ( atmos_hydrometeor_dry ) then
2821  log_error("MKINIT_wk1982",*) 'QV is not registered'
2822  call prc_abort
2823  end if
2824 
2825  sfc_pres = pstd
2826 
2827  rewind(io_fid_conf)
2828  read(io_fid_conf,nml=param_mkinit_wk1982,iostat=ierr)
2829  if( ierr < 0 ) then !--- missing
2830  log_info("MKINIT_wk1982",*) 'Not found namelist. Default used.'
2831  elseif( ierr > 0 ) then !--- fatal error
2832  log_error("MKINIT_wk1982",*) 'Not appropriate names in namelist PARAM_MKINIT_WK1982. Check!'
2833  call prc_abort
2834  endif
2835  log_nml(param_mkinit_wk1982)
2836 
2837  ! calc in dry condition
2838  do j = jsb, jeb
2839  do i = isb, ieb
2840  pres_sfc(i,j) = sfc_pres
2841  pott_sfc(i,j) = sfc_theta
2842 
2843  do k = ks, ke
2844  if ( real_cz(k,i,j) <= tr_z ) then ! below initial cloud top
2845  pott(k,i,j) = pott_sfc(i,j) &
2846  + ( tr_theta - pott_sfc(i,j) ) * ( real_cz(k,i,j) / tr_z )**1.25_rp
2847  else
2848  pott(k,i,j) = tr_theta * exp( grav * ( real_cz(k,i,j) - tr_z ) / cpdry / tr_temp )
2849  endif
2850  enddo
2851  enddo
2852  enddo
2853 
2854  ! make density & pressure profile in dry condition
2855  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
2856  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
2857  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
2858  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
2859  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
2860 
2861  ! calc QV from RH
2862  do j = jsb, jeb
2863  do i = isb, ieb
2864  rh_sfc(i,j) = 1.0_rp - 0.75_rp * ( real_fz(ks-1,i,j) / tr_z )**1.25_rp
2865 
2866  do k = ks, ke
2867  if ( real_cz(k,i,j) <= tr_z ) then ! below initial cloud top
2868  rh(k,i,j) = 1.0_rp - 0.75_rp * ( real_cz(k,i,j) / tr_z )**1.25_rp
2869  else
2870  rh(k,i,j) = 0.25_rp
2871  endif
2872  enddo
2873  enddo
2874  enddo
2875 
2876  call saturation_psat_all( ia, isb, ieb, ja, jsb, jeb, &
2877  temp_sfc(:,:), & ! [IN]
2878  psat_sfc(:,:) ) ! [OUT]
2879  qdry(:,:,:) = 1.0_rp - qv(:,:,:) - qc(:,:,:)
2880  call saturation_pres2qsat_all( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
2881  temp(:,:,:), pres(:,:,:), qdry(:,:,:), & ! [IN]
2882  qsat(:,:,:) ) ! [OUT]
2883 
2884  qv0 = qv0 * 1e-3_rp ! g/kg to kg/kg
2885  qv0 = qv0 / ( 1.0_rp + qv0 ) ! mixing ratio to specicic humidity
2886 
2887  do j = jsb, jeb
2888  do i = isb, ieb
2889  qsat_sfc(i,j) = epsvap * psat_sfc(i,j) / ( pres_sfc(i,j) - ( 1.0_rp-epsvap ) * psat_sfc(i,j) )
2890  qv_sfc(i,j) = min( rh_sfc(i,j) * qsat_sfc(i,j), qv0 )
2891  do k = ks, ke
2892  qv(k,i,j) = min( rh(k,i,j) * qsat(k,i,j), qv0 )
2893  enddo
2894  enddo
2895  enddo
2896 
2897  ! make density & pressure profile in moist condition
2898  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
2899  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
2900  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
2901  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
2902  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
2903 
2904  do k = ks, ke
2905  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
2906  enddo
2907 
2908  call comm_vars8( dens(:,:,:), 1 )
2909  call comm_wait ( dens(:,:,:), 1 )
2910 
2911  do j = jsb, jeb
2912  do i = isb, ieb
2913  do k = ks, ke
2914  momx(k,i,j) = shear_u * tanh( real_cz(k,i,j) / shear_z ) &
2915  * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
2916  enddo
2917  enddo
2918  enddo
2919 
2920  do j = jsb, jeb
2921  do i = isb, ieb
2922  do k = ks, ke
2923  momy(k,i,j) = 0.0_rp
2924  momz(k,i,j) = 0.0_rp
2925  rhot(k,i,j) = pott(k,i,j) * dens(k,i,j)
2926 
2927  ! make warm bubble
2928  rhot(k,i,j) = dens(k,i,j) * ( pott(k,i,j) + bbl_theta * bubble(k,i,j) )
2929  enddo
2930  enddo
2931  enddo
2932 
2933  call flux_setup
2934 
2935  return
2936  end subroutine mkinit_wk1982
2937 
2938  !-----------------------------------------------------------------------------
2940  subroutine mkinit_dycoms2_rf01
2941  use scale_const, only: &
2942  rdry => const_rdry, &
2943  rvap => const_rvap, &
2944  cpdry => const_cpdry, &
2945  cpvap => const_cpvap, &
2946  cl => const_cl
2947  use scale_atmos_hydrometeor, only: &
2949  implicit none
2950 
2951 #ifndef DRY
2952  real(RP) :: PERTURB_AMP = 0.0_rp
2953  integer :: RANDOM_LIMIT = 5
2954  integer :: RANDOM_FLAG = 0 ! 0 -> no perturbation
2955  ! 1 -> petrurbation for pt
2956  ! 2 -> perturbation for u, v, w
2957  logical :: USE_LWSET = .false. ! use liq. water. static energy temp.?
2958 
2959  namelist / param_mkinit_rf01 / &
2960  perturb_amp, &
2961  random_limit, &
2962  random_flag, &
2963  use_lwset
2964 
2965  real(RP) :: potl(KA,IA,JA) ! liquid potential temperature
2966  real(RP) :: LHV (KA,IA,JA) ! latent heat of vaporization [J/kg]
2967 
2968  real(RP) :: qall ! QV+QC
2969  real(RP) :: fact
2970  real(RP) :: pi2
2971  real(RP) :: sint
2972  real(RP) :: GEOP_sw ! switch for geopotential energy correction
2973 
2974  real(RP) :: qdry, Rtot, CPtot
2975 
2976  integer :: ierr
2977  integer :: k, i, j
2978  !---------------------------------------------------------------------------
2979 
2980  pi2 = atan(1.0_rp) * 2.0_rp ! pi/2
2981 
2982  log_newline
2983  log_info("MKINIT_DYCOMS2_RF01",*) 'Setup initial state'
2984 
2985  rewind(io_fid_conf)
2986 
2987  if ( atmos_hydrometeor_dry ) then
2988  log_error("MKINIT_DYCOMS2_RF01",*) 'QV is not registered'
2989  call prc_abort
2990  end if
2991 
2992  read(io_fid_conf,nml=param_mkinit_rf01,iostat=ierr)
2993  if( ierr < 0 ) then !--- missing
2994  log_info("MKINIT_DYCOMS2_RF01",*) 'Not found namelist. Default used.'
2995  elseif( ierr > 0 ) then !--- fatal error
2996  log_error("MKINIT_DYCOMS2_RF01",*) 'Not appropriate names in namelist PARAM_MKINIT_RF01. Check!'
2997  call prc_abort
2998  endif
2999  log_nml(param_mkinit_rf01)
3000 
3001  if ( use_lwset ) then
3002  geop_sw = 1.0_rp
3003  else
3004  geop_sw = 0.0_rp
3005  endif
3006 
3007  ! calc in dry condition
3008  do j = jsb, jeb
3009  do i = isb, ieb
3010 
3011  pres_sfc(i,j) = 1017.8e2_rp ! [Pa]
3012  pott_sfc(i,j) = 289.0_rp ! [K]
3013 
3014  do k = ks, ke
3015  velx(k,i,j) = 7.0_rp
3016  vely(k,i,j) = -5.5_rp
3017  if ( cz(k) < 820.0_rp ) then ! below initial cloud top
3018  potl(k,i,j) = 289.0_rp - grav / cpdry * cz(k) * geop_sw
3019  elseif( cz(k) <= 860.0_rp ) then
3020  sint = sin( pi2 * ( cz(k)-840.0_rp ) / 20.0_rp ) * 0.5_rp
3021  potl(k,i,j) = ( 289.0_rp - grav / cpdry * cz(k) * geop_sw ) * (0.5_rp-sint) &
3022  + ( 297.5_rp+sign(abs(cz(k)-840.0_rp)**(1.0_rp/3.0_rp),cz(k)-840.0_rp) &
3023  - grav / cpdry * cz(k) * geop_sw ) * (0.5_rp+sint)
3024  else
3025  potl(k,i,j) = 297.5_rp + ( cz(k)-840.0_rp )**(1.0_rp/3.0_rp) &
3026  - grav / cpdry * cz(k) * geop_sw
3027  endif
3028  enddo
3029 
3030  enddo
3031  enddo
3032 
3033  ! make density & pressure profile in dry condition
3034  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3035  potl(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3036  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3037  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3038  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3039 
3040  ! calc in moist condition
3041  do j = jsb, jeb
3042  do i = isb, ieb
3043  qv_sfc(i,j) = 9.0e-3_rp ! [kg/kg]
3044 
3045  do k = ks, ke
3046  if ( cz(k) < 820.0_rp ) then ! below initial cloud top
3047  qall = 9.0e-3_rp
3048  elseif( cz(k) <= 860.0_rp ) then ! boundary
3049  sint = sin( pi2 * ( cz(k)-840.0_rp ) / 20.0_rp ) * 0.5_rp
3050  qall = 9.0e-3_rp * (0.5_rp-sint) &
3051  + 1.5e-3_rp * (0.5_rp+sint)
3052  elseif( cz(k) <= 5000.0_rp ) then
3053  qall = 1.5e-3_rp
3054  else
3055  qall = 0.0_rp
3056  endif
3057 
3058  if ( cz(k) <= 600.0_rp ) then
3059  qc(k,i,j) = 0.0_rp
3060  elseif( cz(k) < 820.0_rp ) then ! in the cloud
3061  fact = ( cz(k)-600.0_rp ) / ( 840.0_rp-600.0_rp )
3062  qc(k,i,j) = 0.45e-3_rp * fact
3063  elseif( cz(k) <= 860.0_rp ) then ! boundary
3064  sint = sin( pi2 * ( cz(k)-840.0_rp ) / 20.0_rp ) * 0.5_rp
3065  fact = ( cz(k)-600.0_rp ) / ( 840.0_rp-600.0_rp )
3066  qc(k,i,j) = 0.45e-3_rp * fact * (0.5_rp-sint)
3067  else
3068  qc(k,i,j) = 0.0_rp
3069  endif
3070 
3071  qv(k,i,j) = qall - qc(k,i,j)
3072  enddo
3073 
3074  enddo
3075  enddo
3076 
3077  call hydrometeor_lhv( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3078  temp(:,:,:), lhv(:,:,:) )
3079 
3080  do j = jsb, jeb
3081  do i = isb, ieb
3082  do k = ks, ke
3083  temp(k,i,j) = temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j)
3084  qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
3085  rtot = rdry * qdry + rvap * qv(k,i,j)
3086  cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
3087  pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
3088  enddo
3089  enddo
3090  enddo
3091 
3092  ! make density & pressure profile in moist condition
3093  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3094  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3095  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3096  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3097  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3098 
3099  do j = jsb, jeb
3100  do i = isb, ieb
3101  dens( 1:ks-1,i,j) = dens(ks,i,j)
3102  dens(ke+1:ka, i,j) = dens(ke,i,j)
3103  enddo
3104  enddo
3105 
3106  call comm_vars8( dens(:,:,:), 1 )
3107  call comm_wait ( dens(:,:,:), 1 )
3108 
3109  call random_uniform(rndm) ! make random
3110  do j = jsb, jeb
3111  do i = isb, ieb
3112  do k = ks, ke
3113  if ( random_flag == 2 .and. k <= random_limit ) then ! below initial cloud top
3114  momz(k,i,j) = ( ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3115  * 0.5_rp * ( dens(k+1,i,j) + dens(k,i,j) )
3116  else
3117  momz(k,i,j) = 0.0_rp
3118  endif
3119  enddo
3120  enddo
3121  enddo
3122 
3123  call random_uniform(rndm) ! make random
3124  do j = jsb, jeb
3125  do i = isb, ieb
3126  do k = ks, ke
3127  if ( random_flag == 2 .AND. k <= random_limit ) then ! below initial cloud top
3128  momx(k,i,j) = ( velx(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3129  * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
3130  else
3131  momx(k,i,j) = velx(k,i,j) * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
3132  endif
3133  enddo
3134  enddo
3135  enddo
3136 
3137  call random_uniform(rndm) ! make random
3138  do j = jsb, jeb
3139  do i = isb, ieb
3140  do k = ks, ke
3141  if ( random_flag == 2 .AND. k <= random_limit ) then ! below initial cloud top
3142  momy(k,i,j) = ( vely(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3143  * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
3144  else
3145  momy(k,i,j) = vely(k,i,j) * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
3146  endif
3147  enddo
3148  enddo
3149  enddo
3150 
3151  call random_uniform(rndm) ! make random
3152  do j = jsb, jeb
3153  do i = isb, ieb
3154  do k = ks, ke
3155  if ( random_flag == 1 .and. k <= random_limit ) then ! below initial cloud top
3156  rhot(k,i,j) = ( pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3157  * dens(k,i,j)
3158  else
3159  rhot(k,i,j) = pott(k,i,j) * dens(k,i,j)
3160  endif
3161  enddo
3162  enddo
3163  enddo
3164 
3165  do j = jsb, jeb
3166  do i = isb, ieb
3167  do k = ks, ke
3168  if ( qc(k,i,j) > 0.0_rp ) then
3169  nc(k,i,j) = 120.e6_rp / dens(k,i,j) ! [number/m3] / [kg/m3]
3170  end if
3171  enddo
3172  enddo
3173  enddo
3174 
3175 #endif
3176  return
3177  end subroutine mkinit_dycoms2_rf01
3178 
3179  !-----------------------------------------------------------------------------
3181  subroutine mkinit_dycoms2_rf02
3182  use scale_const, only: &
3183  rdry => const_rdry, &
3184  rvap => const_rvap, &
3185  cpdry => const_cpdry, &
3186  cpvap => const_cpvap, &
3187  cl => const_cl
3188  use scale_atmos_hydrometeor, only: &
3190  implicit none
3191 
3192 #ifndef DRY
3193  real(RP) :: PERTURB_AMP = 0.0_rp
3194  integer :: RANDOM_LIMIT = 5
3195  integer :: RANDOM_FLAG = 0 ! 0 -> no perturbation
3196  ! 1 -> perturbation for PT
3197  ! 2 -> perturbation for u,v,w
3198 
3199  namelist / param_mkinit_rf02 / &
3200  perturb_amp, &
3201  random_limit, &
3202  random_flag
3203 
3204  real(RP) :: potl(KA,IA,JA) ! liquid potential temperature
3205  real(RP) :: LHV (KA,IA,JA) ! latent heat of vaporization [J/kg]
3206 
3207  real(RP) :: qall ! QV+QC
3208  real(RP) :: fact
3209  real(RP) :: pi2
3210  real(RP) :: sint
3211  real(RP) :: qdry, Rtot, CPtot
3212 
3213  integer :: ierr
3214  integer :: k, i, j
3215  !---------------------------------------------------------------------------
3216 
3217  pi2 = atan(1.0_rp) * 2.0_rp ! pi/2
3218  log_newline
3219  log_info("MKINIT_DYCOMS2_RF02",*) 'Setup initial state'
3220 
3221  if ( atmos_hydrometeor_dry ) then
3222  log_error("MKINIT_DYCOMS2_RF02",*) 'QV is not registered'
3223  call prc_abort
3224  end if
3225 
3226  rewind(io_fid_conf)
3227  read(io_fid_conf,nml=param_mkinit_rf02,iostat=ierr)
3228  if( ierr < 0 ) then !--- missing
3229  log_info("MKINIT_DYCOMS2_RF02",*) 'Not found namelist. Default used.'
3230  elseif( ierr > 0 ) then !--- fatal error
3231  log_error("MKINIT_DYCOMS2_RF02",*) 'Not appropriate names in namelist PARAM_MKINIT_RF02. Check!'
3232  call prc_abort
3233  endif
3234  log_nml(param_mkinit_rf02)
3235 
3236  ! calc in dry condition
3237  call random_uniform(rndm) ! make random
3238  do j = jsb, jeb
3239  do i = isb, ieb
3240 
3241  pres_sfc(i,j) = 1017.8e2_rp ! [Pa]
3242  pott_sfc(i,j) = 288.3_rp ! [K]
3243 
3244  do k = ks, ke
3245  velx(k,i,j) = 3.0_rp + 4.3 * cz(k)*1.e-3_rp
3246  vely(k,i,j) = -9.0_rp + 5.6 * cz(k)*1.e-3_rp
3247 
3248  if ( cz(k) < 775.0_rp ) then ! below initial cloud top
3249  potl(k,i,j) = 288.3_rp ! [K]
3250  else if ( cz(k) <= 815.0_rp ) then
3251  sint = sin( pi2 * (cz(k) - 795.0_rp)/20.0_rp )
3252  potl(k,i,j) = 288.3_rp * (1.0_rp-sint)*0.5_rp &
3253  + ( 295.0_rp+sign(abs(cz(k)-795.0_rp)**(1.0_rp/3.0_rp),cz(k)-795.0_rp) ) &
3254  * (1.0_rp+sint)*0.5_rp
3255  else
3256  potl(k,i,j) = 295.0_rp + ( cz(k)-795.0_rp )**(1.0_rp/3.0_rp)
3257  endif
3258  enddo
3259  enddo
3260  enddo
3261 
3262  ! make density & pressure profile in dry condition
3263  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3264  potl(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3265  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3266  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3267  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3268 
3269  ! calc in moist condition
3270  do j = jsb, jeb
3271  do i = isb, ieb
3272  qv_sfc(i,j) = 9.45e-3_rp
3273 
3274  do k = ks, ke
3275  if ( cz(k) < 775.0_rp ) then ! below initial cloud top
3276  qall = 9.45e-3_rp ! [kg/kg]
3277  else if ( cz(k) <= 815.0_rp ) then
3278  sint = sin( pi2 * (cz(k) - 795.0_rp)/20.0_rp )
3279  qall = 9.45e-3_rp * (1.0_rp-sint)*0.5_rp + &
3280  ( 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
3281  else
3282  qall = 5.e-3_rp - 3.e-3_rp * ( 1.0_rp - exp( (795.0_rp-cz(k))/500.0_rp ) ) ! [kg/kg]
3283  endif
3284 
3285  if( cz(k) < 400.0_rp ) then
3286  qc(k,i,j) = 0.0_rp
3287  elseif( cz(k) < 775.0_rp ) then
3288  fact = ( cz(k)-400.0_rp ) / ( 795.0_rp-400.0_rp )
3289  qc(k,i,j) = 0.65e-3_rp * fact
3290  elseif( cz(k) <= 815.0_rp ) then
3291  sint = sin( pi2 * ( cz(k)-795.0_rp )/20.0_rp )
3292  fact = ( cz(k)-400.0_rp ) / ( 795.0_rp-400.0_rp )
3293  qc(k,i,j) = 0.65e-3_rp * fact * (1.0_rp-sint) * 0.5_rp
3294  else
3295  qc(k,i,j) = 0.0_rp
3296  endif
3297  qv(k,i,j) = qall - qc(k,i,j)
3298  enddo
3299 
3300  enddo
3301  enddo
3302 
3303  call hydrometeor_lhv( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3304  temp(:,:,:), lhv(:,:,:) )
3305 
3306  do j = jsb, jeb
3307  do i = isb, ieb
3308  do k = ks, ke
3309  temp(k,i,j) = temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j)
3310  qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
3311  rtot = rdry * qdry + rvap * qv(k,i,j)
3312  cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
3313  pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
3314  enddo
3315  enddo
3316  enddo
3317 
3318  ! make density & pressure profile in moist condition
3319  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3320  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3321  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3322  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3323  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3324 
3325  do j = jsb, jeb
3326  do i = isb, ieb
3327  dens( 1:ks-1,i,j) = dens(ks,i,j)
3328  dens(ke+1:ka, i,j) = dens(ke,i,j)
3329  enddo
3330  enddo
3331 
3332  call comm_vars8( dens(:,:,:), 1 )
3333  call comm_wait ( dens(:,:,:), 1 )
3334 
3335  call random_uniform(rndm) ! make random
3336  do j = jsb, jeb
3337  do i = isb, ieb
3338  do k = ks, ke
3339  if( random_flag == 2 .and. k <= random_limit ) then
3340  momz(k,i,j) = ( 0.0_rp + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3341  * 0.5_rp * ( dens(k+1,i,j) + dens(k,i,j) )
3342  else
3343  momz(k,i,j) = 0.0_rp
3344  endif
3345  enddo
3346  enddo
3347  enddo
3348 
3349  call random_uniform(rndm) ! make random
3350  do j = jsb, jeb
3351  do i = isb, ieb
3352  do k = ks, ke
3353  if( random_flag == 2 .and. k <= random_limit ) then
3354  momx(k,i,j) = ( velx(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3355  * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
3356  else
3357  momx(k,i,j) = ( velx(k,i,j) ) * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
3358  endif
3359  enddo
3360  enddo
3361  enddo
3362 
3363  call random_uniform(rndm) ! make random
3364  do j = jsb, jeb
3365  do i = isb, ieb
3366  do k = ks, ke
3367  if( random_flag == 2 .and. k <= random_limit ) then
3368  momy(k,i,j) = ( vely(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3369  * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
3370  else
3371  momy(k,i,j) = vely(k,i,j) * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
3372  endif
3373  enddo
3374  enddo
3375  enddo
3376 
3377  call random_uniform(rndm) ! make random
3378  do j = jsb, jeb
3379  do i = isb, ieb
3380  do k = ks, ke
3381  if( random_flag == 1 .and. k <= random_limit ) then
3382  rhot(k,i,j) = ( pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3383  * dens(k,i,j)
3384  else
3385  rhot(k,i,j) = pott(k,i,j) * dens(k,i,j)
3386  endif
3387  enddo
3388  enddo
3389  enddo
3390 
3391  do j = jsb, jeb
3392  do i = isb, ieb
3393  do k = ks, ke
3394  if ( qc(k,i,j) > 0.0_rp ) then
3395  nc(k,i,j) = 55.0e6_rp / dens(k,i,j) ! [number/m3] / [kg/m3]
3396  endif
3397  enddo
3398  enddo
3399  enddo
3400 
3401 #endif
3402  return
3403  end subroutine mkinit_dycoms2_rf02
3404 
3405  !-----------------------------------------------------------------------------
3407  subroutine mkinit_dycoms2_rf02_dns
3408  use scale_const, only: &
3409  rdry => const_rdry, &
3410  rvap => const_rvap, &
3411  cpdry => const_cpdry, &
3412  cpvap => const_cpvap, &
3413  cl => const_cl
3414  use scale_atmos_hydrometeor, only: &
3416  implicit none
3417 
3418 #ifndef DRY
3419  real(RP) :: ZB = 750.0_rp ! domain bottom
3420 ! real(RP) :: ZT = 900.0_RP ! domain top
3421  real(RP) :: CONST_U = 0.0_rp
3422  real(RP) :: CONST_V = 0.0_rp
3423  real(RP) :: PRES_ZB = 93060.0_rp
3424  real(RP) :: PERTURB_AMP = 0.0_rp
3425  integer :: RANDOM_LIMIT = 5
3426  integer :: RANDOM_FLAG = 0 ! 0 -> no perturbation
3427  ! 1 -> perturbation for PT
3428  ! 2 -> perturbation for u,v,w
3429 
3430  namelist / param_mkinit_rf02_dns / &
3431  zb, const_u, const_v,pres_zb,&
3432  perturb_amp, &
3433  random_limit, &
3434  random_flag
3435 
3436  real(RP) :: potl(KA,IA,JA) ! liquid potential temperature
3437  real(RP) :: LHV (KA,IA,JA) ! latent heat of vaporization [J/kg]
3438 
3439  real(RP) :: qall ! QV+QC
3440  real(RP) :: fact
3441  real(RP) :: pi2
3442 
3443  real(RP) :: qdry, Rtot, CPtot
3444 
3445  integer :: ierr
3446  integer :: k, i, j
3447  !---------------------------------------------------------------------------
3448 
3449  pi2 = atan(1.0_rp) * 2.0_rp ! pi/2
3450 
3451  log_newline
3452  log_info("MKINIT_DYCOMS2_RF02_DNS",*) 'Setup initial state'
3453 
3454  if ( atmos_hydrometeor_dry ) then
3455  log_error("MKINIT_DYCOMS2_RF02_DNS",*) 'QV is not registered'
3456  call prc_abort
3457  end if
3458 
3459  rewind(io_fid_conf)
3460  read(io_fid_conf,nml=param_mkinit_rf02_dns,iostat=ierr)
3461  if( ierr < 0 ) then !--- missing
3462  log_info("MKINIT_DYCOMS2_RF02_DNS",*) 'Not found namelist. Default used.'
3463  elseif( ierr > 0 ) then !--- fatal error
3464  log_error("MKINIT_DYCOMS2_RF02_DNS",*) 'Not appropriate names in namelist PARAM_MKINIT_RF02_DNS. Check!'
3465  call prc_abort
3466  endif
3467  log_nml(param_mkinit_rf02_dns)
3468 
3469  ! calc in dry condition
3470  call random_uniform(rndm) ! make random
3471  do j = jsb, jeb
3472  do i = isb, ieb
3473 
3474  pres_sfc(i,j) = pres_zb
3475 ! pott_sfc(i,j) = 288.3_RP ! [K]
3476 ! qv_sfc (i,j) = 9.45E-3_RP
3477 
3478  do k = ks, ke
3479 
3480  velx(k,i,j) = const_u
3481  vely(k,i,j) = const_v
3482 
3483 ! if ( ZB+CZ(k) < 775.0_RP ) then ! below initial cloud top
3484  if ( zb+cz(k) <= 795.0_rp ) then ! below initial cloud top
3485  potl(k,i,j) = 288.3_rp ! [K]
3486  qall = 9.45e-3_rp ! [kg/kg]
3487 ! necessary?
3488 ! else if ( CZ(k) <= 815.0_RP ) then
3489 ! sint = sin( pi2 * (CZ(k) - 795.0_RP)/20.0_RP )
3490 ! potl(k,i,j) = 288.3_RP * (1.0_RP-sint)*0.5_RP + &
3491 ! ( 295.0_RP+sign(abs(CZ(k)-795.0_RP)**(1.0_RP/3.0_RP),CZ(k)-795.0_RP) ) * (1.0_RP+sint)*0.5_RP
3492 ! qall = 9.45E-3_RP * (1.0_RP-sint)*0.5_RP + &
3493 ! ( 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
3494  else
3495  potl(k,i,j) = 295.0_rp + ( zb+cz(k)-795.0_rp )**(1.0_rp/3.0_rp)
3496  qall = 5.e-3_rp - 3.e-3_rp * ( 1.0_rp - exp( (795.0_rp-(zb+cz(k)))/500.0_rp ) ) ! [kg/kg]
3497  endif
3498 
3499  if( zb+cz(k) < 400.0_rp ) then
3500  qc(k,i,j) = 0.0_rp
3501  elseif( zb+cz(k) <= 795.0_rp ) then
3502  fact = ( (zb+cz(k))-400.0_rp ) / ( 795.0_rp-400.0_rp )
3503  qc(k,i,j) = 0.8e-3_rp * fact
3504  else
3505  qc(k,i,j) = 0.0_rp
3506  endif
3507  qv(k,i,j) = qall - qc(k,i,j)
3508 
3509  !if(i==is.and.j==js)LOG_INFO("MKINIT_DYCOMS2_RF02_DNS",*)'chkk',k,cz(k)+zb,qc(k,i,j),qv(k,i,j)
3510  enddo
3511  enddo
3512  enddo
3513 
3514  !LOG_INFO("MKINIT_DYCOMS2_RF02_DNS",*)'chk3',ks,ke
3515  ! extrapolation (temtative)
3516  pott_sfc(:,:) = potl(ks,:,:)-0.5*(potl(ks+1,:,:)-potl(ks,:,:))
3517  qv_sfc(:,:) = qv(ks,:,:)-0.5*(qv(ks+1,:,:)-qv(ks,:,:))
3518  qc_sfc(:,:) = qc(ks,:,:)-0.5*(qc(ks+1,:,:)-qc(ks,:,:))
3519 
3520  ! make density & pressure profile in moist condition
3521  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3522  potl(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3523  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3524  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3525  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3526 
3527  call hydrometeor_lhv( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3528  temp(:,:,:), lhv(:,:,:) )
3529 
3530  do j = jsb, jeb
3531  do i = isb, ieb
3532  do k = ks, ke
3533  temp(k,i,j) = temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j)
3534  qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
3535  rtot = rdry * qdry + rvap * qv(k,i,j)
3536  cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
3537  pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
3538  enddo
3539  enddo
3540  enddo
3541 
3542  ! make density & pressure profile in moist condition
3543  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3544  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3545  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3546  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3547  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3548 
3549  do j = jsb, jeb
3550  do i = isb, ieb
3551  dens( 1:ks-1,i,j) = dens(ks,i,j)
3552  dens(ke+1:ka, i,j) = dens(ke,i,j)
3553  enddo
3554  enddo
3555 
3556  call comm_vars8( dens(:,:,:), 1 )
3557  call comm_wait ( dens(:,:,:), 1 )
3558 
3559  call random_uniform(rndm) ! make random
3560  do j = jsb, jeb
3561  do i = isb, ieb
3562  do k = ks, ke
3563  if( random_flag == 2 .and. k <= random_limit ) then
3564  momz(k,i,j) = ( 0.0_rp + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3565  * 0.5_rp * ( dens(k+1,i,j) + dens(k,i,j) )
3566  else
3567  momz(k,i,j) = 0.0_rp
3568  endif
3569  enddo
3570  enddo
3571  enddo
3572 
3573  !LOG_INFO("MKINIT_DYCOMS2_RF02_DNS",*)'chk8'
3574  call random_uniform(rndm) ! make random
3575  do j = jsb, jeb
3576  do i = isb, ieb
3577  do k = ks, ke
3578  if( random_flag == 2 .and. k <= random_limit ) then
3579  momx(k,i,j) = ( velx(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3580  * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
3581  else
3582  momx(k,i,j) = ( velx(k,i,j) ) * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
3583  endif
3584  enddo
3585  enddo
3586  enddo
3587  !LOG_INFO("MKINIT_DYCOMS2_RF02_DNS",*)'chk9'
3588 
3589  call random_uniform(rndm) ! make random
3590  do j = jsb, jeb
3591  do i = isb, ieb
3592  do k = ks, ke
3593  if( random_flag == 2 .and. k <= random_limit ) then
3594  momy(k,i,j) = ( vely(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3595  * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
3596  else
3597  momy(k,i,j) = vely(k,i,j) * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
3598  endif
3599  enddo
3600  enddo
3601  enddo
3602 
3603  call random_uniform(rndm) ! make random
3604  do j = jsb, jeb
3605  do i = isb, ieb
3606  do k = ks, ke
3607  if( random_flag == 1 .and. k <= random_limit ) then
3608  rhot(k,i,j) = ( pott(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
3609  * dens(k,i,j)
3610  else
3611  rhot(k,i,j) = pott(k,i,j) * dens(k,i,j)
3612  endif
3613  enddo
3614  enddo
3615  enddo
3616 
3617  do j = jsb, jeb
3618  do i = isb, ieb
3619  do k = ks, ke
3620  if ( qc(k,i,j) > 0.0_rp ) then
3621  nc(k,i,j) = 55.0e6_rp / dens(k,i,j) ! [number/m3] / [kg/m3]
3622  endif
3623  enddo
3624  enddo
3625  enddo
3626 
3627 #endif
3628  return
3629  end subroutine mkinit_dycoms2_rf02_dns
3630 
3631  !-----------------------------------------------------------------------------
3633  subroutine mkinit_rico
3634  use scale_const, only: &
3635  rdry => const_rdry, &
3636  rvap => const_rvap, &
3637  cpdry => const_cpdry, &
3638  cpvap => const_cpvap, &
3639  cl => const_cl
3640  use scale_atmos_hydrometeor, only: &
3642  implicit none
3643 
3644 #ifndef DRY
3645  real(RP):: PERTURB_AMP_PT = 0.1_rp
3646  real(RP):: PERTURB_AMP_QV = 2.5e-5_rp
3647 
3648  namelist / param_mkinit_rico / &
3649  perturb_amp_pt, &
3650  perturb_amp_qv
3651 
3652  real(RP) :: LHV (KA,IA,JA) ! latent heat of vaporization [J/kg]
3653  real(RP) :: potl(KA,IA,JA) ! liquid potential temperature
3654  real(RP) :: qall ! QV+QC
3655  real(RP) :: fact
3656 
3657  real(RP) :: qdry, Rtot, CPtot
3658 
3659  integer :: ierr
3660  integer :: k, i, j
3661  !---------------------------------------------------------------------------
3662 
3663  log_newline
3664  log_info("MKINIT_RICO",*) 'Setup initial state'
3665 
3666  if ( atmos_hydrometeor_dry ) then
3667  log_error("MKINIT_RICO",*) 'QV is not registered'
3668  call prc_abort
3669  end if
3670 
3671  rewind(io_fid_conf)
3672  read(io_fid_conf,nml=param_mkinit_rico,iostat=ierr)
3673  if( ierr < 0 ) then !--- missing
3674  log_info("MKINIT_RICO",*) 'Not found namelist. Default used.'
3675  elseif( ierr > 0 ) then !--- fatal error
3676  log_error("MKINIT_RICO",*) 'Not appropriate names in namelist PARAM_MKINIT_RICO. Check!'
3677  call prc_abort
3678  endif
3679  log_nml(param_mkinit_rico)
3680 
3681  ! calc in moist condition
3682  do j = jsb, jeb
3683  do i = isb, ieb
3684 
3685  pres_sfc(i,j) = 1015.4e2_rp ! [Pa]
3686  pott_sfc(i,j) = 297.9_rp
3687 
3688  do k = ks, ke
3689  !--- potential temperature
3690  if ( cz(k) < 740.0_rp ) then ! below initial cloud top
3691  potl(k,i,j) = 297.9_rp
3692  else
3693  fact = ( cz(k)-740.0_rp ) * ( 317.0_rp-297.9_rp ) / ( 4000.0_rp-740.0_rp )
3694  potl(k,i,j) = 297.9_rp + fact
3695  endif
3696 
3697  !--- horizontal wind velocity
3698  if ( cz(k) <= 4000.0_rp ) then ! below initial cloud top
3699  fact = ( cz(k)-0.0_rp ) * ( -1.9_rp+9.9_rp ) / ( 4000.0_rp-0.0_rp )
3700  velx(k,i,j) = -9.9_rp + fact
3701  vely(k,i,j) = -3.8_rp
3702  else
3703  velx(k,i,j) = -1.9_rp
3704  vely(k,i,j) = -3.8_rp
3705  endif
3706  enddo
3707 
3708  enddo
3709  enddo
3710 
3711  ! make density & pressure profile in moist condition
3712  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3713  potl(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3714  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3715  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3716  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3717 
3718 
3719  do j = jsb, jeb
3720  do i = isb, ieb
3721  qv_sfc(i,j) = 16.0e-3_rp ! [kg/kg]
3722 
3723  do k = ks, ke
3724  !--- mixing ratio of vapor
3725  if ( cz(k) <= 740.0_rp ) then ! below initial cloud top
3726  fact = ( cz(k)-0.0_rp ) * ( 13.8e-3_rp-16.0e-3_rp ) / ( 740.0_rp-0.0_rp )
3727  qall = 16.0e-3_rp + fact
3728  elseif ( cz(k) <= 3260.0_rp ) then ! boundary
3729  fact = ( cz(k)-740.0_rp ) * ( 2.4e-3_rp-13.8e-3_rp ) / ( 3260.0_rp-740.0_rp )
3730  qall = 13.8e-3_rp + fact
3731  elseif( cz(k) <= 4000.0_rp ) then
3732  fact = ( cz(k)-3260.0_rp ) * ( 1.8e-3_rp-2.4e-3_rp ) / ( 4000.0_rp-3260.0_rp )
3733  qall = 2.4e-3_rp + fact
3734  else
3735  qall = 0.0_rp
3736  endif
3737 
3738  qv(k,i,j) = qall - qc(k,i,j)
3739  enddo
3740 
3741  enddo
3742  enddo
3743 
3744  call hydrometeor_lhv( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3745  temp(:,:,:), lhv(:,:,:) )
3746 
3747  do j = jsb, jeb
3748  do i = isb, ieb
3749  do k = ks, ke
3750  temp(k,i,j) = temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j)
3751  qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
3752  rtot = rdry * qdry + rvap * qv(k,i,j)
3753  cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
3754  pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
3755  enddo
3756  enddo
3757  enddo
3758 
3759  ! make density & pressure profile in moist condition
3760  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3761  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3762  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3763  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3764  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3765 
3766 
3767  do j = jsb, jeb
3768  do i = isb, ieb
3769  dens( 1:ks-1,i,j) = dens(ks,i,j)
3770  dens(ke+1:ka ,i,j) = dens(ke,i,j)
3771  enddo
3772  enddo
3773 
3774  call comm_vars8( dens(:,:,:), 1 )
3775  call comm_wait ( dens(:,:,:), 1 )
3776 
3777  do j = jsb, jeb
3778  do i = isb, ieb
3779  do k = ks, ke
3780  momz(k,i,j) = 0.0_rp
3781  enddo
3782  enddo
3783  enddo
3784 
3785  do j = jsb, jeb
3786  do i = isb, ieb
3787  do k = ks, ke
3788  momx(k,i,j) = velx(k,i,j) * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
3789  enddo
3790  enddo
3791  enddo
3792 
3793  do j = jsb, jeb
3794  do i = isb, ieb
3795  do k = ks, ke
3796  momy(k,i,j) = vely(k,i,j) * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
3797  enddo
3798  enddo
3799  enddo
3800 
3801  call random_uniform(rndm) ! make random
3802  do j = jsb, jeb
3803  do i = isb, ieb
3804  do k = ks, ke
3805  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)
3806  enddo
3807  enddo
3808  enddo
3809 
3810  call random_uniform(rndm) ! make random
3811  do j = jsb, jeb
3812  do i = isb, ieb
3813  do k = ks, ke
3814  qv(k,i,j) = qv(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp_qv
3815  enddo
3816  enddo
3817  enddo
3818 
3819  do j = jsb, jeb
3820  do i = isb, ieb
3821  do k = ks, ke
3822  if ( qc(k,i,j) > 0.0_rp ) then
3823  nc(k,i,j) = 70.e6_rp / dens(k,i,j) ! [number/m3] / [kg/m3]
3824  endif
3825  enddo
3826  enddo
3827  enddo
3828 
3829 #endif
3830  return
3831  end subroutine mkinit_rico
3832 
3833  !-----------------------------------------------------------------------------
3835  subroutine mkinit_bomex
3836  use scale_const, only: &
3837  rdry => const_rdry, &
3838  rvap => const_rvap, &
3839  cpdry => const_cpdry, &
3840  cpvap => const_cpvap, &
3841  cl => const_cl
3842  use scale_atmos_hydrometeor, only: &
3844  implicit none
3845 
3846 #ifndef DRY
3847  real(RP):: PERTURB_AMP_PT = 0.1_rp
3848  real(RP):: PERTURB_AMP_QV = 2.5e-5_rp
3849 
3850  namelist / param_mkinit_bomex / &
3851  perturb_amp_pt, &
3852  perturb_amp_qv
3853 
3854  real(RP) :: LHV (KA,IA,JA) ! latent heat of vaporization [J/kg]
3855  real(RP) :: potl(KA,IA,JA) ! liquid potential temperature
3856  real(RP) :: qall ! QV+QC
3857  real(RP) :: fact
3858 
3859  real(RP) :: qdry, Rtot, CPtot
3860 
3861  integer :: ierr
3862  integer :: k, i, j
3863  !---------------------------------------------------------------------------
3864 
3865  log_newline
3866  log_info("MKINIT_BOMEX",*) 'Setup initial state'
3867 
3868  if ( atmos_hydrometeor_dry ) then
3869  log_error("MKINIT_BOMEX",*) 'QV is not registered'
3870  call prc_abort
3871  end if
3872 
3873  rewind(io_fid_conf)
3874  read(io_fid_conf,nml=param_mkinit_bomex,iostat=ierr)
3875  if( ierr < 0 ) then !--- missing
3876  log_info("MKINIT_BOMEX",*) 'Not found namelist. Default used.'
3877  elseif( ierr > 0 ) then !--- fatal error
3878  log_error("MKINIT_BOMEX",*) 'Not appropriate names in namelist PARAM_MKINIT_BOMEX. Check!'
3879  call prc_abort
3880  endif
3881  log_nml(param_mkinit_bomex)
3882 
3883  ! calc in moist condition
3884  do j = jsb, jeb
3885  do i = isb, ieb
3886 
3887  pres_sfc(i,j) = 1015.e2_rp ! [Pa]
3888  pott_sfc(i,j) = 299.1_rp
3889 
3890  do k = ks, ke
3891  !--- potential temperature
3892  if ( cz(k) < 520.0_rp ) then ! below initial cloud top
3893  potl(k,i,j) = 298.7_rp
3894  elseif( cz(k) < 1480.0_rp ) then
3895  fact = ( cz(k)-520.0_rp ) * ( 302.4_rp-298.7_rp ) / ( 1480.0_rp-520.0_rp )
3896  potl(k,i,j) = 298.7_rp + fact
3897  elseif( cz(k) < 2000.0_rp ) then
3898  fact = ( cz(k)-1480.0_rp ) * ( 308.2_rp-302.4_rp ) / ( 2000.0_rp-1480.0_rp )
3899  potl(k,i,j) = 302.4_rp + fact
3900  else
3901  fact = ( cz(k)-2000.0_rp ) * 3.65e-3_rp
3902  potl(k,i,j) = 308.2_rp + fact
3903  endif
3904 
3905  !--- horizontal wind velocity
3906  if ( cz(k) <= 700.0_rp ) then ! below initial cloud top
3907  velx(k,i,j) = -8.75_rp
3908  vely(k,i,j) = 0.0_rp
3909  else
3910  fact = 1.8e-3_rp * ( cz(k)-700.0_rp )
3911  velx(k,i,j) = -8.75_rp + fact
3912  vely(k,i,j) = 0.0_rp
3913  endif
3914  enddo
3915 
3916  enddo
3917  enddo
3918 
3919  ! make density & pressure profile in moist condition
3920  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3921  potl(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3922  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3923  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3924  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3925 
3926 
3927  do j = jsb, jeb
3928  do i = isb, ieb
3929  qv_sfc(i,j) = 22.45e-3_rp ! [kg/kg]
3930 
3931  do k = ks, ke
3932  !--- mixing ratio of vapor
3933  if ( cz(k) <= 520.0_rp ) then ! below initial cloud top
3934  fact = ( cz(k)-0.0_rp ) * ( 16.3e-3_rp-17.0e-3_rp ) / ( 520.0_rp-0.0_rp )
3935  qall = 17.0e-3_rp + fact
3936  elseif ( cz(k) <= 1480.0_rp ) then ! boundary
3937  fact = ( cz(k)-520.0_rp ) * ( 10.7e-3_rp-16.3e-3_rp ) / ( 1480.0_rp-520.0_rp )
3938  qall = 16.3e-3_rp + fact
3939  elseif( cz(k) <= 2000.0_rp ) then
3940  fact = ( cz(k)-1480.0_rp ) * ( 4.2e-3_rp-10.7e-3_rp ) / ( 2000.0_rp-1480.0_rp )
3941  qall = 10.7e-3_rp + fact
3942  else
3943  fact = ( cz(k)-2000.0_rp ) * ( -1.2e-6_rp )
3944  qall = 4.2e-3_rp + fact
3945  endif
3946 
3947  qv(k,i,j) = qall - qc(k,i,j)
3948  enddo
3949 
3950  enddo
3951  enddo
3952 
3953  call hydrometeor_lhv( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3954  temp(:,:,:), lhv(:,:,:) )
3955 
3956  do j = jsb, jeb
3957  do i = isb, ieb
3958  do k = ks, ke
3959  qdry = 1.0_rp - qv(k,i,j) - qc(k,i,j)
3960  rtot = rdry * qdry + rvap * qv(k,i,j)
3961  cptot = cpdry * qdry + cpvap * qv(k,i,j) + cl * qc(k,i,j)
3962  pott(k,i,j) = ( temp(k,i,j) + lhv(k,i,j) / cpdry * qc(k,i,j) ) * ( p00 / pres(k,i,j) )**(rtot/cptot)
3963  enddo
3964  enddo
3965  enddo
3966 
3967  ! make density & pressure profile in moist condition
3968  call hydrostatic_buildrho( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
3969  pott(:,:,:), qv(:,:,:), qc(:,:,:), & ! [IN]
3970  pres_sfc(:,:), pott_sfc(:,:), qv_sfc(:,:), qc_sfc(:,:), & ! [IN]
3971  real_cz(:,:,:), real_fz(:,:,:), area(:,:), & ! [IN]
3972  dens(:,:,:), temp(:,:,:), pres(:,:,:), temp_sfc(:,:) ) ! [OUT]
3973 
3974 
3975  do j = jsb, jeb
3976  do i = isb, ieb
3977  dens( 1:ks-1,i,j) = dens(ks,i,j)
3978  dens(ke+1:ka ,i,j) = dens(ke,i,j)
3979  enddo
3980  enddo
3981 
3982  call comm_vars8( dens(:,:,:), 1 )
3983  call comm_wait ( dens(:,:,:), 1 )
3984 
3985  do j = jsb, jeb
3986  do i = isb, ieb
3987  do k = ks, ke
3988  momz(k,i,j) = 0.0_rp
3989  enddo
3990  enddo
3991  enddo
3992 
3993  do j = jsb, jeb
3994  do i = isb, ieb
3995  do k = ks, ke
3996  momx(k,i,j) = velx(k,i,j) * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
3997  enddo
3998  enddo
3999  enddo
4000 
4001  do j = jsb, jeb
4002  do i = isb, ieb
4003  do k = ks, ke
4004  momy(k,i,j) = vely(k,i,j) * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
4005  enddo
4006  enddo
4007  enddo
4008 
4009  call random_uniform(rndm) ! make random
4010  do j = jsb, jeb
4011  do i = isb, ieb
4012  do k = ks, ke
4013  if( cz(k) <= 1600.0_rp ) then !--- lowest 40 model layer when dz=40m
4014  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)
4015  else
4016  rhot(k,i,j) = pott(k,i,j) * dens(k,i,j)
4017  endif
4018  enddo
4019  enddo
4020  enddo
4021 
4022  call random_uniform(rndm) ! make random
4023  do j = jsb, jeb
4024  do i = isb, ieb
4025  do k = ks, ke
4026  if( cz(k) <= 1600.0_rp ) then !--- lowest 40 model layer when dz=40m
4027  qv(k,i,j) = qv(k,i,j) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp_qv
4028  endif
4029  enddo
4030  enddo
4031  enddo
4032 
4033  do j = jsb, jeb
4034  do i = isb, ieb
4035  do k = ks, ke
4036  if ( qc(k,i,j) > 0.0_rp ) then
4037  nc(k,i,j) = 70.e6_rp / dens(k,i,j) ! [number/m3] / [kg/m3]
4038  endif
4039  enddo
4040  enddo
4041  enddo
4042 
4043 #endif
4044  return
4045  end subroutine mkinit_bomex
4046 
4047  !-----------------------------------------------------------------------------
4049  subroutine mkinit_oceancouple
4050  implicit none
4051 
4052  log_newline
4053  log_info("MKINIT_oceancouple",*) 'Setup initial state'
4054 
4055  call flux_setup
4056 
4057  call ocean_setup
4058 
4059  return
4060  end subroutine mkinit_oceancouple
4061 
4062  !-----------------------------------------------------------------------------
4064  subroutine mkinit_landcouple
4065  implicit none
4066 
4067  log_newline
4068  log_info("MKINIT_landcouple",*) 'Setup initial state'
4069 
4070  call flux_setup
4071 
4072  call land_setup
4073 
4074  return
4075  end subroutine mkinit_landcouple
4076 
4077  !-----------------------------------------------------------------------------
4079  subroutine mkinit_urbancouple
4080  implicit none
4081 
4082  log_newline
4083  log_info("MKINIT_urbancouple",*) 'Setup initial state'
4084 
4085  call flux_setup
4086 
4087  call urban_setup
4088 
4089  return
4090  end subroutine mkinit_urbancouple
4091 
4092  !-----------------------------------------------------------------------------
4094  subroutine mkinit_seabreeze
4095  use scale_prc_cartesc, only: &
4096  prc_num_x
4097  use scale_landuse, only: &
4101  use scale_atmos_grid_cartesc, only: &
4102  domain_center_x => atmos_grid_cartesc_domain_center_x
4103  use scale_land_grid_cartesc_real, only: &
4105  use scale_ocean_grid_cartesc_real, only: &
4107  implicit none
4108 
4109  real(RP) :: LAND_SIZE
4110 
4111  namelist / param_mkinit_seabreeze / &
4112  land_size
4113 
4114  integer :: ierr
4115  integer :: i, j
4116  !---------------------------------------------------------------------------
4117 
4118  log_newline
4119  log_info("MKINIT_seabreeze",*) 'Setup initial state'
4120 
4121  land_size = 0.0_rp
4122 
4123  !--- read namelist
4124  rewind(io_fid_conf)
4125  read(io_fid_conf,nml=param_mkinit_seabreeze,iostat=ierr)
4126 
4127  if( ierr < 0 ) then !--- missing
4128  log_info("MKINIT_seabreeze",*) 'Not found namelist. Default used.'
4129  elseif( ierr > 0 ) then !--- fatal error
4130  log_error("MKINIT_seabreeze",*) 'Not appropriate names in namelist PARAM_MKINIT_SEABREEZE. Check!'
4131  call prc_abort
4132  endif
4133  log_nml(param_mkinit_seabreeze)
4134 
4135  call flux_setup
4136 
4137  call land_setup
4138 
4139  call ocean_setup
4140 
4141  ! make landuse conditions
4142  do j = jsb, jeb
4143  do i = isb, ieb
4144  if ( abs( cx(i) - domain_center_x ) < land_size ) then
4145  landuse_frac_land(i,j) = 1.0_rp
4146  else
4147  landuse_frac_land(i,j) = 0.0_rp
4148  endif
4149  enddo
4150  enddo
4151 
4152  ! calculate landuse factors
4153  call landuse_fillhalo( fill_bnd=.true. )
4154  call landuse_calc_fact
4155 
4158 
4159  return
4160  end subroutine mkinit_seabreeze
4161 
4162  !-----------------------------------------------------------------------------
4164  subroutine mkinit_heatisland
4165  use scale_prc_cartesc, only: &
4166  prc_num_x
4167  use scale_landuse, only: &
4172  implicit none
4173 
4174  real(RP) :: dist
4175 
4176  integer :: i, j
4177  !---------------------------------------------------------------------------
4178 
4179  log_newline
4180  log_info("MKINIT_heatisland",*) 'Setup initial state'
4181 
4182  call flux_setup
4183 
4184  call land_setup
4185 
4186  call urban_setup
4187 
4188  ! 1/9 size of domain
4189  dist = ( cxg(imax*prc_num_x) - cxg(1) ) / 9.0_rp
4190 
4191  ! make landuse conditions
4192  do j = jsb, jeb
4193  do i = isb, ieb
4194  if ( cx(i) >= dist * 4.0_rp &
4195  .AND. cx(i) < dist * 5.0_rp ) then
4196  landuse_frac_land(i,j) = 1.0_rp
4197  landuse_frac_urban(i,j) = 1.0_rp
4198  else
4199  landuse_frac_land(i,j) = 1.0_rp
4200  landuse_frac_urban(i,j) = 0.0_rp
4201  endif
4202  enddo
4203  enddo
4204 
4205  ! calculate landuse factors
4206  call landuse_fillhalo( fill_bnd=.true. )
4207  call landuse_calc_fact
4208 
4209  return
4210  end subroutine mkinit_heatisland
4211 
4212  !-----------------------------------------------------------------------------
4214  subroutine mkinit_grayzone
4215  use scale_atmos_hydrometeor, only: &
4217  implicit none
4218 
4219  real(RP) :: RHO(KA)
4220  real(RP) :: VELX(KA)
4221  real(RP) :: VELY(KA)
4222  real(RP) :: POTT(KA)
4223  real(RP) :: QV1D(KA)
4224 
4225  real(RP) :: PERTURB_AMP = 0.0_rp
4226  integer :: RANDOM_LIMIT = 0
4227  integer :: RANDOM_FLAG = 0 ! 0 -> no perturbation
4228  ! 1 -> petrurbation for pt
4229  ! 2 -> perturbation for u, v, w
4230 
4231  namelist / param_mkinit_grayzone / &
4232  perturb_amp, &
4233  random_limit, &
4234  random_flag
4235 
4236  integer :: ierr
4237  integer :: k, i, j
4238  !---------------------------------------------------------------------------
4239 
4240  log_newline
4241  log_info("MKINIT_grayzone",*) 'Setup initial state'
4242 
4243  if ( atmos_hydrometeor_dry ) then
4244  log_error("MKINIT_grayzone",*) 'QV is not registered'
4245  call prc_abort
4246  end if
4247 
4248  !--- read namelist
4249  rewind(io_fid_conf)
4250  read(io_fid_conf,nml=param_mkinit_grayzone,iostat=ierr)
4251 
4252  if( ierr < 0 ) then !--- missing
4253  log_info("MKINIT_grayzone",*) 'Not found namelist. Default used.'
4254  elseif( ierr > 0 ) then !--- fatal error
4255  log_error("MKINIT_grayzone",*) 'Not appropriate names in namelist PARAM_MKINIT_GRAYZONE. Check!'
4256  call prc_abort
4257  endif
4258  log_nml(param_mkinit_grayzone)
4259 
4260  call read_sounding( rho, velx, vely, pott, qv1d ) ! (out)
4261 
4262 ! do j = JS, JE
4263 ! do i = IS, IE
4264  do j = 1, ja
4265  do i = 1, ia
4266  do k = ks, ke
4267  dens(k,i,j) = rho(k)
4268 ! MOMZ(k,i,j) = 0.0_RP
4269 ! MOMX(k,i,j) = RHO(k) * VELX(k)
4270 ! MOMY(k,i,j) = RHO(k) * VELY(k)
4271 
4272 ! RHOT(k,i,j) = RHO(k) * POTT(k)
4273  qv(k,i,j) = qv1d(k)
4274  enddo
4275  enddo
4276  enddo
4277 
4278  do j = jsb, jeb
4279  do i = isb, ieb
4280  dens( 1:ks-1,i,j) = dens(ks,i,j)
4281  dens(ke+1:ka, i,j) = dens(ke,i,j)
4282  enddo
4283  enddo
4284 
4285  call random_uniform(rndm) ! make random
4286  do j = jsb, jeb
4287  do i = isb, ieb
4288  do k = ks, ke
4289  if ( random_flag == 2 .and. k <= random_limit ) then ! below initial cloud top
4290  momz(k,i,j) = ( ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4291  * 0.5_rp * ( dens(k+1,i,j) + dens(k,i,j) )
4292  else
4293  momz(k,i,j) = 0.0_rp
4294  endif
4295  enddo
4296  enddo
4297  enddo
4298 
4299  call random_uniform(rndm) ! make random
4300  do j = jsb, jeb
4301  do i = isb, ieb
4302  do k = ks, ke
4303  if ( random_flag == 2 .AND. k <= random_limit ) then ! below initial cloud top
4304  momx(k,i,j) = ( velx(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4305  * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
4306  else
4307  momx(k,i,j) = velx(k) * 0.5_rp * ( dens(k,i+1,j) + dens(k,i,j) )
4308  endif
4309  enddo
4310  enddo
4311  enddo
4312 
4313  call random_uniform(rndm) ! make random
4314  do j = jsb, jeb
4315  do i = isb, ieb
4316  do k = ks, ke
4317  if ( random_flag == 2 .AND. k <= random_limit ) then ! below initial cloud top
4318  momy(k,i,j) = ( vely(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4319  * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
4320  else
4321  momy(k,i,j) = vely(k) * 0.5_rp * ( dens(k,i,j+1) + dens(k,i,j) )
4322  endif
4323  enddo
4324  enddo
4325  enddo
4326 
4327  call random_uniform(rndm) ! make random
4328  do j = jsb, jeb
4329  do i = isb, ieb
4330  do k = ks, ke
4331  if ( random_flag == 1 .and. k <= random_limit ) then ! below initial cloud top
4332  rhot(k,i,j) = ( pott(k) + ( rndm(k,i,j) * 2.0_rp - 1.0_rp ) * perturb_amp ) &
4333  * dens(k,i,j)
4334  else
4335  rhot(k,i,j) = pott(k) * dens(k,i,j)
4336  endif
4337  enddo
4338  enddo
4339  enddo
4340 
4341  return
4342  end subroutine mkinit_grayzone
4343 
4344  !-----------------------------------------------------------------------------
4346  subroutine mkinit_boxaero
4347  use scale_const, only: &
4348  rdry => const_rdry, &
4349  rvap => const_rvap, &
4350  cvdry => const_cvdry, &
4351  cvvap => const_cvvap, &
4352  cpdry => const_cpdry, &
4353  cpvap => const_cpvap
4354  use scale_atmos_hydrometeor, only: &
4356  use scale_atmos_thermodyn, only: &
4357  atmos_thermodyn_rhot2temp_pres
4358  use mod_atmos_admin, only: &
4360  implicit none
4361 
4362  real(RP) :: init_dens = 1.12_rp ![kg/m3]
4363  real(RP) :: init_temp = 298.18_rp ![K]
4364  real(RP) :: init_pres = 1.e+5_rp ![Pa]
4365  real(RP) :: init_ssliq = 0.01_rp ![%]
4366 
4367  namelist / param_mkinit_boxaero / &
4368  init_dens, &
4369  init_temp, &
4370  init_pres, &
4371  init_ssliq
4372 
4373  real(RP) :: rtot (KA,IA,JA)
4374  real(RP) :: cvtot(KA,IA,JA)
4375  real(RP) :: cptot(KA,IA,JA)
4376  real(RP) :: qdry
4377  real(RP) :: psat, qsat
4378  integer :: i, j, k, ierr
4379  !---------------------------------------------------------------------------
4380 
4381  if ( atmos_phy_ae_type /= 'KAJINO13' ) then
4382  log_info("MKINIT_boxaero",*) 'For [Box model of aerosol],'
4383  log_info("MKINIT_boxaero",*) 'ATMOS_PHY_AE_TYPE should be KAJINO13. Stop! ', trim(atmos_phy_ae_type)
4384  call prc_abort
4385  endif
4386 
4387  if ( atmos_hydrometeor_dry ) then
4388  log_error("MKINIT_boxaero",*) 'QV is not registered'
4389  call prc_abort
4390  end if
4391 
4392  log_newline
4393  log_info("MKINIT_boxaero",*) 'Setup initial state'
4394 
4395  !--- read namelist
4396  rewind(io_fid_conf)
4397  read(io_fid_conf,nml=param_mkinit_boxaero,iostat=ierr)
4398  if( ierr < 0 ) then !--- missing
4399  log_info("MKINIT_boxaero",*) 'Not found namelist. Default used.'
4400  elseif( ierr > 0 ) then !--- fatal error
4401  log_error("MKINIT_boxaero",*) 'Not appropriate names in namelist PARAM_MKINIT_BOXAERO. Check!'
4402  call prc_abort
4403  endif
4404  log_nml(param_mkinit_boxaero)
4405 
4406  call saturation_psat_all( init_temp, psat )
4407  qsat = epsvap * psat / ( init_pres - ( 1.0_rp-epsvap ) * psat )
4408 
4409  do j = 1, ja
4410  do i = 1, ia
4411  do k = 1, ka
4412  dens(k,i,j) = init_dens
4413  momx(k,i,j) = 0.0_rp
4414  momy(k,i,j) = 0.0_rp
4415  momz(k,i,j) = 0.0_rp
4416  pott(k,i,j) = init_temp * ( p00/init_pres )**(rdry/cpdry)
4417  rhot(k,i,j) = init_dens * pott(k,i,j)
4418 
4419  qv(k,i,j) = ( init_ssliq + 1.0_rp ) * qsat
4420 
4421  qdry = 1.0 - qv(k,i,j)
4422  rtot(k,i,j) = rdry * qdry + rvap * qv(i,i,j)
4423  cvtot(k,i,j) = cvdry * qdry + cvvap * qv(i,i,j)
4424  cptot(k,i,j) = cpdry * qdry + cpvap * qv(i,i,j)
4425  enddo
4426  enddo
4427  enddo
4428 
4429  call atmos_thermodyn_rhot2temp_pres( ka, 1, ka, ia, 1, ia, ja, 1, ja, &
4430  dens(:,:,:), rhot(:,:,:), & ! (in)
4431  rtot(:,:,:), cvtot(:,:,:), cptot(:,:,:), & ! (in)
4432  temp(:,:,:), pres(:,:,:) ) ! (out)
4433 
4434  return
4435  end subroutine mkinit_boxaero
4436 
4437  !-----------------------------------------------------------------------------
4439  subroutine mkinit_warmbubbleaero
4440  use scale_atmos_hydrometeor, only: &
4442  implicit none
4443 
4444  ! Surface state
4445  real(RP) :: SFC_THETA ! surface potential temperature [K]
4446  real(RP) :: SFC_PRES ! surface pressure [Pa]
4447  real(RP) :: SFC_RH = 80.0_rp ! surface relative humidity [%]
4448  ! Environment state
4449  real(RP) :: ENV_U = 0.0_rp ! velocity u of environment [m/s]
4450  real(RP) :: ENV_V = 0.0_rp ! velocity v of environment [m/s]
4451  real(RP) :: ENV_RH = 80.0_rp ! Relative Humidity of environment [%]
4452  real(RP) :: ENV_L1_ZTOP = 1.e3_rp ! top height of the layer1 (constant THETA) [m]
4453  real(RP) :: ENV_L2_ZTOP = 14.e3_rp ! top height of the layer2 (small THETA gradient) [m]
4454  real(RP) :: ENV_L2_TLAPS = 4.e-3_rp ! Lapse rate of THETA in the layer2 (small THETA gradient) [K/m]
4455  real(RP) :: ENV_L3_TLAPS = 3.e-2_rp ! Lapse rate of THETA in the layer3 (large THETA gradient) [K/m]
4456  ! Bubble
4457  real(RP) :: BBL_THETA = 1.0_rp ! extremum of temperature in bubble [K]
4458 
4459  namelist / param_mkinit_warmbubble / &
4460  sfc_theta, &
4461  sfc_pres, &
4462  env_u, &
4463  env_v, &
4464  env_rh, &
4465  env_l1_ztop, &
4466  env_l2_ztop, &
4467  env_l2_tlaps, &
4468  env_l3_tlaps, &
4469  bbl_theta
4470 
4471  integer :: ierr
4472  integer :: k, i, j
4473  !---------------------------------------------------------------------------
4474 
4475  log_newline
4476  log_info("MKINIT_warmbubbleaero",*) 'Setup initial state'
4477 
4478  if ( atmos_hydrometeor_dry ) then
4479  log_error("MKINIT_warmbubbleaero",*) 'QV is not registerd'
4480  call prc_abort
4481  end if
4482 
4483 
4484  sfc_theta = thetastd
4485  sfc_pres = pstd
4486 
4487  !--- read namelist
4488  rewind(io_fid_conf)
4489  read(io_fid_conf,nml=param_mkinit_warmbubble,iostat=ierr)
4490 
4491  if( ierr < 0 ) then !--- missing
4492  log_info("MKINIT_warmbubbleaero",*) 'Not found namelist. Default used.'
4493  elseif( ierr > 0 ) then !--- fatal error
4494  log_error("MKINIT_warmbubbleaero",*) 'Not appropriate names in namelist PARAM_MKINIT_WARMBUBBLE. Check!'
4495  call prc_abort
4496  endif
4497  log_nml(param_mkinit_warmbubble)
4498 
4499  ! calc in dry condition
4500  pres_sfc(1,1) = sfc_pres
4501  pott_sfc(1,1) = sfc_theta
4502 
4503  do k = ks, ke
4504  if ( cz(k) <= env_l1_ztop ) then ! Layer 1
4505  pott(k,1,1) = sfc_theta
4506  elseif( cz(k) < env_l2_ztop ) then ! Layer 2
4507  pott(k,1,1) = pott(k-1,1,1) + env_l2_tlaps * ( cz(k)-cz(k-1) )
4508  else ! Layer 3
4509  pott(k,1,1) = pott(k-1,1,1) + env_l3_tlaps * ( cz(k)-cz(k-1) )
4510  endif
4511  enddo
4512 
4513  ! make density & pressure profile in dry condition
4514  call hydrostatic_buildrho( ka, ks, ke, &
4515  pott(:,1,1), qv(:,1,1), qc(:,1,1), & ! [IN]
4516  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
4517  cz(:), fz(:), & ! [IN]
4518  dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1) ) ! [OUT]
4519 
4520  ! calc QV from RH
4521  call saturation_psat_all( temp_sfc(1,1), psat_sfc(1,1) ) ! [IN], [OUT]
4522  qsat_sfc(1,1) = epsvap * psat_sfc(1,1) / ( pres_sfc(1,1) - ( 1.0_rp-epsvap ) * psat_sfc(1,1) )
4523 
4524  qdry(:,1,1) = 1.0_rp - qv(:,1,1) - qc(:,1,1)
4525  call saturation_pres2qsat_all( ka, ks, ke, &
4526  temp(:,1,1), pres(:,1,1), qdry(:,1,1), & ! [IN]
4527  qsat(:,1,1) ) ! [OUT]
4528  qv_sfc(1,1) = sfc_rh * 1.e-2_rp * qsat_sfc(1,1)
4529  do k = ks, ke
4530  if ( cz(k) <= env_l1_ztop ) then ! Layer 1
4531  qv(k,1,1) = env_rh * 1.e-2_rp * qsat(k,1,1)
4532  elseif( cz(k) <= env_l2_ztop ) then ! Layer 2
4533  qv(k,1,1) = env_rh * 1.e-2_rp * qsat(k,1,1)
4534  else ! Layer 3
4535  qv(k,1,1) = 0.0_rp
4536  endif
4537  enddo
4538 
4539  ! make density & pressure profile in moist condition
4540  call hydrostatic_buildrho( ka, ks, ke, &
4541  pott(:,1,1), qv(:,1,1), qc(:,1,1), & ! [IN]
4542  pres_sfc(1,1), pott_sfc(1,1), qv_sfc(1,1), qc_sfc(1,1), & ! [IN]
4543  cz(:), fz(:), & ! [IN]
4544  dens(:,1,1), temp(:,1,1), pres(:,1,1), temp_sfc(1,1) ) ! [OUT]
4545 
4546  do j = jsb, jeb
4547  do i = isb, ieb
4548  do k = ks, ke
4549  dens(k,i,j) = dens(k,1,1)
4550  momz(k,i,j) = 0.0_rp
4551  momx(k,i,j) = env_u * dens(k,i,j)
4552  momy(k,i,j) = env_v * dens(k,i,j)
4553 
4554  ! make warm bubble
4555  rhot(k,i,j) = dens(k,1,1) * ( pott(k,1,1) + bbl_theta * bubble(k,i,j) )
4556 
4557  qv(k,i,j) = qv(k,1,1)
4558  enddo
4559  enddo
4560  enddo
4561 
4562  call flux_setup
4563 
4564  return
4565  end subroutine mkinit_warmbubbleaero
4566 
4567  !-----------------------------------------------------------------------------
4569  subroutine mkinit_real
4570  use mod_realinput, only: &
4571  realinput_atmos, &
4573  implicit none
4574 
4575  call prof_rapstart('__Real_Atmos',2)
4576 
4577  call realinput_atmos
4578 
4579  call prof_rapend ('__Real_Atmos',2)
4580  call prof_rapstart('__Real_Surface',2)
4581 
4582  call realinput_surface
4583 
4584  call prof_rapend ('__Real_Surface',2)
4585 
4586  call flux_setup
4587 
4588  return
4589  end subroutine mkinit_real
4590 
4591 end module mod_mkinit
scale_const::const_grav
real(rp), public const_grav
standard acceleration of gravity [m/s2]
Definition: scale_const.F90:46
mod_mkinit::i_tracerbubble
integer, parameter, public i_tracerbubble
Definition: mod_mkinit.F90:92
scale_atmos_grid_cartesc_index::isb
integer, public isb
Definition: scale_atmos_grid_cartesC_index.F90:63
scale_atmos_phy_ae_kajino13
module atmosphere / physics / aerosol / Kajino13
Definition: scale_atmos_phy_ae_kajino13.F90:12
mod_mkinit::mkinit_type
integer, public mkinit_type
Definition: mod_mkinit.F90:88
mod_mkinit::i_cavityflow
integer, parameter, public i_cavityflow
Definition: mod_mkinit.F90:128
mod_atmos_phy_mp_vars
module Atmosphere / Physics Cloud Microphysics
Definition: mod_atmos_phy_mp_vars.F90:12
mod_ocean_vars::ocean_ocn_z0m
real(rp), dimension(:,:), allocatable, public ocean_ocn_z0m
surface roughness length for momentum, open ocean [m]
Definition: mod_ocean_vars.F90:65
mod_land_vars::land_temp
real(rp), dimension(:,:,:), allocatable, public land_temp
temperature of each soil layer [K]
Definition: mod_land_vars.F90:61
scale_atmos_grid_cartesc_index::ke
integer, public ke
end point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:52
mod_urban_vars::urban_sfc_temp
real(rp), dimension(:,:), allocatable, public urban_sfc_temp
Definition: mod_urban_vars.F90:74
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
mod_ocean_vars::ocean_ice_temp
real(rp), dimension(:,:), allocatable, public ocean_ice_temp
sea ice temperature [K]
Definition: mod_ocean_vars.F90:73
mod_mkinit::i_boxaero
integer, parameter, public i_boxaero
Definition: mod_mkinit.F90:125
mod_land_vars::snow_sfc_temp
real(rp), dimension(:,:), allocatable, public snow_sfc_temp
snow surface temperature [K]
Definition: mod_land_vars.F90:68
mod_mkinit::land_setup
subroutine land_setup
Land setup.
Definition: mod_mkinit.F90:937
mod_urban_vars::urban_tb
real(rp), dimension(:,:), allocatable, public urban_tb
Definition: mod_urban_vars.F90:64
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_cz
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_cz
geopotential height [m] (zxy)
Definition: scale_atmos_grid_cartesC_real.F90:38
scale_atmos_grid_cartesc_index::ihalo
integer, public ihalo
Definition: scale_atmos_grid_cartesC_index.F90:44
mod_ocean_vars::ocean_sfc_z0e
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0e
ocean surface roughness length for vapor [m]
Definition: mod_ocean_vars.F90:71
scale_landuse::landuse_calc_fact
subroutine, public landuse_calc_fact
Definition: scale_landuse.F90:239
scale_const::const_epsvap
real(rp), public const_epsvap
Rdry / Rvap.
Definition: scale_const.F90:69
mod_land_vars::land_sfc_albedo
real(rp), dimension(:,:,:,:), allocatable, public land_sfc_albedo
land surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
Definition: mod_land_vars.F90:65
scale_atmos_hydrometeor::qhs
integer, public qhs
Definition: scale_atmos_hydrometeor.F90:115
scale_tracer::tracer_inq_id
subroutine, public tracer_inq_id(NAME, ID)
Inquire tracer ID.
Definition: scale_tracer.F90:175
scale_const::const_undef8
real(dp), parameter, public const_undef8
undefined value (REAL8)
Definition: scale_const.F90:40
scale_precision
module PRECISION
Definition: scale_precision.F90:14
scale_atmos_grid_cartesc_index::ka
integer, public ka
Definition: scale_atmos_grid_cartesC_index.F90:47
mod_ocean_vars::ice_flag
logical, public ice_flag
Definition: mod_ocean_vars.F90:141
mod_atmos_admin
module ATMOS admin
Definition: mod_atmos_admin.F90:11
mod_mkinit::faero
real(rp) function faero(f0, r0, x, alpha, rhoa)
Definition: mod_mkinit.F90:861
mod_urban_vars::urban_sfc_albedo
real(rp), dimension(:,:,:,:), allocatable, public urban_sfc_albedo
Definition: mod_urban_vars.F90:75
mod_mkinit::i_grayzone
integer, parameter, public i_grayzone
Definition: mod_mkinit.F90:124
mod_mkinit::i_warmbubbleaero
integer, parameter, public i_warmbubbleaero
Definition: mod_mkinit.F90:126
mod_atmos_phy_mp_vars::qs_mp
integer, public qs_mp
Definition: mod_atmos_phy_mp_vars.F90:78
mod_mkinit::i_wk1982
integer, parameter, public i_wk1982
Definition: mod_mkinit.F90:104
scale_const::const_rvap
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
Definition: scale_const.F90:63
scale_atmos_profile
module atmosphere / vertical profile
Definition: scale_atmos_profile.F90:12
mod_land_vars::land_water
real(rp), dimension(:,:,:), allocatable, public land_water
moisture of each soil layer [m3/m3]
Definition: mod_land_vars.F90:62
mod_mkinit::i_landcouple
integer, parameter, public i_landcouple
Definition: mod_mkinit.F90:111
scale_cpl_sfc_index::i_r_ir
integer, parameter, public i_r_ir
Definition: scale_cpl_sfc_index.F90:29
scale_const::const_eps
real(rp), public const_eps
small number
Definition: scale_const.F90:33
scale_prof::prof_rapstart
subroutine, public prof_rapstart(rapname_base, level, disable_barrier)
Start raptime.
Definition: scale_prof.F90:159
mod_urban_vars::urban_trl
real(rp), dimension(:,:,:), allocatable, public urban_trl
Definition: mod_urban_vars.F90:60
scale_atmos_hydrometeor
module atmosphere / hydrometeor
Definition: scale_atmos_hydrometeor.F90:12
scale_atmos_grid_cartesc::atmos_grid_cartesc_fyg
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fyg
face coordinate [m]: y, global
Definition: scale_atmos_grid_cartesC.F90:78
scale_atmos_grid_cartesc::atmos_grid_cartesc_fx
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fx
face coordinate [m]: x, local
Definition: scale_atmos_grid_cartesC.F90:57
mod_atmos_phy_rd_vars
module Atmosphere / Physics Radiation
Definition: mod_atmos_phy_rd_vars.F90:12
mod_atmos_phy_mp_vars::atmos_phy_mp_sflx_rain
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_rain
Definition: mod_atmos_phy_mp_vars.F90:73
mod_urban_vars::urban_raing
real(rp), dimension(:,:), allocatable, public urban_raing
Definition: mod_urban_vars.F90:71
scale_random
module RANDOM
Definition: scale_random.F90:11
scale_atmos_phy_mp_suzuki10::nbin
integer, public nbin
Definition: scale_atmos_phy_mp_suzuki10.F90:136
scale_io::io_get_available_fid
integer function, public io_get_available_fid()
search & get available file ID
Definition: scale_io.F90:321
mod_urban_vars::urban_qc
real(rp), dimension(:,:), allocatable, public urban_qc
Definition: mod_urban_vars.F90:67
mod_ocean_vars::ocean_sfc_z0m
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0m
ocean surface roughness length for momentum [m]
Definition: mod_ocean_vars.F90:69
scale_atmos_hydrometeor::atmos_hydrometeor_dry
logical, public atmos_hydrometeor_dry
Definition: scale_atmos_hydrometeor.F90:97
mod_mkinit::flux_setup
subroutine flux_setup
flux setup
Definition: mod_mkinit.F90:880
mod_mkinit::i_seabreeze
integer, parameter, public i_seabreeze
Definition: mod_mkinit.F90:117
mod_atmos_vars::rhot
real(rp), dimension(:,:,:), allocatable, target, public rhot
Definition: mod_atmos_vars.F90:79
scale_atmos_grid_cartesc_real
module Atmosphere GRID CartesC Real(real space)
Definition: scale_atmos_grid_cartesC_real.F90:11
mod_atmos_vars::qtrc
real(rp), dimension(:,:,:,:), allocatable, target, public qtrc
Definition: mod_atmos_vars.F90:80
scale_atmos_grid_cartesc_index::imax
integer, public imax
Definition: scale_atmos_grid_cartesC_index.F90:37
scale_atmos_grid_cartesc::atmos_grid_cartesc_domain_center_y
real(rp), public atmos_grid_cartesc_domain_center_y
center position of global domain [m]: y
Definition: scale_atmos_grid_cartesC.F90:91
scale_atmos_grid_cartesc_index::jeb
integer, public jeb
Definition: scale_atmos_grid_cartesC_index.F90:66
mod_mkinit::i_dycoms2_rf02_dns
integer, parameter, public i_dycoms2_rf02_dns
Definition: mod_mkinit.F90:120
mod_atmos_phy_mp_driver
module atmosphere / physics / cloud microphysics
Definition: mod_atmos_phy_mp_driver.F90:12
scale_const::const_cpvap
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
Definition: scale_const.F90:64
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_const::const_pi
real(rp), public const_pi
pi
Definition: scale_const.F90:31
scale_precision::rp
integer, parameter, public rp
Definition: scale_precision.F90:41
mod_mkinit::read_sounding
subroutine read_sounding(DENS, VELX, VELY, POTT, QV)
Read sounding data from file.
Definition: mod_mkinit.F90:1258
scale_landuse::landuse_frac_urban
real(rp), dimension(:,:), allocatable, public landuse_frac_urban
urban fraction
Definition: scale_landuse.F90:55
scale_atmos_grid_cartesc_index::ie
integer, public ie
end point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:54
mod_mkinit::mkinit
subroutine, public mkinit(output)
Driver.
Definition: mod_mkinit.F90:345
scale_io
module STDIO
Definition: scale_io.F90:10
scale_const::const_pstd
real(rp), public const_pstd
standard pressure [Pa]
Definition: scale_const.F90:87
scale_atmos_grid_cartesc_index::jag
integer, public jag
Definition: scale_atmos_grid_cartesC_index.F90:74
mod_atmos_phy_rd_vars::atmos_phy_rd_sflx_lw_dn
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_lw_dn
Definition: mod_atmos_phy_rd_vars.F90:61
mod_realinput::realinput_surface
subroutine, public realinput_surface
Definition: mod_realinput.F90:477
scale_atmos_grid_cartesc_index::iag
integer, public iag
Definition: scale_atmos_grid_cartesC_index.F90:73
mod_atmos_phy_bl_vars
module atmosphere / physics / PBL
Definition: mod_atmos_phy_bl_vars.F90:12
mod_atmos_phy_rd_vars::atmos_phy_rd_sflx_sw_dn
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_sw_dn
Definition: mod_atmos_phy_rd_vars.F90:63
mod_atmos_vars::dens
real(rp), dimension(:,:,:), allocatable, target, public dens
Definition: mod_atmos_vars.F90:75
scale_cpl_sfc_index::i_r_nir
integer, parameter, public i_r_nir
Definition: scale_cpl_sfc_index.F90:30
scale_ocean_grid_cartesc_real::ocean_grid_cartesc_real_set_areavol
subroutine, public ocean_grid_cartesc_real_set_areavol
Definition: scale_ocean_grid_cartesC_real.F90:63
mod_ocean_vars::ocean_sfc_z0h
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0h
ocean surface roughness length for heat [m]
Definition: mod_ocean_vars.F90:70
scale_atmos_grid_cartesc::atmos_grid_cartesc_cxg
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cxg
center coordinate [m]: x, global
Definition: scale_atmos_grid_cartesC.F90:75
mod_mkinit::i_ignore
integer, parameter, public i_ignore
Definition: mod_mkinit.F90:89
scale_atmos_hydrometeor::qhe
integer, public qhe
Definition: scale_atmos_hydrometeor.F90:116
scale_tracer::k
real(rp), public k
Definition: scale_tracer.F90:44
scale_atmos_grid_cartesc::atmos_grid_cartesc_domain_center_x
real(rp), public atmos_grid_cartesc_domain_center_x
center position of global domain [m]: x
Definition: scale_atmos_grid_cartesC.F90:90
scale_atmos_grid_cartesc_index
module atmosphere / grid / cartesC index
Definition: scale_atmos_grid_cartesC_index.F90:12
scale_const
module CONSTANT
Definition: scale_const.F90:11
scale_atmos_grid_cartesc_index::ia
integer, public ia
Definition: scale_atmos_grid_cartesC_index.F90:48
mod_ocean_vars::ocean_uvel
real(rp), dimension(:,:,:), allocatable, public ocean_uvel
ocean zonal velocity [m/s]
Definition: mod_ocean_vars.F90:62
mod_atmos_phy_rd_vars::atmos_phy_rd_sflx_sw_up
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_sw_up
Definition: mod_atmos_phy_rd_vars.F90:62
mod_atmos_phy_ae_vars::qa_ae
integer, public qa_ae
Definition: mod_atmos_phy_ae_vars.F90:66
mod_atmos_phy_rd_vars::atmos_phy_rd_sflx_lw_up
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_lw_up
Definition: mod_atmos_phy_rd_vars.F90:60
mod_mkinit::i_real
integer, parameter, public i_real
Definition: mod_mkinit.F90:122
scale_landuse::landuse_frac_land
real(rp), dimension(:,:), allocatable, public landuse_frac_land
land fraction
Definition: scale_landuse.F90:54
mod_atmos_vars::momz
real(rp), dimension(:,:,:), allocatable, target, public momz
Definition: mod_atmos_vars.F90:76
mod_urban_vars::urban_tgl
real(rp), dimension(:,:,:), allocatable, public urban_tgl
Definition: mod_urban_vars.F90:62
mod_atmos_phy_tb_vars
module Atmosphere / Physics Turbulence
Definition: mod_atmos_phy_tb_vars.F90:12
scale_const::const_cvdry
real(rp), public const_cvdry
specific heat (dry air,constant volume) [J/kg/K]
Definition: scale_const.F90:57
scale_land_grid_cartesc_real
module land / grid / cartesianC / real
Definition: scale_land_grid_cartesC_real.F90:11
mod_mkinit::i_dycoms2_rf01
integer, parameter, public i_dycoms2_rf01
Definition: mod_mkinit.F90:105
scale_atmos_grid_cartesc::atmos_grid_cartesc_fy
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fy
face coordinate [m]: y, local
Definition: scale_atmos_grid_cartesC.F90:58
mod_mkinit::i_interporation
integer, parameter, public i_interporation
Definition: mod_mkinit.F90:109
mod_mkinit::i_heatisland
integer, parameter, public i_heatisland
Definition: mod_mkinit.F90:118
mod_land_vars
module LAND Variables
Definition: mod_land_vars.F90:11
scale_prc_cartesc
module process / cartesC
Definition: scale_prc_cartesC.F90:11
scale_const::const_cpdry
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
Definition: scale_const.F90:56
scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_mkinit
subroutine, public atmos_phy_ae_kajino13_mkinit(KA, KS, KE, IA, IS, IE, JA, JS, JE, QA_AE, DENS, TEMP, PRES, QDRY, QV, m0_init, dg_init, sg_init, d_min_inp, d_max_inp, k_min_inp, k_max_inp, n_kap_inp, QTRC, CCN)
Definition: scale_atmos_phy_ae_kajino13.F90:940
mod_mkinit::tke_setup
subroutine tke_setup
TKE setup.
Definition: mod_mkinit.F90:1190
scale_atmos_phy_ae_offline::atmos_phy_ae_offline_mkinit
subroutine, public atmos_phy_ae_offline_mkinit(KA, KS, KE, IA, IS, IE, JA, JS, JE, ccn_init, CCN)
Definition: scale_atmos_phy_ae_offline.F90:332
mod_atmos_phy_bl_vars::atmos_phy_bl_zi
real(rp), dimension(:,:), allocatable, public atmos_phy_bl_zi
Definition: mod_atmos_phy_bl_vars.F90:64
scale_prof
module profiler
Definition: scale_prof.F90:11
mod_land_vars::snow_nosnowsec
real(rp), dimension(:,:), allocatable, public snow_nosnowsec
sec while no snow [s]
Definition: mod_land_vars.F90:72
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_area
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_area
horizontal area ( xy, normal z) [m2]
Definition: scale_atmos_grid_cartesC_real.F90:65
mod_mkinit::rect_setup
subroutine rect_setup
Bubble.
Definition: mod_mkinit.F90:631
mod_atmos_vars::momx
real(rp), dimension(:,:,:), allocatable, target, public momx
Definition: mod_atmos_vars.F90:77
mod_mkinit::i_urbancouple
integer, parameter, public i_urbancouple
Definition: mod_mkinit.F90:113
scale_atmos_grid_cartesc_index::is
integer, public is
start point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:53
mod_mkinit::i_gravitywave
integer, parameter, public i_gravitywave
Definition: mod_mkinit.F90:96
mod_ocean_vars
module OCEAN Variables
Definition: mod_ocean_vars.F90:12
scale_atmos_grid_cartesc_index::jhalo
integer, public jhalo
Definition: scale_atmos_grid_cartesC_index.F90:45
scale_atmos_phy_ae_offline
module atmosphere / physics / aerosol / offline
Definition: scale_atmos_phy_ae_offline.F90:12
scale_atmos_phy_mp_suzuki10
module Spectran Bin Microphysics
Definition: scale_atmos_phy_mp_suzuki10.F90:23
scale_atmos_grid_cartesc_index::ja
integer, public ja
Definition: scale_atmos_grid_cartesC_index.F90:49
mod_mkinit::i_rico
integer, parameter, public i_rico
Definition: mod_mkinit.F90:107
mod_atmos_vars::momy
real(rp), dimension(:,:,:), allocatable, target, public momy
Definition: mod_atmos_vars.F90:78
mod_mkinit::i_barocwave
integer, parameter, public i_barocwave
Definition: mod_mkinit.F90:129
mod_atmos_admin::atmos_phy_ae_type
character(len=h_short), public atmos_phy_ae_type
Definition: mod_atmos_admin.F90:37
mod_land_vars::snow_swe
real(rp), dimension(:,:), allocatable, public snow_swe
snow water equivalent [kg/m2]
Definition: mod_land_vars.F90:69
scale_atmos_hydrometeor::i_hc
integer, parameter, public i_hc
liquid water cloud
Definition: scale_atmos_hydrometeor.F90:81
mod_atmos_phy_bl_vars::qe
integer, public qe
Definition: mod_atmos_phy_bl_vars.F90:45
mod_mkinit::mkinit_setup
subroutine, public mkinit_setup
Setup.
Definition: mod_mkinit.F90:211
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
mod_mkinit::i_dycoms2_rf02
integer, parameter, public i_dycoms2_rf02
Definition: mod_mkinit.F90:106
mod_urban_vars::urban_tc
real(rp), dimension(:,:), allocatable, public urban_tc
Definition: mod_urban_vars.F90:66
mod_urban_vars::urban_tg
real(rp), dimension(:,:), allocatable, public urban_tg
Definition: mod_urban_vars.F90:65
mod_atmos_phy_ae_vars::atmos_phy_ae_ccn
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn
Definition: mod_atmos_phy_ae_vars.F90:62
scale_atmos_hydrometeor::i_qv
integer, public i_qv
Definition: scale_atmos_hydrometeor.F90:77
mod_mkinit::i_mountainwave
integer, parameter, public i_mountainwave
Definition: mod_mkinit.F90:99
mod_mkinit::i_supercell
integer, parameter, public i_supercell
Definition: mod_mkinit.F90:102
scale_atmos_grid_cartesc::atmos_grid_cartesc_fxg
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fxg
face coordinate [m]: x, global
Definition: scale_atmos_grid_cartesC.F90:77
mod_urban_vars::urban_uc
real(rp), dimension(:,:), allocatable, public urban_uc
Definition: mod_urban_vars.F90:68
mod_realinput::realinput_atmos
subroutine, public realinput_atmos
Definition: mod_realinput.F90:193
mod_realinput
module REAL input
Definition: mod_realinput.F90:11
scale_atmos_grid_cartesc_index::ks
integer, public ks
start point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:51
mod_mkinit::i_bomex
integer, parameter, public i_bomex
Definition: mod_mkinit.F90:130
mod_atmos_phy_tb_vars::i_tke
integer, public i_tke
Definition: mod_atmos_phy_tb_vars.F90:61
mod_land_vars::land_sfc_temp
real(rp), dimension(:,:), allocatable, public land_sfc_temp
land surface skin temperature [K]
Definition: mod_land_vars.F90:64
mod_ocean_vars::ocean_ice_mass
real(rp), dimension(:,:), allocatable, public ocean_ice_mass
sea ice mass [kg]
Definition: mod_ocean_vars.F90:74
scale_atmos_hydrostatic
module atmosphere / hydrostatic barance
Definition: scale_atmos_hydrostatic.F90:12
scale_atmos_grid_cartesc::atmos_grid_cartesc_fz
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fz
face coordinate [m]: z, local
Definition: scale_atmos_grid_cartesC.F90:41
mod_ocean_vars::ocean_vvel
real(rp), dimension(:,:,:), allocatable, public ocean_vvel
ocean meridional velocity [m/s]
Definition: mod_ocean_vars.F90:63
scale_comm_cartesc
module COMMUNICATION
Definition: scale_comm_cartesC.F90:11
scale_const::const_cl
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
Definition: scale_const.F90:66
mod_atmos_vars
module ATMOSPHERIC Variables
Definition: mod_atmos_vars.F90:12
scale_cpl_sfc_index
module coupler / surface-atmospehre
Definition: scale_cpl_sfc_index.F90:11
scale_const::const_cvvap
real(rp), public const_cvvap
specific heat (water vapor, constant volume) [J/kg/K]
Definition: scale_const.F90:65
scale_land_grid_cartesc_real::land_grid_cartesc_real_set_areavol
subroutine, public land_grid_cartesc_real_set_areavol
Definition: scale_land_grid_cartesC_real.F90:62
mod_land_vars::snow_depth
real(rp), dimension(:,:), allocatable, public snow_depth
snow depth [m]
Definition: mod_land_vars.F90:70
scale_const::const_radius
real(rp), public const_radius
radius of the planet [m]
Definition: scale_const.F90:44
mod_mkinit::i_triplecouple
integer, parameter, public i_triplecouple
Definition: mod_mkinit.F90:114
mod_urban_vars::urban_rainb
real(rp), dimension(:,:), allocatable, public urban_rainb
Definition: mod_urban_vars.F90:70
scale_atmos_grid_cartesc_index::js
integer, public js
start point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:55
mod_mkinit::i_bubblecouple
integer, parameter, public i_bubblecouple
Definition: mod_mkinit.F90:115
scale_cpl_sfc_index::i_r_vis
integer, parameter, public i_r_vis
Definition: scale_cpl_sfc_index.F90:31
mod_atmos_phy_ae_vars::qs_ae
integer, public qs_ae
Definition: mod_atmos_phy_ae_vars.F90:67
mod_land_vars::snow_flag
logical, public snow_flag
Definition: mod_land_vars.F90:132
scale_atmos_grid_cartesc::atmos_grid_cartesc_cy
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cy
center coordinate [m]: y, local
Definition: scale_atmos_grid_cartesC.F90:56
mod_ocean_vars::ocean_sfc_albedo
real(rp), dimension(:,:,:,:), allocatable, public ocean_sfc_albedo
ocean surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
Definition: mod_ocean_vars.F90:68
mod_atmos_phy_mp_vars::atmos_phy_mp_sflx_snow
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_snow
Definition: mod_atmos_phy_mp_vars.F90:74
scale_atmos_phy_mp_suzuki10::nccn
integer, public nccn
Definition: scale_atmos_phy_mp_suzuki10.F90:138
mod_mkinit::i_coldbubble
integer, parameter, public i_coldbubble
Definition: mod_mkinit.F90:93
mod_urban_vars::urban_tr
real(rp), dimension(:,:), allocatable, public urban_tr
Definition: mod_urban_vars.F90:63
mod_ocean_vars::ocean_sfc_temp
real(rp), dimension(:,:), allocatable, public ocean_sfc_temp
ocean surface skin temperature [K]
Definition: mod_ocean_vars.F90:67
scale_atmos_grid_cartesc_index::ieb
integer, public ieb
Definition: scale_atmos_grid_cartesC_index.F90:64
mod_mkinit::i_khwave
integer, parameter, public i_khwave
Definition: mod_mkinit.F90:97
mod_atmos_phy_ae_vars
module ATMOSPHERE / Physics Aerosol Microphysics
Definition: mod_atmos_phy_ae_vars.F90:12
mod_mkinit::i_warmbubble
integer, parameter, public i_warmbubble
Definition: mod_mkinit.F90:101
mod_atmos_admin::atmos_phy_mp_type
character(len=h_short), public atmos_phy_mp_type
Definition: mod_atmos_admin.F90:36
scale_atmos_thermodyn
module atmosphere / thermodyn
Definition: scale_atmos_thermodyn.F90:11
scale_const::const_rdry
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
Definition: scale_const.F90:55
mod_urban_vars::urban_roff
real(rp), dimension(:,:), allocatable, public urban_roff
Definition: mod_urban_vars.F90:91
scale_prof::prof_rapend
subroutine, public prof_rapend(rapname_base, level, disable_barrier)
Save raptime.
Definition: scale_prof.F90:217
scale_ocean_grid_cartesc_real
module ocean / grid / cartesianC / real
Definition: scale_ocean_grid_cartesC_real.F90:12
mod_atmos_phy_mp_vars::qe_mp
integer, public qe_mp
Definition: mod_atmos_phy_mp_vars.F90:79
scale_prc_cartesc::prc_num_x
integer, public prc_num_x
x length of 2D processor topology
Definition: scale_prc_cartesC.F90:41
mod_mkinit::urban_setup
subroutine urban_setup
Urban setup.
Definition: mod_mkinit.F90:1092
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_fz
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_fz
geopotential height [m] (wxy)
Definition: scale_atmos_grid_cartesC_real.F90:42
mod_ocean_vars::ocean_salt
real(rp), dimension(:,:,:), allocatable, public ocean_salt
ocean salinity [PSU]
Definition: mod_ocean_vars.F90:61
mod_urban_vars::urban_tbl
real(rp), dimension(:,:,:), allocatable, public urban_tbl
Definition: mod_urban_vars.F90:61
scale_atmos_grid_cartesc
module atmosphere / grid / cartesC
Definition: scale_atmos_grid_cartesC.F90:12
scale_landuse
module LANDUSE
Definition: scale_landuse.F90:19
scale_atmos_grid_cartesc::atmos_grid_cartesc_cz
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cz
center coordinate [m]: z, local
Definition: scale_atmos_grid_cartesC.F90:40
mod_land_vars::land_ice
real(rp), dimension(:,:,:), allocatable, public land_ice
ice of each soil layer [m3/m3]
Definition: mod_land_vars.F90:63
mod_mkinit::i_lambwave
integer, parameter, public i_lambwave
Definition: mod_mkinit.F90:95
scale_atmos_grid_cartesc_index::jsb
integer, public jsb
Definition: scale_atmos_grid_cartesC_index.F90:65
mod_mkinit::ocean_setup
subroutine ocean_setup
Ocean setup.
Definition: mod_mkinit.F90:1007
scale_atmos_saturation
module atmosphere / saturation
Definition: scale_atmos_saturation.F90:12
mod_atmos_phy_mp_driver::atmos_phy_mp_driver_qhyd2qtrc
subroutine, public atmos_phy_mp_driver_qhyd2qtrc(KA, KS, KE, IA, IS, IE, JA, JS, JE, QV, QHYD, QTRC, QNUM)
Definition: mod_atmos_phy_mp_driver.F90:1361
mod_mkinit
module INITIAL
Definition: mod_mkinit.F90:12
scale_const::const_ohm
real(rp), public const_ohm
angular velocity of the planet [1/s]
Definition: scale_const.F90:45
mod_urban_vars::urban_rainr
real(rp), dimension(:,:), allocatable, public urban_rainr
Definition: mod_urban_vars.F90:69
scale_const::const_pre00
real(rp), public const_pre00
pressure reference [Pa]
Definition: scale_const.F90:88
scale_io::io_fid_conf
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:56
scale_atmos_grid_cartesc_index::je
integer, public je
end point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:56
scale_atmos_hydrometeor::n_hyd
integer, parameter, public n_hyd
Definition: scale_atmos_hydrometeor.F90:79
mod_atmos_phy_ae_vars::qe_ae
integer, public qe_ae
Definition: mod_atmos_phy_ae_vars.F90:68
mod_urban_vars
module URBAN Variables
Definition: mod_urban_vars.F90:12
mod_mkinit::i_turbulence
integer, parameter, public i_turbulence
Definition: mod_mkinit.F90:98
mod_land_vars::snow_dzero
real(rp), dimension(:,:), allocatable, public snow_dzero
snow depth at melting point [m]
Definition: mod_land_vars.F90:71
scale_landuse::landuse_fillhalo
subroutine, public landuse_fillhalo(FILL_BND)
HALO Communication.
Definition: scale_landuse.F90:271
scale_atmos_grid_cartesc::atmos_grid_cartesc_cx
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cx
center coordinate [m]: x, local
Definition: scale_atmos_grid_cartesC.F90:55
mod_mkinit::i_planestate
integer, parameter, public i_planestate
Definition: mod_mkinit.F90:91
mod_ocean_vars::ocean_temp
real(rp), dimension(:,:,:), allocatable, public ocean_temp
ocean temperature [K]
Definition: mod_ocean_vars.F90:60
mod_atmos_phy_bl_vars::qs
integer, public qs
Definition: mod_atmos_phy_bl_vars.F90:45
mod_mkinit::i_squallline
integer, parameter, public i_squallline
Definition: mod_mkinit.F90:103
mod_mkinit::i_oceancouple
integer, parameter, public i_oceancouple
Definition: mod_mkinit.F90:112