libsim Versione 7.1.11

◆ count_distinct_ana()

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

conta gli elementi distinti in vect

Definizione alla linea 641 del file vol7d_ana_class.F90.

642! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
643! authors:
644! Davide Cesari <dcesari@arpa.emr.it>
645! Paolo Patruno <ppatruno@arpa.emr.it>
646
647! This program is free software; you can redistribute it and/or
648! modify it under the terms of the GNU General Public License as
649! published by the Free Software Foundation; either version 2 of
650! the License, or (at your option) any later version.
651
652! This program is distributed in the hope that it will be useful,
653! but WITHOUT ANY WARRANTY; without even the implied warranty of
654! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
655! GNU General Public License for more details.
656
657! You should have received a copy of the GNU General Public License
658! along with this program. If not, see <http://www.gnu.org/licenses/>.
659#include "config.h"
660
665MODULE vol7d_ana_class
666USE kinds
669IMPLICIT NONE
670
672INTEGER,PARAMETER :: vol7d_ana_lenident=20
673
678TYPE vol7d_ana
679 TYPE(geo_coord) :: coord
680 CHARACTER(len=vol7d_ana_lenident) :: ident
681END TYPE vol7d_ana
682
684TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
685
689INTERFACE init
690 MODULE PROCEDURE vol7d_ana_init
691END INTERFACE
692
695INTERFACE delete
696 MODULE PROCEDURE vol7d_ana_delete
697END INTERFACE
698
702INTERFACE OPERATOR (==)
703 MODULE PROCEDURE vol7d_ana_eq
704END INTERFACE
705
709INTERFACE OPERATOR (/=)
710 MODULE PROCEDURE vol7d_ana_ne
711END INTERFACE
712
713
718INTERFACE OPERATOR (>)
719 MODULE PROCEDURE vol7d_ana_gt
720END INTERFACE
721
726INTERFACE OPERATOR (<)
727 MODULE PROCEDURE vol7d_ana_lt
728END INTERFACE
729
734INTERFACE OPERATOR (>=)
735 MODULE PROCEDURE vol7d_ana_ge
736END INTERFACE
737
742INTERFACE OPERATOR (<=)
743 MODULE PROCEDURE vol7d_ana_le
744END INTERFACE
745
746
748INTERFACE c_e
749 MODULE PROCEDURE vol7d_ana_c_e
750END INTERFACE
751
754INTERFACE read_unit
755 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
756END INTERFACE
757
760INTERFACE write_unit
761 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
762END INTERFACE
763
764#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
765#define VOL7D_POLY_TYPES _ana
766#define ENABLE_SORT
767#include "array_utilities_pre.F90"
768
770INTERFACE to_char
771 MODULE PROCEDURE to_char_ana
772END INTERFACE
773
775INTERFACE display
776 MODULE PROCEDURE display_ana
777END INTERFACE
778
779CONTAINS
780
784SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
785TYPE(vol7d_ana),INTENT(INOUT) :: this
786REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
787REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
788CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
789INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
790INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
791
792CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
793IF (PRESENT(ident)) THEN
794 this%ident = ident
795ELSE
796 this%ident = cmiss
797ENDIF
798
799END SUBROUTINE vol7d_ana_init
800
801
803SUBROUTINE vol7d_ana_delete(this)
804TYPE(vol7d_ana),INTENT(INOUT) :: this
805
806CALL delete(this%coord)
807this%ident = cmiss
808
809END SUBROUTINE vol7d_ana_delete
810
811
812
813character(len=80) function to_char_ana(this)
814
815TYPE(vol7d_ana),INTENT(in) :: this
816
817to_char_ana="ANA: "//&
818 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
819 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
820 t2c(this%ident,miss="Missing ident")
821
822return
823
824end function to_char_ana
825
826
827subroutine display_ana(this)
828
829TYPE(vol7d_ana),INTENT(in) :: this
830
831print*, trim(to_char(this))
832
833end subroutine display_ana
834
835
836ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
837TYPE(vol7d_ana),INTENT(IN) :: this, that
838LOGICAL :: res
839
840res = this%coord == that%coord .AND. this%ident == that%ident
841
842END FUNCTION vol7d_ana_eq
843
844
845ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
846TYPE(vol7d_ana),INTENT(IN) :: this, that
847LOGICAL :: res
848
849res = .NOT.(this == that)
850
851END FUNCTION vol7d_ana_ne
852
853
854ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
855TYPE(vol7d_ana),INTENT(IN) :: this, that
856LOGICAL :: res
857
858res = this%ident > that%ident
859
860if ( this%ident == that%ident) then
861 res =this%coord > that%coord
862end if
863
864END FUNCTION vol7d_ana_gt
865
866
867ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
868TYPE(vol7d_ana),INTENT(IN) :: this, that
869LOGICAL :: res
870
871res = .not. this < that
872
873END FUNCTION vol7d_ana_ge
874
875
876ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
877TYPE(vol7d_ana),INTENT(IN) :: this, that
878LOGICAL :: res
879
880res = this%ident < that%ident
881
882if ( this%ident == that%ident) then
883 res = this%coord < that%coord
884end if
885
886END FUNCTION vol7d_ana_lt
887
888
889ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
890TYPE(vol7d_ana),INTENT(IN) :: this, that
891LOGICAL :: res
892
893res = .not. (this > that)
894
895END FUNCTION vol7d_ana_le
896
897
898
899ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
900TYPE(vol7d_ana),INTENT(IN) :: this
901LOGICAL :: c_e
902c_e = this /= vol7d_ana_miss
903END FUNCTION vol7d_ana_c_e
904
905
910SUBROUTINE vol7d_ana_read_unit(this, unit)
911TYPE(vol7d_ana),INTENT(out) :: this
912INTEGER, INTENT(in) :: unit
913
914CALL vol7d_ana_vect_read_unit((/this/), unit)
915
916END SUBROUTINE vol7d_ana_read_unit
917
918
923SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
924TYPE(vol7d_ana) :: this(:)
925INTEGER, INTENT(in) :: unit
926
927CHARACTER(len=40) :: form
928
929CALL read_unit(this%coord, unit)
930INQUIRE(unit, form=form)
931IF (form == 'FORMATTED') THEN
932 READ(unit,'(A)')this(:)%ident
933ELSE
934 READ(unit)this(:)%ident
935ENDIF
936
937END SUBROUTINE vol7d_ana_vect_read_unit
938
939
944SUBROUTINE vol7d_ana_write_unit(this, unit)
945TYPE(vol7d_ana),INTENT(in) :: this
946INTEGER, INTENT(in) :: unit
947
948CALL vol7d_ana_vect_write_unit((/this/), unit)
949
950END SUBROUTINE vol7d_ana_write_unit
951
952
957SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
958TYPE(vol7d_ana),INTENT(in) :: this(:)
959INTEGER, INTENT(in) :: unit
960
961CHARACTER(len=40) :: form
962
963CALL write_unit(this%coord, unit)
964INQUIRE(unit, form=form)
965IF (form == 'FORMATTED') THEN
966 WRITE(unit,'(A)')this(:)%ident
967ELSE
968 WRITE(unit)this(:)%ident
969ENDIF
970
971END SUBROUTINE vol7d_ana_vect_write_unit
972
973
974#include "array_utilities_inc.F90"
975
976
977END 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.