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

Generated with Doxygen.