Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

some fortran 77 language question

Status
Not open for further replies.

consideration

Programmer
Aug 19, 2005
4
DE
hi,
i'm very new to FORTRAN 77 and i hope someone
can help me out.

1.code :
real*8 pa(1), sa(1), ra(1), ea(1), ta(1), aa(1), ha(1)
integer npts, mflag

can anyone explain me the term "pa(1)" in c++ language ?
what does "(1)" stand for ? array ?

2.code :
rhos = (ps / s5) ** (1.0d0 / gama)

what does "**" stand for (in c++) ??

THANKS in Advance (really!)
 
real*8 pa(1) is an array of type 8 byte real with a single element.

The "**" symbol raises a variable to a power.

3.0 ** 2.0 = 9.0

Hope that helps a little.
 
pa(1) means pa[1] but in Fortran arrays begin at 1: not at 0 so if you are translating to C++ and wish to use it as is then all the arrays need to be increased by 1.

For ** use pow.
 
real*8 corresponds to the C type of double.

It used to be called double precision in the old days...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top