Skip to content

Fortran wrapper for libsharp

Martin Reinecke requested to merge fortran-wrapper into master

Created by: dagss

The Fortran part in the fortran subdirectory is stand-alone and should be considered unstable. The test program in particular is a complete mess, and nothing is built by the makefiles. The intention is that anyone interested would copy the wrapper to their own project, possibly improve it, and contribute back.

Changes to C are nicely seperated out in the Commits tab. Summary:

  • sharp_map_size and sharp_alm_count functions to query for array sizes from descriptors
  • Move SHARP_REAL_HARMONICS flag to the alm_info construction (it is still supported to pass it to execute-functions for backwards compatability, and it should stay that way IMO, but documentation-wise it is moved to alm_info construction).
  • Added sharp_make_mmajor_real_packed_alm_info which constructs an alm_info in the scheme documented here: http://commander.readthedocs.org/en/latest/library_guide/sphere.html (note that this takes in ms to use for the given node, for use with MPI parallelization, but this is a bit inconsistent with similar routines..)
  • Introduce sharp_make_subset_healpix_geom_info which makes it possible to construct a HEALPix grid for only the rings given (intended usecase is MPI parallelization)

Testing

I use this script to build the test program using gfortran:

set -e
make
mpif90 -o fortran/sharp.o -c fortran/sharp.f90
mpif90 -I/usr/lib/openmpi/lib -Wall -Ifortran -fopenmp -o test_sharp fortran/test_sharp.f90 fortran/sharp.o -L auto/lib -lsharp -lfftpack -lc_utils
echo 'Running...'
mpiexec -np 2 ./test_sharp 

Merge request reports