libsim Versione 7.2.0
vol7d_network_class.F90
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#include "config.h"
19
27USE kinds
30IMPLICIT NONE
31
32integer, parameter :: network_name_len=20
33
39 character(len=network_name_len) :: name
40END TYPE vol7d_network
41
43TYPE(vol7d_network),PARAMETER :: vol7d_network_miss=vol7d_network(cmiss)
44
48INTERFACE init
49 MODULE PROCEDURE vol7d_network_init
50END INTERFACE
51
54INTERFACE delete
55 MODULE PROCEDURE vol7d_network_delete
56END INTERFACE
57
61INTERFACE OPERATOR (==)
62 MODULE PROCEDURE vol7d_network_eq
63END INTERFACE
64
68INTERFACE OPERATOR (/=)
69 MODULE PROCEDURE vol7d_network_ne
70END INTERFACE
71
75INTERFACE OPERATOR (>)
76 MODULE PROCEDURE vol7d_network_gt
77END INTERFACE
78
82INTERFACE OPERATOR (<)
83 MODULE PROCEDURE vol7d_network_lt
84END INTERFACE
85
89INTERFACE OPERATOR (>=)
90 MODULE PROCEDURE vol7d_network_ge
91END INTERFACE
92
96INTERFACE OPERATOR (<=)
97 MODULE PROCEDURE vol7d_network_le
98END INTERFACE
99
100#define VOL7D_POLY_TYPE TYPE(vol7d_network)
101#define VOL7D_POLY_TYPES _network
102#define ENABLE_SORT
103#include "array_utilities_pre.F90"
104
106INTERFACE display
107 MODULE PROCEDURE display_network
108END INTERFACE
109
111INTERFACE c_e
112 MODULE PROCEDURE c_e_network
113END INTERFACE
114
116INTERFACE to_char
117 MODULE PROCEDURE to_char_network
118END INTERFACE
119
120CONTAINS
121
127FUNCTION vol7d_network_new(name) RESULT(this)
128CHARACTER(len=*),INTENT(in),OPTIONAL :: name
129
130TYPE(vol7d_network) :: this
131
132CALL init(this, name)
133
134END FUNCTION vol7d_network_new
135
136
140SUBROUTINE vol7d_network_init(this, name)
141TYPE(vol7d_network),INTENT(INOUT) :: this
142CHARACTER(len=*),INTENT(in),OPTIONAL :: name
143
144IF (PRESENT(name)) THEN
145 this%name = lowercase(name)
146ELSE
147 this%name = cmiss
148END IF
149
150END SUBROUTINE vol7d_network_init
151
152
154SUBROUTINE vol7d_network_delete(this)
155TYPE(vol7d_network),INTENT(INOUT) :: this
156
157this%name = cmiss
158
159END SUBROUTINE vol7d_network_delete
160
161
162subroutine display_network(this)
163
164TYPE(vol7d_network),INTENT(in) :: this
165
166print*,to_char_network(this)
167
168end subroutine display_network
169
170
171elemental function c_e_network(this) result(res)
172
173TYPE(vol7d_network),INTENT(in) :: this
174logical :: res
175
176res = .not. this == vol7d_network_miss
177
178end function c_e_network
179
180
181elemental character(len=20) function to_char_network(this)
182
183TYPE(vol7d_network),INTENT(in) :: this
184
185to_char_network="Network: "//trim(this%name)
186
187return
188
189end function to_char_network
190
191
192ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
193TYPE(vol7d_network),INTENT(IN) :: this, that
194LOGICAL :: res
195
196res = (this%name == that%name)
197
198END FUNCTION vol7d_network_eq
199
200
201ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
202TYPE(vol7d_network),INTENT(IN) :: this, that
203LOGICAL :: res
204
205res = .NOT.(this == that)
206
207END FUNCTION vol7d_network_ne
208
209
210ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
211TYPE(vol7d_network),INTENT(IN) :: this, that
212LOGICAL :: res
213
214res = this%name > that%name
215
216END FUNCTION vol7d_network_gt
217
218ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
219TYPE(vol7d_network),INTENT(IN) :: this, that
220LOGICAL :: res
221
222res = this%name < that%name
223
224END FUNCTION vol7d_network_lt
225
227ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
228TYPE(vol7d_network),INTENT(IN) :: this, that
229LOGICAL :: res
230
231res = this%name >= that%name
232
233END FUNCTION vol7d_network_ge
234
235ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
236TYPE(vol7d_network),INTENT(IN) :: this, that
237LOGICAL :: res
238
239res = this%name <= that%name
240
241END FUNCTION vol7d_network_le
243
244#include "array_utilities_inc.F90"
245
246
247END MODULE vol7d_network_class
Index method.
Check object presence.
Distruttore per la classe vol7d_network.
Index method with sorted array.
Costruttore per la classe vol7d_network.
return network object in a pretty string
Utilities for CHARACTER variables.
Definition of constants to be used for declaring variables of a desired type.
Definition: kinds.F90:245
Definitions of constants and functions for working with missing values.
Classe per la gestione delle reti di stazioni per osservazioni meteo e affini.
Definisce la rete a cui appartiene una stazione.

Generated with Doxygen.