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

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

Functions/Subroutines

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)

Detailed Description

Module common / Runge-Kutta scheme.

Description
Butcher tableau

Notation rules:

  • ERK schemes ERK(abbrev1)MsPo(_abbrev2) : explicit RK scheme with M-stage and P-th order. ERK_1s1o (, Euler ) : Euler scheme ERK_4s4o (, RK4 ) : classical 4 stage and 4th-order RK scheme ERK_SSP_MsPo : strong stability preserving (SSP) (M,P) RK scheme
  • IMEX schemes (we assume that ERK for non-stiff part and DIRK for stiff part) IMEX_abbrev : abbreviation of scheme name follows the table in Vogl et al. (2019).
Author
Yuta Kawai, Team SCALE
Reference
  • Vogl et al. 2019: Evaluation of implicit-explicit additive Runge-Kutta integrators for the HOMME-NH dynamical core. Journal of Advances in Modeling Earth Systems, 11, 4228–4244.
  • Higueras and Roldan, 2019: New third order low-storage SSP explicit Runge–Kutta methods. Journal of Scientific Computing, 79(3), 1882-1906.

Function/Subroutine Documentation

◆ timeint_rk_butcher_tab_get_info()

subroutine, public scale_timeint_rk_butcher_tab::timeint_rk_butcher_tab_get_info ( character(len=*), intent(in) rk_scheme_name,
integer, intent(out) nstage,
integer, intent(out) tend_buf_size,
logical, intent(out) low_storage_flag,
logical, intent(out) imex_flag )

Definition at line 60 of file scale_timeint_rk_butcher_tab.F90.

62 implicit none
63 character(len=*), intent(in) :: rk_scheme_name
64 integer, intent(out) :: nstage
65 integer, intent(out) :: tend_buf_size
66 logical, intent(out) :: low_storage_flag
67 logical, intent(out) :: imex_flag
68 !-----------------------------------------------------------
69
70 low_storage_flag = .false.
71
72 select case(rk_scheme_name)
73 case( 'ERK_1s1o', 'ERK_Euler' )
74 nstage = 1
75 tend_buf_size = 1
76 imex_flag = .false.
77 case( 'ERK_4s4o', 'ERK_RK4' )
78 nstage = 4
79 tend_buf_size = 1
80 imex_flag = .false.
81 case( 'ERK_SSP_2s2o' ) ! Shu and Osher, 1998: Efficient implementation of essentially nonoscillatory shock-capturing schemes, J. Comput. Phys.; Gottlieb and Shu, 1998: Total variation diminishing Runge-Kutta schemes, Math. Comput.
82 nstage = 2
83 tend_buf_size = 1
84 low_storage_flag = .true.
85 imex_flag = .false.
86 case( 'ERK_SSP_3s3o' ) ! Shu and Osher, 1998: Efficient implementation of essentially nonoscillatory shock-capturing schemes, J. Comput. Phys.;
87 ! SSP coefficient: 1, effective SSP coefficient Ceff: 1/3
88 nstage = 3
89 tend_buf_size = 1
90 low_storage_flag = .true.
91 imex_flag = .false.
92 case( 'ERK_SSP_4s3o' )
93 nstage = 4
94 tend_buf_size = 1
95 low_storage_flag = .true.
96 imex_flag = .false.
97 case( 'ERK_SSP_5s3o_2N2*' ) ! Higueras and Roldan, 2018: New third order low-storage SSP explicit Runge–Kutta methods
98 nstage = 5
99 tend_buf_size = 1
100 low_storage_flag = .true.
101 imex_flag = .false.
102 case ( 'ERK_SSP_10s4o_2N' ) ! Ketcheson, 2008: HIGHLY EFFICIENT STRONG STABILITY-PRESERVING RUNGE–KUTTA METHODS WITH LOW-STORAGE IMPLEMENTATIONS, SIAM J. SCI. COMPUT.
103 ! SSP coefficient: 6, effective SSP coefficient Ceff: 0.6
104 nstage = 10
105 tend_buf_size = 1
106 low_storage_flag = .true.
107 imex_flag = .false.
108 case( 'IMEX_ARK232' ) ! Giraldo et al. (2013): Implicit-Explicit Formulations of a Three-Dimensional Nonhydrostatic Unified Model
109 ! of the Atmosphere (NUMA), SIAM J. Sci. Comp.
110 nstage = 3
111 tend_buf_size = 3
112 imex_flag = .true.
113 case( 'IMEX_ARK324' ) ! Kennedy and Carpenter, 2003: Additive Runge-Kutta schemes for convection-diffusion-reaction equations, Appl. Numer. Math.
114 nstage = 4
115 tend_buf_size = 4
116 imex_flag = .true.
117 case default
118 log_error("timeint_rk_butcher_tab_get_info",*) trim(rk_scheme_name)//' is not supported. Check!'
119 call prc_abort
120 end select
121
122 return

Referenced by scale_timeint_rk::timeint_rk_init().

◆ timeint_rk_butcher_tab_get()

subroutine, public scale_timeint_rk_butcher_tab::timeint_rk_butcher_tab_get ( character(len=*), intent(in) rk_scheme_name,
integer, intent(in) nstage,
logical, intent(in) imex_flag,
real(rp), dimension(nstage,nstage), intent(out) coef_a_ex,
real(rp), dimension(nstage), intent(out) coef_b_ex,
real(rp), dimension(nstage), intent(out) coef_c_ex,
real(rp), dimension(nstage+1,nstage), intent(out) coef_sig_ex,
real(rp), dimension(nstage+1,nstage), intent(out) coef_gam_ex,
real(rp), dimension(nstage,nstage), intent(out) coef_a_im,
real(rp), dimension(nstage), intent(out) coef_b_im,
real(rp), dimension(nstage), intent(out) coef_c_im,
integer, dimension(nstage), intent(out) tend_buf_indmap )

Definition at line 126 of file scale_timeint_rk_butcher_tab.F90.

132
133 implicit none
134 character(len=*), intent(in) :: rk_scheme_name
135 integer, intent(in) :: nstage
136 logical, intent(in) :: imex_flag
137 real(RP), intent(out) :: coef_a_ex(nstage,nstage)
138 real(RP), intent(out) :: coef_b_ex(nstage)
139 real(RP), intent(out) :: coef_c_ex(nstage)
140 real(RP), intent(out) :: coef_sig_ex(nstage+1,nstage)
141 real(RP), intent(out) :: coef_gam_ex(nstage+1,nstage)
142 real(RP), intent(out) :: coef_a_im(nstage,nstage)
143 real(RP), intent(out) :: coef_b_im(nstage)
144 real(RP), intent(out) :: coef_c_im(nstage)
145 integer, intent(out) :: tend_buf_indmap(nstage)
146
147 integer :: n
148 real(RP) :: alp, gam, del
149 logical :: call_ShuOsher2Butcher
150
151 !-----------------------------------------------------------
152
153 coef_a_ex(:,:) = 0.0_rp
154 coef_b_ex(:) = 0.0_rp
155 coef_c_ex(:) = 0.0_rp
156
157 coef_sig_ex(:,:) = 0.0_rp
158 coef_gam_ex(:,:) = 0.0_rp
159
160 if (imex_flag) then
161 coef_a_im(:,:) = 0.0_rp
162 coef_b_im(:) = 0.0_rp
163 coef_c_im(:) = 0.0_rp
164 end if
165
166 call_shuosher2butcher = .false.
167
168 !---
169
170 select case(rk_scheme_name)
171 case( 'ERK_1s1o', 'ERK_Euler' )
172
173 coef_a_ex(1,1) = 0.0_rp
174 coef_b_ex(:) = (/ 1.0_rp /)
175
176 coef_sig_ex(2,1 ) = 1.0_rp
177 coef_gam_ex(2,1 ) = 1.0_rp
178
179 tend_buf_indmap(:) = 1
180
181 case( 'ERK_4s4o', 'ERK_RK4' )
182
183 coef_a_ex(2,1) = 0.5_rp
184 coef_a_ex(3,2) = 0.5_rp
185 coef_a_ex(4,3) = 1.0_rp
186 coef_b_ex(:) = (/ 1.0_rp, 2.0_rp, 2.0_rp, 1.0_rp /)/6.0_rp
187
188 tend_buf_indmap(:) = 1
189
190 case( 'ERK_SSP_2s2o' )
191
192 coef_sig_ex(2,1 ) = 1.0_rp
193 coef_sig_ex(3,1:2) = (/ 1.0_rp, 1.0_rp /) / 2.0_rp
194 coef_gam_ex(2,1 ) = 1.0_rp
195 coef_gam_ex(3,2 ) = 1.0_rp / 2.0_rp
196
197 tend_buf_indmap(:) = 1
198 call_shuosher2butcher = .true.
199
200 case( 'ERK_SSP_3s3o' )
201
202 coef_sig_ex(2,1 ) = 1.0_rp
203 coef_sig_ex(3,1:2) = (/ 3.0_rp, 1.0_rp /) / 4.0_rp
204 coef_sig_ex(4,1:3) = (/ 1.0_rp, 0.0_rp, 2.0_rp /) / 3.0_rp
205 coef_gam_ex(2,1 ) = 1.0_rp
206 coef_gam_ex(3,2 ) = 1.0_rp / 4.0_rp
207 coef_gam_ex(4,3 ) = 2.0_rp / 3.0_rp
208
209 tend_buf_indmap(:) = 1
210 call_shuosher2butcher = .true.
211
212 case( 'ERK_SSP_4s3o' )
213
214 coef_sig_ex(2,1 ) = 1.0_rp
215 coef_sig_ex(3,1:2) = (/ 0.0_rp, 1.0_rp /)
216 coef_sig_ex(4,1:3) = (/ 2.0_rp, 0.0_rp, 1.0_rp /) / 3.0_rp
217 coef_sig_ex(5,1:4) = (/ 0.0_rp, 0.0_rp, 0.0_rp, 1.0_rp /)
218 coef_gam_ex(2,1 ) = 0.5_rp
219 coef_gam_ex(3,2 ) = 0.5_rp
220 coef_gam_ex(4,3 ) = 1.0_rp / 6.0_rp
221 coef_gam_ex(5,4 ) = 0.5_rp
222
223 tend_buf_indmap(:) = 1
224 call_shuosher2butcher = .true.
225
226 case( 'ERK_SSP_5s3o_2N2*' )
227
228 coef_sig_ex(2,1 ) = 1.0_rp
229 coef_sig_ex(3,1:2) = (/ 0.0_rp, 1.0_rp /)
230 coef_sig_ex(4,1:3) = (/ 0.682342861037239_rp, 0.0_rp, 0.317657138962761_rp /)
231 coef_sig_ex(5,1:4) = (/ 0.0_rp, 0.0_rp, 0.0_rp, 1.0_rp /)
232 coef_sig_ex(6,1:5) = (/ 0.045230974482400_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.954769025517600_rp /)
233 coef_gam_ex(2,1 ) = 0.465388589249323_rp
234 coef_gam_ex(3,2 ) = 0.465388589249323_rp
235 coef_gam_ex(4,3 ) = 0.124745797313998_rp
236 coef_gam_ex(5,4 ) = 0.465388589249323_rp
237 coef_gam_ex(6,5 ) = 0.154263303748666_rp
238
239 tend_buf_indmap(:) = 1
240 call_shuosher2butcher = .true.
241
242 case( 'ERK_SSP_10s4o_2N' )
243
244 do n=1, 4
245 coef_sig_ex(n+1,n) = 1.0_rp
246 coef_gam_ex(n+1,n) = 1.0_rp / 6.0_rp
247 end do
248 coef_sig_ex(6,1:5) = (/ 3.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 2.0_rp /) / 5.0_rp
249 coef_gam_ex(6,5 ) = 1.0_rp / 15.0_rp
250 do n=6, 9
251 coef_sig_ex(n+1,n) = 1.0_rp
252 coef_gam_ex(n+1,n) = 1.0_rp / 6.0_rp
253 end do
254 coef_sig_ex(11,1:10) = (/ 0.2_rp, 0.0_rp, 0.0_rp, 0.0_rp, 1.8_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 3.0_rp /) * 0.2_rp
255 coef_gam_ex(11,1:10) = (/ 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 1.8_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 3.0_rp /) / 30.0_rp
256
257 tend_buf_indmap(:) = 1
258 call_shuosher2butcher = .true.
259
260 case('IMEX_ARK232')
261
262 alp = (3.0_rp + 2.0_rp*sqrt(2.0_rp))/6.0_rp
263 gam = 1.0_rp - 1.0_rp/sqrt(2.0_rp)
264 del = 1.0_rp/(2.0_rp*sqrt(2.0_rp))
265
266 coef_a_ex(2,1) = 2.0_rp*gam
267 coef_a_ex(3,:) = (/ 1.0_rp - alp, alp, 0.0_rp /)
268 coef_b_ex(:) = (/ del, del, gam /)
269
270 coef_a_im(2,:) = (/ gam, gam, 0.0_rp /)
271 coef_a_im(3,:) = (/ del, del, gam /)
272 coef_b_im(:) = coef_b_ex(:)
273
274 tend_buf_indmap(:) = (/ 1, 2, 3 /)
275
276 case('IMEX_ARK324')
277
278 coef_a_ex(2,1) = 1767732205903.0_rp/2027836641118.0_rp
279 coef_a_ex(3,1) = 5535828885825.0_rp/10492691773637.0_rp
280 coef_a_ex(3,2) = 788022342437.0_rp/10882634858940.0_rp
281 coef_a_ex(4,1) = 6485989280629.0_rp/16251701735622.0_rp
282 coef_a_ex(4,2) = -4246266847089.0_rp/9704473918619.0_rp
283 coef_a_ex(4,3) = 10755448449292.0_rp/10357097424841.0_rp
284 coef_b_ex(1) = 1471266399579.0_rp/7840856788654.0_rp
285 coef_b_ex(2) = -4482444167858.0_rp/7529755066697.0_rp
286 coef_b_ex(3) = 11266239266428.0_rp/11593286722821.0_rp
287 coef_b_ex(4) = 1767732205903.0_rp/4055673282236.0_rp
288
289 coef_a_im(2,1:2) = 1767732205903.0_rp/4055673282236.0_rp
290 coef_a_im(3,1) = 2746238789719.0_rp/10658868560708.0_rp
291 coef_a_im(3,2) = -640167445237.0_rp/6845629431997.0_rp
292 coef_a_im(3,3) = 1767732205903.0_rp/4055673282236.0_rp
293 coef_a_im(4,:) = coef_b_ex(:)
294 coef_b_im(:) = coef_b_ex(:)
295
296 tend_buf_indmap(:) = (/ 1, 2, 3, 4 /)
297
298 case default
299 log_error("timeint_rk_butcher_tab_get",*) trim(rk_scheme_name)//' is not supported. Check!'
300 call prc_abort
301
302 end select
303
304 !--
305 if ( call_shuosher2butcher ) then
306 call shuosher2butcher( &
307 coef_sig_ex, coef_gam_ex, nstage, & ! (in)
308 coef_a_ex, coef_b_ex ) ! (out)
309 end if
310
311 !--
312 coef_c_ex(:) = 0.0_rp
313 do n=1, nstage
314 coef_c_ex(n) = sum( coef_a_ex(n,1:n) )
315 end do
316 if ( imex_flag ) then
317 coef_c_ex(:) = 0.0_rp
318 do n=1, nstage
319 coef_c_ex(n) = sum( coef_a_ex(n,1:n) )
320 end do
321 end if
322
323 return

Referenced by scale_timeint_rk::timeint_rk_init().