libsim Versione 7.2.6
|
◆ vol7d_ana_delete()
Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
Definizione alla linea 405 del file vol7d_ana_class.F90. 406! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
407! authors:
408! Davide Cesari <dcesari@arpa.emr.it>
409! Paolo Patruno <ppatruno@arpa.emr.it>
410
411! This program is free software; you can redistribute it and/or
412! modify it under the terms of the GNU General Public License as
413! published by the Free Software Foundation; either version 2 of
414! the License, or (at your option) any later version.
415
416! This program is distributed in the hope that it will be useful,
417! but WITHOUT ANY WARRANTY; without even the implied warranty of
418! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
419! GNU General Public License for more details.
420
421! You should have received a copy of the GNU General Public License
422! along with this program. If not, see <http://www.gnu.org/licenses/>.
423#include "config.h"
424
425!> Classe per la gestione dell'anagrafica di stazioni meteo e affini.
426!! Questo modulo definisce una classe in grado di rappresentare
427!! le caratteristiche di una stazione meteo fissa o mobile.
428!! \ingroup vol7d
433IMPLICIT NONE
434
435!> Lunghezza della stringa che indica l'identificativo del volo.
436INTEGER,PARAMETER :: vol7d_ana_lenident=20
437
438!> Definisce l'anagrafica di una stazione.
439!! I membri di \a vol7d_ana sono pubblici e quindi liberamente
440!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
441!! il costruttore ::init.
443 TYPE(geo_coord) :: coord !< coordinata per una stazione fissa
444 CHARACTER(len=vol7d_ana_lenident) :: ident !< identificativo per una stazione mobile (es. aereo)
446
447!> Valore mancante per vo7d_ana.
449
450!> Costruttore per la classe vol7d_ana.
451!! Deve essere richiamato
452!! per tutti gli oggetti di questo tipo definiti in un programma.
454 MODULE PROCEDURE vol7d_ana_init
455END INTERFACE
456
457!> Distruttore per la classe vol7d_ana.
458!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
460 MODULE PROCEDURE vol7d_ana_delete
461END INTERFACE
462
463!> Logical equality operator for objects of \a vol7d_ana class.
464!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
465!! of any shape.
466INTERFACE OPERATOR (==)
467 MODULE PROCEDURE vol7d_ana_eq
468END INTERFACE
469
470!> Logical inequality operator for objects of \a vol7d_ana class.
471!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
472!! of any shape.
473INTERFACE OPERATOR (/=)
474 MODULE PROCEDURE vol7d_ana_ne
475END INTERFACE
476
477
478!> Logical greater-than operator for objects of \a vol7d_ana class.
479!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
480!! of any shape.
481!! Comparison is performed first on \a ident, then on coord
482INTERFACE OPERATOR (>)
483 MODULE PROCEDURE vol7d_ana_gt
484END INTERFACE
485
486!> Logical less-than operator for objects of \a vol7d_ana class.
487!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
488!! of any shape.
489!! Comparison is performed first on \a ident, then on coord
490INTERFACE OPERATOR (<)
491 MODULE PROCEDURE vol7d_ana_lt
492END INTERFACE
493
494!> Logical greater-equal operator for objects of \a vol7d_ana class.
495!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
496!! of any shape.
497!! Comparison is performed first on \a ident, then on coord
498INTERFACE OPERATOR (>=)
499 MODULE PROCEDURE vol7d_ana_ge
500END INTERFACE
501
502!> Logical less-equal operator for objects of \a vol7d_ana class.
503!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
504!! of any shape.
505!! Comparison is performed first on \a ident, then on coord
506INTERFACE OPERATOR (<=)
507 MODULE PROCEDURE vol7d_ana_le
508END INTERFACE
509
510
511!> check for missing value
513 MODULE PROCEDURE vol7d_ana_c_e
514END INTERFACE
515
516!> Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da
517!! un file \c FORMATTED o \c UNFORMATTED.
519 MODULE PROCEDURE vol7d_ana_read_unit, vol7d_ana_vect_read_unit
520END INTERFACE
521
522!> Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su
523!! un file \c FORMATTED o \c UNFORMATTED.
525 MODULE PROCEDURE vol7d_ana_write_unit, vol7d_ana_vect_write_unit
526END INTERFACE
527
528#define VOL7D_POLY_TYPE TYPE(vol7d_ana)
529#define VOL7D_POLY_TYPES _ana
530#define ENABLE_SORT
531#include "array_utilities_pre.F90"
532
533!> Represent ana object in a pretty string
535 MODULE PROCEDURE to_char_ana
536END INTERFACE
537
538!> Print object
540 MODULE PROCEDURE display_ana
541END INTERFACE
542
543CONTAINS
544
545!> Inizializza un oggetto \a vol7d_ana con i parametri opzionali forniti.
546!! Se non viene passato nessun parametro opzionale l'oggetto è
547!! inizializzato a valore mancante.
548SUBROUTINE vol7d_ana_init(this, lon, lat, ident, ilon, ilat)
549TYPE(vol7d_ana),INTENT(INOUT) :: this !< oggetto da inizializzare
550REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lon !< longitudine
551REAL(kind=fp_geo),INTENT(in),OPTIONAL :: lat !< latitudine
552CHARACTER(len=*),INTENT(in),OPTIONAL :: ident !< identificativo del volo
553INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilon !< integer longitude (nint(lon*1.d5)
554INTEGER(kind=int_l),INTENT(in),OPTIONAL :: ilat !< integer latitude (nint(lat*1.d5)
555
557IF (PRESENT(ident)) THEN
558 this%ident = ident
559ELSE
560 this%ident = cmiss
561ENDIF
562
563END SUBROUTINE vol7d_ana_init
564
565
566!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
567SUBROUTINE vol7d_ana_delete(this)
568TYPE(vol7d_ana),INTENT(INOUT) :: this !< oggetto da distruggre
569
571this%ident = cmiss
572
573END SUBROUTINE vol7d_ana_delete
574
575
576
577character(len=80) function to_char_ana(this)
578
579TYPE(vol7d_ana),INTENT(in) :: this
580
581to_char_ana="ANA: "//&
584 t2c(this%ident,miss="Missing ident")
585
586return
587
588end function to_char_ana
589
590
591subroutine display_ana(this)
592
593TYPE(vol7d_ana),INTENT(in) :: this
594
595print*, trim(to_char(this))
596
597end subroutine display_ana
598
599
600ELEMENTAL FUNCTION vol7d_ana_eq(this, that) RESULT(res)
601TYPE(vol7d_ana),INTENT(IN) :: this, that
602LOGICAL :: res
603
604res = this%coord == that%coord .AND. this%ident == that%ident
605
606END FUNCTION vol7d_ana_eq
607
608
609ELEMENTAL FUNCTION vol7d_ana_ne(this, that) RESULT(res)
610TYPE(vol7d_ana),INTENT(IN) :: this, that
611LOGICAL :: res
612
613res = .NOT.(this == that)
614
615END FUNCTION vol7d_ana_ne
616
617
618ELEMENTAL FUNCTION vol7d_ana_gt(this, that) RESULT(res)
619TYPE(vol7d_ana),INTENT(IN) :: this, that
620LOGICAL :: res
621
622res = this%ident > that%ident
623
624if ( this%ident == that%ident) then
625 res =this%coord > that%coord
626end if
627
628END FUNCTION vol7d_ana_gt
629
630
631ELEMENTAL FUNCTION vol7d_ana_ge(this, that) RESULT(res)
632TYPE(vol7d_ana),INTENT(IN) :: this, that
633LOGICAL :: res
634
635res = .not. this < that
636
637END FUNCTION vol7d_ana_ge
638
639
640ELEMENTAL FUNCTION vol7d_ana_lt(this, that) RESULT(res)
641TYPE(vol7d_ana),INTENT(IN) :: this, that
642LOGICAL :: res
643
644res = this%ident < that%ident
645
646if ( this%ident == that%ident) then
647 res = this%coord < that%coord
648end if
649
650END FUNCTION vol7d_ana_lt
651
652
653ELEMENTAL FUNCTION vol7d_ana_le(this, that) RESULT(res)
654TYPE(vol7d_ana),INTENT(IN) :: this, that
655LOGICAL :: res
656
657res = .not. (this > that)
658
659END FUNCTION vol7d_ana_le
660
661
662
663ELEMENTAL FUNCTION vol7d_ana_c_e(this) RESULT(c_e)
664TYPE(vol7d_ana),INTENT(IN) :: this
665LOGICAL :: c_e
666c_e = this /= vol7d_ana_miss
667END FUNCTION vol7d_ana_c_e
668
669
670!> This method reads from a Fortran file unit the contents of the
671!! object \a this. The record to be read must have been written with
672!! the ::write_unit method. The method works both on formatted and
673!! unformatted files.
674SUBROUTINE vol7d_ana_read_unit(this, unit)
675TYPE(vol7d_ana),INTENT(out) :: this !< object to be read
676INTEGER, INTENT(in) :: unit !< unit from which to read, it must be an opened Fortran file unit
677
678CALL vol7d_ana_vect_read_unit((/this/), unit)
679
680END SUBROUTINE vol7d_ana_read_unit
681
682
683!> This method reads from a Fortran file unit the contents of the
684!! object \a this. The record to be read must have been written with
685!! the ::write_unit method. The method works both on formatted and
686!! unformatted files.
687SUBROUTINE vol7d_ana_vect_read_unit(this, unit)
688TYPE(vol7d_ana) :: this(:) !< object to be read
689INTEGER, INTENT(in) :: unit !< unit from which to read, it must be an opened Fortran file unit
690
691CHARACTER(len=40) :: form
692
694INQUIRE(unit, form=form)
695IF (form == 'FORMATTED') THEN
696 READ(unit,'(A)')this(:)%ident
697ELSE
698 READ(unit)this(:)%ident
699ENDIF
700
701END SUBROUTINE vol7d_ana_vect_read_unit
702
703
704!> This method writes on a Fortran file unit the contents of the
705!! object \a this. The record can successively be read by the
706!! ::read_unit method. The method works both on formatted and
707!! unformatted files.
708SUBROUTINE vol7d_ana_write_unit(this, unit)
709TYPE(vol7d_ana),INTENT(in) :: this !< object to be written
710INTEGER, INTENT(in) :: unit !< unit where to write, it must be an opened Fortran file unit
711
712CALL vol7d_ana_vect_write_unit((/this/), unit)
713
714END SUBROUTINE vol7d_ana_write_unit
715
716
717!> This method writes on a Fortran file unit the contents of the
718!! object \a this. The record can successively be read by the
719!! ::read_unit method. The method works both on formatted and
720!! unformatted files.
721SUBROUTINE vol7d_ana_vect_write_unit(this, unit)
722TYPE(vol7d_ana),INTENT(in) :: this(:) !< object to be written
723INTEGER, INTENT(in) :: unit !< unit where to write, it must be an opened Fortran file unit
724
725CHARACTER(len=40) :: form
726
728INQUIRE(unit, form=form)
729IF (form == 'FORMATTED') THEN
730 WRITE(unit,'(A)')this(:)%ident
731ELSE
732 WRITE(unit)this(:)%ident
733ENDIF
734
735END SUBROUTINE vol7d_ana_vect_write_unit
736
737
738#include "array_utilities_inc.F90"
739
740
Legge un oggetto vol7d_ana o un vettore di oggetti vol7d_ana da un file FORMATTED o UNFORMATTED. Definition vol7d_ana_class.F90:301 Scrive un oggetto vol7d_ana o un vettore di oggetti vol7d_ana su un file FORMATTED o UNFORMATTED. Definition vol7d_ana_class.F90:307 Classes for handling georeferenced sparse points in geographical corodinates. Definition geo_coord_class.F90:216 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 dell'anagrafica di stazioni meteo e affini. Definition vol7d_ana_class.F90:212 |