libsim Versione 7.2.6
|
◆ map_distinct_network()
map distinct Definizione alla linea 805 del file vol7d_network_class.F90. 806! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
807! authors:
808! Davide Cesari <dcesari@arpa.emr.it>
809! Paolo Patruno <ppatruno@arpa.emr.it>
810
811! This program is free software; you can redistribute it and/or
812! modify it under the terms of the GNU General Public License as
813! published by the Free Software Foundation; either version 2 of
814! the License, or (at your option) any later version.
815
816! This program is distributed in the hope that it will be useful,
817! but WITHOUT ANY WARRANTY; without even the implied warranty of
818! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
819! GNU General Public License for more details.
820
821! You should have received a copy of the GNU General Public License
822! along with this program. If not, see <http://www.gnu.org/licenses/>.
823#include "config.h"
824
825!> Classe per la gestione delle reti di stazioni per osservazioni meteo e affini.
826!! Questo modulo definisce una classe per identificare la rete
827!! a cui appartiene una stazione. Per rete si intende un insieme di stazioni
828!! omogenee per tipo di sensori, tipo di variabili osservate,
829!! frequenza delle osservazioni, formato dei dati.
830!! \ingroup vol7d
835IMPLICIT NONE
836
837integer, parameter :: network_name_len=20
838
839!> Definisce la rete a cui appartiene una stazione.
840!! I membri di \a vol7d_network sono pubblici e quindi liberamente
841!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
842!! il costruttore ::init.
844 character(len=network_name_len) :: name !< Mnemonic alias for type of report
846
847!> Valore mancante per vol7d_network.
849
850!> Costruttore per la classe vol7d_network.
851!! Deve essere richiamato
852!! per tutti gli oggetti di questo tipo definiti in un programma.
854 MODULE PROCEDURE vol7d_network_init
855END INTERFACE
856
857!> Distruttore per la classe vol7d_network.
858!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
860 MODULE PROCEDURE vol7d_network_delete
861END INTERFACE
862
863!> Logical equality operator for objects of \a vol7d_network class.
864!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
865!! of any shape.
866INTERFACE OPERATOR (==)
867 MODULE PROCEDURE vol7d_network_eq
868END INTERFACE
869
870!> Logical inequality operator for objects of \a vol7d_network class.
871!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
872!! of any shape.
873INTERFACE OPERATOR (/=)
874 MODULE PROCEDURE vol7d_network_ne
875END INTERFACE
876
877!> Logical greater-than operator for objects of \a vol7d_network class.
878!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
879!! of any shape.
880INTERFACE OPERATOR (>)
881 MODULE PROCEDURE vol7d_network_gt
882END INTERFACE
883
884!> Logical less-than operator for objects of \a vol7d_network class.
885!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
886!! of any shape.
887INTERFACE OPERATOR (<)
888 MODULE PROCEDURE vol7d_network_lt
889END INTERFACE
890
891!> Logical greater-equal operator for objects of \a vol7d_network class.
892!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
893!! of any shape.
894INTERFACE OPERATOR (>=)
895 MODULE PROCEDURE vol7d_network_ge
896END INTERFACE
897
898!> Logical less-equal operator for objects of \a vol7d_network class.
899!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
900!! of any shape.
901INTERFACE OPERATOR (<=)
902 MODULE PROCEDURE vol7d_network_le
903END INTERFACE
904
905#define VOL7D_POLY_TYPE TYPE(vol7d_network)
906#define VOL7D_POLY_TYPES _network
907#define ENABLE_SORT
908#include "array_utilities_pre.F90"
909
910!>Print object
912 MODULE PROCEDURE display_network
913END INTERFACE
914
915!>Check object presence
917 MODULE PROCEDURE c_e_network
918END INTERFACE
919
920!>return network object in a pretty string
922 MODULE PROCEDURE to_char_network
923END INTERFACE
924
925CONTAINS
926
927!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
928!! Questa è la versione \c FUNCTION, in stile F2003, del costruttore, da preferire
929!! rispetto alla versione \c SUBROUTINE \c init.
930!! Se non viene passato nessun parametro opzionale l'oggetto è
931!! inizializzato a valore mancante.
932FUNCTION vol7d_network_new(name) RESULT(this)
933CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
934
935TYPE(vol7d_network) :: this !< oggetto da inizializzare
936
938
939END FUNCTION vol7d_network_new
940
941
942!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
943!! Se non viene passato nessun parametro opzionale l'oggetto è
944!! inizializzato a valore mancante.
945SUBROUTINE vol7d_network_init(this, name)
946TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da inizializzare
947CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
948
949IF (PRESENT(name)) THEN
950 this%name = lowercase(name)
951ELSE
952 this%name = cmiss
953END IF
954
955END SUBROUTINE vol7d_network_init
956
957
958!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
959SUBROUTINE vol7d_network_delete(this)
960TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da distruggre
961
962this%name = cmiss
963
964END SUBROUTINE vol7d_network_delete
965
966
967subroutine display_network(this)
968
969TYPE(vol7d_network),INTENT(in) :: this
970
971print*,to_char_network(this)
972
973end subroutine display_network
974
975
976elemental function c_e_network(this) result(res)
977
978TYPE(vol7d_network),INTENT(in) :: this
979logical :: res
980
981res = .not. this == vol7d_network_miss
982
983end function c_e_network
984
985
986elemental character(len=20) function to_char_network(this)
987
988TYPE(vol7d_network),INTENT(in) :: this
989
990to_char_network="Network: "//trim(this%name)
991
992return
993
994end function to_char_network
995
996
997ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
998TYPE(vol7d_network),INTENT(IN) :: this, that
999LOGICAL :: res
1000
1001res = (this%name == that%name)
1002
1003END FUNCTION vol7d_network_eq
1004
1005
1006ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
1007TYPE(vol7d_network),INTENT(IN) :: this, that
1008LOGICAL :: res
1009
1010res = .NOT.(this == that)
1011
1012END FUNCTION vol7d_network_ne
1013
1014
1015ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
1016TYPE(vol7d_network),INTENT(IN) :: this, that
1017LOGICAL :: res
1018
1019res = this%name > that%name
1020
1021END FUNCTION vol7d_network_gt
1022
1023ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
1024TYPE(vol7d_network),INTENT(IN) :: this, that
1025LOGICAL :: res
1026
1027res = this%name < that%name
1028
1029END FUNCTION vol7d_network_lt
1030
1031
1032ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
1033TYPE(vol7d_network),INTENT(IN) :: this, that
1034LOGICAL :: res
1035
1036res = this%name >= that%name
1037
1038END FUNCTION vol7d_network_ge
1039
1040ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
1041TYPE(vol7d_network),INTENT(IN) :: this, that
1042LOGICAL :: res
1043
1044res = this%name <= that%name
1045
1046END FUNCTION vol7d_network_le
1047
1048
1049#include "array_utilities_inc.F90"
1050
1051
Distruttore per la classe vol7d_network. Definition vol7d_network_class.F90:242 Costruttore per la classe vol7d_network. Definition vol7d_network_class.F90:236 return network object in a pretty string Definition vol7d_network_class.F90:359 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 delle reti di stazioni per osservazioni meteo e affini. Definition vol7d_network_class.F90:214 Definisce la rete a cui appartiene una stazione. Definition vol7d_network_class.F90:226 |