Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
getenvvr.f
Go to the documentation of this file.
1  subroutine get_env_var(inpfile,clen)
2 c
3 c-----Description-------------------------------------------------------
4 c
5 c Author/Date: Kelley Fugelso, 1265 (SEA) 07/89
6 c Mac mods February 19, 1993; hnw
7 c More mods May 14, 1993; kws
8 c Modifications:
9 c 03/07/95, MLK, format statement 945 exceeded 72 characters
10 c 06/09/95, MLK, converted some statements back to lowercase
11 c and commented out use of sub1,sub2,sub3,sub4
12 c 08/21/95, MLK, Moved opening of input file to this routine
13 c and made it system dependent to allow MAC
14 c version to open a file browser. UNIX and PC
15 c versions are identical. Included format
16 c statement number 5 directly. Also, removed
17 c READONLY option from open statement -- not
18 c standard Fortran.
19 c 02/14/97, MLK, Added machine dependencies for MS Powerstation
20 c version
21 c 08/13/97, MLK, Added defining the string base_filename to
22 c store the filename without the extension for
23 c DOS (otherwise, it is the full filename). This
24 c is used to name the LOG file. Also removed
25 c MAC_ABSOFT 'pause' statement -- apparently it
26 c is not needed.
27 c 03/31/98, MLK, Replaced all UNIX system dependencies and
28 c replaced with generic UNIX
29 c 2008-12-07 RBS Error message for bad input file name fixed.
30 c Clean up of legacy coments
31 c ----------------------------------------------------------------------
32 c
33 c Purpose: This subroutines contains ALL of the device dependent
34 c library calls in SCREAMER. These calls are used to obtain
35 c the values of various "environmental" variables which are
36 c needed by other subroutines in SCREAMER. The values are
37 c stored in the common block contained in zdemenv.h.
38 c
39 c Called by: Program ZDEM
40 c
41 c Calls: Subroutine CONV_TO_LCASE
42 c
43 c Modifications:
44 c
45 c 2012-04-10 RBS: Fixed the extra logfile text and cleaned up routine
46 c
47 c
48 c-----Include Files-----------------------------------------------------
49 c
50  include 'zdemenv.h'
51 c
52 c-----Passed variables
53 c
54 c inpfile is defined as character in zdemenv.h
55 c
56  integer clen
57 c
58 c-----Local Variables---------------------------------------------------
59 c
60  integer istart
61  character(len=80)::buffer
62  character dlfile*80, templog*80, logfile*80
63  character period*1
64  parameter(period = '.')
65 
66 c----Variables used in C++ wrapper JAM----------------------------------
67  istart=1
68  iend=clen
69 
70  open (unit=4, file=inpfile(istart:iend),
71  & err=999, status='old')
72 
73  base_filename(1:iend-istart+1) = inpfile(istart:iend)
74 c
75 c Create the log file based on the input file name
76 c
77  call strip(inpfile, i_1st, i_last)
78 c
79 c Strip off the extension
80 c
81  call strip_name(inpfile(i_1st:i_last),templog,lentmp)
82  logfile = templog(1:lentmp)//'.log'
83  open (unit= 9, file=logfile, status='UNKNOWN')
84 c
85 c Set a name for the temporary SCREAMER output parameter file
86 c
87  scr_parmfile='scrtmpfl'
88 
89  return
90 c
91 c Error found when opening the data file, so print a message and stop.
92 c
93  999 continue
94  write(buffer,'(A)')
95  & ' ### Unable to open the input file, exection halted.'
96  call writebuffer(buffer)
97 
98  stop
99  end
subroutine strip_name(text, name, start)
Definition: strpname.f:1
subroutine get_env_var(inpfile, clen)
Definition: getenvvr.f:1
subroutine strip(text, start, end)
Definition: strpblnk.f:1
c This is a Fortran header file
Definition: sfc.h:3