Closed asreimer closed 3 years ago
The Emmert paper was published in 2010, so things were updated sometime between while building apexpy?
Yes, in a discussion with Emmert, he stated that Maute had done the more recent updates for IGRF.
Thanks for suggesting those changes. I agree with and committed them.
Adding the tolerance to the unit tests is probably a good idea too. Although it's odd (concerning?) that we get different answers on macOS (or was it Windows?) vs. Fedora 33. Shouldn't we get the same numbers? AFAIK, Emmert's apex code is deterministic.
I wonder if adding something like: extra_f90_compile_args=['-fPIC']
to setup.py
would fix this? -fno-automatic
might also be needed. I had some issue like this in my flipchem package, where different OSes had different results due to different implicit compiler flags. Reading the Makefile, maybe we should at least include -fPIC
as an extra compile arg? This should probably be addressed in a separate issue.
I wonder if adding something like: extra_f90_compile_args=['-fPIC'] to setup.py would fix this? -fno-automatic might also be needed. I had some issue like this in my flipchem package, where different OSes had different results due to different implicit compiler flags. Reading the Makefile, maybe we should at least include -fPIC as an extra compile arg? This should probably be addressed in a separate issue.
I agree that we should look into this, it would be nice to ensure more consistent performance across OSes if there isn't a significant hint to performance. But having this as a separate issue would be best. That way we can test both the consistency and the runtime.
This PR makes several changes that complete the update to IGRF13 coefficients:
igrf13coeffs.txt
to all fortran programs and subroutines that use theCOFRM
subroutine inmagfld.f
. This includes:apex.f
,makeapexsh.f90
, andcheckapexsh.f90
.src/fortranapex/readme.txt
to include some dev notesfortranapex.pyf
filedocs/maintenance.rst
to include instructions for updatingapexsh.dat
.edit: Interesting note: according to the docstring of magfld.f in v1.0.2, is missing information about upgrading the file to IGRF12. If you compare the hard coded table of g(n,m) and h(n,m) in magfld.f with the IGRF12 coefficients file, they match up. The Emmert paper was published in 2010, so things were updated sometime between while building apexpy?
Comparing with this: https://github.com/NCAR/apex_fortran/blob/master/test.out, I get similar results. Note that we expect small errors comparing against the full apex code as stated in Emmert 2010.