libsim Versione 7.2.4
esempio_v7ddballe.f90

/brief Programma esempio semplice per l'uso di vol7d con DB-All.e

/brief Programma esempio semplice per l'uso di vol7d con DB-All.e

1! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
2! authors:
3! Davide Cesari <dcesari@arpa.emr.it>
4! Paolo Patruno <ppatruno@arpa.emr.it>
5
6! This program is free software; you can redistribute it and/or
7! modify it under the terms of the GNU General Public License as
8! published by the Free Software Foundation; either version 2 of
9! the License, or (at your option) any later version.
10
11! This program is distributed in the hope that it will be useful,
12! but WITHOUT ANY WARRANTY; without even the implied warranty of
13! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14! GNU General Public License for more details.
15
16! You should have received a copy of the GNU General Public License
17! along with this program. If not, see <http://www.gnu.org/licenses/>.
18PROGRAM v7ddballe
19! Programma di esempio di estrazione dall'archivio DB-all.e
23
24IMPLICIT NONE
25
26TYPE(vol7d_dballe) :: v7d
27TYPE(datetime) :: ti, tf
28TYPE(vol7d_network):: network
29CHARACTER(len=12) :: c
30INTEGER :: i, n
31REAL, POINTER :: vol2d(:,:)
32
33! Definisco le date iniziale e finale e network
34CALL init(ti, year=2007, month=3, day=18, hour=12)
35CALL init(tf, year=2007, month=3, day=21, hour=00)
36call init(network,name='generic')
37
38! Chiamo il costruttore della classe vol7d_dballe per il mio oggetto
39CALL init(v7d)
40
41! Importo i dati, variabile 'B13011' della btable (precipitazione),
42CALL import(v7d, var=(/'B13011'/),set_network=network,varkind=(/"r"/), attr=(/"*B33192","*B33007"/))
43!CALL import(v7d, 'B13011', network=network, timei=ti, timef=tf, timerange=vol7d_timerange(4,-1800,0), attr=(/"*B33192","*B33007"/))
44
45print *,v7d%vol7d%dativar%r
46print *,v7d%vol7d%datiattr%c
47
48
49! Creo una vista su un array bidimensionale che scorre le dimensioni
50! dell'anagrafica e del tempo (vol7d_ana_d, vol7d_time_d)
51CALL vol7d_get_voldatir(v7d%vol7d, (/vol7d_ana_d,vol7d_time_d/), vol2dp=vol2d)
52! Calcolo la media e la stampo assieme all'istante
53DO i = 1, SIZE(v7d%vol7d%time)
54 CALL getval(v7d%vol7d%time(i), simpledate=c)
55 n = count(vol2d(:,i) /= rmiss)
56 IF (n > 0) THEN
57 print*, c, ' prec. media:', sum(vol2d(:,i), mask=(vol2d(:,i) /= rmiss))/n,n
58! if (c=="200703202030" ) print *, vol2d(:,i)
59
60 ENDIF
61ENDDO
62
63CALL delete (v7d)
64
65END PROGRAM v7ddballe
Distruttori per le 2 classi.
Restituiscono il valore dell'oggetto nella forma desiderata.
Costruttori per le classi datetime e timedelta.
Lettura da file.
Classi per la gestione delle coordinate temporali.
Classe per la gestione di un volume completo di dati osservati.
classe per import ed export di volumi da e in DB-All.e

Generated with Doxygen.