libsim Versione 7.2.4

◆ count_distinct_network()

integer function count_distinct_network ( type(vol7d_network), dimension(:), intent(in) vect,
logical, dimension(:), intent(in), optional mask,
logical, intent(in), optional back )

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
573USE kinds
576IMPLICIT NONE
577
578integer, parameter :: network_name_len=20
579
584TYPE vol7d_network
585 character(len=network_name_len) :: name
586END TYPE vol7d_network
587
589TYPE(vol7d_network),PARAMETER :: vol7d_network_miss=vol7d_network(cmiss)
590
594INTERFACE init
595 MODULE PROCEDURE vol7d_network_init
596END INTERFACE
597
600INTERFACE delete
601 MODULE PROCEDURE vol7d_network_delete
602END INTERFACE
603
607INTERFACE OPERATOR (==)
608 MODULE PROCEDURE vol7d_network_eq
609END INTERFACE
610
614INTERFACE OPERATOR (/=)
615 MODULE PROCEDURE vol7d_network_ne
616END INTERFACE
617
621INTERFACE OPERATOR (>)
622 MODULE PROCEDURE vol7d_network_gt
623END INTERFACE
624
628INTERFACE OPERATOR (<)
629 MODULE PROCEDURE vol7d_network_lt
630END INTERFACE
631
635INTERFACE OPERATOR (>=)
636 MODULE PROCEDURE vol7d_network_ge
637END INTERFACE
638
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
652INTERFACE display
653 MODULE PROCEDURE display_network
654END INTERFACE
655
657INTERFACE c_e
658 MODULE PROCEDURE c_e_network
659END INTERFACE
660
662INTERFACE to_char
663 MODULE PROCEDURE to_char_network
664END INTERFACE
665
666CONTAINS
667
673FUNCTION vol7d_network_new(name) RESULT(this)
674CHARACTER(len=*),INTENT(in),OPTIONAL :: name
675
676TYPE(vol7d_network) :: this
677
678CALL init(this, name)
679
680END FUNCTION vol7d_network_new
681
682
686SUBROUTINE vol7d_network_init(this, name)
687TYPE(vol7d_network),INTENT(INOUT) :: this
688CHARACTER(len=*),INTENT(in),OPTIONAL :: name
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
700SUBROUTINE vol7d_network_delete(this)
701TYPE(vol7d_network),INTENT(INOUT) :: this
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
793END MODULE vol7d_network_class
Distruttore per la classe vol7d_network.
Costruttore per la classe vol7d_network.
return network object in a pretty string
Utilities for CHARACTER variables.
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.
Classe per la gestione delle reti di stazioni per osservazioni meteo e affini.
Definisce la rete a cui appartiene una stazione.

Generated with Doxygen.