LCOV - code coverage report
Current view: top level - physics/carma/base - vaporp_h2o_goff1946.F90 (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 8 0.0 %
Date: 2025-03-14 01:33:33 Functions: 0 1 0.0 %

          Line data    Source code
       1             : ! Include shortname defintions, so that the F77 code does not have to be modified to
       2             : ! reference the CARMA structure.
       3             : #include "carma_globaer.h"
       4             : 
       5             : !! Calculates the vapor pressure of water vapor over liquid water and ice according
       6             : !! to the parameterization of Goff & Gratch [1946] as used in CAM (wv_saturation.F90).
       7             : !!
       8             : !! NOTE: <pvapl> and <pvapi> are vapor pressures in units of [dyne/cm^2]
       9             : !!
      10             : !! @author  Chuck Bardeen
      11             : !! @version Dec-2010
      12           0 : subroutine vaporp_h2o_goff1946(carma, cstate, iz, rc, pvap_liq, pvap_ice)
      13             : 
      14             :         !     types
      15             :   use carma_precision_mod
      16             :   use carma_enums_mod
      17             :   use carma_constants_mod
      18             :   use carma_types_mod
      19             :   use carmastate_mod
      20             :   use carma_mod
      21             : 
      22             :         implicit none
      23             : 
      24             :   type(carma_type), intent(in)         :: carma     !! the carma object
      25             :   type(carmastate_type), intent(inout) :: cstate    !! the carma state object
      26             :   integer, intent(in)                  :: iz        !! z index
      27             :   real(kind=f), intent(out)            :: pvap_liq  !! vapor pressure wrt liquid [dyne/cm2]
      28             :   real(kind=f), intent(out)            :: pvap_ice  !! vapor pressure wrt ice [dyne[cm2]
      29             :   integer, intent(inout)               :: rc        !! return code, negative indicates failure
      30             : 
      31             :   ! Local declarations
      32             :   real(kind=f)            :: tt
      33             :   
      34             : 
      35             :   ! Saturation vapor pressure over liquid water and water ice from
      36             :   !   Goff and Gatch, [1946].
      37           0 :   tt = t(iz)
      38             :            
      39             :   pvap_liq = 10.0_f * 10._f**(-7.90298_f * (373.16_f / tt - 1._f) + &
      40             :              5.02808_f * log10(373.16_f / tt) - &
      41             :              1.3816e-7_f * (10._f**(11.344_f * (1._f - tt / 373.16_f)) - 1._f) + &
      42             :              8.1328e-3_f * (10._f**(-3.49149_f * (373.16_f / tt - 1._f)) - 1._f) + &
      43           0 :              log10(1013.246_f)) * 100._f                      
      44             : 
      45             :   pvap_ice = 10.0_f * 10._f**(-9.09718_f * (273.16_f / tt - 1._f) - 3.56654_f * &
      46             :              log10(273.16_f / tt) + 0.876793_f * (1._f - tt / 273.16_f) + &
      47           0 :              log10(6.1071_f)) * 100._f
      48             : 
      49             :   ! Check to see whether temperature is ouside range of validity for the parameterization.
      50             :   !
      51             :   ! pvapl is defined for -50 C < T < 102 C ,  Gibbons [1990]
      52             :   ! pvapi is defined for T > -100 C
      53             :   !
      54             :   ! NOTE: Don't stop the simulation if the limits are exceeded.
      55           0 :   if ((t(iz) .le. 173.0_f) .or. (t(iz) .ge. 375.0_f)) then
      56             : !    if (do_print) then
      57             : !       write(LUNOPRT,*) 'vaporp_h2o_goff1946::WARNING - Temperature', t(iz), &
      58             : !            ' out of range at iz = ', iz, "lat=", lat, "lon=", lon
      59             : !    end if
      60           0 :     rc = RC_WARNING
      61             :   endif
      62             : 
      63             :   ! Return to caller with vapor pressures evaluated.
      64           0 :   return
      65           0 : end

Generated by: LCOV version 1.14