libsim Versione 7.2.6
|
◆ inssor_network()
Sorts into increasing order (Insertion sort) Sorts XDONT into increasing order (Insertion sort) This subroutine uses insertion sort. It does not use any work array and is faster when XDONT is of very small size (< 20), or already almost sorted, so it is used in a final pass when the partial quicksorting has left a sequence of small subsets and that sorting is only necessary within each subset to complete the process. Michel Olagnon - Apr. 2000 Definizione alla linea 1311 del file vol7d_network_class.F90. 1312! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
1313! authors:
1314! Davide Cesari <dcesari@arpa.emr.it>
1315! Paolo Patruno <ppatruno@arpa.emr.it>
1316
1317! This program is free software; you can redistribute it and/or
1318! modify it under the terms of the GNU General Public License as
1319! published by the Free Software Foundation; either version 2 of
1320! the License, or (at your option) any later version.
1321
1322! This program is distributed in the hope that it will be useful,
1323! but WITHOUT ANY WARRANTY; without even the implied warranty of
1324! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1325! GNU General Public License for more details.
1326
1327! You should have received a copy of the GNU General Public License
1328! along with this program. If not, see <http://www.gnu.org/licenses/>.
1329#include "config.h"
1330
1331!> Classe per la gestione delle reti di stazioni per osservazioni meteo e affini.
1332!! Questo modulo definisce una classe per identificare la rete
1333!! a cui appartiene una stazione. Per rete si intende un insieme di stazioni
1334!! omogenee per tipo di sensori, tipo di variabili osservate,
1335!! frequenza delle osservazioni, formato dei dati.
1336!! \ingroup vol7d
1341IMPLICIT NONE
1342
1343integer, parameter :: network_name_len=20
1344
1345!> Definisce la rete a cui appartiene una stazione.
1346!! I membri di \a vol7d_network sono pubblici e quindi liberamente
1347!! accessibili e scrivibili, ma è comunque consigliato assegnarli tramite
1348!! il costruttore ::init.
1350 character(len=network_name_len) :: name !< Mnemonic alias for type of report
1352
1353!> Valore mancante per vol7d_network.
1355
1356!> Costruttore per la classe vol7d_network.
1357!! Deve essere richiamato
1358!! per tutti gli oggetti di questo tipo definiti in un programma.
1360 MODULE PROCEDURE vol7d_network_init
1361END INTERFACE
1362
1363!> Distruttore per la classe vol7d_network.
1364!! Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
1366 MODULE PROCEDURE vol7d_network_delete
1367END INTERFACE
1368
1369!> Logical equality operator for objects of \a vol7d_network class.
1370!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1371!! of any shape.
1372INTERFACE OPERATOR (==)
1373 MODULE PROCEDURE vol7d_network_eq
1374END INTERFACE
1375
1376!> Logical inequality operator for objects of \a vol7d_network class.
1377!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1378!! of any shape.
1379INTERFACE OPERATOR (/=)
1380 MODULE PROCEDURE vol7d_network_ne
1381END INTERFACE
1382
1383!> Logical greater-than operator for objects of \a vol7d_network class.
1384!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1385!! of any shape.
1386INTERFACE OPERATOR (>)
1387 MODULE PROCEDURE vol7d_network_gt
1388END INTERFACE
1389
1390!> Logical less-than operator for objects of \a vol7d_network class.
1391!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1392!! of any shape.
1393INTERFACE OPERATOR (<)
1394 MODULE PROCEDURE vol7d_network_lt
1395END INTERFACE
1396
1397!> Logical greater-equal operator for objects of \a vol7d_network class.
1398!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1399!! of any shape.
1400INTERFACE OPERATOR (>=)
1401 MODULE PROCEDURE vol7d_network_ge
1402END INTERFACE
1403
1404!> Logical less-equal operator for objects of \a vol7d_network class.
1405!! It is defined as \a ELEMENTAL thus it works also with conformal arrays
1406!! of any shape.
1407INTERFACE OPERATOR (<=)
1408 MODULE PROCEDURE vol7d_network_le
1409END INTERFACE
1410
1411#define VOL7D_POLY_TYPE TYPE(vol7d_network)
1412#define VOL7D_POLY_TYPES _network
1413#define ENABLE_SORT
1414#include "array_utilities_pre.F90"
1415
1416!>Print object
1418 MODULE PROCEDURE display_network
1419END INTERFACE
1420
1421!>Check object presence
1423 MODULE PROCEDURE c_e_network
1424END INTERFACE
1425
1426!>return network object in a pretty string
1428 MODULE PROCEDURE to_char_network
1429END INTERFACE
1430
1431CONTAINS
1432
1433!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
1434!! Questa è la versione \c FUNCTION, in stile F2003, del costruttore, da preferire
1435!! rispetto alla versione \c SUBROUTINE \c init.
1436!! Se non viene passato nessun parametro opzionale l'oggetto è
1437!! inizializzato a valore mancante.
1438FUNCTION vol7d_network_new(name) RESULT(this)
1439CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
1440
1441TYPE(vol7d_network) :: this !< oggetto da inizializzare
1442
1444
1445END FUNCTION vol7d_network_new
1446
1447
1448!> Inizializza un oggetto \a vol7d_network con i parametri opzionali forniti.
1449!! Se non viene passato nessun parametro opzionale l'oggetto è
1450!! inizializzato a valore mancante.
1451SUBROUTINE vol7d_network_init(this, name)
1452TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da inizializzare
1453CHARACTER(len=*),INTENT(in),OPTIONAL :: name !< Mnemonic alias for type of report
1454
1455IF (PRESENT(name)) THEN
1456 this%name = lowercase(name)
1457ELSE
1458 this%name = cmiss
1459END IF
1460
1461END SUBROUTINE vol7d_network_init
1462
1463
1464!> Distrugge l'oggetto in maniera pulita, assegnandogli un valore mancante.
1465SUBROUTINE vol7d_network_delete(this)
1466TYPE(vol7d_network),INTENT(INOUT) :: this !< oggetto da distruggre
1467
1468this%name = cmiss
1469
1470END SUBROUTINE vol7d_network_delete
1471
1472
1473subroutine display_network(this)
1474
1475TYPE(vol7d_network),INTENT(in) :: this
1476
1477print*,to_char_network(this)
1478
1479end subroutine display_network
1480
1481
1482elemental function c_e_network(this) result(res)
1483
1484TYPE(vol7d_network),INTENT(in) :: this
1485logical :: res
1486
1487res = .not. this == vol7d_network_miss
1488
1489end function c_e_network
1490
1491
1492elemental character(len=20) function to_char_network(this)
1493
1494TYPE(vol7d_network),INTENT(in) :: this
1495
1496to_char_network="Network: "//trim(this%name)
1497
1498return
1499
1500end function to_char_network
1501
1502
1503ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
1504TYPE(vol7d_network),INTENT(IN) :: this, that
1505LOGICAL :: res
1506
1507res = (this%name == that%name)
1508
1509END FUNCTION vol7d_network_eq
1510
1511
1512ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
1513TYPE(vol7d_network),INTENT(IN) :: this, that
1514LOGICAL :: res
1515
1516res = .NOT.(this == that)
1517
1518END FUNCTION vol7d_network_ne
1519
1520
1521ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
1522TYPE(vol7d_network),INTENT(IN) :: this, that
1523LOGICAL :: res
1524
1525res = this%name > that%name
1526
1527END FUNCTION vol7d_network_gt
1528
1529ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
1530TYPE(vol7d_network),INTENT(IN) :: this, that
1531LOGICAL :: res
1532
1533res = this%name < that%name
1534
1535END FUNCTION vol7d_network_lt
1536
1537
1538ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
1539TYPE(vol7d_network),INTENT(IN) :: this, that
1540LOGICAL :: res
1541
1542res = this%name >= that%name
1543
1544END FUNCTION vol7d_network_ge
1545
1546ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
1547TYPE(vol7d_network),INTENT(IN) :: this, that
1548LOGICAL :: res
1549
1550res = this%name <= that%name
1551
1552END FUNCTION vol7d_network_le
1553
1554
1555#include "array_utilities_inc.F90"
1556
1557
Distruttore per la classe vol7d_network. Definition vol7d_network_class.F90:242 Costruttore per la classe vol7d_network. Definition vol7d_network_class.F90:236 return network object in a pretty string Definition vol7d_network_class.F90:359 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 delle reti di stazioni per osservazioni meteo e affini. Definition vol7d_network_class.F90:214 Definisce la rete a cui appartiene una stazione. Definition vol7d_network_class.F90:226 |