libsim Versione 7.2.6
|
◆ map_distinct_ana()
map distinct Definizione alla linea 894 del file vol7d_ana_class.F90. 895! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
896! authors:
897! Davide Cesari <dcesari@arpa.emr.it>
898! Paolo Patruno <ppatruno@arpa.emr.it>
899
900! This program is free software; you can redistribute it and/or
901! modify it under the terms of the GNU General Public License as
902! published by the Free Software Foundation; either version 2 of
903! the License, or (at your option) any later version.
904
905! This program is distributed in the hope that it will be useful,
906! but WITHOUT ANY WARRANTY; without even the implied warranty of
907! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
908! GNU General Public License for more details.
909
910! You should have received a copy of the GNU General Public License
911! along with this program. If not, see <http://www.gnu.org/licenses/>.
912#include "config.h"
913
914!> Classe per la gestione dell'anagrafica di stazioni meteo e affini.
915!! Questo modulo definisce una classe in grado di rappresentare
916!! le caratteristiche di una stazione meteo fissa o mobile.
917!! \ingroup vol7d
922IMPLICIT NONE
923
924!> Lunghezza della stringa che indica l'identificativo del volo.
925INTEGER,PARAMETER :: vol7d_ana_lenident=20
926
927!> Definisce l'anagrafica di una stazione.
928!! I membri di \a vol7d_ana sono pubblici e quindi liberamente
929!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
930!! il costruttore ::init.
932 TYPE(geo_coord) :: coord !< coordinata per una stazione fissa
933 CHARACTER(len=vol7d_ana_lenident) :: ident !< identificativo per una stazione mobile (es. aereo)
935
936!> Valore mancante per vo7d_ana.
938
939!> Costruttore per la classe vol7d_ana.
940!! Deve essere richiamato
941!! per tutti gli oggetti di questo tipo definiti in un programma.
943 MODULE PROCEDURE vol7d_ana_init
944END INTERFACE
945
946!> Distruttore per la classe vol7d_ana.
947!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
949 MODULE PROCEDURE vol7d_ana_delete
950END INTERFACE
951
952!> Logical equality operator for objects of \a vol7d_ana class.
953!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
954!! of any shape.
955INTERFACE OPERATOR (==)
956 MODULE PROCEDURE vol7d_ana_eq
957END INTERFACE
958
959!> Logical inequality operator for objects of \a vol7d_ana class.
960!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
961!! of any shape.
962INTERFACE OPERATOR (/=)
963 MODULE PROCEDURE vol7d_ana_ne
964END INTERFACE
965
966
967!> Logical greater-than operator for objects of \a vol7d_ana class.
968!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
969!! of any shape.
970!! Comparison is performed first on \a ident, then on coord
971INTERFACE OPERATOR (>)
972 MODULE PROCEDURE vol7d_ana_gt
973END INTERFACE
974
975!> Logical less-than operator for objects of \a vol7d_ana class.
976!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
977!! of any shape.
978!! Comparison is performed first on \a ident, then on coord
979INTERFACE OPERATOR (<)
980 MODULE PROCEDURE vol7d_ana_lt
981END INTERFACE
982
983!> Logical greater-equal operator for objects of \a vol7d_ana class.
984!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
985!! of any shape.
986!! Comparison is performed first on \a ident, then on coord
987INTERFACE OPERATOR (>=)
988 MODULE PROCEDURE vol7d_ana_ge
989END INTERFACE
990
991!> Logical less-equal operator for objects of \a vol7d_ana class.
992!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
993!! of any shape.
994!! Comparison is performed first on \a ident, then on coord
995INTERFACE OPERATOR (<=)
996 MODULE PROCEDURE vol7d_ana_le
997END INTERFACE
998
999
1000!> check for missing value
1002 MODULE PROCEDURE vol7d_ana_c_e
1003END INTERFACE
1004
1005!> Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da
1006!! un file \c FORMATTED o \c UNFORMATTED.
1008 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
1009END INTERFACE
1010
1011!> Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su
1012!! un file \c FORMATTED o \c UNFORMATTED.
1014 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
1015END INTERFACE
1016
1017#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
1018#define VOL7D_POLY_TYPES _ana
1019#define ENABLE_SORT
1020#include "array_utilities_pre.F90"
1021
1022!> Represent ana object in a pretty string
1024 MODULE PROCEDURE to_char_ana
1025END INTERFACE
1026
1027!> Print object
1029 MODULE PROCEDURE display_ana
1030END INTERFACE
1031
1032CONTAINS
1033
1034!> Inizializza un oggetto \a vol7d_ana con i parametri opzionali forniti.
1035!! Se non viene passato nessun parametro opzionale l'oggetto è
1036!! inizializzato a valore mancante.
1037SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
1038TYPE(vol7d_ana),INTENT(INOUT) :: this !< oggetto da inizializzare
1039REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon !< longitudine
1040REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat !< latitudine
1041CHARACTER(len=*),INTENT(in),OPTIONAL :: ident !< identificativo del volo
1042INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon !< integer longitude (nint(lon*1.d5)
1043INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat !< integer latitude (nint(lat*1.d5)
1044
1046IF (PRESENT(ident)) THEN
1047 this%ident = ident
1048ELSE
1049 this%ident = cmiss
1050ENDIF
1051
1052END SUBROUTINE vol7d_ana_init
1053
1054
1055!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
1056SUBROUTINE vol7d_ana_delete(this)
1057TYPE(vol7d_ana),INTENT(INOUT) :: this !< oggetto da distruggre
1058
1060this%ident = cmiss
1061
1062END SUBROUTINE vol7d_ana_delete
1063
1064
1065
1066character(len=80) function to_char_ana(this)
1067
1068TYPE(vol7d_ana),INTENT(in) :: this
1069
1070to_char_ana="ANA: "//&
1073 t2c(this%ident,miss="Missing ident")
1074
1075return
1076
1077end function to_char_ana
1078
1079
1080subroutine display_ana(this)
1081
1082TYPE(vol7d_ana),INTENT(in) :: this
1083
1084print*, trim(to_char(this))
1085
1086end subroutine display_ana
1087
1088
1089ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
1090TYPE(vol7d_ana),INTENT(IN) :: this, that
1091LOGICAL :: res
1092
1093res = this%coord == that%coord .AND. this%ident == that%ident
1094
1095END FUNCTION vol7d_ana_eq
1096
1097
1098ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
1099TYPE(vol7d_ana),INTENT(IN) :: this, that
1100LOGICAL :: res
1101
1102res = .NOT.(this == that)
1103
1104END FUNCTION vol7d_ana_ne
1105
1106
1107ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
1108TYPE(vol7d_ana),INTENT(IN) :: this, that
1109LOGICAL :: res
1110
1111res = this%ident > that%ident
1112
1113if ( this%ident == that%ident) then
1114 res =this%coord > that%coord
1115end if
1116
1117END FUNCTION vol7d_ana_gt
1118
1119
1120ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
1121TYPE(vol7d_ana),INTENT(IN) :: this, that
1122LOGICAL :: res
1123
1124res = .not. this < that
1125
1126END FUNCTION vol7d_ana_ge
1127
1128
1129ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
1130TYPE(vol7d_ana),INTENT(IN) :: this, that
1131LOGICAL :: res
1132
1133res = this%ident < that%ident
1134
1135if ( this%ident == that%ident) then
1136 res = this%coord < that%coord
1137end if
1138
1139END FUNCTION vol7d_ana_lt
1140
1141
1142ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
1143TYPE(vol7d_ana),INTENT(IN) :: this, that
1144LOGICAL :: res
1145
1146res = .not. (this > that)
1147
1148END FUNCTION vol7d_ana_le
1149
1150
1151
1152ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
1153TYPE(vol7d_ana),INTENT(IN) :: this
1154LOGICAL :: c_e
1155c_e = this /= vol7d_ana_miss
1156END FUNCTION vol7d_ana_c_e
1157
1158
1159!> This method reads from a Fortran file unit the contents of the
1160!! object \a this. The record to be read must have been written with
1161!! the ::write_unit method. The method works both on formatted and
1162!! unformatted files.
1163SUBROUTINE vol7d_ana_read_unit(this, unit)
1164TYPE(vol7d_ana),INTENT(out) :: this !< object to be read
1165INTEGER, INTENT(in) :: unit !< unit from which to read, it must be an opened Fortran file unit
1166
1167CALL vol7d_ana_vect_read_unit((/this/), unit)
1168
1169END SUBROUTINE vol7d_ana_read_unit
1170
1171
1172!> This method reads from a Fortran file unit the contents of the
1173!! object \a this. The record to be read must have been written with
1174!! the ::write_unit method. The method works both on formatted and
1175!! unformatted files.
1176SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
1177TYPE(vol7d_ana) :: this(:) !< object to be read
1178INTEGER, INTENT(in) :: unit !< unit from which to read, it must be an opened Fortran file unit
1179
1180CHARACTER(len=40) :: form
1181
1183INQUIRE(unit, form=form)
1184IF (form == 'FORMATTED') THEN
1185 READ(unit,'(A)')this(:)%ident
1186ELSE
1187 READ(unit)this(:)%ident
1188ENDIF
1189
1190END SUBROUTINE vol7d_ana_vect_read_unit
1191
1192
1193!> This method writes on a Fortran file unit the contents of the
1194!! object \a this. The record can successively be read by the
1195!! ::read_unit method. The method works both on formatted and
1196!! unformatted files.
1197SUBROUTINE vol7d_ana_write_unit(this, unit)
1198TYPE(vol7d_ana),INTENT(in) :: this !< object to be written
1199INTEGER, INTENT(in) :: unit !< unit where to write, it must be an opened Fortran file unit
1200
1201CALL vol7d_ana_vect_write_unit((/this/), unit)
1202
1203END SUBROUTINE vol7d_ana_write_unit
1204
1205
1206!> This method writes on a Fortran file unit the contents of the
1207!! object \a this. The record can successively be read by the
1208!! ::read_unit method. The method works both on formatted and
1209!! unformatted files.
1210SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
1211TYPE(vol7d_ana),INTENT(in) :: this(:) !< object to be written
1212INTEGER, INTENT(in) :: unit !< unit where to write, it must be an opened Fortran file unit
1213
1214CHARACTER(len=40) :: form
1215
1217INQUIRE(unit, form=form)
1218IF (form == 'FORMATTED') THEN
1219 WRITE(unit,'(A)')this(:)%ident
1220ELSE
1221 WRITE(unit)this(:)%ident
1222ENDIF
1223
1224END SUBROUTINE vol7d_ana_vect_write_unit
1225
1226
1227#include "array_utilities_inc.F90"
1228
1229
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 |