FE-Project
Loading...
Searching...
No Matches
scale_timeint_rk Module Reference

Module common / Runge-Kutta scheme. More...

Data Types

type  timeint_rk
 Derived type to provide RK scheme. More...
type  timeint_rk_var
 Derived type to store pointer to variable data when using varlist in RK advance procedures. More...

Functions/Subroutines

subroutine timeint_rk_init (this, rk_scheme_name, dt, var_num, ndim, size_each_var)
 Initialize a object to provide RK scheme.

Detailed Description

Module common / Runge-Kutta scheme.

Description
Driver module to provide various Runge-Kutta schemes.
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ timeint_rk_init()

subroutine scale_timeint_rk::timeint_rk_init ( class(timeint_rk), intent(inout) this,
character(*), intent(in) rk_scheme_name,
real(rp), intent(in) dt,
integer, intent(in) var_num,
integer, intent(in) ndim,
integer, dimension(ndim), intent(in) size_each_var )

Initialize a object to provide RK scheme.

Parameters
rk_scheme_nameName of RK scheme
dtTimestep
ndimNumber of spatial Dimension
var_numNumber of variables
size_each_varArray to store size of each dimension

Definition at line 135 of file scale_timeint_rk.F90.

137
141 implicit none
142 class(timeint_rk), intent(inout) :: this
143 character(*), intent(in) :: rk_scheme_name
144 real(RP), intent(in) :: dt
145 integer, intent(in) :: var_num
146 integer, intent(in) :: ndim
147 integer, intent(in) :: size_each_var(ndim)
148 !----------------------------------------
149
150 !$acc enter data create(this)
151
152 this%dt = dt
153 this%ndim = ndim
154 this%var_num = var_num
155 allocate( this%size_each_var(ndim) )
156 this%size_each_var(:) = size_each_var(:)
157 !$acc enter data copyin( this%size_each_var )
158 !$acc enter data attach( this%size_each_var )
159
160 call timeint_rk_butcher_tab_get_info( rk_scheme_name, & ! (in)
161 this%nstage, this%tend_buf_size, & ! (out)
162 this%low_storage_flag, this%imex_flag ) ! (out)
163
164 allocate ( this%coef_a_ex(this%nstage,this%nstage), this%coef_b_ex(this%nstage), this%coef_c_ex(this%nstage) )
165 allocate ( this%coef_sig_ex(this%nstage+1,this%nstage), this%coef_gam_ex(this%nstage+1,this%nstage) )
166! if (this%imex_flag) then
167 allocate ( this%coef_a_im(this%nstage,this%nstage), this%coef_b_im(this%nstage), this%coef_c_im(this%nstage) )
168! end if
169
170 select case(this%ndim)
171 case(1)
172 allocate( this%tend_buf1D_ex(size_each_var(1), var_num, this%tend_buf_size) )
173 !$acc enter data create( this%tend_buf1D_ex )
174 if ( this%imex_flag ) then
175 allocate( this%tend_buf1D_im(size_each_var(1), var_num, this%tend_buf_size) )
176 else
177 allocate( this%tend_buf1D_im(1,1,1) ) ! dummy allocation to avoid error in the case of non-IMEX scheme
178 end if
179 !$acc enter data create( this%tend_buf1D_im )
180 allocate( this%var0_1D(size_each_var(1), var_num) )
181 allocate( this%varTmp_1D(size_each_var(1), var_num) )
182 !$acc enter data create( this%var0_1D, this%varTmp_1D )
183 case(2)
184 allocate( this%tend_buf2D_ex(size_each_var(1),size_each_var(2), var_num, this%tend_buf_size) )
185 !$acc enter data create( this%tend_buf2D_ex )
186 if ( this%imex_flag ) then
187 allocate( this%tend_buf2D_im(size_each_var(1),size_each_var(2), var_num, this%tend_buf_size) )
188 else
189 allocate( this%tend_buf2D_im(1,1,1,1) ) ! dummy allocation to avoid error in the case of non-IMEX scheme
190 end if
191 !$acc enter data create( this%tend_buf2D_im )
192 allocate( this%var0_2D(size_each_var(1),size_each_var(2), var_num) )
193 allocate( this%varTmp_2D(size_each_var(1),size_each_var(2), var_num) )
194 !$acc enter data create( this%var0_2D, this%varTmp_2D )
195 case(3)
196 allocate( this%tend_buf3D_ex(size_each_var(1),size_each_var(2),size_each_var(3), var_num, this%tend_buf_size) )
197 !$acc enter data create( this%tend_buf3D_ex )
198 if ( this%imex_flag ) then
199 allocate( this%tend_buf3D_im(size_each_var(1),size_each_var(2),size_each_var(3), var_num, this%tend_buf_size) )
200 else
201 allocate( this%tend_buf3D_im(1,1,1,1,1) ) ! dummy allocation to avoid error in the case of non-IMEX scheme
202 end if
203 !$acc enter data create( this%tend_buf3D_im )
204 allocate( this%var0_3D(size_each_var(1),size_each_var(2),size_each_var(3), var_num) )
205 allocate( this%varTmp_3D(size_each_var(1),size_each_var(2),size_each_var(3), var_num) )
206 !$acc enter data create( this%var0_3D, this%varTmp_3D )
207 end select
208 allocate( this%tend_buf_indmap(this%nstage) )
209
211 rk_scheme_name, this%nstage, this%imex_flag, & ! (in)
212 this%coef_a_ex, this%coef_b_ex, this%coef_c_ex, & ! (out)
213 this%coef_sig_ex, this%coef_gam_ex, & ! (out)
214 this%coef_a_im, this%coef_b_im, this%coef_c_im, & ! (out)
215 this%tend_buf_indmap ) ! (out)
216
217 !$acc enter data copyin( this%coef_a_ex, this%coef_b_ex, this%coef_c_ex, &
218 !$acc this%coef_sig_ex, this%coef_gam_ex, &
219 !$acc this%coef_a_im, this%coef_b_im, this%coef_c_im, &
220 !$acc this%tend_buf_indmap )
221
222 !$acc enter data attach( this%coef_a_ex, this%coef_b_ex, this%coef_c_ex, &
223 !$acc this%coef_sig_ex, this%coef_gam_ex, &
224 !$acc this%coef_a_im, this%coef_b_im, this%coef_c_im, &
225 !$acc this%tend_buf_indmap )
226
227 !$acc update device( this%dt, this%rk_scheme_id_ex, this%rk_scheme_id_im, this%nstage, this%tend_buf_size, this%var_num, this%low_storage_flag, this%imex_flag, this%ndim )
228 return
Module common / Runge-Kutta scheme.
subroutine, public timeint_rk_butcher_tab_get_info(rk_scheme_name, nstage, tend_buf_size, low_storage_flag, imex_flag)
subroutine, public timeint_rk_butcher_tab_get(rk_scheme_name, nstage, imex_flag, coef_a_ex, coef_b_ex, coef_c_ex, coef_sig_ex, coef_gam_ex, coef_a_im, coef_b_im, coef_c_im, tend_buf_indmap)

References scale_timeint_rk_butcher_tab::timeint_rk_butcher_tab_get(), and scale_timeint_rk_butcher_tab::timeint_rk_butcher_tab_get_info().