libsim Versione 7.2.1

◆ array

type(vol7d_timerange), dimension(:), pointer array =>NULL()

array of TYPE(vol7d_timerange)

Definizione alla linea 407 del file vol7d_timerange_class.F90.

407! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
408! authors:
409! Davide Cesari <dcesari@arpa.emr.it>
410! Paolo Patruno <ppatruno@arpa.emr.it>
411
412! This program is free software; you can redistribute it and/or
413! modify it under the terms of the GNU General Public License as
414! published by the Free Software Foundation; either version 2 of
415! the License, or (at your option) any later version.
416
417! This program is distributed in the hope that it will be useful,
418! but WITHOUT ANY WARRANTY; without even the implied warranty of
419! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
420! GNU General Public License for more details.
421
422! You should have received a copy of the GNU General Public License
423! along with this program. If not, see <http://www.gnu.org/licenses/>.
424#include "config.h"
425
434USE kinds
437IMPLICIT NONE
438
444 INTEGER :: timerange
445 INTEGER :: p1
446 INTEGER :: p2
447END TYPE vol7d_timerange
448
450TYPE(vol7d_timerange),PARAMETER :: vol7d_timerange_miss= &
451 vol7d_timerange(imiss,imiss,imiss)
452
456INTERFACE init
457 MODULE PROCEDURE vol7d_timerange_init
458END INTERFACE
459
462INTERFACE delete
463 MODULE PROCEDURE vol7d_timerange_delete
464END INTERFACE
465
469INTERFACE OPERATOR (==)
470 MODULE PROCEDURE vol7d_timerange_eq
471END INTERFACE
472
476INTERFACE OPERATOR (/=)
477 MODULE PROCEDURE vol7d_timerange_ne
478END INTERFACE
479
483INTERFACE OPERATOR (>)
484 MODULE PROCEDURE vol7d_timerange_gt
485END INTERFACE
486
490INTERFACE OPERATOR (<)
491 MODULE PROCEDURE vol7d_timerange_lt
492END INTERFACE
493
497INTERFACE OPERATOR (>=)
498 MODULE PROCEDURE vol7d_timerange_ge
499END INTERFACE
500
504INTERFACE OPERATOR (<=)
505 MODULE PROCEDURE vol7d_timerange_le
506END INTERFACE
507
510INTERFACE OPERATOR (.almosteq.)
511 MODULE PROCEDURE vol7d_timerange_almost_eq
512END INTERFACE
513
514
515! da documentare in inglese assieme al resto
517INTERFACE c_e
518 MODULE PROCEDURE vol7d_timerange_c_e
519END INTERFACE
520
521#define VOL7D_POLY_TYPE TYPE(vol7d_timerange)
522#define VOL7D_POLY_TYPES _timerange
523#define ENABLE_SORT
524#include "array_utilities_pre.F90"
525
527INTERFACE display
528 MODULE PROCEDURE display_timerange
529END INTERFACE
530
532INTERFACE to_char
533 MODULE PROCEDURE to_char_timerange
534END INTERFACE
535
536#define ARRAYOF_ORIGTYPE TYPE(vol7d_timerange)
537#define ARRAYOF_TYPE arrayof_vol7d_timerange
538#define ARRAYOF_ORIGEQ 1
539#include "arrayof_pre.F90"
540
541
542type(vol7d_timerange) :: almost_equal_timeranges(2)=(/&
543 vol7d_timerange(254,0,imiss),&
544 vol7d_timerange(3,0,3600)/)
545
546
547! from arrayof
549PUBLIC insert_unique, append_unique
550PUBLIC almost_equal_timeranges
551
552CONTAINS
553
554
560FUNCTION vol7d_timerange_new(timerange, p1, p2) RESULT(this)
561INTEGER,INTENT(IN),OPTIONAL :: timerange
562INTEGER,INTENT(IN),OPTIONAL :: p1
563INTEGER,INTENT(IN),OPTIONAL :: p2
564
565TYPE(vol7d_timerange) :: this
566
567CALL init(this, timerange, p1, p2)
568
569END FUNCTION vol7d_timerange_new
570
571
575SUBROUTINE vol7d_timerange_init(this, timerange, p1, p2)
576TYPE(vol7d_timerange),INTENT(INOUT) :: this
577INTEGER,INTENT(IN),OPTIONAL :: timerange
578INTEGER,INTENT(IN),OPTIONAL :: p1
579INTEGER,INTENT(IN),OPTIONAL :: p2
580
581IF (PRESENT(timerange)) THEN
582 this%timerange = timerange
583ELSE
584 this%timerange = imiss
585 this%p1 = imiss
586 this%p2 = imiss
587 RETURN
588ENDIF
589!!$IF (timerange == 1) THEN ! p1 sempre 0
590!!$ this%p1 = 0
591!!$ this%p2 = imiss
592!!$ELSE IF (timerange == 0 .OR. timerange == 10) THEN ! solo p1
593!!$ IF (PRESENT(p1)) THEN
594!!$ this%p1 = p1
595!!$ ELSE
596!!$ this%p1 = 0
597!!$ ENDIF
598!!$ this%p2 = imiss
599!!$ELSE ! tutti gli altri
600 IF (PRESENT(p1)) THEN
601 this%p1 = p1
602 ELSE
603 this%p1 = imiss
604 ENDIF
605 IF (PRESENT(p2)) THEN
606 this%p2 = p2
607 ELSE
608 this%p2 = imiss
609 ENDIF
610!!$END IF
611
612END SUBROUTINE vol7d_timerange_init
613
614
616SUBROUTINE vol7d_timerange_delete(this)
617TYPE(vol7d_timerange),INTENT(INOUT) :: this
618
619this%timerange = imiss
620this%p1 = imiss
621this%p2 = imiss
622
623END SUBROUTINE vol7d_timerange_delete
624
625
626SUBROUTINE display_timerange(this)
627TYPE(vol7d_timerange),INTENT(in) :: this
628
629print*,to_char_timerange(this)
630
631END SUBROUTINE display_timerange
632
633
634FUNCTION to_char_timerange(this)
635#ifdef HAVE_DBALLE
636USE dballef
637#endif
638TYPE(vol7d_timerange),INTENT(in) :: this
639CHARACTER(len=80) :: to_char_timerange
640
641#ifdef HAVE_DBALLE
642INTEGER :: handle, ier
643
644handle = 0
645ier = idba_messaggi(handle,"/dev/null", "w", "BUFR")
646ier = idba_spiegat(handle,this%timerange,this%p1,this%p2,to_char_timerange)
647ier = idba_fatto(handle)
648
649to_char_timerange="Timerange: "//to_char_timerange
650
651#else
652
653to_char_timerange="Timerange: "//trim(to_char(this%timerange))//" P1: "//&
654 trim(to_char(this%p1))//" P2: "//trim(to_char(this%p2))
655
656#endif
657
658END FUNCTION to_char_timerange
659
660
661ELEMENTAL FUNCTION vol7d_timerange_eq(this, that) RESULT(res)
662TYPE(vol7d_timerange),INTENT(IN) :: this, that
663LOGICAL :: res
664
665
666res = &
667 this%timerange == that%timerange .AND. &
668 this%p1 == that%p1 .AND. (this%p2 == that%p2 .OR. &
669 this%timerange == 254)
670
671END FUNCTION vol7d_timerange_eq
672
673
674ELEMENTAL FUNCTION vol7d_timerange_almost_eq(this, that) RESULT(res)
675TYPE(vol7d_timerange),INTENT(IN) :: this, that
676LOGICAL :: res
677
678IF (.not. c_e(this%timerange) .or. .not. c_e(that%timerange) .or. this%timerange == that%timerange .AND. &
679 this%p1 == that%p1 .AND. &
680 this%p2 == that%p2) THEN
681 res = .true.
682ELSE
683 res = .false.
684ENDIF
685
686END FUNCTION vol7d_timerange_almost_eq
687
688
689ELEMENTAL FUNCTION vol7d_timerange_ne(this, that) RESULT(res)
690TYPE(vol7d_timerange),INTENT(IN) :: this, that
691LOGICAL :: res
692
693res = .NOT.(this == that)
694
695END FUNCTION vol7d_timerange_ne
696
697
698ELEMENTAL FUNCTION vol7d_timerange_gt(this, that) RESULT(res)
699TYPE(vol7d_timerange),INTENT(IN) :: this, that
700LOGICAL :: res
701
702IF (this%timerange > that%timerange .OR. &
703 (this%timerange == that%timerange .AND. this%p1 > that%p1) .OR. &
704 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
705 this%p2 > that%p2)) THEN
706 res = .true.
707ELSE
708 res = .false.
709ENDIF
710
711END FUNCTION vol7d_timerange_gt
712
713
714ELEMENTAL FUNCTION vol7d_timerange_lt(this, that) RESULT(res)
715TYPE(vol7d_timerange),INTENT(IN) :: this, that
716LOGICAL :: res
717
718IF (this%timerange < that%timerange .OR. &
719 (this%timerange == that%timerange .AND. this%p1 < that%p1) .OR. &
720 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
721 this%p2 < that%p2)) THEN
722 res = .true.
723ELSE
724 res = .false.
725ENDIF
726
727END FUNCTION vol7d_timerange_lt
728
729
730ELEMENTAL FUNCTION vol7d_timerange_ge(this, that) RESULT(res)
731TYPE(vol7d_timerange),INTENT(IN) :: this, that
732LOGICAL :: res
733
734IF (this == that) THEN
735 res = .true.
736ELSE IF (this > that) THEN
737 res = .true.
738ELSE
739 res = .false.
740ENDIF
741
742END FUNCTION vol7d_timerange_ge
743
744
745ELEMENTAL FUNCTION vol7d_timerange_le(this, that) RESULT(res)
746TYPE(vol7d_timerange),INTENT(IN) :: this, that
747LOGICAL :: res
748
749IF (this == that) THEN
750 res = .true.
751ELSE IF (this < that) THEN
752 res = .true.
753ELSE
754 res = .false.
755ENDIF
756
757END FUNCTION vol7d_timerange_le
758
759
760ELEMENTAL FUNCTION vol7d_timerange_c_e(this) RESULT(c_e)
761TYPE(vol7d_timerange),INTENT(IN) :: this
762LOGICAL :: c_e
763c_e = this /= vol7d_timerange_miss
764END FUNCTION vol7d_timerange_c_e
765
766
767#include "array_utilities_inc.F90"
768
769#include "arrayof_post.F90"
770
771
772END 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:245
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.