libsim Versione 7.2.4
|
◆ arrayof_vol7d_timerange_remove()
Method for removing elements of the array at a desired position. If necessary, the array is reallocated to reduce space.
Definizione alla linea 1994 del file vol7d_timerange_class.F90. 1999! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
2000! authors:
2001! Davide Cesari <dcesari@arpa.emr.it>
2002! Paolo Patruno <ppatruno@arpa.emr.it>
2003
2004! This program is free software; you can redistribute it and/or
2005! modify it under the terms of the GNU General Public License as
2006! published by the Free Software Foundation; either version 2 of
2007! the License, or (at your option) any later version.
2008
2009! This program is distributed in the hope that it will be useful,
2010! but WITHOUT ANY WARRANTY; without even the implied warranty of
2011! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2012! GNU General Public License for more details.
2013
2014! You should have received a copy of the GNU General Public License
2015! along with this program. If not, see <http://www.gnu.org/licenses/>.
2016#include "config.h"
2017
2029IMPLICIT NONE
2030
2036 INTEGER :: timerange
2037 INTEGER :: p1
2038 INTEGER :: p2
2040
2042TYPE(vol7d_timerange),PARAMETER :: vol7d_timerange_miss= &
2043 vol7d_timerange(imiss,imiss,imiss)
2044
2049 MODULE PROCEDURE vol7d_timerange_init
2050END INTERFACE
2051
2055 MODULE PROCEDURE vol7d_timerange_delete
2056END INTERFACE
2057
2061INTERFACE OPERATOR (==)
2062 MODULE PROCEDURE vol7d_timerange_eq
2063END INTERFACE
2064
2068INTERFACE OPERATOR (/=)
2069 MODULE PROCEDURE vol7d_timerange_ne
2070END INTERFACE
2071
2075INTERFACE OPERATOR (>)
2076 MODULE PROCEDURE vol7d_timerange_gt
2077END INTERFACE
2078
2082INTERFACE OPERATOR (<)
2083 MODULE PROCEDURE vol7d_timerange_lt
2084END INTERFACE
2085
2089INTERFACE OPERATOR (>=)
2090 MODULE PROCEDURE vol7d_timerange_ge
2091END INTERFACE
2092
2096INTERFACE OPERATOR (<=)
2097 MODULE PROCEDURE vol7d_timerange_le
2098END INTERFACE
2099
2102INTERFACE OPERATOR (.almosteq.)
2103 MODULE PROCEDURE vol7d_timerange_almost_eq
2104END INTERFACE
2105
2106
2107! da documentare in inglese assieme al resto
2110 MODULE PROCEDURE vol7d_timerange_c_e
2111END INTERFACE
2112
2113#define VOL7D_POLY_TYPE TYPE(vol7d_timerange)
2114#define VOL7D_POLY_TYPES _timerange
2115#define ENABLE_SORT
2116#include "array_utilities_pre.F90"
2117
2120 MODULE PROCEDURE display_timerange
2121END INTERFACE
2122
2125 MODULE PROCEDURE to_char_timerange
2126END INTERFACE
2127
2128#define ARRAYOF_ORIGTYPE TYPE(vol7d_timerange)
2129#define ARRAYOF_TYPE arrayof_vol7d_timerange
2130#define ARRAYOF_ORIGEQ 1
2131#include "arrayof_pre.F90"
2132
2133
2134type(vol7d_timerange) :: almost_equal_timeranges(2)=(/&
2135 vol7d_timerange(254,0,imiss),&
2136 vol7d_timerange(3,0,3600)/)
2137
2138
2139! from arrayof
2141PUBLIC insert_unique, append_unique
2142PUBLIC almost_equal_timeranges
2143
2144CONTAINS
2145
2146
2152FUNCTION vol7d_timerange_new(timerange, p1, p2) RESULT(this)
2153INTEGER,INTENT(IN),OPTIONAL :: timerange
2154INTEGER,INTENT(IN),OPTIONAL :: p1
2155INTEGER,INTENT(IN),OPTIONAL :: p2
2156
2157TYPE(vol7d_timerange) :: this
2158
2160
2161END FUNCTION vol7d_timerange_new
2162
2163
2167SUBROUTINE vol7d_timerange_init(this, timerange, p1, p2)
2168TYPE(vol7d_timerange),INTENT(INOUT) :: this
2169INTEGER,INTENT(IN),OPTIONAL :: timerange
2170INTEGER,INTENT(IN),OPTIONAL :: p1
2171INTEGER,INTENT(IN),OPTIONAL :: p2
2172
2173IF (PRESENT(timerange)) THEN
2174 this%timerange = timerange
2175ELSE
2176 this%timerange = imiss
2177 this%p1 = imiss
2178 this%p2 = imiss
2179 RETURN
2180ENDIF
2181!!$IF (timerange == 1) THEN ! p1 sempre 0
2182!!$ this%p1 = 0
2183!!$ this%p2 = imiss
2184!!$ELSE IF (timerange == 0 .OR. timerange == 10) THEN ! solo p1
2185!!$ IF (PRESENT(p1)) THEN
2186!!$ this%p1 = p1
2187!!$ ELSE
2188!!$ this%p1 = 0
2189!!$ ENDIF
2190!!$ this%p2 = imiss
2191!!$ELSE ! tutti gli altri
2192 IF (PRESENT(p1)) THEN
2193 this%p1 = p1
2194 ELSE
2195 this%p1 = imiss
2196 ENDIF
2197 IF (PRESENT(p2)) THEN
2198 this%p2 = p2
2199 ELSE
2200 this%p2 = imiss
2201 ENDIF
2202!!$END IF
2203
2204END SUBROUTINE vol7d_timerange_init
2205
2206
2208SUBROUTINE vol7d_timerange_delete(this)
2209TYPE(vol7d_timerange),INTENT(INOUT) :: this
2210
2211this%timerange = imiss
2212this%p1 = imiss
2213this%p2 = imiss
2214
2215END SUBROUTINE vol7d_timerange_delete
2216
2217
2218SUBROUTINE display_timerange(this)
2219TYPE(vol7d_timerange),INTENT(in) :: this
2220
2221print*,to_char_timerange(this)
2222
2223END SUBROUTINE display_timerange
2224
2225
2226FUNCTION to_char_timerange(this)
2227#ifdef HAVE_DBALLE
2228USE dballef
2229#endif
2230TYPE(vol7d_timerange),INTENT(in) :: this
2231CHARACTER(len=80) :: to_char_timerange
2232
2233#ifdef HAVE_DBALLE
2234INTEGER :: handle, ier
2235
2236handle = 0
2237ier = idba_messaggi(handle,"/dev/null", "w", "BUFR")
2238ier = idba_spiegat(handle,this%timerange,this%p1,this%p2,to_char_timerange)
2239ier = idba_fatto(handle)
2240
2241to_char_timerange="Timerange: "//to_char_timerange
2242
2243#else
2244
2247
2248#endif
2249
2250END FUNCTION to_char_timerange
2251
2252
2253ELEMENTAL FUNCTION vol7d_timerange_eq(this, that) RESULT(res)
2254TYPE(vol7d_timerange),INTENT(IN) :: this, that
2255LOGICAL :: res
2256
2257
2258res = &
2259 this%timerange == that%timerange .AND. &
2260 this%p1 == that%p1 .AND. (this%p2 == that%p2 .OR. &
2261 this%timerange == 254)
2262
2263END FUNCTION vol7d_timerange_eq
2264
2265
2266ELEMENTAL FUNCTION vol7d_timerange_almost_eq(this, that) RESULT(res)
2267TYPE(vol7d_timerange),INTENT(IN) :: this, that
2268LOGICAL :: res
2269
2270IF (.not. c_e(this%timerange) .or. .not. c_e(that%timerange) .or. this%timerange == that%timerange .AND. &
2271 this%p1 == that%p1 .AND. &
2272 this%p2 == that%p2) THEN
2273 res = .true.
2274ELSE
2275 res = .false.
2276ENDIF
2277
2278END FUNCTION vol7d_timerange_almost_eq
2279
2280
2281ELEMENTAL FUNCTION vol7d_timerange_ne(this, that) RESULT(res)
2282TYPE(vol7d_timerange),INTENT(IN) :: this, that
2283LOGICAL :: res
2284
2285res = .NOT.(this == that)
2286
2287END FUNCTION vol7d_timerange_ne
2288
2289
2290ELEMENTAL FUNCTION vol7d_timerange_gt(this, that) RESULT(res)
2291TYPE(vol7d_timerange),INTENT(IN) :: this, that
2292LOGICAL :: res
2293
2294IF (this%timerange > that%timerange .OR. &
2295 (this%timerange == that%timerange .AND. this%p1 > that%p1) .OR. &
2296 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
2297 this%p2 > that%p2)) THEN
2298 res = .true.
2299ELSE
2300 res = .false.
2301ENDIF
2302
2303END FUNCTION vol7d_timerange_gt
2304
2305
2306ELEMENTAL FUNCTION vol7d_timerange_lt(this, that) RESULT(res)
2307TYPE(vol7d_timerange),INTENT(IN) :: this, that
2308LOGICAL :: res
2309
2310IF (this%timerange < that%timerange .OR. &
2311 (this%timerange == that%timerange .AND. this%p1 < that%p1) .OR. &
2312 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
2313 this%p2 < that%p2)) THEN
2314 res = .true.
2315ELSE
2316 res = .false.
2317ENDIF
2318
2319END FUNCTION vol7d_timerange_lt
2320
2321
2322ELEMENTAL FUNCTION vol7d_timerange_ge(this, that) RESULT(res)
2323TYPE(vol7d_timerange),INTENT(IN) :: this, that
2324LOGICAL :: res
2325
2326IF (this == that) THEN
2327 res = .true.
2328ELSE IF (this > that) THEN
2329 res = .true.
2330ELSE
2331 res = .false.
2332ENDIF
2333
2334END FUNCTION vol7d_timerange_ge
2335
2336
2337ELEMENTAL FUNCTION vol7d_timerange_le(this, that) RESULT(res)
2338TYPE(vol7d_timerange),INTENT(IN) :: this, that
2339LOGICAL :: res
2340
2341IF (this == that) THEN
2342 res = .true.
2343ELSE IF (this < that) THEN
2344 res = .true.
2345ELSE
2346 res = .false.
2347ENDIF
2348
2349END FUNCTION vol7d_timerange_le
2350
2351
2352ELEMENTAL FUNCTION vol7d_timerange_c_e(this) RESULT(c_e)
2353TYPE(vol7d_timerange),INTENT(IN) :: this
2354LOGICAL :: c_e
2355c_e = this /= vol7d_timerange_miss
2356END FUNCTION vol7d_timerange_c_e
2357
2358
2359#include "array_utilities_inc.F90"
2360
2361#include "arrayof_post.F90"
2362
2363
Quick method to append an element to the array. Definition vol7d_timerange_class.F90:425 Distruttore per la classe vol7d_timerange. Definition vol7d_timerange_class.F90:244 Costruttore per la classe vol7d_timerange. Definition vol7d_timerange_class.F90:238 Method for inserting elements of the array at a desired position. Definition vol7d_timerange_class.F90:416 Method for packing the array object reducing at a minimum the memory occupation, without destroying i... Definition vol7d_timerange_class.F90:448 Method for removing elements of the array at a desired position. Definition vol7d_timerange_class.F90:431 Represent timerange object in a pretty string. Definition vol7d_timerange_class.F90:369 Definition of constants to be used for declaring variables of a desired type. Definition kinds.F90:245 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:215 Definisce l'intervallo temporale di un'osservazione meteo. Definition vol7d_timerange_class.F90:225 |