libsim Versione 7.2.6
|
◆ pack_distinct_sorted_network()
compatta gli elementi distinti di vect in un sorted array Definizione alla linea 623 del file vol7d_network_class.F90. 625! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
626! authors:
627! Davide Cesari <dcesari@arpa.emr.it>
628! Paolo Patruno <ppatruno@arpa.emr.it>
629
630! This program is free software; you can redistribute it and/or
631! modify it under the terms of the GNU General Public License as
632! published by the Free Software Foundation; either version 2 of
633! the License, or (at your option) any later version.
634
635! This program is distributed in the hope that it will be useful,
636! but WITHOUT ANY WARRANTY; without even the implied warranty of
637! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
638! GNU General Public License for more details.
639
640! You should have received a copy of the GNU General Public License
641! along with this program. If not, see <http://www.gnu.org/licenses/>.
642#include "config.h"
643
644!> Classe per la gestione delle reti di stazioni per osservazioni meteo e affini.
645!! Questo modulo definisce una classe per identificare la rete
646!! a cui appartiene una stazione. Per rete si intende un insieme di stazioni
647!! omogenee per tipo di sensori, tipo di variabili osservate,
648!! frequenza delle osservazioni, formato dei dati.
649!! \ingroup vol7d
654IMPLICIT NONE
655
656integer, parameter :: network_name_len=20
657
658!> Definisce la rete a cui appartiene una stazione.
659!! I membri di \a vol7d_network sono pubblici e quindi liberamente
660!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
661!! il costruttore ::init.
663 character(len=network_name_len) :: name !< Mnemonic alias for type of report
665
666!> Valore mancante per vol7d_network.
668
669!> Costruttore per la classe vol7d_network.
670!! Deve essere richiamato
671!! per tutti gli oggetti di questo tipo definiti in un programma.
673 MODULE PROCEDURE vol7d_network_init
674END INTERFACE
675
676!> Distruttore per la classe vol7d_network.
677!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
679 MODULE PROCEDURE vol7d_network_delete
680END INTERFACE
681
682!> Logical equality operator for objects of \a vol7d_network class.
683!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
684!! of any shape.
685INTERFACE OPERATOR (==)
686 MODULE PROCEDURE vol7d_network_eq
687END INTERFACE
688
689!> Logical inequality operator for objects of \a vol7d_network class.
690!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
691!! of any shape.
692INTERFACE OPERATOR (/=)
693 MODULE PROCEDURE vol7d_network_ne
694END INTERFACE
695
696!> Logical greater-than operator for objects of \a vol7d_network class.
697!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
698!! of any shape.
699INTERFACE OPERATOR (>)
700 MODULE PROCEDURE vol7d_network_gt
701END INTERFACE
702
703!> Logical less-than operator for objects of \a vol7d_network class.
704!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
705!! of any shape.
706INTERFACE OPERATOR (<)
707 MODULE PROCEDURE vol7d_network_lt
708END INTERFACE
709
710!> Logical greater-equal operator for objects of \a vol7d_network class.
711!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
712!! of any shape.
713INTERFACE OPERATOR (>=)
714 MODULE PROCEDURE vol7d_network_ge
715END INTERFACE
716
717!> Logical less-equal operator for objects of \a vol7d_network class.
718!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
719!! of any shape.
720INTERFACE OPERATOR (<=)
721 MODULE PROCEDURE vol7d_network_le
722END INTERFACE
723
724#define VOL7D_POLY_TYPE TYPE(vol7d_network)
725#define VOL7D_POLY_TYPES _network
726#define ENABLE_SORT
727#include "array_utilities_pre.F90"
728
729!>Print object
731 MODULE PROCEDURE display_network
732END INTERFACE
733
734!>Check object presence
736 MODULE PROCEDURE c_e_network
737END INTERFACE
738
739!>return network object in a pretty string
741 MODULE PROCEDURE to_char_network
742END INTERFACE
743
744CONTAINS
745
746!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
747!! Questa è la versione \c FUNCTION, in stile F2003, del costruttore, da preferire
748!! rispetto alla versione \c SUBROUTINE \c init.
749!! Se non viene passato nessun parametro opzionale l'oggetto è
750!! inizializzato a valore mancante.
751FUNCTION vol7d_network_new(name) RESULT(this)
752CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
753
754TYPE(vol7d_network) :: this !< oggetto da inizializzare
755
757
758END FUNCTION vol7d_network_new
759
760
761!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
762!! Se non viene passato nessun parametro opzionale l'oggetto è
763!! inizializzato a valore mancante.
764SUBROUTINE vol7d_network_init(this, name)
765TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da inizializzare
766CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
767
768IF (PRESENT(name)) THEN
769 this%name = lowercase(name)
770ELSE
771 this%name = cmiss
772END IF
773
774END SUBROUTINE vol7d_network_init
775
776
777!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
778SUBROUTINE vol7d_network_delete(this)
779TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da distruggre
780
781this%name = cmiss
782
783END SUBROUTINE vol7d_network_delete
784
785
786subroutine display_network(this)
787
788TYPE(vol7d_network),INTENT(in) :: this
789
790print*,to_char_network(this)
791
792end subroutine display_network
793
794
795elemental function c_e_network(this) result(res)
796
797TYPE(vol7d_network),INTENT(in) :: this
798logical :: res
799
800res = .not. this == vol7d_network_miss
801
802end function c_e_network
803
804
805elemental character(len=20) function to_char_network(this)
806
807TYPE(vol7d_network),INTENT(in) :: this
808
809to_char_network="Network: "//trim(this%name)
810
811return
812
813end function to_char_network
814
815
816ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
817TYPE(vol7d_network),INTENT(IN) :: this, that
818LOGICAL :: res
819
820res = (this%name == that%name)
821
822END FUNCTION vol7d_network_eq
823
824
825ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
826TYPE(vol7d_network),INTENT(IN) :: this, that
827LOGICAL :: res
828
829res = .NOT.(this == that)
830
831END FUNCTION vol7d_network_ne
832
833
834ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
835TYPE(vol7d_network),INTENT(IN) :: this, that
836LOGICAL :: res
837
838res = this%name > that%name
839
840END FUNCTION vol7d_network_gt
841
842ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
843TYPE(vol7d_network),INTENT(IN) :: this, that
844LOGICAL :: res
845
846res = this%name < that%name
847
848END FUNCTION vol7d_network_lt
849
850
851ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
852TYPE(vol7d_network),INTENT(IN) :: this, that
853LOGICAL :: res
854
855res = this%name >= that%name
856
857END FUNCTION vol7d_network_ge
858
859ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
860TYPE(vol7d_network),INTENT(IN) :: this, that
861LOGICAL :: res
862
863res = this%name <= that%name
864
865END FUNCTION vol7d_network_le
866
867
868#include "array_utilities_inc.F90"
869
870
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 |