28 real(kind=kind_real),
allocatable :: values(:,:)
31 #define LISTED_TYPE obs_vect 34 #include "oops/util/linkedList_i.f" 43 #include "oops/util/linkedList_c.f" 47 subroutine c_qg_obsvec_setup(c_key_self, ncol, nobs) bind(c,name='qg_obsvec_setup_f90')
49 integer(c_int),
intent(inout) :: c_key_self
50 integer(c_int),
intent(in) :: ncol, nobs
51 type(obs_vect),
pointer :: self
64 type(
obs_vect),
intent(inout) :: self
65 integer(c_int),
intent(in) :: nc,
no 69 if (
allocated(self%values))
deallocate(self%values)
70 allocate(self%values(self%ncol,self%nobs))
76 subroutine c_qg_obsvec_clone(c_key_self, c_key_other) bind(c,name='qg_obsvec_clone_f90')
78 integer(c_int),
intent(in) :: c_key_self
79 integer(c_int),
intent(inout) :: c_key_other
80 type(obs_vect),
pointer :: self, other
88 allocate(other%values(other%ncol,other%nobs))
96 integer(c_int),
intent(inout) :: c_key_self
97 type(obs_vect),
pointer :: self
100 deallocate(self%values)
106 subroutine c_qg_obsvec_assign(c_key_self, c_key_rhs) bind(c,name='qg_obsvec_assign_f90')
108 integer(c_int),
intent(in) :: c_key_self
109 integer(c_int),
intent(in) :: c_key_rhs
110 type(obs_vect),
pointer :: self, rhs
114 if (rhs%ncol/=self%ncol .or. rhs%nobs/=self%nobs)
then 115 deallocate(self%values)
118 allocate(self%values(self%ncol,self%nobs))
120 self%values(:,:)=rhs%values(:,:)
126 integer(c_int),
intent(in) :: c_key_self
127 type(obs_vect),
pointer :: self
130 self%values(:,:)=0.0_kind_real
136 integer(c_int),
intent(in) :: c_key_self
137 real(c_double),
intent(in) :: zz
138 type(obs_vect),
pointer :: self
141 self%values(:,:)=zz*self%values(:,:)
145 subroutine c_qg_obsvec_add(c_key_self, c_key_other) bind(c,name='qg_obsvec_add_f90')
147 integer(c_int),
intent(in) :: c_key_self
148 integer(c_int),
intent(in) :: c_key_other
149 type(obs_vect),
pointer :: self, other
153 self%values(:,:)=self%values(:,:)+other%values(:,:)
157 subroutine c_qg_obsvec_sub(c_key_self, c_key_other) bind(c,name='qg_obsvec_sub_f90')
159 integer(c_int),
intent(in) :: c_key_self
160 integer(c_int),
intent(in) :: c_key_other
161 type(obs_vect),
pointer :: self, other
165 self%values(:,:)=self%values(:,:)-other%values(:,:)
169 subroutine c_qg_obsvec_mul(c_key_self, c_key_other) bind(c,name='qg_obsvec_mul_f90')
171 integer(c_int),
intent(in) :: c_key_self
172 integer(c_int),
intent(in) :: c_key_other
173 type(obs_vect),
pointer :: self, other
177 self%values(:,:)=self%values(:,:)*other%values(:,:)
181 subroutine c_qg_obsvec_div(c_key_self, c_key_other) bind(c,name='qg_obsvec_div_f90')
183 integer(c_int),
intent(in) :: c_key_self
184 integer(c_int),
intent(in) :: c_key_other
185 type(obs_vect),
pointer :: self, other
189 self%values(:,:)=self%values(:,:)/other%values(:,:)
193 subroutine c_qg_obsvec_axpy(c_key_self, zz, c_key_other) bind(c,name='qg_obsvec_axpy_f90')
195 integer(c_int),
intent(in) :: c_key_self
196 real(c_double),
intent(in) :: zz
197 integer(c_int),
intent(in) :: c_key_other
198 type(obs_vect),
pointer :: self, other
202 self%values(:,:)=self%values(:,:)+zz*other%values(:,:)
208 integer(c_int),
intent(in) :: c_key_self
209 type(obs_vect),
pointer :: self
212 self%values(:,:)=1.0_kind_real/self%values(:,:)
218 integer(c_int),
intent(in) :: c_key_self
219 type(obs_vect),
pointer :: self
226 subroutine c_qg_obsvec_dotprod(c_key_self, c_key_other, zz) bind(c,name='qg_obsvec_dotprod_f90')
228 integer(c_int),
intent(in) :: c_key_self
229 integer(c_int),
intent(in) :: c_key_other
230 real(c_double),
intent(inout) :: zz
231 type(obs_vect),
pointer :: self, other
239 zz = zz + self%values(jc,jo)*other%values(jc,jo)
245 subroutine c_qg_obsvec_minmaxavg(c_key_self, zmin, zmax, zavg) bind(c,name='qg_obsvec_minmaxavg_f90')
247 integer(c_int),
intent(in) :: c_key_self
248 real(c_double),
intent(inout) :: zmin, zmax, zavg
249 type(obs_vect),
pointer :: self
253 if (self%nobs>0.and.self%ncol>0)
then 254 if (.not.
allocated(self%values))
call abor1_ftn(
"obsvec_minmax: obs vector not allocated")
255 zmin=self%values(1,1)
256 zmax=self%values(1,1)
260 zmin=
min(self%values(jc,jo),zmin)
261 zmax=
max(self%values(jc,jo),zmax)
262 zavg=zavg+self%values(jc,jo)
265 zavg=zavg/
real(self%ncol*self%nobs,kind_real)
274 subroutine c_qg_obsvec_nobs(c_key_self, kobs) bind(c,name='qg_obsvec_nobs_f90')
276 integer(c_int),
intent(in) :: c_key_self
277 integer(c_int),
intent(inout) :: kobs
278 type(obs_vect),
pointer :: self
281 kobs=self%nobs*self%ncol
Fortran generic for generating random 1d, 2d and 3d arrays.
type(registry_t), public qg_obs_vect_registry
Linked list interface - defines registry_t type.
integer, parameter, public no
subroutine c_qg_obsvec_delete(c_key_self)
subroutine c_qg_obsvec_mul(c_key_self, c_key_other)
subroutine c_qg_obsvec_assign(c_key_self, c_key_rhs)
subroutine c_qg_obsvec_invert(c_key_self)
subroutine c_qg_obsvec_zero(c_key_self)
subroutine c_qg_obsvec_add(c_key_self, c_key_other)
subroutine c_qg_obsvec_div(c_key_self, c_key_other)
subroutine c_qg_obsvec_mul_scal(c_key_self, zz)
subroutine c_qg_obsvec_setup(c_key_self, ncol, nobs)
Linked list implementation.
subroutine c_qg_obsvec_random(c_key_self)
subroutine c_qg_obsvec_dotprod(c_key_self, c_key_other, zz)
subroutine c_qg_obsvec_minmaxavg(c_key_self, zmin, zmax, zavg)
subroutine, public obsvec_setup(self, nc, no)
subroutine c_qg_obsvec_nobs(c_key_self, kobs)
Fortran module for generating random vectors.
subroutine c_qg_obsvec_axpy(c_key_self, zz, c_key_other)
subroutine c_qg_obsvec_clone(c_key_self, c_key_other)
subroutine c_qg_obsvec_sub(c_key_self, c_key_other)
Fortran module handling observation vectors.
Fortran derived type to represent an observation vector.