libsim Versione 7.2.6

◆ index_sorted_network()

recursive integer function index_sorted_network ( type(vol7d_network), dimension(:), intent(in) vect,
type(vol7d_network), intent(in) search )

Cerca l'indice del primo o ultimo elemento di vect uguale a search.

Definizione alla linea 1064 del file vol7d_network_class.F90.

1066! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
1067! authors:
1068! Davide Cesari <dcesari@arpa.emr.it>
1069! Paolo Patruno <ppatruno@arpa.emr.it>
1070
1071! This program is free software; you can redistribute it and/or
1072! modify it under the terms of the GNU General Public License as
1073! published by the Free Software Foundation; either version 2 of
1074! the License, or (at your option) any later version.
1075
1076! This program is distributed in the hope that it will be useful,
1077! but WITHOUT ANY WARRANTY; without even the implied warranty of
1078! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1079! GNU General Public License for more details.
1080
1081! You should have received a copy of the GNU General Public License
1082! along with this program. If not, see <http://www.gnu.org/licenses/>.
1083#include "config.h"
1084
1085!> Classe per la gestione delle reti di stazioni per osservazioni meteo e affini.
1086!! Questo modulo definisce una classe per identificare la rete
1087!! a cui appartiene una stazione. Per rete si intende un insieme di stazioni
1088!! omogenee per tipo di sensori, tipo di variabili osservate,
1089!! frequenza delle osservazioni, formato dei dati.
1090!! \ingroup vol7d
1092USE kinds
1095IMPLICIT NONE
1096
1097integer, parameter :: network_name_len=20
1098
1099!> Definisce la rete a cui appartiene una stazione.
1100!! I membri di \a vol7d_network sono pubblici e quindi liberamente
1101!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
1102!! il costruttore ::init.
1103TYPE vol7d_network
1104 character(len=network_name_len) :: name !< Mnemonic alias for type of report
1105END TYPE vol7d_network
1106
1107!> Valore mancante per vol7d_network.
1108TYPE(vol7d_network),PARAMETER :: vol7d_network_miss=vol7d_network(cmiss)
1109
1110!> Costruttore per la classe vol7d_network.
1111!! Deve essere richiamato
1112!! per tutti gli oggetti di questo tipo definiti in un programma.
1113INTERFACE init
1114 MODULE PROCEDURE vol7d_network_init
1115END INTERFACE
1116
1117!> Distruttore per la classe vol7d_network.
1118!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
1119INTERFACE delete
1120 MODULE PROCEDURE vol7d_network_delete
1121END INTERFACE
1122
1123!> Logical equality operator for objects of \a vol7d_network class.
1124!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1125!! of any shape.
1126INTERFACE OPERATOR (==)
1127 MODULE PROCEDURE vol7d_network_eq
1128END INTERFACE
1129
1130!> Logical inequality operator for objects of \a vol7d_network class.
1131!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1132!! of any shape.
1133INTERFACE OPERATOR (/=)
1134 MODULE PROCEDURE vol7d_network_ne
1135END INTERFACE
1136
1137!> Logical greater-than operator for objects of \a vol7d_network class.
1138!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1139!! of any shape.
1140INTERFACE OPERATOR (>)
1141 MODULE PROCEDURE vol7d_network_gt
1142END INTERFACE
1143
1144!> Logical less-than operator for objects of \a vol7d_network class.
1145!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1146!! of any shape.
1147INTERFACE OPERATOR (<)
1148 MODULE PROCEDURE vol7d_network_lt
1149END INTERFACE
1150
1151!> Logical greater-equal operator for objects of \a vol7d_network class.
1152!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1153!! of any shape.
1154INTERFACE OPERATOR (>=)
1155 MODULE PROCEDURE vol7d_network_ge
1156END INTERFACE
1157
1158!> Logical less-equal operator for objects of \a vol7d_network class.
1159!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1160!! of any shape.
1161INTERFACE OPERATOR (<=)
1162 MODULE PROCEDURE vol7d_network_le
1163END INTERFACE
1164
1165#define VOL7D_POLY_TYPE TYPE(vol7d_network)
1166#define VOL7D_POLY_TYPES _network
1167#define ENABLE_SORT
1168#include "array_utilities_pre.F90"
1169
1170!>Print object
1171INTERFACE display
1172 MODULE PROCEDURE display_network
1173END INTERFACE
1174
1175!>Check object presence
1176INTERFACE c_e
1177 MODULE PROCEDURE c_e_network
1178END INTERFACE
1179
1180!>return network object in a pretty string
1181INTERFACE to_char
1182 MODULE PROCEDURE to_char_network
1183END INTERFACE
1184
1185CONTAINS
1186
1187!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
1188!! Questa è la versione \c FUNCTION, in stile F2003, del costruttore, da preferire
1189!! rispetto alla versione \c SUBROUTINE \c init.
1190!! Se non viene passato nessun parametro opzionale l'oggetto è
1191!! inizializzato a valore mancante.
1192FUNCTION vol7d_network_new(name) RESULT(this)
1193CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
1194
1195TYPE(vol7d_network) :: this !< oggetto da inizializzare
1196
1197CALL init(this, name)
1198
1199END FUNCTION vol7d_network_new
1200
1201
1202!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
1203!! Se non viene passato nessun parametro opzionale l'oggetto è
1204!! inizializzato a valore mancante.
1205SUBROUTINE vol7d_network_init(this, name)
1206TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da inizializzare
1207CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
1208
1209IF (PRESENT(name)) THEN
1210 this%name = lowercase(name)
1211ELSE
1212 this%name = cmiss
1213END IF
1214
1215END SUBROUTINE vol7d_network_init
1216
1217
1218!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
1219SUBROUTINE vol7d_network_delete(this)
1220TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da distruggre
1221
1222this%name = cmiss
1223
1224END SUBROUTINE vol7d_network_delete
1225
1226
1227subroutine display_network(this)
1228
1229TYPE(vol7d_network),INTENT(in) :: this
1230
1231print*,to_char_network(this)
1232
1233end subroutine display_network
1234
1235
1236elemental function c_e_network(this) result(res)
1237
1238TYPE(vol7d_network),INTENT(in) :: this
1239logical :: res
1240
1241res = .not. this == vol7d_network_miss
1242
1243end function c_e_network
1244
1245
1246elemental character(len=20) function to_char_network(this)
1247
1248TYPE(vol7d_network),INTENT(in) :: this
1249
1250to_char_network="Network: "//trim(this%name)
1251
1252return
1253
1254end function to_char_network
1255
1256
1257ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
1258TYPE(vol7d_network),INTENT(IN) :: this, that
1259LOGICAL :: res
1260
1261res = (this%name == that%name)
1262
1263END FUNCTION vol7d_network_eq
1264
1265
1266ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
1267TYPE(vol7d_network),INTENT(IN) :: this, that
1268LOGICAL :: res
1269
1270res = .NOT.(this == that)
1271
1272END FUNCTION vol7d_network_ne
1273
1274
1275ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
1276TYPE(vol7d_network),INTENT(IN) :: this, that
1277LOGICAL :: res
1278
1279res = this%name > that%name
1280
1281END FUNCTION vol7d_network_gt
1282
1283ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
1284TYPE(vol7d_network),INTENT(IN) :: this, that
1285LOGICAL :: res
1286
1287res = this%name < that%name
1288
1289END FUNCTION vol7d_network_lt
1290
1291
1292ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
1293TYPE(vol7d_network),INTENT(IN) :: this, that
1294LOGICAL :: res
1295
1296res = this%name >= that%name
1297
1298END FUNCTION vol7d_network_ge
1299
1300ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
1301TYPE(vol7d_network),INTENT(IN) :: this, that
1302LOGICAL :: res
1303
1304res = this%name <= that%name
1305
1306END FUNCTION vol7d_network_le
1307
1308
1309#include "array_utilities_inc.F90"
1310
1311
1312END MODULE vol7d_network_class
Distruttore per la classe vol7d_network.
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.