da_sfc_pre.inc
References to this file elsewhere.
1 subroutine da_sfc_pre (psfcm, psm, tsm, qsm, hsm, ho, to, qvo)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: Correct pressure between two levels.
5 !
6 ! Reference: make use of the hydrosatic equation:
7 !
8 ! P2 = P1 * exp [-G/R * (z2-z1) / (tv1 + tv2)/2)
9 !
10 ! Where:
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 !---------------------------------------------------------------------------
18
19 implicit none
20
21 real, intent (out) :: psfcm ! model pressure at ho
22 real, intent (in) :: psm, tsm, qsm
23
24 real, intent (in) :: hsm, ho
25 real, intent (in), optional :: to, qvo
26
27 real :: tvo, tvsm, tv, dz, arg0, arg
28
29 real, parameter :: GASR = gas_constant
30 real, parameter :: G = gravity
31
32 if (trace_use) call da_trace_entry("da_sfc_pre")
33
34 ! 1. MODEL AND OBSERVATION VIRTUAL TEMPERATURE
35 ! ---------------------------------------------
36
37 tvsm = tsm * (1.0 + 0.608 * qsm)
38 if (present(to) .and. present(qvo)) then
39 tvo = to * (1.0 + 0.608 * qvo)
40 else if (present(to) .and. .not.present(qvo)) then
41 tvo = to
42 else
43 tvo = tvsm
44 end if
45
46 tv = 0.5 * (tvsm + tvo)
47
48 ! 2. HEIGHT DifFERENCE BEWTEEN MODEL SURFACE AND OBSERVATIONS
49 ! ------------------------------------------------------------
50
51 dz = hsm - ho
52 arg0 = dz * g / gasr
53
54 ! 3. EXTRAPOLATE PRESSURE OBS TO MODEL SURFACE
55 ! ---------------------------------------------
56
57 arg = arg0 / tv
58
59 psfcm = psm * exp (arg)
60
61 if (trace_use) call da_trace_exit("da_sfc_pre")
62
63 end subroutine da_sfc_pre
64
65