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 ! 1. MODEL AND OBSERVATION VIRTUAL TEMPERATURE
33 ! ---------------------------------------------
34
35 tvsm = tsm * (1. + 0.608 * qsm)
36 if (present(to) .and. present(qvo)) then
37 tvo = to * (1. + 0.608 * qvo)
38 else if (present(to) .and. .not.present(qvo)) then
39 tvo = to
40 else
41 tvo = tvsm
42 end if
43
44 tv = 0.5 * (tvsm + tvo)
45
46 ! 2. HEIGHT DifFERENCE BEWTEEN MODEL SURFACE AND OBSERVATIONS
47 ! ------------------------------------------------------------
48
49 dz = hsm - ho
50 arg0 = dz * g / gasr
51
52 ! 3. EXTRAPOLATE PRESSURE OBS TO MODEL SURFACE
53 ! ---------------------------------------------
54
55 arg = arg0 / tv
56
57 psfcm = psm * exp (arg)
58
59 end subroutine da_sfc_pre
60
61