Re: seeking advice for "translate" Fortran code to Java code
- From: "highegg" <highegg@xxxxxxxxx>
- Date: 23 Oct 2006 05:22:16 -0700
Ancient_Hacker wrote:
That's a fine start, with caveats. Many old FORTRAN programs would, to
save memory, redefine a common block as needed for each subroutine.
i.e: one might use: COMMON /VOLATILE/A(100,100,100) and another
unrelated subroutine: COMMON/VOLATILE/ Z(20,20,20). Ugly but very,
um, common. A lot of very useful programs were written back when
memory was $1 a word or more, and you couldnt put more than 256K on a
lot of computers, no matter how much money you had.
"Modernizers" exist that translate such archaisms into modern-style
POINTER aliasing
(with MODULES instead of COMMONs). Still, Java has no pointers, so I
wonder if
this is doable.
Not sure what you mean. Fortran standard doesn't know compile-time or(d) 4-D array slices passed as 2D arrays, as VAR parameters
Java arrays are always what C would call arrays of pointers
to arrays. If you want slices, create arrays of object
references to the appropriate subarrays.
I dunno, can you define a Java array of references to reals, referring
to a column of another array? Cool if doable. Unfortunately it
probably has to be done at run-time, while FORTRAN can do it at
compile-time.
run-time.
Unless a subroutine is inlined, slices are (in all compilers I know)
passed by a runtime-created array descriptor (for assumed shape) or by
runtime temporary copy (for explicit shape and assumed size, if
necessary).
I don't quite understand. Surely you would have to program all
(e) PURE and INTRINSIC functions
I don't know that Java has anything like this.
Well you can kinda fake it by writing an array-handling class that
can accept a function pointer or class type, if that's doable.
necessary
Fortran intrinsics in Java appropriately. But I don't recall Java
having anything like PURE.
(g) about 300 FORMAT statements
I believe Java finally has something close to C's printf.
It took a long time, though.
FORTRAN I/O can be hard to convert, especially things like implied
do-loops, repeated format specs, and binary I/O. I was hoping for a
FORTRAN I/O class that would emulate formatted and binary I/O.
I believe that Visual Numerics sells JMSL for Java. Of course, only(i) Calling over 30 routines from the FORTRAN IMSL and other libraries.
Probably through JNI, but if you really want to translate a program
to Java you might as well translate the library routines, too.
Probably from netlib to avoid copyright problems, though a translated
version would likely get around copyright. That is, it would be
a different expression of the ideas.
Yep, only problem is a lot of those libraries are matrix manipulation
packages, which suffer in Java from the very different array models,
not to mention speed issues.
portions
of IMSL functionality are covered.
No, it's deleted as of Fortran 95. SELECT should be used instead.(j) ASSIGNED go-to for error exit and recovery.
I thought ASSIGNed GOTO was removed from Fortran.It's "deprecated" I think, but really comes in handy for error exits.
(k) EQUIVALENCE,
What do you want to do with it?
Sooo many old programs would economize on memory by defining arrays on
top of each other by using EQUIVALENCE. Or matrix packages would map
variables onto well-known locations into an array. Ugly but still a
lot of that out there.
I agree that a general Fortran-to-Java converter is a difficult task
(and probably Fortran-to-anything). I would recommend to take advantage
of some Fortran "modernizers" already available and focus on converting
modern Fortran, which should be simpler. F could be a good start.
.
- References:
- seeking advice for "translate" Fortran code to Java code
- From: Shawn
- Re: seeking advice for "translate" Fortran code to Java code
- From: Ancient_Hacker
- Re: seeking advice for "translate" Fortran code to Java code
- From: AeroSpace Ed
- Re: seeking advice for "translate" Fortran code to Java code
- From: Ancient_Hacker
- Re: seeking advice for "translate" Fortran code to Java code
- From: glen herrmannsfeldt
- Re: seeking advice for "translate" Fortran code to Java code
- From: Ancient_Hacker
- seeking advice for "translate" Fortran code to Java code
- Prev by Date: Re: Q: Aligning data with cache lines in fortran 95 ?
- Next by Date: Re: Q: Aligning data with cache lines in fortran 95 ?
- Previous by thread: Re: seeking advice for "translate" Fortran code to Java code
- Next by thread: Re: seeking advice for "translate" Fortran code to Java code
- Index(es):
Relevant Pages
|