Programma esempio semplice per gridinfo e volgrid6d.
Programma esempio semplice per gridinfo e volgrid6d. Programma che importa da file un vettore di gridinfo poi lo importa in volgrid6d. Da volgrid6d viene di nuovo creato un vettore di gridinfo per poi exportare su file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18program demo3
19
26implicit none
27
28integer :: ier
29type(l4f_handle) :: category
30character(len=512):: a_name
31type(arrayof_gridinfo) :: gridinfoin, gridinfoout
32type(volgrid6d),pointer :: volgrid(:)
33
34TYPE(grid_file_id) :: ifile
35TYPE(grid_id) :: gaid, gaid_template
36INTEGER :: ngrib
37
38
39call l4f_launcher(a_name,a_name_force="demo3")
40
41
43
44
45category=l4f_category_get_handle(a_name//".main")
46
47
48ngrib=0
49
50ifile = grid_file_id_new('../data/in.grb','r')
51ngrib = grid_file_id_count(ifile)
52
54 "Numero totale di grib: "//
to_char(ngrib))
55
56
57CALL insert(gridinfoin, nelem=ngrib)
58
59ngrib=0
60
61
62DO WHILE (.true.)
63 gaid = grid_id_new(ifile)
64 IF (.NOT.
c_e(gaid))
EXIT
65
67 ngrib = ngrib + 1
68 CALL init (gridinfoin%array(ngrib), gaid=gaid, categoryappend=trim(
to_char(ngrib)))
69 CALL import(gridinfoin%array(ngrib))
70ENDDO
71
74
76
77call import(volgrid, gridinfoin, categoryappend=
"volume di test")
78
80
82
83
84
85gaid_template = grid_id_new(grib_api_template="regular_ll_sfc_grib1")
86
87call l4f_category_log(category,l4f_info,
"export a un grib fatto come voglio io")
88
89call export(volgrid, gridinfoout, gaid_template=gaid_template)
90
91ifile = grid_file_id_new('out.grb','w')
92
93do ngrib=1,gridinfoout%arraysize
94
95
96 if(
c_e(gridinfoout%array(ngrib)%gaid))
then
97 call export(gridinfoout%array(ngrib))
98 call export(gridinfoout%array(ngrib)%gaid,ifile)
99 end if
100end do
101
103
105
107
108
109call l4f_category_delete(category)
111
112end program demo3
Destructor for the line_split class.
Set of functions that return a CHARACTER representation of the input variable.
Check whether the corresponding object has been correctly associated.
Display on standard output a description of the grid_id object provided.
Constructors for the corresponding classes in SUBROUTINE form.
Import information from a file or grid_id object into the gridinfo descriptors.
Method for inserting elements of the array at a desired position.
Emit log message for a category with specific priority.
Global log4fortran destructor.
Global log4fortran constructor.
Utilities for CHARACTER variables.
This module defines an abstract interface to different drivers for access to files containing gridded...
Class for managing information about a single gridded georeferenced field, typically imported from an...
classe per la gestione del logging
Definitions of constants and functions for working with missing values.
This module defines objects and methods for managing data volumes on rectangular georeferenced grids.