summaryrefslogtreecommitdiff
path: root/Dragon/src/AEXGNV.f
blob: a3ab55ae24e95d0db70b6bfa58780feba41ef35c (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
*DECK AEXGNV
      SUBROUTINE AEXGNV(ICHAMP,SEGMEN,TCHDIM,TCHTYP,TCHDKL,IDK,NV)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Localization of a specific segment component in a SAPHYR archive.
* Component of a FORTRAN-77 emulator of the SAPHYR archive system.
*
*Copyright:
* Copyright (C) 1999 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
* ICHAMP  component index in segment (low integer value).
* SEGMEN  integer segment.
* TCHDIM  dimension of segment components.
* TCHTYP  character type of segment components.
* TCHDKL  position of segment components.
*
*Parameters: output
* IDK     position of segment component with index ichamp.
* NV      length of segment component with index ichamp.
*
*-----------------------------------------------------------------------
*
      INTEGER SEGMEN(*),TCHDIM(*),TCHTYP(*),TCHDKL(*)
      CHARACTER TEXT4*4
*
      LONMOT=4
      CALL LCMCAR(TEXT4,.FALSE.,TCHTYP(ICHAMP))
      ND=TCHDIM(ICHAMP)
      IDK=TCHDKL(ICHAMP+1)
      NV=1
      DO 100 ID=1,ND
      NV=NV*SEGMEN(IDK+ID)
  100 CONTINUE
      IDKE=TCHDKL(ICHAMP)
      IF(IDKE.LT.0) THEN
        IDK=SEGMEN(1-IDKE)+1
      ELSE
        IDK=IDKE+1
      ENDIF
      IF(TEXT4(1:1).EQ.'C') IDK=(IDK-1)/LONMOT+1
      RETURN
      END