LCOV - code coverage report
Current view: top level - physics/carma/base - vaporp_h2o_buck1981.F90 (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 9 0.0 %
Date: 2025-03-14 01:30:37 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 Buck [1981].
       7             : !!
       8             : !! NOTE: <pvapl> and <pvapi> are vapor pressures in units of [dyne/cm^2]
       9             : !!
      10           0 : subroutine vaporp_h2o_buck1981(carma, cstate, iz, rc, pvap_liq, pvap_ice)
      11             : 
      12             :         !     types
      13             :   use carma_precision_mod
      14             :   use carma_enums_mod
      15             :   use carma_constants_mod
      16             :   use carma_types_mod
      17             :   use carmastate_mod
      18             :   use carma_mod
      19             : 
      20             :         implicit none
      21             : 
      22             :   type(carma_type), intent(in)         :: carma     !! the carma object
      23             :   type(carmastate_type), intent(inout) :: cstate    !! the carma state object
      24             :   integer, intent(in)                  :: iz        !! z index
      25             :   real(kind=f), intent(out)            :: pvap_liq  !! vapor pressure wrt liquid
      26             :   real(kind=f), intent(out)            :: pvap_ice  !! vapor pressure wrt ice
      27             :   integer, intent(inout)               :: rc        !! return code, negative indicates failure
      28             : 
      29             :   ! Local declarations
      30             :   
      31             :   !  Define coefficients in Buck's formulation for saturation vapor pressures
      32             :   !  Table 2
      33             :   !
      34             :   ! Ice: valid temperature interval -80 - 0 C
      35             :   real(kind=f), parameter :: BAI = 6.1115e2_f
      36             :   real(kind=f), parameter :: BBI = 23.036_f
      37             :   real(kind=f), parameter :: BCI = 279.82_f
      38             :   real(kind=f), parameter :: BDI = 333.7_f
      39             : 
      40             :   ! Liquid: valid temperature interval -40 - +50 C
      41             :   real(kind=f), parameter :: BAL = 6.1121e2_f
      42             :   real(kind=f), parameter :: BBL = 18.729_f
      43             :   real(kind=f), parameter :: BCL = 257.87_f
      44             :   real(kind=f), parameter :: BDL = 227.3_f
      45             :   
      46             :   real(kind=f)            :: tt
      47             : 
      48             : 
      49             :   ! Saturation vapor pressure over liquid water and water ice from
      50             :   !   Buck [J. Atmos. Sci., 20, 1527, 1981]
      51           0 :   tt = t(iz) - 273.16_f
      52             :   
      53           0 :   pvap_liq = BAL * exp( (BBL - tt/BDL)*tt / (tt + BCL) )
      54           0 :   pvap_ice = BAI * exp( (BBI - tt/BDI)*tt / (tt + BCI) )
      55             : 
      56             :   ! Check to see whether temperature is ouside range of validity for the parameterization.
      57             :   !
      58             :   ! NOTE: Don't stop the simulation if the limits are exceeded.
      59           0 :   if (pvap_liq .le. 1.e-13_f) then
      60           0 :     if (do_print) write(LUNOPRT,*) 'vaporp_buck1981::WARNING - Temperature (', t(iz), ') too small for iz = ', iz
      61           0 :     rc = RC_WARNING
      62             :   endif
      63             : 
      64             :   ! Return to caller with vapor pressures evaluated.
      65           0 :   return
      66           0 : end

Generated by: LCOV version 1.14