libsim Versione 7.2.6
|
◆ count_distinct_network()
conta gli elementi distinti in vect Definizione alla linea 546 del file vol7d_network_class.F90. 547! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
548! authors:
549! Davide Cesari <dcesari@arpa.emr.it>
550! Paolo Patruno <ppatruno@arpa.emr.it>
551
552! This program is free software; you can redistribute it and/or
553! modify it under the terms of the GNU General Public License as
554! published by the Free Software Foundation; either version 2 of
555! the License, or (at your option) any later version.
556
557! This program is distributed in the hope that it will be useful,
558! but WITHOUT ANY WARRANTY; without even the implied warranty of
559! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
560! GNU General Public License for more details.
561
562! You should have received a copy of the GNU General Public License
563! along with this program. If not, see <http://www.gnu.org/licenses/>.
564#include "config.h"
565
566!> Classe per la gestione delle reti di stazioni per osservazioni meteo e affini.
567!! Questo modulo definisce una classe per identificare la rete
568!! a cui appartiene una stazione. Per rete si intende un insieme di stazioni
569!! omogenee per tipo di sensori, tipo di variabili osservate,
570!! frequenza delle osservazioni, formato dei dati.
571!! \ingroup vol7d
576IMPLICIT NONE
577
578integer, parameter :: network_name_len=20
579
580!> Definisce la rete a cui appartiene una stazione.
581!! I membri di \a vol7d_network sono pubblici e quindi liberamente
582!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
583!! il costruttore ::init.
585 character(len=network_name_len) :: name !< Mnemonic alias for type of report
587
588!> Valore mancante per vol7d_network.
590
591!> Costruttore per la classe vol7d_network.
592!! Deve essere richiamato
593!! per tutti gli oggetti di questo tipo definiti in un programma.
595 MODULE PROCEDURE vol7d_network_init
596END INTERFACE
597
598!> Distruttore per la classe vol7d_network.
599!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
601 MODULE PROCEDURE vol7d_network_delete
602END INTERFACE
603
604!> Logical equality operator for objects of \a vol7d_network class.
605!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
606!! of any shape.
607INTERFACE OPERATOR (==)
608 MODULE PROCEDURE vol7d_network_eq
609END INTERFACE
610
611!> Logical inequality operator for objects of \a vol7d_network class.
612!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
613!! of any shape.
614INTERFACE OPERATOR (/=)
615 MODULE PROCEDURE vol7d_network_ne
616END INTERFACE
617
618!> Logical greater-than operator for objects of \a vol7d_network class.
619!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
620!! of any shape.
621INTERFACE OPERATOR (>)
622 MODULE PROCEDURE vol7d_network_gt
623END INTERFACE
624
625!> Logical less-than operator for objects of \a vol7d_network class.
626!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
627!! of any shape.
628INTERFACE OPERATOR (<)
629 MODULE PROCEDURE vol7d_network_lt
630END INTERFACE
631
632!> Logical greater-equal operator for objects of \a vol7d_network class.
633!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
634!! of any shape.
635INTERFACE OPERATOR (>=)
636 MODULE PROCEDURE vol7d_network_ge
637END INTERFACE
638
639!> Logical less-equal operator for objects of \a vol7d_network class.
640!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
641!! of any shape.
642INTERFACE OPERATOR (<=)
643 MODULE PROCEDURE vol7d_network_le
644END INTERFACE
645
646#define VOL7D_POLY_TYPE TYPE(vol7d_network)
647#define VOL7D_POLY_TYPES _network
648#define ENABLE_SORT
649#include "array_utilities_pre.F90"
650
651!>Print object
653 MODULE PROCEDURE display_network
654END INTERFACE
655
656!>Check object presence
658 MODULE PROCEDURE c_e_network
659END INTERFACE
660
661!>return network object in a pretty string
663 MODULE PROCEDURE to_char_network
664END INTERFACE
665
666CONTAINS
667
668!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
669!! Questa è la versione \c FUNCTION, in stile F2003, del costruttore, da preferire
670!! rispetto alla versione \c SUBROUTINE \c init.
671!! Se non viene passato nessun parametro opzionale l'oggetto è
672!! inizializzato a valore mancante.
673FUNCTION vol7d_network_new(name) RESULT(this)
674CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
675
676TYPE(vol7d_network) :: this !< oggetto da inizializzare
677
679
680END FUNCTION vol7d_network_new
681
682
683!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
684!! Se non viene passato nessun parametro opzionale l'oggetto è
685!! inizializzato a valore mancante.
686SUBROUTINE vol7d_network_init(this, name)
687TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da inizializzare
688CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
689
690IF (PRESENT(name)) THEN
691 this%name = lowercase(name)
692ELSE
693 this%name = cmiss
694END IF
695
696END SUBROUTINE vol7d_network_init
697
698
699!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
700SUBROUTINE vol7d_network_delete(this)
701TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da distruggre
702
703this%name = cmiss
704
705END SUBROUTINE vol7d_network_delete
706
707
708subroutine display_network(this)
709
710TYPE(vol7d_network),INTENT(in) :: this
711
712print*,to_char_network(this)
713
714end subroutine display_network
715
716
717elemental function c_e_network(this) result(res)
718
719TYPE(vol7d_network),INTENT(in) :: this
720logical :: res
721
722res = .not. this == vol7d_network_miss
723
724end function c_e_network
725
726
727elemental character(len=20) function to_char_network(this)
728
729TYPE(vol7d_network),INTENT(in) :: this
730
731to_char_network="Network: "//trim(this%name)
732
733return
734
735end function to_char_network
736
737
738ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
739TYPE(vol7d_network),INTENT(IN) :: this, that
740LOGICAL :: res
741
742res = (this%name == that%name)
743
744END FUNCTION vol7d_network_eq
745
746
747ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
748TYPE(vol7d_network),INTENT(IN) :: this, that
749LOGICAL :: res
750
751res = .NOT.(this == that)
752
753END FUNCTION vol7d_network_ne
754
755
756ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
757TYPE(vol7d_network),INTENT(IN) :: this, that
758LOGICAL :: res
759
760res = this%name > that%name
761
762END FUNCTION vol7d_network_gt
763
764ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
765TYPE(vol7d_network),INTENT(IN) :: this, that
766LOGICAL :: res
767
768res = this%name < that%name
769
770END FUNCTION vol7d_network_lt
771
772
773ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
774TYPE(vol7d_network),INTENT(IN) :: this, that
775LOGICAL :: res
776
777res = this%name >= that%name
778
779END FUNCTION vol7d_network_ge
780
781ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
782TYPE(vol7d_network),INTENT(IN) :: this, that
783LOGICAL :: res
784
785res = this%name <= that%name
786
787END FUNCTION vol7d_network_le
788
789
790#include "array_utilities_inc.F90"
791
792
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 |