51 MODULE PROCEDURE vol7d_varvect_init
56 MODULE PROCEDURE vol7d_varvect_delete
62 MODULE PROCEDURE vol7d_varvect_index,vol7d_varvect_indexvect
67 MODULE PROCEDURE display_varvect
77SUBROUTINE vol7d_varvect_init(this)
80NULLIFY(this%r, this%d, this%i, this%b, this%c)
82END SUBROUTINE vol7d_varvect_init
87elemental SUBROUTINE vol7d_varvect_delete(this)
90IF (
ASSOCIATED(this%r))
DEALLOCATE(this%r)
91IF (
ASSOCIATED(this%d))
DEALLOCATE(this%d)
92IF (
ASSOCIATED(this%i))
DEALLOCATE(this%i)
93IF (
ASSOCIATED(this%b))
DEALLOCATE(this%b)
94IF (
ASSOCIATED(this%c))
DEALLOCATE(this%c)
96END SUBROUTINE vol7d_varvect_delete
104SUBROUTINE vol7d_varvect_alloc(this, nvarr, nvard, nvari, nvarb, nvarc, ini)
106INTEGER,
INTENT(in),
OPTIONAL :: nvarr
107INTEGER,
INTENT(in),
OPTIONAL :: nvard
108INTEGER,
INTENT(in),
OPTIONAL :: nvari
109INTEGER,
INTENT(in),
OPTIONAL :: nvarb
110INTEGER,
INTENT(in),
OPTIONAL :: nvarc
111LOGICAL,
INTENT(in),
OPTIONAL :: ini
116IF (
PRESENT(ini))
THEN
122IF (
PRESENT(nvarr))
THEN
124 IF (
ASSOCIATED(this%r))
DEALLOCATE(this%r)
125 ALLOCATE(this%r(nvarr))
133IF (
PRESENT(nvard))
THEN
135 IF (
ASSOCIATED(this%d))
DEALLOCATE(this%d)
136 ALLOCATE(this%d(nvard))
144IF (
PRESENT(nvari))
THEN
146 IF (
ASSOCIATED(this%i))
DEALLOCATE(this%i)
147 ALLOCATE(this%i(nvari))
155IF (
PRESENT(nvarb))
THEN
157 IF (
ASSOCIATED(this%b))
DEALLOCATE(this%b)
158 ALLOCATE(this%b(nvarb))
166IF (
PRESENT(nvarc))
THEN
168 IF (
ASSOCIATED(this%c))
DEALLOCATE(this%c)
169 ALLOCATE(this%c(nvarc))
178END SUBROUTINE vol7d_varvect_alloc
183FUNCTION vol7d_varvect_index(this, search, mask, back, type)
RESULT(index_)
186LOGICAL,
INTENT(in),
OPTIONAL :: mask(:)
187LOGICAL,
INTENT(in),
OPTIONAL :: back
188character(len=*),
intent(inout),
optional ::
type
194select case (optio_c(
type,1))
197 if (
associated(this%d))
then
198 index_=
index(this%d(:), search, mask, back)
202 if (
associated(this%r))
then
203 index_=
index(this%r(:), search, mask, back)
207 if (
associated(this%i))
then
208 index_=
index(this%i(:), search, mask, back)
212 if (
associated(this%b))
then
213 index_=
index(this%b(:), search, mask, back)
217 if (
associated(this%c))
then
218 index_=
index(this%c(:), search, mask, back)
223 if (
associated(this%d))
then
224 index_=
index(this%d(:), search, mask, back)
225 if (
present(type)) type=
"d"
229 if (
associated(this%r))
then
230 index_=
index(this%r(:), search, mask, back)
231 if (
present(type)) type=
"r"
236 if (
associated(this%i))
then
237 index_=
index(this%i(:), search, mask, back)
238 if (
present(type)) type=
"i"
243 if (
associated(this%b))
then
244 index_=
index(this%b(:), search, mask, back)
245 if (
present(type)) type=
"b"
250 if (
associated(this%c))
then
251 index_=
index(this%c(:), search, mask, back)
252 if (
present(type)) type=
"c"
256 if (index_ == 0) type=cmiss
260 CALL l4f_log(l4f_error,
'variable type not contemplated: '//type)
264END FUNCTION vol7d_varvect_index
269FUNCTION vol7d_varvect_indexvect(this, search, back, TYPE)
RESULT(index_)
272LOGICAL,
INTENT(in),
OPTIONAL :: back
273character(len=*),
intent(inout) ::
type(:)
274INTEGER :: index_(size(search))
279 index_(i) = vol7d_varvect_index(this, search(i), back=back, type=
type(i))
282END FUNCTION vol7d_varvect_indexvect
286subroutine display_varvect(this)
290if (
associated(this%d))
then
291print *,
"----------------- varvect --------------------------"
292 print*,
"double precision elements=",
size(this%d)
296if (
associated(this%r))
then
297print *,
"----------------- varvect --------------------------"
298 print*,
"real elements=",
size(this%r)
302if (
associated(this%i))
then
303print *,
"----------------- varvect --------------------------"
304 print*,
"integer elements=",
size(this%i)
308if (
associated(this%b))
then
309print *,
"----------------- varvect --------------------------"
310 print*,
"byte elements=",
size(this%b)
314if (
associated(this%c))
then
315print *,
"----------------- varvect --------------------------"
316 print*,
"character elements=",
size(this%c)
321end subroutine display_varvect
Distruttore per la classe vol7d_varvect.
display on the screen a brief content of object
Costruttore per la classe vol7d_varvect.
Definition of constants to be used for declaring variables of a desired type.
classe per la gestione del logging
Definitions of constants and functions for working with missing values.
Module for quickly interpreting the OPTIONAL parameters passed to a subprogram.
Classe per la gestione delle variabili osservate da stazioni meteo e affini.
Classe per gestire un vettore di oggetti di tipo vol7d_var_class::vol7d_var.
Definisce una variabile meteorologica osservata o un suo attributo.
Definisce un vettore di vol7d_var_class::vol7d_var per ogni tipo di dato supportato.