1 subroutine da_intpsfc_tem (val, ho, po, to, height, pressure, temp, kts, kte)
3 !-----------------------------------------------------------------------
4 ! Purpose: Correct temperature between two levels.
8 ! The use of surface observations in four dimensional data assimilation
9 ! Using a mesoscale model.
10 ! Ruggiero et al., 1996, Monthly Weather Review, Volume 124, 1018-1033
12 !----------------------------------------------------------------------------
16 real, intent (out) :: val
17 integer, intent (in) :: kts, kte
18 real, intent (in) :: ho, po, to
19 real, intent (in) :: height(kts:kte)
20 real, intent (in) :: pressure(kts:kte)
21 real, intent (in) :: temp(kts:kte)
23 real :: prs_mb(kts:kte)
24 ! calculated but never used
25 ! real :: dth_12, dth_21, dth_sfc, dth_obs
26 ! real :: dhe_12, dhe_21, dhe_sfc1, dhe_obs1, dhe_sfc2, dhe_obs2
27 real :: dth_21, dth_sfc, dth_obs
28 real :: dhe_12, dhe_sfc1, dhe_obs1, dhe_sfc2, dhe_obs2
29 real :: th_100mb, th_200mb, th_obs, th_sfc
30 real :: th_obs_int, th_sfc_int
32 integer :: k_100mb, k_200mb, jk
33 integer :: inc_100mb, inc_200mb
35 if (trace_use_dull) call da_trace_entry("da_intpsfc_tem")
39 ! 1.Find levels: model surface + 100hpa and model surface + 200hpa ar obs loc
40 ! ===========================================================================
42 ! 1.1 Convert model pressure profile from Pa to hPa
44 prs_mb = pressure / 100.0
46 ! 1.2 Find levels surface + 100hPA
52 pdif = prs_mb (kts) - prs_mb (jk)
53 if (pdif .GE. inc_100mb) then
59 ! 1.2 Find levels surface + 200hPA
65 pdif = prs_mb (kts) - prs_mb (jk)
66 if (pdif .GE. inc_200mb) then
72 ! 1.3 Check consistency
74 if ((k_100mb .LE. kts) .OR. (k_200mb .LE. kts) .OR. &
75 (k_200mb .LT. k_100mb)) then
76 write (unit=message(1),fmt='(A)') ' Cannot find sfc + 200hPa and sfc + 100hPa'
77 write (unit=message(2),fmt='(A,I2,A,F10.3)') ' P (',k_200mb,') = ',prs_mb (k_200mb)
78 write (unit=message(3),fmt='(A,I2,A,F10.3)') ' P (',k_100mb,') = ',prs_mb (k_100mb)
79 write (unit=message(4),fmt='(A,F10.3)') ' P_SFC = ', prs_mb (kts)
80 call da_warning(__FILE__,__LINE__,message(1:4))
82 if (trace_use_dull) call da_trace_exit("da_intpsfc_tem")
86 ! 2. potential temperature
87 ! =========================
89 ! 2.1 Potential temperature at 100hPa above model surface
91 th_100mb = temp (k_100mb) * (1000.0 / prs_mb (k_100mb))**rcp
93 ! 2.2 Potential temperature at 200hPa above model surface
95 th_200mb = temp (K_200mb) * (1000.0 / prs_mb (k_200mb))**rcp
97 ! 2.3 Potential temperature at observation location
99 th_obs = to * (1000.0 / (po/100.0)) ** rcp
102 ! 3. lapse rate between surface+200hpa and surface+100hpa
103 ! =========================================================
105 ! 3.1 Potential temperature increment
107 dth_21 = th_100mb - th_200mb
109 ! dth_12 = th_200mb - th_100mb
111 ! 3.1 Height increments
114 ! dhe_21 = height (k_100mb)- height (k_200mb)
115 dhe_sfc1 = height (k_100mb)- height (kts)
116 dhe_obs1 = height (k_100mb)- ho
118 dhe_12 = height (k_200mb)- height (k_100mb)
119 dhe_sfc2 = height (k_200mb)- height (kts)
120 dhe_obs2 = height (k_200mb)- ho
122 ! 3.2 Extrapolated potential temperature at model surface and observation loc
124 th_sfc_int = th_100mb + (dth_21/dhe_12) * dhe_sfc1
125 th_obs_int = th_100mb + (dth_21/dhe_12) * dhe_obs1
128 ! 4. Bring temperature onto model surface
129 ! ========================================
131 ! 4.1 Difference at observation locations
133 dth_obs = th_obs_int - th_obs
135 ! 4.2 Difference at model surface
137 dth_sfc = (dhe_sfc2/dhe_obs2) * dth_obs
139 ! 4.3 Potentiel temperature brought to model surface
141 th_sfc = th_sfc_int - dth_sfc
143 ! 4.3 Corresponding Temperature
145 val = th_sfc * (prs_mb (kts) / 1000.0)**rcp
147 if (trace_use_dull) call da_trace_exit("da_intpsfc_tem")
149 end subroutine da_intpsfc_tem