LCOV - code coverage report
Current view: top level - chemistry/mozart - mo_negtrc.F90 (source / functions) Hit Total Coverage
Test: coverage.info Lines: 6 6 100.0 %
Date: 2024-12-17 22:39:59 Functions: 1 1 100.0 %

          Line data    Source code
       1             : 
       2             :       module mo_negtrc
       3             : 
       4             :       private
       5             :       public :: negtrc
       6             : 
       7             :       contains
       8             : 
       9     1489176 :       subroutine negtrc( header, fld, ncol )
      10             : !-----------------------------------------------------------------------
      11             : !       ... Check for negative constituent values and
      12             : !           replace with zero value
      13             : !-----------------------------------------------------------------------
      14             : 
      15             :       use shr_kind_mod, only: r8 => shr_kind_r8
      16             :       use chem_mods,   only : gas_pcnst
      17             :       use ppgrid,      only : pver
      18             : 
      19             :       implicit none
      20             : 
      21             : !-----------------------------------------------------------------------
      22             : !       ... Dummy arguments
      23             : !-----------------------------------------------------------------------
      24             :       integer, intent(in)          :: ncol
      25             :       character(len=*), intent(in) :: header
      26             :       real(r8), intent(inout)          :: fld(ncol,pver,gas_pcnst) ! field to check
      27             : 
      28             : !-----------------------------------------------------------------------
      29             : !       ... Local variables
      30             : !-----------------------------------------------------------------------
      31             :       integer :: m
      32             :       integer :: nneg                       ! flag counter
      33             : 
      34    47653632 :       do m  = 1,gas_pcnst
      35 71734196664 :          nneg = count( fld(:,:,m) < 0._r8 )
      36    47653632 :          if( nneg > 0 ) then
      37   447496958 :             where( fld(:,:,m) < 0._r8 )
      38             :                fld(:,:,m) = 0._r8
      39             :             endwhere
      40             :          end if
      41             :       end do
      42             : 
      43     1489176 :       end subroutine negtrc
      44             : 
      45             :       end module mo_negtrc

Generated by: LCOV version 1.14