libsim Versione 7.2.6

◆ index_network()

integer function index_network ( type(vol7d_network), dimension(:), intent(in) vect,
type(vol7d_network), intent(in) search,
logical, dimension(:), intent(in), optional mask,
logical, intent(in), optional back,
integer, intent(in), optional cache )

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

Definizione alla linea 987 del file vol7d_network_class.F90.

989! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
990! authors:
991! Davide Cesari <dcesari@arpa.emr.it>
992! Paolo Patruno <ppatruno@arpa.emr.it>
993
994! This program is free software; you can redistribute it and/or
995! modify it under the terms of the GNU General Public License as
996! published by the Free Software Foundation; either version 2 of
997! the License, or (at your option) any later version.
998
999! This program is distributed in the hope that it will be useful,
1000! but WITHOUT ANY WARRANTY; without even the implied warranty of
1001! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1002! GNU General Public License for more details.
1003
1004! You should have received a copy of the GNU General Public License
1005! along with this program. If not, see <http://www.gnu.org/licenses/>.
1006#include "config.h"
1007
1008!> Classe per la gestione delle reti di stazioni per osservazioni meteo e affini.
1009!! Questo modulo definisce una classe per identificare la rete
1010!! a cui appartiene una stazione. Per rete si intende un insieme di stazioni
1011!! omogenee per tipo di sensori, tipo di variabili osservate,
1012!! frequenza delle osservazioni, formato dei dati.
1013!! \ingroup vol7d
1015USE kinds
1018IMPLICIT NONE
1019
1020integer, parameter :: network_name_len=20
1021
1022!> Definisce la rete a cui appartiene una stazione.
1023!! I membri di \a vol7d_network sono pubblici e quindi liberamente
1024!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
1025!! il costruttore ::init.
1026TYPE vol7d_network
1027 character(len=network_name_len) :: name !< Mnemonic alias for type of report
1028END TYPE vol7d_network
1029
1030!> Valore mancante per vol7d_network.
1031TYPE(vol7d_network),PARAMETER :: vol7d_network_miss=vol7d_network(cmiss)
1032
1033!> Costruttore per la classe vol7d_network.
1034!! Deve essere richiamato
1035!! per tutti gli oggetti di questo tipo definiti in un programma.
1036INTERFACE init
1037 MODULE PROCEDURE vol7d_network_init
1038END INTERFACE
1039
1040!> Distruttore per la classe vol7d_network.
1041!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
1042INTERFACE delete
1043 MODULE PROCEDURE vol7d_network_delete
1044END INTERFACE
1045
1046!> Logical equality operator for objects of \a vol7d_network class.
1047!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1048!! of any shape.
1049INTERFACE OPERATOR (==)
1050 MODULE PROCEDURE vol7d_network_eq
1051END INTERFACE
1052
1053!> Logical inequality operator for objects of \a vol7d_network class.
1054!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1055!! of any shape.
1056INTERFACE OPERATOR (/=)
1057 MODULE PROCEDURE vol7d_network_ne
1058END INTERFACE
1059
1060!> Logical greater-than operator for objects of \a vol7d_network class.
1061!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1062!! of any shape.
1063INTERFACE OPERATOR (>)
1064 MODULE PROCEDURE vol7d_network_gt
1065END INTERFACE
1066
1067!> Logical less-than operator for objects of \a vol7d_network class.
1068!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1069!! of any shape.
1070INTERFACE OPERATOR (<)
1071 MODULE PROCEDURE vol7d_network_lt
1072END INTERFACE
1073
1074!> Logical greater-equal operator for objects of \a vol7d_network class.
1075!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1076!! of any shape.
1077INTERFACE OPERATOR (>=)
1078 MODULE PROCEDURE vol7d_network_ge
1079END INTERFACE
1080
1081!> Logical less-equal operator for objects of \a vol7d_network class.
1082!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1083!! of any shape.
1084INTERFACE OPERATOR (<=)
1085 MODULE PROCEDURE vol7d_network_le
1086END INTERFACE
1087
1088#define VOL7D_POLY_TYPE TYPE(vol7d_network)
1089#define VOL7D_POLY_TYPES _network
1090#define ENABLE_SORT
1091#include "array_utilities_pre.F90"
1092
1093!>Print object
1094INTERFACE display
1095 MODULE PROCEDURE display_network
1096END INTERFACE
1097
1098!>Check object presence
1099INTERFACE c_e
1100 MODULE PROCEDURE c_e_network
1101END INTERFACE
1102
1103!>return network object in a pretty string
1104INTERFACE to_char
1105 MODULE PROCEDURE to_char_network
1106END INTERFACE
1107
1108CONTAINS
1109
1110!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
1111!! Questa è la versione \c FUNCTION, in stile F2003, del costruttore, da preferire
1112!! rispetto alla versione \c SUBROUTINE \c init.
1113!! Se non viene passato nessun parametro opzionale l'oggetto è
1114!! inizializzato a valore mancante.
1115FUNCTION vol7d_network_new(name) RESULT(this)
1116CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
1117
1118TYPE(vol7d_network) :: this !< oggetto da inizializzare
1119
1120CALL init(this, name)
1121
1122END FUNCTION vol7d_network_new
1123
1124
1125!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
1126!! Se non viene passato nessun parametro opzionale l'oggetto è
1127!! inizializzato a valore mancante.
1128SUBROUTINE vol7d_network_init(this, name)
1129TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da inizializzare
1130CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
1131
1132IF (PRESENT(name)) THEN
1133 this%name = lowercase(name)
1134ELSE
1135 this%name = cmiss
1136END IF
1137
1138END SUBROUTINE vol7d_network_init
1139
1140
1141!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
1142SUBROUTINE vol7d_network_delete(this)
1143TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da distruggre
1144
1145this%name = cmiss
1146
1147END SUBROUTINE vol7d_network_delete
1148
1149
1150subroutine display_network(this)
1151
1152TYPE(vol7d_network),INTENT(in) :: this
1153
1154print*,to_char_network(this)
1155
1156end subroutine display_network
1157
1158
1159elemental function c_e_network(this) result(res)
1160
1161TYPE(vol7d_network),INTENT(in) :: this
1162logical :: res
1163
1164res = .not. this == vol7d_network_miss
1165
1166end function c_e_network
1167
1168
1169elemental character(len=20) function to_char_network(this)
1170
1171TYPE(vol7d_network),INTENT(in) :: this
1172
1173to_char_network="Network: "//trim(this%name)
1174
1175return
1176
1177end function to_char_network
1178
1179
1180ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
1181TYPE(vol7d_network),INTENT(IN) :: this, that
1182LOGICAL :: res
1183
1184res = (this%name == that%name)
1185
1186END FUNCTION vol7d_network_eq
1187
1188
1189ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
1190TYPE(vol7d_network),INTENT(IN) :: this, that
1191LOGICAL :: res
1192
1193res = .NOT.(this == that)
1194
1195END FUNCTION vol7d_network_ne
1196
1197
1198ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
1199TYPE(vol7d_network),INTENT(IN) :: this, that
1200LOGICAL :: res
1201
1202res = this%name > that%name
1203
1204END FUNCTION vol7d_network_gt
1205
1206ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
1207TYPE(vol7d_network),INTENT(IN) :: this, that
1208LOGICAL :: res
1209
1210res = this%name < that%name
1211
1212END FUNCTION vol7d_network_lt
1213
1214
1215ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
1216TYPE(vol7d_network),INTENT(IN) :: this, that
1217LOGICAL :: res
1218
1219res = this%name >= that%name
1220
1221END FUNCTION vol7d_network_ge
1222
1223ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
1224TYPE(vol7d_network),INTENT(IN) :: this, that
1225LOGICAL :: res
1226
1227res = this%name <= that%name
1228
1229END FUNCTION vol7d_network_le
1230
1231
1232#include "array_utilities_inc.F90"
1233
1234
1235END 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.