1 !**********************************************************************************
2 ! This computer software was prepared by Battelle Memorial Institute, hereinafter
3 ! the Contractor, under Contract No. DE-AC05-76RL0 1830 with the Department of
4 ! Energy (DOE). NEITHER THE GOVERNMENT NOR THE CONTRACTOR MAKES ANY WARRANTY,
5 ! EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.
7 ! MOSAIC module: see module_mosaic_driver.F for references and terms of use
8 !**********************************************************************************
9 module module_mosaic_csuesat
11 !-----------------------------------------------------------------------
15 integer, parameter :: nebins=149, nebinsi=110
17 real, save :: estbar(nebins+1), esitbar(nebinsi+1)
19 real, save :: tmin = -1.0
20 real, save :: tmini = -1.0
28 !-----------------------------------------------------------------------
29 ! following funcs from pegasus file csuesat01.f (timestamp = 09-apr-2002)
30 !-----------------------------------------------------------------------
31 ! file csuesat01.f - from stratcld.F,v on 8-oct-97
32 ! routines and common blocks renamed to allow running either
33 ! standalone gchm or coupled gchm-ccm2
34 !-----------------------------------------------------------------------
37 !-----------------------------------------------------------------------
38 real function esat_gchm( t )
40 ! saturation vapor pressure (dynes/cm2) with respect to water
46 if (tmin .lt. 0.0) then
50 it=max0(1,min0(ifix(t-tmin),nebins))
51 av=amax1(amin1(t-tmin-float(it),1.),0.)
52 esat_gchm=estbar(it)*(1.-av)+estbar(it+1)*av
54 end function esat_gchm
57 !-----------------------------------------------------------------------
58 real function esati_gchm( t )
60 ! saturation vapor pressure (dynes/cm2) with respect to ice
66 if (tmin .lt. 0.0) then
70 it=max0(1,min0(ifix(t-tmini),nebinsi))
71 av=amax1(amin1(t-tmini-float(it),1.),0.)
72 esati_gchm=esitbar(it)*(1.-av)+esitbar(it+1)*av
74 end function esati_gchm
77 !-----------------------------------------------------------------------
78 subroutine init_csuesat
80 ! calculate table of saturation vapor pressure (dynes/cm2) with respect
81 ! to water(estbar) and ice (esitbar)
84 real a0, a2, a3, a3dtf, a4, a5, a6, arg, ax
85 real t, tf, tinver, z1, z2
99 arg=ax*tf*tinver+a2*alog(tf*tinver)+a3*t/tf
100 esitbar(k)=a0*exp(arg)*1.e3
118 arg=ax*tf/t+a2*alog(tf/t)+a3*z1+a5*z2
119 4 estbar(jd)=a0*exp(arg)*1.e3
122 end subroutine init_csuesat
125 !-----------------------------------------------------------------------
126 end module module_mosaic_csuesat