libsim Versione 7.2.6

◆ vol7d_ana_init()

subroutine vol7d_ana_init ( type(vol7d_ana), intent(inout) this,
real(kind=fp_geo), intent(in), optional lon,
real(kind=fp_geo), intent(in), optional lat,
character(len=*), intent(in), optional ident,
integer(kind=int_l), intent(in), optional ilon,
integer(kind=int_l), intent(in), optional ilat )

Inizializza un oggetto vol7d_ana con i parametri opzionali forniti.

Se non viene passato nessun parametro opzionale l'oggetto è inizializzato a valore mancante.

Parametri
[in,out]thisoggetto da inizializzare
[in]lonlongitudine
[in]latlatitudine
[in]identidentificativo del volo
[in]iloninteger longitude (nint(lon*1.d5)
[in]ilatinteger latitude (nint(lat*1.d5)

Definizione alla linea 386 del file vol7d_ana_class.F90.

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

Generated with Doxygen.