libsim Versione 7.1.11

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

720! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
721! authors:
722! Davide Cesari <dcesari@arpa.emr.it>
723! Paolo Patruno <ppatruno@arpa.emr.it>
724
725! This program is free software; you can redistribute it and/or
726! modify it under the terms of the GNU General Public License as
727! published by the Free Software Foundation; either version 2 of
728! the License, or (at your option) any later version.
729
730! This program is distributed in the hope that it will be useful,
731! but WITHOUT ANY WARRANTY; without even the implied warranty of
732! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
733! GNU General Public License for more details.
734
735! You should have received a copy of the GNU General Public License
736! along with this program. If not, see <http://www.gnu.org/licenses/>.
737#include "config.h"
738
743MODULE vol7d_ana_class
744USE kinds
747IMPLICIT NONE
748
750INTEGER,PARAMETER :: vol7d_ana_lenident=20
751
756TYPE vol7d_ana
757 TYPE(geo_coord) :: coord
758 CHARACTER(len=vol7d_ana_lenident) :: ident
759END TYPE vol7d_ana
760
762TYPE(vol7d_ana),PARAMETER :: vol7d_ana_miss=vol7d_ana(geo_coord_miss,cmiss)
763
767INTERFACE init
768 MODULE PROCEDURE vol7d_ana_init
769END INTERFACE
770
773INTERFACE delete
774 MODULE PROCEDURE vol7d_ana_delete
775END INTERFACE
776
780INTERFACE OPERATOR (==)
781 MODULE PROCEDURE vol7d_ana_eq
782END INTERFACE
783
787INTERFACE OPERATOR (/=)
788 MODULE PROCEDURE vol7d_ana_ne
789END INTERFACE
790
791
796INTERFACE OPERATOR (>)
797 MODULE PROCEDURE vol7d_ana_gt
798END INTERFACE
799
804INTERFACE OPERATOR (<)
805 MODULE PROCEDURE vol7d_ana_lt
806END INTERFACE
807
812INTERFACE OPERATOR (>=)
813 MODULE PROCEDURE vol7d_ana_ge
814END INTERFACE
815
820INTERFACE OPERATOR (<=)
821 MODULE PROCEDURE vol7d_ana_le
822END INTERFACE
823
824
826INTERFACE c_e
827 MODULE PROCEDURE vol7d_ana_c_e
828END INTERFACE
829
832INTERFACE read_unit
833 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
834END INTERFACE
835
838INTERFACE write_unit
839 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
840END INTERFACE
841
842#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
843#define VOL7D_POLY_TYPES _ana
844#define ENABLE_SORT
845#include "array_utilities_pre.F90"
846
848INTERFACE to_char
849 MODULE PROCEDURE to_char_ana
850END INTERFACE
851
853INTERFACE display
854 MODULE PROCEDURE display_ana
855END INTERFACE
856
857CONTAINS
858
862SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
863TYPE(vol7d_ana),INTENT(INOUT) :: this
864REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon
865REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat
866CHARACTER(len=*),INTENT(in),OPTIONAL :: ident
867INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon
868INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat
869
870CALL init(this%coord, lon=lon, lat=lat , ilon=ilon, ilat=ilat)
871IF (PRESENT(ident)) THEN
872 this%ident = ident
873ELSE
874 this%ident = cmiss
875ENDIF
876
877END SUBROUTINE vol7d_ana_init
878
879
881SUBROUTINE vol7d_ana_delete(this)
882TYPE(vol7d_ana),INTENT(INOUT) :: this
883
884CALL delete(this%coord)
885this%ident = cmiss
886
887END SUBROUTINE vol7d_ana_delete
888
889
890
891character(len=80) function to_char_ana(this)
892
893TYPE(vol7d_ana),INTENT(in) :: this
894
895to_char_ana="ANA: "//&
896 to_char(getlon(this%coord),miss="Missing lon",form="(f11.5)")//&
897 to_char(getlat(this%coord),miss="Missing lat",form="(f11.5)")//&
898 t2c(this%ident,miss="Missing ident")
899
900return
901
902end function to_char_ana
903
904
905subroutine display_ana(this)
906
907TYPE(vol7d_ana),INTENT(in) :: this
908
909print*, trim(to_char(this))
910
911end subroutine display_ana
912
913
914ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
915TYPE(vol7d_ana),INTENT(IN) :: this, that
916LOGICAL :: res
917
918res = this%coord == that%coord .AND. this%ident == that%ident
919
920END FUNCTION vol7d_ana_eq
921
922
923ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
924TYPE(vol7d_ana),INTENT(IN) :: this, that
925LOGICAL :: res
926
927res = .NOT.(this == that)
928
929END FUNCTION vol7d_ana_ne
930
931
932ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
933TYPE(vol7d_ana),INTENT(IN) :: this, that
934LOGICAL :: res
935
936res = this%ident > that%ident
937
938if ( this%ident == that%ident) then
939 res =this%coord > that%coord
940end if
941
942END FUNCTION vol7d_ana_gt
943
944
945ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
946TYPE(vol7d_ana),INTENT(IN) :: this, that
947LOGICAL :: res
948
949res = .not. this < that
950
951END FUNCTION vol7d_ana_ge
952
953
954ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
955TYPE(vol7d_ana),INTENT(IN) :: this, that
956LOGICAL :: res
957
958res = this%ident < that%ident
959
960if ( this%ident == that%ident) then
961 res = this%coord < that%coord
962end if
963
964END FUNCTION vol7d_ana_lt
965
966
967ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
968TYPE(vol7d_ana),INTENT(IN) :: this, that
969LOGICAL :: res
970
971res = .not. (this > that)
972
973END FUNCTION vol7d_ana_le
974
975
976
977ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
978TYPE(vol7d_ana),INTENT(IN) :: this
979LOGICAL :: c_e
980c_e = this /= vol7d_ana_miss
981END FUNCTION vol7d_ana_c_e
982
983
988SUBROUTINE vol7d_ana_read_unit(this, unit)
989TYPE(vol7d_ana),INTENT(out) :: this
990INTEGER, INTENT(in) :: unit
991
992CALL vol7d_ana_vect_read_unit((/this/), unit)
993
994END SUBROUTINE vol7d_ana_read_unit
995
996
1001SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
1002TYPE(vol7d_ana) :: this(:)
1003INTEGER, INTENT(in) :: unit
1004
1005CHARACTER(len=40) :: form
1006
1007CALL read_unit(this%coord, unit)
1008INQUIRE(unit, form=form)
1009IF (form == 'FORMATTED') THEN
1010 READ(unit,'(A)')this(:)%ident
1011ELSE
1012 READ(unit)this(:)%ident
1013ENDIF
1014
1015END SUBROUTINE vol7d_ana_vect_read_unit
1016
1017
1022SUBROUTINE vol7d_ana_write_unit(this, unit)
1023TYPE(vol7d_ana),INTENT(in) :: this
1024INTEGER, INTENT(in) :: unit
1025
1026CALL vol7d_ana_vect_write_unit((/this/), unit)
1027
1028END SUBROUTINE vol7d_ana_write_unit
1029
1030
1035SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
1036TYPE(vol7d_ana),INTENT(in) :: this(:)
1037INTEGER, INTENT(in) :: unit
1038
1039CHARACTER(len=40) :: form
1040
1041CALL write_unit(this%coord, unit)
1042INQUIRE(unit, form=form)
1043IF (form == 'FORMATTED') THEN
1044 WRITE(unit,'(A)')this(:)%ident
1045ELSE
1046 WRITE(unit)this(:)%ident
1047ENDIF
1048
1049END SUBROUTINE vol7d_ana_vect_write_unit
1050
1051
1052#include "array_utilities_inc.F90"
1053
1054
1055END 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.