forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

compile F77 code with ftn: array bound error

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
zolotovo@gmail.com



Joined: 16 Aug 2012
Posts: 1

PostPosted: Thu Aug 16, 2012 1:35 pm    Post subject: compile F77 code with ftn: array bound error Reply with quote

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
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2629
Location: Sydney

PostPosted: Tue Aug 21, 2012 2:35 am    Post subject: Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2433
Location: Yateley, Hants, UK

PostPosted: Tue Aug 21, 2012 1:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2629
Location: Sydney

PostPosted: Thu Aug 23, 2012 2:06 am    Post subject: Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2433
Location: Yateley, Hants, UK

PostPosted: Thu Aug 23, 2012 10:07 am    Post subject: Reply with quote

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
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1943
Location: USA

PostPosted: Thu Dec 18, 2025 1:08 am    Post subject: A comforting closure to this thread. Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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