libsim Versione 7.1.11
|
◆ count_distinct_sorted_network()
conta gli elementi distinti in un sorted array Definizione alla linea 518 del file vol7d_network_class.F90. 519! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
520! authors:
521! Davide Cesari <dcesari@arpa.emr.it>
522! Paolo Patruno <ppatruno@arpa.emr.it>
523
524! This program is free software; you can redistribute it and/or
525! modify it under the terms of the GNU General Public License as
526! published by the Free Software Foundation; either version 2 of
527! the License, or (at your option) any later version.
528
529! This program is distributed in the hope that it will be useful,
530! but WITHOUT ANY WARRANTY; without even the implied warranty of
531! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
532! GNU General Public License for more details.
533
534! You should have received a copy of the GNU General Public License
535! along with this program. If not, see <http://www.gnu.org/licenses/>.
536#include "config.h"
537
548IMPLICIT NONE
549
550integer, parameter :: network_name_len=20
551
557 character(len=network_name_len) :: name
559
562
567 MODULE PROCEDURE vol7d_network_init
568END INTERFACE
569
573 MODULE PROCEDURE vol7d_network_delete
574END INTERFACE
575
579INTERFACE OPERATOR (==)
580 MODULE PROCEDURE vol7d_network_eq
581END INTERFACE
582
586INTERFACE OPERATOR (/=)
587 MODULE PROCEDURE vol7d_network_ne
588END INTERFACE
589
593INTERFACE OPERATOR (>)
594 MODULE PROCEDURE vol7d_network_gt
595END INTERFACE
596
600INTERFACE OPERATOR (<)
601 MODULE PROCEDURE vol7d_network_lt
602END INTERFACE
603
607INTERFACE OPERATOR (>=)
608 MODULE PROCEDURE vol7d_network_ge
609END INTERFACE
610
614INTERFACE OPERATOR (<=)
615 MODULE PROCEDURE vol7d_network_le
616END INTERFACE
617
618#define VOL7D_POLY_TYPE TYPE(vol7d_network)
619#define VOL7D_POLY_TYPES _network
620#define ENABLE_SORT
621#include "array_utilities_pre.F90"
622
625 MODULE PROCEDURE display_network
626END INTERFACE
627
630 MODULE PROCEDURE c_e_network
631END INTERFACE
632
635 MODULE PROCEDURE to_char_network
636END INTERFACE
637
638CONTAINS
639
645FUNCTION vol7d_network_new(name) RESULT(this)
646CHARACTER(len=*),INTENT(in),OPTIONAL :: name
647
648TYPE(vol7d_network) :: this
649
651
652END FUNCTION vol7d_network_new
653
654
658SUBROUTINE vol7d_network_init(this, name)
659TYPE(vol7d_network),INTENT(INOUT) :: this
660CHARACTER(len=*),INTENT(in),OPTIONAL :: name
661
662IF (PRESENT(name)) THEN
663 this%name = lowercase(name)
664ELSE
665 this%name = cmiss
666END IF
667
668END SUBROUTINE vol7d_network_init
669
670
672SUBROUTINE vol7d_network_delete(this)
673TYPE(vol7d_network),INTENT(INOUT) :: this
674
675this%name = cmiss
676
677END SUBROUTINE vol7d_network_delete
678
679
680subroutine display_network(this)
681
682TYPE(vol7d_network),INTENT(in) :: this
683
684print*,to_char_network(this)
685
686end subroutine display_network
687
688
689elemental function c_e_network(this) result(res)
690
691TYPE(vol7d_network),INTENT(in) :: this
692logical :: res
693
694res = .not. this == vol7d_network_miss
695
696end function c_e_network
697
698
699elemental character(len=20) function to_char_network(this)
700
701TYPE(vol7d_network),INTENT(in) :: this
702
703to_char_network="Network: "//trim(this%name)
704
705return
706
707end function to_char_network
708
709
710ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
711TYPE(vol7d_network),INTENT(IN) :: this, that
712LOGICAL :: res
713
714res = (this%name == that%name)
715
716END FUNCTION vol7d_network_eq
717
718
719ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
720TYPE(vol7d_network),INTENT(IN) :: this, that
721LOGICAL :: res
722
723res = .NOT.(this == that)
724
725END FUNCTION vol7d_network_ne
726
727
728ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
729TYPE(vol7d_network),INTENT(IN) :: this, that
730LOGICAL :: res
731
732res = this%name > that%name
733
734END FUNCTION vol7d_network_gt
735
736ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
737TYPE(vol7d_network),INTENT(IN) :: this, that
738LOGICAL :: res
739
740res = this%name < that%name
741
742END FUNCTION vol7d_network_lt
743
744
745ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
746TYPE(vol7d_network),INTENT(IN) :: this, that
747LOGICAL :: res
748
749res = this%name >= that%name
750
751END FUNCTION vol7d_network_ge
752
753ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
754TYPE(vol7d_network),INTENT(IN) :: this, that
755LOGICAL :: res
756
757res = this%name <= that%name
758
759END FUNCTION vol7d_network_le
760
761
762#include "array_utilities_inc.F90"
763
764
Distruttore per la classe vol7d_network. Definition: vol7d_network_class.F90:248 Costruttore per la classe vol7d_network. Definition: vol7d_network_class.F90:242 return network object in a pretty string Definition: vol7d_network_class.F90:365 Definition of constants to be used for declaring variables of a desired type. Definition: kinds.F90:251 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:220 Definisce la rete a cui appartiene una stazione. Definition: vol7d_network_class.F90:232 |