 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
| 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: 2629 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: 2433 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: 2629 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: 2433 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 |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1943 Location: USA
|
Posted: Thu Dec 18, 2025 1:08 am Post subject: A comforting closure to this thread. |
|
|
This thread was started 13 years ago. The original NASA FTP site and the HWM93 source codes are no longer accessible. There is, however, a successor code called HWM14, which is available at https://map.nrl.navy.mil/map/pub/nrl/HWM/HWM14/. This code is provided as a .tgz file which, when extracted, provides two Fortran-90 source files, two unformatted Fortran files with data for the program, and three text files that contain the output of the program when compiled with (i) Intel Fortran, (ii) Gfortran. The unformatted Fortran files are not compatible with FTN95. I was able to build EXEs using (i) Intel Fortran compiler IFX, (ii) Gfortran 13.4.0. The output from the two EXES matched the output files in the .tgz archive quite well. Unfortunately, the program uses some real type arrays without initialization, so it is not possible to draw any conclusions without knowing whether the authors wanted zero initialization. The output results are questionable, as well.
I still have the Microsoft FPS4.0 compiler, but it failed to compile the new sources. The Compaq Visual Fortran 6.6C failed, as well. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|