libsim  Versione 7.1.8
example_vg6d_5.f90

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/>.
18 program demo5
19 
20 use log4fortran
21 use grib_api
23 use grid_class
26 implicit none
27 
28 integer :: category,ier,gaid_template
29 integer :: i,j
30 character(len=512):: a_name
31 type (volgrid6d),pointer :: volgrid(:),volgrid_out(:)
32 type(transform_def) :: trans
33 
34 !questa chiamata prende dal launcher il nome univoco
35 call l4f_launcher(a_name,a_name_force="demo5")
36 
37 !init di log4fortran
38 ier=l4f_init()
39 
40 !imposta a_name
41 category=l4f_category_get(a_name//".main")
42 
43 call l4f_category_log(category,l4f_info,"inizio")
44 
45 call 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 
83 call 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")
88 call transform(trans, volgrid6d_in=volgrid, volgrid6d_out=volgrid_out,clone=.true.,categoryappend="trasforma")
89 
90 call display(volgrid_out(1)%griddim)
91 
92 call l4f_category_log(category,l4f_info,"trasformato")
93 
94 if (associated(volgrid)) call delete(volgrid)
95 
96 !call grib_new_from_template (gaid_template,"regular_ll_sfc_grib1")
97 
98 call 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")
101 call export (volgrid_out,filename="out.grb",categoryappend="exportazione")
102 
103 call l4f_category_log(category,l4f_info,"terminato")
104 
105 if (associated(volgrid_out)) call delete(volgrid_out)
106 
107 !chiudo il logger
108 call l4f_category_delete(category)
109 ier=l4f_fini()
110 
111 end program demo5
Emit log message for a category with specific priority.
log4fortran destructor
Global log4fortran constructor.
Display on standard output a description of the volgrid6d object provided.
Export an object dirctly to a native file, to a gridinfo object or to a supported file format through...
Constructor, it creates a new instance of the object.
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.
Definition: grid_class.F90:243
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.