32 use oops_variables_mod
33 use missing_values_mod
34 use fckit_log_module,
only : fckit_log
41 type(oops_variables),
public :: geovars
42 type(oops_variables),
public :: obsvars
62 use fckit_configuration_module,
only: fckit_configuration
65 type(fckit_configuration),
intent(in) :: f_conf
85 integer,
intent(in) :: nvars, nlocs
87 real(c_double),
intent(inout) :: hofx(nvars, nlocs)
88 type(c_ptr),
value,
intent(in) :: obss
90 character(len=*),
parameter :: myname_ =
"ufo_scatwind_neutralmetoffice_simobs"
91 integer,
parameter :: max_string = 800
93 character(max_string) :: err_msg
94 character(max_string) :: message
101 type(
ufo_geoval),
pointer :: cx_obukhov_length
104 real(kind_real),
allocatable :: CDR10(:)
106 write(err_msg,*)
"TRACE: ufo_scatwind_neutralmetoffice_simobs: begin"
107 call fckit_log%info(err_msg)
110 if (geovals%nlocs /=
size(hofx(1,:)))
then
111 write(err_msg,*) myname_,
' error: nlocs inconsistent!'
112 call abor1_ftn(err_msg)
116 if (
size(hofx(:,1)) /= 2)
then
117 write(err_msg,*) myname_,
' error: hofx should have 2 variables - eastward_wind and northward_wind'
118 call abor1_ftn(err_msg)
121 write(message, *) myname_,
' Running Met Office neutral wind operator'
122 call fckit_log%info(message)
134 allocate(cdr10(nlocs))
135 cdr10(:) = missing_value(cdr10(1))
137 write(err_msg,*)
"TRACE: ufo_scatwind_neutralmetoffice_simobs: begin observation loop, nobs = ", nlocs
138 call fckit_log%info(err_msg)
140 obs_loop:
do iobs = 1, nlocs
142 cx_u % vals(:, iobs), &
143 cx_v % vals(:, iobs), &
144 cx_friction_vel % vals(1,iobs), &
145 cx_obukhov_length % vals(1,iobs), &
146 cx_seaice % vals(1,iobs), &
147 cx_orog % vals(1,iobs), &
154 write(err_msg,*)
"TRACE: ufo_scatwind_neutralmetoffice_simobs: completed"
155 call fckit_log%info(err_msg)
214 real(kind_real),
intent(in) :: za(:)
215 real(kind_real),
intent(in) :: u(:)
216 real(kind_real),
intent(in) :: v(:)
217 real(kind_real),
intent(in) :: ustr
218 real(kind_real),
intent(in) :: oblen
219 real(kind_real),
intent(in) :: seaice
220 real(kind_real),
intent(in) :: orog
221 real(kind_real),
intent(inout) :: ycalc(:)
222 real(kind_real),
intent(inout) :: cdr10
226 integer,
parameter :: max_string = 800
227 real,
parameter :: scatt_height = 10.0
228 real,
parameter :: charnock = 0.018
229 character(len=*),
parameter :: myname_ =
"Ops_Scatwind_ForwardModel"
230 character(max_string) :: message
246 character(max_string) :: err_msg
248 if (u(1) == missing_value(u(1)))
then
249 write(message, *) myname_,
"Missing value u1"
250 call abor1_ftn(message)
253 if (v(1) == missing_value(v(1)))
then
254 write(message, *) myname_,
"Missing value v1"
255 call abor1_ftn(message)
258 if (za(1) == missing_value(za(1)))
then
259 write(message, *) myname_,
"Missing value z1_uv"
260 call abor1_ftn(message)
263 if (oblen == missing_value(oblen))
then
264 write(message, *) myname_,
"Missing value obukhov length"
265 call abor1_ftn(message)
268 if (ustr == missing_value(ustr))
then
269 write(message, *) myname_,
"Missing value friction velocity"
270 call abor1_ftn(message)
273 if (orog == missing_value(orog))
then
274 write(message, *) myname_,
"Missing value orography"
275 call fckit_log % warning(message)
278 if (seaice == missing_value(seaice))
then
279 write(message, *) myname_,
"Missing value sea ice"
280 call fckit_log % warning(message)
291 oblen_1 = sign( max(1.0e-6, abs(oblen)),oblen)
292 recip_l_mo = 1.0 / oblen_1
294 if (orog == 0.0 .and. seaice == 0.0 .and. z1_uv > 0.0)
then
298 z0m = 1.54e-6 / (1.0e-5 + ustr) + (charnock /
grav) * ustr * ustr
302 write(message, *) myname_,
"Invalid roughness height"
303 call abor1_ftn(message)
321 phi_mn_10 = log((scatt_height + z0m) / z0m)
323 if (phi_m > 0.0)
then
325 ycalc(1) = (phi_mn_10 / phi_m) * u1
326 ycalc(2) = (phi_mn_10 / phi_m) * v1
332 if (phi_m_10 > 0.0)
then
334 if (cdr10 == missing_value(cdr10))
then
336 cdr10 = (phi_mn_10 / phi_m_10)
343 ycalc(1) = missing_value(ycalc(1))
344 ycalc(2) = missing_value(ycalc(2))
409 real,
intent(in) :: recip_l_mo
410 real,
intent(in) :: z_uv
411 real,
intent(in) :: z0m
412 real,
intent(out) :: phi_m
414 character(len=*),
parameter :: RoutineName =
'ops_scatwind_phi_m_sea'
415 real,
parameter :: a = 1.0
416 real,
parameter :: b = 2.0 / 3.0
417 real,
parameter :: c = 5.0
418 real,
parameter :: d = 0.35
419 real,
parameter :: c_over_d = c / d
429 phi_mn = log((z_uv + z0m)/z0m)
432 zeta_uv = (z_uv + z0m) * recip_l_mo
433 zeta_0m = z0m * recip_l_mo
435 if (recip_l_mo >= 0.0)
then
439 a * (zeta_uv - zeta_0m) + &
440 b * ((zeta_uv - c_over_d) * exp(-d * zeta_uv) - &
441 (zeta_0m - c_over_d) * exp(-d * zeta_0m))
445 x_uv_sq = sqrt(1.0 - 16.0 * zeta_uv)
446 x_0m_sq = sqrt(1.0 - 16.0 * zeta_0m)
450 phi_m = phi_mn - 2.0 * log((1.0 + x_uv) / (1.0 + x_0m)) - &
451 log((1.0 + x_uv_sq) / (1.0 + x_0m_sq)) + &
452 2.0 * (atan(x_uv) - atan(x_0m))
real(kind_real), parameter, public grav
type(registry_t), public ufo_geovals_registry
Linked list interface - defines registry_t type.
subroutine, public ufo_geovals_get_var(self, varname, geoval)
Fortran module for Met Office scatwind neutral wind forward operator.
subroutine ufo_scatwind_neutralmetoffice_simobs(self, geovals, obss, nvars, nlocs, hofx)
Neutral wind forward operator for the Met Office system.
subroutine ops_scatwind_phi_m_sea(recip_l_mo, z_uv, z0m, phi_m)
Calculate the integrated froms of the Monin-Obukhov stability functions for surface exchanges.
subroutine ufo_scatwind_neutralmetoffice_setup(self, f_conf)
character(len=maxvarlen), dimension(7), parameter geovars_default
subroutine ops_scatwind_forwardmodel(za, u, v, ustr, oblen, seaice, orog, ycalc, cdr10)
Scatterometer forward model.
character(len=maxvarlen), parameter, public var_sfc_ifrac
character(len=maxvarlen), parameter, public var_obk_length
character(len=maxvarlen), parameter, public var_v
character(len=maxvarlen), parameter, public var_zi
character(len=maxvarlen), parameter, public var_sfc_geomz
character(len=maxvarlen), parameter, public var_u
character(len=maxvarlen), parameter, public var_sea_fric_vel
type to hold interpolated field for one variable, one observation
type to hold interpolated fields required by the obs operators
Fortran derived type for neutral wind.