libsim Versione 7.2.6
modqc_peel_util_include.F90
1
2!> Data validity check for confidence
3elemental logical function vd/**/vol7d_poly_types (flag)
4
5/**/vol7d_poly_type ,intent(in) :: flag !< confidenza
6
7
8vd/**/vol7d_poly_types = .not. (realdat(flag,vol7d_var_new(qcattrvarsbtables(2),scalefactor=0)) <= qcpar%att .and. c_e(flag)&
9 .and. c_e(qcpar%att))
10
11
12return
13end function vd/**/vol7d_poly_types
14
15
16!> Data gross error check
17elemental logical function vdge/**/vol7d_poly_types (flag)
18
19/**/vol7d_poly_type ,intent(in) :: flag !< confidenza
20
21
22vdge/**/vol7d_poly_types = .not. (realdat(flag,vol7d_var_new(qcattrvarsbtables(2),scalefactor=0)) == qcpar%gross_error .and. c_e(flag) &
23 .and. c_e(qcpar%gross_error))
24
25
26return
27end function vdge/**/vol7d_poly_types
28
29
30!> Data invalidated check
31elemental logical function invalidated/**/vol7d_poly_types(flag)
32
33/**/vol7d_poly_type ,intent(in) :: flag !< attributo di invalidazione del dato
34
35invalidated/**/vol7d_poly_types= realdat(flag,vol7d_var_new(qcattrvarsbtables(1),scalefactor=0)) == qcpar%invalidated .and. c_e(flag) &
36 .and. c_e(qcpar%invalidated)
37
38
39return
40end function invalidated/**/vol7d_poly_types
41
42!> Check data validity based on multiple confidences.
43!! Compute final decision boolean flag
44!! Quality control is complete if one of 3 conditions is verified:
45!! a) invalidated data
46!! b) gross error check failed
47!! c) tot variable less -1
48
49!> Controllo di validita' del dato basato su test multipli.
50!! Per il calcolo della validita' del dato (flag booleano B33007), si prendono in considerazione 3 test; il dato risulta invalidato (flag booleano posto a false) se e solo se uno dei test risulta soddisfatto:
51!! a) il dato e' stato invalidato a mano (flag0=B33196=0)
52!! b) il dato non ha passato il gross erro check (flag1=B33192=0)
53!! c) la variabile tot risulta minore a -1
54!! La variabile tot e' il risultato del confronto tra controllo climatologico (flag1, B33192), controllo temporale (flag2, B33193) e controllo spaziale (flag3, B33194).
55!! Ad ognuno di tali controlli e' stato attribuito un punteggio a seconda che ciascuno dei valori relativi ai flag di qualita' risulti inferiore od uguale-maggiore di 10.
56!! Nel dettaglio:
57!! se B33192 < 10 tot=-1; se B33192>=10 tot=0
58!! se B33193 < 10 tot=-1; se B33193>=10 tot=1
59!! se B33194 < 10 tot=-1; se B33194>=10 tot=1
60!! Ogni dato e' controllato nei 3 flag di qualita' presenti, e viene valutata la somma risultante di tot. Se tot risulta inferiore a -1, qcsummaryflag e' posto a false ed il dato e' invalitato (B33007=0). Se tot risulta maggiore od uguale a -1 qcsummaryflag e' true ed il dato e' valido.
61
62ELEMENTAL LOGICAL FUNCTION qcsummaryflag/**/vol7d_poly_types(flag0, flag1, flag2, flag3)
63/**/vol7d_poly_type ,intent(in),optional :: flag0
64/**/vol7d_poly_type ,intent(in),optional :: flag1
65/**/vol7d_poly_type ,intent(in),optional :: flag2
66/**/vol7d_poly_type ,intent(in),optional :: flag3
67integer :: tot
68
69
70#ifdef VOL7D_POLY_ISC
71
72if (invalidated(optio_3/**/vol7d_poly_types(flag0))) then
73 qcsummaryflag/**/vol7d_poly_types = .false.
74 return
75endif
76
77if ( .not. vdge(optio_3/**/vol7d_poly_types(flag1))) then
78 qcsummaryflag/**/vol7d_poly_types = .false.
79 return
80endif
81
82tot=0
83
84if (.not. vd(optio_3/**/vol7d_poly_types(flag1))) then
85 tot = tot -1
86endif
87
88if (.not. vd(optio_3/**/vol7d_poly_types(flag2))) then
89 tot = tot -1
90endif
91if (vd(optio_3/**/vol7d_poly_types(flag2)) .and. c_e(optio_3/**/vol7d_poly_types(flag2))) then
92 tot = tot +1
93endif
94
95if (.not. vd(optio_3/**/vol7d_poly_types(flag3))) then
96 tot = tot -1
97endif
98if (vd(optio_3/**/vol7d_poly_types(flag3)) .and. c_e(optio_3/**/vol7d_poly_types(flag3))) then
99 tot = tot +1
100endif
101
102qcsummaryflag/**/vol7d_poly_types=(tot >= -1)
103
104contains
105
106!> Return the optional value if present, otherwise return missing value.
107!! N.B. elemental version of optio_c
108elemental function optio_3c(var) result(char)
109
110character (len=*),intent(in),optional :: var !< variable to be checked
111!here the string len needed is 3 but so is more easy
112/**/vol7d_poly_type :: char
113
114if (present(var))then
115 char=var
116else
117 char=cmiss
118end if
119
120return
121end function optio_3c
122
123#else
124
125
126if (invalidated(optio_/**/vol7d_poly_types(flag0))) then
127 qcsummaryflag/**/vol7d_poly_types = .false.
128 return
129endif
130
131if ( .not. vdge(optio_/**/vol7d_poly_types(flag1))) then
132 qcsummaryflag/**/vol7d_poly_types = .false.
133 return
134endif
135
136tot=0
137
138if (.not. vd(optio_/**/vol7d_poly_types(flag1))) then
139 tot = tot -1
140endif
141
142if (.not. vd(optio_/**/vol7d_poly_types(flag2))) then
143 tot = tot -1
144endif
145if (vd(optio_/**/vol7d_poly_types(flag2)) .and. c_e(optio_/**/vol7d_poly_types(flag2))) then
146 tot = tot +1
147endif
148
149if (.not. vd(optio_/**/vol7d_poly_types(flag3))) then
150 tot = tot -1
151endif
152if (vd(optio_/**/vol7d_poly_types(flag3)) .and. c_e(optio_/**/vol7d_poly_types(flag3))) then
153 tot = tot +1
154endif
155
156qcsummaryflag/**/vol7d_poly_types=(tot >= -1)
157
158#endif
159
160
161END FUNCTION qcsummaryflag/**/vol7d_poly_types
162

Generated with Doxygen.