SCALE-RM
Functions/Subroutines | Variables
mod_atmos_phy_ae_vars Module Reference

module ATMOSPHERE / Physics Aerosol Microphysics More...

Functions/Subroutines

subroutine, public atmos_phy_ae_vars_setup
 Setup. More...
 
subroutine, public atmos_phy_ae_vars_finalize
 Finalize. More...
 
subroutine, public atmos_phy_ae_vars_fillhalo
 HALO Communication. More...
 
subroutine, public atmos_phy_ae_vars_restart_open
 Open restart file for read. More...
 
subroutine, public atmos_phy_ae_vars_restart_read
 Read restart. More...
 
subroutine, public atmos_phy_ae_vars_restart_create
 Create restart file. More...
 
subroutine, public atmos_phy_ae_vars_restart_enddef
 Exit netCDF define mode. More...
 
subroutine, public atmos_phy_ae_vars_restart_close
 Close restart file. More...
 
subroutine, public atmos_phy_ae_vars_restart_def_var
 Write restart. More...
 
subroutine, public atmos_phy_ae_vars_restart_write
 Write restart. More...
 
subroutine, public atmos_phy_ae_vars_history (QTRC, RH)
 
subroutine, public atmos_phy_ae_vars_get_diagnostic (QTRC, RH, Re, Qe)
 
subroutine, public atmos_phy_ae_vars_reset_diagnostics
 

Variables

logical, public atmos_phy_ae_restart_output = .false.
 output restart file? More...
 
character(len=h_long), public atmos_phy_ae_restart_in_basename = ''
 Basename of the input file. More...
 
logical, public atmos_phy_ae_restart_in_aggregate
 Switch to use aggregate file. More...
 
logical, public atmos_phy_ae_restart_in_postfix_timelabel = .false.
 Add timelabel to the basename of input file? More...
 
character(len=h_long), public atmos_phy_ae_restart_out_basename = ''
 Basename of the output file. More...
 
logical, public atmos_phy_ae_restart_out_aggregate
 Switch to use aggregate file. More...
 
logical, public atmos_phy_ae_restart_out_postfix_timelabel = .true.
 Add timelabel to the basename of output file? More...
 
character(len=h_mid), public atmos_phy_ae_restart_out_title = 'ATMOS_PHY_AE restart'
 title of the output file More...
 
character(len=h_short), public atmos_phy_ae_restart_out_dtype = 'DEFAULT'
 REAL4 or REAL8. More...
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ae_rhoq_t
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn_t
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ae_emit
 
integer, public qa_ae = 0
 
integer, public qs_ae = -1
 
integer, public qe_ae = -2
 

Detailed Description

module ATMOSPHERE / Physics Aerosol Microphysics

Description
Container for mod_atmos_phy_ae
Author
Team SCALE
NAMELIST
  • PARAM_ATMOS_PHY_AE_VARS
    nametypedefault valuecomment
    ATMOS_PHY_AE_RESTART_IN_BASENAME character(len=H_LONG) '' Basename of the input file
    ATMOS_PHY_AE_RESTART_IN_AGGREGATE logical Switch to use aggregate file
    ATMOS_PHY_AE_RESTART_IN_POSTFIX_TIMELABEL logical .false. Add timelabel to the basename of input file?
    ATMOS_PHY_AE_RESTART_OUTPUT logical .false. output restart file?
    ATMOS_PHY_AE_RESTART_OUT_BASENAME character(len=H_LONG) '' Basename of the output file
    ATMOS_PHY_AE_RESTART_OUT_AGGREGATE logical Switch to use aggregate file
    ATMOS_PHY_AE_RESTART_OUT_POSTFIX_TIMELABEL logical .true. Add timelabel to the basename of output file?
    ATMOS_PHY_AE_RESTART_OUT_TITLE character(len=H_MID) 'ATMOS_PHY_AE restart' title of the output file
    ATMOS_PHY_AE_RESTART_OUT_DTYPE character(len=H_SHORT) 'DEFAULT' REAL4 or REAL8

History Output
namedescriptionunitvariable
Qe_{AE_NAME} mass mixing ratio of {AE_NAME};
{AE_NAME} is AD, ASO, AVA, AS, AR, ASS, AU, AT, AOC.
kg/kg {'Qe_'//trim}
Re_{AE_NAME} effective radius of {AE_NAME};
{AE_NAME} is AD, ASO, AVA, AS, AR, ASS, AU, AT, AOC.
cm {'Re_'//trim}

Function/Subroutine Documentation

◆ atmos_phy_ae_vars_setup()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_setup

Setup.

Definition at line 110 of file mod_atmos_phy_ae_vars.F90.

110  use scale_prc, only: &
111  prc_abort
112  use scale_const, only: &
113  undef => const_undef
114  use scale_atmos_aerosol, only: &
115  n_ae, &
116  ae_name, &
117  ae_desc
118  use scale_file_history, only: &
120  implicit none
121 
122  namelist / param_atmos_phy_ae_vars / &
123  atmos_phy_ae_restart_in_basename, &
124  atmos_phy_ae_restart_in_aggregate, &
125  atmos_phy_ae_restart_in_postfix_timelabel, &
126  atmos_phy_ae_restart_output, &
127  atmos_phy_ae_restart_out_basename, &
128  atmos_phy_ae_restart_out_aggregate, &
129  atmos_phy_ae_restart_out_postfix_timelabel, &
130  atmos_phy_ae_restart_out_title, &
131  atmos_phy_ae_restart_out_dtype
132 
133  integer :: ierr
134  integer :: iv
135  !---------------------------------------------------------------------------
136 
137  log_newline
138  log_info("ATMOS_PHY_AE_vars_setup",*) 'Setup'
139 
140  allocate( atmos_phy_ae_rhoq_t(ka,ia,ja,qs_ae:qe_ae) )
141  atmos_phy_ae_rhoq_t(:,:,:, :) = undef
142  !$acc enter data create(ATMOS_PHY_AE_RHOQ_t)
143 
144  allocate( atmos_phy_ae_ccn(ka,ia,ja) )
145  atmos_phy_ae_ccn(:,:,:) = undef
146  !$acc enter data create(ATMOS_PHY_AE_CCN)
147 
148  allocate( atmos_phy_ae_ccn_t(ka,ia,ja) )
149  atmos_phy_ae_ccn_t(:,:,:) = undef
150  !$acc enter data create(ATMOS_PHY_AE_CCN_t)
151 
152  allocate( atmos_phy_ae_emit(ka,ia,ja,qs_ae:qe_ae) )
153  atmos_phy_ae_emit(:,:,:,:) = 0.0_rp
154  !$acc enter data copyin(ATMOS_PHY_AE_EMIT)
155 
156  !--- read namelist
157  rewind(io_fid_conf)
158  read(io_fid_conf,nml=param_atmos_phy_ae_vars,iostat=ierr)
159  if( ierr < 0 ) then !--- missing
160  log_info("ATMOS_PHY_AE_vars_setup",*) 'Not found namelist. Default used.'
161  elseif( ierr > 0 ) then !--- fatal error
162  log_error("ATMOS_PHY_AE_vars_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_AE_VARS. Check!'
163  call prc_abort
164  endif
165  log_nml(param_atmos_phy_ae_vars)
166 
167  log_newline
168  log_info("ATMOS_PHY_AE_vars_setup",*) '[ATMOS_PHY_AE] prognostic/diagnostic variables'
169  log_info_cont('(1x,A,A24,A,A48,A,A12,A)') &
170  ' |', 'VARNAME ','|', &
171  'DESCRIPTION ', '[', 'UNIT ', ']'
172  do iv = 1, vmax
173  log_info_cont('(1x,A,I3,A,A24,A,A48,A,A12,A)') &
174  'NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
175  enddo
176 
177  log_newline
178  if ( atmos_phy_ae_restart_in_basename /= '' ) then
179  log_info("ATMOS_PHY_AE_vars_setup",*) 'Restart input? : YES, file = ', trim(atmos_phy_ae_restart_in_basename)
180  log_info("ATMOS_PHY_AE_vars_setup",*) 'Add timelabel? : ', atmos_phy_ae_restart_in_postfix_timelabel
181  else
182  log_info("ATMOS_PHY_AE_vars_setup",*) 'Restart input? : NO'
183  endif
184  if ( atmos_phy_ae_restart_output &
185  .AND. atmos_phy_ae_restart_out_basename /= '' ) then
186  log_info("ATMOS_PHY_AE_vars_setup",*) 'Restart output? : YES, file = ', trim(atmos_phy_ae_restart_out_basename)
187  log_info("ATMOS_PHY_AE_vars_setup",*) 'Add timelabel? : ', atmos_phy_ae_restart_out_postfix_timelabel
188  else
189  log_info("ATMOS_PHY_AE_vars_setup",*) 'Restart output? : NO'
190  atmos_phy_ae_restart_output = .false.
191  endif
192 
193  ! diagnostices
194  allocate( atmos_phy_ae_re(ka,ia,ja,n_ae) )
195  allocate( atmos_phy_ae_qe(ka,ia,ja,n_ae) )
196 !OCL XFILL
197  atmos_phy_ae_re(:,:,:,:) = undef
198 !OCL XFILL
199  atmos_phy_ae_qe(:,:,:,:) = undef
200  diag_re = .false.
201  diag_qe = .false.
202  !$acc enter data create(ATMOS_PHY_AE_Re,ATMOS_PHY_AE_Qe)
203 
204  ! history
205  hist_re = .false.
206  allocate( hist_re_id(n_ae) )
207  do iv = 1, n_ae
208  call file_history_reg( 'Re_'//trim(ae_name(iv)), 'effective radius of '//trim(ae_desc(iv)), 'cm', hist_re_id(iv), fill_halo=.true., dim_type='ZXY' )
209  if ( hist_re_id(iv) > 0 ) hist_re = .true.
210  end do
211 
212  hist_qe = .false.
213  allocate( hist_qe_id(n_ae) )
214  do iv = 1, n_ae
215  call file_history_reg( 'Qe_'//trim(ae_name(iv)), 'mass mixing ratio of '//trim(ae_desc(iv)), 'kg/kg', hist_qe_id(iv), fill_halo=.true., dim_type='ZXY' )
216  if ( hist_qe_id(iv) > 0 ) hist_qe = .true.
217  end do
218 
219  return

References scale_atmos_aerosol::ae_desc, scale_atmos_aerosol::ae_name, atmos_phy_ae_ccn, atmos_phy_ae_ccn_t, atmos_phy_ae_emit, atmos_phy_ae_restart_in_aggregate, atmos_phy_ae_restart_in_basename, atmos_phy_ae_restart_in_postfix_timelabel, atmos_phy_ae_restart_out_aggregate, atmos_phy_ae_restart_out_basename, atmos_phy_ae_restart_out_dtype, atmos_phy_ae_restart_out_postfix_timelabel, atmos_phy_ae_restart_out_title, atmos_phy_ae_restart_output, atmos_phy_ae_rhoq_t, scale_const::const_undef, scale_file_history::file_history_reg(), scale_atmos_grid_cartesc_index::ia, scale_io::io_fid_conf, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::ka, scale_atmos_aerosol::n_ae, scale_prc::prc_abort(), qe_ae, and qs_ae.

Referenced by mod_atmos_vars::atmos_vars_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_finalize()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_finalize

Finalize.

Definition at line 225 of file mod_atmos_phy_ae_vars.F90.

225  implicit none
226  !---------------------------------------------------------------------------
227 
228  log_newline
229  log_info("ATMOS_PHY_AE_vars_finalize",*) 'Finalize'
230 
231  !$acc exit data delete(ATMOS_PHY_AE_RHOQ_t)
232  deallocate( atmos_phy_ae_rhoq_t )
233 
234  !$acc exit data delete(ATMOS_PHY_AE_CCN)
235  deallocate( atmos_phy_ae_ccn )
236 
237  !$acc exit data delete(ATMOS_PHY_AE_CCN_t)
238  deallocate( atmos_phy_ae_ccn_t )
239 
240  !$acc exit data delete(ATMOS_PHY_AE_EMIT)
241  deallocate( atmos_phy_ae_emit )
242 
243  ! diagnostices
244  !$acc exit data delete(ATMOS_PHY_AE_Re,ATMOS_PHY_AE_Qe)
245  deallocate( atmos_phy_ae_re )
246  deallocate( atmos_phy_ae_qe )
247 
248  ! history
249  deallocate( hist_re_id )
250 
251  deallocate( hist_qe_id )
252 
253  return

References atmos_phy_ae_ccn, atmos_phy_ae_ccn_t, atmos_phy_ae_emit, and atmos_phy_ae_rhoq_t.

Referenced by mod_atmos_vars::atmos_vars_finalize().

Here is the caller graph for this function:

◆ atmos_phy_ae_vars_fillhalo()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_fillhalo

HALO Communication.

Definition at line 259 of file mod_atmos_phy_ae_vars.F90.

259  use scale_comm_cartesc, only: &
260  comm_vars8, &
261  comm_wait
262  implicit none
263 
264  integer :: i, j
265  !---------------------------------------------------------------------------
266 
267  !$omp parallel do
268  !$acc kernels
269  !$acc loop independent collapse(2)
270  do j = js, je
271  do i = is, ie
272  atmos_phy_ae_ccn( 1:ks-1,i,j) = atmos_phy_ae_ccn(ks,i,j)
273  atmos_phy_ae_ccn(ke+1:ka, i,j) = atmos_phy_ae_ccn(ke,i,j)
274  enddo
275  enddo
276  !$acc end kernels
277 
278  call comm_vars8( atmos_phy_ae_ccn(:,:,:), 1 )
279  call comm_wait ( atmos_phy_ae_ccn(:,:,:), 1 )
280 
281  return

References atmos_phy_ae_ccn, scale_atmos_grid_cartesc_index::ie, scale_atmos_grid_cartesc_index::is, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::js, scale_atmos_grid_cartesc_index::ka, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by atmos_phy_ae_vars_restart_read(), and atmos_phy_ae_vars_restart_write().

Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_open()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_open

Open restart file for read.

Definition at line 287 of file mod_atmos_phy_ae_vars.F90.

287  use scale_time, only: &
289  use scale_file_cartesc, only: &
291  implicit none
292 
293  character(len=19) :: timelabel
294  character(len=H_LONG) :: basename
295  !---------------------------------------------------------------------------
296 
297  log_newline
298  log_info("ATMOS_PHY_AE_vars_restart_open",*) 'Open restart file (ATMOS_PHY_AE) '
299 
300  if ( atmos_phy_ae_restart_in_basename /= '' ) then
301 
302  if ( atmos_phy_ae_restart_in_postfix_timelabel ) then
303  call time_gettimelabel( timelabel )
304  basename = trim(atmos_phy_ae_restart_in_basename)//'_'//trim(timelabel)
305  else
306  basename = trim(atmos_phy_ae_restart_in_basename)
307  endif
308 
309  log_info("ATMOS_PHY_AE_vars_restart_open",*) 'basename: ', trim(basename)
310 
311  call file_cartesc_open( basename, restart_fid, aggregate=atmos_phy_ae_restart_in_aggregate )
312  else
313  log_info("ATMOS_PHY_AE_vars_restart_open",*) 'restart file for ATMOS_PHY_AE is not specified.'
314  endif
315 
316  return

References atmos_phy_ae_restart_in_aggregate, atmos_phy_ae_restart_in_basename, atmos_phy_ae_restart_in_postfix_timelabel, scale_file_cartesc::file_cartesc_open(), and scale_time::time_gettimelabel().

Referenced by mod_atmos_vars::atmos_vars_restart_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_read()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_read

Read restart.

Definition at line 322 of file mod_atmos_phy_ae_vars.F90.

322  use scale_file, only: &
324  use scale_file_cartesc, only: &
325  file_cartesc_read, &
327  implicit none
328 
329  integer :: i, j
330  !---------------------------------------------------------------------------
331 
332  if ( restart_fid /= -1 ) then
333  log_newline
334  log_info("ATMOS_PHY_AE_vars_restart_read",*) 'Read from restart file (ATMOS_PHY_AE) '
335 
336  call file_cartesc_read( restart_fid, var_name(1), 'ZXY', & ! [IN]
337  atmos_phy_ae_ccn(:,:,:) ) ! [OUT]
338 
339  if ( file_get_aggregate(restart_fid) ) then
340  call file_cartesc_flush( restart_fid ) ! X/Y halos have been read from file
341  !$acc update device(ATMOS_PHY_AE_CCN)
342 
343  ! fill K halos
344  !$omp parallel do
345  !$acc kernels
346  !$acc loop independent collapse(2)
347  do j = 1, ja
348  do i = 1, ia
349  atmos_phy_ae_ccn( 1:ks-1,i,j) = atmos_phy_ae_ccn(ks,i,j)
350  atmos_phy_ae_ccn(ke+1:ka, i,j) = atmos_phy_ae_ccn(ke,i,j)
351  enddo
352  enddo
353  !$acc end kernels
354  else
355  call atmos_phy_ae_vars_fillhalo
356  end if
357 
358  call atmos_phy_ae_vars_check
359 
360  else
361  log_info("ATMOS_PHY_AE_vars_restart_read",*) 'invlaid restart file ID for ATMOS_PHY_AE.'
362  endif
363 
364  return

References atmos_phy_ae_ccn, atmos_phy_ae_vars_fillhalo(), scale_file_cartesc::file_cartesc_flush(), scale_file::file_get_aggregate(), scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::ka, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by mod_atmos_vars::atmos_vars_restart_read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_create()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_create

Create restart file.

Definition at line 370 of file mod_atmos_phy_ae_vars.F90.

370  use scale_time, only: &
372  use scale_file_cartesc, only: &
374  implicit none
375 
376  character(len=19) :: timelabel
377  character(len=H_LONG) :: basename
378  !---------------------------------------------------------------------------
379 
380  if ( atmos_phy_ae_restart_out_basename /= '' ) then
381 
382  log_newline
383  log_info("ATMOS_PHY_AE_vars_restart_create",*) 'Create restart file (ATMOS_PHY_AE) '
384 
385  if ( atmos_phy_ae_restart_out_postfix_timelabel ) then
386  call time_gettimelabel( timelabel )
387  basename = trim(atmos_phy_ae_restart_out_basename)//'_'//trim(timelabel)
388  else
389  basename = trim(atmos_phy_ae_restart_out_basename)
390  endif
391 
392  log_info("ATMOS_PHY_AE_vars_restart_create",*) 'basename: ', trim(basename)
393 
394  call file_cartesc_create( &
395  basename, atmos_phy_ae_restart_out_title, atmos_phy_ae_restart_out_dtype, & ! [IN]
396  restart_fid, & ! [OUT]
397  aggregate=atmos_phy_ae_restart_out_aggregate ) ! [IN]
398 
399  endif
400 
401  return

References atmos_phy_ae_restart_out_aggregate, atmos_phy_ae_restart_out_basename, atmos_phy_ae_restart_out_dtype, atmos_phy_ae_restart_out_postfix_timelabel, atmos_phy_ae_restart_out_title, scale_file_cartesc::file_cartesc_create(), and scale_time::time_gettimelabel().

Referenced by mod_atmos_vars::atmos_vars_restart_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_enddef()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_enddef

Exit netCDF define mode.

Definition at line 407 of file mod_atmos_phy_ae_vars.F90.

407  use scale_file_cartesc, only: &
409  implicit none
410 
411  if ( restart_fid /= -1 ) then
412  call file_cartesc_enddef( restart_fid ) ! [IN]
413  endif
414 
415  return

References scale_file_cartesc::file_cartesc_enddef().

Referenced by mod_atmos_vars::atmos_vars_restart_enddef().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_close()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_close

Close restart file.

Definition at line 421 of file mod_atmos_phy_ae_vars.F90.

421  use scale_file_cartesc, only: &
423  implicit none
424  !---------------------------------------------------------------------------
425 
426  if ( restart_fid /= -1 ) then
427  log_newline
428  log_info("ATMOS_PHY_AE_vars_restart_close",*) 'Close restart file (ATMOS_PHY_AE) '
429 
430  call file_cartesc_close( restart_fid ) ! [IN]
431 
432  restart_fid = -1
433  endif
434 
435  return

References scale_file_cartesc::file_cartesc_close().

Referenced by mod_atmos_vars::atmos_vars_restart_close().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_def_var()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_def_var

Write restart.

Definition at line 441 of file mod_atmos_phy_ae_vars.F90.

441  use scale_file_cartesc, only: &
443  implicit none
444  !---------------------------------------------------------------------------
445 
446  if ( restart_fid /= -1 ) then
447  call file_cartesc_def_var( restart_fid, var_name(1), var_desc(1), var_unit(1), 'ZXY', atmos_phy_ae_restart_out_dtype, &
448  var_id(1) )
449  endif
450 
451  return

References atmos_phy_ae_restart_out_dtype, and scale_file_cartesc::file_cartesc_def_var().

Referenced by mod_atmos_vars::atmos_vars_restart_def_var().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_write()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_write

Write restart.

Definition at line 457 of file mod_atmos_phy_ae_vars.F90.

457  use scale_file_cartesc, only: &
458  file_cartesc_write_var
459  implicit none
460  !---------------------------------------------------------------------------
461 
462  if ( restart_fid /= -1 ) then
463 
464  call atmos_phy_ae_vars_fillhalo
465 
466  call atmos_phy_ae_vars_check
467 
468  call file_cartesc_write_var( restart_fid, var_id(1), atmos_phy_ae_ccn(:,:,:), var_name(1), 'ZXY' ) ! [IN]
469 
470  endif
471 
472  return

References atmos_phy_ae_ccn, and atmos_phy_ae_vars_fillhalo().

Referenced by mod_atmos_vars::atmos_vars_restart_write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_history()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_history ( real(rp), dimension(ka,ia,ja,qa), intent(in)  QTRC,
real(rp), dimension(ka,ia,ja), intent(in)  RH 
)

Definition at line 477 of file mod_atmos_phy_ae_vars.F90.

477  use scale_tracer, only: &
478  qa
479  use scale_atmos_aerosol, only: &
480  n_ae
481  use scale_file_history, only: &
482  file_history_put
483  real(RP), intent(in) :: QTRC(KA,IA,JA,QA)
484  real(RP), intent(in) :: RH(KA,IA,JA)
485 
486  real(RP) :: WORK(KA,IA,JA,N_AE)
487  integer :: iv
488 
489  if ( hist_re ) then
490  call atmos_phy_ae_vars_get_diagnostic( &
491  qtrc(:,:,:,:), rh(:,:,:), & ! [IN]
492  re=work(:,:,:,:) ) ! [OUT]
493  do iv = 1, n_ae
494  if ( hist_re_id(iv) > 0 ) &
495  call file_history_put( hist_re_id(iv), work(:,:,:,iv) )
496  end do
497  end if
498 
499  if ( hist_qe ) then
500  call atmos_phy_ae_vars_get_diagnostic( &
501  qtrc(:,:,:,:), rh(:,:,:), & ! [IN]
502  qe=work(:,:,:,:) ) ! [OUT]
503  do iv = 1, n_ae
504  if ( hist_qe_id(iv) > 0 ) &
505  call file_history_put( hist_qe_id(iv), work(:,:,:,iv) )
506  end do
507  end if
508 
509  return

References atmos_phy_ae_vars_get_diagnostic(), scale_atmos_aerosol::n_ae, and scale_tracer::qa.

Referenced by mod_atmos_vars::atmos_vars_history().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_get_diagnostic()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_get_diagnostic ( real(rp), dimension(ka,ia,ja,qa), intent(in)  QTRC,
real(rp), dimension(ka,ia,ja), intent(in)  RH,
real(rp), dimension(ka,ia,ja,n_ae), intent(out), optional  Re,
real(rp), dimension(ka,ia,ja,n_ae), intent(out), optional  Qe 
)

Definition at line 515 of file mod_atmos_phy_ae_vars.F90.

515  use scale_time, only: &
517  use scale_tracer, only: &
518  qa
519  use scale_atmos_aerosol, only: &
520  n_ae
521  use scale_atmos_phy_ae_kajino13, only: &
523  use scale_atmos_phy_ae_offline, only: &
526  use mod_atmos_admin, only: &
528 
529  real(RP), intent(in) :: QTRC(KA,IA,JA,QA)
530  real(RP), intent(in) :: RH(KA,IA,JA)
531  real(RP), intent(out), optional :: Re(KA,IA,JA,N_AE)
532  real(RP), intent(out), optional :: Qe(KA,IA,JA,N_AE)
533 
534  if ( present(re) ) then
535  !$acc data copyout(Re)
536  if ( .not. diag_re ) then
537 
538  select case ( atmos_phy_ae_type )
539  case ( 'KAJINO13' )
540  !$acc update host(QTRC(:,:,:,QS_AE:QE_AE),RH)
542  ka, ia, ja, qa_ae, &
543  qtrc(:,:,:,qs_ae:qe_ae), rh(:,:,:), & ! [IN]
544  atmos_phy_ae_re(:,:,:,:) ) ! [OUT]
545  !$acc update device(ATMOS_PHY_AE_Re)
546  case ( 'OFFLINE' )
547  !$acc update host(RH)
549  ka, ia, ja, &
550  rh(:,:,:), & ! [IN]
551  atmos_phy_ae_re(:,:,:,:) ) ! [OUT]
552  !$acc update device(ATMOS_PHY_AE_Re)
553  case default
554  !$acc kernels
555  atmos_phy_ae_re(:,:,:,:) = 0.0_rp
556  !$acc end kernels
557  end select
558 
559  diag_re = .true.
560  end if
561 !OCL XFILL
562  !$acc kernels
563  re(:,:,:,:) = atmos_phy_ae_re(:,:,:,:)
564  !$acc end kernels
565  !$acc end data
566  end if
567 
568  if ( present(qe) ) then
569  !$acc data copyout(Qe)
570  if ( .not. diag_qe ) then
571 
572  select case ( atmos_phy_ae_type )
573  case ( 'OFFLINE' )
575  ka, ia, ja, &
576  time_nowdaysec, &
577  atmos_phy_ae_qe(:,:,:,:) ) ! [OUT]
578  !$acc update device(ATMOS_PHY_AE_Qe)
579  case default
580  !$acc kernels
581  atmos_phy_ae_qe(:,:,:,:) = 0.0_rp
582  !$acc end kernels
583  end select
584 
585  diag_qe = .true.
586  end if
587 !OCL XFILL
588  !$acc kernels
589  qe(:,:,:,:) = atmos_phy_ae_qe(:,:,:,:)
590  !$acc end kernels
591  !$acc end data
592  end if
593 
594  return

References scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_effective_radius(), scale_atmos_phy_ae_offline::atmos_phy_ae_offline_effective_radius(), scale_atmos_phy_ae_offline::atmos_phy_ae_offline_qtrc2qaero(), mod_atmos_admin::atmos_phy_ae_type, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::ka, scale_atmos_aerosol::n_ae, scale_tracer::qa, qa_ae, qe_ae, qs_ae, and scale_time::time_nowdaysec.

Referenced by atmos_phy_ae_vars_history(), and mod_atmos_phy_rd_driver::atmos_phy_rd_driver_calc_tendency().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_reset_diagnostics()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_reset_diagnostics

Variable Documentation

◆ atmos_phy_ae_restart_output

logical, public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_output = .false.

output restart file?

Definition at line 50 of file mod_atmos_phy_ae_vars.F90.

50  logical, public :: ATMOS_PHY_AE_RESTART_OUTPUT = .false.

Referenced by mod_admin_restart::admin_restart_setup(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_restart_in_basename

character(len=h_long), public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_in_basename = ''

Basename of the input file.

Definition at line 52 of file mod_atmos_phy_ae_vars.F90.

52  character(len=H_LONG), public :: ATMOS_PHY_AE_RESTART_IN_BASENAME = ''

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_open(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_restart_in_aggregate

logical, public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_in_aggregate

Switch to use aggregate file.

Definition at line 53 of file mod_atmos_phy_ae_vars.F90.

53  logical, public :: ATMOS_PHY_AE_RESTART_IN_AGGREGATE

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_open(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_restart_in_postfix_timelabel

logical, public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_in_postfix_timelabel = .false.

Add timelabel to the basename of input file?

Definition at line 54 of file mod_atmos_phy_ae_vars.F90.

54  logical, public :: ATMOS_PHY_AE_RESTART_IN_POSTFIX_TIMELABEL = .false.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_open(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_restart_out_basename

character(len=h_long), public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_out_basename = ''

Basename of the output file.

Definition at line 55 of file mod_atmos_phy_ae_vars.F90.

55  character(len=H_LONG), public :: ATMOS_PHY_AE_RESTART_OUT_BASENAME = ''

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_create(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_restart_out_aggregate

logical, public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_out_aggregate

Switch to use aggregate file.

Definition at line 56 of file mod_atmos_phy_ae_vars.F90.

56  logical, public :: ATMOS_PHY_AE_RESTART_OUT_AGGREGATE

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_create(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_restart_out_postfix_timelabel

logical, public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_out_postfix_timelabel = .true.

Add timelabel to the basename of output file?

Definition at line 57 of file mod_atmos_phy_ae_vars.F90.

57  logical, public :: ATMOS_PHY_AE_RESTART_OUT_POSTFIX_TIMELABEL = .true.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_create(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_restart_out_title

character(len=h_mid), public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_out_title = 'ATMOS_PHY_AE restart'

title of the output file

Definition at line 58 of file mod_atmos_phy_ae_vars.F90.

58  character(len=H_MID), public :: ATMOS_PHY_AE_RESTART_OUT_TITLE = 'ATMOS_PHY_AE restart'

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_create(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_restart_out_dtype

character(len=h_short), public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_out_dtype = 'DEFAULT'

REAL4 or REAL8.

Definition at line 59 of file mod_atmos_phy_ae_vars.F90.

59  character(len=H_SHORT), public :: ATMOS_PHY_AE_RESTART_OUT_DTYPE = 'DEFAULT'

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_create(), atmos_phy_ae_vars_restart_def_var(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_rhoq_t

real(rp), dimension(:,:,:,:), allocatable, public mod_atmos_phy_ae_vars::atmos_phy_ae_rhoq_t

Definition at line 61 of file mod_atmos_phy_ae_vars.F90.

61  real(RP), public, allocatable :: ATMOS_PHY_AE_RHOQ_t(:,:,:,:) ! tendency rho*QTRC [kg/kg/s]

Referenced by mod_atmos_phy_ae_driver::atmos_phy_ae_driver_calc_tendency(), atmos_phy_ae_vars_finalize(), and atmos_phy_ae_vars_setup().

◆ atmos_phy_ae_ccn

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_ae_vars::atmos_phy_ae_ccn

◆ atmos_phy_ae_ccn_t

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_ae_vars::atmos_phy_ae_ccn_t

Definition at line 64 of file mod_atmos_phy_ae_vars.F90.

64  real(RP), public, allocatable :: ATMOS_PHY_AE_CCN_t(:,:,:) ! tendency CCN [/m3/s]

Referenced by mod_atmos_phy_ae_driver::atmos_phy_ae_driver_calc_tendency(), atmos_phy_ae_vars_finalize(), atmos_phy_ae_vars_setup(), and mod_atmos_phy_mp_driver::atmos_phy_mp_driver_calc_tendency().

◆ atmos_phy_ae_emit

real(rp), dimension(:,:,:,:), allocatable, public mod_atmos_phy_ae_vars::atmos_phy_ae_emit

Definition at line 65 of file mod_atmos_phy_ae_vars.F90.

65  real(RP), public, allocatable :: ATMOS_PHY_AE_EMIT(:,:,:,:) ! emission of aerosol and gas

Referenced by mod_atmos_phy_ae_driver::atmos_phy_ae_driver_calc_tendency(), atmos_phy_ae_vars_finalize(), and atmos_phy_ae_vars_setup().

◆ qa_ae

integer, public mod_atmos_phy_ae_vars::qa_ae = 0

◆ qs_ae

integer, public mod_atmos_phy_ae_vars::qs_ae = -1

◆ qe_ae

integer, public mod_atmos_phy_ae_vars::qe_ae = -2
scale_atmos_phy_ae_kajino13
module atmosphere / physics / aerosol / Kajino13
Definition: scale_atmos_phy_ae_kajino13.F90:12
scale_time::time_nowdaysec
real(dp), public time_nowdaysec
second of current time [sec]
Definition: scale_time.F90:72
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_tracer::qa
integer, public qa
Definition: scale_tracer.F90:35
scale_file_cartesc::file_cartesc_enddef
subroutine, public file_cartesc_enddef(fid)
Exit netCDF file define mode.
Definition: scale_file_cartesC.F90:964
scale_file_cartesc::file_cartesc_def_var
subroutine, public file_cartesc_def_var(fid, varname, desc, unit, dim_type, datatype, vid, standard_name, timeintv, nsteps, cell_measures)
Define a variable to file.
Definition: scale_file_cartesC.F90:3360
mod_atmos_admin
module ATMOS admin
Definition: mod_atmos_admin.F90:11
scale_atmos_aerosol::n_ae
integer, parameter, public n_ae
Definition: scale_atmos_aerosol.F90:33
scale_atmos_aerosol::ae_desc
character(len=h_mid), dimension(n_ae), parameter, public ae_desc
Definition: scale_atmos_aerosol.F90:44
scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_effective_radius
subroutine, public atmos_phy_ae_kajino13_effective_radius(KA, IA, JA, QA_AE, QTRC, RH, Re)
Calculate Effective Radius.
Definition: scale_atmos_phy_ae_kajino13.F90:948
mod_atmos_vars::qtrc
real(rp), dimension(:,:,:,:), allocatable, target, public qtrc
Definition: mod_atmos_vars.F90:81
scale_file_history
module file_history
Definition: scale_file_history.F90:15
scale_file
module file
Definition: scale_file.F90:15
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_const
module CONSTANT
Definition: scale_const.F90:11
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:65
mod_atmos_phy_ae_vars::qa_ae
integer, public qa_ae
Definition: mod_atmos_phy_ae_vars.F90:67
scale_atmos_phy_ae_offline::atmos_phy_ae_offline_effective_radius
subroutine, public atmos_phy_ae_offline_effective_radius(KA, IA, JA, RH, Re)
Calculate Effective Radius.
Definition: scale_atmos_phy_ae_offline.F90:239
scale_file_cartesc::file_cartesc_close
subroutine, public file_cartesc_close(fid)
Close a netCDF file.
Definition: scale_file_cartesC.F90:1044
scale_atmos_phy_ae_offline
module atmosphere / physics / aerosol / offline
Definition: scale_atmos_phy_ae_offline.F90:12
scale_time
module TIME
Definition: scale_time.F90:11
mod_atmos_admin::atmos_phy_ae_type
character(len=h_short), public atmos_phy_ae_type
Definition: mod_atmos_admin.F90:37
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
scale_atmos_aerosol
module atmosphere / aerosol
Definition: scale_atmos_aerosol.F90:12
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:63
scale_atmos_phy_ae_offline::atmos_phy_ae_offline_qtrc2qaero
subroutine, public atmos_phy_ae_offline_qtrc2qaero(KA, IA, JA, time_now, Qe)
Calculate Effective Radius.
Definition: scale_atmos_phy_ae_offline.F90:280
scale_file_cartesc::file_cartesc_create
subroutine, public file_cartesc_create(basename, title, datatype, fid, date, subsec, haszcoord, append, aggregate, single)
Create/open a netCDF file.
Definition: scale_file_cartesC.F90:796
scale_file_cartesc::file_cartesc_flush
subroutine, public file_cartesc_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
Definition: scale_file_cartesC.F90:1018
scale_time::time_gettimelabel
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:93
scale_comm_cartesc
module COMMUNICATION
Definition: scale_comm_cartesC.F90:11
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:61
mod_atmos_phy_ae_vars::qs_ae
integer, public qs_ae
Definition: mod_atmos_phy_ae_vars.F90:68
scale_atmos_aerosol::ae_name
character(len=h_short), dimension(n_ae), parameter, public ae_name
Definition: scale_atmos_aerosol.F90:42
scale_file::file_get_aggregate
logical function, public file_get_aggregate(fid)
Definition: scale_file.F90:6316
scale_file_cartesc::file_cartesc_open
subroutine, public file_cartesc_open(basename, fid, single, aggregate)
open a netCDF file for read
Definition: scale_file_cartesC.F90:760
scale_file_history::file_history_reg
subroutine, public file_history_reg(name, desc, unit, itemid, standard_name, ndims, dim_type, cell_measures, fill_halo)
Register/Append variable to history file.
Definition: scale_file_history.F90:685
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:64
scale_const::const_undef
real(rp), public const_undef
Definition: scale_const.F90:43
scale_file_cartesc
module file / cartesianC
Definition: scale_file_cartesC.F90:11
mod_atmos_phy_ae_vars::qe_ae
integer, public qe_ae
Definition: mod_atmos_phy_ae_vars.F90:69