libsim Versione 8.0.0
esempio_v7ddballe_move_and_collapse.f90

!

! Example program to reduce to one the dimensions of levels and time without loss of data

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_move_and_collapse
19! Example program to reduce to one the dimensions of levels and time without loss of data
20! read from in.bufr and write to out.bufr
21
24
25IMPLICIT NONE
26
27TYPE(vol7d_dballe) :: v7d_in,v7d_out
28
29integer :: indana,indtime,indlevel,indtimerange,indnetwork
30integer :: indananew,indtimenew,indlevelnew,indtimerangenew,indnetworknew
31integer :: inddativar,inddatiattr,inddativarattr
32
33
34CHARACTER(len=80) :: filein="../data/in.bufr",fileout="../data/out.bufr"
35
36character(len=512):: a_name
37integer :: ier
38type(l4f_handle) :: category
39
40!questa chiamata prende dal launcher il nome univoco
41call l4f_launcher(a_name,a_name_force="ensascii")
42
43!init di log4fortran
44ier=l4f_init()
45
46!imposta a_name
47category=l4f_category_get_handle(trim(a_name)//".main")
48call l4f_category_log(category,l4f_info,"start")
49
50
51! Chiamo il costruttore della classe vol7d_dballe per il mio oggetto in import
52CALL init(v7d_in,filename=filein,file=.true.)
53
54! Chiamo il costruttore della classe vol7d_dballe per il mio oggetto in export
55CALL init(v7d_out,filename=fileout,write=.true.,wipe=.true.,file=.true.)
56
57CALL import(v7d_in)
58call display(v7d_in%vol7d)
59
60! move data to the firth index for time and level
61do indana=1,size(v7d_in%vol7d%ana)
62 do indtime=2,size(v7d_in%vol7d%time)
63 do indlevel=2,size(v7d_in%vol7d%level)
64 do indtimerange=1,size(v7d_in%vol7d%timerange)
65 do indnetwork=1,size(v7d_in%vol7d%network)
66 indananew=indana
67 indtimenew=1
68 indlevelnew=1
69 indtimerangenew=indtimerange
70 indnetworknew=indnetwork
71
72 call move_datac (v7d_in%vol7d,&
73 indana,indtime,indlevel,indtimerange,indnetwork,&
74 indananew,indtimenew,indlevelnew,indtimerangenew,indnetworknew)
75
76 end do
77 end do
78 end do
79 end do
80end do
81
82! set to missing level and time > 1
83do indlevel=2,size(v7d_in%vol7d%level)
84 call init (v7d_in%vol7d%level(indlevel))
85end do
86
87do indtime=2,size(v7d_in%vol7d%time)
88 call init (v7d_in%vol7d%time(indtime))
89end do
90
91!copy with remove
92call vol7d_copy(v7d_in%vol7d,v7d_out%vol7d,miss=.true.)
93CALL delete (v7d_in)
94
95!set to missing the ambigous descriptions
96call init (v7d_out%vol7d%level(1))
97call init (v7d_out%vol7d%time(1))
98
99call display(v7d_out%vol7d)
100CALL export(v7d_out)
101CALL delete(v7d_out)
102
103!chiudo il logger
104call l4f_category_log(category,l4f_info,"end")
105call l4f_category_delete(category)
106ier=l4f_fini()
107
108END PROGRAM v7ddballe_move_and_collapse
Distruttore per la classe vol7d.
Scrittura su file.
Lettura da file.
Costruttore per la classe vol7d.
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.