libsim  Versione8.0.0
example_vg6d_6.f90

Programma trasformazione da volgrid6d a vol7d

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 demo6
19 
20 use log4fortran
22 use grid_class
25 USE vol7d_class
26 
27 implicit none
28 
29 integer :: ier,i,nana
30 type(l4f_handle) :: category
31 character(len=512):: a_name,filename="out.bufr"
32 type(volgrid6d),pointer :: volgrid(:),volgrid_out(:)
33 type(transform_def) :: trans
34 type(vol7d) :: v7d
35 type(vol7d) :: vol7d_out
36 TYPE(vol7d_dballe) :: v7d_exp
37 
38 
39 !questa chiamata prende dal launcher il nome univoco
40 call l4f_launcher(a_name,a_name_force="demo6")
41 
42 !init di log4fortran
43 ier=l4f_init()
44 
45 !imposta a_name
46 category=l4f_category_get_handle(a_name//".main")
47 
48 call l4f_category_log(category,l4f_info,"inizio")
49 
50 !!$ nana=5
51 !!$ allocate(ana(nana))
52 !!$ !target points
53 !!$ call init(ana(1),lat=45.D0,lon=11.D0)
54 !!$ call init(ana(2),lat=45.6D0,lon=11.8D0)
55 !!$ call init(ana(3),lat=46.6D0,lon=12.8D0)
56 !!$ call init(ana(4),lat=40.6D0,lon=11.8D0)
57 !!$ call init(ana(5),lat=40.0D0,lon=10.0D0)
58 
59 call init(v7d)
60 
61 call import (v7d,filename="ana.v7d")
62 
63 call display(v7d)
64 
65 !trasformation object
66 call init(trans, trans_type="inter",sub_type="bilin", categoryappend="trasformation")
67 
68 call import (volgrid,filename="in.grb",categoryappend="volume letto")
69 
70 call transform(trans, volgrid6d_in=volgrid, vol7d_out=vol7d_out, v7d=v7d, categoryappend="trasforma")
71 
72 call l4f_category_log(category,l4f_info,"trasformato")
73 
74 if (associated(volgrid)) call delete(volgrid)
75 
76 call l4f_category_log(category,l4f_info,"export to BUFR")
77 
78 
79 ! Chiamo il costruttore della classe vol7d_dballe per il mio oggetto in export
80 CALL init(v7d_exp,file=.true.,write=.true.,wipe=.true.,filename=filename,&
81 categoryappend="exportBUFR",format="BUFR",template="synop")
82 
83 CALL display(vol7d_out)
84 v7d_exp%vol7d = vol7d_out
85 CALL export(v7d_exp)
86 
87 CALL l4f_category_log(category,l4f_info,"terminato")
88 
89 CALL delete (v7d_exp)
90 
91 !chiudo il logger
92 CALL l4f_category_delete(category)
93 ier=l4f_fini()
94 
95 end program demo6

Generated with Doxygen.