libsim Versione 7.2.1

◆ 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
1092USE kinds
1095IMPLICIT NONE
1096
1097integer, parameter :: network_name_len=20
1098
1103TYPE vol7d_network
1104 character(len=network_name_len) :: name
1105END TYPE vol7d_network
1106
1108TYPE(vol7d_network),PARAMETER :: vol7d_network_miss=vol7d_network(cmiss)
1109
1113INTERFACE init
1114 MODULE PROCEDURE vol7d_network_init
1115END INTERFACE
1116
1119INTERFACE delete
1120 MODULE PROCEDURE vol7d_network_delete
1121END INTERFACE
1122
1126INTERFACE OPERATOR (==)
1127 MODULE PROCEDURE vol7d_network_eq
1128END INTERFACE
1129
1133INTERFACE OPERATOR (/=)
1134 MODULE PROCEDURE vol7d_network_ne
1135END INTERFACE
1136
1140INTERFACE OPERATOR (>)
1141 MODULE PROCEDURE vol7d_network_gt
1142END INTERFACE
1143
1147INTERFACE OPERATOR (<)
1148 MODULE PROCEDURE vol7d_network_lt
1149END INTERFACE
1150
1154INTERFACE OPERATOR (>=)
1155 MODULE PROCEDURE vol7d_network_ge
1156END INTERFACE
1157
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
1171INTERFACE display
1172 MODULE PROCEDURE display_network
1173END INTERFACE
1174
1176INTERFACE c_e
1177 MODULE PROCEDURE c_e_network
1178END INTERFACE
1179
1181INTERFACE to_char
1182 MODULE PROCEDURE to_char_network
1183END INTERFACE
1184
1185CONTAINS
1186
1192FUNCTION vol7d_network_new(name) RESULT(this)
1193CHARACTER(len=*),INTENT(in),OPTIONAL :: name
1194
1195TYPE(vol7d_network) :: this
1196
1197CALL init(this, name)
1198
1199END FUNCTION vol7d_network_new
1200
1201
1205SUBROUTINE vol7d_network_init(this, name)
1206TYPE(vol7d_network),INTENT(INOUT) :: this
1207CHARACTER(len=*),INTENT(in),OPTIONAL :: name
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
1219SUBROUTINE vol7d_network_delete(this)
1220TYPE(vol7d_network),INTENT(INOUT) :: this
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.