libsim Versione 7.2.6

◆ pack_distinct_sorted_ana()

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

compatta gli elementi distinti di vect in un sorted array

Definizione alla linea 712 del file vol7d_ana_class.F90.

714! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
715! authors:
716! Davide Cesari <dcesari@arpa.emr.it>
717! Paolo Patruno <ppatruno@arpa.emr.it>
718
719! This program is free software; you can redistribute it and/or
720! modify it under the terms of the GNU General Public License as
721! published by the Free Software Foundation; either version 2 of
722! the License, or (at your option) any later version.
723
724! This program is distributed in the hope that it will be useful,
725! but WITHOUT ANY WARRANTY; without even the implied warranty of
726! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
727! GNU General Public License for more details.
728
729! You should have received a copy of the GNU General Public License
730! along with this program. If not, see <http://www.gnu.org/licenses/>.
731#include "config.h"
732
733!> Classe per la gestione dell'anagrafica di stazioni meteo e affini.
734!! Questo modulo definisce una classe in grado di rappresentare
735!! le caratteristiche di una stazione meteo fissa o mobile.
736!! \ingroup vol7d
737MODULE vol7d_ana_class
738USE kinds
741IMPLICIT NONE
742
743!> Lunghezza della stringa che indica l'identificativo del volo.
744INTEGER,PARAMETER :: vol7d_ana_lenident=20
745
746!> Definisce l'anagrafica di una stazione.
747!! I membri di \a vol7d_ana sono pubblici e quindi liberamente
748!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
749!! il costruttore ::init.
750TYPE vol7d_ana
751 TYPE(geo_coord) :: coord !< coordinata per una stazione fissa
752 CHARACTER(len=vol7d_ana_lenident) :: ident !< identificativo per una stazione mobile (es. aereo)
753END TYPE vol7d_ana
754
755!> Valore mancante per vo7d_ana.
756TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
757
758!> Costruttore per la classe vol7d_ana.
759!! Deve essere richiamato
760!! per tutti gli oggetti di questo tipo definiti in un programma.
761INTERFACE init
762 MODULE PROCEDURE vol7d_ana_init
763END INTERFACE
764
765!> Distruttore per la classe vol7d_ana.
766!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
767INTERFACE delete
768 MODULE PROCEDURE vol7d_ana_delete
769END INTERFACE
770
771!> Logical equality operator for objects of \a vol7d_ana class.
772!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
773!! of any shape.
774INTERFACE OPERATOR (==)
775 MODULE PROCEDURE vol7d_ana_eq
776END INTERFACE
777
778!> Logical inequality operator for objects of \a vol7d_ana class.
779!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
780!! of any shape.
781INTERFACE OPERATOR (/=)
782 MODULE PROCEDURE vol7d_ana_ne
783END INTERFACE
784
785
786!> Logical greater-than operator for objects of \a vol7d_ana class.
787!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
788!! of any shape.
789!! Comparison is performed first on \a ident, then on coord
790INTERFACE OPERATOR (>)
791 MODULE PROCEDURE vol7d_ana_gt
792END INTERFACE
793
794!> Logical less-than operator for objects of \a vol7d_ana class.
795!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
796!! of any shape.
797!! Comparison is performed first on \a ident, then on coord
798INTERFACE OPERATOR (<)
799 MODULE PROCEDURE vol7d_ana_lt
800END INTERFACE
801
802!> Logical greater-equal operator for objects of \a vol7d_ana class.
803!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
804!! of any shape.
805!! Comparison is performed first on \a ident, then on coord
806INTERFACE OPERATOR (>=)
807 MODULE PROCEDURE vol7d_ana_ge
808END INTERFACE
809
810!> Logical less-equal operator for objects of \a vol7d_ana class.
811!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
812!! of any shape.
813!! Comparison is performed first on \a ident, then on coord
814INTERFACE OPERATOR (<=)
815 MODULE PROCEDURE vol7d_ana_le
816END INTERFACE
817
818
819!> check for missing value
820INTERFACE c_e
821 MODULE PROCEDURE vol7d_ana_c_e
822END INTERFACE
823
824!> Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da
825!! un file \c FORMATTED o \c UNFORMATTED.
826INTERFACE read_unit
827 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
828END INTERFACE
829
830!> Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su
831!! un file \c FORMATTED o \c UNFORMATTED.
832INTERFACE write_unit
833 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
834END INTERFACE
835
836#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
837#define VOL7D_POLY_TYPES _ana
838#define ENABLE_SORT
839#include "array_utilities_pre.F90"
840
841!> Represent ana object in a pretty string
842INTERFACE to_char
843 MODULE PROCEDURE to_char_ana
844END INTERFACE
845
846!> Print object
847INTERFACE display
848 MODULE PROCEDURE display_ana
849END INTERFACE
850
851CONTAINS
852
853!> Inizializza un oggetto \a vol7d_ana con i parametri opzionali forniti.
854!! Se non viene passato nessun parametro opzionale l'oggetto è
855!! inizializzato a valore mancante.
856SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
857TYPE(vol7d_ana),INTENT(INOUT) :: this !< oggetto da inizializzare
858REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon !< longitudine
859REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat !< latitudine
860CHARACTER(len=*),INTENT(in),OPTIONAL :: ident !< identificativo del volo
861INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon !< integer longitude (nint(lon*1.d5)
862INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat !< integer latitude (nint(lat*1.d5)
863
864CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
865IF (PRESENT(ident)) THEN
866 this%ident = ident
867ELSE
868 this%ident = cmiss
869ENDIF
870
871END SUBROUTINE vol7d_ana_init
872
873
874!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
875SUBROUTINE vol7d_ana_delete(this)
876TYPE(vol7d_ana),INTENT(INOUT) :: this !< oggetto da distruggre
877
878CALL delete(this%coord)
879this%ident = cmiss
880
881END SUBROUTINE vol7d_ana_delete
882
883
884
885character(len=80) function to_char_ana(this)
886
887TYPE(vol7d_ana),INTENT(in) :: this
888
889to_char_ana="ANA: "//&
890 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
891 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
892 t2c(this%ident,miss="Missing ident")
893
894return
895
896end function to_char_ana
897
898
899subroutine display_ana(this)
900
901TYPE(vol7d_ana),INTENT(in) :: this
902
903print*, trim(to_char(this))
904
905end subroutine display_ana
906
907
908ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
909TYPE(vol7d_ana),INTENT(IN) :: this, that
910LOGICAL :: res
911
912res = this%coord == that%coord .AND. this%ident == that%ident
913
914END FUNCTION vol7d_ana_eq
915
916
917ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
918TYPE(vol7d_ana),INTENT(IN) :: this, that
919LOGICAL :: res
920
921res = .NOT.(this == that)
922
923END FUNCTION vol7d_ana_ne
924
925
926ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
927TYPE(vol7d_ana),INTENT(IN) :: this, that
928LOGICAL :: res
929
930res = this%ident > that%ident
931
932if ( this%ident == that%ident) then
933 res =this%coord > that%coord
934end if
935
936END FUNCTION vol7d_ana_gt
937
938
939ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
940TYPE(vol7d_ana),INTENT(IN) :: this, that
941LOGICAL :: res
942
943res = .not. this < that
944
945END FUNCTION vol7d_ana_ge
946
947
948ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
949TYPE(vol7d_ana),INTENT(IN) :: this, that
950LOGICAL :: res
951
952res = this%ident < that%ident
953
954if ( this%ident == that%ident) then
955 res = this%coord < that%coord
956end if
957
958END FUNCTION vol7d_ana_lt
959
960
961ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
962TYPE(vol7d_ana),INTENT(IN) :: this, that
963LOGICAL :: res
964
965res = .not. (this > that)
966
967END FUNCTION vol7d_ana_le
968
969
970
971ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
972TYPE(vol7d_ana),INTENT(IN) :: this
973LOGICAL :: c_e
974c_e = this /= vol7d_ana_miss
975END FUNCTION vol7d_ana_c_e
976
977
978!> This method reads from a Fortran file unit the contents of the
979!! object \a this. The record to be read must have been written with
980!! the ::write_unit method. The method works both on formatted and
981!! unformatted files.
982SUBROUTINE vol7d_ana_read_unit(this, unit)
983TYPE(vol7d_ana),INTENT(out) :: this !< object to be read
984INTEGER, INTENT(in) :: unit !< unit from which to read, it must be an opened Fortran file unit
985
986CALL vol7d_ana_vect_read_unit((/this/), unit)
987
988END SUBROUTINE vol7d_ana_read_unit
989
990
991!> This method reads from a Fortran file unit the contents of the
992!! object \a this. The record to be read must have been written with
993!! the ::write_unit method. The method works both on formatted and
994!! unformatted files.
995SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
996TYPE(vol7d_ana) :: this(:) !< object to be read
997INTEGER, INTENT(in) :: unit !< unit from which to read, it must be an opened Fortran file unit
998
999CHARACTER(len=40) :: form
1000
1001CALL read_unit(this%coord, unit)
1002INQUIRE(unit, form=form)
1003IF (form == 'FORMATTED') THEN
1004 READ(unit,'(A)')this(:)%ident
1005ELSE
1006 READ(unit)this(:)%ident
1007ENDIF
1008
1009END SUBROUTINE vol7d_ana_vect_read_unit
1010
1011
1012!> This method writes on a Fortran file unit the contents of the
1013!! object \a this. The record can successively be read by the
1014!! ::read_unit method. The method works both on formatted and
1015!! unformatted files.
1016SUBROUTINE vol7d_ana_write_unit(this, unit)
1017TYPE(vol7d_ana),INTENT(in) :: this !< object to be written
1018INTEGER, INTENT(in) :: unit !< unit where to write, it must be an opened Fortran file unit
1019
1020CALL vol7d_ana_vect_write_unit((/this/), unit)
1021
1022END SUBROUTINE vol7d_ana_write_unit
1023
1024
1025!> This method writes on a Fortran file unit the contents of the
1026!! object \a this. The record can successively be read by the
1027!! ::read_unit method. The method works both on formatted and
1028!! unformatted files.
1029SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
1030TYPE(vol7d_ana),INTENT(in) :: this(:) !< object to be written
1031INTEGER, INTENT(in) :: unit !< unit where to write, it must be an opened Fortran file unit
1032
1033CHARACTER(len=40) :: form
1034
1035CALL write_unit(this%coord, unit)
1036INQUIRE(unit, form=form)
1037IF (form == 'FORMATTED') THEN
1038 WRITE(unit,'(A)')this(:)%ident
1039ELSE
1040 WRITE(unit)this(:)%ident
1041ENDIF
1042
1043END SUBROUTINE vol7d_ana_vect_write_unit
1044
1045
1046#include "array_utilities_inc.F90"
1047
1048
1049END 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.