SCALE-RM
Functions/Subroutines
scale_atmos_dyn_tinteg_tracer_rk3 Module Reference

module Atmosphere / Dyn Tinteg More...

Functions/Subroutines

subroutine, public atmos_dyn_tinteg_tracer_rk3_setup (tinteg_type)
 Setup. More...
 
subroutine, public atmos_dyn_tinteg_tracer_rk3_finalize
 finalize More...
 
subroutine, public atmos_dyn_tinteg_tracer_rk3 (QTRC, qflx, QTRC0, RHOQ_t, DENS0, DENS, mflx_hi, num_diff, GSQRT, MAPF, CDZ, RCDZ, RCDX, RCDY, BND_W, BND_E, BND_S, BND_N, TwoD, dtl, FLAG_FCT_TRACER, FLAG_FCT_ALONG_STREAM)
 RK3. More...
 

Detailed Description

module Atmosphere / Dyn Tinteg

Description
Temporal integration for tracer advection for Atmospheric process three stage Runge-Kutta scheme
Author
Team SCALE

Function/Subroutine Documentation

◆ atmos_dyn_tinteg_tracer_rk3_setup()

subroutine, public scale_atmos_dyn_tinteg_tracer_rk3::atmos_dyn_tinteg_tracer_rk3_setup ( character(len=*)  tinteg_type)

Setup.

Definition at line 66 of file scale_atmos_dyn_tinteg_tracer_rk3.F90.

66  use scale_const, only: &
67  undef => const_undef
68  use scale_prc, only: &
69  prc_abort
70  use scale_comm_cartesc, only: &
72  implicit none
73 
74  character(len=*) :: tinteg_type
75 
76  integer :: iv
77  !---------------------------------------------------------------------------
78 
79  if ( tinteg_type /= 'RK3WS2002' ) then
80  log_error("ATMOS_DYN_Tinteg_tracer_rk3_setup",*) 'TINTEG_TRACER_TYPE is not RK3WS2002. Check!'
81  call prc_abort
82  end if
83 
84  allocate( qtrc_rk1(ka,ia,ja) )
85  allocate( qtrc_rk2(ka,ia,ja) )
86  qtrc_rk1(:,:,:) = undef
87  qtrc_rk2(:,:,:) = undef
88  !$acc enter data create(QTRC_RK1, QTRC_RK2)
89 
90  i_comm_rk1 = 1
91  call comm_vars8_init( 'QTRC_RK1', qtrc_rk1, i_comm_rk1 )
92 
93  i_comm_rk2 = 1
94  call comm_vars8_init( 'QTRC_RK2', qtrc_rk2, i_comm_rk2 )
95 
96  return

References scale_comm_cartesc::comm_vars8_init(), scale_const::const_undef, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::ka, and scale_prc::prc_abort().

Referenced by scale_atmos_dyn_tinteg_tracer::atmos_dyn_tinteg_tracer_setup().

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

◆ atmos_dyn_tinteg_tracer_rk3_finalize()

subroutine, public scale_atmos_dyn_tinteg_tracer_rk3::atmos_dyn_tinteg_tracer_rk3_finalize

finalize

Definition at line 102 of file scale_atmos_dyn_tinteg_tracer_rk3.F90.

102 
103  !$acc exit data delete(QTRC_RK1, QTRC_RK2)
104  deallocate( qtrc_rk1 )
105  deallocate( qtrc_rk2 )
106 
107  return

Referenced by scale_atmos_dyn_tinteg_tracer::atmos_dyn_tinteg_tracer_setup().

Here is the caller graph for this function:

◆ atmos_dyn_tinteg_tracer_rk3()

subroutine, public scale_atmos_dyn_tinteg_tracer_rk3::atmos_dyn_tinteg_tracer_rk3 ( real(rp), dimension (ka,ia,ja), intent(inout)  QTRC,
real(rp), dimension (ka,ia,ja,3), intent(out)  qflx,
real(rp), dimension (ka,ia,ja), intent(in)  QTRC0,
real(rp), dimension (ka,ia,ja), intent(in)  RHOQ_t,
real(rp), dimension (ka,ia,ja), intent(in)  DENS0,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja,3), intent(in)  mflx_hi,
real(rp), dimension(ka,ia,ja,3), intent(in)  num_diff,
real(rp), dimension (ka,ia,ja,7), intent(in)  GSQRT,
real(rp), dimension (ia,ja), intent(in)  MAPF,
real(rp), dimension(ka), intent(in)  CDZ,
real(rp), dimension(ka), intent(in)  RCDZ,
real(rp), dimension(ia), intent(in)  RCDX,
real(rp), dimension(ja), intent(in)  RCDY,
logical, intent(in)  BND_W,
logical, intent(in)  BND_E,
logical, intent(in)  BND_S,
logical, intent(in)  BND_N,
logical, intent(in)  TwoD,
real(rp), intent(in)  dtl,
logical, intent(in)  FLAG_FCT_TRACER,
logical, intent(in)  FLAG_FCT_ALONG_STREAM 
)

RK3.

Definition at line 125 of file scale_atmos_dyn_tinteg_tracer_rk3.F90.

125  use scale_comm_cartesc, only: &
126  comm_vars8, &
127  comm_wait
128  use scale_atmos_dyn_tstep_tracer, only: &
130  use scale_atmos_dyn_common, only: &
132  implicit none
133  real(RP), intent(inout) :: QTRC (KA,IA,JA)
134  real(RP), intent(out) :: qflx (KA,IA,JA,3)
135  real(RP), intent(in) :: QTRC0 (KA,IA,JA)
136  real(RP), intent(in) :: RHOQ_t (KA,IA,JA)
137  real(RP), intent(in) :: DENS0 (KA,IA,JA)
138  real(RP), intent(in) :: DENS (KA,IA,JA)
139  real(RP), intent(in) :: mflx_hi (KA,IA,JA,3)
140  real(RP), intent(in) :: num_diff(KA,IA,JA,3)
141  real(RP), intent(in) :: GSQRT (KA,IA,JA,7)
142  real(RP), intent(in) :: MAPF (IA,JA)
143  real(RP), intent(in) :: CDZ(KA)
144  real(RP), intent(in) :: RCDZ(KA)
145  real(RP), intent(in) :: RCDX(IA)
146  real(RP), intent(in) :: RCDY(JA)
147  logical, intent(in) :: BND_W
148  logical, intent(in) :: BND_E
149  logical, intent(in) :: BND_S
150  logical, intent(in) :: BND_N
151  logical, intent(in) :: TwoD
152  real(RP), intent(in) :: dtl
153  logical, intent(in) :: FLAG_FCT_TRACER
154  logical, intent(in) :: FLAG_FCT_ALONG_STREAM
155 
156  real(RP) :: DENS_RK(KA,IA,JA)
157  real(RP) :: dtrk
158  integer :: k, i, j
159 
160  !$acc data copy(QTRC), copyout(qflx) &
161  !$acc copyin(QTRC0, RHOQ_t, DENS0, DENS, mflx_hi, num_diff, &
162  !$acc GSQRT, MAPF, CDZ, RCDZ, RCDX, RCDY) &
163  !$acc create(DENS_RK)
164  !------------------------------------------------------------------------
165  ! Start RK
166  !------------------------------------------------------------------------
167 
168  !$acc kernels
169  do j = js-1, je+1
170  do i = max(is-1,1), min(ie+1,ia)
171  do k = ks, ke
172  dens_rk(k,i,j) = dens0(k,i,j) &
173  + ( dens(k,i,j) - dens0(k,i,j) ) / 3.0_rp
174  end do
175  end do
176  end do
177  !$acc end kernels
178 
179  dtrk = dtl / 3.0_rp
180  call atmos_dyn_tstep_tracer( &
181  qtrc_rk1, & ! (out)
182  qflx, & ! (out)
183  qtrc, qtrc0, rhoq_t, &! (in)
184  dens0, dens_rk, & ! (in)
185  mflx_hi, num_diff, & ! (in)
186  gsqrt, mapf, & ! (in)
187  cdz, rcdz, rcdx, rcdy, & ! (in)
188  twod, dtrk, & ! (in)
189  .false., flag_fct_along_stream ) ! (in)
190 
191  call atmos_dyn_copy_boundary_tracer( qtrc_rk1, & ! [INOUT]
192  qtrc0, & ! [IN]
193  bnd_w, bnd_e, bnd_s, bnd_n, & ! [IN]
194  twod ) ! [IN]
195 
196  call comm_vars8( qtrc_rk1(:,:,:), i_comm_rk1 )
197  call comm_wait ( qtrc_rk1(:,:,:), i_comm_rk1, .false. )
198 
199 
200  !$acc kernels
201  do j = js-1, je+1
202  do i = max(is-1,1), min(ie+1,ia)
203  do k = ks, ke
204  dens_rk(k,i,j) = dens0(k,i,j) &
205  + ( dens(k,i,j) - dens0(k,i,j) ) * 0.5_rp
206  end do
207  end do
208  end do
209  !$acc end kernels
210 
211  dtrk = dtl / 2.0_rp
212  call atmos_dyn_tstep_tracer( &
213  qtrc_rk2, & ! (out)
214  qflx, & ! (out)
215  qtrc_rk1, qtrc0, rhoq_t, &! (in)
216  dens0, dens_rk, & ! (in)
217  mflx_hi, num_diff, & ! (in)
218  gsqrt, mapf, & ! (in)
219  cdz, rcdz, rcdx, rcdy, & ! (in)
220  twod, dtrk, & ! (in)
221  .false., flag_fct_along_stream ) ! (in)
222 
223  call atmos_dyn_copy_boundary_tracer( qtrc_rk2, & ! [INOUT]
224  qtrc0, & ! [IN]
225  bnd_w, bnd_e, bnd_s, bnd_n, & ! [IN]
226  twod ) ! [IN]
227 
228  call comm_vars8( qtrc_rk2(:,:,:), i_comm_rk2 )
229  call comm_wait ( qtrc_rk2(:,:,:), i_comm_rk2, .false. )
230 
231 
232  dtrk = dtl
233  call atmos_dyn_tstep_tracer( &
234  qtrc, & ! (out)
235  qflx, & ! (out)
236  qtrc_rk2, qtrc0, rhoq_t, &! (in)
237  dens0, dens, & ! (in)
238  mflx_hi, num_diff, & ! (in)
239  gsqrt, mapf, & ! (in)
240  cdz, rcdz, rcdx, rcdy, & ! (in)
241  twod, & ! (in)
242  dtrk, & ! (in)
243  flag_fct_tracer, flag_fct_along_stream ) ! (in)
244 
245  !$acc end data
246 
247  return

References scale_atmos_dyn_common::atmos_dyn_copy_boundary_tracer(), scale_atmos_dyn_tstep_tracer::atmos_dyn_tstep_tracer, scale_atmos_grid_cartesc_index::ia, 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_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_tinteg_tracer::atmos_dyn_tinteg_tracer_setup().

Here is the call graph for this function:
Here is the caller graph for this function:
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_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_atmos_dyn_common
module Atmosphere / Dynamics common
Definition: scale_atmos_dyn_common.F90:12
scale_atmos_grid_cartesc_index::ka
integer, public ka
Definition: scale_atmos_grid_cartesC_index.F90:47
scale_prc
module PROCESS
Definition: scale_prc.F90:11
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_const
module CONSTANT
Definition: scale_const.F90:11
scale_atmos_grid_cartesc_index::ia
integer, public ia
Definition: scale_atmos_grid_cartesC_index.F90:48
scale_atmos_dyn_common::atmos_dyn_copy_boundary_tracer
subroutine, public atmos_dyn_copy_boundary_tracer(QTRC, QTRC0, BND_W, BND_E, BND_S, BND_N, TwoD)
Definition: scale_atmos_dyn_common.F90:359
scale_atmos_dyn_tstep_tracer
module Atmosphere / Dynamical scheme
Definition: scale_atmos_dyn_tstep_tracer.F90:12
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_grid_cartesc_index::ja
integer, public ja
Definition: scale_atmos_grid_cartesC_index.F90:49
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_comm_cartesc
module COMMUNICATION
Definition: scale_comm_cartesC.F90:11
scale_atmos_dyn_tstep_tracer::atmos_dyn_tstep_tracer
procedure(step), pointer, public atmos_dyn_tstep_tracer
Definition: scale_atmos_dyn_tstep_tracer.F90:72
scale_atmos_grid_cartesc_index::js
integer, public js
start point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:55
scale_comm_cartesc::comm_vars8_init
subroutine, public comm_vars8_init(varname, var, vid, gid)
Register variables.
Definition: scale_comm_cartesC.F90:811
scale_const::const_undef
real(rp), public const_undef
Definition: scale_const.F90:43
scale_atmos_grid_cartesc_index::je
integer, public je
end point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:56