libsim Versione 8.0.0
example_vg6d_5.f90

Programma trasformazione da volgrid6d a volgrid6d.

Programma trasformazione da volgrid6d a volgrid6d Legge grib da un file e li organizza in un vettore di strutture volgrid6d mettendoli a disposizione per eventuali elaborazioni; vengono poi riesportati a un file grib

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 demo5
19
21use grib_api
23use grid_class
26implicit none
27
28integer :: ier,gaid_template
29type(l4f_handle) :: category
30integer :: i,j
31character(len=512):: a_name
32type (volgrid6d),pointer :: volgrid(:),volgrid_out(:)
33type(transform_def) :: trans
34
35!questa chiamata prende dal launcher il nome univoco
36call l4f_launcher(a_name,a_name_force="demo5")
37
38!init di log4fortran
39ier=l4f_init()
40
41!imposta a_name
42category=l4f_category_get_handle(a_name//".main")
43
44call l4f_category_log(category,l4f_info,"inizio")
45
46call import (volgrid,filename="../data/in.grb",categoryappend="volume letto")
47
48! qui posso fare tutti i conti possibili
49!!$print*,"-------------"
50!!$
51!!$call griddim_unproj(volgrid(1)%griddim)
52!!$
53!!$print*,"sotto"
54!!$
55!!$do i=1,volgrid(1)%griddim%dim%nx,10
56!!$ j=1
57!!$ print*,volgrid(1)%griddim%dim%lon(i,j),volgrid(1)%griddim%dim%lat(i,j)
58!!$end do
59!!$
60!!$print*,"destra"
61!!$
62!!$do j=1,volgrid(1)%griddim%dim%ny,10
63!!$ i=volgrid(1)%griddim%dim%nx
64!!$ print*,volgrid(1)%griddim%dim%lon(i,j),volgrid(1)%griddim%dim%lat(i,j)
65!!$end do
66!!$
67!!$print*,"sopra"
68!!$
69!!$do i=volgrid(1)%griddim%dim%nx,1,-10
70!!$ j=volgrid(1)%griddim%dim%ny
71!!$ print*,volgrid(1)%griddim%dim%lon(i,j),volgrid(1)%griddim%dim%lat(i,j)
72!!$end do
73!!$
74!!$print*,"sinistra"
75!!$
76!!$do j=volgrid(1)%griddim%dim%ny,1,-10
77!!$ i=1
78!!$ print*,volgrid(1)%griddim%dim%lon(i,j),volgrid(1)%griddim%dim%lat(i,j)
79!!$end do
80!!$
81!!$
82!!$print*,"-------------"
83
84call init(trans, trans_type="zoom",sub_type="coord", &
85 ilon=-10.d0,ilat=40.d0,flon=10.d0,flat=50.d0,&
86 categoryappend="trasformation")
87
88!call transform(trans,griddim, volgrid, volgrid_out,categoryappend="trasforma")
89call transform(trans, volgrid6d_in=volgrid, volgrid6d_out=volgrid_out,clone=.true.,categoryappend="trasforma")
90
91call display(volgrid_out(1)%griddim)
92
93call l4f_category_log(category,l4f_info,"trasformato")
94
95if (associated(volgrid)) call delete(volgrid)
96
97!call grib_new_from_template (gaid_template,"regular_ll_sfc_grib1")
98
99call l4f_category_log(category,l4f_info,"export a un nuovo file grib")
100
101!call export (volgrid,filename="out.grb",gaid_template=gaid_template,categoryappend="exportazione")
102call export (volgrid_out,filename="out.grb",categoryappend="exportazione")
103
104call l4f_category_log(category,l4f_info,"terminato")
105
106if (associated(volgrid_out)) call delete(volgrid_out)
107
108!chiudo il logger
109call l4f_category_delete(category)
110ier=l4f_fini()
111
112end program demo5
Destructor for the line_split class.
Print a brief description on stdout.
Export griddim object to grid_id.
Constructors of the corresponding objects.
Emit log message for a category with specific priority.
Global log4fortran destructor.
Global log4fortran constructor.
Transform between any combination of volgrid6d and vol7d objects by means of a transform_def object d...
Utilities for CHARACTER variables.
Module for describing geographically referenced regular grids.
Module for defining transformations between rectangular georeferenced grids and between grids and spa...
classe per la gestione del logging
This module defines objects and methods for managing data volumes on rectangular georeferenced grids.

Generated with Doxygen.