libsim Versione 7.2.0

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

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