libsim Versione 7.2.6

◆ vol7d_network_init()

subroutine vol7d_network_init ( type(vol7d_network), intent(inout) this,
character(len=*), intent(in), optional name )

Inizializza un oggetto vol7d_network 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]nameMnemonic alias for type of report

Definizione alla linea 383 del file vol7d_network_class.F90.

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