41 end type vol7d_timerange
44 TYPE(vol7d_timerange
),
PARAMETER :: vol7d_timerange_miss= &
45 vol7d_timerange(imiss,imiss,imiss)
51 MODULE PROCEDURE vol7d_timerange_init
57 MODULE PROCEDURE vol7d_timerange_delete
63 INTERFACE operator (==)
64 MODULE PROCEDURE vol7d_timerange_eq
70 INTERFACE operator (/=)
71 MODULE PROCEDURE vol7d_timerange_ne
77 INTERFACE operator (>)
78 MODULE PROCEDURE vol7d_timerange_gt
84 INTERFACE operator (<)
85 MODULE PROCEDURE vol7d_timerange_lt
91 INTERFACE operator (>=)
92 MODULE PROCEDURE vol7d_timerange_ge
98 INTERFACE operator (<=)
99 MODULE PROCEDURE vol7d_timerange_le
104 INTERFACE operator (.almosteq.)
105 MODULE PROCEDURE vol7d_timerange_almost_eq
112 MODULE PROCEDURE vol7d_timerange_c_e
115 #define VOL7D_POLY_TYPE TYPE(vol7d_timerange)
116 #define VOL7D_POLY_TYPES _timerange
118 #include "array_utilities_pre.F90"
122 MODULE PROCEDURE display_timerange
127 MODULE PROCEDURE to_char_timerange
130 #define ARRAYOF_ORIGTYPE TYPE(vol7d_timerange)
131 #define ARRAYOF_TYPE arrayof_vol7d_timerange
132 #define ARRAYOF_ORIGEQ 1
133 #include "arrayof_pre.F90"
136 type(vol7d_timerange
) :: almost_equal_timeranges(2)=(/&
137 vol7d_timerange(254,0,imiss),&
138 vol7d_timerange(3,0,3600)/)
143 PUBLIC insert_unique, append_unique
144 PUBLIC almost_equal_timeranges
154 FUNCTION vol7d_timerange_new(timerange, p1, p2) RESULT(this)
155 INTEGER,
INTENT(IN),
OPTIONAL :: timerange
156 INTEGER,
INTENT(IN),
OPTIONAL :: p1
157 INTEGER,
INTENT(IN),
OPTIONAL :: p2
159 TYPE(vol7d_timerange
) :: this
161 CALL
init(this, timerange, p1, p2)
163 END FUNCTION vol7d_timerange_new
169 SUBROUTINE vol7d_timerange_init(this, timerange, p1, p2)
170 TYPE(vol7d_timerange
),
INTENT(INOUT) :: this
171 INTEGER,
INTENT(IN),
OPTIONAL :: timerange
172 INTEGER,
INTENT(IN),
OPTIONAL :: p1
173 INTEGER,
INTENT(IN),
OPTIONAL :: p2
175 IF (present(timerange))
THEN
176 this%timerange = timerange
178 this%timerange = imiss
194 IF (present(p1))
THEN
199 IF (present(p2))
THEN
206 END SUBROUTINE vol7d_timerange_init
210 SUBROUTINE vol7d_timerange_delete(this)
211 TYPE(vol7d_timerange
),
INTENT(INOUT) :: this
213 this%timerange = imiss
217 END SUBROUTINE vol7d_timerange_delete
220 SUBROUTINE display_timerange(this)
221 TYPE(vol7d_timerange
),
INTENT(in) :: this
223 print*,to_char_timerange(this)
225 END SUBROUTINE display_timerange
228 FUNCTION to_char_timerange(this)
232 TYPE(vol7d_timerange
),
INTENT(in) :: this
233 CHARACTER(len=80) :: to_char_timerange
236 INTEGER :: handle, ier
239 ier = idba_messaggi(handle,
"/dev/null",
"w",
"BUFR")
240 ier = idba_spiegat(handle,this%timerange,this%p1,this%p2,to_char_timerange)
241 ier = idba_fatto(handle)
243 to_char_timerange=
"Timerange: "//to_char_timerange
247 to_char_timerange=
"Timerange: "//trim(
to_char(this%timerange))//
" P1: "//&
252 END FUNCTION to_char_timerange
255 ELEMENTAL FUNCTION vol7d_timerange_eq(this, that) RESULT(res)
256 TYPE(vol7d_timerange
),
INTENT(IN) :: this, that
261 this%timerange == that%timerange .AND. &
262 this%p1 == that%p1 .AND. (this%p2 == that%p2 .OR. &
263 this%timerange == 254)
265 END FUNCTION vol7d_timerange_eq
268 ELEMENTAL FUNCTION vol7d_timerange_almost_eq(this, that) RESULT(res)
269 TYPE(vol7d_timerange
),
INTENT(IN) :: this, that
272 IF (.not.
c_e(this%timerange) .or. .not.
c_e(that%timerange) .or. this%timerange == that%timerange .AND. &
273 this%p1 == that%p1 .AND. &
274 this%p2 == that%p2)
THEN
280 END FUNCTION vol7d_timerange_almost_eq
283 ELEMENTAL FUNCTION vol7d_timerange_ne(this, that) RESULT(res)
284 TYPE(vol7d_timerange
),
INTENT(IN) :: this, that
287 res = .NOT.(this == that)
289 END FUNCTION vol7d_timerange_ne
292 ELEMENTAL FUNCTION vol7d_timerange_gt(this, that) RESULT(res)
293 TYPE(vol7d_timerange
),
INTENT(IN) :: this, that
296 IF (this%timerange > that%timerange .OR. &
297 (this%timerange == that%timerange .AND. this%p1 > that%p1) .OR. &
298 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
299 this%p2 > that%p2))
THEN
305 END FUNCTION vol7d_timerange_gt
308 ELEMENTAL FUNCTION vol7d_timerange_lt(this, that) RESULT(res)
309 TYPE(vol7d_timerange
),
INTENT(IN) :: this, that
312 IF (this%timerange < that%timerange .OR. &
313 (this%timerange == that%timerange .AND. this%p1 < that%p1) .OR. &
314 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
315 this%p2 < that%p2))
THEN
321 END FUNCTION vol7d_timerange_lt
324 ELEMENTAL FUNCTION vol7d_timerange_ge(this, that) RESULT(res)
325 TYPE(vol7d_timerange
),
INTENT(IN) :: this, that
328 IF (this == that)
THEN
330 ELSE IF (this > that)
THEN
336 END FUNCTION vol7d_timerange_ge
339 ELEMENTAL FUNCTION vol7d_timerange_le(this, that) RESULT(res)
340 TYPE(vol7d_timerange
),
INTENT(IN) :: this, that
343 IF (this == that)
THEN
345 ELSE IF (this < that)
THEN
351 END FUNCTION vol7d_timerange_le
354 ELEMENTAL FUNCTION vol7d_timerange_c_e(this) RESULT(c_e)
355 TYPE(vol7d_timerange
),
INTENT(IN) :: this
357 c_e = this /= vol7d_timerange_miss
358 END FUNCTION vol7d_timerange_c_e
361 #include "array_utilities_inc.F90"
363 #include "arrayof_post.F90"
Definitions of constants and functions for working with missing values.
Distruttore per la classe vol7d_timerange.
Represent timerange object in a pretty string.
Method for packing the array object reducing at a minimum the memory occupation, without destroying i...
Classe per la gestione degli intervalli temporali di osservazioni meteo e affini. ...
Utilities for CHARACTER variables.
Method for inserting elements of the array at a desired position.
Quick method to append an element to the array.
Definition of constants to be used for declaring variables of a desired type.
Costruttore per la classe vol7d_timerange.
Method for removing elements of the array at a desired position.