libsim Versione 7.2.1
|
◆ 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
542IMPLICIT NONE
543
544integer, parameter :: network_name_len=20
545
551 character(len=network_name_len) :: name
553
556
561 MODULE PROCEDURE vol7d_network_init
562END INTERFACE
563
567 MODULE PROCEDURE vol7d_network_delete
568END INTERFACE
569
573INTERFACE OPERATOR (==)
574 MODULE PROCEDURE vol7d_network_eq
575END INTERFACE
576
580INTERFACE OPERATOR (/=)
581 MODULE PROCEDURE vol7d_network_ne
582END INTERFACE
583
587INTERFACE OPERATOR (>)
588 MODULE PROCEDURE vol7d_network_gt
589END INTERFACE
590
594INTERFACE OPERATOR (<)
595 MODULE PROCEDURE vol7d_network_lt
596END INTERFACE
597
601INTERFACE OPERATOR (>=)
602 MODULE PROCEDURE vol7d_network_ge
603END INTERFACE
604
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
619 MODULE PROCEDURE display_network
620END INTERFACE
621
624 MODULE PROCEDURE c_e_network
625END INTERFACE
626
629 MODULE PROCEDURE to_char_network
630END INTERFACE
631
632CONTAINS
633
639FUNCTION vol7d_network_new(name) RESULT(this)
640CHARACTER(len=*),INTENT(in),OPTIONAL :: name
641
642TYPE(vol7d_network) :: this
643
645
646END FUNCTION vol7d_network_new
647
648
652SUBROUTINE vol7d_network_init(this, name)
653TYPE(vol7d_network),INTENT(INOUT) :: this
654CHARACTER(len=*),INTENT(in),OPTIONAL :: name
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
666SUBROUTINE vol7d_network_delete(this)
667TYPE(vol7d_network),INTENT(INOUT) :: this
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 |