Skip to content

Commit

Permalink
Per #2227, changes to remove namespace std and netCDF from header files
Browse files Browse the repository at this point in the history
  • Loading branch information
Julie Prestopnik committed Oct 3, 2022
1 parent 9106192 commit 3877b64
Show file tree
Hide file tree
Showing 98 changed files with 682 additions and 553 deletions.
4 changes: 2 additions & 2 deletions src/basic/vx_util/crr_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CRR_Array {

void clear();

void dump(ostream &, int = 0) const;
void dump(std::ostream &, int = 0) const;

//
// set stuff
Expand Down Expand Up @@ -282,7 +282,7 @@ return;

template <typename T>

void CRR_Array<T>::dump(ostream & out, int depth) const
void CRR_Array<T>::dump(std::ostream & out, int depth) const

{

Expand Down
3 changes: 3 additions & 0 deletions src/libcode/vx_data2d_factory/is_netcdf_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ using namespace std;
#include <fcntl.h>
#include <cmath>

#include <netcdf>
using namespace netCDF;

#include "is_netcdf_file.h"

#include "vx_nc_util.h"
Expand Down
3 changes: 0 additions & 3 deletions src/libcode/vx_data2d_nc_met/data2d_nc_met.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
////////////////////////////////////////////////////////////////////////


#include <netcdf>
using namespace netCDF;

#include "data_plane.h"
#include "data_class.h"
#include "var_info_nc_met.h"
Expand Down
3 changes: 3 additions & 0 deletions src/libcode/vx_data2d_nc_met/get_met_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ using namespace std;
#include <string.h>
#include <cmath>

#include <netcdf>
using namespace netCDF;

#include "get_met_grid.h"

#include "nc_utils.h"
Expand Down
5 changes: 2 additions & 3 deletions src/libcode/vx_data2d_nc_met/get_met_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
////////////////////////////////////////////////////////////////////////

#include <netcdf>
using namespace netCDF;

#include "vx_grid.h"

////////////////////////////////////////////////////////////////////////

extern void read_netcdf_grid(NcFile *, Grid &);
extern void read_netcdf_grid(netCDF::NcFile *, Grid &);

extern int has_variable(NcFile *, const char *);
extern int has_variable(netCDF::NcFile *, const char *);

////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 3 additions & 0 deletions src/libcode/vx_data2d_nc_met/met_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ using namespace std;
#include <cmath>
#include <time.h>

#include <netcdf>
using namespace netCDF;

#include "vx_math.h"
#include "vx_cal.h"
#include "vx_log.h"
Expand Down
12 changes: 6 additions & 6 deletions src/libcode/vx_data2d_nc_met/met_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@ class MetNcFile {

void dump(std::ostream &, int = 0) const;

NcFile * Nc; // allocated
netCDF::NcFile * Nc; // allocated

//
// dimensions
//

int Ndims;

NcDim ** Dim; // allocated
netCDF::NcDim ** Dim; // allocated

StringArray DimNames;

NcDim * Xdim; // not allocated
NcDim * Ydim; // not allocated
netCDF::NcDim * Xdim; // not allocated
netCDF::NcDim * Ydim; // not allocated

//
// variables
Expand All @@ -92,9 +92,9 @@ class MetNcFile {
// data
//

double data(NcVar *, const LongArray &) const;
double data(netCDF::NcVar *, const LongArray &) const;

bool data(NcVar *, const LongArray &, DataPlane &) const;
bool data(netCDF::NcVar *, const LongArray &, DataPlane &) const;

bool data(const char *, const LongArray &, DataPlane &, NcVarInfo *&) const;

Expand Down
1 change: 0 additions & 1 deletion src/libcode/vx_data2d_nc_pinterp/data2d_nc_pinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


#include <netcdf>
using namespace netCDF;

#include "data_plane.h"
#include "data_class.h"
Expand Down
3 changes: 1 addition & 2 deletions src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@


#include <netcdf>
using namespace netCDF;

#include "vx_grid.h"

Expand All @@ -32,7 +31,7 @@ using namespace netCDF;

extern bool get_pinterp_grid(const char * pinterp_filename, Grid &);

extern bool get_pinterp_grid(NcFile &, Grid &);
extern bool get_pinterp_grid(netCDF::NcFile &, Grid &);


////////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 3 additions & 0 deletions src/libcode/vx_data2d_nc_pinterp/pinterp_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ using namespace std;
#include <cstdio>
#include <cmath>

#include <netcdf>
using namespace netCDF;

#include "vx_math.h"
#include "vx_cal.h"
#include "vx_log.h"
Expand Down
17 changes: 8 additions & 9 deletions src/libcode/vx_data2d_nc_pinterp/pinterp_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <ostream>

#include <netcdf>
using namespace netCDF;

#include "vx_grid.h"
#include "data_plane.h"
Expand Down Expand Up @@ -56,7 +55,7 @@ class PinterpFile {
void dump(std::ostream &, int = 0) const;


NcFile * Nc; // allocated
netCDF::NcFile * Nc; // allocated

//
// time
Expand All @@ -77,14 +76,14 @@ class PinterpFile {

int Ndims;

NcDim ** Dim; // allocated
netCDF::NcDim ** Dim; // allocated

StringArray DimNames;

NcDim * Xdim; // not allocated
NcDim * Ydim; // not allocated
NcDim * Zdim; // not allocated
NcDim * Tdim; // not allocated
netCDF::NcDim * Xdim; // not allocated
netCDF::NcDim * Ydim; // not allocated
netCDF::NcDim * Zdim; // not allocated
netCDF::NcDim * Tdim; // not allocated

//
// variables
Expand All @@ -108,9 +107,9 @@ class PinterpFile {
// data
//

double data(NcVar *, const LongArray &) const;
double data(netCDF::NcVar *, const LongArray &) const;

bool data(NcVar *, const LongArray &, DataPlane &, double & pressure) const;
bool data(netCDF::NcVar *, const LongArray &, DataPlane &, double & pressure) const;

bool data(const char *, const LongArray &, DataPlane &,
double & pressure, NcVarInfo *&) const;
Expand Down
3 changes: 3 additions & 0 deletions src/libcode/vx_data2d_nccf/data2d_nccf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ using namespace std;
#include <stdlib.h>
#include <cmath>

#include <netcdf>
using namespace netCDF;

#include "data2d_nccf.h"
#include "vx_math.h"
#include "vx_log.h"
Expand Down
3 changes: 0 additions & 3 deletions src/libcode/vx_data2d_nccf/data2d_nccf.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
////////////////////////////////////////////////////////////////////////


#include <netcdf>
using namespace netCDF;

#include "data_plane.h"
#include "data_class.h"
#include "var_info_nccf.h"
Expand Down
3 changes: 3 additions & 0 deletions src/libcode/vx_data2d_nccf/nccf_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ using namespace std;
#include <string>
#include <time.h>

#include <netcdf>
using namespace netCDF;

#include "vx_math.h"
#include "vx_cal.h"
#include "vx_log.h"
Expand Down
61 changes: 29 additions & 32 deletions src/libcode/vx_data2d_nccf/nccf_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

#include <ostream>

#include <netcdf>
using namespace netCDF;

#include "vx_grid.h"
#include "nc_utils.h"
#include "data_plane.h"
Expand Down Expand Up @@ -107,9 +104,9 @@ class NcCfFile {
// data
//

double getData(NcVar *, const LongArray &) const;
double getData(netCDF::NcVar *, const LongArray &) const;

bool getData(NcVar *, const LongArray &, DataPlane &) const;
bool getData(netCDF::NcVar *, const LongArray &, DataPlane &) const;

bool getData(const char *, const LongArray &, DataPlane &, NcVarInfo *&) const;

Expand All @@ -120,30 +117,30 @@ class NcCfFile {

static const double DELTA_TOLERANCE;

NcFile * _ncFile; // allocated
netCDF::NcFile * _ncFile; // allocated

//
// dimensions
//

int _numDims;

NcDim ** _dims; // allocated
netCDF::NcDim ** _dims; // allocated

StringArray _dimNames;

// Pointers to the X/Y and time dimensions and the associated coordinate
// variables. Note that these are pointers into the _dims and Var
// arrays so should not be deleted.

NcDim *_xDim;
NcDim *_yDim;
NcDim *_tDim;
netCDF::NcDim *_xDim;
netCDF::NcDim *_yDim;
netCDF::NcDim *_tDim;

NcVar *_latVar;
NcVar *_lonVar;
NcVar *_xCoordVar;
NcVar *_yCoordVar;
netCDF::NcVar *_latVar;
netCDF::NcVar *_lonVar;
netCDF::NcVar *_xCoordVar;
netCDF::NcVar *_yCoordVar;
NcVarInfo *_time_var_info;

void init_from_scratch();
Expand All @@ -163,29 +160,29 @@ class NcCfFile {
// grid member with that information.

void read_netcdf_grid();
void get_grid_from_grid_mapping(const NcVarAtt *grid_mapping_att);
void get_grid_from_grid_mapping(const netCDF::NcVarAtt *grid_mapping_att);

void get_grid_mapping_albers_conical_equal_area(const NcVar *grid_mapping_var);
void get_grid_mapping_azimuthal_equidistant(const NcVar *grid_mapping_var);
void get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_mapping_var);
void get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mapping_var);
void get_grid_mapping_lambert_cylindrical_equal_area(const NcVar *grid_mapping_var);
void get_grid_mapping_latitude_longitude(const NcVar *grid_mapping_var);
void get_grid_mapping_mercator(const NcVar *grid_mapping_var);
void get_grid_mapping_orthographic(const NcVar *grid_mapping_var);
void get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_var);
void get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_mapping_var);
void get_grid_mapping_stereographic(const NcVar *grid_mapping_var);
void get_grid_mapping_transverse_mercator(const NcVar *grid_mapping_var);
void get_grid_mapping_vertical_perspective(const NcVar *grid_mapping_var);
void get_grid_mapping_geostationary(const NcVar *grid_mapping_var);
void get_grid_mapping_albers_conical_equal_area(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_azimuthal_equidistant(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_lambert_azimuthal_equal_area(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_lambert_conformal_conic(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_lambert_cylindrical_equal_area(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_latitude_longitude(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_mercator(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_orthographic(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_polar_stereographic(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_rotated_latitude_longitude(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_stereographic(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_transverse_mercator(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_vertical_perspective(const netCDF::NcVar *grid_mapping_var);
void get_grid_mapping_geostationary(const netCDF::NcVar *grid_mapping_var);

bool get_grid_from_coordinates(const NcVar *data_var);
bool get_grid_from_coordinates(const netCDF::NcVar *data_var);
bool get_grid_from_dimensions();
void get_grid_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var,
void get_grid_from_lat_lon_vars(netCDF::NcVar *lat_var, netCDF::NcVar *lon_var,
const long lat_counts, const long lon_counts);

LatLonData get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var,
LatLonData get_data_from_lat_lon_vars(netCDF::NcVar *lat_var, netCDF::NcVar *lon_var,
const long lat_counts, const long lon_counts,
bool &swap_to_north);
};
Expand Down
3 changes: 3 additions & 0 deletions src/libcode/vx_nc_obs/nc_obs_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ using namespace std;

#include <iostream>

#include <netcdf>
using namespace netCDF;

#include "vx_nc_util.h"

#include "nc_obs_util.h"
Expand Down
Loading

0 comments on commit 3877b64

Please sign in to comment.