libsim Versione 7.2.4
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 :: category,ier,gaid_template
29integer :: i,j
30character(len=512):: a_name
31type (volgrid6d),pointer :: volgrid(:),volgrid_out(:)
32type(transform_def) :: trans
33
34!questa chiamata prende dal launcher il nome univoco
35call l4f_launcher(a_name,a_name_force="demo5")
36
37!init di log4fortran
38ier=l4f_init()
39
40!imposta a_name
41category=l4f_category_get(a_name//".main")
42
43call l4f_category_log(category,l4f_info,"inizio")
44
45call import (volgrid,filename="../data/in.grb",categoryappend="volume letto")
46
47! qui posso fare tutti i conti possibili
48!!$print*,"-------------"
49!!$
50!!$call griddim_unproj(volgrid(1)%griddim)
51!!$
52!!$print*,"sotto"
53!!$
54!!$do i=1,volgrid(1)%griddim%dim%nx,10
55!!$ j=1
56!!$ print*,volgrid(1)%griddim%dim%lon(i,j),volgrid(1)%griddim%dim%lat(i,j)
57!!$end do
58!!$
59!!$print*,"destra"
60!!$
61!!$do j=1,volgrid(1)%griddim%dim%ny,10
62!!$ i=volgrid(1)%griddim%dim%nx
63!!$ print*,volgrid(1)%griddim%dim%lon(i,j),volgrid(1)%griddim%dim%lat(i,j)
64!!$end do
65!!$
66!!$print*,"sopra"
67!!$
68!!$do i=volgrid(1)%griddim%dim%nx,1,-10
69!!$ j=volgrid(1)%griddim%dim%ny
70!!$ print*,volgrid(1)%griddim%dim%lon(i,j),volgrid(1)%griddim%dim%lat(i,j)
71!!$end do
72!!$
73!!$print*,"sinistra"
74!!$
75!!$do j=volgrid(1)%griddim%dim%ny,1,-10
76!!$ i=1
77!!$ print*,volgrid(1)%griddim%dim%lon(i,j),volgrid(1)%griddim%dim%lat(i,j)
78!!$end do
79!!$
80!!$
81!!$print*,"-------------"
82
83call init(trans, trans_type="zoom",sub_type="coord", &
84 ilon=-10.d0,ilat=40.d0,flon=10.d0,flat=50.d0,&
85 categoryappend="trasformation")
86
87!call transform(trans,griddim, volgrid, volgrid_out,categoryappend="trasforma")
88call transform(trans, volgrid6d_in=volgrid, volgrid6d_out=volgrid_out,clone=.true.,categoryappend="trasforma")
89
90call display(volgrid_out(1)%griddim)
91
92call l4f_category_log(category,l4f_info,"trasformato")
93
94if (associated(volgrid)) call delete(volgrid)
95
96!call grib_new_from_template (gaid_template,"regular_ll_sfc_grib1")
97
98call l4f_category_log(category,l4f_info,"export a un nuovo file grib")
99
100!call export (volgrid,filename="out.grb",gaid_template=gaid_template,categoryappend="exportazione")
101call export (volgrid_out,filename="out.grb",categoryappend="exportazione")
102
103call l4f_category_log(category,l4f_info,"terminato")
104
105if (associated(volgrid_out)) call delete(volgrid_out)
106
107!chiudo il logger
108call l4f_category_delete(category)
109ier=l4f_fini()
110
111end 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.
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.