summaryrefslogtreecommitdiff
path: root/Dragon/src/SYB7TN.f
blob: e0833fc0080996816bf73773bf94f44d6bfca7e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
*DECK SYB7TN
      SUBROUTINE SYB7TN (IHMIN,IHMAX,IXRAYO,ISDEBU,COSECT,NRI,RAYONS,
     & TYSUIT,IHSUIT,DELTAC,IRSUIT)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Search of the next singular point in an hexagonal cell.
*
*Copyright:
* Copyright (C) 2002 Ecole Polytechnique de Montreal
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version
*
*Author(s): A. Hebert
*
*Parameters: input
* IHMIN   index of the first tube.
* IHMAX   index of the last tube.
* IXRAYO  tube indices from west to east.
* ISDEBU  index of the first sector.
* COSECT  sector angle cosinus.
* NRI     number of radius.
* RAYONS  radius of the tubes.
*
*Parameters: input/output
* DELTAC  next distance.
*
*Parameters: output
* TYSUIT  type of the next singular point.
* IHSUIT  index of the next singular point.
* IRSUIT  index of the preceding tube.
*
*-----------------------------------------------------------------------
*
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER        IHMIN,IHMAX,IXRAYO(IHMAX),ISDEBU,NRI,IHSUIT,IRSUIT
      REAL           COSECT(3),RAYONS(NRI),DELTAC
      CHARACTER      TYSUIT*4
*----
*  LOCAL VARIABLES
*----
      LOGICAL        LGSEC1
      LOGICAL        LGSEC2
*
      IR1 = IXRAYO(IHMIN)
      IR2 = IXRAYO(IHMIN+1)
      LGSEC2 = IR1 .EQ. IR2
      IF (LGSEC2) THEN
        ISC = ISDEBU
      ELSE
        ISC = ISDEBU - 1
      ENDIF
*
      DO IHC = IHMIN + 1, IHMAX - 1
        LGSEC1 = LGSEC2
        IR0 = IR1
        IR1 = IR2
*
        IR2 = IXRAYO(IHC+1)
        LGSEC2 = IR1 .EQ. IR2
        IF (LGSEC2) THEN
          ISC = ISC + 1
        ENDIF
*
* Tangente = Intersection Couronne
        IF (IR2 .EQ. IR0) THEN
        IF (IR2 .EQ. IR1+1) THEN
          IF (RAYONS(IR1) .LT. DELTAC) THEN
            IHSUIT = IHC
            DELTAC = RAYONS(IR1)
            TYSUIT = 'Tang'
          ENDIF
        ENDIF
*
* Coin du 1er Secteur
        ELSEIF (ISC .EQ. 1) THEN
         IF (LGSEC2) THEN
          RR  = RAYONS(IR1)
          DD  = RR * COSECT(ISC)
          IF (DD .LT. DELTAC) THEN
            IHSUIT = IHC
            DELTAC = DD
            TYSUIT = 'Coin'
            IRSUIT = IR1 + 1
          ENDIF
         ENDIF
*
* Coin d'un Secteur Est
        ELSEIF (LGSEC1) THEN
          RR  = RAYONS(IR1)
          DD  = RR * COSECT(ISC)
          IF (DD .LT. DELTAC) THEN
            IHSUIT = IHC
            DELTAC = DD
            TYSUIT = 'Coin'
            IRSUIT = IR1 + 1
          ENDIF
        ENDIF
*
      ENDDO
*
      RETURN
      END