10 use,
intrinsic :: iso_c_binding
11 use missing_values_mod
24 real(kind_real) ::
value
25 real(kind_real) :: oberr
26 real(kind_real) :: pgefinal
33 real(kind_real) :: jcost
34 real(kind_real) :: latitude
35 real(kind_real) :: longitude
38 real(kind_real),
allocatable :: solutbendingangle(:)
43 integer,
allocatable :: qc_flags(:)
48 real(kind_real),
allocatable :: za(:)
49 real(kind_real),
allocatable :: zb(:)
50 real(kind_real),
allocatable :: p(:)
51 real(kind_real),
allocatable :: q(:)
65 integer(c_size_t),
intent(in) :: input(:)
66 integer,
allocatable,
intent(out) :: output(:)
68 integer,
allocatable :: unique_vals(:)
74 allocate(unique_vals(1:
size(input)))
76 cur_val = minval(input) - 1
77 max_val = maxval(input)
78 do while (cur_val < max_val)
80 cur_val = minval(input, mask=input>cur_val)
81 unique_vals(nfound) = cur_val
83 allocate(output(nfound))
84 output = unique_vals(1:nfound)
116 REAL(kind_real),
INTENT(IN) :: key(:)
117 INTEGER,
ALLOCATABLE,
INTENT(OUT) :: index(:)
125 CHARACTER(len=*),
PARAMETER :: routinename =
'Ops_RealSortQuick'
137 makeheap :
DO j = n / 2, 1, -1
144 IF (child > n)
EXIT sift1
146 IF (key(index(child + 1)) > key(index(child))) child = child + 1
151 IF (key(index(head)) >= key(index(child)))
EXIT sift1
158 index(child) = index(head)
167 retire :
DO j = n, 2, -1
177 IF (child > (j - 1))
EXIT sift2
178 IF (child < (j - 1))
THEN
179 IF (key(index(child + 1)) > key(index(child))) child = child + 1
181 IF (key(index(head)) >= key(index(child)))
EXIT sift2
183 index(child) = index(head)
205 integer,
intent(in) :: nobs
206 integer,
intent(in) :: nlevp
207 integer,
intent(in) :: nlevq
209 allocate(singleob % p(1:nlevp))
210 allocate(singleob % q(1:nlevq))
211 allocate(singleob % solutbendingangle(1:nobs))
212 allocate(singleob % bendingangle(1:nobs))
213 allocate(singleob % impactparam(1:nobs))
214 allocate(singleob % qc_flags(1:nobs))
216 singleob % solutbendingangle(:) = missing_value(singleob % solutbendingangle(1))
217 singleob % qc_flags(:) = 0
219 singleob % p(:) % value = missing_value(singleob % p(1) % value)
220 singleob % p(:) % oberr = missing_value(singleob % p(1) % oberr)
221 singleob % p(:) % pgefinal = missing_value(singleob % p(1) % pgefinal)
223 singleob % q(:) % value = missing_value(singleob % q(1) % value)
224 singleob % q(:) % oberr = missing_value(singleob % q(1) % oberr)
225 singleob % q(:) % pgefinal = missing_value(singleob % q(1) % pgefinal)
227 singleob % bendingangle(:) % value = missing_value(singleob % bendingangle(1) % value)
228 singleob % bendingangle(:) % oberr = missing_value(singleob % bendingangle(1) % oberr)
229 singleob % bendingangle(:) % pgefinal = missing_value(singleob % bendingangle(1) % pgefinal)
231 singleob % impactparam(:) % value = missing_value(singleob % impactparam(1) % value)
232 singleob % impactparam(:) % oberr = missing_value(singleob % impactparam(1) % oberr)
233 singleob % impactparam(:) % pgefinal = missing_value(singleob % impactparam(1) % pgefinal)
251 deallocate(singleob % p)
252 deallocate(singleob % q)
253 deallocate(singleob % solutbendingangle)
254 deallocate(singleob % bendingangle)
255 deallocate(singleob % impactparam)
256 deallocate(singleob % qc_flags)
273 integer,
intent(in) :: nlevp
274 integer,
intent(in) :: nlevq
276 allocate(singlebg % za(1:nlevp))
277 allocate(singlebg % zb(1:nlevq))
278 allocate(singlebg % p(1:nlevp))
279 allocate(singlebg % q(1:nlevq))
281 singlebg % za(:) = missing_value(singlebg % za(1))
282 singlebg % zb(:) = missing_value(singlebg % zb(1))
283 singlebg % p(:) = missing_value(singlebg % p(1))
284 singlebg % q(:) = missing_value(singlebg % q(1))
302 deallocate(singlebg % za)
303 deallocate(singlebg % zb)
304 deallocate(singlebg % p)
305 deallocate(singlebg % q)
subroutine, public allocate_singleob(singleob, nobs, nlevp, nlevq)
Allocate the singleob_type structure, given a certain number of observations,.
subroutine, public deallocate_singleob(singleob)
Deallocate the singleob_type structure.
subroutine, public ops_realsortquick(key, index)
Generates a index array pointing to the elements of the array 'key'.
subroutine, public deallocate_singlebg(singlebg)
Dealloate the singlebg_type structure.
subroutine, public find_unique(input, output)
Find the unique entries in the input list.
subroutine, public allocate_singlebg(singlebg, nlevp, nlevq)
Allocate the structure to hold background information from a single profile.