~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to prim/table/libsrc/tdname.for

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
C @(#)tdname.for        19.1 (ES0-DMD) 02/25/03 14:11:18
 
2
C===========================================================================
 
3
C Copyright (C) 1995 European Southern Observatory (ESO)
 
4
C
 
5
C This program is free software; you can redistribute it and/or 
 
6
C modify it under the terms of the GNU General Public License as 
 
7
C published by the Free Software Foundation; either version 2 of 
 
8
C the License, or (at your option) any later version.
 
9
C
 
10
C This program is distributed in the hope that it will be useful,
 
11
C but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
C GNU General Public License for more details.
 
14
C
 
15
C You should have received a copy of the GNU General Public 
 
16
C License along with this program; if not, write to the Free 
 
17
C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
18
C MA 02139, USA.
 
19
C
 
20
C Corresponding concerning ESO-MIDAS should be addressed as follows:
 
21
C       Internet e-mail: midas@eso.org
 
22
C       Postal address: European Southern Observatory
 
23
C                       Data Management Division 
 
24
C                       Karl-Schwarzschild-Strasse 2
 
25
C                       D 85748 Garching bei Muenchen 
 
26
C                       GERMANY
 
27
C===========================================================================
 
28
C
 
29
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
30
C.COPYRIGHT: Copyright (c) 1987 European Southern Observatory,
 
31
C                                         all rights reserved
 
32
C
 
33
C.VERSION: 1.0  ESO-FORTRAN Conversion, AA  17:58 - 11 DEC 1987
 
34
C
 
35
C.LANGUAGE: F77+ESOext
 
36
C
 
37
C.AUTHOR: J.D.PONZ
 
38
C.IDENTIFICATION        TDNAME.FOR
 
39
C.KEYWORDS           TABLE, APPLICATIONS
 
40
C.ENVIRONMENT  MIDAS
 
41
C.PURPOSE
 
42
C  Transfroms the short name (optionally without file type),
 
43
C  into the long name with type appended
 
44
C
 
45
C
 
46
C------------------------------------------------------------------
 
47
      SUBROUTINE TDNAME(INNAME,TYPE,OUTNAM)
 
48
      IMPLICIT NONE
 
49
      CHARACTER*(*) INNAME ! IN  : short name
 
50
      CHARACTER*(*) TYPE   ! IN  : file type   
 
51
      CHARACTER*(*) OUTNAM ! OUT : long name
 
52
C
 
53
      CHARACTER*80  SDUM
 
54
C
 
55
      INTEGER I1,I2,I3
 
56
C
 
57
C ... search for end of name
 
58
C
 
59
      SDUM   = INNAME//' '
 
60
      I1     = INDEX(SDUM,' ') - 1
 
61
C
 
62
C ... search for VMS directory path
 
63
C
 
64
      I2     = INDEX(INNAME(1:I1),']')
 
65
C
 
66
C ... search for filename type
 
67
C
 
68
      I3     = INDEX(INNAME(I2+1:I1),'.')
 
69
C
 
70
C ... append file type if required
 
71
C
 
72
      IF (I3.EQ.0) THEN
 
73
          OUTNAM = INNAME(1:I1)//'.'//TYPE
 
74
 
 
75
      ELSE
 
76
          OUTNAM = INNAME
 
77
      END IF
 
78
 
 
79
      RETURN
 
80
 
 
81
      END