1 subroutine da_intpsfc_prs (val, ho, po, hm, tm, qm, to, qo)
3 !----------------------------------------------------------------------------
4 ! Purpose: Correct pressure between two levels.
6 ! Reference: make use of the hydrosatic equation:
8 ! P2 = P1 * exp [-G/R * (z2-z1) / (tv1 + tv2)/2)
11 ! z1 = height at level 1
12 ! z1 = height at level 2
13 ! tv1 = temperature at level 1
14 ! tv2 = temperature at level 2
15 ! P1 = Pressure at level 1
16 ! P2 = Pressure at level 2
17 !----------------------------------------------------------------------------
21 real, intent (out) :: val
22 real, intent (in) :: ho, po
23 real, intent (in) :: hm, tm, qm
24 real, intent (in), optional :: to, qo
26 real :: tvo, tvm, tv, dz, arg
28 if (trace_use) call da_trace_entry("da_intpsfc_prs")
30 ! 1. model and observation virtual temperature
31 ! ---------------------------------------------
33 tvm = tm * (1.0 + 0.608 * qm)
34 if (present(to) .and. present(qo)) then
35 tvo = to * (1.0 + 0.608 * qo)
36 else if (present(to) .and. .not.present(qo)) then
42 tv = 0.5 * (tvm + tvo)
44 ! 2. height difference bewteen model surface and observations
45 ! ------------------------------------------------------------
49 ! 3. extrapolate pressure obs to model surface
50 ! ---------------------------------------------
52 arg = dz * gravity / gas_constant
57 if (trace_use) call da_trace_exit("da_intpsfc_prs")
59 end subroutine da_intpsfc_prs