libsim Versione 7.2.6

◆ vol7d_network_new()

type(vol7d_network) function vol7d_network_new ( character(len=*), intent(in), optional name)

Inizializza un oggetto vol7d_network con i parametri opzionali forniti.

Questa è la versione FUNCTION, in stile F2003, del costruttore, da preferire rispetto alla versione SUBROUTINE init. Se non viene passato nessun parametro opzionale l'oggetto è inizializzato a valore mancante.

Parametri
[in]nameMnemonic alias for type of report
Restituisce
oggetto da inizializzare

Definizione alla linea 370 del file vol7d_network_class.F90.

371! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
372! authors:
373! Davide Cesari <dcesari@arpa.emr.it>
374! Paolo Patruno <ppatruno@arpa.emr.it>
375
376! This program is free software; you can redistribute it and/or
377! modify it under the terms of the GNU General Public License as
378! published by the Free Software Foundation; either version 2 of
379! the License, or (at your option) any later version.
380
381! This program is distributed in the hope that it will be useful,
382! but WITHOUT ANY WARRANTY; without even the implied warranty of
383! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
384! GNU General Public License for more details.
385
386! You should have received a copy of the GNU General Public License
387! along with this program. If not, see <http://www.gnu.org/licenses/>.
388#include "config.h"
389
390!> Classe per la gestione delle reti di stazioni per osservazioni meteo e affini.
391!! Questo modulo definisce una classe per identificare la rete
392!! a cui appartiene una stazione. Per rete si intende un insieme di stazioni
393!! omogenee per tipo di sensori, tipo di variabili osservate,
394!! frequenza delle osservazioni, formato dei dati.
395!! \ingroup vol7d
397USE kinds
400IMPLICIT NONE
401
402integer, parameter :: network_name_len=20
403
404!> Definisce la rete a cui appartiene una stazione.
405!! I membri di \a vol7d_network sono pubblici e quindi liberamente
406!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
407!! il costruttore ::init.
408TYPE vol7d_network
409 character(len=network_name_len) :: name !< Mnemonic alias for type of report
410END TYPE vol7d_network
411
412!> Valore mancante per vol7d_network.
413TYPE(vol7d_network),PARAMETER :: vol7d_network_miss=vol7d_network(cmiss)
414
415!> Costruttore per la classe vol7d_network.
416!! Deve essere richiamato
417!! per tutti gli oggetti di questo tipo definiti in un programma.
418INTERFACE init
419 MODULE PROCEDURE vol7d_network_init
420END INTERFACE
421
422!> Distruttore per la classe vol7d_network.
423!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
424INTERFACE delete
425 MODULE PROCEDURE vol7d_network_delete
426END INTERFACE
427
428!> Logical equality operator for objects of \a vol7d_network class.
429!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
430!! of any shape.
431INTERFACE OPERATOR (==)
432 MODULE PROCEDURE vol7d_network_eq
433END INTERFACE
434
435!> Logical inequality operator for objects of \a vol7d_network class.
436!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
437!! of any shape.
438INTERFACE OPERATOR (/=)
439 MODULE PROCEDURE vol7d_network_ne
440END INTERFACE
441
442!> Logical greater-than operator for objects of \a vol7d_network class.
443!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
444!! of any shape.
445INTERFACE OPERATOR (>)
446 MODULE PROCEDURE vol7d_network_gt
447END INTERFACE
448
449!> Logical less-than operator for objects of \a vol7d_network class.
450!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
451!! of any shape.
452INTERFACE OPERATOR (<)
453 MODULE PROCEDURE vol7d_network_lt
454END INTERFACE
455
456!> Logical greater-equal operator for objects of \a vol7d_network class.
457!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
458!! of any shape.
459INTERFACE OPERATOR (>=)
460 MODULE PROCEDURE vol7d_network_ge
461END INTERFACE
462
463!> Logical less-equal operator for objects of \a vol7d_network 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_network_le
468END INTERFACE
469
470#define VOL7D_POLY_TYPE TYPE(vol7d_network)
471#define VOL7D_POLY_TYPES _network
472#define ENABLE_SORT
473#include "array_utilities_pre.F90"
474
475!>Print object
476INTERFACE display
477 MODULE PROCEDURE display_network
478END INTERFACE
479
480!>Check object presence
481INTERFACE c_e
482 MODULE PROCEDURE c_e_network
483END INTERFACE
484
485!>return network object in a pretty string
486INTERFACE to_char
487 MODULE PROCEDURE to_char_network
488END INTERFACE
489
490CONTAINS
491
492!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
493!! Questa è la versione \c FUNCTION, in stile F2003, del costruttore, da preferire
494!! rispetto alla versione \c SUBROUTINE \c init.
495!! Se non viene passato nessun parametro opzionale l'oggetto è
496!! inizializzato a valore mancante.
497FUNCTION vol7d_network_new(name) RESULT(this)
498CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
499
500TYPE(vol7d_network) :: this !< oggetto da inizializzare
501
502CALL init(this, name)
503
504END FUNCTION vol7d_network_new
505
506
507!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
508!! Se non viene passato nessun parametro opzionale l'oggetto è
509!! inizializzato a valore mancante.
510SUBROUTINE vol7d_network_init(this, name)
511TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da inizializzare
512CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
513
514IF (PRESENT(name)) THEN
515 this%name = lowercase(name)
516ELSE
517 this%name = cmiss
518END IF
519
520END SUBROUTINE vol7d_network_init
521
522
523!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
524SUBROUTINE vol7d_network_delete(this)
525TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da distruggre
526
527this%name = cmiss
528
529END SUBROUTINE vol7d_network_delete
530
531
532subroutine display_network(this)
533
534TYPE(vol7d_network),INTENT(in) :: this
535
536print*,to_char_network(this)
537
538end subroutine display_network
539
540
541elemental function c_e_network(this) result(res)
542
543TYPE(vol7d_network),INTENT(in) :: this
544logical :: res
545
546res = .not. this == vol7d_network_miss
547
548end function c_e_network
549
550
551elemental character(len=20) function to_char_network(this)
552
553TYPE(vol7d_network),INTENT(in) :: this
554
555to_char_network="Network: "//trim(this%name)
556
557return
558
559end function to_char_network
560
561
562ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
563TYPE(vol7d_network),INTENT(IN) :: this, that
564LOGICAL :: res
565
566res = (this%name == that%name)
567
568END FUNCTION vol7d_network_eq
569
570
571ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
572TYPE(vol7d_network),INTENT(IN) :: this, that
573LOGICAL :: res
574
575res = .NOT.(this == that)
576
577END FUNCTION vol7d_network_ne
578
579
580ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
581TYPE(vol7d_network),INTENT(IN) :: this, that
582LOGICAL :: res
583
584res = this%name > that%name
585
586END FUNCTION vol7d_network_gt
587
588ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
589TYPE(vol7d_network),INTENT(IN) :: this, that
590LOGICAL :: res
591
592res = this%name < that%name
593
594END FUNCTION vol7d_network_lt
595
596
597ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
598TYPE(vol7d_network),INTENT(IN) :: this, that
599LOGICAL :: res
600
601res = this%name >= that%name
602
603END FUNCTION vol7d_network_ge
604
605ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
606TYPE(vol7d_network),INTENT(IN) :: this, that
607LOGICAL :: res
608
609res = this%name <= that%name
610
611END FUNCTION vol7d_network_le
612
613
614#include "array_utilities_inc.F90"
615
616
617END MODULE vol7d_network_class
Distruttore per la classe vol7d_network.
Costruttore per la classe vol7d_network.
return network 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 delle reti di stazioni per osservazioni meteo e affini.
Definisce la rete a cui appartiene una stazione.

Generated with Doxygen.