First-order Extended Modified Patankar scheme


INTERFACE:

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

Here, the first-order Extended Modified Patankar scheme for biogeochemical models is coded, with one evaluation of the right-hand side per time step:


$\displaystyle {\vec{c}^{n + 1} = \vec{c}^n + \Delta t \: \vec{f}(t^n,\vec{c}^n)\prod\limits_{j \in J^n} {\frac{c_j^{n + 1} }{c_j^n}}}$
    with $\displaystyle J^n = \left\{ {i:f_i (t^n,\vec{c}^n) < 0,i \in \{1,...,I\}} \right\}$ (257)

This system of non-linear implicit equations is solved in auxiliary subroutine findp_bisection, using the fact this system can be reduced to a polynomial in one unknown, and additionally using the restrictions imposed by the requirement of positivity. For more details, see Bruggeman et al. (2006).


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,rhs)
         logical, intent(in)                  :: first
         integer, intent(in)                  :: numc,nlev
         REALTYPE, intent(in)                 :: cc(1:numc,0:nlev)
         REALTYPE, intent(out)                :: rhs(1:numc,0:nlev)
      end
   end interface
REVISION HISTORY:
   Original author(s): Jorn Bruggeman
LOCAL VARIABLES:
  logical  :: first
  REALTYPE :: derivative(1:numc,0:nlev)
  integer  :: ci
  REALTYPE :: pi



Karsten Bolding 2012-12-28