libsim Versione 7.1.11

◆ index_ana()

integer function index_ana ( type(vol7d_ana), dimension(:), intent(in)  vect,
type(vol7d_ana), 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 1082 del file vol7d_ana_class.F90.

1084! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
1085! authors:
1086! Davide Cesari <dcesari@arpa.emr.it>
1087! Paolo Patruno <ppatruno@arpa.emr.it>
1088
1089! This program is free software; you can redistribute it and/or
1090! modify it under the terms of the GNU General Public License as
1091! published by the Free Software Foundation; either version 2 of
1092! the License, or (at your option) any later version.
1093
1094! This program is distributed in the hope that it will be useful,
1095! but WITHOUT ANY WARRANTY; without even the implied warranty of
1096! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1097! GNU General Public License for more details.
1098
1099! You should have received a copy of the GNU General Public License
1100! along with this program. If not, see <http://www.gnu.org/licenses/>.
1101#include "config.h"
1102
1107MODULE vol7d_ana_class
1108USE kinds
1111IMPLICIT NONE
1112
1114INTEGER,PARAMETER :: vol7d_ana_lenident=20
1115
1120TYPE vol7d_ana
1121 TYPE(geo_coord) :: coord
1122 CHARACTER(len=vol7d_ana_lenident) :: ident
1123END TYPE vol7d_ana
1124
1126TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
1127
1131INTERFACE init
1132 MODULE PROCEDURE vol7d_ana_init
1133END INTERFACE
1134
1137INTERFACE delete
1138 MODULE PROCEDURE vol7d_ana_delete
1139END INTERFACE
1140
1144INTERFACE OPERATOR (==)
1145 MODULE PROCEDURE vol7d_ana_eq
1146END INTERFACE
1147
1151INTERFACE OPERATOR (/=)
1152 MODULE PROCEDURE vol7d_ana_ne
1153END INTERFACE
1154
1155
1160INTERFACE OPERATOR (>)
1161 MODULE PROCEDURE vol7d_ana_gt
1162END INTERFACE
1163
1168INTERFACE OPERATOR (<)
1169 MODULE PROCEDURE vol7d_ana_lt
1170END INTERFACE
1171
1176INTERFACE OPERATOR (>=)
1177 MODULE PROCEDURE vol7d_ana_ge
1178END INTERFACE
1179
1184INTERFACE OPERATOR (<=)
1185 MODULE PROCEDURE vol7d_ana_le
1186END INTERFACE
1187
1188
1190INTERFACE c_e
1191 MODULE PROCEDURE vol7d_ana_c_e
1192END INTERFACE
1193
1196INTERFACE read_unit
1197 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
1198END INTERFACE
1199
1202INTERFACE write_unit
1203 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
1204END INTERFACE
1205
1206#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
1207#define VOL7D_POLY_TYPES _ana
1208#define ENABLE_SORT
1209#include "array_utilities_pre.F90"
1210
1212INTERFACE to_char
1213 MODULE PROCEDURE to_char_ana
1214END INTERFACE
1215
1217INTERFACE display
1218 MODULE PROCEDURE display_ana
1219END INTERFACE
1220
1221CONTAINS
1222
1226SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
1227TYPE(vol7d_ana),INTENT(INOUT) :: this
1228REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
1229REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
1230CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
1231INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
1232INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
1233
1234CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
1235IF (PRESENT(ident)) THEN
1236 this%ident = ident
1237ELSE
1238 this%ident = cmiss
1239ENDIF
1240
1241END SUBROUTINE vol7d_ana_init
1242
1243
1245SUBROUTINE vol7d_ana_delete(this)
1246TYPE(vol7d_ana),INTENT(INOUT) :: this
1247
1248CALL delete(this%coord)
1249this%ident = cmiss
1250
1251END SUBROUTINE vol7d_ana_delete
1252
1253
1254
1255character(len=80) function to_char_ana(this)
1256
1257TYPE(vol7d_ana),INTENT(in) :: this
1258
1259to_char_ana="ANA: "//&
1260 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
1261 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
1262 t2c(this%ident,miss="Missing ident")
1263
1264return
1265
1266end function to_char_ana
1267
1268
1269subroutine display_ana(this)
1270
1271TYPE(vol7d_ana),INTENT(in) :: this
1272
1273print*, trim(to_char(this))
1274
1275end subroutine display_ana
1276
1277
1278ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
1279TYPE(vol7d_ana),INTENT(IN) :: this, that
1280LOGICAL :: res
1281
1282res = this%coord == that%coord .AND. this%ident == that%ident
1283
1284END FUNCTION vol7d_ana_eq
1285
1286
1287ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
1288TYPE(vol7d_ana),INTENT(IN) :: this, that
1289LOGICAL :: res
1290
1291res = .NOT.(this == that)
1292
1293END FUNCTION vol7d_ana_ne
1294
1295
1296ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
1297TYPE(vol7d_ana),INTENT(IN) :: this, that
1298LOGICAL :: res
1299
1300res = this%ident > that%ident
1301
1302if ( this%ident == that%ident) then
1303 res =this%coord > that%coord
1304end if
1305
1306END FUNCTION vol7d_ana_gt
1307
1308
1309ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
1310TYPE(vol7d_ana),INTENT(IN) :: this, that
1311LOGICAL :: res
1312
1313res = .not. this < that
1314
1315END FUNCTION vol7d_ana_ge
1316
1317
1318ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
1319TYPE(vol7d_ana),INTENT(IN) :: this, that
1320LOGICAL :: res
1321
1322res = this%ident < that%ident
1323
1324if ( this%ident == that%ident) then
1325 res = this%coord < that%coord
1326end if
1327
1328END FUNCTION vol7d_ana_lt
1329
1330
1331ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
1332TYPE(vol7d_ana),INTENT(IN) :: this, that
1333LOGICAL :: res
1334
1335res = .not. (this > that)
1336
1337END FUNCTION vol7d_ana_le
1338
1339
1340
1341ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
1342TYPE(vol7d_ana),INTENT(IN) :: this
1343LOGICAL :: c_e
1344c_e = this /= vol7d_ana_miss
1345END FUNCTION vol7d_ana_c_e
1346
1347
1352SUBROUTINE vol7d_ana_read_unit(this, unit)
1353TYPE(vol7d_ana),INTENT(out) :: this
1354INTEGER, INTENT(in) :: unit
1355
1356CALL vol7d_ana_vect_read_unit((/this/), unit)
1357
1358END SUBROUTINE vol7d_ana_read_unit
1359
1360
1365SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
1366TYPE(vol7d_ana) :: this(:)
1367INTEGER, INTENT(in) :: unit
1368
1369CHARACTER(len=40) :: form
1370
1371CALL read_unit(this%coord, unit)
1372INQUIRE(unit, form=form)
1373IF (form == 'FORMATTED') THEN
1374 READ(unit,'(A)')this(:)%ident
1375ELSE
1376 READ(unit)this(:)%ident
1377ENDIF
1378
1379END SUBROUTINE vol7d_ana_vect_read_unit
1380
1381
1386SUBROUTINE vol7d_ana_write_unit(this, unit)
1387TYPE(vol7d_ana),INTENT(in) :: this
1388INTEGER, INTENT(in) :: unit
1389
1390CALL vol7d_ana_vect_write_unit((/this/), unit)
1391
1392END SUBROUTINE vol7d_ana_write_unit
1393
1394
1399SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
1400TYPE(vol7d_ana),INTENT(in) :: this(:)
1401INTEGER, INTENT(in) :: unit
1402
1403CHARACTER(len=40) :: form
1404
1405CALL write_unit(this%coord, unit)
1406INQUIRE(unit, form=form)
1407IF (form == 'FORMATTED') THEN
1408 WRITE(unit,'(A)')this(:)%ident
1409ELSE
1410 WRITE(unit)this(:)%ident
1411ENDIF
1412
1413END SUBROUTINE vol7d_ana_vect_write_unit
1414
1415
1416#include "array_utilities_inc.F90"
1417
1418
1419END MODULE vol7d_ana_class
check for missing value
Distruttore per la classe vol7d_ana.
Costruttore per la classe vol7d_ana.
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED.
Represent ana object in a pretty string.
Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED.
Classes for handling georeferenced sparse points in geographical corodinates.
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 dell'anagrafica di stazioni meteo e affini.
Definisce l'anagrafica di una stazione.

Generated with Doxygen.