Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

a.out file
I would like to know how to > a.out infile return to run and
not a.out return, then infile return


Report this thread to moderator Post Follow-up to this message
Old Post
wiggy13
05-27-05 09:01 PM


Re: a.out file
wiggy13 wrote:
> I would like to know how to > a.out infile return to run and
> not a.out return, then infile return
>

Cottleston Cottleston Cottleston Pie,
A fly can't bird, but a bird can fly.
Ask me a riddle and I reply
Cottleston Cottleston Cottleston Pie.

Cottleston Cottleston Cottleston Pie,
Why does a chicken? I don't know why.
Ask me a riddle and I reply
Cottleston Cottleston Cottleston Pie.

Cottleston Cottleston Cottleston Pie,
A fish can't whistle and neither can I.
Ask me a riddle and I reply
Cottleston Cottleston Cottleston Pie.

-- A. A. Milne

Report this thread to moderator Post Follow-up to this message
Old Post
Rich Townsend
05-27-05 09:01 PM


Re: a.out file
In article <1117212099.575832.327450@z14g2000cwz.googlegroups.com>,
"wiggy13" <wiggy13@gmail.com> wrote:

> I would like to know how to > a.out infile return to run and
> not a.out return, then infile return

See <http://www.winteracter.com/f2kcli>

--
Richard Maine                       |  Good judgment comes from experience;
email: my first.last at org.domain  |  experience comes from bad judgment.
org: nasa, domain: gov              |        -- Mark Twain

Report this thread to moderator Post Follow-up to this message
Old Post
Richard E Maine
05-27-05 09:01 PM


Re: a.out file
anything for linux?


Report this thread to moderator Post Follow-up to this message
Old Post
wiggy13
05-27-05 09:01 PM


Re: a.out file
wiggy13 wrote:
> anything for linux?
>

f2kcli works with Linux. Alternatively, try "man getarg".

cheers,

Rich

Report this thread to moderator Post Follow-up to this message
Old Post
Rich Townsend
05-27-05 09:01 PM


Re: a.out file
In article <1117216007.924749.68480@g47g2000cwa.googlegroups.com>,
"wiggy13" <wiggy13@gmail.com> wrote:

> anything for linux?

Did you actually go check the reference I gave? The reason I was so
brief in my reply was

1. That site really has everything that you need to know on the subject,
including even mentions of other approaches. Anything I could say would
be just redundant. One of the nice things about the site is that it
saves me a lot of typing.

In particular, the site has information about options for almost every
operating system currently in widespread use (and some that aren't very
widespread at all). It certainly has plenty of information about Linux
options.

2. I assumed from your first post that you probably were not a native
English speaker and thus that it might help for me to be as brief and
simple as possible.

--
Richard Maine                       |  Good judgment comes from experience;
email: my first.last at org.domain  |  experience comes from bad judgment.
org: nasa, domain: gov              |        -- Mark Twain

Report this thread to moderator Post Follow-up to this message
Old Post
Richard E Maine
05-27-05 09:01 PM


Re: a.out file
let me look at it.

You see the problem is that if I type a.out then return
filein then return
I got output

however if I type a.out < infile  and enter I got problem

...........................................................................
...........
open: No such file or directory
apparent state: unit 10 named "Record Length"   2500    "Points"
-8.80000012e-009        0.0001414063
lately reading sequential formatted external IO
Abort (core dumped)
////////////////////////////////////////////////////////////////////////////
///////////////
program t
c
c  Author:  jason
c
c
c     implicit        NONE
c
c  constants
CHARACTER(LEN=5)  :: name,gna,nama2
integer           max_s
parameter         (max_s = 10000)  ! same as in driver prog
c  arguments and common blocks

integer           npar,iflag
*      double precision  futil, chi2, par(*), grad(*)
real              sum,sy
integer           num_points
real              x(max_s), y(max_s), dy(max_s), zd(max_s)
common            / data_block / num_points, zd, x, y, dy
c  local variables
character*80      infile
character*80      line
integer           i
integer           ios
integer           lun,luo
double precision  alpha
character*80       outfile1                   /'out1.dat'/
character*80       outfile2                   /'out2.dat'/
c   beginccccccccccccccccccccccccccccccccccc
cccccccccccccccccccc
c        write (*, *) 'enter file name for input data'
read (*, '(a80)') infile
lun = 10
open (unit=lun,  file=infile,form='formatted',ACCESS='DIR
ECT',
+  status='old')
 cccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccc
i = 0
ios = 0
do while ( ios .eq. 0 )
read (lun, fmt = '(a80)', iostat = ios) line
if (ios .eq. 0 .and.line(1:1) .ne. '"') then
i = i + 1
read (line, *) x(i),y(i)
endif
c       endif
end do

close (lun)
 cccccccccccccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccccc


do i = 1,125
sy = sy + y(i)
enddo
sy =sy/125.
sum = 0.
do i = 441,900
if (y(i).le.sy) then  !This is obtain from doing part c below
sum = sum+.5*abs((y(i)-sy)+(y(i+1)-sy))*(x(i+1)-x(i))
sumi = sumi+.5*abs((y(i)-sy)+(y(i+1)-sy))*((i+1)-(i))
endif
enddo
 cccccccccccccccccccccccccccccccccccccccc
ccccccccccc

write(*,*) 'Record Length= ',zd(1),' Points'
write(*,*) 'Sample Interval= ',zd(2),' s'
write(*,*) 'Trigger Point= ',zd(3),'Samples'
write(*,*) 'Trigger Time= ',zd(4), ' s'
write(*,*) 'Horizontial Offset= ',zd(6), 's'
write(*,*) '--------------------------'
write(*,*) 'ave at far y',sy/125.
write(*,*) 'final sum',sum
write(*,*) '1',x(1),y(1)
write(*,*) '7',x(7),y(7)
write(*,*) '8',x(8),y(8)

END

 ****************************************
***********************


Report this thread to moderator Post Follow-up to this message
Old Post
wiggy13
05-28-05 01:57 AM


Re: a.out file
In article <1117235333.201538.254820@g43g2000cwa.googlegroups.com>,
"wiggy13" <wiggy13@gmail.com> writes:
>
> however if I type a.out < infile  and enter I got problem

You are using file redirection on the command line.  The
first line of infile needs to please

>         read (*, '(a80)') infile

this read statement, so that

>         lun = 10
>         open (unit=lun,  file=infile,form='formatted',ACCESS='DIR
ECT',
>      +  status='old')

this open statement works.

Does your infile match these expectations?

--
Steve
http://troutmask.apl.washington.edu/~kargl/

Report this thread to moderator Post Follow-up to this message
Old Post
Steven G. Kargl
05-28-05 08:58 AM


Re: a.out file
There is a reason to this. I got many files that need to be read as
inputs.

a.out < infile would do the job without modifiy the source code.


Report this thread to moderator Post Follow-up to this message
Old Post
wiggy13
05-28-05 08:58 AM


Re: a.out file
wiggy13 wrote:

>There is a reason to this. I got many files that need to be read as
>inputs.
>
>a.out < infile would do the job without modifiy the source code.
>
>
>

echo infile | ./a.out

Report this thread to moderator Post Follow-up to this message
Old Post
John Doe
05-28-05 08:58 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:26 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.