libsim Versione 7.2.1

◆ 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 1076 del file vol7d_ana_class.F90.

1078! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
1079! authors:
1080! Davide Cesari <dcesari@arpa.emr.it>
1081! Paolo Patruno <ppatruno@arpa.emr.it>
1082
1083! This program is free software; you can redistribute it and/or
1084! modify it under the terms of the GNU General Public License as
1085! published by the Free Software Foundation; either version 2 of
1086! the License, or (at your option) any later version.
1087
1088! This program is distributed in the hope that it will be useful,
1089! but WITHOUT ANY WARRANTY; without even the implied warranty of
1090! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1091! GNU General Public License for more details.
1092
1093! You should have received a copy of the GNU General Public License
1094! along with this program. If not, see <http://www.gnu.org/licenses/>.
1095#include "config.h"
1096
1101MODULE vol7d_ana_class
1102USE kinds
1105IMPLICIT NONE
1106
1108INTEGER,PARAMETER :: vol7d_ana_lenident=20
1109
1114TYPE vol7d_ana
1115 TYPE(geo_coord) :: coord
1116 CHARACTER(len=vol7d_ana_lenident) :: ident
1117END TYPE vol7d_ana
1118
1120TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
1121
1125INTERFACE init
1126 MODULE PROCEDURE vol7d_ana_init
1127END INTERFACE
1128
1131INTERFACE delete
1132 MODULE PROCEDURE vol7d_ana_delete
1133END INTERFACE
1134
1138INTERFACE OPERATOR (==)
1139 MODULE PROCEDURE vol7d_ana_eq
1140END INTERFACE
1141
1145INTERFACE OPERATOR (/=)
1146 MODULE PROCEDURE vol7d_ana_ne
1147END INTERFACE
1148
1149
1154INTERFACE OPERATOR (>)
1155 MODULE PROCEDURE vol7d_ana_gt
1156END INTERFACE
1157
1162INTERFACE OPERATOR (<)
1163 MODULE PROCEDURE vol7d_ana_lt
1164END INTERFACE
1165
1170INTERFACE OPERATOR (>=)
1171 MODULE PROCEDURE vol7d_ana_ge
1172END INTERFACE
1173
1178INTERFACE OPERATOR (<=)
1179 MODULE PROCEDURE vol7d_ana_le
1180END INTERFACE
1181
1182
1184INTERFACE c_e
1185 MODULE PROCEDURE vol7d_ana_c_e
1186END INTERFACE
1187
1190INTERFACE read_unit
1191 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
1192END INTERFACE
1193
1196INTERFACE write_unit
1197 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
1198END INTERFACE
1199
1200#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
1201#define VOL7D_POLY_TYPES _ana
1202#define ENABLE_SORT
1203#include "array_utilities_pre.F90"
1204
1206INTERFACE to_char
1207 MODULE PROCEDURE to_char_ana
1208END INTERFACE
1209
1211INTERFACE display
1212 MODULE PROCEDURE display_ana
1213END INTERFACE
1214
1215CONTAINS
1216
1220SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
1221TYPE(vol7d_ana),INTENT(INOUT) :: this
1222REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
1223REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
1224CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
1225INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
1226INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
1227
1228CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
1229IF (PRESENT(ident)) THEN
1230 this%ident = ident
1231ELSE
1232 this%ident = cmiss
1233ENDIF
1234
1235END SUBROUTINE vol7d_ana_init
1236
1237
1239SUBROUTINE vol7d_ana_delete(this)
1240TYPE(vol7d_ana),INTENT(INOUT) :: this
1241
1242CALL delete(this%coord)
1243this%ident = cmiss
1244
1245END SUBROUTINE vol7d_ana_delete
1246
1247
1248
1249character(len=80) function to_char_ana(this)
1250
1251TYPE(vol7d_ana),INTENT(in) :: this
1252
1253to_char_ana="ANA: "//&
1254 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
1255 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
1256 t2c(this%ident,miss="Missing ident")
1257
1258return
1259
1260end function to_char_ana
1261
1262
1263subroutine display_ana(this)
1264
1265TYPE(vol7d_ana),INTENT(in) :: this
1266
1267print*, trim(to_char(this))
1268
1269end subroutine display_ana
1270
1271
1272ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
1273TYPE(vol7d_ana),INTENT(IN) :: this, that
1274LOGICAL :: res
1275
1276res = this%coord == that%coord .AND. this%ident == that%ident
1277
1278END FUNCTION vol7d_ana_eq
1279
1280
1281ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
1282TYPE(vol7d_ana),INTENT(IN) :: this, that
1283LOGICAL :: res
1284
1285res = .NOT.(this == that)
1286
1287END FUNCTION vol7d_ana_ne
1288
1289
1290ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
1291TYPE(vol7d_ana),INTENT(IN) :: this, that
1292LOGICAL :: res
1293
1294res = this%ident > that%ident
1295
1296if ( this%ident == that%ident) then
1297 res =this%coord > that%coord
1298end if
1299
1300END FUNCTION vol7d_ana_gt
1301
1302
1303ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
1304TYPE(vol7d_ana),INTENT(IN) :: this, that
1305LOGICAL :: res
1306
1307res = .not. this < that
1308
1309END FUNCTION vol7d_ana_ge
1310
1311
1312ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
1313TYPE(vol7d_ana),INTENT(IN) :: this, that
1314LOGICAL :: res
1315
1316res = this%ident < that%ident
1317
1318if ( this%ident == that%ident) then
1319 res = this%coord < that%coord
1320end if
1321
1322END FUNCTION vol7d_ana_lt
1323
1324
1325ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
1326TYPE(vol7d_ana),INTENT(IN) :: this, that
1327LOGICAL :: res
1328
1329res = .not. (this > that)
1330
1331END FUNCTION vol7d_ana_le
1332
1333
1334
1335ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
1336TYPE(vol7d_ana),INTENT(IN) :: this
1337LOGICAL :: c_e
1338c_e = this /= vol7d_ana_miss
1339END FUNCTION vol7d_ana_c_e
1340
1341
1346SUBROUTINE vol7d_ana_read_unit(this, unit)
1347TYPE(vol7d_ana),INTENT(out) :: this
1348INTEGER, INTENT(in) :: unit
1349
1350CALL vol7d_ana_vect_read_unit((/this/), unit)
1351
1352END SUBROUTINE vol7d_ana_read_unit
1353
1354
1359SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
1360TYPE(vol7d_ana) :: this(:)
1361INTEGER, INTENT(in) :: unit
1362
1363CHARACTER(len=40) :: form
1364
1365CALL read_unit(this%coord, unit)
1366INQUIRE(unit, form=form)
1367IF (form == 'FORMATTED') THEN
1368 READ(unit,'(A)')this(:)%ident
1369ELSE
1370 READ(unit)this(:)%ident
1371ENDIF
1372
1373END SUBROUTINE vol7d_ana_vect_read_unit
1374
1375
1380SUBROUTINE vol7d_ana_write_unit(this, unit)
1381TYPE(vol7d_ana),INTENT(in) :: this
1382INTEGER, INTENT(in) :: unit
1383
1384CALL vol7d_ana_vect_write_unit((/this/), unit)
1385
1386END SUBROUTINE vol7d_ana_write_unit
1387
1388
1393SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
1394TYPE(vol7d_ana),INTENT(in) :: this(:)
1395INTEGER, INTENT(in) :: unit
1396
1397CHARACTER(len=40) :: form
1398
1399CALL write_unit(this%coord, unit)
1400INQUIRE(unit, form=form)
1401IF (form == 'FORMATTED') THEN
1402 WRITE(unit,'(A)')this(:)%ident
1403ELSE
1404 WRITE(unit)this(:)%ident
1405ENDIF
1406
1407END SUBROUTINE vol7d_ana_vect_write_unit
1408
1409
1410#include "array_utilities_inc.F90"
1411
1412
1413END 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:245
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.