f27ca028c5
Patched version of 3.6.0 to fix potentially serious bug described at http://www.unidata.ucar.edu/packages/netcdf/docs/known_problems.html#cdf2-bug Changes 3.6.0: Added texinfo source for the documentation. Added large file tests to Windows directory in distribution. Modified win32 visual studio project files so that m4 is no longer required to build netcdf under visual studio. Modified rules.make to use install instead of cp, fixing install problem for cygwin users. Modified configure/install stuff to support HP-UX. Modified configure/install stuff to support G95. In the f90 interface, applied Arnaud Desitter's fixes to correct mismatches between scalar and array arguments, eliminating (legitimate) complaints by the NAGWare f95 compiler. Also fixed bugs introduced in 3.6.0-beta5 in the mapped array interfaces.
139 lines
3.8 KiB
Text
139 lines
3.8 KiB
Text
$NetBSD: patch-an,v 1.2 2005/02/25 09:52:47 adam Exp $
|
|
|
|
--- cxx/nctst.cpp.orig 2004-08-15 18:04:30.000000000 +0000
|
|
+++ cxx/nctst.cpp
|
|
@@ -1,6 +1,6 @@
|
|
#include <iostream>
|
|
using namespace std;
|
|
-
|
|
+#include <iostream>
|
|
#include <string.h>
|
|
#include "netcdfcpp.h"
|
|
|
|
@@ -22,7 +22,7 @@ void gen(const char* path, int version)
|
|
|
|
// Check if the file was opened successfully
|
|
if (! nc.is_valid()) {
|
|
- cerr << "can't create netCDF file " << path << "\n";
|
|
+ std::cerr << "can't create netCDF file " << path << "\n";
|
|
return;
|
|
}
|
|
|
|
@@ -138,12 +138,12 @@ void DumpableNcFile::dumpdims( void )
|
|
|
|
for (int n=0; n < num_dims(); n++) {
|
|
NcDim* dim = get_dim(n);
|
|
- cout << "\t" << dim->name() << " = " ;
|
|
+ std::cout << "\t" << dim->name() << " = " ;
|
|
if (dim->is_unlimited())
|
|
- cout << "UNLIMITED" << " ;\t " << "// " << dim->size() <<
|
|
+ std::cout << "UNLIMITED" << " ;\t " << "// " << dim->size() <<
|
|
" currently\n";
|
|
else
|
|
- cout << dim->size() << " ;\n";
|
|
+ std::cout << dim->size() << " ;\n";
|
|
}
|
|
}
|
|
|
|
@@ -151,10 +151,10 @@ void dumpatts(NcVar& var)
|
|
{
|
|
NcToken vname = var.name();
|
|
NcAtt* ap;
|
|
- for(int n = 0; ap = var.get_att(n); n++) {
|
|
- cout << "\t\t" << vname << ":" << ap->name() << " = " ;
|
|
+ for(int n = 0; (ap = var.get_att(n)); n++) {
|
|
+ std::cout << "\t\t" << vname << ":" << ap->name() << " = " ;
|
|
NcValues* vals = ap->values();
|
|
- cout << *vals << " ;" << endl ;
|
|
+ std::cout << *vals << " ;" << std::endl ;
|
|
delete ap;
|
|
delete vals;
|
|
}
|
|
@@ -167,20 +167,20 @@ void DumpableNcFile::dumpvars( void )
|
|
{"","byte","char","short","long","float","double"};
|
|
NcVar* vp;
|
|
|
|
- for(n = 0; vp = get_var(n); n++) {
|
|
- cout << "\t" << types[vp->type()] << " " << vp->name() ;
|
|
+ for(n = 0; (vp = get_var(n)); n++) {
|
|
+ std::cout << "\t" << types[vp->type()] << " " << vp->name() ;
|
|
|
|
if (vp->num_dims() > 0) {
|
|
- cout << "(";
|
|
+ std::cout << "(";
|
|
for (int d = 0; d < vp->num_dims(); d++) {
|
|
NcDim* dim = vp->get_dim(d);
|
|
- cout << dim->name();
|
|
+ std::cout << dim->name();
|
|
if (d < vp->num_dims()-1)
|
|
- cout << ", ";
|
|
+ std::cout << ", ";
|
|
}
|
|
- cout << ")";
|
|
+ std::cout << ")";
|
|
}
|
|
- cout << " ;\n";
|
|
+ std::cout << " ;\n";
|
|
// now dump each of this variable's attributes
|
|
dumpatts(*vp);
|
|
}
|
|
@@ -189,10 +189,10 @@ void DumpableNcFile::dumpvars( void )
|
|
void DumpableNcFile::dumpgatts( void )
|
|
{
|
|
NcAtt* ap;
|
|
- for(int n = 0; ap = get_att(n); n++) {
|
|
- cout << "\t\t" << ":" << ap->name() << " = " ;
|
|
+ for(int n = 0; (ap = get_att(n)); n++) {
|
|
+ std::cout << "\t\t" << ":" << ap->name() << " = " ;
|
|
NcValues* vals = ap->values();
|
|
- cout << *vals << " ;" << endl ;
|
|
+ std::cout << *vals << " ;" << std::endl ;
|
|
delete vals;
|
|
delete ap;
|
|
}
|
|
@@ -201,10 +201,10 @@ void DumpableNcFile::dumpgatts( void )
|
|
void DumpableNcFile::dumpdata( )
|
|
{
|
|
NcVar* vp;
|
|
- for (int n = 0; vp = get_var(n); n++) {
|
|
- cout << " " << vp->name() << " = ";
|
|
+ for (int n = 0; (vp = get_var(n)); n++) {
|
|
+ std::cout << " " << vp->name() << " = ";
|
|
NcValues* vals = vp->values();
|
|
- cout << *vals << " ;" << endl ;
|
|
+ std::cout << *vals << " ;" << std::endl ;
|
|
delete vals;
|
|
}
|
|
}
|
|
@@ -213,25 +213,25 @@ void dump(const char* path)
|
|
{
|
|
DumpableNcFile nc(path); // default is open in read-only mode
|
|
|
|
- cout << "netcdf " << cdl_name(path) << " {" << endl <<
|
|
- "dimensions:" << endl ;
|
|
+ std::cout << "netcdf " << cdl_name(path) << " {" << std::endl <<
|
|
+ "dimensions:" << std::endl ;
|
|
|
|
nc.dumpdims();
|
|
|
|
- cout << "variables:" << endl;
|
|
+ std::cout << "variables:" << std::endl;
|
|
|
|
nc.dumpvars();
|
|
|
|
if (nc.num_atts() > 0)
|
|
- cout << "// global attributes" << endl ;
|
|
+ std::cout << "// global attributes" << std::endl ;
|
|
|
|
nc.dumpgatts();
|
|
|
|
- cout << "data:" << endl;
|
|
+ std::cout << "data:" << std::endl;
|
|
|
|
nc.dumpdata();
|
|
|
|
- cout << "}" << endl;
|
|
+ std::cout << "}" << std::endl;
|
|
}
|
|
|
|
|