libsim Versione 7.1.11
|
◆ 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 1317 del file vol7d_network_class.F90. 1318! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
1319! authors:
1320! Davide Cesari <dcesari@arpa.emr.it>
1321! Paolo Patruno <ppatruno@arpa.emr.it>
1322
1323! This program is free software; you can redistribute it and/or
1324! modify it under the terms of the GNU General Public License as
1325! published by the Free Software Foundation; either version 2 of
1326! the License, or (at your option) any later version.
1327
1328! This program is distributed in the hope that it will be useful,
1329! but WITHOUT ANY WARRANTY; without even the implied warranty of
1330! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1331! GNU General Public License for more details.
1332
1333! You should have received a copy of the GNU General Public License
1334! along with this program. If not, see <http://www.gnu.org/licenses/>.
1335#include "config.h"
1336
1347IMPLICIT NONE
1348
1349integer, parameter :: network_name_len=20
1350
1356 character(len=network_name_len) :: name
1358
1361
1366 MODULE PROCEDURE vol7d_network_init
1367END INTERFACE
1368
1372 MODULE PROCEDURE vol7d_network_delete
1373END INTERFACE
1374
1378INTERFACE OPERATOR (==)
1379 MODULE PROCEDURE vol7d_network_eq
1380END INTERFACE
1381
1385INTERFACE OPERATOR (/=)
1386 MODULE PROCEDURE vol7d_network_ne
1387END INTERFACE
1388
1392INTERFACE OPERATOR (>)
1393 MODULE PROCEDURE vol7d_network_gt
1394END INTERFACE
1395
1399INTERFACE OPERATOR (<)
1400 MODULE PROCEDURE vol7d_network_lt
1401END INTERFACE
1402
1406INTERFACE OPERATOR (>=)
1407 MODULE PROCEDURE vol7d_network_ge
1408END INTERFACE
1409
1413INTERFACE OPERATOR (<=)
1414 MODULE PROCEDURE vol7d_network_le
1415END INTERFACE
1416
1417#define VOL7D_POLY_TYPE TYPE(vol7d_network)
1418#define VOL7D_POLY_TYPES _network
1419#define ENABLE_SORT
1420#include "array_utilities_pre.F90"
1421
1424 MODULE PROCEDURE display_network
1425END INTERFACE
1426
1429 MODULE PROCEDURE c_e_network
1430END INTERFACE
1431
1434 MODULE PROCEDURE to_char_network
1435END INTERFACE
1436
1437CONTAINS
1438
1444FUNCTION vol7d_network_new(name) RESULT(this)
1445CHARACTER(len=*),INTENT(in),OPTIONAL :: name
1446
1447TYPE(vol7d_network) :: this
1448
1450
1451END FUNCTION vol7d_network_new
1452
1453
1457SUBROUTINE vol7d_network_init(this, name)
1458TYPE(vol7d_network),INTENT(INOUT) :: this
1459CHARACTER(len=*),INTENT(in),OPTIONAL :: name
1460
1461IF (PRESENT(name)) THEN
1462 this%name = lowercase(name)
1463ELSE
1464 this%name = cmiss
1465END IF
1466
1467END SUBROUTINE vol7d_network_init
1468
1469
1471SUBROUTINE vol7d_network_delete(this)
1472TYPE(vol7d_network),INTENT(INOUT) :: this
1473
1474this%name = cmiss
1475
1476END SUBROUTINE vol7d_network_delete
1477
1478
1479subroutine display_network(this)
1480
1481TYPE(vol7d_network),INTENT(in) :: this
1482
1483print*,to_char_network(this)
1484
1485end subroutine display_network
1486
1487
1488elemental function c_e_network(this) result(res)
1489
1490TYPE(vol7d_network),INTENT(in) :: this
1491logical :: res
1492
1493res = .not. this == vol7d_network_miss
1494
1495end function c_e_network
1496
1497
1498elemental character(len=20) function to_char_network(this)
1499
1500TYPE(vol7d_network),INTENT(in) :: this
1501
1502to_char_network="Network: "//trim(this%name)
1503
1504return
1505
1506end function to_char_network
1507
1508
1509ELEMENTAL FUNCTION vol7d_network_eq(this, that) RESULT(res)
1510TYPE(vol7d_network),INTENT(IN) :: this, that
1511LOGICAL :: res
1512
1513res = (this%name == that%name)
1514
1515END FUNCTION vol7d_network_eq
1516
1517
1518ELEMENTAL FUNCTION vol7d_network_ne(this, that) RESULT(res)
1519TYPE(vol7d_network),INTENT(IN) :: this, that
1520LOGICAL :: res
1521
1522res = .NOT.(this == that)
1523
1524END FUNCTION vol7d_network_ne
1525
1526
1527ELEMENTAL FUNCTION vol7d_network_gt(this, that) RESULT(res)
1528TYPE(vol7d_network),INTENT(IN) :: this, that
1529LOGICAL :: res
1530
1531res = this%name > that%name
1532
1533END FUNCTION vol7d_network_gt
1534
1535ELEMENTAL FUNCTION vol7d_network_lt(this, that) RESULT(res)
1536TYPE(vol7d_network),INTENT(IN) :: this, that
1537LOGICAL :: res
1538
1539res = this%name < that%name
1540
1541END FUNCTION vol7d_network_lt
1542
1543
1544ELEMENTAL FUNCTION vol7d_network_ge(this, that) RESULT(res)
1545TYPE(vol7d_network),INTENT(IN) :: this, that
1546LOGICAL :: res
1547
1548res = this%name >= that%name
1549
1550END FUNCTION vol7d_network_ge
1551
1552ELEMENTAL FUNCTION vol7d_network_le(this, that) RESULT(res)
1553TYPE(vol7d_network),INTENT(IN) :: this, that
1554LOGICAL :: res
1555
1556res = this%name <= that%name
1557
1558END FUNCTION vol7d_network_le
1559
1560
1561#include "array_utilities_inc.F90"
1562
1563
Distruttore per la classe vol7d_network. Definition: vol7d_network_class.F90:248 Costruttore per la classe vol7d_network. Definition: vol7d_network_class.F90:242 return network object in a pretty string Definition: vol7d_network_class.F90:365 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. Definition: missing_values.f90:50 Classe per la gestione delle reti di stazioni per osservazioni meteo e affini. Definition: vol7d_network_class.F90:220 Definisce la rete a cui appartiene una stazione. Definition: vol7d_network_class.F90:232 |