libsim Versione 7.2.4
esempio_v7ddballe_move_and_collapse.f90

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

! 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 :: category,ier
38
39!questa chiamata prende dal launcher il nome univoco
40call l4f_launcher(a_name,a_name_force="ensascii")
41
42!init di log4fortran
43ier=l4f_init()
44
45!imposta a_name
46category=l4f_category_get(trim(a_name)//".main")
47call l4f_category_log(category,l4f_info,"start")
48
49
50! Chiamo il costruttore della classe vol7d_dballe per il mio oggetto in import
51CALL init(v7d_in,filename=filein,file=.true.)
52
53! Chiamo il costruttore della classe vol7d_dballe per il mio oggetto in export
54CALL init(v7d_out,filename=fileout,write=.true.,wipe=.true.,file=.true.)
55
56CALL import(v7d_in)
57call display(v7d_in%vol7d)
58
59! move data to the firth index for time and level
60do indana=1,size(v7d_in%vol7d%ana)
61 do indtime=2,size(v7d_in%vol7d%time)
62 do indlevel=2,size(v7d_in%vol7d%level)
63 do indtimerange=1,size(v7d_in%vol7d%timerange)
64 do indnetwork=1,size(v7d_in%vol7d%network)
65 indananew=indana
66 indtimenew=1
67 indlevelnew=1
68 indtimerangenew=indtimerange
69 indnetworknew=indnetwork
70
71 call move_datac (v7d_in%vol7d,&
72 indana,indtime,indlevel,indtimerange,indnetwork,&
73 indananew,indtimenew,indlevelnew,indtimerangenew,indnetworknew)
74
75 end do
76 end do
77 end do
78 end do
79end do
80
81! set to missing level and time > 1
82do indlevel=2,size(v7d_in%vol7d%level)
83 call init (v7d_in%vol7d%level(indlevel))
84end do
85
86do indtime=2,size(v7d_in%vol7d%time)
87 call init (v7d_in%vol7d%time(indtime))
88end do
89
90!copy with remove
91call vol7d_copy(v7d_in%vol7d,v7d_out%vol7d,miss=.true.)
92CALL delete (v7d_in)
93
94!set to missing the ambigous descriptions
95call init (v7d_out%vol7d%level(1))
96call init (v7d_out%vol7d%time(1))
97
98call display(v7d_out%vol7d)
99CALL export(v7d_out)
100CALL delete(v7d_out)
101
102!chiudo il logger
103call l4f_category_log(category,l4f_info,"end")
104call l4f_category_delete(category)
105ier=l4f_fini()
106
107END 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.