libsim Versione 7.1.11
|
◆ arrayof_vol7d_timerange_delete()
Destructor for finalizing an array object. If defined, calls the destructor for every element of the array object; finally it deallocates all the space occupied.
Definizione alla linea 2053 del file vol7d_timerange_class.F90. 2058! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
2059! authors:
2060! Davide Cesari <dcesari@arpa.emr.it>
2061! Paolo Patruno <ppatruno@arpa.emr.it>
2062
2063! This program is free software; you can redistribute it and/or
2064! modify it under the terms of the GNU General Public License as
2065! published by the Free Software Foundation; either version 2 of
2066! the License, or (at your option) any later version.
2067
2068! This program is distributed in the hope that it will be useful,
2069! but WITHOUT ANY WARRANTY; without even the implied warranty of
2070! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2071! GNU General Public License for more details.
2072
2073! You should have received a copy of the GNU General Public License
2074! along with this program. If not, see <http://www.gnu.org/licenses/>.
2075#include "config.h"
2076
2088IMPLICIT NONE
2089
2095 INTEGER :: timerange
2096 INTEGER :: p1
2097 INTEGER :: p2
2099
2101TYPE(vol7d_timerange),PARAMETER :: vol7d_timerange_miss= &
2102 vol7d_timerange(imiss,imiss,imiss)
2103
2108 MODULE PROCEDURE vol7d_timerange_init
2109END INTERFACE
2110
2114 MODULE PROCEDURE vol7d_timerange_delete
2115END INTERFACE
2116
2120INTERFACE OPERATOR (==)
2121 MODULE PROCEDURE vol7d_timerange_eq
2122END INTERFACE
2123
2127INTERFACE OPERATOR (/=)
2128 MODULE PROCEDURE vol7d_timerange_ne
2129END INTERFACE
2130
2134INTERFACE OPERATOR (>)
2135 MODULE PROCEDURE vol7d_timerange_gt
2136END INTERFACE
2137
2141INTERFACE OPERATOR (<)
2142 MODULE PROCEDURE vol7d_timerange_lt
2143END INTERFACE
2144
2148INTERFACE OPERATOR (>=)
2149 MODULE PROCEDURE vol7d_timerange_ge
2150END INTERFACE
2151
2155INTERFACE OPERATOR (<=)
2156 MODULE PROCEDURE vol7d_timerange_le
2157END INTERFACE
2158
2161INTERFACE OPERATOR (.almosteq.)
2162 MODULE PROCEDURE vol7d_timerange_almost_eq
2163END INTERFACE
2164
2165
2166! da documentare in inglese assieme al resto
2169 MODULE PROCEDURE vol7d_timerange_c_e
2170END INTERFACE
2171
2172#define VOL7D_POLY_TYPE TYPE(vol7d_timerange)
2173#define VOL7D_POLY_TYPES _timerange
2174#define ENABLE_SORT
2175#include "array_utilities_pre.F90"
2176
2179 MODULE PROCEDURE display_timerange
2180END INTERFACE
2181
2184 MODULE PROCEDURE to_char_timerange
2185END INTERFACE
2186
2187#define ARRAYOF_ORIGTYPE TYPE(vol7d_timerange)
2188#define ARRAYOF_TYPE arrayof_vol7d_timerange
2189#define ARRAYOF_ORIGEQ 1
2190#include "arrayof_pre.F90"
2191
2192
2193type(vol7d_timerange) :: almost_equal_timeranges(2)=(/&
2194 vol7d_timerange(254,0,imiss),&
2195 vol7d_timerange(3,0,3600)/)
2196
2197
2198! from arrayof
2200PUBLIC insert_unique, append_unique
2201PUBLIC almost_equal_timeranges
2202
2203CONTAINS
2204
2205
2211FUNCTION vol7d_timerange_new(timerange, p1, p2) RESULT(this)
2212INTEGER,INTENT(IN),OPTIONAL :: timerange
2213INTEGER,INTENT(IN),OPTIONAL :: p1
2214INTEGER,INTENT(IN),OPTIONAL :: p2
2215
2216TYPE(vol7d_timerange) :: this
2217
2219
2220END FUNCTION vol7d_timerange_new
2221
2222
2226SUBROUTINE vol7d_timerange_init(this, timerange, p1, p2)
2227TYPE(vol7d_timerange),INTENT(INOUT) :: this
2228INTEGER,INTENT(IN),OPTIONAL :: timerange
2229INTEGER,INTENT(IN),OPTIONAL :: p1
2230INTEGER,INTENT(IN),OPTIONAL :: p2
2231
2232IF (PRESENT(timerange)) THEN
2233 this%timerange = timerange
2234ELSE
2235 this%timerange = imiss
2236 this%p1 = imiss
2237 this%p2 = imiss
2238 RETURN
2239ENDIF
2240!!$IF (timerange == 1) THEN ! p1 sempre 0
2241!!$ this%p1 = 0
2242!!$ this%p2 = imiss
2243!!$ELSE IF (timerange == 0 .OR. timerange == 10) THEN ! solo p1
2244!!$ IF (PRESENT(p1)) THEN
2245!!$ this%p1 = p1
2246!!$ ELSE
2247!!$ this%p1 = 0
2248!!$ ENDIF
2249!!$ this%p2 = imiss
2250!!$ELSE ! tutti gli altri
2251 IF (PRESENT(p1)) THEN
2252 this%p1 = p1
2253 ELSE
2254 this%p1 = imiss
2255 ENDIF
2256 IF (PRESENT(p2)) THEN
2257 this%p2 = p2
2258 ELSE
2259 this%p2 = imiss
2260 ENDIF
2261!!$END IF
2262
2263END SUBROUTINE vol7d_timerange_init
2264
2265
2267SUBROUTINE vol7d_timerange_delete(this)
2268TYPE(vol7d_timerange),INTENT(INOUT) :: this
2269
2270this%timerange = imiss
2271this%p1 = imiss
2272this%p2 = imiss
2273
2274END SUBROUTINE vol7d_timerange_delete
2275
2276
2277SUBROUTINE display_timerange(this)
2278TYPE(vol7d_timerange),INTENT(in) :: this
2279
2280print*,to_char_timerange(this)
2281
2282END SUBROUTINE display_timerange
2283
2284
2285FUNCTION to_char_timerange(this)
2286#ifdef HAVE_DBALLE
2287USE dballef
2288#endif
2289TYPE(vol7d_timerange),INTENT(in) :: this
2290CHARACTER(len=80) :: to_char_timerange
2291
2292#ifdef HAVE_DBALLE
2293INTEGER :: handle, ier
2294
2295handle = 0
2296ier = idba_messaggi(handle,"/dev/null", "w", "BUFR")
2297ier = idba_spiegat(handle,this%timerange,this%p1,this%p2,to_char_timerange)
2298ier = idba_fatto(handle)
2299
2300to_char_timerange="Timerange: "//to_char_timerange
2301
2302#else
2303
2306
2307#endif
2308
2309END FUNCTION to_char_timerange
2310
2311
2312ELEMENTAL FUNCTION vol7d_timerange_eq(this, that) RESULT(res)
2313TYPE(vol7d_timerange),INTENT(IN) :: this, that
2314LOGICAL :: res
2315
2316
2317res = &
2318 this%timerange == that%timerange .AND. &
2319 this%p1 == that%p1 .AND. (this%p2 == that%p2 .OR. &
2320 this%timerange == 254)
2321
2322END FUNCTION vol7d_timerange_eq
2323
2324
2325ELEMENTAL FUNCTION vol7d_timerange_almost_eq(this, that) RESULT(res)
2326TYPE(vol7d_timerange),INTENT(IN) :: this, that
2327LOGICAL :: res
2328
2329IF (.not. c_e(this%timerange) .or. .not. c_e(that%timerange) .or. this%timerange == that%timerange .AND. &
2330 this%p1 == that%p1 .AND. &
2331 this%p2 == that%p2) THEN
2332 res = .true.
2333ELSE
2334 res = .false.
2335ENDIF
2336
2337END FUNCTION vol7d_timerange_almost_eq
2338
2339
2340ELEMENTAL FUNCTION vol7d_timerange_ne(this, that) RESULT(res)
2341TYPE(vol7d_timerange),INTENT(IN) :: this, that
2342LOGICAL :: res
2343
2344res = .NOT.(this == that)
2345
2346END FUNCTION vol7d_timerange_ne
2347
2348
2349ELEMENTAL FUNCTION vol7d_timerange_gt(this, that) RESULT(res)
2350TYPE(vol7d_timerange),INTENT(IN) :: this, that
2351LOGICAL :: res
2352
2353IF (this%timerange > that%timerange .OR. &
2354 (this%timerange == that%timerange .AND. this%p1 > that%p1) .OR. &
2355 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
2356 this%p2 > that%p2)) THEN
2357 res = .true.
2358ELSE
2359 res = .false.
2360ENDIF
2361
2362END FUNCTION vol7d_timerange_gt
2363
2364
2365ELEMENTAL FUNCTION vol7d_timerange_lt(this, that) RESULT(res)
2366TYPE(vol7d_timerange),INTENT(IN) :: this, that
2367LOGICAL :: res
2368
2369IF (this%timerange < that%timerange .OR. &
2370 (this%timerange == that%timerange .AND. this%p1 < that%p1) .OR. &
2371 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
2372 this%p2 < that%p2)) THEN
2373 res = .true.
2374ELSE
2375 res = .false.
2376ENDIF
2377
2378END FUNCTION vol7d_timerange_lt
2379
2380
2381ELEMENTAL FUNCTION vol7d_timerange_ge(this, that) RESULT(res)
2382TYPE(vol7d_timerange),INTENT(IN) :: this, that
2383LOGICAL :: res
2384
2385IF (this == that) THEN
2386 res = .true.
2387ELSE IF (this > that) THEN
2388 res = .true.
2389ELSE
2390 res = .false.
2391ENDIF
2392
2393END FUNCTION vol7d_timerange_ge
2394
2395
2396ELEMENTAL FUNCTION vol7d_timerange_le(this, that) RESULT(res)
2397TYPE(vol7d_timerange),INTENT(IN) :: this, that
2398LOGICAL :: res
2399
2400IF (this == that) THEN
2401 res = .true.
2402ELSE IF (this < that) THEN
2403 res = .true.
2404ELSE
2405 res = .false.
2406ENDIF
2407
2408END FUNCTION vol7d_timerange_le
2409
2410
2411ELEMENTAL FUNCTION vol7d_timerange_c_e(this) RESULT(c_e)
2412TYPE(vol7d_timerange),INTENT(IN) :: this
2413LOGICAL :: c_e
2414c_e = this /= vol7d_timerange_miss
2415END FUNCTION vol7d_timerange_c_e
2416
2417
2418#include "array_utilities_inc.F90"
2419
2420#include "arrayof_post.F90"
2421
2422
Quick method to append an element to the array. Definition: vol7d_timerange_class.F90:431 Distruttore per la classe vol7d_timerange. Definition: vol7d_timerange_class.F90:250 Costruttore per la classe vol7d_timerange. Definition: vol7d_timerange_class.F90:244 Method for inserting elements of the array at a desired position. Definition: vol7d_timerange_class.F90:422 Method for packing the array object reducing at a minimum the memory occupation, without destroying i... Definition: vol7d_timerange_class.F90:454 Method for removing elements of the array at a desired position. Definition: vol7d_timerange_class.F90:437 Represent timerange object in a pretty string. Definition: vol7d_timerange_class.F90:375 Definition of constants to be used for declaring variables of a desired type. Definition: kinds.F90:251 Definitions of constants and functions for working with missing values. Definition: missing_values.f90:50 Classe per la gestione degli intervalli temporali di osservazioni meteo e affini. Definition: vol7d_timerange_class.F90:221 Definisce l'intervallo temporale di un'osservazione meteo. Definition: vol7d_timerange_class.F90:231 |