abcoefs.F90 957 Bytes
Newer Older
Youngsung Kim's avatar
Youngsung Kim committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
!KGEN-generated Fortran source file 
  
!Generated at : 2020-05-29 19:47:48 
!KGEN version : 0.9.0 
  


module abcoefs_mod
    USE kgen_utils_mod, ONLY: kgen_dp, kgen_array_sumcheck 
    USE tprof_mod, ONLY: tstart, tstop, tnull, tprnt 
    IMPLICIT NONE 

contains

  subroutine abcoefs(ncrms)
    !      coefficients for the Adams-Bashforth scheme
      USE grid 
      USE params, ONLY: crm_rknd 
    implicit none
    integer, intent(in) :: ncrms
    real(crm_rknd) alpha, beta

    if(nstep.ge.3.and.nadams.eq.3.or.nrestart.eq.2) then
      alpha = dt3(nb) / dt3(na)
      beta = dt3(nc) / dt3(na)
      ct = (2.+3.* alpha) / (6.* (alpha + beta) * beta)
      bt = -(1.+2.*(alpha + beta) * ct)/(2. * alpha)
      at = 1. - bt - ct
    else if(nstep.ge.2) then
      at = 3./2.
      bt = -1./2.
      ct = 0.
    else
      at = 1.
      bt = 0.
      ct = 0.
    end if
   !$omp target update to (dt3)
  end subroutine abcoefs

end module abcoefs_mod