Fortran -> IDL translator [message #2702] |
Wed, 31 August 1994 15:50  |
uk2
Messages: 8 Registered: June 1994
|
Junior Member |
|
|
Hi,
I was thinking about the logistics of writing a programme to convert
fortran source code into IDL. But I'd like to know whether (a) It's been
done (successfully); or (b) there is some reason why it's not a worthwhile
project. If it's neither, would anyone like to collaborate ?
Pete (uk2@lpl.arizona.edu)
|
|
|
|
Re: FORTRAN -> IDL [message #10718 is a reply to message #2702] |
Mon, 12 January 1998 00:00  |
Harald Frey
Messages: 41 Registered: March 1997
|
Member |
|
|
Kelly Dean wrote:
> I am converted some FORTRAN code into IDL, but I am confused what this
> FORTRAN statment "SINE(X)=SIN(.01745329*X) " in this function is trying
> to do.
>
> FUNCTION GETDIST (HEIGHT,ANGLE,ZENANG,SLANT)
> DATA RAD/3437.748/
> SINE(X)=SIN(.01745329*X)
> ARCSIN(X)=57.29578*ASIN(X)
> ANG=ABS(ANGLE)
> FAC=SINE(ANG)/RAD
> .
> .
> .
>
> Any hints?
>
> Kelly Dean
> CSU/CIRA
!pi/180.=0.0174533
Harald Frey
|
|
|
Re: FORTRAN -> IDL [message #10721 is a reply to message #2702] |
Sun, 11 January 1998 00:00  |
Robert S. Hill
Messages: 11 Registered: January 1998
|
Junior Member |
|
|
On Sun, 11 Jan 1998, Kevin Ivory wrote:
> Kelly Dean wrote:
>>
>> I am converted some FORTRAN code into IDL, but I am confused what this
>> FORTRAN statment "SINE(X)=SIN(.01745329*X) " in this function is trying
>> to do.
>
I think this may be a Fortran relic called a "statement function." In
that case, it would be defining a new function sine() for the scope of the
current program unit. A roughly similar thing is done nowadays in C using
a preprocessor definition with arguments.
Bob Hill
--
Robert.S.Hill.1@gsfc.nasa.gov Phone: 301-286-3624
Raytheon STX / Code 681, NASA/GSFC, Greenbelt, MD 20771
|
|
|
Re: FORTRAN -> IDL [message #10722 is a reply to message #2702] |
Sun, 11 January 1998 00:00  |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <34B9133C.3E4E6636@linmpi.mpg.de>, Kevin Ivory <Kevin.Ivory@linmpi.mpg.de> writes:
> Kelly Dean wrote:
>>
>> I am converted some FORTRAN code into IDL, but I am confused what this
>> FORTRAN statment "SINE(X)=SIN(.01745329*X) " in this function is trying
>> to do.
>
> It looks like it takes the angle in degrees X, calculates the sine
> and puts it into the Xth array element of the array SINE.
> Something like IDLs
> sine = sin(!dtor * x)
> where both x and sine are arrays.
No, I think this is what is called a "Statement Function" in FORTRAN. It is
basically a 1-line function definition. This one says that SINE(X) is the same
as SIN(X), except that it takes its argument in degrees rather than radians.
____________________________________________________________
Mark Rivers (773) 702-2279 (office)
CARS (773) 702-9951 (secretary)
Univ. of Chicago (773) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)
or:
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
|
|
|
Re: FORTRAN -> IDL [message #10723 is a reply to message #2702] |
Sun, 11 January 1998 00:00  |
Kevin Ivory
Messages: 71 Registered: January 1997
|
Member |
|
|
Kelly Dean wrote:
>
> I am converted some FORTRAN code into IDL, but I am confused what this
> FORTRAN statment "SINE(X)=SIN(.01745329*X) " in this function is trying
> to do.
It looks like it takes the angle in degrees X, calculates the sine
and puts it into the Xth array element of the array SINE.
Something like IDLs
sine = sin(!dtor * x)
where both x and sine are arrays.
Hope this helps
Kevin
--
Kevin Ivory Tel: +49 5556 979 434
Max-Planck-Institut fuer Aeronomie Fax: +49 5556 979 240
Max-Planck-Str. 2 mailto:Kevin.Ivory@linmpi.mpg.de
D-37191 Katlenburg-Lindau, GERMANY http://www.gwdg.de/~kivory2/
|
|
|