Programma esempio semplice per la lettura di file grib.
Programma esempio semplice per la lettura di file grib. Programma che legge i grib contenuti in un file e li organizza in un vettore di oggetti gridinfo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18program demo2
19
24
25implicit none
26
27integer :: category,ier
28character(len=512):: a_name
29type(arrayof_gridinfo) :: gridinfo
30
31TYPE(grid_file_id) :: ifile
32TYPE(grid_id) :: gaid
33INTEGER :: ngrib
34
35
36call l4f_launcher(a_name,a_name_force="demo2")
37
38
39category=l4f_category_get(a_name//".main")
40
41
43
44
45ngrib=0
46
47ifile = grid_file_id_new('../data/in.grb','r')
48
49DO WHILE (.true.)
50 gaid = grid_id_new(ifile)
51 IF (.NOT.
c_e(gaid))
EXIT
52
53 ngrib = ngrib + 1
55ENDDO
56
58
60 "Numero totale di grib: "//
to_char(ngrib))
61
62
63CALL insert(gridinfo, nelem=ngrib)
64
65ngrib=0
66
67ifile = grid_file_id_new('../data/in.grb','r')
68
69DO WHILE (.true.)
70 gaid = grid_id_new(ifile)
71 IF (.NOT.
c_e(gaid))
EXIT
72
74 ngrib = ngrib + 1
75 CALL init (gridinfo%array(ngrib), gaid=gaid)
76 CALL import(gridinfo%array(ngrib))
77ENDDO
78
81
83
85
86
87call l4f_category_delete(category)
89
90end program demo2
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