libsim Versione 7.1.11

◆ 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 1070 del file vol7d_network_class.F90.

1072! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
1073! authors:
1074! Davide Cesari <dcesari@arpa.emr.it>
1075! Paolo Patruno <ppatruno@arpa.emr.it>
1076
1077! This program is free software; you can redistribute it and/or
1078! modify it under the terms of the GNU General Public License as
1079! published by the Free Software Foundation; either version 2 of
1080! the License, or (at your option) any later version.
1081
1082! This program is distributed in the hope that it will be useful,
1083! but WITHOUT ANY WARRANTY; without even the implied warranty of
1084! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1085! GNU General Public License for more details.
1086
1087! You should have received a copy of the GNU General Public License
1088! along with this program. If not, see <http://www.gnu.org/licenses/>.
1089#include "config.h"
1090
1098USE kinds
1101IMPLICIT NONE
1102
1103integer, parameter :: network_name_len=20
1104
1109TYPE vol7d_network
1110 character(len=network_name_len) :: name
1111END TYPE vol7d_network
1112
1114TYPE(vol7d_network),PARAMETER :: vol7d_network_miss=vol7d_network(cmiss)
1115
1119INTERFACE init
1120 MODULE PROCEDURE vol7d_network_init
1121END INTERFACE
1122
1125INTERFACE delete
1126 MODULE PROCEDURE vol7d_network_delete
1127END INTERFACE
1128
1132INTERFACE OPERATOR (==)
1133 MODULE PROCEDURE vol7d_network_eq
1134END INTERFACE
1135
1139INTERFACE OPERATOR (/=)
1140 MODULE PROCEDURE vol7d_network_ne
1141END INTERFACE
1142
1146INTERFACE OPERATOR (>)
1147 MODULE PROCEDURE vol7d_network_gt
1148END INTERFACE
1149
1153INTERFACE OPERATOR (<)
1154 MODULE PROCEDURE vol7d_network_lt
1155END INTERFACE
1156
1160INTERFACE OPERATOR (>=)
1161 MODULE PROCEDURE vol7d_network_ge
1162END INTERFACE
1163
1167INTERFACE OPERATOR (<=)
1168 MODULE PROCEDURE vol7d_network_le
1169END INTERFACE
1170
1171#define VOL7D_POLY_TYPE TYPE(vol7d_network)
1172#define VOL7D_POLY_TYPES _network
1173#define ENABLE_SORT
1174#include "array_utilities_pre.F90"
1175
1177INTERFACE display
1178 MODULE PROCEDURE display_network
1179END INTERFACE
1180
1182INTERFACE c_e
1183 MODULE PROCEDURE c_e_network
1184END INTERFACE
1185
1187INTERFACE to_char
1188 MODULE PROCEDURE to_char_network
1189END INTERFACE
1190
1191CONTAINS
1192
1198FUNCTION vol7d_network_new(name) RESULT(this)
1199CHARACTER(len=*),INTENT(in),OPTIONAL :: name
1200
1201TYPE(vol7d_network) :: this
1202
1203CALL init(this, name)
1204
1205END FUNCTION vol7d_network_new
1206
1207
1211SUBROUTINE vol7d_network_init(this, name)
1212TYPE(vol7d_network),INTENT(INOUT) :: this
1213CHARACTER(len=*),INTENT(in),OPTIONAL :: name
1214
1215IF (PRESENT(name)) THEN
1216 this%name = lowercase(name)
1217ELSE
1218 this%name = cmiss
1219END IF
1220
1221END SUBROUTINE vol7d_network_init
1222
1223
1225SUBROUTINE vol7d_network_delete(this)
1226TYPE(vol7d_network),INTENT(INOUT) :: this
1227
1228this%name = cmiss
1229
1230END SUBROUTINE vol7d_network_delete
1231
1232
1233subroutine display_network(this)
1234
1235TYPE(vol7d_network),INTENT(in) :: this
1236
1237print*,to_char_network(this)
1238
1239end subroutine display_network
1240
1241
1242elemental function c_e_network(this) result(res)
1243
1244TYPE(vol7d_network),INTENT(in) :: this
1245logical :: res
1246
1247res = .not. this == vol7d_network_miss
1248
1249end function c_e_network
1250
1251
1252elemental character(len=20) function to_char_network(this)
1253
1254TYPE(vol7d_network),INTENT(in) :: this
1255
1256to_char_network="Network: "//trim(this%name)
1257
1258return
1259
1260end function to_char_network
1261
1262
1263ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
1264TYPE(vol7d_network),INTENT(IN) :: this, that
1265LOGICAL :: res
1266
1267res = (this%name == that%name)
1268
1269END FUNCTION vol7d_network_eq
1270
1271
1272ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
1273TYPE(vol7d_network),INTENT(IN) :: this, that
1274LOGICAL :: res
1275
1276res = .NOT.(this == that)
1277
1278END FUNCTION vol7d_network_ne
1279
1280
1281ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
1282TYPE(vol7d_network),INTENT(IN) :: this, that
1283LOGICAL :: res
1284
1285res = this%name > that%name
1286
1287END FUNCTION vol7d_network_gt
1288
1289ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
1290TYPE(vol7d_network),INTENT(IN) :: this, that
1291LOGICAL :: res
1292
1293res = this%name < that%name
1294
1295END FUNCTION vol7d_network_lt
1296
1297
1298ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
1299TYPE(vol7d_network),INTENT(IN) :: this, that
1300LOGICAL :: res
1301
1302res = this%name >= that%name
1303
1304END FUNCTION vol7d_network_ge
1305
1306ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
1307TYPE(vol7d_network),INTENT(IN) :: this, that
1308LOGICAL :: res
1309
1310res = this%name <= that%name
1311
1312END FUNCTION vol7d_network_le
1313
1314
1315#include "array_utilities_inc.F90"
1316
1317
1318END MODULE vol7d_network_class
Check object presence.
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:251
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.