da_ref_pres.inc

References to this file elsewhere.
1 subroutine da_ref_pres(height, ref_pres)
2 
3    !---------------------------------------------------------------------------
4    ! Purpose: To calculate the reference pressure from the height.
5    !---------------------------------------------------------------------------
6 
7    implicit none
8 
9    real, intent(in)  :: height
10    real, intent(out) :: ref_pres
11 
12    real, parameter :: rovg = gas_constant/gravity
13 
14    real :: aa, bb, cc, hh, htop, ziso, p0iso
15 
16    call da_ref_height(ptop, htop)
17 
18    bb = rovg * ts0
19    aa = rovg * tlp * 0.5
20 
21    hh = min(htop, height)
22    cc = (-bb + sqrt(bb * bb - 4.0 * aa * hh))/(2.0*aa)
23    ref_pres = ps0 * exp(cc)
24 
25    if (tis0 > 0.0) then
26       p0iso=ps0*exp((tis0-ts0)/tlp)
27       cc=log(p0iso/ps0)
28       ziso=-(aa*cc+bb)*cc
29 
30       if (height > ziso) then
31          ref_pres = p0iso/exp((height-ziso)/(rovg*tis0))
32       end if
33    end if
34 
35 end subroutine da_ref_pres
36 
37