4 |
|
|
5 |
private :: cp_file_number, cp_open |
private :: cp_file_number, cp_open |
6 |
|
|
7 |
public :: cp_io_unit, cp_init, cp_write_open, cp_read_open, cp_close |
public :: cp_io_unit, cp_init, cp_write_open, cp_read_open, cp_close, cp_fNumber |
8 |
|
|
9 |
integer :: cp_file_number, cp_io_unit |
integer :: cp_file_number, cp_io_unit |
10 |
|
|
18 |
|
|
19 |
interface cp_write_open |
interface cp_write_open |
20 |
module procedure write_open_i |
module procedure write_open_i |
21 |
|
module procedure write_openX_i |
22 |
end interface |
end interface |
23 |
|
|
24 |
interface cp_read_open |
interface cp_read_open |
25 |
module procedure read_open_i |
module procedure read_open_i |
26 |
|
module procedure read_openX_i |
27 |
end interface |
end interface |
28 |
|
|
29 |
interface cp_close |
interface cp_close |
33 |
interface cp_findunit |
interface cp_findunit |
34 |
module procedure findunit_i |
module procedure findunit_i |
35 |
end interface |
end interface |
36 |
|
|
37 |
contains |
contains |
38 |
|
|
39 |
subroutine init_i |
subroutine init_i |
44 |
subroutine write_open_i() |
subroutine write_open_i() |
45 |
implicit none |
implicit none |
46 |
call cp_open() |
call cp_open() |
47 |
|
! print *, 'writing ', cp_file_number |
48 |
cp_file_number=cp_file_number+1 |
cp_file_number=cp_file_number+1 |
49 |
end subroutine |
end subroutine |
50 |
|
|
51 |
|
subroutine write_openX_i(X) |
52 |
|
implicit none |
53 |
|
integer X |
54 |
|
cp_file_number=X |
55 |
|
! print *, 'writing ', cp_file_number |
56 |
|
call cp_open() |
57 |
|
end subroutine |
58 |
|
|
59 |
subroutine read_open_i() |
subroutine read_open_i() |
60 |
implicit none |
implicit none |
61 |
cp_file_number=cp_file_number-1 |
cp_file_number=cp_file_number-1 |
62 |
|
! print *, 'reading ', cp_file_number |
63 |
|
call cp_open() |
64 |
|
end subroutine |
65 |
|
|
66 |
|
subroutine read_openX_i(X) |
67 |
|
implicit none |
68 |
|
integer X |
69 |
|
cp_file_number=X |
70 |
|
! print *, 'reading ', cp_file_number |
71 |
call cp_open() |
call cp_open() |
72 |
end subroutine |
end subroutine |
73 |
|
|
130 |
endif |
endif |
131 |
end subroutine |
end subroutine |
132 |
|
|
133 |
|
function cp_fNumber() |
134 |
|
integer cp_fNumber |
135 |
|
cp_fNumber=cp_file_number |
136 |
|
end function |
137 |
|
|
138 |
end module |
end module |