LCOV - code coverage report
Current view: top level - physics/carma/base - csolve.F90 (source / functions) Hit Total Coverage
Test: coverage.info Lines: 9 11 81.8 %
Date: 2025-03-14 01:30:37 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "carma_globaer.h"
       2             : 
       3             : !! This routine calculates new particle concentrations from coagulation
       4             : !! microphysical processes.
       5             : !!
       6             : !!  The basic form from which the solution is derived is:
       7             : !!
       8             : !!    ( new_value - old_value ) / dtime = source_term - loss_rate*new_value
       9             : !!
      10             : !! This routine derived from psolve.f code, in which particle concentrations
      11             : !! due to coagulation were formerly included, before the relatively slow
      12             : !! coagulation calcs were separated from the other microphysical processes
      13             : !! so that time splitting could be applied to these fast & slow calcs.
      14             : !!
      15             : !! @author Bill McKie
      16             : !! @version Sep-1997
      17   231137280 : subroutine csolve(carma, cstate, ibin, ielem, rc)
      18             : 
      19             :   ! types
      20             :   use carma_precision_mod
      21             :   use carma_enums_mod
      22             :   use carma_constants_mod
      23             :   use carma_types_mod
      24             :   use carmastate_mod
      25             :   use carma_mod
      26             : 
      27             :   implicit none
      28             : 
      29             :   type(carma_type), intent(in)         :: carma   !! the carma object
      30             :   type(carmastate_type), intent(inout) :: cstate  !! the carma state object
      31             :   integer, intent(in)                  :: ibin    !! bin index
      32             :   integer, intent(in)                  :: ielem   !! element index
      33             :   integer, intent(inout)               :: rc      !! return code, negative indicates failure
      34             : 
      35             :   ! Local Variables
      36             :   integer                        :: igroup
      37   462274560 :   real(kind=f)                   :: ppd(NZ)
      38   462274560 :   real(kind=f)                   :: pls(NZ)
      39             : 
      40             : 
      41             :   ! Define current group & particle number concentration element indices
      42   231137280 :   igroup = igelem(ielem)         ! particle group
      43             : 
      44             :   ! Compute total production rate due to coagulation
      45  7627530240 :   ppd = coagpe(:,ibin,ielem) / zmet(:)
      46             : 
      47             :   ! Compute total loss rate due to coagulation
      48  7627530240 :   pls = coaglg(:,ibin,igroup) / zmet(:)
      49             : 
      50             :   ! Update net particle number concentration during current timestep
      51             :   ! due to production and loss rates for coagulation
      52           0 :   pc(:,ibin,ielem) = ( pc(:,ibin,ielem) &
      53           0 :                        + dtime * ppd(:) ) &
      54  7627530240 :                        /  ( ONE + pls(:) * dtime )
      55             : 
      56   231137280 :   return
      57   231137280 : end

Generated by: LCOV version 1.14