libsim Versione 7.2.4
|
◆ arraysize
current logical size of the array; it may be different from the physical size Definizione alla linea 408 del file vol7d_timerange_class.F90. 408! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
409! authors:
410! Davide Cesari <dcesari@arpa.emr.it>
411! Paolo Patruno <ppatruno@arpa.emr.it>
412
413! This program is free software; you can redistribute it and/or
414! modify it under the terms of the GNU General Public License as
415! published by the Free Software Foundation; either version 2 of
416! the License, or (at your option) any later version.
417
418! This program is distributed in the hope that it will be useful,
419! but WITHOUT ANY WARRANTY; without even the implied warranty of
420! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
421! GNU General Public License for more details.
422
423! You should have received a copy of the GNU General Public License
424! along with this program. If not, see <http://www.gnu.org/licenses/>.
425#include "config.h"
426
438IMPLICIT NONE
439
445 INTEGER :: timerange
446 INTEGER :: p1
447 INTEGER :: p2
449
451TYPE(vol7d_timerange),PARAMETER :: vol7d_timerange_miss= &
452 vol7d_timerange(imiss,imiss,imiss)
453
458 MODULE PROCEDURE vol7d_timerange_init
459END INTERFACE
460
464 MODULE PROCEDURE vol7d_timerange_delete
465END INTERFACE
466
470INTERFACE OPERATOR (==)
471 MODULE PROCEDURE vol7d_timerange_eq
472END INTERFACE
473
477INTERFACE OPERATOR (/=)
478 MODULE PROCEDURE vol7d_timerange_ne
479END INTERFACE
480
484INTERFACE OPERATOR (>)
485 MODULE PROCEDURE vol7d_timerange_gt
486END INTERFACE
487
491INTERFACE OPERATOR (<)
492 MODULE PROCEDURE vol7d_timerange_lt
493END INTERFACE
494
498INTERFACE OPERATOR (>=)
499 MODULE PROCEDURE vol7d_timerange_ge
500END INTERFACE
501
505INTERFACE OPERATOR (<=)
506 MODULE PROCEDURE vol7d_timerange_le
507END INTERFACE
508
511INTERFACE OPERATOR (.almosteq.)
512 MODULE PROCEDURE vol7d_timerange_almost_eq
513END INTERFACE
514
515
516! da documentare in inglese assieme al resto
519 MODULE PROCEDURE vol7d_timerange_c_e
520END INTERFACE
521
522#define VOL7D_POLY_TYPE TYPE(vol7d_timerange)
523#define VOL7D_POLY_TYPES _timerange
524#define ENABLE_SORT
525#include "array_utilities_pre.F90"
526
529 MODULE PROCEDURE display_timerange
530END INTERFACE
531
534 MODULE PROCEDURE to_char_timerange
535END INTERFACE
536
537#define ARRAYOF_ORIGTYPE TYPE(vol7d_timerange)
538#define ARRAYOF_TYPE arrayof_vol7d_timerange
539#define ARRAYOF_ORIGEQ 1
540#include "arrayof_pre.F90"
541
542
543type(vol7d_timerange) :: almost_equal_timeranges(2)=(/&
544 vol7d_timerange(254,0,imiss),&
545 vol7d_timerange(3,0,3600)/)
546
547
548! from arrayof
550PUBLIC insert_unique, append_unique
551PUBLIC almost_equal_timeranges
552
553CONTAINS
554
555
561FUNCTION vol7d_timerange_new(timerange, p1, p2) RESULT(this)
562INTEGER,INTENT(IN),OPTIONAL :: timerange
563INTEGER,INTENT(IN),OPTIONAL :: p1
564INTEGER,INTENT(IN),OPTIONAL :: p2
565
566TYPE(vol7d_timerange) :: this
567
569
570END FUNCTION vol7d_timerange_new
571
572
576SUBROUTINE vol7d_timerange_init(this, timerange, p1, p2)
577TYPE(vol7d_timerange),INTENT(INOUT) :: this
578INTEGER,INTENT(IN),OPTIONAL :: timerange
579INTEGER,INTENT(IN),OPTIONAL :: p1
580INTEGER,INTENT(IN),OPTIONAL :: p2
581
582IF (PRESENT(timerange)) THEN
583 this%timerange = timerange
584ELSE
585 this%timerange = imiss
586 this%p1 = imiss
587 this%p2 = imiss
588 RETURN
589ENDIF
590!!$IF (timerange == 1) THEN ! p1 sempre 0
591!!$ this%p1 = 0
592!!$ this%p2 = imiss
593!!$ELSE IF (timerange == 0 .OR. timerange == 10) THEN ! solo p1
594!!$ IF (PRESENT(p1)) THEN
595!!$ this%p1 = p1
596!!$ ELSE
597!!$ this%p1 = 0
598!!$ ENDIF
599!!$ this%p2 = imiss
600!!$ELSE ! tutti gli altri
601 IF (PRESENT(p1)) THEN
602 this%p1 = p1
603 ELSE
604 this%p1 = imiss
605 ENDIF
606 IF (PRESENT(p2)) THEN
607 this%p2 = p2
608 ELSE
609 this%p2 = imiss
610 ENDIF
611!!$END IF
612
613END SUBROUTINE vol7d_timerange_init
614
615
617SUBROUTINE vol7d_timerange_delete(this)
618TYPE(vol7d_timerange),INTENT(INOUT) :: this
619
620this%timerange = imiss
621this%p1 = imiss
622this%p2 = imiss
623
624END SUBROUTINE vol7d_timerange_delete
625
626
627SUBROUTINE display_timerange(this)
628TYPE(vol7d_timerange),INTENT(in) :: this
629
630print*,to_char_timerange(this)
631
632END SUBROUTINE display_timerange
633
634
635FUNCTION to_char_timerange(this)
636#ifdef HAVE_DBALLE
637USE dballef
638#endif
639TYPE(vol7d_timerange),INTENT(in) :: this
640CHARACTER(len=80) :: to_char_timerange
641
642#ifdef HAVE_DBALLE
643INTEGER :: handle, ier
644
645handle = 0
646ier = idba_messaggi(handle,"/dev/null", "w", "BUFR")
647ier = idba_spiegat(handle,this%timerange,this%p1,this%p2,to_char_timerange)
648ier = idba_fatto(handle)
649
650to_char_timerange="Timerange: "//to_char_timerange
651
652#else
653
656
657#endif
658
659END FUNCTION to_char_timerange
660
661
662ELEMENTAL FUNCTION vol7d_timerange_eq(this, that) RESULT(res)
663TYPE(vol7d_timerange),INTENT(IN) :: this, that
664LOGICAL :: res
665
666
667res = &
668 this%timerange == that%timerange .AND. &
669 this%p1 == that%p1 .AND. (this%p2 == that%p2 .OR. &
670 this%timerange == 254)
671
672END FUNCTION vol7d_timerange_eq
673
674
675ELEMENTAL FUNCTION vol7d_timerange_almost_eq(this, that) RESULT(res)
676TYPE(vol7d_timerange),INTENT(IN) :: this, that
677LOGICAL :: res
678
679IF (.not. c_e(this%timerange) .or. .not. c_e(that%timerange) .or. this%timerange == that%timerange .AND. &
680 this%p1 == that%p1 .AND. &
681 this%p2 == that%p2) THEN
682 res = .true.
683ELSE
684 res = .false.
685ENDIF
686
687END FUNCTION vol7d_timerange_almost_eq
688
689
690ELEMENTAL FUNCTION vol7d_timerange_ne(this, that) RESULT(res)
691TYPE(vol7d_timerange),INTENT(IN) :: this, that
692LOGICAL :: res
693
694res = .NOT.(this == that)
695
696END FUNCTION vol7d_timerange_ne
697
698
699ELEMENTAL FUNCTION vol7d_timerange_gt(this, that) RESULT(res)
700TYPE(vol7d_timerange),INTENT(IN) :: this, that
701LOGICAL :: res
702
703IF (this%timerange > that%timerange .OR. &
704 (this%timerange == that%timerange .AND. this%p1 > that%p1) .OR. &
705 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
706 this%p2 > that%p2)) THEN
707 res = .true.
708ELSE
709 res = .false.
710ENDIF
711
712END FUNCTION vol7d_timerange_gt
713
714
715ELEMENTAL FUNCTION vol7d_timerange_lt(this, that) RESULT(res)
716TYPE(vol7d_timerange),INTENT(IN) :: this, that
717LOGICAL :: res
718
719IF (this%timerange < that%timerange .OR. &
720 (this%timerange == that%timerange .AND. this%p1 < that%p1) .OR. &
721 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
722 this%p2 < that%p2)) THEN
723 res = .true.
724ELSE
725 res = .false.
726ENDIF
727
728END FUNCTION vol7d_timerange_lt
729
730
731ELEMENTAL FUNCTION vol7d_timerange_ge(this, that) RESULT(res)
732TYPE(vol7d_timerange),INTENT(IN) :: this, that
733LOGICAL :: res
734
735IF (this == that) THEN
736 res = .true.
737ELSE IF (this > that) THEN
738 res = .true.
739ELSE
740 res = .false.
741ENDIF
742
743END FUNCTION vol7d_timerange_ge
744
745
746ELEMENTAL FUNCTION vol7d_timerange_le(this, that) RESULT(res)
747TYPE(vol7d_timerange),INTENT(IN) :: this, that
748LOGICAL :: res
749
750IF (this == that) THEN
751 res = .true.
752ELSE IF (this < that) THEN
753 res = .true.
754ELSE
755 res = .false.
756ENDIF
757
758END FUNCTION vol7d_timerange_le
759
760
761ELEMENTAL FUNCTION vol7d_timerange_c_e(this) RESULT(c_e)
762TYPE(vol7d_timerange),INTENT(IN) :: this
763LOGICAL :: c_e
764c_e = this /= vol7d_timerange_miss
765END FUNCTION vol7d_timerange_c_e
766
767
768#include "array_utilities_inc.F90"
769
770#include "arrayof_post.F90"
771
772
Quick method to append an element to the array. Definition vol7d_timerange_class.F90:425 Distruttore per la classe vol7d_timerange. Definition vol7d_timerange_class.F90:244 Costruttore per la classe vol7d_timerange. Definition vol7d_timerange_class.F90:238 Method for inserting elements of the array at a desired position. Definition vol7d_timerange_class.F90:416 Method for packing the array object reducing at a minimum the memory occupation, without destroying i... Definition vol7d_timerange_class.F90:448 Method for removing elements of the array at a desired position. Definition vol7d_timerange_class.F90:431 Represent timerange object in a pretty string. Definition vol7d_timerange_class.F90:369 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. Definition missing_values.f90:50 Classe per la gestione degli intervalli temporali di osservazioni meteo e affini. Definition vol7d_timerange_class.F90:215 Definisce l'intervallo temporale di un'osservazione meteo. Definition vol7d_timerange_class.F90:225 |