SCALE-RM
Data Types | Functions/Subroutines | Variables
scale_atmos_boundary Module Reference

module ATMOSPHERE / Boundary treatment More...

Functions/Subroutines

subroutine, public atmos_boundary_setup
 Setup. More...
 
subroutine, public atmos_boundary_resume (DENS, MOMZ, MOMX, MOMY, RHOT, QTRC)
 Resume. More...
 
subroutine atmos_boundary_resume_file
 Resume boundary value for real case experiment. More...
 
subroutine atmos_boundary_resume_online
 Resume boundary value for real case experiment [online daughter]. More...
 
subroutine, public atmos_boundary_firstsend (DENS, MOMZ, MOMX, MOMY, RHOT, QTRC)
 First send boundary value. More...
 
subroutine, public atmos_boundary_finalize
 Finalize boundary value. More...
 
subroutine, public atmos_boundary_update (DENS, MOMZ, MOMX, MOMY, RHOT, QTRC)
 Update boundary value with a constant time boundary. More...
 
subroutine update_ref_index
 Update indices of array of boundary references. More...
 

Variables

integer, public bnd_qa
 
integer, public of
 
integer, public tracer
 
integer, public at
 
integer, public boundary
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_dens
 
real(rp), allocatable, public reference
 
real(rp), dimension(0-1), allocatable, public dens
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velz
 
real(rp), dimension(0-1), allocatable, public velz
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velx
 
real(rp), dimension(0-1), allocatable, public velx
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_vely
 
real(rp), dimension(0-1), allocatable, public vely
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_pott
 
real(rp), dimension(0-1), allocatable, public pott
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_boundary_qtrc
 
real(rp), dimension(0-1), allocatable, public qtrc
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_dens
 
real(rp), allocatable, public damping
 
real(rp), allocatable, public coefficient
 
real(rp), allocatable, public for
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_velz
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_velx
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_vely
 
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_pott
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_boundary_alpha_qtrc
 
real(rp), public atmos_boundary_smoother_fact = 0.2_RP
 
logical, public atmos_boundary_update_flag = .false.
 
logical, public switch
 
logical, public real
 
logical, public case
 

Detailed Description

module ATMOSPHERE / Boundary treatment

Description
Boundary treatment of model domain Additional forcing, Sponge layer, rayleigh dumping
Author
Team SCALE
History
  • 2011-12-07 (Y.Miyamoto) [new]
  • 2011-12-11 (H.Yashiro) [mod] integrate to SCALE-LES ver.3
  • 2012-03-23 (H.Yashiro) [mod] Explicit index parameter inclusion
  • 2014-05-18 (R.Yoshida) [add] boudary read/update for real case
  • 2014-09-05 (R.Yoshida) [add] boudary update by online communicate
NAMELIST
  • PARAM_ATMOS_BOUNDARY
    nametypedefault valuecomment
    ATMOS_BOUNDARY_TYPE character(len=H_SHORT) 'NONE'
    ATMOS_BOUNDARY_IN_BASENAME character(len=H_LONG) ''
    ATMOS_BOUNDARY_IN_CHECK_COORDINATES logical .true.
    ATMOS_BOUNDARY_OUT_BASENAME character(len=H_LONG) ''
    ATMOS_BOUNDARY_OUT_TITLE character(len=H_MID) 'SCALE-RM BOUNDARY CONDITION' title of the output file
    ATMOS_BOUNDARY_OUT_DTYPE character(len=H_SHORT) 'DEFAULT' REAL4 or REAL8
    ATMOS_BOUNDARY_USE_VELZ logical .false. read from file?
    ATMOS_BOUNDARY_USE_VELX logical .false. read from file?
    ATMOS_BOUNDARY_USE_VELY logical .false. read from file?
    ATMOS_BOUNDARY_USE_POTT logical .false. read from file?
    ATMOS_BOUNDARY_USE_DENS logical .false. read from file?
    ATMOS_BOUNDARY_USE_QV logical .false. read from file?
    ATMOS_BOUNDARY_USE_QHYD logical .false. read from file?
    ATMOS_BOUNDARY_VALUE_VELZ real(RP) 0.0_RP velocity w at boundary, 0 [m/s]
    ATMOS_BOUNDARY_VALUE_VELX real(RP) 0.0_RP velocity u at boundary, 0 [m/s]
    ATMOS_BOUNDARY_VALUE_VELY real(RP) 0.0_RP velocity v at boundary, 0 [m/s]
    ATMOS_BOUNDARY_VALUE_POTT real(RP) 300.0_RP potential temp. at boundary, 300 [K]
    ATMOS_BOUNDARY_VALUE_QTRC real(RP) 0.0_RP tracer at boundary, 0 [kg/kg]
    ATMOS_BOUNDARY_ALPHAFACT_DENS real(RP) 1.0_RP alpha factor again default
    ATMOS_BOUNDARY_ALPHAFACT_VELZ real(RP) 1.0_RP alpha factor again default
    ATMOS_BOUNDARY_ALPHAFACT_VELX real(RP) 1.0_RP alpha factor again default
    ATMOS_BOUNDARY_ALPHAFACT_VELY real(RP) 1.0_RP alpha factor again default
    ATMOS_BOUNDARY_ALPHAFACT_POTT real(RP) 1.0_RP alpha factor again default
    ATMOS_BOUNDARY_ALPHAFACT_QTRC real(RP) 1.0_RP alpha factor again default
    ATMOS_BOUNDARY_SMOOTHER_FACT real(RP) 0.2_RP fact for smoother to damping
    ATMOS_BOUNDARY_FRACZ real(RP) 1.0_RP fraction of boundary region for dumping (z) (0-1)
    ATMOS_BOUNDARY_FRACX real(RP) 1.0_RP fraction of boundary region for dumping (x) (0-1)
    ATMOS_BOUNDARY_FRACY real(RP) 1.0_RP fraction of boundary region for dumping (y) (0-1)
    ATMOS_BOUNDARY_TAUZ real(RP) maximum value for damping tau (z) [s]
    ATMOS_BOUNDARY_TAUX real(RP) maximum value for damping tau (x) [s]
    ATMOS_BOUNDARY_TAUY real(RP) maximum value for damping tau (y) [s]
    ATMOS_BOUNDARY_UPDATE_DT real(DP) 0.0_DP inteval time of boudary data update [s]
    ATMOS_BOUNDARY_START_DATE integer, dimension(6) (/ -9999, 0, 0, 0, 0, 0 /) boundary initial date
    ATMOS_BOUNDARY_LINEAR_V logical .false. linear or non-linear profile of relax region
    ATMOS_BOUNDARY_LINEAR_H logical .true. linear or non-linear profile of relax region
    ATMOS_BOUNDARY_EXP_H real(RP) 2.0_RP factor of non-linear profile of relax region
    ATMOS_BOUNDARY_INTERP_TYPE character(len=H_LONG) 'lerp_initpoint' type of boundary interporation

History Output
namedescriptionunitvariable
DENS_BND Boundary Density kg/m3 ATMOS_BOUNDARY_DENS
POTT_BND Boundary potential temperature K ATMOS_BOUNDARY_POTT
VELX_BND Boundary velocity x-direction m/s ATMOS_BOUNDARY_VELX
VELY_BND Boundary velocity y-direction m/s ATMOS_BOUNDARY_VELY
VELZ_BND Boundary velocity z-direction m/s ATMOS_BOUNDARY_VELZ
AQ_NAME_BND tracer name in the boundary data; AQ_NAME depends on the parent model or data, e.g, QV, QC, QR. kg/kg ATMOS_BOUNDARY_QTRC

Function/Subroutine Documentation

◆ atmos_boundary_setup()

subroutine, public scale_atmos_boundary::atmos_boundary_setup ( )

Setup.

Definition at line 203 of file scale_atmos_sub_boundary.F90.

References atmos_boundary_alpha_dens, atmos_boundary_alpha_pott, atmos_boundary_alpha_qtrc, atmos_boundary_alpha_velx, atmos_boundary_alpha_vely, atmos_boundary_alpha_velz, atmos_boundary_dens, atmos_boundary_pott, atmos_boundary_qtrc, atmos_boundary_smoother_fact, atmos_boundary_update_flag, atmos_boundary_velx, atmos_boundary_vely, atmos_boundary_velz, bnd_qa, scale_comm::comm_fill_bnd, scale_const::const_undef, scale_grid_index::ia, scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_fid_nml, scale_stdio::io_l, scale_stdio::io_nml, scale_grid_index::ja, scale_grid_index::ka, scale_grid_nest::offline, scale_grid_nest::online_iam_daughter, scale_grid_nest::online_iam_parent, scale_process::prc_mpistop(), scale_atmos_phy_mp::qa_mp, scale_time::time_dtsec, and scale_grid_nest::use_nesting.

Referenced by mod_atmos_driver::atmos_driver_setup().

203  use scale_process, only: &
205  use scale_comm, only: &
207  use scale_const, only: &
209  use scale_time, only: &
210  dt => time_dtsec
211  use scale_grid_nest, only: &
212  use_nesting, &
213  offline, &
216  use scale_atmos_phy_mp, only: &
217  qa_mp
218  implicit none
219 
220  namelist / param_atmos_boundary / &
221  atmos_boundary_type, &
222  atmos_boundary_in_basename, &
223  atmos_boundary_in_check_coordinates, &
224  atmos_boundary_out_basename, &
225  atmos_boundary_out_title, &
226  atmos_boundary_out_dtype, &
227  atmos_boundary_use_velz, &
228  atmos_boundary_use_velx, &
229  atmos_boundary_use_vely, &
230  atmos_boundary_use_pott, &
231  atmos_boundary_use_dens, &
232  atmos_boundary_use_qv, &
233  atmos_boundary_use_qhyd, &
234  atmos_boundary_value_velz, &
235  atmos_boundary_value_velx, &
236  atmos_boundary_value_vely, &
237  atmos_boundary_value_pott, &
238  atmos_boundary_value_qtrc, &
239  atmos_boundary_alphafact_dens, &
240  atmos_boundary_alphafact_velz, &
241  atmos_boundary_alphafact_velx, &
242  atmos_boundary_alphafact_vely, &
243  atmos_boundary_alphafact_pott, &
244  atmos_boundary_alphafact_qtrc, &
245  atmos_boundary_smoother_fact, &
246  atmos_boundary_fracz, &
247  atmos_boundary_fracx, &
248  atmos_boundary_fracy, &
249  atmos_boundary_tauz, &
250  atmos_boundary_taux, &
251  atmos_boundary_tauy, &
252  atmos_boundary_update_dt, &
253  atmos_boundary_start_date, &
254  atmos_boundary_linear_v, &
255  atmos_boundary_linear_h, &
256  atmos_boundary_exp_h, &
257  atmos_boundary_interp_type
258 
259  integer :: ierr
260  !---------------------------------------------------------------------------
261 
262  if( io_l ) write(io_fid_log,*)
263  if( io_l ) write(io_fid_log,*) '++++++ Module[BOUNDARY] / Categ[ATMOS-RM] / Origin[SCALElib]'
264 
265  atmos_boundary_tauz = dt * 10.0_rp
266  atmos_boundary_taux = dt * 10.0_rp
267  atmos_boundary_tauy = dt * 10.0_rp
268 
269  !--- read namelist
270  rewind(io_fid_conf)
271  read(io_fid_conf,nml=param_atmos_boundary,iostat=ierr)
272  if( ierr < 0 ) then !--- missing
273  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
274  elseif( ierr > 0 ) then !--- fatal error
275  write(*,*) 'xxx Not appropriate names in namelist PARAM_ATMOS_BOUNDARY. Check!'
276  call prc_mpistop
277  endif
278  if( io_nml ) write(io_fid_nml,nml=param_atmos_boundary)
279 
280  ! setting switches
281  if( .NOT. use_nesting ) then
282  atmos_boundary_online = .false.
283  else
284  if( offline ) then
285  atmos_boundary_online = .false.
286  else
287  atmos_boundary_online = .true.
288  endif
289  endif
290  do_parent_process = .false.
291  do_daughter_process = .false.
292  atmos_boundary_online_master = .false.
293  if ( atmos_boundary_online ) then
294  if ( online_iam_parent ) then
295  do_parent_process = .true.
296  if ( .NOT. online_iam_daughter ) then
297  atmos_boundary_online_master = .true.
298  endif
299  endif
300  if ( online_iam_daughter ) then
301  do_daughter_process = .true.
302  endif
303  endif
304 
305  if( atmos_boundary_use_qhyd ) then
306  bnd_qa = qa_mp
307  else if ( qa_mp > 0 ) then
308  bnd_qa = 1
309  else
310  bnd_qa = 0
311  end if
312 
313  allocate( atmos_boundary_dens(ka,ia,ja) )
314  allocate( atmos_boundary_velz(ka,ia,ja) )
315  allocate( atmos_boundary_velx(ka,ia,ja) )
316  allocate( atmos_boundary_vely(ka,ia,ja) )
317  allocate( atmos_boundary_pott(ka,ia,ja) )
318  allocate( atmos_boundary_qtrc(ka,ia,ja,bnd_qa) )
325 
326  allocate( atmos_boundary_alpha_dens(ka,ia,ja) )
327  allocate( atmos_boundary_alpha_velz(ka,ia,ja) )
328  allocate( atmos_boundary_alpha_velx(ka,ia,ja) )
329  allocate( atmos_boundary_alpha_vely(ka,ia,ja) )
330  allocate( atmos_boundary_alpha_pott(ka,ia,ja) )
331  allocate( atmos_boundary_alpha_qtrc(ka,ia,ja,bnd_qa) )
332  atmos_boundary_alpha_dens(:,:,:) = 0.0_rp
333  atmos_boundary_alpha_velz(:,:,:) = 0.0_rp
334  atmos_boundary_alpha_velx(:,:,:) = 0.0_rp
335  atmos_boundary_alpha_vely(:,:,:) = 0.0_rp
336  atmos_boundary_alpha_pott(:,:,:) = 0.0_rp
337  atmos_boundary_alpha_qtrc(:,:,:,:) = 0.0_rp
338 
339  if ( atmos_boundary_type == 'REAL' .OR. do_daughter_process ) then
340  l_bnd = .true.
341  else
342  l_bnd = .false.
343  end if
344 
345  if ( l_bnd ) then
346 
347  select case(atmos_boundary_interp_type)
348  case('same_parent')
349  get_boundary => get_boundary_same_parent
350  case('nearest_neighbor')
351  get_boundary => get_boundary_nearest_neighbor
352  case('lerp_initpoint')
353  get_boundary => get_boundary_lerp_initpoint
354  case('lerp_midpoint')
355  get_boundary => get_boundary_lerp_midpoint
356  case default
357  write(*,*) 'xxx Wrong parameter in ATMOS_BOUNDARY_interp_TYPE. Check!'
358  call prc_mpistop
359  end select
360 
361  comm_fill_bnd = .false.
362 
363  allocate( atmos_boundary_ref_dens(ka,ia,ja,ref_size) )
364  allocate( atmos_boundary_ref_velz(ka,ia,ja,ref_size) )
365  allocate( atmos_boundary_ref_velx(ka,ia,ja,ref_size) )
366  allocate( atmos_boundary_ref_vely(ka,ia,ja,ref_size) )
367  allocate( atmos_boundary_ref_pott(ka,ia,ja,ref_size) )
368  allocate( atmos_boundary_ref_qtrc(ka,ia,ja,bnd_qa,ref_size) )
369  atmos_boundary_ref_dens(:,:,:,:) = const_undef
370  atmos_boundary_ref_velz(:,:,:,:) = const_undef
371  atmos_boundary_ref_velx(:,:,:,:) = const_undef
372  atmos_boundary_ref_vely(:,:,:,:) = const_undef
373  atmos_boundary_ref_pott(:,:,:,:) = const_undef
374  atmos_boundary_ref_qtrc(:,:,:,:,:) = const_undef
375 
376  ! initialize boundary value (reading file or waiting parent domain)
377  if ( do_daughter_process ) then
378  call atmos_boundary_initialize_online
379  else
380  if ( atmos_boundary_in_basename /= '' ) then
381  call atmos_boundary_initialize_file
382  else
383  write(*,*) 'xxx You need specify ATMOS_BOUNDARY_IN_BASENAME'
384  call prc_mpistop
385  endif
386  endif
387 
388  call atmos_boundary_setalpha
389 
390  atmos_boundary_update_flag = .true.
391 
392  elseif ( atmos_boundary_type == 'NONE' ) then
393 
394  atmos_boundary_update_flag = .false.
395 
396  elseif ( atmos_boundary_type == 'CONST' ) then
397 
398  call atmos_boundary_generate
399 
400  call atmos_boundary_setalpha
401 
402  atmos_boundary_update_flag = .false.
403 
404  elseif ( atmos_boundary_type == 'INIT' ) then
405 
406  call atmos_boundary_setalpha
407 
408  atmos_boundary_update_flag = .false.
409 
410  elseif ( atmos_boundary_type == 'FILE' ) then
411 
412  if ( atmos_boundary_in_basename /= '' ) then
413  call atmos_boundary_read
414  else
415  write(*,*) 'xxx You need specify ATMOS_BOUNDARY_IN_BASENAME'
416  call prc_mpistop
417  endif
418 
419  atmos_boundary_update_flag = .false.
420 
421  else
422  write(*,*) 'xxx unsupported ATMOS_BOUNDARY_TYPE. Check!', trim(atmos_boundary_type)
423  call prc_mpistop
424  endif
425 
426  if ( use_nesting ) atmos_boundary_update_flag = .true.
427 
428  !----- report data -----
429  if( io_l ) write(io_fid_log,*)
430  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary parameters ***'
431  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary type : ', atmos_boundary_type
432  if( io_l ) write(io_fid_log,*)
433  if( io_l ) write(io_fid_log,*) '*** Is VELZ used in atmospheric boundary? : ', atmos_boundary_use_velz
434  if( io_l ) write(io_fid_log,*) '*** Is VELX used in atmospheric boundary? : ', atmos_boundary_use_velx
435  if( io_l ) write(io_fid_log,*) '*** Is VELY used in atmospheric boundary? : ', atmos_boundary_use_vely
436  if( io_l ) write(io_fid_log,*) '*** Is POTT used in atmospheric boundary? : ', atmos_boundary_use_pott
437  if( io_l ) write(io_fid_log,*) '*** Is DENS used in atmospheric boundary? : ', atmos_boundary_use_dens
438  if( io_l ) write(io_fid_log,*) '*** Is QV used in atmospheric boundary? : ', atmos_boundary_use_qv
439  if( io_l ) write(io_fid_log,*) '*** Is QHYD used in atmospheric boundary? : ', atmos_boundary_use_qhyd
440  if( io_l ) write(io_fid_log,*)
441  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary VELZ values : ', atmos_boundary_value_velz
442  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary VELX values : ', atmos_boundary_value_velx
443  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary VELY values : ', atmos_boundary_value_vely
444  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary POTT values : ', atmos_boundary_value_pott
445  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary QTRC values : ', atmos_boundary_value_qtrc
446  if( io_l ) write(io_fid_log,*)
447  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary smoother factor : ', atmos_boundary_smoother_fact
448  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary z-fraction : ', atmos_boundary_fracz
449  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary x-fraction : ', atmos_boundary_fracx
450  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary y-fraction : ', atmos_boundary_fracy
451  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary z-relaxation time : ', atmos_boundary_tauz
452  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary x-relaxation time : ', atmos_boundary_taux
453  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary y-relaxation time : ', atmos_boundary_tauy
454  if( io_l ) write(io_fid_log,*)
455  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary update dt : ', atmos_boundary_update_dt
456  if( io_l ) write(io_fid_log,*) '*** Atmospheric boundary start date : ', atmos_boundary_start_date(:)
457  if( io_l ) write(io_fid_log,*)
458  if( io_l ) write(io_fid_log,*) '*** Linear profile in vertically relax region : ', atmos_boundary_linear_v
459  if( io_l ) write(io_fid_log,*) '*** Linear profile in horizontally relax region : ', atmos_boundary_linear_h
460  if( io_l ) write(io_fid_log,*) '*** Non-linear factor in horizontally relax region : ', atmos_boundary_exp_h
461  if( io_l ) write(io_fid_log,*)
462  if( io_l ) write(io_fid_log,*) '*** Online nesting for lateral boundary : ', atmos_boundary_online
463 
464  if( io_l ) write(io_fid_log,*) '*** Does lateral boundary exist in this domain? : ', l_bnd
465  if ( l_bnd ) then
466  if( io_l ) write(io_fid_log,*) '*** Lateral boundary interporation type : ', atmos_boundary_interp_type
467  endif
468 
469  return
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velx
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velz
subroutine, public prc_mpistop
Abort MPI.
module GRID (nesting system)
logical, public online_iam_daughter
a flag to say "I am a daughter"
module ATMOSPHERE / Physics Cloud Microphysics
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_pott
logical, public offline
real(rp), public const_undef
Definition: scale_const.F90:43
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_velz
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_vely
real(rp), dimension(:,:,:,:), allocatable, public atmos_boundary_qtrc
real(dp), public time_dtsec
time interval of model [sec]
Definition: scale_time.F90:36
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_vely
module COMMUNICATION
Definition: scale_comm.F90:23
module TIME
Definition: scale_time.F90:15
module PROCESS
logical, public comm_fill_bnd
switch whether fill boundary data
Definition: scale_comm.F90:119
module CONSTANT
Definition: scale_const.F90:14
logical, public use_nesting
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_dens
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_dens
logical, public online_iam_parent
a flag to say "I am a parent"
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_pott
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_alpha_velx
real(rp), dimension(:,:,:,:), allocatable, public atmos_boundary_alpha_qtrc
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_boundary_resume()

subroutine, public scale_atmos_boundary::atmos_boundary_resume ( real(rp), dimension(ka,ia,ja), intent(in)  DENS,
real(rp), dimension(ka,ia,ja), intent(in)  MOMZ,
real(rp), dimension(ka,ia,ja), intent(in)  MOMX,
real(rp), dimension(ka,ia,ja), intent(in)  MOMY,
real(rp), dimension(ka,ia,ja), intent(in)  RHOT,
real(rp), dimension(ka,ia,ja,qa), intent(in)  QTRC 
)

Resume.

Definition at line 481 of file scale_atmos_sub_boundary.F90.

References atmos_boundary_alpha_dens, atmos_boundary_alpha_pott, atmos_boundary_alpha_qtrc, atmos_boundary_alpha_velx, atmos_boundary_alpha_vely, atmos_boundary_alpha_velz, atmos_boundary_dens, atmos_boundary_firstsend(), atmos_boundary_pott, atmos_boundary_qtrc, atmos_boundary_resume_file(), atmos_boundary_resume_online(), atmos_boundary_update_flag, atmos_boundary_velx, atmos_boundary_vely, atmos_boundary_velz, scale_atmos_phy_mp::atmos_phy_mp_name, scale_atmos_phy_mp::atmos_phy_mp_unit, scale_atmos_refstate::atmos_refstate_dens, bnd_qa, scale_calendar::calendar_combine_daysec(), scale_calendar::calendar_date2char(), scale_calendar::calendar_date2daysec(), scale_const::const_eps, scale_const::const_pi, dens, scale_fileio::fileio_close(), scale_fileio::fileio_open(), scale_grid::grid_cbfx, scale_grid::grid_cbfy, scale_grid::grid_cbfz, scale_grid::grid_fbfx, scale_grid::grid_fbfy, scale_grid::grid_fbfz, scale_grid_index::ia, scale_grid_index::ieb, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::isb, scale_grid_index::ja, scale_grid_index::jeb, scale_grid_index::jsb, scale_grid_index::ka, scale_grid_index::ke, scale_grid_index::ks, scale_grid_nest::online_use_velz, scale_process::prc_mpistop(), scale_atmos_phy_mp::qs_mp, qtrc, and scale_time::time_nowdate.

Referenced by mod_atmos_driver::atmos_driver_resume1().

481  implicit none
482 
483  real(RP), intent(in) :: DENS(KA,IA,JA)
484  real(RP), intent(in) :: MOMZ(KA,IA,JA)
485  real(RP), intent(in) :: MOMX(KA,IA,JA)
486  real(RP), intent(in) :: MOMY(KA,IA,JA)
487  real(RP), intent(in) :: RHOT(KA,IA,JA)
488  real(RP), intent(in) :: QTRC(KA,IA,JA,QA)
489 
490 
491  call atmos_boundary_firstsend( &
492  dens, momz, momx, momy, rhot, qtrc )
493 
494  if ( l_bnd ) then
495 
496  ! initialize boundary value (reading file or waiting parent domain)
497  if ( do_daughter_process ) then
498  call atmos_boundary_resume_online
499  else
500  if ( atmos_boundary_in_basename /= '' ) then
501  call atmos_boundary_resume_file
502  endif
503  endif
504 
505  elseif ( atmos_boundary_type == 'INIT' ) then
506 
507  call atmos_boundary_setinitval( dens, & ! [IN]
508  momz, & ! [IN]
509  momx, & ! [IN]
510  momy, & ! [IN]
511  rhot, & ! [IN]
512  qtrc ) ! [IN]
513  endif
514 
515  if( atmos_boundary_out_basename /= '' ) then
516  call atmos_boundary_write
517  endif
518 
519  if ( atmos_boundary_update_flag ) then
520 
521  call history_bnd( &
528  end if
529 
530  return
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velx
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velz
real(rp), dimension(:,:,:,:), allocatable, public atmos_boundary_qtrc
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_vely
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_dens
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_pott
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_boundary_resume_file()

subroutine scale_atmos_boundary::atmos_boundary_resume_file ( )

Resume boundary value for real case experiment.

Definition at line 1272 of file scale_atmos_sub_boundary.F90.

References atmos_boundary_dens, atmos_boundary_pott, atmos_boundary_qtrc, atmos_boundary_velx, atmos_boundary_vely, atmos_boundary_velz, bnd_qa, scale_calendar::calendar_combine_daysec(), scale_calendar::calendar_date2daysec(), scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_nest::nest_bnd_qa, scale_grid_nest::nest_comm_recvwait_issue(), scale_grid_nest::online_use_velz, scale_grid_nest::parent_dtsec, scale_process::prc_mpistop(), scale_time::time_dtsec, and scale_time::time_nowdate.

Referenced by atmos_boundary_resume().

1272  use gtool_file, only: &
1273  fileread
1274  use scale_process, only: &
1275  prc_mpistop
1276  use scale_time, only: &
1277  time_nowdate, &
1278  time_dtsec
1279  use scale_calendar, only: &
1282  implicit none
1283 
1284  real(RP) :: bnd_DENS(KA,IA,JA) ! damping coefficient for DENS (0-1)
1285  real(RP) :: bnd_VELZ(KA,IA,JA) ! damping coefficient for VELZ (0-1)
1286  real(RP) :: bnd_VELX(KA,IA,JA) ! damping coefficient for VELX (0-1)
1287  real(RP) :: bnd_VELY(KA,IA,JA) ! damping coefficient for VELY (0-1)
1288  real(RP) :: bnd_POTT(KA,IA,JA) ! damping coefficient for POTT (0-1)
1289  real(RP) :: bnd_QTRC(KA,IA,JA,BND_QA) ! damping coefficient for QTRC (0-1)
1290 
1291  integer :: run_time_startdate(6)
1292  integer :: run_time_startday
1293  real(DP) :: run_time_startsec
1294  real(DP) :: run_time_startms
1295  integer :: run_time_offset_year
1296  real(DP) :: run_time_nowdaysec
1297 
1298  real(DP) :: boundary_diff_daysec
1299  real(RP) :: boundary_inc_offset
1300  integer :: fillgaps_steps
1301 
1302  integer :: i, j, k, iq
1303  !---------------------------------------------------------------------------
1304 
1305  if ( atmos_boundary_update_dt <= 0.0_dp ) then
1306  write(*,*) 'xxx You need specify ATMOS_BOUNDARY_UPDATE_DT as larger than 0.0'
1307  call prc_mpistop
1308  endif
1309  update_nstep = nint( atmos_boundary_update_dt / time_dtsec )
1310  if ( abs(update_nstep * time_dtsec - atmos_boundary_update_dt) > 1e-10_dp ) then
1311  write(*,*) 'xxx ATMOS_BOUNDARY_UPDATE_DT is not multiple of DT'
1312  call prc_mpistop
1313  end if
1314 
1315  !--- recalculate time of the run [no offset]
1316  run_time_startdate(:) = time_nowdate(:)
1317  run_time_startms = 0.0_dp
1318  run_time_offset_year = 0
1319 
1320  call calendar_date2daysec( run_time_startday, & ! [OUT]
1321  run_time_startsec, & ! [OUT]
1322  run_time_startdate(:), & ! [IN]
1323  run_time_startms, & ! [IN]
1324  run_time_offset_year ) ! [IN]
1325 
1326  run_time_nowdaysec = calendar_combine_daysec( run_time_startday, run_time_startsec )
1327 
1328  boundary_diff_daysec = run_time_nowdaysec - boundary_time_initdaysec
1329  boundary_timestep = 1 + int( boundary_diff_daysec / atmos_boundary_update_dt )
1330  boundary_inc_offset = mod( boundary_diff_daysec, atmos_boundary_update_dt )
1331  fillgaps_steps = int( boundary_inc_offset / time_dtsec )
1332 
1333  if( io_l ) write(io_fid_log,*) '+++ BOUNDARY TIMESTEP NUMBER FOR INIT:', boundary_timestep
1334  if( io_l ) write(io_fid_log,*) '+++ BOUNDARY OFFSET:', boundary_inc_offset
1335  if( io_l ) write(io_fid_log,*) '+++ BOUNDARY FILLGAPS STEPS:', fillgaps_steps
1336 
1337  ! read boundary data from input file
1338  call atmos_boundary_update_file( ref_now )
1339 
1340  boundary_timestep = boundary_timestep + 1
1341  call atmos_boundary_update_file( ref_new )
1342 
1343  ! copy now to old
1344  !$omp parallel do default(none) private(i,j,k,iq) OMP_SCHEDULE_ collapse(2) &
1345  !$omp shared(JA,IA,KA,ATMOS_BOUNDARY_ref_DENS,ref_old,ref_now,ATMOS_BOUNDARY_ref_VELX) &
1346  !$omp shared(ATMOS_BOUNDARY_ref_VELY,ATMOS_BOUNDARY_ref_POTT,BND_QA,ATMOS_BOUNDARY_ref_QTRC)
1347  do j = 1, ja
1348  do i = 1, ia
1349  do k = 1, ka
1350  atmos_boundary_ref_dens(k,i,j,ref_old) = atmos_boundary_ref_dens(k,i,j,ref_now)
1351  atmos_boundary_ref_velx(k,i,j,ref_old) = atmos_boundary_ref_velx(k,i,j,ref_now)
1352  atmos_boundary_ref_vely(k,i,j,ref_old) = atmos_boundary_ref_vely(k,i,j,ref_now)
1353  atmos_boundary_ref_pott(k,i,j,ref_old) = atmos_boundary_ref_pott(k,i,j,ref_now)
1354  do iq = 1, bnd_qa
1355  atmos_boundary_ref_qtrc(k,i,j,iq,ref_old) = atmos_boundary_ref_qtrc(k,i,j,iq,ref_now)
1356  end do
1357  end do
1358  end do
1359  end do
1360 
1361  ! set boundary data
1362  do j = 1, ja
1363  do i = 1, ia
1364  do k = 1, ka
1365  atmos_boundary_dens(k,i,j) = atmos_boundary_ref_dens(k,i,j,ref_now)
1366  atmos_boundary_velx(k,i,j) = atmos_boundary_ref_velx(k,i,j,ref_now)
1367  atmos_boundary_vely(k,i,j) = atmos_boundary_ref_vely(k,i,j,ref_now)
1368  atmos_boundary_pott(k,i,j) = atmos_boundary_ref_pott(k,i,j,ref_now)
1369  do iq = 1, bnd_qa
1370  atmos_boundary_qtrc(k,i,j,iq) = atmos_boundary_ref_qtrc(k,i,j,iq,ref_now)
1371  end do
1372  end do
1373  end do
1374  end do
1375 
1376  if ( atmos_boundary_use_velz ) then
1377  do j = 1, ja
1378  do i = 1, ia
1379  do k = 1, ka
1380  atmos_boundary_velz(k,i,j) = atmos_boundary_value_velz
1381  end do
1382  end do
1383  end do
1384  end if
1385 
1386  now_step = fillgaps_steps
1387 
1388  ! get time boundary
1389  call get_boundary( bnd_dens(:,:,:), & ! [OUT]
1390  bnd_velz(:,:,:), & ! [OUT]
1391  bnd_velx(:,:,:), & ! [OUT]
1392  bnd_vely(:,:,:), & ! [OUT]
1393  bnd_pott(:,:,:), & ! [OUT]
1394  bnd_qtrc(:,:,:,:), & ! [OUT]
1395  now_step, & ! [IN]
1396  update_nstep ) ! [IN]
1397 
1398  ! fill in gaps of the offset
1399  do j = 1, ja
1400  do i = 1, ia
1401  do k = 1, ka
1402  atmos_boundary_dens(k,i,j) = bnd_dens(k,i,j)
1403  atmos_boundary_velx(k,i,j) = bnd_velx(k,i,j)
1404  atmos_boundary_vely(k,i,j) = bnd_vely(k,i,j)
1405  atmos_boundary_pott(k,i,j) = bnd_pott(k,i,j)
1406  do iq = 1, bnd_qa
1407  atmos_boundary_qtrc(k,i,j,iq) = bnd_qtrc(k,i,j,iq)
1408  end do
1409  end do
1410  end do
1411  end do
1412 
1413  return
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velx
module GTOOL_FILE
Definition: gtool_file.f90:17
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velz
subroutine, public prc_mpistop
Abort MPI.
real(dp) function, public calendar_combine_daysec(absday, abssec)
Combine day and second.
real(rp), dimension(:,:,:,:), allocatable, public atmos_boundary_qtrc
real(dp), public time_dtsec
time interval of model [sec]
Definition: scale_time.F90:36
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_vely
module TIME
Definition: scale_time.F90:15
module PROCESS
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_dens
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_pott
module CALENDAR
integer, dimension(6), public time_nowdate
current time [YYYY MM DD HH MM SS]
Definition: scale_time.F90:65
subroutine, public calendar_date2daysec(absday, abssec, ymdhms, subsec, offset_year)
Convert from gregorian date to absolute day/second.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_boundary_resume_online()

subroutine scale_atmos_boundary::atmos_boundary_resume_online ( )

Resume boundary value for real case experiment [online daughter].

Definition at line 1448 of file scale_atmos_sub_boundary.F90.

References atmos_boundary_dens, atmos_boundary_pott, atmos_boundary_qtrc, atmos_boundary_velx, atmos_boundary_vely, atmos_boundary_velz, bnd_qa, scale_grid_index::ia, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::ja, scale_grid_index::ka, scale_grid_nest::nest_comm_recvwait_issue(), scale_grid_nest::online_use_velz, scale_grid_nest::parent_nstep, scale_process::prc_mpistop(), scale_time::time_dtsec, and scale_time::time_nstep.

Referenced by atmos_boundary_resume().

1448  use scale_process, only: &
1449  prc_mpistop
1450  use scale_time, only: &
1451  time_dtsec, &
1452  time_nstep
1453  use scale_grid_nest, only: &
1455  online_use_velz, &
1456  parent_nstep
1457  implicit none
1458 
1459  ! parameters
1460  integer, parameter :: handle = 2
1461 
1462  ! works
1463  integer :: i, j, k, iq
1464  !---------------------------------------------------------------------------
1465 
1466  ! import data from parent domain
1467  boundary_timestep = 1
1468  if( io_l ) write(io_fid_log,*) '+++ BOUNDARY TIMESTEP NUMBER FOR INIT:', boundary_timestep
1469 
1470  call atmos_boundary_update_online_daughter( ref_now )
1471 
1472  boundary_timestep = boundary_timestep + 1
1473  if( io_l ) write(io_fid_log,*) '+++ BOUNDARY TIMESTEP NUMBER FOR INIT:', boundary_timestep
1474 
1475  call atmos_boundary_update_online_daughter( ref_new )
1476 
1477  ! copy now to old
1478  do j = 1, ja
1479  do i = 1, ia
1480  do k = 1, ka
1481  atmos_boundary_ref_dens(k,i,j,ref_old) = atmos_boundary_ref_dens(k,i,j,ref_now)
1482  atmos_boundary_ref_velx(k,i,j,ref_old) = atmos_boundary_ref_velx(k,i,j,ref_now)
1483  atmos_boundary_ref_vely(k,i,j,ref_old) = atmos_boundary_ref_vely(k,i,j,ref_now)
1484  atmos_boundary_ref_pott(k,i,j,ref_old) = atmos_boundary_ref_pott(k,i,j,ref_now)
1485  do iq = 1, bnd_qa
1486  atmos_boundary_ref_qtrc(k,i,j,iq,ref_old) = atmos_boundary_ref_qtrc(k,i,j,iq,ref_now)
1487  end do
1488  end do
1489  end do
1490  end do
1491 
1492  ! set boundary data
1493  do j = 1, ja
1494  do i = 1, ia
1495  do k = 1, ka
1496  atmos_boundary_dens(k,i,j) = atmos_boundary_ref_dens(k,i,j,ref_now)
1497  atmos_boundary_velx(k,i,j) = atmos_boundary_ref_velx(k,i,j,ref_now)
1498  atmos_boundary_vely(k,i,j) = atmos_boundary_ref_vely(k,i,j,ref_now)
1499  atmos_boundary_pott(k,i,j) = atmos_boundary_ref_pott(k,i,j,ref_now)
1500  do iq = 1, bnd_qa
1501  atmos_boundary_qtrc(k,i,j,iq) = atmos_boundary_ref_qtrc(k,i,j,iq,ref_now)
1502  end do
1503  end do
1504  end do
1505  end do
1506 
1507  if ( online_use_velz ) then
1508  do j = 1, ja
1509  do i = 1, ia
1510  do k = 1, ka
1511  atmos_boundary_velz(k,i,j) = atmos_boundary_ref_velz(k,i,j,ref_now)
1512  end do
1513  end do
1514  end do
1515  else if ( atmos_boundary_use_velz ) then
1516  do j = 1, ja
1517  do i = 1, ia
1518  do k = 1, ka
1519  atmos_boundary_velz(k,i,j) = atmos_boundary_value_velz
1520  end do
1521  end do
1522  end do
1523  end if
1524 
1525  update_nstep = nint( atmos_boundary_update_dt / time_dtsec )
1526  if ( update_nstep * parent_nstep(handle) /= time_nstep ) then
1527  write(*,*) 'xxx NSTEP is not multiple of PARENT_NSTEP'
1528  call prc_mpistop
1529  end if
1530 
1531  now_step = 0 ! should be set as zero in initialize process
1532 
1533  return
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velx
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velz
subroutine, public prc_mpistop
Abort MPI.
module GRID (nesting system)
integer, public time_nstep
total steps [number]
Definition: scale_time.F90:71
integer, dimension(2), public parent_nstep
parent step [number]
real(rp), dimension(:,:,:,:), allocatable, public atmos_boundary_qtrc
real(dp), public time_dtsec
time interval of model [sec]
Definition: scale_time.F90:36
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_vely
module TIME
Definition: scale_time.F90:15
module PROCESS
subroutine, public nest_comm_recvwait_issue(HANDLE, BND_QA)
Sub-command for data transfer from parent to daughter: nestdown.
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_dens
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_pott
logical, public online_use_velz
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_boundary_firstsend()

subroutine, public scale_atmos_boundary::atmos_boundary_firstsend ( real(rp), dimension(ka,ia,ja), intent(in)  DENS,
real(rp), dimension(ka,ia,ja), intent(in)  MOMZ,
real(rp), dimension(ka,ia,ja), intent(in)  MOMX,
real(rp), dimension(ka,ia,ja), intent(in)  MOMY,
real(rp), dimension(ka,ia,ja), intent(in)  RHOT,
real(rp), dimension(ka,ia,ja,qa), intent(in)  QTRC 
)

First send boundary value.

Definition at line 1540 of file scale_atmos_sub_boundary.F90.

References dens, and qtrc.

Referenced by atmos_boundary_resume().

1540  implicit none
1541 
1542  ! arguments
1543  real(RP), intent(in) :: DENS(KA,IA,JA)
1544  real(RP), intent(in) :: MOMZ(KA,IA,JA)
1545  real(RP), intent(in) :: MOMX(KA,IA,JA)
1546  real(RP), intent(in) :: MOMY(KA,IA,JA)
1547  real(RP), intent(in) :: RHOT(KA,IA,JA)
1548  real(RP), intent(in) :: QTRC(KA,IA,JA,QA)
1549  !---------------------------------------------------------------------------
1550 
1551  ! send data at the first time
1552  if ( do_parent_process ) then !online [parent]
1553  ! issue send
1554  call atmos_boundary_send( dens, momz, momx, momy, rhot, qtrc )
1555  endif
1556 
1557  return
Here is the caller graph for this function:

◆ atmos_boundary_finalize()

subroutine, public scale_atmos_boundary::atmos_boundary_finalize ( )

Finalize boundary value.

Definition at line 1563 of file scale_atmos_sub_boundary.F90.

References scale_fileio::fileio_close(), scale_grid_nest::nest_bnd_qa, scale_grid_nest::nest_comm_recv_cancel(), and scale_grid_nest::nest_comm_recvwait_issue().

Referenced by mod_atmos_driver::atmos_driver_finalize().

1563  use scale_grid_nest, only: &
1566  nestqa => nest_bnd_qa
1567  use scale_fileio, only: &
1568  fileio_close
1569  implicit none
1570 
1571  ! works
1572  integer :: handle
1573  !---------------------------------------------------------------------------
1574 
1575  if ( do_parent_process ) then !online [parent]
1576  handle = 1
1577  call nest_comm_recvwait_issue( handle, nestqa )
1578  endif
1579 
1580  if ( do_daughter_process ) then !online [daughter]
1581  handle = 2
1582  call nest_comm_recv_cancel( handle )
1583  endif
1584 
1585  if ( atmos_boundary_fid > 0 ) then
1586  call fileio_close( atmos_boundary_fid )
1587  atmos_boundary_fid = -1
1588  end if
1589 
1590  return
module GRID (nesting system)
integer, public nest_bnd_qa
number of tracer treated in nesting system
module FILE I/O (netcdf)
subroutine, public nest_comm_recv_cancel(HANDLE)
Sub-command for data transfer from parent to daughter: nestdown.
subroutine, public nest_comm_recvwait_issue(HANDLE, BND_QA)
Sub-command for data transfer from parent to daughter: nestdown.
subroutine, public fileio_close(fid)
Close a netCDF file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_boundary_update()

subroutine, public scale_atmos_boundary::atmos_boundary_update ( real(rp), dimension(ka,ia,ja), intent(inout)  DENS,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMZ,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMX,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMY,
real(rp), dimension(ka,ia,ja), intent(inout)  RHOT,
real(rp), dimension(ka,ia,ja,qa), intent(inout)  QTRC 
)

Update boundary value with a constant time boundary.

Definition at line 1597 of file scale_atmos_sub_boundary.F90.

References atmos_boundary_dens, atmos_boundary_pott, atmos_boundary_qtrc, atmos_boundary_velx, atmos_boundary_vely, atmos_boundary_velz, scale_atmos_hydrometeor::atmos_hydrometeor_diagnose_number_concentration(), scale_atmos_phy_mp::atmos_phy_mp_name, bnd_qa, scale_grid_nest::daughter_ia, scale_grid_nest::daughter_ja, scale_grid_nest::daughter_ka, dens, scale_fileio::fileio_flush(), scale_grid_index::ia, scale_grid_index::ie, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::is, scale_grid_index::ja, scale_grid_index::je, scale_grid_index::js, scale_grid_index::ka, scale_grid_index::ke, scale_grid_index::ks, scale_grid_nest::nest_bnd_qa, scale_grid_nest::nest_comm_nestdown(), scale_grid_nest::nest_comm_recvwait_issue(), scale_grid_nest::nest_comm_test(), scale_grid_nest::online_boundary_diagqnum, scale_grid_nest::online_use_velz, scale_grid_nest::parent_ia, scale_grid_nest::parent_ja, scale_grid_nest::parent_ka, scale_rm_process::prc_has_e, scale_rm_process::prc_has_n, scale_rm_process::prc_has_s, scale_rm_process::prc_has_w, scale_process::prc_mpistop(), scale_tracer::qa, scale_atmos_phy_mp::qa_mp, scale_atmos_phy_mp::qs_mp, qtrc, scale_time::time_dtsec, and update_ref_index().

Referenced by mod_atmos_driver::atmos_driver().

1597  use scale_process, only: &
1598  prc_mpistop
1599  use scale_rm_process, only: &
1600  prc_has_w, &
1601  prc_has_e, &
1602  prc_has_s, &
1603  prc_has_n
1604  use scale_atmos_phy_mp, only: &
1605  qs_mp
1606  use scale_grid_nest, only: &
1607  online_use_velz, &
1609  implicit none
1610 
1611  real(RP), intent(inout) :: DENS(KA,IA,JA)
1612  real(RP), intent(inout) :: MOMZ(KA,IA,JA)
1613  real(RP), intent(inout) :: MOMX(KA,IA,JA)
1614  real(RP), intent(inout) :: MOMY(KA,IA,JA)
1615  real(RP), intent(inout) :: RHOT(KA,IA,JA)
1616  real(RP), intent(inout) :: QTRC(KA,IA,JA,QA)
1617 
1618  real(RP) :: bnd_DENS(KA,IA,JA) ! damping coefficient for DENS (0-1)
1619  real(RP) :: bnd_VELZ(KA,IA,JA) ! damping coefficient for VELZ (0-1)
1620  real(RP) :: bnd_VELX(KA,IA,JA) ! damping coefficient for VELX (0-1)
1621  real(RP) :: bnd_VELY(KA,IA,JA) ! damping coefficient for VELY (0-1)
1622  real(RP) :: bnd_POTT(KA,IA,JA) ! damping coefficient for POTT (0-1)
1623  real(RP) :: bnd_QTRC(KA,IA,JA,BND_QA) ! damping coefficient for QTRC (0-1)
1624 
1625  integer :: handle
1626  integer :: i, j, k, iq, iqa
1627  !---------------------------------------------------------------------------
1628 
1629  if ( do_parent_process ) then !online [parent]
1630  ! should be called every time step
1631  call atmos_boundary_update_online_parent( dens,momz,momx,momy,rhot,qtrc )
1632  endif
1633 
1634  if ( l_bnd ) then
1635  ! update referce vars
1636  if ( now_step >= update_nstep ) then
1637  now_step = 0
1638  boundary_timestep = boundary_timestep + 1
1639 
1640  call update_ref_index
1641 
1642  if ( do_daughter_process ) then !online [daughter]
1643  call atmos_boundary_update_online_daughter( ref_new )
1644  else
1645  call atmos_boundary_update_file( ref_new )
1646  end if
1647  end if
1648 
1649  ! step boundary
1650  now_step = now_step + 1
1651 
1652  ! get boundaryal coefficients
1653  call get_boundary( bnd_dens(:,:,:), & ! [OUT]
1654  bnd_velz(:,:,:), & ! [OUT]
1655  bnd_velx(:,:,:), & ! [OUT]
1656  bnd_vely(:,:,:), & ! [OUT]
1657  bnd_pott(:,:,:), & ! [OUT]
1658  bnd_qtrc(:,:,:,:), & ! [OUT]
1659  now_step, & ! [IN]
1660  update_nstep ) ! [IN]
1661 
1662  ! update boundary vars
1663  do j = 1, ja
1664  do i = 1, ia
1665  do k = 1, ka
1666  atmos_boundary_dens(k,i,j) = bnd_dens(k,i,j)
1667  atmos_boundary_velx(k,i,j) = bnd_velx(k,i,j)
1668  atmos_boundary_vely(k,i,j) = bnd_vely(k,i,j)
1669  atmos_boundary_pott(k,i,j) = bnd_pott(k,i,j)
1670  do iq = 1, bnd_qa
1671  atmos_boundary_qtrc(k,i,j,iq) = bnd_qtrc(k,i,j,iq)
1672  end do
1673  end do
1674  end do
1675  end do
1676  if ( online_use_velz ) then
1677  do j = 1, ja
1678  do i = 1, ia
1679  do k = 1, ka
1680  atmos_boundary_velz(k,i,j) = bnd_velz(k,i,j)
1681  end do
1682  end do
1683  end do
1684  end if
1685 
1686  ! fill HALO in western region
1687  if ( .NOT. prc_has_w ) then
1688  !$omp parallel do default(none) &
1689  !$omp shared(JS,IS,KA,DENS,ATMOS_BOUNDARY_DENS,MOMX,ATMOS_BOUNDARY_VELX,RHOT) &
1690  !$omp shared(ATMOS_BOUNDARY_POTT,ATMOS_BOUNDARY_QTRC,BND_QA,QS_MP,QTRC,QA,JA) &
1691  !$omp private(i,j,k,iq,iqa) OMP_SCHEDULE_ collapse(2)
1692  do j = 1, ja
1693  do i = 1, is-1
1694  do k = 1, ka
1695  dens(k,i,j) = atmos_boundary_dens(k,i,j)
1696  momx(k,i,j) = atmos_boundary_velx(k,i,j) &
1697  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k,i+1,j) ) * 0.5_rp
1698  rhot(k,i,j) = atmos_boundary_pott(k,i,j) * atmos_boundary_dens(k,i,j)
1699  do iq = 1, bnd_qa
1700  iqa = iq + qs_mp - 1
1701  qtrc(k,i,j,iqa) = atmos_boundary_qtrc(k,i,j,iq)
1702  end do
1703  do iq = 1, qa
1704  if ( iq < qs_mp .or. iq >= bnd_qa + qs_mp ) then
1705  qtrc(k,i,j,iq) = qtrc(k,is,j,iq) &
1706  * ( 0.5_rp - sign(0.5_rp, atmos_boundary_velx(k,is-1,j)) )
1707  end if
1708  end do
1709  end do
1710  end do
1711  end do
1712  do j = 1, ja-1
1713  do i = 1, is-1
1714  do k = 1, ka
1715  momy(k,i,j) = atmos_boundary_vely(k,i,j) &
1716  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k,i,j+1) ) * 0.5_rp
1717  end do
1718  end do
1719  end do
1720  do i = 1, is-1
1721  do k = 1, ka
1722  momy(k,i,ja) = atmos_boundary_vely(k,i,ja) &
1723  * atmos_boundary_dens(k,i,ja)
1724  end do
1725  end do
1726  if ( online_use_velz ) then
1727  do j = 1, ja
1728  do i = 1, is-1
1729  do k = ks, ke-1
1730  momz(k,i,j) = atmos_boundary_velz(k,i,j) &
1731  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k+1,i,j) ) * 0.5_rp
1732  end do
1733  end do
1734  end do
1735  else
1736  do j = 1, ja
1737  do i = 1, is-1
1738  do k = ks, ke-1
1739  momz(k,i,j) = momz(k,is,j)
1740  end do
1741  end do
1742  end do
1743  end if
1744  end if
1745 
1746  ! fill HALO in eastern region
1747  if ( .NOT. prc_has_e ) then
1748  !$omp parallel do default(none) &
1749  !$omp shared(JA,IE,IA,KA,DENS,ATMOS_BOUNDARY_DENS,ATMOS_BOUNDARY_VELX,RHOT) &
1750  !$omp shared(ATMOS_BOUNDARY_POTT,ATMOS_BOUNDARY_QTRC,BND_QA,QS_MP,QTRC,QA) &
1751  !$omp private(i,j,k,iq,iqa) OMP_SCHEDULE_ collapse(2)
1752  do j = 1, ja
1753  do i = ie+1, ia
1754  do k = 1, ka
1755  dens(k,i,j) = atmos_boundary_dens(k,i,j)
1756  rhot(k,i,j) = atmos_boundary_pott(k,i,j) * atmos_boundary_dens(k,i,j)
1757  do iq = 1, bnd_qa
1758  iqa = iq + qs_mp - 1
1759  qtrc(k,i,j,iqa) = atmos_boundary_qtrc(k,i,j,iq)
1760  end do
1761  do iq = 1, qa
1762  if ( iq < qs_mp .or. iq >= bnd_qa + qs_mp ) then
1763  qtrc(k,i,j,iq) = qtrc(k,ie,j,iq) &
1764  * ( 0.5_rp + sign(0.5_rp, atmos_boundary_velx(k,ie,j)) )
1765  end if
1766  end do
1767  end do
1768  end do
1769  end do
1770  do j = 1, ja
1771  do i = ie, ia-1
1772  do k = 1, ka
1773  momx(k,i,j) = atmos_boundary_velx(k,i,j) &
1774  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k,i+1,j) ) * 0.5_rp
1775  end do
1776  end do
1777  end do
1778  do j = 1, ja
1779  do k = 1, ka
1780  momx(k,ia,j) = atmos_boundary_velx(k,ia,j) * atmos_boundary_dens(k,ia,j)
1781  end do
1782  end do
1783  do j = 1, ja-1
1784  do i = ie+1, ia
1785  do k = 1, ka
1786  momy(k,i,j) = atmos_boundary_vely(k,i,j) &
1787  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k,i,j+1) ) * 0.5_rp
1788  end do
1789  end do
1790  end do
1791  do i = ie+1, ia
1792  do k = 1, ka
1793  momy(k,i,ja) = atmos_boundary_vely(k,i,ja) &
1794  * atmos_boundary_dens(k,i,ja)
1795  end do
1796  end do
1797  if ( online_use_velz ) then
1798  do j = 1, ja
1799  do i = ie+1, ia
1800  do k = ks, ke-1
1801  momz(k,i,j) = atmos_boundary_velz(k,i,j) &
1802  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k+1,i,j) ) * 0.5_rp
1803  end do
1804  end do
1805  end do
1806  else
1807  do j = 1, ja
1808  do i = ie+1, ia
1809  do k = ks, ke-1
1810  momz(k,i,j) = momz(k,ie,j)
1811  end do
1812  end do
1813  end do
1814  end if
1815  end if
1816 
1817  ! fill HALO in southern region
1818  if ( .NOT. prc_has_s ) then
1819  !$omp parallel do default(none) &
1820  !$omp shared(JS,IA,KA,DENS,ATMOS_BOUNDARY_DENS,MOMY,ATMOS_BOUNDARY_VELY,RHOT) &
1821  !$omp shared(ATMOS_BOUNDARY_POTT,ATMOS_BOUNDARY_QTRC,BND_QA,QS_MP,QTRC,QA) &
1822  !$omp private(i,j,k,iq,iqa) OMP_SCHEDULE_ collapse(2)
1823  do j = 1, js-1
1824  do i = 1, ia
1825  do k = 1, ka
1826  dens(k,i,j) = atmos_boundary_dens(k,i,j)
1827  momy(k,i,j) = atmos_boundary_vely(k,i,j) &
1828  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k,i,j+1) ) * 0.5_rp
1829  rhot(k,i,j) = atmos_boundary_pott(k,i,j) * atmos_boundary_dens(k,i,j)
1830  do iq = 1, bnd_qa
1831  iqa = iq + qs_mp - 1
1832  qtrc(k,i,j,iqa) = atmos_boundary_qtrc(k,i,j,iq)
1833  end do
1834  do iq = 1, qa
1835  if ( iq < qs_mp .or. iq >= bnd_qa + qs_mp ) then
1836  qtrc(k,i,j,iq) = qtrc(k,i,js,iq) &
1837  * ( 0.5_rp - sign(0.5_rp, atmos_boundary_vely(k,i,js-1)) )
1838  end if
1839  end do
1840  end do
1841  end do
1842  end do
1843  do j = 1, js-1
1844  do i = 1, ia-1
1845  do k = 1, ka
1846  momx(k,i,j) = atmos_boundary_velx(k,i,j) &
1847  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k,i+1,j) ) * 0.5_rp
1848  end do
1849  end do
1850  end do
1851  do j = 1, js-1
1852  do k = 1, ka
1853  momx(k,ia,j) = atmos_boundary_velx(k,ia,j) &
1854  * atmos_boundary_dens(k,ia,j)
1855  end do
1856  end do
1857  if ( online_use_velz ) then
1858  do j = 1, js-1
1859  do i = 1, ia
1860  do k = ks, ke-1
1861  momz(k,i,j) = atmos_boundary_velz(k,i,j) &
1862  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k+1,i,j) ) * 0.5_rp
1863  end do
1864  end do
1865  end do
1866  else
1867  do j = 1, js-1
1868  do i = 1, ia
1869  do k = ks, ke-1
1870  momz(k,i,j) = momz(k,i,js)
1871  end do
1872  end do
1873  end do
1874  end if
1875  end if
1876 
1877  ! fill HALO in northern region
1878  if ( .NOT. prc_has_n ) then
1879  !$omp parallel do default(none) &
1880  !$omp shared(JE,JA,IA,KA,DENS,ATMOS_BOUNDARY_DENS,ATMOS_BOUNDARY_VELY,RHOT) &
1881  !$omp shared(ATMOS_BOUNDARY_POTT,ATMOS_BOUNDARY_QTRC,BND_QA,QS_MP,QTRC,QA) &
1882  !$omp private(i,j,k,iq,iqa) OMP_SCHEDULE_ collapse(2)
1883  do j = je+1, ja
1884  do i = 1, ia
1885  do k = 1, ka
1886  dens(k,i,j) = atmos_boundary_dens(k,i,j)
1887  rhot(k,i,j) = atmos_boundary_pott(k,i,j) * atmos_boundary_dens(k,i,j)
1888  do iq = 1, bnd_qa
1889  iqa = iq + qs_mp - 1
1890  qtrc(k,i,j,iqa) = atmos_boundary_qtrc(k,i,j,iq)
1891  end do
1892  do iq = bnd_qa+1, qa
1893  if ( iq < qs_mp .or. iq >= bnd_qa + qs_mp ) then
1894  qtrc(k,i,j,iq) = qtrc(k,i,je,iq) &
1895  * ( 0.5_rp + sign(0.5_rp, atmos_boundary_vely(k,i,je)) )
1896  end if
1897  end do
1898  end do
1899  end do
1900  end do
1901  do j = je, ja-1
1902  do i = 1, ia
1903  do k = 1, ka
1904  momy(k,i,j) = atmos_boundary_vely(k,i,j) &
1905  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k,i,j+1) ) * 0.5_rp
1906  end do
1907  end do
1908  end do
1909  do i = 1, ia
1910  do k = 1, ka
1911  momy(k,i,ja) = atmos_boundary_vely(k,i,ja) * atmos_boundary_dens(k,i,ja)
1912  end do
1913  end do
1914  do j = je+1, ja
1915  do i = 1, ia-1
1916  do k = 1, ka
1917  momx(k,i,j) = atmos_boundary_velx(k,i,j) &
1918  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k,i+1,j) ) * 0.5_rp
1919  end do
1920  end do
1921  end do
1922  do j = je+1, ja
1923  do k = 1, ka
1924  momx(k,ia,j) = atmos_boundary_velx(k,ia,j) &
1925  * atmos_boundary_dens(k,ia,j)
1926  end do
1927  end do
1928  if ( online_use_velz ) then
1929  do j = je+1, ja
1930  do i = 1, ia
1931  do k = ks, ke-1
1932  momz(k,i,j) = atmos_boundary_velz(k,i,j) &
1933  * ( atmos_boundary_dens(k,i,j) + atmos_boundary_dens(k+1,i,j) ) * 0.5_rp
1934  end do
1935  end do
1936  end do
1937  else
1938  do j = je+1, ja
1939  do i = 1, ia
1940  do k = ks, ke-1
1941  momz(k,i,j) = momz(k,i,je)
1942  end do
1943  end do
1944  end do
1945  end if
1946  end if
1947 
1948  elseif ( do_parent_process ) then
1949  ! do nothing
1950  else
1951  write(*,*) 'xxx [BUG] invalid path'
1952  call prc_mpistop
1953  end if
1954 
1955  call history_bnd( atmos_boundary_dens, &
1961 
1962  ! To be enable to do asynchronous communicaton
1963  if ( do_parent_process ) then !online [parent]
1964  handle = 1
1965  call nest_comm_test( handle )
1966  endif
1967  if ( do_daughter_process ) then !online [daughter]
1968  handle = 2
1969  call nest_comm_test( handle )
1970  endif
1971 
1972  return
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velx
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_velz
logical, public prc_has_n
subroutine, public prc_mpistop
Abort MPI.
module GRID (nesting system)
module ATMOSPHERE / Physics Cloud Microphysics
logical, public prc_has_e
logical, public prc_has_s
real(rp), dimension(:,:,:,:), allocatable, public atmos_boundary_qtrc
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_vely
module PROCESS
module RM PROCESS
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_dens
real(rp), dimension(:,:,:), allocatable, public atmos_boundary_pott
logical, public online_use_velz
logical, public prc_has_w
subroutine, public nest_comm_test(HANDLE)
[check communication status] Inter-communication
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_ref_index()

subroutine scale_atmos_boundary::update_ref_index ( )

Update indices of array of boundary references.

Definition at line 2489 of file scale_atmos_sub_boundary.F90.

References scale_atmos_phy_mp::atmos_phy_mp_name.

Referenced by atmos_boundary_update().

2489  implicit none
2490 
2491  ! works
2492  integer :: ref_tmp
2493  !---------------------------------------------------------------------------
2494 
2495  ref_tmp = ref_old
2496  ref_old = ref_now
2497  ref_now = ref_new
2498  ref_new = ref_tmp
2499 
2500  return
Here is the caller graph for this function:

Variable Documentation

◆ bnd_qa

integer, public scale_atmos_boundary::bnd_qa

◆ of

integer, public scale_atmos_boundary::of

Definition at line 52 of file scale_atmos_sub_boundary.F90.

◆ tracer

integer, public scale_atmos_boundary::tracer

Definition at line 52 of file scale_atmos_sub_boundary.F90.

◆ at

integer, public scale_atmos_boundary::at

Definition at line 52 of file scale_atmos_sub_boundary.F90.

◆ boundary

integer, public scale_atmos_boundary::boundary

Definition at line 52 of file scale_atmos_sub_boundary.F90.

◆ atmos_boundary_dens

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_dens

◆ reference

real(rp), allocatable, public scale_atmos_boundary::reference

Definition at line 54 of file scale_atmos_sub_boundary.F90.

◆ dens

real(rp), dimension (0-1), allocatable, public scale_atmos_boundary::dens

◆ atmos_boundary_velz

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_velz

◆ velz

real(rp), dimension (0-1), allocatable, public scale_atmos_boundary::velz

Definition at line 55 of file scale_atmos_sub_boundary.F90.

◆ atmos_boundary_velx

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_velx

◆ velx

real(rp), dimension (0-1), allocatable, public scale_atmos_boundary::velx

Definition at line 56 of file scale_atmos_sub_boundary.F90.

◆ atmos_boundary_vely

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_vely

◆ vely

real(rp), dimension (0-1), allocatable, public scale_atmos_boundary::vely

Definition at line 57 of file scale_atmos_sub_boundary.F90.

◆ atmos_boundary_pott

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_pott

◆ pott

real(rp), dimension (0-1), allocatable, public scale_atmos_boundary::pott

Definition at line 58 of file scale_atmos_sub_boundary.F90.

◆ atmos_boundary_qtrc

real(rp), dimension(:,:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_qtrc

◆ qtrc

real(rp), dimension (0-1), allocatable, public scale_atmos_boundary::qtrc

◆ atmos_boundary_alpha_dens

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_alpha_dens

Definition at line 61 of file scale_atmos_sub_boundary.F90.

Referenced by atmos_boundary_resume(), atmos_boundary_setup(), and mod_atmos_dyn_driver::atmos_dyn_driver().

61  real(RP), public, allocatable :: ATMOS_BOUNDARY_alpha_DENS(:,:,:)

◆ damping

real(rp), allocatable, public scale_atmos_boundary::damping

Definition at line 61 of file scale_atmos_sub_boundary.F90.

◆ coefficient

real(rp), allocatable, public scale_atmos_boundary::coefficient

Definition at line 61 of file scale_atmos_sub_boundary.F90.

◆ for

logical allocatable public scale_atmos_boundary::for

Definition at line 61 of file scale_atmos_sub_boundary.F90.

◆ atmos_boundary_alpha_velz

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_alpha_velz

Definition at line 62 of file scale_atmos_sub_boundary.F90.

Referenced by atmos_boundary_resume(), atmos_boundary_setup(), and mod_atmos_dyn_driver::atmos_dyn_driver().

62  real(RP), public, allocatable :: ATMOS_BOUNDARY_alpha_VELZ(:,:,:)

◆ atmos_boundary_alpha_velx

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_alpha_velx

Definition at line 63 of file scale_atmos_sub_boundary.F90.

Referenced by atmos_boundary_resume(), atmos_boundary_setup(), and mod_atmos_dyn_driver::atmos_dyn_driver().

63  real(RP), public, allocatable :: ATMOS_BOUNDARY_alpha_VELX(:,:,:)

◆ atmos_boundary_alpha_vely

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_alpha_vely

Definition at line 64 of file scale_atmos_sub_boundary.F90.

Referenced by atmos_boundary_resume(), atmos_boundary_setup(), and mod_atmos_dyn_driver::atmos_dyn_driver().

64  real(RP), public, allocatable :: ATMOS_BOUNDARY_alpha_VELY(:,:,:)

◆ atmos_boundary_alpha_pott

real(rp), dimension(:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_alpha_pott

Definition at line 65 of file scale_atmos_sub_boundary.F90.

Referenced by atmos_boundary_resume(), atmos_boundary_setup(), and mod_atmos_dyn_driver::atmos_dyn_driver().

65  real(RP), public, allocatable :: ATMOS_BOUNDARY_alpha_POTT(:,:,:)

◆ atmos_boundary_alpha_qtrc

real(rp), dimension(:,:,:,:), allocatable, public scale_atmos_boundary::atmos_boundary_alpha_qtrc

Definition at line 66 of file scale_atmos_sub_boundary.F90.

Referenced by atmos_boundary_resume(), atmos_boundary_setup(), and mod_atmos_dyn_driver::atmos_dyn_driver().

66  real(RP), public, allocatable :: ATMOS_BOUNDARY_alpha_QTRC(:,:,:,:)

◆ atmos_boundary_smoother_fact

real(rp), public scale_atmos_boundary::atmos_boundary_smoother_fact = 0.2_RP

◆ atmos_boundary_update_flag

logical, public scale_atmos_boundary::atmos_boundary_update_flag = .false.

Definition at line 71 of file scale_atmos_sub_boundary.F90.

Referenced by atmos_boundary_resume(), atmos_boundary_setup(), mod_atmos_driver::atmos_driver(), and mod_atmos_driver::atmos_driver_finalize().

71  logical, public :: ATMOS_BOUNDARY_UPDATE_FLAG = .false.

◆ switch

logical, public scale_atmos_boundary::switch

Definition at line 71 of file scale_atmos_sub_boundary.F90.

◆ real

scale_atmos_boundary::real

Definition at line 71 of file scale_atmos_sub_boundary.F90.

◆ case

logical, public scale_atmos_boundary::case

Definition at line 71 of file scale_atmos_sub_boundary.F90.