libsim  Versione8.0.0
example_vg6d_7.f90

Programma trasformazione da vol7d a volgrid6d

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 demo7
19 
20 use log4fortran
22 use grid_class
25 USE vol7d_class
26 USE grid_id_class
27 
28 implicit none
29 
30 integer :: ier
31 type(l4f_handle) :: category
32 character(len=512):: a_name,filename="out.bufr"
33 type(volgrid6d),pointer :: volgrid(:)
34 type(transform_def) :: trans
35 TYPE(vol7d_dballe) :: v7d_import
36 type(griddim_def) :: griddim_out
37 
38 integer :: nx=40,ny=40,component_flag=0
39 type(grid_id) :: gaid_template
40 doubleprecision :: xmin=0., xmax=30., ymin=30., ymax=60.
41 doubleprecision :: latitude_south_pole=-32.5,longitude_south_pole=10.,angle_rotation=0.
42 character(len=80) :: type='regular_ll',trans_type='inter',sub_type='linear'
43 
44 !questa chiamata prende dal launcher il nome univoco
45 call l4f_launcher(a_name,a_name_force="demo7")
46 
47 !init di log4fortran
48 ier=l4f_init()
49 
50 !imposta a_name
51 category=l4f_category_get_handle(a_name//".main")
52 
53 call l4f_category_log(category,l4f_info,"inizio")
54 
55 allocate (volgrid(1))
56 
57 call init(griddim_out,&
58  proj_type=type,nx=nx,ny=ny, &
59  xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, component_flag=component_flag, &
60  latitude_south_pole=latitude_south_pole,longitude_south_pole=longitude_south_pole,angle_rotation=angle_rotation, &
61  categoryappend=type)
62 
63 call griddim_unproj(griddim_out)
64 
65 print*,'grid di interpolazione >>>>>>>>>>>>>>>>>>>>'
66 call display(griddim_out)
67 
68 gaid_template = grid_id_new(grib_api_template="regular_ll_sfc_grib1")
69 
70 !trasformation object
71 call init(trans, trans_type=trans_type,sub_type=sub_type, categoryappend="trasformation")
72 
73 ! Chiamo il costruttore della classe vol7d_dballe per il mio oggetto in import
74 CALL init(v7d_import,file=.true.,write=.false.,filename=filename,&
75  categoryappend="importBUFR",format="BUFR")
76 
77 call import (v7d_import,var=(/"B12101"/),varkind=(/"r"/))
78 
79 call display(v7d_import%vol7d)
80 
81 call l4f_category_log(category,l4f_info,"trasformato")
82 call transform(trans,griddim_out, vol7d_in=v7d_import%vol7d, &
83  volgrid6d_out=volgrid(1), gaid_template=gaid_template, &
84  categoryappend="trasform->")
85 
86 call l4f_category_log(category,l4f_info,"export to GRIB")
87 CALL export(volgrid, 'examp[le_v7d.grb', gaid_template=gaid_template,&
88  categoryappend="volume scritto")
89 
90 if (associated(volgrid)) call delete(volgrid)
91 
92 call l4f_category_log(category,l4f_info,"terminato")
93 
94 call delete (v7d_import)
95 
96 !chiudo il logger
97 call l4f_category_delete(category)
98 ier=l4f_fini()
99 
100 end program demo7

Generated with Doxygen.