Fixed yorick_nc3, and necdf4 building (C++4). Fixed borg reading routines

This commit is contained in:
Guilhem Lavaux 2015-02-06 14:04:51 +01:00
parent 48900328d4
commit beb651c79a
4 changed files with 21 additions and 18 deletions

View File

@ -40,11 +40,10 @@ ENDIF(EXISTS ${NETCDFCPP_INCLUDE_PATH}/netcdf AND ${NETCDFCPP_LIBRARY} MATCHES "
find_program(CYTHON cython)
set(HDF5_FIND_COMPONENTS HL CXX)
if(HDF5_ROOTDIR)
SET(ENV{HDF5_ROOT} ${HDF5_ROOTDIR})
endif(HDF5_ROOTDIR)
include(FindHDF5)
find_package(HDF5 COMPONENTS HL CXX)
set(NETCDF_FIND_REQUIRED TRUE)

View File

@ -100,7 +100,7 @@ if (INTERNAL_NETCDF)
CONFIGURE_COMMAND ${NETCDF_SOURCE_DIR}/configure
--prefix=${NETCDF_BIN_DIR} --libdir=${NETCDF_BIN_DIR}/lib
--enable-netcdf-4 --with-pic --disable-shared --disable-dap
--disable-cdmremote --disable-rpc
--disable-cdmremote --disable-rpc --enable-cxx-4
--disable-examples ${EXTRA_NC_FLAGS} CC=${CMAKE_C_COMPILER}
CXX=${CMAKE_CXX_COMPILER}
BUILD_IN_SOURCE 1
@ -110,7 +110,7 @@ if (INTERNAL_NETCDF)
SET(EXTRA_NC_FLAGS CPPFLAGS=${CONFIGURE_CPP_FLAGS} LDFLAGS=${CONFIGURE_CPP_LDFLAGS})
SET(cosmotool_DEPS ${cosmotool_DEPS} netcdf)
SET(NETCDF_LIBRARY ${NETCDF_BIN_DIR}/lib/libnetcdf.a CACHE STRING "NetCDF lib" FORCE)
SET(NETCDFCPP_LIBRARY ${NETCDF_BIN_DIR}/lib/libnetcdf_c++.a CACHE STRING "NetCDF-C++ lib" FORCE)
SET(NETCDFCPP_LIBRARY ${NETCDF_BIN_DIR}/lib/libnetcdf_c++4.a CACHE STRING "NetCDF-C++ lib" FORCE)
SET(NETCDF_INCLUDE_PATH ${NETCDF_BIN_DIR}/include CACHE STRING "NetCDF include" FORCE)
SET(NETCDFCPP_INCLUDE_PATH ${NETCDF_INCLUDE_PATH} CACHE STRING "NetCDF C++ include path" FORCE)

View File

@ -217,7 +217,9 @@ def get_mean_density_fdir(fdir,init,steps):
fname0=fname0[init::steps]
fname1=fname1[init::steps]
MEAN0,ranges=read_borg_vol(fname0[0])
borg=read_borg_vol(fname0[0])
MEAN0 = borg.density
RANGES0 = borg.ranges
MEAN0=MEAN0*0.;
VAR0=copy(MEAN0)
MEAN1=copy(MEAN0)
@ -226,20 +228,22 @@ def get_mean_density_fdir(fdir,init,steps):
norm1=0.
for fn in fname0:
auxdata0,auxranges0=read_borg_vol(fn)
MEAN0+=auxdata0
VAR0+=auxdata0**2.
norm0+=1.
del auxranges0
del auxdata0
auxborg=read_borg_vol(fn)
auxdata0 = auxborg.density
MEAN0+=auxdata0
VAR0+=auxdata0**2.
norm0+=1.
del auxdata0
del auxborg
for fn in fname1:
auxdata1,auxranges1=read_borg_vol(fn)
MEAN1+=auxdata1
VAR1+=auxdata1**2.
norm1+=1.
del auxranges1
del auxdata1
auxborg1=read_borg_vol(fn)
auxdata1 = auxborg1.density
MEAN1+=auxdata1
VAR1+=auxdata1**2.
norm1+=1.
del auxdata1
del auxborg1
MEAN0/=norm0
VAR0/=norm0

View File

@ -37,7 +37,7 @@ knowledge of the CeCILL license and that you accept its terms.
#include "config.hpp"
#ifdef NETCDFCPP4
#include <netcdf>
using namespace netCDF
using namespace netCDF;
#else
#include <netcdfcpp.h>
#endif