Ignore:
Timestamp:
05/11/16 14:56:07 (8 years ago)
Author:
ymipsl
Message:

Remapper : manage some floating rounding error leading to some NAN

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/extern/remap/src/triple.cpp

    r688 r849  
    4040double arcdist(const Coord &x, const Coord &y) 
    4141{ // et angles aigus non orientes 
    42         Coord n = crossprod(x, y); 
    43         double a = asin(norm(n)); 
     42        double n = norm(crossprod(x, y)); 
     43  if (n>1.) n=1. ; 
     44        double a = asin(n); 
    4445        if (squaredist(x,y) > 2.0) a = M_PI - a; 
    4546        return a; 
Note: See TracChangeset for help on using the changeset viewer.