geodynamics / axisem

AxiSEM is a parallel spectral-element method to solve 3D wave propagation in a sphere with axisymmetric or spherically symmetric visco-elastic, acoustic, anisotropic structures.
67 stars 31 forks source link

Remove Numerical Recipes code #39

Closed QuLogic closed 8 years ago

QuLogic commented 9 years ago

There are at least four instances with explicit references:

$ grep -IRi 'numerical recipe'
SOLVER/unrolled_loops.f90:  ! outer product (dyadic) from numerical recipes
SOLVER/unrolled_loops.f90:  ! outer product (dyadic) from numerical recipes
SOLVER/source.f90:!> Calculates the error function, coefficients taken from Numerical Recipes
MESHER/numbering.f90:  ! Use Heap Sort (Numerical Recipes)

The license of Numerical Recipes does not allow for redistribution in source code form and is incompatible with the GPL license used by AxiSEM.

martinvandriel commented 9 years ago

The first two are from the public domain part of NR:

http://www.nr.com/public-domain.html

The third does not use the code, but just the coefficients, so I doubt this has a problem with the license

The last one is a copy from an early version of specfem, I am not sure if by the time specfem was under GPL. This is hard to track, because both codes where not in subversion systems back then. In other places we use our own parallel implementation of mergesort, and I think we might just use it here as well.

QuLogic commented 9 years ago

Okay, maybe those first two should indicate they're from the public domain part (though that is a nebulous term).

The heap sort was removed from specfem by me due to the aforementioned licensing issues. It really doesn't matter when it came from; it's from NR and must go.

martinvandriel commented 9 years ago

Can you point me to the new sorting routine in specfem? I can only find this one, which to me appears to be the same we use:

https://github.com/geodynamics/specfem3d/blob/aaef3ff2527d101573b583e528fa48700e0e039c/utils/small_SEM_solvers_in_Fortran_and_C_without_MPI_to_learn/mesher_for_serial/sort_array_coordinates.f90#L129-L189

Could it be, that the get_global was also replaced in specfem?

martinvandriel commented 9 years ago

Nevermind, I found it:

https://github.com/geodynamics/specfem3d/blob/9abd01ab2c96c3a7cf9a5bad3c1245e5320f845a/src/shared/sort_array_coordinates.f90#L126

QuLogic commented 9 years ago

Yes, that's right. Thanks for pointing out that other copy; I've removed it also.