summaryrefslogtreecommitdiff
path: root/Dragon/src/SYB4TN.f
blob: a15ba8e615e5f606d2990a3446ef28c6710d4d81 (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
*DECK SYB4TN
      SUBROUTINE SYB4TN (NHMAX,IXRAYO,ISDEBU,COSECT,NRI,RAYONS,DELTAC)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Search of the next singular point in a Cartesian 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
* NHMAX   number of intervals (the number of interceptions is NHMAX+1).
* IXRAYO  tubes indices from west to east.
* ISDEBU  index of the first sector.
* COSECT  cosinus of the sector angles.
* NRI     number of radius.
* RAYONS  radius of the tubes.
*
*Parameters: input/output
* DELTAC  next distance.
*
*-----------------------------------------------------------------------
*
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER        NHMAX,IXRAYO(NHMAX),ISDEBU,NRI
      REAL           COSECT(*),RAYONS(NRI),DELTAC
*----
*  LOCAL VARIABLES
*----
      LOGICAL        LGSEC1,LGSEC2
*
      IF (NHMAX .LT. 2) RETURN
      IHX = 0
      IR1 = IXRAYO(1)
      IR2 = IXRAYO(2)
      LGSEC2 = IR1 .EQ. IR2
      IF (LGSEC2) THEN
        ISC = ISDEBU + 1
      ELSE
        ISC = ISDEBU
      ENDIF
*
      DO IHC = 2, NHMAX - 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
            DELTAC = RAYONS(IR1)
            IHX = IHC
          ENDIF
        ENDIF
*
* Coin Secteur/Rayon
        ELSEIF (LGSEC1) THEN
        IF (IR2 .EQ. IR1+1) THEN
          RR  = RAYONS(IR1)
          DD  = RR * COSECT(ISC-1)
          IF (DD .LT. DELTAC) THEN
            DELTAC = DD
            IHX = IHC
          ENDIF
        ENDIF
*
* Coin Secteur/Rayon
        ELSEIF (LGSEC2) THEN
        IF (IR0 .EQ. IR1+1) THEN
          RR  = RAYONS(IR1)
          DD  = RR * COSECT(ISC-1)
          IF (DD .LT. DELTAC) THEN
            DELTAC = DD
            IHX = IHC
          ENDIF
        ENDIF
*
        ENDIF
*
      ENDDO
*
      RETURN
      END