libsim Versione 7.1.11
|
◆ overalloc
overallocation factor, values close to 1 determine more calls to the system alloc function (decreased performances) at the advantage of less memory consumption, the default is 2; the results are not affected by the value of this member Definizione alla linea 417 del file vol7d_timerange_class.F90. 417! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
418! authors:
419! Davide Cesari <dcesari@arpa.emr.it>
420! Paolo Patruno <ppatruno@arpa.emr.it>
421
422! This program is free software; you can redistribute it and/or
423! modify it under the terms of the GNU General Public License as
424! published by the Free Software Foundation; either version 2 of
425! the License, or (at your option) any later version.
426
427! This program is distributed in the hope that it will be useful,
428! but WITHOUT ANY WARRANTY; without even the implied warranty of
429! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
430! GNU General Public License for more details.
431
432! You should have received a copy of the GNU General Public License
433! along with this program. If not, see <http://www.gnu.org/licenses/>.
434#include "config.h"
435
447IMPLICIT NONE
448
454 INTEGER :: timerange
455 INTEGER :: p1
456 INTEGER :: p2
458
460TYPE(vol7d_timerange),PARAMETER :: vol7d_timerange_miss= &
461 vol7d_timerange(imiss,imiss,imiss)
462
467 MODULE PROCEDURE vol7d_timerange_init
468END INTERFACE
469
473 MODULE PROCEDURE vol7d_timerange_delete
474END INTERFACE
475
479INTERFACE OPERATOR (==)
480 MODULE PROCEDURE vol7d_timerange_eq
481END INTERFACE
482
486INTERFACE OPERATOR (/=)
487 MODULE PROCEDURE vol7d_timerange_ne
488END INTERFACE
489
493INTERFACE OPERATOR (>)
494 MODULE PROCEDURE vol7d_timerange_gt
495END INTERFACE
496
500INTERFACE OPERATOR (<)
501 MODULE PROCEDURE vol7d_timerange_lt
502END INTERFACE
503
507INTERFACE OPERATOR (>=)
508 MODULE PROCEDURE vol7d_timerange_ge
509END INTERFACE
510
514INTERFACE OPERATOR (<=)
515 MODULE PROCEDURE vol7d_timerange_le
516END INTERFACE
517
520INTERFACE OPERATOR (.almosteq.)
521 MODULE PROCEDURE vol7d_timerange_almost_eq
522END INTERFACE
523
524
525! da documentare in inglese assieme al resto
528 MODULE PROCEDURE vol7d_timerange_c_e
529END INTERFACE
530
531#define VOL7D_POLY_TYPE TYPE(vol7d_timerange)
532#define VOL7D_POLY_TYPES _timerange
533#define ENABLE_SORT
534#include "array_utilities_pre.F90"
535
538 MODULE PROCEDURE display_timerange
539END INTERFACE
540
543 MODULE PROCEDURE to_char_timerange
544END INTERFACE
545
546#define ARRAYOF_ORIGTYPE TYPE(vol7d_timerange)
547#define ARRAYOF_TYPE arrayof_vol7d_timerange
548#define ARRAYOF_ORIGEQ 1
549#include "arrayof_pre.F90"
550
551
552type(vol7d_timerange) :: almost_equal_timeranges(2)=(/&
553 vol7d_timerange(254,0,imiss),&
554 vol7d_timerange(3,0,3600)/)
555
556
557! from arrayof
559PUBLIC insert_unique, append_unique
560PUBLIC almost_equal_timeranges
561
562CONTAINS
563
564
570FUNCTION vol7d_timerange_new(timerange, p1, p2) RESULT(this)
571INTEGER,INTENT(IN),OPTIONAL :: timerange
572INTEGER,INTENT(IN),OPTIONAL :: p1
573INTEGER,INTENT(IN),OPTIONAL :: p2
574
575TYPE(vol7d_timerange) :: this
576
578
579END FUNCTION vol7d_timerange_new
580
581
585SUBROUTINE vol7d_timerange_init(this, timerange, p1, p2)
586TYPE(vol7d_timerange),INTENT(INOUT) :: this
587INTEGER,INTENT(IN),OPTIONAL :: timerange
588INTEGER,INTENT(IN),OPTIONAL :: p1
589INTEGER,INTENT(IN),OPTIONAL :: p2
590
591IF (PRESENT(timerange)) THEN
592 this%timerange = timerange
593ELSE
594 this%timerange = imiss
595 this%p1 = imiss
596 this%p2 = imiss
597 RETURN
598ENDIF
599!!$IF (timerange == 1) THEN ! p1 sempre 0
600!!$ this%p1 = 0
601!!$ this%p2 = imiss
602!!$ELSE IF (timerange == 0 .OR. timerange == 10) THEN ! solo p1
603!!$ IF (PRESENT(p1)) THEN
604!!$ this%p1 = p1
605!!$ ELSE
606!!$ this%p1 = 0
607!!$ ENDIF
608!!$ this%p2 = imiss
609!!$ELSE ! tutti gli altri
610 IF (PRESENT(p1)) THEN
611 this%p1 = p1
612 ELSE
613 this%p1 = imiss
614 ENDIF
615 IF (PRESENT(p2)) THEN
616 this%p2 = p2
617 ELSE
618 this%p2 = imiss
619 ENDIF
620!!$END IF
621
622END SUBROUTINE vol7d_timerange_init
623
624
626SUBROUTINE vol7d_timerange_delete(this)
627TYPE(vol7d_timerange),INTENT(INOUT) :: this
628
629this%timerange = imiss
630this%p1 = imiss
631this%p2 = imiss
632
633END SUBROUTINE vol7d_timerange_delete
634
635
636SUBROUTINE display_timerange(this)
637TYPE(vol7d_timerange),INTENT(in) :: this
638
639print*,to_char_timerange(this)
640
641END SUBROUTINE display_timerange
642
643
644FUNCTION to_char_timerange(this)
645#ifdef HAVE_DBALLE
646USE dballef
647#endif
648TYPE(vol7d_timerange),INTENT(in) :: this
649CHARACTER(len=80) :: to_char_timerange
650
651#ifdef HAVE_DBALLE
652INTEGER :: handle, ier
653
654handle = 0
655ier = idba_messaggi(handle,"/dev/null", "w", "BUFR")
656ier = idba_spiegat(handle,this%timerange,this%p1,this%p2,to_char_timerange)
657ier = idba_fatto(handle)
658
659to_char_timerange="Timerange: "//to_char_timerange
660
661#else
662
665
666#endif
667
668END FUNCTION to_char_timerange
669
670
671ELEMENTAL FUNCTION vol7d_timerange_eq(this, that) RESULT(res)
672TYPE(vol7d_timerange),INTENT(IN) :: this, that
673LOGICAL :: res
674
675
676res = &
677 this%timerange == that%timerange .AND. &
678 this%p1 == that%p1 .AND. (this%p2 == that%p2 .OR. &
679 this%timerange == 254)
680
681END FUNCTION vol7d_timerange_eq
682
683
684ELEMENTAL FUNCTION vol7d_timerange_almost_eq(this, that) RESULT(res)
685TYPE(vol7d_timerange),INTENT(IN) :: this, that
686LOGICAL :: res
687
688IF (.not. c_e(this%timerange) .or. .not. c_e(that%timerange) .or. this%timerange == that%timerange .AND. &
689 this%p1 == that%p1 .AND. &
690 this%p2 == that%p2) THEN
691 res = .true.
692ELSE
693 res = .false.
694ENDIF
695
696END FUNCTION vol7d_timerange_almost_eq
697
698
699ELEMENTAL FUNCTION vol7d_timerange_ne(this, that) RESULT(res)
700TYPE(vol7d_timerange),INTENT(IN) :: this, that
701LOGICAL :: res
702
703res = .NOT.(this == that)
704
705END FUNCTION vol7d_timerange_ne
706
707
708ELEMENTAL FUNCTION vol7d_timerange_gt(this, that) RESULT(res)
709TYPE(vol7d_timerange),INTENT(IN) :: this, that
710LOGICAL :: res
711
712IF (this%timerange > that%timerange .OR. &
713 (this%timerange == that%timerange .AND. this%p1 > that%p1) .OR. &
714 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
715 this%p2 > that%p2)) THEN
716 res = .true.
717ELSE
718 res = .false.
719ENDIF
720
721END FUNCTION vol7d_timerange_gt
722
723
724ELEMENTAL FUNCTION vol7d_timerange_lt(this, that) RESULT(res)
725TYPE(vol7d_timerange),INTENT(IN) :: this, that
726LOGICAL :: res
727
728IF (this%timerange < that%timerange .OR. &
729 (this%timerange == that%timerange .AND. this%p1 < that%p1) .OR. &
730 (this%timerange == that%timerange .AND. this%p1 == that%p1 .AND. &
731 this%p2 < that%p2)) THEN
732 res = .true.
733ELSE
734 res = .false.
735ENDIF
736
737END FUNCTION vol7d_timerange_lt
738
739
740ELEMENTAL FUNCTION vol7d_timerange_ge(this, that) RESULT(res)
741TYPE(vol7d_timerange),INTENT(IN) :: this, that
742LOGICAL :: res
743
744IF (this == that) THEN
745 res = .true.
746ELSE IF (this > that) THEN
747 res = .true.
748ELSE
749 res = .false.
750ENDIF
751
752END FUNCTION vol7d_timerange_ge
753
754
755ELEMENTAL FUNCTION vol7d_timerange_le(this, that) RESULT(res)
756TYPE(vol7d_timerange),INTENT(IN) :: this, that
757LOGICAL :: res
758
759IF (this == that) THEN
760 res = .true.
761ELSE IF (this < that) THEN
762 res = .true.
763ELSE
764 res = .false.
765ENDIF
766
767END FUNCTION vol7d_timerange_le
768
769
770ELEMENTAL FUNCTION vol7d_timerange_c_e(this) RESULT(c_e)
771TYPE(vol7d_timerange),INTENT(IN) :: this
772LOGICAL :: c_e
773c_e = this /= vol7d_timerange_miss
774END FUNCTION vol7d_timerange_c_e
775
776
777#include "array_utilities_inc.F90"
778
779#include "arrayof_post.F90"
780
781
Quick method to append an element to the array. Definition: vol7d_timerange_class.F90:431 Distruttore per la classe vol7d_timerange. Definition: vol7d_timerange_class.F90:250 Costruttore per la classe vol7d_timerange. Definition: vol7d_timerange_class.F90:244 Method for inserting elements of the array at a desired position. Definition: vol7d_timerange_class.F90:422 Method for packing the array object reducing at a minimum the memory occupation, without destroying i... Definition: vol7d_timerange_class.F90:454 Method for removing elements of the array at a desired position. Definition: vol7d_timerange_class.F90:437 Represent timerange object in a pretty string. Definition: vol7d_timerange_class.F90:375 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. Definition: missing_values.f90:50 Classe per la gestione degli intervalli temporali di osservazioni meteo e affini. Definition: vol7d_timerange_class.F90:221 Definisce l'intervallo temporale di un'osservazione meteo. Definition: vol7d_timerange_class.F90:231 |