Changeset 1176 for XIOS/dev/branch_yushan_merged/extern/remap/src
- Timestamp:
- 06/21/17 09:09:59 (7 years ago)
- Location:
- XIOS/dev/branch_yushan_merged/extern/remap/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/extern/remap/src/libmapper.cpp
r1155 r1176 16 16 #include "gridRemap.hpp" 17 17 18 #include <stdio.h> 19 18 20 using namespace sphereRemap ; 19 21 20 extern CRemapGrid srcGrid;21 #pragma omp threadprivate(srcGrid)22 //extern CRemapGrid srcGrid; 23 //#pragma omp threadprivate(srcGrid) 22 24 23 extern CRemapGrid tgtGrid;24 #pragma omp threadprivate(tgtGrid)25 //extern CRemapGrid tgtGrid; 26 //#pragma omp threadprivate(tgtGrid) 25 27 26 28 … … 40 42 int order, int* n_weights) 41 43 { 42 assert(src_bounds_lon); 43 assert(src_bounds_lat); 44 assert(n_vert_per_cell_src >= 3); 45 assert(n_cell_src >= 4); 46 assert(dst_bounds_lon); 47 assert(dst_bounds_lat); 48 assert(n_vert_per_cell_dst >= 3); 49 assert(n_cell_dst >= 4); 50 assert(1 <= order && order <= 2); 44 printf("libmapper callded : remap_get_num_weights\n"); 45 assert(src_bounds_lon); 46 assert(src_bounds_lat); 47 assert(n_vert_per_cell_src >= 3); 48 assert(n_cell_src >= 4); 49 assert(dst_bounds_lon); 50 assert(dst_bounds_lat); 51 assert(n_vert_per_cell_dst >= 3); 52 assert(n_cell_dst >= 4); 53 assert(1 <= order && order <= 2); 51 54 52 55 mapper = new Mapper(MPI_COMM_WORLD); … … 87 90 double tic = cputime(); 88 91 mapper = new Mapper(MPI_COMM_WORLD); 89 mapper->setVerbosity(PROGRESS) ;92 mapper->setVerbosity(PROGRESS) ; 90 93 mapper->buildSSTree(src_msh, dst_msh); 91 94 double tac = cputime(); … … 122 125 double* centre_lon, double* centre_lat, double* areas) 123 126 { 127 printf("libmapper callded : remap_get_barycentres_and_areas\n"); 124 128 for (int i = 0; i < n_cell; i++) 125 129 { … … 145 149 extern "C" void remap_get_weights(double* weights, int* src_indices, int* dst_indices) 146 150 { 151 printf("libmapper callded : remap_get_weights\n"); 147 152 memcpy(weights, mapper->remapMatrix, mapper->nWeights*sizeof(double)); 148 153 memcpy(src_indices, mapper->srcAddress, mapper->nWeights*sizeof(int)); -
XIOS/dev/branch_yushan_merged/extern/remap/src/polyg.cpp
r950 r1176 3 3 #include <cassert> 4 4 #include <iostream> 5 #include <stdio.h> 5 6 #include "elt.hpp" 6 7 #include "errhandle.hpp" … … 161 162 { 162 163 if (N < 3) 163 return 0; /* polygons with less th en three vertices have zero area */164 return 0; /* polygons with less than three vertices have zero area */ 164 165 Coord t[3]; 165 166 t[0] = barycentre(x, N); … … 174 175 t[2] = x[ii]; 175 176 double sc=scalarprod(crossprod(t[1] - t[0], t[2] - t[0]), t[0]) ; 176 assert(sc >= -1e-10); // Error: tri a l'env (wrong orientation) 177 //assert(sc >= -1e-10); // Error: tri a l'env (wrong orientation) 178 if(sc < -1e-10) 179 { 180 printf("N=%d, sc = %f, t[0]=(%f,%f,%f), t[1]=(%f,%f,%f), t[2]=(%f,%f,%f)\n", N, sc, 181 t[0].x, t[0].y, t[0].z, 182 t[1].x, t[1].y, t[1].z, 183 t[2].x, t[2].y, t[2].z); 184 assert(sc >= -1e-10); 185 } 177 186 double area_gc = triarea(t[0], t[1], t[2]); 178 187 double area_sc_gc_moon = 0; -
XIOS/dev/branch_yushan_merged/extern/remap/src/triple.cpp
r1016 r1176 3 3 namespace sphereRemap { 4 4 5 externconst Coord ORIGIN(0.0, 0.0, 0.0);5 const Coord ORIGIN(0.0, 0.0, 0.0); 6 6 7 7 std::ostream& operator<<(std::ostream& os, const Coord& c) {
Note: See TracChangeset
for help on using the changeset viewer.