SCALE-RM
mod_atmos_phy_ae_driver.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
11 #include "scalelib.h"
13  !-----------------------------------------------------------------------------
14  !
15  !++ used modules
16  !
17  use scale_precision
18  use scale_io
19  use scale_prof
21  !-----------------------------------------------------------------------------
22  implicit none
23  private
24  !-----------------------------------------------------------------------------
25  !
26  !++ Public procedure
27  !
32 
33  !-----------------------------------------------------------------------------
34  !
35  !++ Public parameters & variables
36  !
37  !-----------------------------------------------------------------------------
38  !
39  !++ Private procedure
40  !
41  !-----------------------------------------------------------------------------
42  !
43  !++ Private parameters & variables
44  !
45  !-----------------------------------------------------------------------------
46 contains
47  !-----------------------------------------------------------------------------
50  use mod_atmos_admin, only: &
53  use scale_tracer, only: &
55  use scale_atmos_phy_ae_kajino13, only: &
60  use scale_prc, only: &
61  prc_abort
62  use mod_atmos_phy_ae_vars, only: &
63  qa_ae, &
64  qs_ae, &
65  qe_ae
66  implicit none
67 
68  log_newline
69  log_info("ATMOS_PHY_AE_driver_tracer_setup",*) 'Setup'
70 
71  if ( atmos_sw_phy_ae ) then
72  select case ( atmos_phy_ae_type )
73  case ( 'OFF', 'NONE' )
74  log_info("ATMOS_PHY_AE_driver_tracer_setup",*) 'this component is never called.'
75  case ( 'KAJINO13' )
77 
78  call tracer_regist( qs_ae, & ! [OUT]
79  qa_ae, & ! [IN]
80  atmos_phy_ae_kajino13_name(:), & ! [IN]
81  atmos_phy_ae_kajino13_desc(:), & ! [IN]
82  atmos_phy_ae_kajino13_unit(:) ) ! [IN]
83  case ( 'OFFLINE' )
84  log_info("ATMOS_PHY_AE_driver_tracer_setup",*) 'offline aerosol module has no tracers'
85  case default
86  log_error("ATMOS_PHY_AE_driver_tracer_setup",*) 'invalid aerosol type(', atmos_phy_ae_type, '). CHECK!'
87  call prc_abort
88  end select
89 
90  qe_ae = qs_ae + qa_ae - 1
91 
92  else
93  qa_ae = 0
94  qs_ae = -1
95  qe_ae = -2
96  end if
97 
98  return
100 
101  !-----------------------------------------------------------------------------
103  subroutine atmos_phy_ae_driver_setup
104  use mod_atmos_admin, only: &
107  use scale_atmos_phy_ae_kajino13, only: &
109  use scale_atmos_phy_ae_offline, only: &
111  use scale_prc, only: &
112  prc_abort
113  implicit none
114  !---------------------------------------------------------------------------
115 
116  log_newline
117  log_info("ATMOS_PHY_AE_driver_setup",*) 'Setup'
118 
119  if ( atmos_sw_phy_ae ) then
120 
121  select case ( atmos_phy_ae_type )
122  case ( 'KAJINO13' )
124  case ( 'OFFLINE' )
126  case default
127  log_error("ATMOS_PHY_AE_driver_setup",*) 'invalid aerosol type(', atmos_phy_ae_type, '). CHECK!'
128  call prc_abort
129  end select
130 
131  endif
132 
133  return
134  end subroutine atmos_phy_ae_driver_setup
135 
136  !-----------------------------------------------------------------------------
139  use mod_atmos_vars, only: &
140  qtrc
141  use mod_atmos_phy_ae_vars, only: &
142  qa_ae, &
143  qs_ae, &
144  qe_ae
145  use mod_atmos_admin, only: &
148  use scale_atmos_phy_ae_kajino13, only: &
150  implicit none
151 
152  if ( atmos_sw_phy_ae ) then
153 
154  select case ( atmos_phy_ae_type )
155  case ( 'KAJINO13' )
157  qtrc(:,:,:,qs_ae:qe_ae) ) ! [INOUT]
158  end select
159 
160  end if
161 
162  return
163  end subroutine atmos_phy_ae_driver_adjustment
164 
165  !-----------------------------------------------------------------------------
167  subroutine atmos_phy_ae_driver_calc_tendency( update_flag )
168  use scale_tracer, only: &
170  use scale_prc, only: &
171  prc_abort
172  use scale_time, only: &
173  dt_ae => time_dtsec_atmos_phy_ae, &
175  use scale_statistics, only: &
177  statistics_total
178  use scale_atmos_grid_cartesc_real, only: &
181  use scale_file_history, only: &
182  file_history_in
183  use mod_atmos_vars, only: &
184  dens => dens_av, &
185  qtrc => qtrc_av, &
186  qdry, &
187  pres, &
188  temp, &
189  qv, &
190  rhoq_t => rhoq_tp
191  use mod_atmos_phy_ae_vars, only: &
192  qa_ae, &
193  qs_ae, &
194  qe_ae, &
195  rhoq_t_ae => atmos_phy_ae_rhoq_t, &
196  ccn => atmos_phy_ae_ccn, &
197  ccn_t => atmos_phy_ae_ccn_t, &
198  ae_emit => atmos_phy_ae_emit
199  use mod_atmos_phy_mp_vars, only: &
200  evaporate => atmos_phy_mp_evaporate
201  use mod_atmos_admin, only: &
203  use scale_atmos_phy_ae_kajino13, only: &
205  use scale_atmos_phy_ae_offline, only: &
207  implicit none
208 
209  logical, intent(in) :: update_flag
210 
211  real(rp) :: cn(ka,ia,ja)
212  real(rp) :: nreg(ka,ia,ja)
213 
214  integer :: k, i, j, iq
215  !---------------------------------------------------------------------------
216 
217  if ( update_flag ) then
218 
219 !OCL XFILL
220  ccn(:,:,:) = 0.0_rp ! reset
221 !OCL XFILL
222  rhoq_t_ae(:,:,:,:) = 0.0_rp ! reset
223 
224  do j = js, je
225  do i = is, ie
226  do k = ks, ke
227  nreg(k,i,j) = evaporate(k,i,j) * dt_ae
228  enddo
229  enddo
230  enddo
231 
232  select case ( atmos_phy_ae_type )
233  case ( 'KAJINO13' )
235  temp(:,:,:), & ! [IN]
236  pres(:,:,:), & ! [IN]
237  qdry(:,:,:), & ! [IN]
238  nreg(:,:,:), & ! [IN]
239  dens(:,:,:), & ! [IN]
240  qv(:,:,:), & ! [IN]
241  qtrc(:,:,:,qs_ae:qe_ae), & ! [IN]
242  ae_emit(:,:,:,qs_ae:qe_ae), & ! [IN]
243  dt_ae, & ! [IN]
244  rhoq_t_ae(:,:,:,qs_ae:qe_ae), & ! [OUT]
245  cn(:,:,:), & ! [OUT]
246  ccn(:,:,:) ) ! [OUT]
247  case ( 'OFFLINE' )
248  call atmos_phy_ae_offline_tendency ( ka, ks, ke, ia, is, ie, ja, js, je, &
249  time_nowdaysec, & ! [IN]
250  ccn(:,:,:) ) ! [OUT]
251  cn(:,:,:) = 0.0_rp ! not supported
252  end select
253 
254  ccn_t(:,:,:) = ccn(:,:,:) / dt_ae
255 
256  call file_history_in( cn(:,:,:)*1.e-6_rp, 'CN', 'condensation nucrei', 'num/cc' )
257  call file_history_in( ccn(:,:,:)*1.e-6_rp, 'CCN', 'cloud condensation nucrei', 'num/cc' )
258 
259  endif
260 
261  do iq = qs_ae, qe_ae
262  !$omp parallel do private(i,j,k) OMP_SCHEDULE_
263  do j = js, je
264  do i = is, ie
265  do k = ks, ke
266  rhoq_t(k,i,j,iq) = rhoq_t(k,i,j,iq) + rhoq_t_ae(k,i,j,iq)
267  enddo
268  enddo
269  enddo
270  enddo
271 
272  if ( statistics_checktotal ) then
273  do iq = qs_ae, qe_ae
274  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
275  rhoq_t_ae(:,:,:,iq), trim(tracer_name(iq))//'_t_AE', &
278  enddo
279  endif
280 
281  return
282  end subroutine atmos_phy_ae_driver_calc_tendency
283 
284 end module mod_atmos_phy_ae_driver
scale_atmos_phy_ae_kajino13
module atmosphere / physics / aerosol / Kajino13
Definition: scale_atmos_phy_ae_kajino13.F90:12
scale_statistics
module Statistics
Definition: scale_statistics.F90:11
mod_atmos_phy_mp_vars
module Atmosphere / Physics Cloud Microphysics
Definition: mod_atmos_phy_mp_vars.F90:12
scale_atmos_grid_cartesc_index::ke
integer, public ke
end point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:52
scale_time::time_nowdaysec
real(dp), public time_nowdaysec
second of current time [sec]
Definition: scale_time.F90:70
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
mod_atmos_vars::rhoq_tp
real(rp), dimension(:,:,:,:), allocatable, public rhoq_tp
Definition: mod_atmos_vars.F90:120
mod_atmos_vars::qtrc_av
real(rp), dimension(:,:,:,:), pointer, public qtrc_av
Definition: mod_atmos_vars.F90:94
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_atmos_admin
module ATMOS admin
Definition: mod_atmos_admin.F90:11
mod_atmos_vars::qdry
real(rp), dimension(:,:,:), allocatable, target, public qdry
Definition: mod_atmos_vars.F90:139
mod_atmos_phy_ae_driver::atmos_phy_ae_driver_setup
subroutine, public atmos_phy_ae_driver_setup
Setup.
Definition: mod_atmos_phy_ae_driver.F90:104
scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_name
character(len=h_short), dimension(:), allocatable, public atmos_phy_ae_kajino13_name
Definition: scale_atmos_phy_ae_kajino13.F90:51
scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_tracer_setup
subroutine, public atmos_phy_ae_kajino13_tracer_setup(QA_AE)
Tracer setup.
Definition: scale_atmos_phy_ae_kajino13.F90:183
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_file_history
module file_history
Definition: scale_file_history.F90:15
scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_tendency
subroutine, public atmos_phy_ae_kajino13_tendency(KA, KS, KE, IA, IS, IE, JA, JS, JE, QA_AE, TEMP, PRES, QDRY, NREG, DENS, QV, QTRC, EMIT, dt, RHOQ_t_AE, CN, CCN)
Aerosol Microphysics.
Definition: scale_atmos_phy_ae_kajino13.F90:619
mod_atmos_phy_ae_driver::atmos_phy_ae_driver_adjustment
subroutine, public atmos_phy_ae_driver_adjustment
adjustment
Definition: mod_atmos_phy_ae_driver.F90:139
scale_prc
module PROCESS
Definition: scale_prc.F90:11
mod_atmos_admin::atmos_sw_phy_ae
logical, public atmos_sw_phy_ae
Definition: mod_atmos_admin.F90:53
scale_precision::rp
integer, parameter, public rp
Definition: scale_precision.F90:41
scale_atmos_grid_cartesc_index::ie
integer, public ie
end point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:54
scale_io
module STDIO
Definition: scale_io.F90:10
scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_setup
subroutine, public atmos_phy_ae_kajino13_setup
Setup.
Definition: scale_atmos_phy_ae_kajino13.F90:357
scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_desc
character(len=h_mid), dimension(:), allocatable, public atmos_phy_ae_kajino13_desc
Definition: scale_atmos_phy_ae_kajino13.F90:52
mod_atmos_vars::dens
real(rp), dimension(:,:,:), allocatable, target, public dens
Definition: mod_atmos_vars.F90:75
scale_atmos_grid_cartesc_index
module atmosphere / grid / cartesC index
Definition: scale_atmos_grid_cartesC_index.F90:12
scale_atmos_grid_cartesc_index::ia
integer, public ia
Definition: scale_atmos_grid_cartesC_index.F90:48
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_vol
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_vol
control volume (zxy) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:83
mod_atmos_phy_ae_vars::atmos_phy_ae_emit
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ae_emit
Definition: mod_atmos_phy_ae_vars.F90:64
mod_atmos_phy_ae_vars::qa_ae
integer, public qa_ae
Definition: mod_atmos_phy_ae_vars.F90:66
scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_unit
character(len=h_short), dimension(:), allocatable, public atmos_phy_ae_kajino13_unit
Definition: scale_atmos_phy_ae_kajino13.F90:53
scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_negative_fixer
subroutine, public atmos_phy_ae_kajino13_negative_fixer(KA, KS, KE, IA, IS, IE, JA, JS, JE, QA_AE, QTRC)
Definition: scale_atmos_phy_ae_kajino13.F90:1143
scale_tracer::tracer_name
character(len=h_short), dimension(qa_max), public tracer_name
Definition: scale_tracer.F90:38
scale_prof
module profiler
Definition: scale_prof.F90:11
scale_atmos_phy_ae_offline::atmos_phy_ae_offline_setup
subroutine, public atmos_phy_ae_offline_setup
Setup.
Definition: scale_atmos_phy_ae_offline.F90:67
scale_atmos_phy_ae_offline::atmos_phy_ae_offline_tendency
subroutine, public atmos_phy_ae_offline_tendency(KA, KS, KE, IA, IS, IE, JA, JS, JE, time_now, CCN)
Aerosol Microphysics.
Definition: scale_atmos_phy_ae_offline.F90:197
scale_atmos_grid_cartesc_index::is
integer, public is
start point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:53
scale_atmos_phy_ae_offline
module atmosphere / physics / aerosol / offline
Definition: scale_atmos_phy_ae_offline.F90:12
mod_atmos_vars::temp
real(rp), dimension(:,:,:), allocatable, target, public temp
Definition: mod_atmos_vars.F90:133
scale_atmos_grid_cartesc_index::ja
integer, public ja
Definition: scale_atmos_grid_cartesC_index.F90:49
scale_time
module TIME
Definition: scale_time.F90:11
mod_atmos_vars::qv
real(rp), dimension(:,:,:), allocatable, pointer, target, public qv
Definition: mod_atmos_vars.F90:96
mod_atmos_admin::atmos_phy_ae_type
character(len=h_short), public atmos_phy_ae_type
Definition: mod_atmos_admin.F90:37
scale_time::time_dtsec_atmos_phy_ae
real(dp), public time_dtsec_atmos_phy_ae
time interval of physics(aerosol ) [sec]
Definition: scale_time.F90:44
scale_tracer::tracer_regist
subroutine, public tracer_regist(QS, NQ, NAME, DESC, UNIT, CV, CP, R, ENGI0, ADVC, MASS)
Regist tracer.
Definition: scale_tracer.F90:65
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
mod_atmos_phy_mp_vars::atmos_phy_mp_evaporate
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_evaporate
Definition: mod_atmos_phy_mp_vars.F90:72
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
mod_atmos_phy_ae_driver::atmos_phy_ae_driver_tracer_setup
subroutine, public atmos_phy_ae_driver_tracer_setup
Setup.
Definition: mod_atmos_phy_ae_driver.F90:50
mod_atmos_vars::pres
real(rp), dimension(:,:,:), allocatable, target, public pres
Definition: mod_atmos_vars.F90:134
mod_atmos_vars::dens_av
real(rp), dimension(:,:,:), pointer, public dens_av
Definition: mod_atmos_vars.F90:89
scale_atmos_grid_cartesc_index::ks
integer, public ks
start point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:51
scale_statistics::statistics_checktotal
logical, public statistics_checktotal
calc&report variable totals to logfile?
Definition: scale_statistics.F90:64
mod_atmos_phy_ae_vars::atmos_phy_ae_rhoq_t
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ae_rhoq_t
Definition: mod_atmos_phy_ae_vars.F90:60
mod_atmos_vars
module ATMOSPHERIC Variables
Definition: mod_atmos_vars.F90:12
mod_atmos_phy_ae_driver
module ATMOSPHERE / Physics Aerosol Microphysics
Definition: mod_atmos_phy_ae_driver.F90:12
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_atmos_phy_ae_vars::qs_ae
integer, public qs_ae
Definition: mod_atmos_phy_ae_vars.F90:67
mod_atmos_phy_ae_vars
module ATMOSPHERE / Physics Aerosol Microphysics
Definition: mod_atmos_phy_ae_vars.F90:12
mod_atmos_phy_ae_vars::atmos_phy_ae_ccn_t
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn_t
Definition: mod_atmos_phy_ae_vars.F90:63
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_totvol
real(rp), public atmos_grid_cartesc_real_totvol
total volume (zxy, local) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:87
scale_atmos_grid_cartesc_index::je
integer, public je
end point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:56
mod_atmos_phy_ae_vars::qe_ae
integer, public qe_ae
Definition: mod_atmos_phy_ae_vars.F90:68
mod_atmos_phy_ae_driver::atmos_phy_ae_driver_calc_tendency
subroutine, public atmos_phy_ae_driver_calc_tendency(update_flag)
Driver.
Definition: mod_atmos_phy_ae_driver.F90:168