libsim  Versione6.3.0
example_vg6d_8.f90

Programma scrittura su file vettore di anagrafica

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/>.
18 program demo8
19 
20 use log4fortran
22 USE vol7d_class
23 
24 implicit none
25 
26 integer :: category,ier
27 character(len=512):: a_name,filename="synop_t.bufr"
28 TYPE(vol7d_dballe) :: v7d_dba
29 TYPE(vol7d) :: v7d_ana
30 
31 !questa chiamata prende dal launcher il nome univoco
32 call l4f_launcher(a_name,a_name_force="demo8")
33 
34 !init di log4fortran
35 ier=l4f_init()
36 
37 !imposta a_name
38 category=l4f_category_get(a_name//".main")
39 
40 call l4f_category_log(category,l4f_info,"inizio")
41 
42 ! Chiamo il costruttore della classe vol7d_dballe per il mio oggetto in import
43 CALL init(v7d_dba,file=.true.,write=.false.,filename=filename,&
44  categoryappend="importBUFR",format="BUFR")
45 
46 call import(v7d_dba,var=(/"B12101"/),varkind=(/"r"/))
47 
48 call l4f_category_log(category,l4f_info,"importato vol7d")
49 
50 call display(v7d_dba%vol7d)
51 
52 call l4f_category_log(category,l4f_info,"export to ana file")
53 
54 call init(v7d_ana)
55 
56 call vol7d_copy(v7d_dba%vol7d,v7d_ana)
57 
58 call delete(v7d_dba)
59 
60 !pulisco i dati che a me sono inutili
61 call delete(v7d_ana,dataonly=.true.)
62  call vol7d_alloc(v7d_ana, &
63  ntime=0, ntimerange=0, nlevel=0, &
64  ndativarr=0, ndativari=0, ndativarb=0, ndativard=0, ndativarc=0,&
65  ndatiattrr=0, ndatiattri=0, ndatiattrb=0, ndatiattrd=0, ndatiattrc=0,&
66  ndativarattrr=0, ndativarattri=0, ndativarattrb=0, ndativarattrd=0, ndativarattrc=0)
67 
68 call display(v7d_ana)
69 
70 CALL export(v7d_ana,filename="ana.v7d",description="Solo anagrafica")
71 
72 call delete(v7d_ana)
73 
74 call l4f_category_log(category,l4f_info,"terminato")
75 
76 
77 !chiudo il logger
78 call l4f_category_delete(category)
79 ier=l4f_fini()
80 
81 end program demo8

Generated with Doxygen.