1 subroutine da_ref_height(pres, ref_height)
3 !---------------------------------------------------------------------------
4 ! Purpose: To calculate the height from the reference pressure
5 !---------------------------------------------------------------------------
9 real, intent(in) :: pres
10 real, intent(out) :: ref_height
15 real, parameter :: rovg = gas_constant/gravity
17 if (trace_use) call da_trace_entry("da_ref_height")
19 aa = 0.5 * rovg * base_lapse
22 cc = log(pres/base_pres)
23 ref_height = -(bb + aa * cc) * cc
25 if (base_temp > 0.0) then
26 p0iso=base_pres*exp((base_temp-t0)/base_lapse)
27 cc=log(p0iso/base_pres)
30 if (ref_height > ziso) then
31 ref_height=ziso+rovg*base_temp*log(p0iso/pres)
35 if (trace_use) call da_trace_exit("da_ref_height")
37 end subroutine da_ref_height