libsim Versione 7.1.11

◆ 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 376 del file vol7d_network_class.F90.

377! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
378! authors:
379! Davide Cesari <dcesari@arpa.emr.it>
380! Paolo Patruno <ppatruno@arpa.emr.it>
381
382! This program is free software; you can redistribute it and/or
383! modify it under the terms of the GNU General Public License as
384! published by the Free Software Foundation; either version 2 of
385! the License, or (at your option) any later version.
386
387! This program is distributed in the hope that it will be useful,
388! but WITHOUT ANY WARRANTY; without even the implied warranty of
389! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
390! GNU General Public License for more details.
391
392! You should have received a copy of the GNU General Public License
393! along with this program. If not, see <http://www.gnu.org/licenses/>.
394#include "config.h"
395
403USE kinds
406IMPLICIT NONE
407
408integer, parameter :: network_name_len=20
409
414TYPE vol7d_network
415 character(len=network_name_len) :: name
416END TYPE vol7d_network
417
419TYPE(vol7d_network),PARAMETER :: vol7d_network_miss=vol7d_network(cmiss)
420
424INTERFACE init
425 MODULE PROCEDURE vol7d_network_init
426END INTERFACE
427
430INTERFACE delete
431 MODULE PROCEDURE vol7d_network_delete
432END INTERFACE
433
437INTERFACE OPERATOR (==)
438 MODULE PROCEDURE vol7d_network_eq
439END INTERFACE
440
444INTERFACE OPERATOR (/=)
445 MODULE PROCEDURE vol7d_network_ne
446END INTERFACE
447
451INTERFACE OPERATOR (>)
452 MODULE PROCEDURE vol7d_network_gt
453END INTERFACE
454
458INTERFACE OPERATOR (<)
459 MODULE PROCEDURE vol7d_network_lt
460END INTERFACE
461
465INTERFACE OPERATOR (>=)
466 MODULE PROCEDURE vol7d_network_ge
467END INTERFACE
468
472INTERFACE OPERATOR (<=)
473 MODULE PROCEDURE vol7d_network_le
474END INTERFACE
475
476#define VOL7D_POLY_TYPE TYPE(vol7d_network)
477#define VOL7D_POLY_TYPES _network
478#define ENABLE_SORT
479#include "array_utilities_pre.F90"
480
482INTERFACE display
483 MODULE PROCEDURE display_network
484END INTERFACE
485
487INTERFACE c_e
488 MODULE PROCEDURE c_e_network
489END INTERFACE
490
492INTERFACE to_char
493 MODULE PROCEDURE to_char_network
494END INTERFACE
495
496CONTAINS
497
503FUNCTION vol7d_network_new(name) RESULT(this)
504CHARACTER(len=*),INTENT(in),OPTIONAL :: name
505
506TYPE(vol7d_network) :: this
507
508CALL init(this, name)
509
510END FUNCTION vol7d_network_new
511
512
516SUBROUTINE vol7d_network_init(this, name)
517TYPE(vol7d_network),INTENT(INOUT) :: this
518CHARACTER(len=*),INTENT(in),OPTIONAL :: name
519
520IF (PRESENT(name)) THEN
521 this%name = lowercase(name)
522ELSE
523 this%name = cmiss
524END IF
525
526END SUBROUTINE vol7d_network_init
527
528
530SUBROUTINE vol7d_network_delete(this)
531TYPE(vol7d_network),INTENT(INOUT) :: this
532
533this%name = cmiss
534
535END SUBROUTINE vol7d_network_delete
536
537
538subroutine display_network(this)
539
540TYPE(vol7d_network),INTENT(in) :: this
541
542print*,to_char_network(this)
543
544end subroutine display_network
545
546
547elemental function c_e_network(this) result(res)
548
549TYPE(vol7d_network),INTENT(in) :: this
550logical :: res
551
552res = .not. this == vol7d_network_miss
553
554end function c_e_network
555
556
557elemental character(len=20) function to_char_network(this)
558
559TYPE(vol7d_network),INTENT(in) :: this
560
561to_char_network="Network: "//trim(this%name)
562
563return
564
565end function to_char_network
566
567
568ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
569TYPE(vol7d_network),INTENT(IN) :: this, that
570LOGICAL :: res
571
572res = (this%name == that%name)
573
574END FUNCTION vol7d_network_eq
575
576
577ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
578TYPE(vol7d_network),INTENT(IN) :: this, that
579LOGICAL :: res
580
581res = .NOT.(this == that)
582
583END FUNCTION vol7d_network_ne
584
585
586ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
587TYPE(vol7d_network),INTENT(IN) :: this, that
588LOGICAL :: res
589
590res = this%name > that%name
591
592END FUNCTION vol7d_network_gt
593
594ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
595TYPE(vol7d_network),INTENT(IN) :: this, that
596LOGICAL :: res
597
598res = this%name < that%name
599
600END FUNCTION vol7d_network_lt
601
602
603ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
604TYPE(vol7d_network),INTENT(IN) :: this, that
605LOGICAL :: res
606
607res = this%name >= that%name
608
609END FUNCTION vol7d_network_ge
610
611ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
612TYPE(vol7d_network),INTENT(IN) :: this, that
613LOGICAL :: res
614
615res = this%name <= that%name
616
617END FUNCTION vol7d_network_le
618
619
620#include "array_utilities_inc.F90"
621
622
623END MODULE vol7d_network_class
Check object presence.
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:251
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.