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 :: category,ier
29character(len=512):: a_name
30type(arrayof_gridinfo) :: gridinfoin, gridinfoout
31type(volgrid6d),pointer :: volgrid(:)
32
33TYPE(grid_file_id) :: ifile
34TYPE(grid_id) :: gaid, gaid_template
35INTEGER :: ngrib
36
37
38call l4f_launcher(a_name,a_name_force="demo3")
39
40
42
43
44category=l4f_category_get(a_name//".main")
45
46
47ngrib=0
48
49ifile = grid_file_id_new('../data/in.grb','r')
50ngrib = grid_file_id_count(ifile)
51
53 "Numero totale di grib: "//
to_char(ngrib))
54
55
56CALL insert(gridinfoin, nelem=ngrib)
57
58ngrib=0
59
60
61DO WHILE (.true.)
62 gaid = grid_id_new(ifile)
63 IF (.NOT.
c_e(gaid))
EXIT
64
66 ngrib = ngrib + 1
67 CALL init (gridinfoin%array(ngrib), gaid=gaid, categoryappend=trim(
to_char(ngrib)))
68 CALL import(gridinfoin%array(ngrib))
69ENDDO
70
73
75
76call import(volgrid, gridinfoin, categoryappend=
"volume di test")
77
79
81
82
83
84gaid_template = grid_id_new(grib_api_template="regular_ll_sfc_grib1")
85
86call l4f_category_log(category,l4f_info,
"export a un grib fatto come voglio io")
87
88call export(volgrid, gridinfoout, gaid_template=gaid_template)
89
90ifile = grid_file_id_new('out.grb','w')
91
92do ngrib=1,gridinfoout%arraysize
93
94
95 if(
c_e(gridinfoout%array(ngrib)%gaid))
then
96 call export(gridinfoout%array(ngrib))
97 call export(gridinfoout%array(ngrib)%gaid,ifile)
98 end if
99end do
100
102
104
106
107
108call l4f_category_delete(category)
110
111end 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 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.