[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #BPR-855218]: Clarification on gennet.for
- Subject: [netCDF #BPR-855218]: Clarification on gennet.for
- Date: Thu, 08 May 2014 12:49:36 -0600
Hi,
> Thank you so much for your help.It is solved.
> I have a problem. when compiling gennet.for , in the output (readnet.for)
> in the data long_name, I am getting the following.
> C
> C LONG NAMES FOR EACH VARIABLE
> C
> data long_name/
> *'^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@',
>
> *'^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@',
...
> *'^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@'/
>
>
> Is it the problem with the netcdf file or something else???
Although gennet.for is an unsupported program contributed by its author,
I think I can answer this question. The problem is that gennet.for
seems to expect that every netCDF variable in the input always has
a "long_name" attribute. It tries to read the value of that attribute
for each variable, using the call
call ncagtc(ncid,i,'long_name',long_name(i),mtlen,rcode)
but then it doesn't check the return code in "rcode" to determine
whether such an attribute actually existed in the input file. So
the array long_name, declared as
character*50 long_name(100)
never gets any values, and is simply 5000 zero bytes. When the program
later attempts to print out the initialization of the "long_name" attribute
in the generated Fortran code, it just prints out the 5000 uninitialized
character values, and that's what zero bytes look like from a Fortran write
statement using the "a" format specifier:
write(10,894) long_name(i)
894 format(5x,'*',1h',a50,1h',',')
If you want to fix this, you would have to provide a test of rcode from
ncagtc(). If it indicated no such variable attribute as "long_name" existed,
you would have to avoid trying to print out the value in a data statement.
--Russ
> Thanking you
>
> Ticket ID: BPR-855218
> Subject: Clarification on gennet.for
> Department: Support netCDF
> Priority: Normal
>
>
>
>
>
> On Wed, May 7, 2014 at 11:28 AM, Tikemani Bag <address@hidden> wrote:
>
> > Hi,
> > I have installed netcdf-3.6.3. I checked
> >
> > ncdump --version
> >
> > It shows
> >
> > ncdump: invalid option -- '-'
> > ncdump [-c|-h] [-v ...] [[-b|-f] [c|f]] [-l len] [-n name] [-p n[,n]] [-x]
> > [-k] file
> > [-c] Coordinate variable data and header information
> > [-h] Header information only, no data
> > [-v var1[,...]] Data for variable(s) <var1>,... only
> > [-b [c|f]] Brief annotations for C or Fortran indices in data
> > [-f [c|f]] Full annotations for C or Fortran indices in data
> > [-l len] Line length maximum in data section (default 80)
> > [-n name] Name for netCDF (default derived from file name)
> > [-p n[,n]] Display floating-point values with less precision
> > [-x] Output XML (NcML) instead of CDL
> > [-k] Output kind of netCDF file
> > file Name of netCDF file
> > netcdf library version "3.6.3" of May 6 2014 23:24:51 $
> >
> > Does it mean netcdf -3.6.3 is not properly installed??
> >
> > I want to uninstall 3.6.3 and install 4.2. I have gcc (GCC) 4.7.2 20120921
> > (Red Hat 4.7.2-2) and GNU Fortran (GCC) 3.4.6 20060404 (Red Hat
> > 3.4.6-24.fc17) in fedora 17. Is it possible to install netcdf 4.2 on the
> > 3.6.3 version??I tried to install using command ''wget -O -
> > ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.gz" but its showing the
> > following
> > --2014-05-07 11:12:53--
> > ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.gz
> > => `-'
> > Resolving ftp.unidata.ucar.edu... 128.117.149.64
> > Connecting to ftp.unidata.ucar.edu|128.117.149.64|:21... connected.
> > Logging in as anonymous ... Logged in!
> > ==> SYST ... done. ==> PWD ... done.
> > ==> TYPE I ... done. ==> CWD (1) /pub/netcdf ... done.
> > ==> SIZE netcdf.tar.gz ... 4766305
> > ==> PASV ... ... couldn't connect to 128.117.149.64 port 44090:
> > Connection timed out
> > Retrying.
> >
> >
> > Is this link broken or I have to unistall 3.6.3. and then only 4.2 can be
> > installed?? In fact I am struggling to uninstall.
> >
> >
> > Ticket ID: BPR-855218
> > Subject: Clarification on gennet.for
> > Department: Support netCDF
> > Priority: Normal
> > Status: Open
> >
> >
> >
> > address@hidden> wrote:
> >
> >> Hi,
> >>
> >> > I installed netcdf-3.6.3 in fedora 17, then gennet.for programme. In my
> >> > case linnetcdf.a is in /usr/local/lib/. so I compiled with f77
> >> > gennet.for /usr/local/lib/libnetcdf.a .After command for outpot
> >> (./a.out)
> >> > and entering netcdf file name,It's showing error "NCAGTC: : NetCDF:
> >> > Attribute not found".
> >> > Need your help..
> >>
> >> Here's a previous answer I gave to this question that still applies,
> >> as far as I know:
> >>
> >>
> >> http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg03610.html
> >>
> >> --Russ
> >>
> >> Russ Rew UCAR Unidata Program
> >> address@hidden http://www.unidata.ucar.edu
> >>
> >>
> >>
> >> Ticket Details
> >> ===================
> >> Ticket ID: BPR-855218
> >> Department: Support netCDF
> >> Priority: Normal
> >> Status: Closed
> >>
> >>
> >
> >
> > --
> > *With Regards*
> > *Mr.Tikemani Bag*
> > *Ph D Student*,
> > *Department of Physics*
> >
> > *Indian Institute of Technology Roorkee Roorkee-247667,Uttarakhand*
> > *Mob:+91 7417497104*
> > *India*
> >
>
>
>
> --
> *With Regards*
> *Mr.Tikemani Bag*
> *Ph D Student*,
> *Department of Physics*
>
> *Indian Institute of Technology RoorkeeRoorkee-247667,Uttarakhand*
> *Mob:+91 7417497104*
> *India*
>
>
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu
Ticket Details
===================
Ticket ID: BPR-855218
Department: Support netCDF
Priority: Normal
Status: Closed