libsim Versione 7.2.4

◆ 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 601 del file vol7d_ana_class.F90.

602! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
603! authors:
604! Davide Cesari <dcesari@arpa.emr.it>
605! Paolo Patruno <ppatruno@arpa.emr.it>
606
607! This program is free software; you can redistribute it and/or
608! modify it under the terms of the GNU General Public License as
609! published by the Free Software Foundation; either version 2 of
610! the License, or (at your option) any later version.
611
612! This program is distributed in the hope that it will be useful,
613! but WITHOUT ANY WARRANTY; without even the implied warranty of
614! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
615! GNU General Public License for more details.
616
617! You should have received a copy of the GNU General Public License
618! along with this program. If not, see <http://www.gnu.org/licenses/>.
619#include "config.h"
620
625MODULE vol7d_ana_class
626USE kinds
629IMPLICIT NONE
630
632INTEGER,PARAMETER :: vol7d_ana_lenident=20
633
638TYPE vol7d_ana
639 TYPE(geo_coord) :: coord
640 CHARACTER(len=vol7d_ana_lenident) :: ident
641END TYPE vol7d_ana
642
644TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
645
649INTERFACE init
650 MODULE PROCEDURE vol7d_ana_init
651END INTERFACE
652
655INTERFACE delete
656 MODULE PROCEDURE vol7d_ana_delete
657END INTERFACE
658
662INTERFACE OPERATOR (==)
663 MODULE PROCEDURE vol7d_ana_eq
664END INTERFACE
665
669INTERFACE OPERATOR (/=)
670 MODULE PROCEDURE vol7d_ana_ne
671END INTERFACE
672
673
678INTERFACE OPERATOR (>)
679 MODULE PROCEDURE vol7d_ana_gt
680END INTERFACE
681
686INTERFACE OPERATOR (<)
687 MODULE PROCEDURE vol7d_ana_lt
688END INTERFACE
689
694INTERFACE OPERATOR (>=)
695 MODULE PROCEDURE vol7d_ana_ge
696END INTERFACE
697
702INTERFACE OPERATOR (<=)
703 MODULE PROCEDURE vol7d_ana_le
704END INTERFACE
705
706
708INTERFACE c_e
709 MODULE PROCEDURE vol7d_ana_c_e
710END INTERFACE
711
714INTERFACE read_unit
715 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
716END INTERFACE
717
720INTERFACE write_unit
721 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
722END INTERFACE
723
724#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
725#define VOL7D_POLY_TYPES _ana
726#define ENABLE_SORT
727#include "array_utilities_pre.F90"
728
730INTERFACE to_char
731 MODULE PROCEDURE to_char_ana
732END INTERFACE
733
735INTERFACE display
736 MODULE PROCEDURE display_ana
737END INTERFACE
738
739CONTAINS
740
744SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
745TYPE(vol7d_ana),INTENT(INOUT) :: this
746REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
747REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
748CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
749INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
750INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
751
752CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
753IF (PRESENT(ident)) THEN
754 this%ident = ident
755ELSE
756 this%ident = cmiss
757ENDIF
758
759END SUBROUTINE vol7d_ana_init
760
761
763SUBROUTINE vol7d_ana_delete(this)
764TYPE(vol7d_ana),INTENT(INOUT) :: this
765
766CALL delete(this%coord)
767this%ident = cmiss
768
769END SUBROUTINE vol7d_ana_delete
770
771
772
773character(len=80) function to_char_ana(this)
774
775TYPE(vol7d_ana),INTENT(in) :: this
776
777to_char_ana="ANA: "//&
778 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
779 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
780 t2c(this%ident,miss="Missing ident")
781
782return
783
784end function to_char_ana
785
786
787subroutine display_ana(this)
788
789TYPE(vol7d_ana),INTENT(in) :: this
790
791print*, trim(to_char(this))
792
793end subroutine display_ana
794
795
796ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
797TYPE(vol7d_ana),INTENT(IN) :: this, that
798LOGICAL :: res
799
800res = this%coord == that%coord .AND. this%ident == that%ident
801
802END FUNCTION vol7d_ana_eq
803
804
805ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
806TYPE(vol7d_ana),INTENT(IN) :: this, that
807LOGICAL :: res
808
809res = .NOT.(this == that)
810
811END FUNCTION vol7d_ana_ne
812
813
814ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
815TYPE(vol7d_ana),INTENT(IN) :: this, that
816LOGICAL :: res
817
818res = this%ident > that%ident
819
820if ( this%ident == that%ident) then
821 res =this%coord > that%coord
822end if
823
824END FUNCTION vol7d_ana_gt
825
826
827ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
828TYPE(vol7d_ana),INTENT(IN) :: this, that
829LOGICAL :: res
830
831res = .not. this < that
832
833END FUNCTION vol7d_ana_ge
834
835
836ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
837TYPE(vol7d_ana),INTENT(IN) :: this, that
838LOGICAL :: res
839
840res = this%ident < that%ident
841
842if ( this%ident == that%ident) then
843 res = this%coord < that%coord
844end if
845
846END FUNCTION vol7d_ana_lt
847
848
849ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
850TYPE(vol7d_ana),INTENT(IN) :: this, that
851LOGICAL :: res
852
853res = .not. (this > that)
854
855END FUNCTION vol7d_ana_le
856
857
858
859ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
860TYPE(vol7d_ana),INTENT(IN) :: this
861LOGICAL :: c_e
862c_e = this /= vol7d_ana_miss
863END FUNCTION vol7d_ana_c_e
864
865
870SUBROUTINE vol7d_ana_read_unit(this, unit)
871TYPE(vol7d_ana),INTENT(out) :: this
872INTEGER, INTENT(in) :: unit
873
874CALL vol7d_ana_vect_read_unit((/this/), unit)
875
876END SUBROUTINE vol7d_ana_read_unit
877
878
883SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
884TYPE(vol7d_ana) :: this(:)
885INTEGER, INTENT(in) :: unit
886
887CHARACTER(len=40) :: form
888
889CALL read_unit(this%coord, unit)
890INQUIRE(unit, form=form)
891IF (form == 'FORMATTED') THEN
892 READ(unit,'(A)')this(:)%ident
893ELSE
894 READ(unit)this(:)%ident
895ENDIF
896
897END SUBROUTINE vol7d_ana_vect_read_unit
898
899
904SUBROUTINE vol7d_ana_write_unit(this, unit)
905TYPE(vol7d_ana),INTENT(in) :: this
906INTEGER, INTENT(in) :: unit
907
908CALL vol7d_ana_vect_write_unit((/this/), unit)
909
910END SUBROUTINE vol7d_ana_write_unit
911
912
917SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
918TYPE(vol7d_ana),INTENT(in) :: this(:)
919INTEGER, INTENT(in) :: unit
920
921CHARACTER(len=40) :: form
922
923CALL write_unit(this%coord, unit)
924INQUIRE(unit, form=form)
925IF (form == 'FORMATTED') THEN
926 WRITE(unit,'(A)')this(:)%ident
927ELSE
928 WRITE(unit)this(:)%ident
929ENDIF
930
931END SUBROUTINE vol7d_ana_vect_write_unit
932
933
934#include "array_utilities_inc.F90"
935
936
937END 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:245
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.