Find Docs

Astronomical Applications Department, U.S. Naval Observatory - novas c 2 doc (Page 38)

Wodocs >> Science : Astronomy >> Astronomical Applications Department, U.S. Naval Observatory novas c 2 doc Page 38
Astronomical Applications Department, U.S. Naval Observatory - novas c 2 doc
38
jplint, in turn, calls JPL subroutine pleph (Fortran code). The C function solarsystem has
a few features that make it possible for it to exchange data with the Fortran subroutine
jplint. First, all of the C arguments of the call to jplint are addresses, since Fortran uses
call by address instead of call by value for arguments of subroutines. Second, all of the
integer arguments in the call are designated as type
long int
in the C function to
match the Fortran
INTEGER
default. The
DOUBLE PRECISION
arguments in the
subroutine are designated as type
double
in the C function.
Probably the biggest hurdle in implementing version 2 of solarsystem will involve the
proper compiling and linking of the mixed-language files. The procedures will be
specific to your computing platform; therefore, you will have to consult your compiler
manual for detailed instructions. The following instructions are offered only as a
guideline ­ they provide a specific example of how the mixed-language files were
successfully handled on an IBM RISC System 6000 Unix workstation.
1. Create a single file with all of the JPL Fortran ephemeris access subroutines.
Name it jplsubs.f.
2. Compile the Fortran files without invoking the linkage editor. This creates the
object file jplsubs.o and jplint.o. The Fortran compiler/linker is
xlf
.
xlf -c jplsubs.f jplint.f
3. Compile, again without invoking the linkage editor, the C files novas.c,
novascon.c, solsys2.c, and readeph0.c. This creates the object files novas.o,
novascon.o, solsys2.o, and readeph0.o:
xlc -c -lm novas.c novascon.c solsys2.c readeph0.c
The C compiler/linker is
xlc
. The
-lm
option specifically searches the math library.
4. Finally, compile the main function and link it with the object files:
In this example, the resulting executable file is named app. Note especially the use of the
-l
option to force the C compiler/linker to search the Fortran libraries for unresolved
references.
create executable named "app"
search the C math library
search the Fortran
libraries (xlf90)
main function
object files
search in this directory
for -l libraries
xlc -L/usr/lib -lm -lxlf90 -o app main.c novas.o novascon.o solsys2.o readeph0.o jplsubs.o

<< Previous       1 .. 31 32 33 34 35 36 37 38 39 40 41 42 43 44       Next >>



Other Documents:
Beam Comp Example, moonpoly 2002, Newcomb, Newcomb Manual, Data Flow Diagrams, participant list, vondrak, zacharias, curvpath, pm AAS poster, Gaussian Distribution, Linear Least Squares, Sensitivity Integral, 3 D plot fits, lyap2, NAO 150, Rotate Vector, lyapcalc, wedges, Scifull, Precession Memo, Precession Maple, Curves 3 D, NOVAS 2004 Overview, NOVAS 2006 Overview, thesis, Ranson,


WODocs | |
All rights reserved. wodocs.comİ 2009
WODocs


New Docs

Documents Category:
Arts (Design, Movies, Music, Radio, Television)
Automotive (Cars, Marine, Motorcycle, ATV, Snowmobiles)
Business (Biotechnology and Pharmaceuticals, Chemicals, Construction and Maintenance, Materials, Real Estate, Services)
Electronics (Computers, Motion Control, Power Supply)
Games (Board, Family, Party, Card, Construction, RC Toys)
Health (Animalm, Beauty, Healthcare, Medicine, Pharmacy, Surgery, Weight Loss)
Home (Accessories, Cooking, Decor and Design, Electrical, Family, Pets)
News (Newspapers, Sports, Television)
Recreation (Collecting, Hiking, Scouting, Survival, Travel)
Reference (Education, Libraries and Archives, Museums)
Science (Agriculture, Astronomy, Biology, Chemistry)
Shopping (Antiques and Collectibles, Clothing, Flowers, Food, Home and Garden)
Sports (Bicycle, Snowboard, Skiing, Other)