10 use fckit_configuration_module,
only: fckit_configuration
18 use missing_values_mod
39 class(
ufo_adt),
intent(inout) :: self
40 type(fckit_configuration),
intent(in) :: f_conf
47 class(
ufo_adt),
intent(inout) :: self
53 use fckit_mpi_module,
only: fckit_mpi_comm, fckit_mpi_sum
55 class(
ufo_adt),
intent(in) :: self
57 real(c_double),
intent(inout) :: hofx(:)
58 type(c_ptr),
value,
intent(in) :: obss
60 character(len=*),
parameter :: myname_=
"ufo_adt_simobs"
61 character(max_string) :: err_msg
63 real(kind_real),
allocatable :: obs_adt(:)
65 integer :: iobs, cnt, cnt_glb
66 real(kind_real) :: offset_hofx, pe_offset_hofx
67 real(kind_real) :: offset_obs, pe_offset_obs
68 type(fckit_mpi_comm) :: f_comm
69 real(c_double) :: missing
71 call obsspace_get_comm(obss, f_comm)
74 missing = missing_value(missing)
77 obss_nlocs = obsspace_get_nlocs(obss)
80 if (geovals%nlocs /=
size(hofx,1))
then
81 write(err_msg,*) myname_,
' error: nlocs inconsistent!'
82 call abor1_ftn(err_msg)
89 allocate(obs_adt(obss_nlocs))
91 call obsspace_get_db(obss,
"ObsValue",
"obs_absolute_dynamic_topography", obs_adt)
97 do iobs = 1, obss_nlocs
98 if (hofx(iobs)/=missing)
then
99 pe_offset_hofx = pe_offset_hofx + geoval_adt%vals(1,iobs)
100 pe_offset_obs = pe_offset_obs + obs_adt(iobs)
106 call f_comm%allreduce(pe_offset_hofx, offset_hofx, fckit_mpi_sum())
107 call f_comm%allreduce(pe_offset_obs, offset_obs, fckit_mpi_sum())
108 call f_comm%allreduce(cnt, cnt_glb, fckit_mpi_sum())
109 offset_hofx = offset_hofx/cnt_glb
110 offset_obs = offset_obs/cnt_glb
113 do iobs = 1, obss_nlocs
114 hofx(iobs) = geoval_adt%vals(1,iobs) + (offset_obs-offset_hofx)
Fortran adt module for observation operator.
subroutine ufo_adt_setup(self, f_conf)
subroutine ufo_adt_delete(self)
subroutine ufo_adt_simobs(self, geovals, hofx, obss)
integer, parameter max_string
subroutine, public ufo_geovals_get_var(self, varname, geoval)
character(len=maxvarlen), public var_abs_topo
Fortran derived type for the observation type.
type to hold interpolated field for one variable, one observation
type to hold interpolated fields required by the obs operators