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