opening existing files with OPEN()
- From: maserda@xxxxxxxxx
- Date: Mon, 10 Sep 2007 19:29:18 -0000
Hi, I am trying to write my own program where I am trying to read
x,y,z points from an existing. The current beginning of my code has
been working well so far, until a few hours ago, where it says that it
can't find the existing files I'm telling it to find by name (even
though I am spelling the names correctly and making sure that file is
in the same directory).
Here is my code. Any suggestions of where I can look? Thanks:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
implicit none
double precision :: x_coord(100000), y_coord(100000), z_coord(100000),
z_max, z_min
integer :: i, j, openstatus, readstatus
! opening and creating proper files
character(25) :: Filename, newname, readin, writeout, junk
readin = "(F8.2, 1A, F9.2, 1A, F5.2)"
writeout = "(F5.2)"
write (*, '(1X, A)', ADVANCE = "no") "Enter name of bathymetry file:"
read *, Filename
open (12, file = Filename, status = "old", iostat = openstatus)
if (openstatus > 0) then
write (*, '(1X, A)') "***Cannot open file***"
stop
endif
write (*, '(1X, A)', ADVANCE = "no") "Enter name of desired shoreline
file:"
read *, newname
open (13, file = newname, status = "new", action = "write", iostat =
OPENSTATUS)
if (OPENSTATUS > 0) then
write (*, '(1X, A)') "***Cannot create new file***"
stop
endif
! defining variables in relation to bathymetry file and each other
do 01
do 02 i = 1, 100
write (*, writeout, iostat = readstatus) 1.0, ",", 2.0, ",", 3.0
if (readstatus > 0) then
write (*, '(1X,A)') "***Cannot read existing file***"
stop
endif
! if end of file is reached during reading the initial file
if (readstatus < 0) then
exit
endif
02 enddo
01 enddo
.
- Follow-Ups:
- Re: opening existing files with OPEN()
- From: maserda
- Re: opening existing files with OPEN()
- From: robert . corbett
- Re: opening existing files with OPEN()
- From: Richard Maine
- Re: opening existing files with OPEN()
- From: *** Hendrickson
- Re: opening existing files with OPEN()
- From: Steven G. Kargl
- Re: opening existing files with OPEN()
- Prev by Date: Re: TARGET and INTENT(IN)
- Next by Date: Re: opening existing files with OPEN()
- Previous by thread: a question regarding printing out format
- Next by thread: Re: opening existing files with OPEN()
- Index(es):