Second-order Patankar-Runge-Kutta scheme


INTERFACE:

    subroutine patankar_runge_kutta_2(dt,numc,nlev,cc,right_hand_side)
DESCRIPTION:

Here, the second-order Patankar-Runge-Kutta (PRK2) scheme is coded, with two evaluations of the right hand sides per time step:

$\displaystyle \left. \begin{array}{rcl} c_i^{(1)} &=& \displaystyle c_i^n + \De...
...{(1)}\right)\right) \dfrac{c_i^{n+1}}{c_i^{(1)}} \right\}. \end{array} \right\}$ (252)


USES:

    IMPLICIT NONE
INPUT PARAMETERS:
    REALTYPE, intent(in)                :: dt
    integer, intent(in)                 :: numc,nlev
   !INPUT/OUTPUT PARAMETER:
    REALTYPE, intent(inout)             :: cc(1:numc,0:nlev)
 
    interface
       subroutine right_hand_side(first,numc,nlev,cc,pp,dd)
          logical, intent(in)                  :: first
          integer, intent(in)                  :: numc,nlev
          REALTYPE, intent(in)                 :: cc(1:numc,0:nlev)
          REALTYPE, intent(out)                :: pp(1:numc,1:numc,0:nlev)
          REALTYPE, intent(out)                :: dd(1:numc,1:numc,0:nlev)
       end subroutine right_hand_side
    end interface
REVISION HISTORY:
    Original author(s): Hans Burchard, Karsten Bolding
LOCAL VARIABLES:
   logical  :: first
   REALTYPE :: ppsum(1:numc,0:nlev),ddsum(1:numc,0:nlev)
   REALTYPE :: pp(1:numc,1:numc,0:nlev),dd(1:numc,1:numc,0:nlev)
   REALTYPE :: cc1(1:numc,0:nlev)
   integer  :: i,j,ci



Karsten Bolding 2012-01-24