da_openfile.inc
References to this file elsewhere.
1 subroutine da_openfile (kunit, cdfile, cdaccess, cdstatus, cdform)
2
3 !------------------------------------------------------------------------
4 ! Purpose: open an file and rewind
5 !
6 ! method:
7 ! ------
8 !
9 ! input:
10 ! -----
11 ! kunit: logical unit
12 ! cdfile: name of file for output of discared obs.
13 ! cda!ess: a!ess (sequential or),
14 ! cdstatus: status (old, new or unknown)
15 ! cdform: form (formatted or unformatted)
16 !
17 ! output:
18 ! ------
19 ! opened file
20 !
21 ! common: no
22 ! -------
23 ! external: no
24 ! --------
25 ! references: no
26 ! ----------
27 !
28 ! modifications:
29 ! --------------
30 ! original : 98-07 (f. vandenberghe)
31 ! additions : 98-11 norm doctor (f. vandenberghe)
32 !--------------------------------------------------------------------------
33
34 implicit none
35
36 integer, intent(in) :: Kunit
37 character*(*), intent(in) :: CDFILE, CDACCESS, CDSTATUS, CDFORM
38
39 integer :: iost
40
41 ! 1. open FILE
42 ! -------------
43
44 IOST = 0
45
46 open (unit = Kunit, &
47 FILE = CDFILE, &
48 ACCESS = CDACCESS, &
49 STATUS = CDSTATUS, &
50 FORM = CDFORM, &
51 ERR = 2000, &
52 iostat = IOST )
53
54 rewind (Kunit)
55
56 return
57
58 ! 2. ERROR PROCESSinG
59 ! --------------------
60
61 2000 continue
62 call da_error(__FILE__,__LINE__, &
63 (/"Cannot open file"//trim(CDFILE)/))
64
65 end subroutine da_openfile
66
67