[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 980121: NetCDF-3.3.1 and fortran compiler option -U
- Subject: Re: 980121: NetCDF-3.3.1 and fortran compiler option -U
- Date: Wed, 21 Jan 98 13:29:49 -0700
Randy,
> To: address@hidden
> From: address@hidden (Randy Zagar)
> Subject: NetCDF-3.3.1 and fortran compiler option -U
> Organization: University of Delaware/College of Marine Studies
> Keywords: 199801211830.LAA15243
In the above message, you wrote:
> #1 `uname -a` = SunOS frodo 5.4 Generic_101945-49 sun4m sparc
> #2 VERSION=3.3.1
> #4 CC = /opt/SUNWspro/bin/cc
> F77 = /opt/SUNWspro/bin/f77
>
>
> First and most importantly, let me state that I am running NetCDF v3.3.1
> and it passes all test-suites and (nearly) all of oury codes work properly.
>
> Here's my situation:
>
> One of our graduate students here is running a fluid-dynamics code
> called SPEM (spectral primitive equation model), and because of the
> number of variables in the code the default Makefile uses the following
> options
>
> f77 ... -u -U ...
>
> The -u option forces the compiler to abort on any undeclared variables,
> and the -U option preserves the case of symbol names used in the code.
> For example, if you were using the -U option then this code fragment would
> work properly
>
> X = 1
> x = 2
>
> IF (X.EQ.x) THEN
> PRINT *, 'warning: symbol names reduced to lower-case.'
> ENDIF
>
> The conflict I am experiencing occurs because there are only lower-case
> symbol names in libnetcdf.a (and in the spem code), and the function
> declarations in netcdf.inc are in upper-case.
>
> If I convert all the nc*() function calls to upper-case in the SPEM code,
> then I get unresolved symbols in the linking phase because the case of
> the symbols is preserved (e.g. looking for _NCOPN_ not _ncopn_ ).
>
> I worked around this problem by dumping the -u option (allowing untyped
> variables), and making sure that all of his netCDF function calls were
> in lower-case. I just wanted you to know that I/we aren't stuck, or
> anything like that, but that I wanted to offer a suggestion:
>
> Would it be possible, in the next minor release, to have additional
> ENTRY statements in the fortran code (and a -U in the makefile) so
> that we can have symbol names in both cases (upper & lower) ?
>
> An alternative to that would be to convert all the function declarations
> in netcdf.inc to use lower-case letters...
I think this is a better solution if it works. Would you please verify
that it does and let me know?
>
> I realize this probably isn't high on your list of priorities, but it's
> just a suggestion.
>
> - -Randy
>
>
> ===
>
> Randy Zagar E-Mail: address@hidden
> Sr. Scientific Programmer E-Mail: address@hidden
> College of Marine Studies Voice: (302) 831-1139
> University of Delaware FAX: (302) 831-6838
> Newark, DE 19716
It's a good suggestion. Thanks.
Please let me know what you discover.
--------
Steve Emmerson <http://www.unidata.ucar.edu>