View previous topic :: View next topic |
Author |
Message |
zolotovo@gmail.com
Joined: 16 Aug 2012 Posts: 1
|
Posted: Thu Aug 16, 2012 1:35 pm Post subject: compile F77 code with ftn: array bound error |
|
|
Dear All,
I am trying to compile HWM93 model ( ftp://nssdcftp.gsfc.nasa.gov/models/atmospheric/hwm93/ ) using ftn95 personal edition, but it gives me at compile-time a set of errors like
*** Array subscript for first rank of PB, 26, is greater than the declared
upper bound, 1
Is it possible to compile this model (which is F77 code) by playing
some options i.e. without source code modification? (I have a plenty
of code - except HWM93 - with such 'features', so modification will
cause a lot of old F77 code).
PS
This code is compiled with FPS4.0 without errors. The errors are due to array bounds checks (which is in F90, but not in F77). |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2580 Location: Sydney
|
Posted: Tue Aug 21, 2012 2:35 am Post subject: |
|
|
You could try ftn95 /? in the command prompt to see a list of compiler options.
To overcome the old dimension a(1) syntax, the following compile option should overcome this for subroutine and function arguments:
ftn95 program /Old_arrays
John |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Tue Aug 21, 2012 1:53 pm Post subject: |
|
|
I'm a big fan of Fortran 77, as a lot of the newer stuff either duplicates what is already there, or proposes an alternative - often, in my view, no better or probably worse than the original. However, when I took a look at the source code for which the link was given I was completely appalled - nobody could maintain or update code written like that.
Good luck to you Zolotovo, you are going to need it!
Eddie |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2580 Location: Sydney
|
Posted: Thu Aug 23, 2012 2:06 am Post subject: |
|
|
Eddie,
That was the way some codes developed, when we only had the 026 card punch! The IDE is a long way from those difficult days.
John |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Thu Aug 23, 2012 10:07 am Post subject: |
|
|
John,
I never wrote code like that.
Mind you, as far as compiling and running goes, it's probably quite fast.
When you see code like that from NASA, it turns you into a believer that the moon landings WERE filmed in a studio!
Eddie |
|
Back to top |
|
|
|