mirror of
https://github.com/Unidata/netcdf-cxx4.git
synced 2025-02-17 18:59:31 +08:00
Removing example test that Aodhan created.
This commit is contained in:
parent
648f70d78b
commit
1d56a8d8c4
@ -12,7 +12,6 @@ IF(NCXX_ENABLE_TESTS)
|
||||
add_bin_test(examples simple_xy_rd)
|
||||
add_bin_test(examples sfc_pres_temp_rd)
|
||||
add_bin_test(examples simple_xy_wr_formats)
|
||||
build_bin_test(aodhan_trial)
|
||||
|
||||
IF(NC_HAS_DEF_VAR_FILTER)
|
||||
build_bin_test(pres_temp_4D_plugin_wr)
|
||||
|
@ -10,7 +10,7 @@ LDADD = -lnetcdf
|
||||
# These are the example programs.
|
||||
TESTPROGRAMS = simple_xy_wr sfc_pres_temp_wr pres_temp_4D_wr \
|
||||
pres_temp_4D_rd simple_xy_rd sfc_pres_temp_rd simple_xy_wr_formats \
|
||||
aodhan_trial pres_temp_4D_plugin_wr pres_temp_4D_plugin_rd
|
||||
pres_temp_4D_plugin_wr pres_temp_4D_plugin_rd
|
||||
check_PROGRAMS = $(TESTPROGRAMS)
|
||||
|
||||
# Ship also this script, which compares the output of these C++
|
||||
@ -28,7 +28,6 @@ pres_temp_4D_rd_SOURCES = pres_temp_4D_rd.cpp
|
||||
pres_temp_4D_plugin_wr_SOURCES = pres_temp_4D_plugin_wr.cpp
|
||||
pres_temp_4D_plugin_rd_SOURCES = pres_temp_4D_plugin_rd.cpp
|
||||
simple_xy_wr_formats_SOURCES = simple_xy_wr_formats.cpp
|
||||
aodhan_trial_SOURCES = aodhan_trial.cpp
|
||||
|
||||
# Run all example programs, plus the do_comps.sh script, which checks
|
||||
# that all the output files are the same as the C example output
|
||||
|
@ -1,60 +0,0 @@
|
||||
//Trial of making my own netcdf code to become more comfortable
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <netcdf>
|
||||
using namespace std;
|
||||
using namespace netCDF;
|
||||
using namespace netCDF::exceptions;
|
||||
|
||||
static const int NLAT = 6;
|
||||
static const int NLON = 12;
|
||||
|
||||
#define BZIP2_ID 307
|
||||
#define BZIP2_LEVEL 9
|
||||
unsigned int level = BZIP2_LEVEL;
|
||||
|
||||
float lats[NLAT];
|
||||
float lons[NLON];
|
||||
|
||||
float pres[NLAT][NLON];
|
||||
float temp[NLAT][NLON];
|
||||
|
||||
int main(){
|
||||
std::cout<<"============================\n this is the example output \n ";
|
||||
|
||||
NcFile dataFile("simple_xy_nc4.nc", NcFile::read);
|
||||
string newname_is = "new_file";
|
||||
NcVar grid_data;
|
||||
grid_data = dataFile.getVar("data");
|
||||
|
||||
cout<<"there are "<<dataFile.getVarCount()<<" variables"<<endl;
|
||||
cout<<"there are "<<dataFile.getAttCount()<<" attributes"<<endl;
|
||||
cout<<"there are "<<dataFile.getDimCount()<<" dimensions"<<endl;
|
||||
cout<<"there are "<<dataFile.getGroupCount()<<" groups"<<endl;
|
||||
cout<<"there are "<<dataFile.getTypeCount()<<" types"<<endl;
|
||||
|
||||
|
||||
NcFile data("sfc_pres_temp.nc", NcFile::write);
|
||||
|
||||
|
||||
data.open("sfc_pres_temp.nc", NcFile::write);
|
||||
|
||||
//using redef() wrapper
|
||||
data.redef();
|
||||
|
||||
//using set_Fill() wrapper
|
||||
|
||||
//using filter functionality
|
||||
NcVar latitude = data.getVar("latitude");
|
||||
NcVar longitude = data.getVar("longitude");
|
||||
NcVar pressure = data.getVar("pressure");
|
||||
NcVar temperature = data.getVar("temperature");
|
||||
|
||||
|
||||
latitude.getVar(lats);
|
||||
longitude.getVar(lons);
|
||||
pressure.getVar(pres);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user