For Programmers: Free Programming Magazines  


Home > Archive > Fortran > June 2005 > Some misc fortran advice please - cranking warnings, interpreting an error, lint, Tot









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Some misc fortran advice please - cranking warnings, interpreting an error, lint, Tot
Dan Stromberg

2005-06-07, 3:57 am


I'm a symin, working with a programmer who's having some fortran
troubles. I used to teach fortran, but I haven't used it in years, so I'm
much more current with C, bash and python. Anyway...

The programmer has inherited a body of fortran code. Apparently most of
it was written for Fortran 77, but some of it is written for Fortran 90,
with the two linked into a single executable.

He's getting some odd runtime errors, like a function that executes a
print *, but upon executing a return statement, never makes it to the
print * after the corresponding call.

I've been suggesting that to take care of his, he crank up the compiler
warning levels as high as they'll go, and hope that the error causing this
strangeness (which I've been presuming is due to the language runtime
getting corrupted somehow by one or more references, either reading or
writing, from or to undefined memory regions) is one of the errors
detected by the compiler or runtime system.

He's using xlf_r and xlf90_r on an AIX 5.1 ML 4 system.

One error that's been particularly puzzling to us is:

The following symbols are in error:
Symbol Hash Inpndx TY CL Source-File(Object-File) OR Import-File{Shared-object}
------------------------- ---------------------- ------- -- -- ------------------------------------------------------
.regrid_4x5_t42 Fort 26ACF12C 3BBCB187 [64] LD PR regrid_4x5_T42.f(regrid_4x5_T42.o)
** References Without Matching Definitions **
Fort 26ACF12C 20202020 [735] ER PR (pinpt.o)
[720] ER PR (pinit.o)
Fort 92E70B55 20202020 [1323] ER PR (pread.o)

....because we've checked and double checked and triple checked the
relevant types on the regrid_4x5_T42 definition and calls, and they all
seem to match up. Is this error not pointing to a call() that isn't
passing the right types? And why would two things hash to the same
20202020? What are those numbers in square brackets (EG "[64]")? What's
that "PR" stuff about? And is there a way of coaxing the compiler into
telling us -its- perception (Ok, it's probably right) of the types
involved, rather than making us "play computer"?

Also, is there free lint-like utility for fortran 77 and/or fortran 90?

Anyone out there familiar with the benefits of "TotalView", which appears
to be a debugger that handles fortran code?

Thanks!


beliavsky@aol.com

2005-06-07, 8:59 am

Dan Stromberg wrote:

<snip>

> Also, is there free lint-like utility for fortran 77 and/or fortran 90?


There are links to such tools at the Open Directory at
http://www.dmoz.org/Computers/Progr.../Code_Analysis/
.. For F77 code I suggest FTNCHEK at
http://www.dsm.fordham.edu/~ftnchek/ and for Fortran 90/95 the online
Lahey "Fortran Source Check" at http://www.lahey.com/check.htm . Both
are free.

Modules reduce (but do not eliminate) the need for a lint-like utility
in Fortran 90/95, just as function prototypes do in C and C++.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com