libsim Versione 7.1.11

◆ count_distinct_sorted_ana()

integer function count_distinct_sorted_ana ( type(vol7d_ana), dimension(:), intent(in)  vect,
logical, dimension(:), intent(in), optional  mask 
)

conta gli elementi distinti in un sorted array

Definizione alla linea 607 del file vol7d_ana_class.F90.

608! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
609! authors:
610! Davide Cesari <dcesari@arpa.emr.it>
611! Paolo Patruno <ppatruno@arpa.emr.it>
612
613! This program is free software; you can redistribute it and/or
614! modify it under the terms of the GNU General Public License as
615! published by the Free Software Foundation; either version 2 of
616! the License, or (at your option) any later version.
617
618! This program is distributed in the hope that it will be useful,
619! but WITHOUT ANY WARRANTY; without even the implied warranty of
620! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
621! GNU General Public License for more details.
622
623! You should have received a copy of the GNU General Public License
624! along with this program. If not, see <http://www.gnu.org/licenses/>.
625#include "config.h"
626
631MODULE vol7d_ana_class
632USE kinds
635IMPLICIT NONE
636
638INTEGER,PARAMETER :: vol7d_ana_lenident=20
639
644TYPE vol7d_ana
645 TYPE(geo_coord) :: coord
646 CHARACTER(len=vol7d_ana_lenident) :: ident
647END TYPE vol7d_ana
648
650TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
651
655INTERFACE init
656 MODULE PROCEDURE vol7d_ana_init
657END INTERFACE
658
661INTERFACE delete
662 MODULE PROCEDURE vol7d_ana_delete
663END INTERFACE
664
668INTERFACE OPERATOR (==)
669 MODULE PROCEDURE vol7d_ana_eq
670END INTERFACE
671
675INTERFACE OPERATOR (/=)
676 MODULE PROCEDURE vol7d_ana_ne
677END INTERFACE
678
679
684INTERFACE OPERATOR (>)
685 MODULE PROCEDURE vol7d_ana_gt
686END INTERFACE
687
692INTERFACE OPERATOR (<)
693 MODULE PROCEDURE vol7d_ana_lt
694END INTERFACE
695
700INTERFACE OPERATOR (>=)
701 MODULE PROCEDURE vol7d_ana_ge
702END INTERFACE
703
708INTERFACE OPERATOR (<=)
709 MODULE PROCEDURE vol7d_ana_le
710END INTERFACE
711
712
714INTERFACE c_e
715 MODULE PROCEDURE vol7d_ana_c_e
716END INTERFACE
717
720INTERFACE read_unit
721 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
722END INTERFACE
723
726INTERFACE write_unit
727 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
728END INTERFACE
729
730#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
731#define VOL7D_POLY_TYPES _ana
732#define ENABLE_SORT
733#include "array_utilities_pre.F90"
734
736INTERFACE to_char
737 MODULE PROCEDURE to_char_ana
738END INTERFACE
739
741INTERFACE display
742 MODULE PROCEDURE display_ana
743END INTERFACE
744
745CONTAINS
746
750SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
751TYPE(vol7d_ana),INTENT(INOUT) :: this
752REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
753REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
754CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
755INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
756INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
757
758CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
759IF (PRESENT(ident)) THEN
760 this%ident = ident
761ELSE
762 this%ident = cmiss
763ENDIF
764
765END SUBROUTINE vol7d_ana_init
766
767
769SUBROUTINE vol7d_ana_delete(this)
770TYPE(vol7d_ana),INTENT(INOUT) :: this
771
772CALL delete(this%coord)
773this%ident = cmiss
774
775END SUBROUTINE vol7d_ana_delete
776
777
778
779character(len=80) function to_char_ana(this)
780
781TYPE(vol7d_ana),INTENT(in) :: this
782
783to_char_ana="ANA: "//&
784 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
785 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
786 t2c(this%ident,miss="Missing ident")
787
788return
789
790end function to_char_ana
791
792
793subroutine display_ana(this)
794
795TYPE(vol7d_ana),INTENT(in) :: this
796
797print*, trim(to_char(this))
798
799end subroutine display_ana
800
801
802ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
803TYPE(vol7d_ana),INTENT(IN) :: this, that
804LOGICAL :: res
805
806res = this%coord == that%coord .AND. this%ident == that%ident
807
808END FUNCTION vol7d_ana_eq
809
810
811ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
812TYPE(vol7d_ana),INTENT(IN) :: this, that
813LOGICAL :: res
814
815res = .NOT.(this == that)
816
817END FUNCTION vol7d_ana_ne
818
819
820ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
821TYPE(vol7d_ana),INTENT(IN) :: this, that
822LOGICAL :: res
823
824res = this%ident > that%ident
825
826if ( this%ident == that%ident) then
827 res =this%coord > that%coord
828end if
829
830END FUNCTION vol7d_ana_gt
831
832
833ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
834TYPE(vol7d_ana),INTENT(IN) :: this, that
835LOGICAL :: res
836
837res = .not. this < that
838
839END FUNCTION vol7d_ana_ge
840
841
842ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
843TYPE(vol7d_ana),INTENT(IN) :: this, that
844LOGICAL :: res
845
846res = this%ident < that%ident
847
848if ( this%ident == that%ident) then
849 res = this%coord < that%coord
850end if
851
852END FUNCTION vol7d_ana_lt
853
854
855ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
856TYPE(vol7d_ana),INTENT(IN) :: this, that
857LOGICAL :: res
858
859res = .not. (this > that)
860
861END FUNCTION vol7d_ana_le
862
863
864
865ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
866TYPE(vol7d_ana),INTENT(IN) :: this
867LOGICAL :: c_e
868c_e = this /= vol7d_ana_miss
869END FUNCTION vol7d_ana_c_e
870
871
876SUBROUTINE vol7d_ana_read_unit(this, unit)
877TYPE(vol7d_ana),INTENT(out) :: this
878INTEGER, INTENT(in) :: unit
879
880CALL vol7d_ana_vect_read_unit((/this/), unit)
881
882END SUBROUTINE vol7d_ana_read_unit
883
884
889SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
890TYPE(vol7d_ana) :: this(:)
891INTEGER, INTENT(in) :: unit
892
893CHARACTER(len=40) :: form
894
895CALL read_unit(this%coord, unit)
896INQUIRE(unit, form=form)
897IF (form == 'FORMATTED') THEN
898 READ(unit,'(A)')this(:)%ident
899ELSE
900 READ(unit)this(:)%ident
901ENDIF
902
903END SUBROUTINE vol7d_ana_vect_read_unit
904
905
910SUBROUTINE vol7d_ana_write_unit(this, unit)
911TYPE(vol7d_ana),INTENT(in) :: this
912INTEGER, INTENT(in) :: unit
913
914CALL vol7d_ana_vect_write_unit((/this/), unit)
915
916END SUBROUTINE vol7d_ana_write_unit
917
918
923SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
924TYPE(vol7d_ana),INTENT(in) :: this(:)
925INTEGER, INTENT(in) :: unit
926
927CHARACTER(len=40) :: form
928
929CALL write_unit(this%coord, unit)
930INQUIRE(unit, form=form)
931IF (form == 'FORMATTED') THEN
932 WRITE(unit,'(A)')this(:)%ident
933ELSE
934 WRITE(unit)this(:)%ident
935ENDIF
936
937END SUBROUTINE vol7d_ana_vect_write_unit
938
939
940#include "array_utilities_inc.F90"
941
942
943END MODULE vol7d_ana_class
check for missing value
Distruttore per la classe vol7d_ana.
Costruttore per la classe vol7d_ana.
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED.
Represent ana object in a pretty string.
Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED.
Classes for handling georeferenced sparse points in geographical corodinates.
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.
Classe per la gestione dell'anagrafica di stazioni meteo e affini.
Definisce l'anagrafica di una stazione.

Generated with Doxygen.