This commit is contained in:
张壹 2025-02-07 11:56:53 +08:00
parent c413814a8b
commit 0212883ec7
5 changed files with 10 additions and 4 deletions

View File

@ -57,6 +57,8 @@ if(GCTL_OPENBLAS)
endif()
if(GCTL_NETCDF)
find_package(HDF5)
if(NOT netCDF_FOUND)
find_package(netCDF REQUIRED)
include_directories(${netCDF_INCLUDE_DIR})

View File

@ -31,6 +31,8 @@ message(STATUS "[GCTL] Check Size: " @GCTL_CHECK_SIZE@)
set(CMAKE_CXX_STANDARD 11)
if(@PROJECT_NAME@_NETCDF)
find_package(HDF5)
if(NOT netCDF_FOUND)
find_package(netCDF REQUIRED)
include_directories(${netCDF_INCLUDE_DIR})

View File

@ -47,6 +47,8 @@ if(GCTL_NETCDF)
target_link_libraries(gctl_static ${netCDF_CXX_LEGACY_LIB})
target_link_libraries(gctl PUBLIC ${netCDF_LIBRARIES})
target_link_libraries(gctl_static ${netCDF_LIBRARIES})
target_link_libraries(gctl PUBLIC ${HDF5_LIBRARIES})
target_link_libraries(gctl_static ${HDF5_LIBRARIES})
endif()
#

View File

@ -25,10 +25,10 @@
* Also add information on how to contact you by electronic and paper mail.
******************************************************/
#include <cmath>
#include <algorithm>
#include <string>
#include <iostream>
#include <cmath>
#include <map>
#include <vector>
@ -40,7 +40,7 @@ bool gctl::geometry2d::collinear(const point2dc &a, const point2dc &b,
{
point2dc at = t - a;
point2dc ab = b - a;
double cos_arc = dot(at, ab)/(at.module()*ab.module());
long double cos_arc = dot(at, ab)/(at.module()*ab.module());
if (sqrt(1.0 - cos_arc*cos_arc)*at.module() <= cut_off)
return true;
else return false;

View File

@ -2003,7 +2003,7 @@ void gctl::mesh_io::save_data_to_xyz(std::string filename, std::string dataname,
if (out_coor == Spherical)
{
ps = vptr->c2s();
ps.rad -= ellipse_radius_2d(refR, refr, ps.lat*M_PI/180.0);
ps.rad -= ellipse_radius_2d(refR, refr, ps.lat*GCTL_Pi/180.0);
ofile << ps.lon << " " << ps.lat << " " << ps.rad << " " << datas_[i].val[n] << "\n";
}
@ -2034,7 +2034,7 @@ void gctl::mesh_io::save_data_to_xyz(std::string filename, std::string dataname,
if (out_coor == Spherical)
{
ps = pc.c2s();
ps.rad -= ellipse_radius_2d(refR, refr, ps.lat*M_PI/180.0);
ps.rad -= ellipse_radius_2d(refR, refr, ps.lat*GCTL_Pi/180.0);
ofile << ps.lon << " " << ps.lat << " " << ps.rad << " " << datas_[i].val[e] << "\n";
}