libsim Versione 7.1.11

◆ vol7d_timerange_delete()

subroutine vol7d_timerange_delete ( type(vol7d_timerange), intent(inout)  this)

Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.

Definizione alla linea 569 del file vol7d_timerange_class.F90.

570! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
571! authors:
572! Davide Cesari <dcesari@arpa.emr.it>
573! Paolo Patruno <ppatruno@arpa.emr.it>
574
575! This program is free software; you can redistribute it and/or
576! modify it under the terms of the GNU General Public License as
577! published by the Free Software Foundation; either version 2 of
578! the License, or (at your option) any later version.
579
580! This program is distributed in the hope that it will be useful,
581! but WITHOUT ANY WARRANTY; without even the implied warranty of
582! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
583! GNU General Public License for more details.
584
585! You should have received a copy of the GNU General Public License
586! along with this program. If not, see <http://www.gnu.org/licenses/>.
587#include "config.h"
588
597USE kinds
600IMPLICIT NONE
601
607 INTEGER :: timerange
608 INTEGER :: p1
609 INTEGER :: p2
610END TYPE vol7d_timerange
611
613TYPE(vol7d_timerange),PARAMETER :: vol7d_timerange_miss= &
614 vol7d_timerange(imiss,imiss,imiss)
615
619INTERFACE init
620 MODULE PROCEDURE vol7d_timerange_init
621END INTERFACE
622
625INTERFACE delete
626 MODULE PROCEDURE vol7d_timerange_delete
627END INTERFACE
628
632INTERFACE OPERATOR (==)
633 MODULE PROCEDURE vol7d_timerange_eq
634END INTERFACE
635
639INTERFACE OPERATOR (/=)
640 MODULE PROCEDURE vol7d_timerange_ne
641END INTERFACE
642
646INTERFACE OPERATOR (>)
647 MODULE PROCEDURE vol7d_timerange_gt
648END INTERFACE
649
653INTERFACE OPERATOR (<)
654 MODULE PROCEDURE vol7d_timerange_lt
655END INTERFACE
656
660INTERFACE OPERATOR (>=)
661 MODULE PROCEDURE vol7d_timerange_ge
662END INTERFACE
663
667INTERFACE OPERATOR (<=)
668 MODULE PROCEDURE vol7d_timerange_le
669END INTERFACE
670
673INTERFACE OPERATOR (.almosteq.)
674 MODULE PROCEDURE vol7d_timerange_almost_eq
675END INTERFACE
676
677
678! da documentare in inglese assieme al resto
680INTERFACE c_e
681 MODULE PROCEDURE vol7d_timerange_c_e
682END INTERFACE
683
684#define VOL7D_POLY_TYPE TYPE(vol7d_timerange)
685#define VOL7D_POLY_TYPES _timerange
686#define ENABLE_SORT
687#include "array_utilities_pre.F90"
688
690INTERFACE display
691 MODULE PROCEDURE display_timerange
692END INTERFACE
693
695INTERFACE to_char
696 MODULE PROCEDURE to_char_timerange
697END INTERFACE
698
699#define ARRAYOF_ORIGTYPE TYPE(vol7d_timerange)
700#define ARRAYOF_TYPE arrayof_vol7d_timerange
701#define ARRAYOF_ORIGEQ 1
702#include "arrayof_pre.F90"
703
704
705type(vol7d_timerange) :: almost_equal_timeranges(2)=(/&
706 vol7d_timerange(254,0,imiss),&
707 vol7d_timerange(3,0,3600)/)
708
709
710! from arrayof
712PUBLIC insert_unique, append_unique
713PUBLIC almost_equal_timeranges
714
715CONTAINS
716
717
723FUNCTION vol7d_timerange_new(timerange, p1, p2) RESULT(this)
724INTEGER,INTENT(IN),OPTIONAL :: timerange
725INTEGER,INTENT(IN),OPTIONAL :: p1
726INTEGER,INTENT(IN),OPTIONAL :: p2
727
728TYPE(vol7d_timerange) :: this
729
730CALL init(this, timerange, p1, p2)
731
732END FUNCTION vol7d_timerange_new
733
734
738SUBROUTINE vol7d_timerange_init(this, timerange, p1, p2)
739TYPE(vol7d_timerange),INTENT(INOUT) :: this
740INTEGER,INTENT(IN),OPTIONAL :: timerange
741INTEGER,INTENT(IN),OPTIONAL :: p1
742INTEGER,INTENT(IN),OPTIONAL :: p2
743
744IF (PRESENT(timerange)) THEN
745 this%timerange = timerange
746ELSE
747 this%timerange = imiss
748 this%p1 = imiss
749 this%p2 = imiss
750 RETURN
751ENDIF
752!!$IF (timerange == 1) THEN ! p1 sempre 0
753!!$ this%p1 = 0
754!!$ this%p2 = imiss
755!!$ELSE IF (timerange == 0 .OR. timerange == 10) THEN ! solo p1
756!!$ IF (PRESENT(p1)) THEN
757!!$ this%p1 = p1
758!!$ ELSE
759!!$ this%p1 = 0
760!!$ ENDIF
761!!$ this%p2 = imiss
762!!$ELSE ! tutti gli altri
763 IF (PRESENT(p1)) THEN
764 this%p1 = p1
765 ELSE
766 this%p1 = imiss
767 ENDIF
768 IF (PRESENT(p2)) THEN
769 this%p2 = p2
770 ELSE
771 this%p2 = imiss
772 ENDIF
773!!$END IF
774
775END SUBROUTINE vol7d_timerange_init
776
777
779SUBROUTINE vol7d_timerange_delete(this)
780TYPE(vol7d_timerange),INTENT(INOUT) :: this
781
782this%timerange = imiss
783this%p1 = imiss
784this%p2 = imiss
785
786END SUBROUTINE vol7d_timerange_delete
787
788
789SUBROUTINE display_timerange(this)
790TYPE(vol7d_timerange),INTENT(in) :: this
791
792print*,to_char_timerange(this)
793
794END SUBROUTINE display_timerange
795
796
797FUNCTION to_char_timerange(this)
798#ifdef HAVE_DBALLE
799USE dballef
800#endif
801TYPE(vol7d_timerange),INTENT(in) :: this
802CHARACTER(len=80) :: to_char_timerange
803
804#ifdef HAVE_DBALLE
805INTEGER :: handle, ier
806
807handle = 0
808ier = idba_messaggi(handle,"/dev/null", "w", "BUFR")
809ier = idba_spiegat(handle,this%timerange,this%p1,this%p2,to_char_timerange)
810ier = idba_fatto(handle)
811
812to_char_timerange="Timerange: "//to_char_timerange
813
814#else
815
816to_char_timerange="Timerange: "//trim(to_char(this%timerange))//" P1: "//&
817 trim(to_char(this%p1))//" P2: "//trim(to_char(this%p2))
818
819#endif
820
821END FUNCTION to_char_timerange
822
823
824ELEMENTAL FUNCTION vol7d_timerange_eq(this, that) RESULT(res)
825TYPE(vol7d_timerange),INTENT(IN) :: this, that
826LOGICAL :: res
827
828
829res = &
830 this%timerange == that%timerange .AND. &
831 this%p1 == that%p1 .AND. (this%p2 == that%p2 .OR. &
832 this%timerange == 254)
833
834END FUNCTION vol7d_timerange_eq
835
836
837ELEMENTAL FUNCTION vol7d_timerange_almost_eq(this, that) RESULT(res)
838TYPE(vol7d_timerange),INTENT(IN) :: this, that
839LOGICAL :: res
840
841IF (.not. c_e(this%timerange) .or. .not. c_e(that%timerange) .or. this%timerange == that%timerange .AND. &
842 this%p1 == that%p1 .AND. &
843 this%p2 == that%p2) THEN
844 res = .true.
845ELSE
846 res = .false.
847ENDIF
848
849END FUNCTION vol7d_timerange_almost_eq
850
851
852ELEMENTAL FUNCTION vol7d_timerange_ne(this, that) RESULT(res)
853TYPE(vol7d_timerange),INTENT(IN) :: this, that
854LOGICAL :: res
855
856res = .NOT.(this == that)
857
858END FUNCTION vol7d_timerange_ne
859
860
861ELEMENTAL FUNCTION vol7d_timerange_gt(this, that) RESULT(res)
862TYPE(vol7d_timerange),INTENT(IN) :: this, that
863LOGICAL :: res
864
865IF (this%timerange > that%timerange .OR. &
866 (this%timerange == that%timerange .AND. this%p1 > that%p1) .OR. &
867 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
868 this%p2 > that%p2)) THEN
869 res = .true.
870ELSE
871 res = .false.
872ENDIF
873
874END FUNCTION vol7d_timerange_gt
875
876
877ELEMENTAL FUNCTION vol7d_timerange_lt(this, that) RESULT(res)
878TYPE(vol7d_timerange),INTENT(IN) :: this, that
879LOGICAL :: res
880
881IF (this%timerange < that%timerange .OR. &
882 (this%timerange == that%timerange .AND. this%p1 < that%p1) .OR. &
883 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
884 this%p2 < that%p2)) THEN
885 res = .true.
886ELSE
887 res = .false.
888ENDIF
889
890END FUNCTION vol7d_timerange_lt
891
892
893ELEMENTAL FUNCTION vol7d_timerange_ge(this, that) RESULT(res)
894TYPE(vol7d_timerange),INTENT(IN) :: this, that
895LOGICAL :: res
896
897IF (this == that) THEN
898 res = .true.
899ELSE IF (this > that) THEN
900 res = .true.
901ELSE
902 res = .false.
903ENDIF
904
905END FUNCTION vol7d_timerange_ge
906
907
908ELEMENTAL FUNCTION vol7d_timerange_le(this, that) RESULT(res)
909TYPE(vol7d_timerange),INTENT(IN) :: this, that
910LOGICAL :: res
911
912IF (this == that) THEN
913 res = .true.
914ELSE IF (this < that) THEN
915 res = .true.
916ELSE
917 res = .false.
918ENDIF
919
920END FUNCTION vol7d_timerange_le
921
922
923ELEMENTAL FUNCTION vol7d_timerange_c_e(this) RESULT(c_e)
924TYPE(vol7d_timerange),INTENT(IN) :: this
925LOGICAL :: c_e
926c_e = this /= vol7d_timerange_miss
927END FUNCTION vol7d_timerange_c_e
928
929
930#include "array_utilities_inc.F90"
931
932#include "arrayof_post.F90"
933
934
935END MODULE vol7d_timerange_class
Quick method to append an element to the array.
Distruttore per la classe vol7d_timerange.
Costruttore per la classe vol7d_timerange.
Method for inserting elements of the array at a desired position.
Method for packing the array object reducing at a minimum the memory occupation, without destroying i...
Method for removing elements of the array at a desired position.
Represent timerange object in a pretty string.
Utilities for CHARACTER variables.
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 degli intervalli temporali di osservazioni meteo e affini.
Definisce l'intervallo temporale di un'osservazione meteo.

Generated with Doxygen.