libsim Versione 7.2.6
|
◆ map_inv_distinct_ana()
map inv distinct Definizione alla linea 990 del file vol7d_ana_class.F90. 992! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
993! authors:
994! Davide Cesari <dcesari@arpa.emr.it>
995! Paolo Patruno <ppatruno@arpa.emr.it>
996
997! This program is free software; you can redistribute it and/or
998! modify it under the terms of the GNU General Public License as
999! published by the Free Software Foundation; either version 2 of
1000! the License, or (at your option) any later version.
1001
1002! This program is distributed in the hope that it will be useful,
1003! but WITHOUT ANY WARRANTY; without even the implied warranty of
1004! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1005! GNU General Public License for more details.
1006
1007! You should have received a copy of the GNU General Public License
1008! along with this program. If not, see <http://www.gnu.org/licenses/>.
1009#include "config.h"
1010
1011!> Classe per la gestione dell'anagrafica di stazioni meteo e affini.
1012!! Questo modulo definisce una classe in grado di rappresentare
1013!! le caratteristiche di una stazione meteo fissa o mobile.
1014!! \ingroup vol7d
1019IMPLICIT NONE
1020
1021!> Lunghezza della stringa che indica l'identificativo del volo.
1022INTEGER,PARAMETER :: vol7d_ana_lenident=20
1023
1024!> Definisce l'anagrafica di una stazione.
1025!! I membri di \a vol7d_ana sono pubblici e quindi liberamente
1026!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
1027!! il costruttore ::init.
1029 TYPE(geo_coord) :: coord !< coordinata per una stazione fissa
1030 CHARACTER(len=vol7d_ana_lenident) :: ident !< identificativo per una stazione mobile (es. aereo)
1032
1033!> Valore mancante per vo7d_ana.
1035
1036!> Costruttore per la classe vol7d_ana.
1037!! Deve essere richiamato
1038!! per tutti gli oggetti di questo tipo definiti in un programma.
1040 MODULE PROCEDURE vol7d_ana_init
1041END INTERFACE
1042
1043!> Distruttore per la classe vol7d_ana.
1044!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
1046 MODULE PROCEDURE vol7d_ana_delete
1047END INTERFACE
1048
1049!> Logical equality operator for objects of \a vol7d_ana class.
1050!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1051!! of any shape.
1052INTERFACE OPERATOR (==)
1053 MODULE PROCEDURE vol7d_ana_eq
1054END INTERFACE
1055
1056!> Logical inequality operator for objects of \a vol7d_ana class.
1057!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1058!! of any shape.
1059INTERFACE OPERATOR (/=)
1060 MODULE PROCEDURE vol7d_ana_ne
1061END INTERFACE
1062
1063
1064!> Logical greater-than operator for objects of \a vol7d_ana class.
1065!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1066!! of any shape.
1067!! Comparison is performed first on \a ident, then on coord
1068INTERFACE OPERATOR (>)
1069 MODULE PROCEDURE vol7d_ana_gt
1070END INTERFACE
1071
1072!> Logical less-than operator for objects of \a vol7d_ana class.
1073!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1074!! of any shape.
1075!! Comparison is performed first on \a ident, then on coord
1076INTERFACE OPERATOR (<)
1077 MODULE PROCEDURE vol7d_ana_lt
1078END INTERFACE
1079
1080!> Logical greater-equal operator for objects of \a vol7d_ana class.
1081!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1082!! of any shape.
1083!! Comparison is performed first on \a ident, then on coord
1084INTERFACE OPERATOR (>=)
1085 MODULE PROCEDURE vol7d_ana_ge
1086END INTERFACE
1087
1088!> Logical less-equal operator for objects of \a vol7d_ana class.
1089!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1090!! of any shape.
1091!! Comparison is performed first on \a ident, then on coord
1092INTERFACE OPERATOR (<=)
1093 MODULE PROCEDURE vol7d_ana_le
1094END INTERFACE
1095
1096
1097!> check for missing value
1099 MODULE PROCEDURE vol7d_ana_c_e
1100END INTERFACE
1101
1102!> Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da
1103!! un file \c FORMATTED o \c UNFORMATTED.
1105 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
1106END INTERFACE
1107
1108!> Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su
1109!! un file \c FORMATTED o \c UNFORMATTED.
1111 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
1112END INTERFACE
1113
1114#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
1115#define VOL7D_POLY_TYPES _ana
1116#define ENABLE_SORT
1117#include "array_utilities_pre.F90"
1118
1119!> Represent ana object in a pretty string
1121 MODULE PROCEDURE to_char_ana
1122END INTERFACE
1123
1124!> Print object
1126 MODULE PROCEDURE display_ana
1127END INTERFACE
1128
1129CONTAINS
1130
1131!> Inizializza un oggetto \a vol7d_ana con i parametri opzionali forniti.
1132!! Se non viene passato nessun parametro opzionale l'oggetto è
1133!! inizializzato a valore mancante.
1134SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
1135TYPE(vol7d_ana),INTENT(INOUT) :: this !< oggetto da inizializzare
1136REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon !< longitudine
1137REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat !< latitudine
1138CHARACTER(len=*),INTENT(in),OPTIONAL :: ident !< identificativo del volo
1139INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon !< integer longitude (nint(lon*1.d5)
1140INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat !< integer latitude (nint(lat*1.d5)
1141
1143IF (PRESENT(ident)) THEN
1144 this%ident = ident
1145ELSE
1146 this%ident = cmiss
1147ENDIF
1148
1149END SUBROUTINE vol7d_ana_init
1150
1151
1152!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
1153SUBROUTINE vol7d_ana_delete(this)
1154TYPE(vol7d_ana),INTENT(INOUT) :: this !< oggetto da distruggre
1155
1157this%ident = cmiss
1158
1159END SUBROUTINE vol7d_ana_delete
1160
1161
1162
1163character(len=80) function to_char_ana(this)
1164
1165TYPE(vol7d_ana),INTENT(in) :: this
1166
1167to_char_ana="ANA: "//&
1170 t2c(this%ident,miss="Missing ident")
1171
1172return
1173
1174end function to_char_ana
1175
1176
1177subroutine display_ana(this)
1178
1179TYPE(vol7d_ana),INTENT(in) :: this
1180
1181print*, trim(to_char(this))
1182
1183end subroutine display_ana
1184
1185
1186ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
1187TYPE(vol7d_ana),INTENT(IN) :: this, that
1188LOGICAL :: res
1189
1190res = this%coord == that%coord .AND. this%ident == that%ident
1191
1192END FUNCTION vol7d_ana_eq
1193
1194
1195ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
1196TYPE(vol7d_ana),INTENT(IN) :: this, that
1197LOGICAL :: res
1198
1199res = .NOT.(this == that)
1200
1201END FUNCTION vol7d_ana_ne
1202
1203
1204ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
1205TYPE(vol7d_ana),INTENT(IN) :: this, that
1206LOGICAL :: res
1207
1208res = this%ident > that%ident
1209
1210if ( this%ident == that%ident) then
1211 res =this%coord > that%coord
1212end if
1213
1214END FUNCTION vol7d_ana_gt
1215
1216
1217ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
1218TYPE(vol7d_ana),INTENT(IN) :: this, that
1219LOGICAL :: res
1220
1221res = .not. this < that
1222
1223END FUNCTION vol7d_ana_ge
1224
1225
1226ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
1227TYPE(vol7d_ana),INTENT(IN) :: this, that
1228LOGICAL :: res
1229
1230res = this%ident < that%ident
1231
1232if ( this%ident == that%ident) then
1233 res = this%coord < that%coord
1234end if
1235
1236END FUNCTION vol7d_ana_lt
1237
1238
1239ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
1240TYPE(vol7d_ana),INTENT(IN) :: this, that
1241LOGICAL :: res
1242
1243res = .not. (this > that)
1244
1245END FUNCTION vol7d_ana_le
1246
1247
1248
1249ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
1250TYPE(vol7d_ana),INTENT(IN) :: this
1251LOGICAL :: c_e
1252c_e = this /= vol7d_ana_miss
1253END FUNCTION vol7d_ana_c_e
1254
1255
1256!> This method reads from a Fortran file unit the contents of the
1257!! object \a this. The record to be read must have been written with
1258!! the ::write_unit method. The method works both on formatted and
1259!! unformatted files.
1260SUBROUTINE vol7d_ana_read_unit(this, unit)
1261TYPE(vol7d_ana),INTENT(out) :: this !< object to be read
1262INTEGER, INTENT(in) :: unit !< unit from which to read, it must be an opened Fortran file unit
1263
1264CALL vol7d_ana_vect_read_unit((/this/), unit)
1265
1266END SUBROUTINE vol7d_ana_read_unit
1267
1268
1269!> This method reads from a Fortran file unit the contents of the
1270!! object \a this. The record to be read must have been written with
1271!! the ::write_unit method. The method works both on formatted and
1272!! unformatted files.
1273SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
1274TYPE(vol7d_ana) :: this(:) !< object to be read
1275INTEGER, INTENT(in) :: unit !< unit from which to read, it must be an opened Fortran file unit
1276
1277CHARACTER(len=40) :: form
1278
1280INQUIRE(unit, form=form)
1281IF (form == 'FORMATTED') THEN
1282 READ(unit,'(A)')this(:)%ident
1283ELSE
1284 READ(unit)this(:)%ident
1285ENDIF
1286
1287END SUBROUTINE vol7d_ana_vect_read_unit
1288
1289
1290!> This method writes on a Fortran file unit the contents of the
1291!! object \a this. The record can successively be read by the
1292!! ::read_unit method. The method works both on formatted and
1293!! unformatted files.
1294SUBROUTINE vol7d_ana_write_unit(this, unit)
1295TYPE(vol7d_ana),INTENT(in) :: this !< object to be written
1296INTEGER, INTENT(in) :: unit !< unit where to write, it must be an opened Fortran file unit
1297
1298CALL vol7d_ana_vect_write_unit((/this/), unit)
1299
1300END SUBROUTINE vol7d_ana_write_unit
1301
1302
1303!> This method writes on a Fortran file unit the contents of the
1304!! object \a this. The record can successively be read by the
1305!! ::read_unit method. The method works both on formatted and
1306!! unformatted files.
1307SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
1308TYPE(vol7d_ana),INTENT(in) :: this(:) !< object to be written
1309INTEGER, INTENT(in) :: unit !< unit where to write, it must be an opened Fortran file unit
1310
1311CHARACTER(len=40) :: form
1312
1314INQUIRE(unit, form=form)
1315IF (form == 'FORMATTED') THEN
1316 WRITE(unit,'(A)')this(:)%ident
1317ELSE
1318 WRITE(unit)this(:)%ident
1319ENDIF
1320
1321END SUBROUTINE vol7d_ana_vect_write_unit
1322
1323
1324#include "array_utilities_inc.F90"
1325
1326
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED. Definition vol7d_ana_class.F90:301 Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED. Definition vol7d_ana_class.F90:307 Classes for handling georeferenced sparse points in geographical corodinates. Definition geo_coord_class.F90:216 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. Definition missing_values.f90:50 Classe per la gestione dell'anagrafica di stazioni meteo e affini. Definition vol7d_ana_class.F90:212 |