Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
opnoutfl.f
Go to the documentation of this file.
1  subroutine open_outfile (iunit, status, ierr)
2 c
3 c-----Description-------------------------------------------------------
4 c
5 c Purpose: This subroutine opens the SCREAMER output parameter file. If
6 c the calling routine specifies that this is a new file
7 c (status=1), the file is opened as new; if the calling routine
8 c specified that this is an existing file (status=2), the
9 c file is opened as old.
10 c Author: K.L.Fugelso, 1265 (SEA), 12/89
11 c
12 c Calls: None
13 c Called by: ZDEM$MAIN, FILVALS, IDRVALS, PLTVALS, PRTVALS,
14 c TABVALS, UFOVALS
15 c
16 c Modifications:
17 c 08/12/97, KWS, modified open statement for DOS-Leahy compiler so that
18 c existing file (from a previous run) will be overwritten.
19 c This caused this module to become machine-dependent.
20 c 03/31/98, MLK, Replaced all UNIX system dependencies and replaced with
21 c generic UNIX
22 c 2014-02-06 RBS: Changed real*4 to real
23 c
24 c-----Include Files-----------------------------------------------------
25 c
26  include 'zdemenv.h'
27 c
28 c-----Input Parameters--------------------------------------------------
29 c
30  integer iunit, ! Logical unit # of SCREAMER output param file
31  + status ! Val. of 1 indicates new file; 2, old file
32 c
33 c-----Output Parameters-------------------------------------------------
34 c
35  integer ierr ! Error flag
36 c
37 c-----Local Variables---------------------------------------------------
38 c
39  integer new, ! Parameter corresponding to status of new file
40  + old ! Parameter corresponding to status of old file
41  real dummy ! Dummy variable used to read 1st 2 recs in file
42  parameter(new=1, old=2)
43 c
44 c-----Subroutine Body---------------------------------------------------
45 c
46  if (status .eq. new) then
47  open (unit=iunit,file=scr_parmfile,form='unformatted',
48  + status='new', iostat=ierr)
49  open (unit=iunit,file=scr_parmfile,form='unformatted',
50  + status='replace', iostat=ierr)
51  elseif (status .eq. old) then
52  open (unit=iunit,file=scr_parmfile,form='unformatted',
53  + status='old',iostat=ierr)
54  read (iunit,iostat=ierr)dummy
55  read (iunit,iostat=ierr)dummy
56 c
57  endif
58 c
59 c-----Return to Calling Routine-----------------------------------------
60 c
61  return
62  end
subroutine open_outfile(iunit, status, ierr)
Definition: opnoutfl.f:1
c This is a Fortran header file
Definition: sfc.h:3