/*************************************************************************** geopack.h - header to integrate the Tsyganenko GEOPACK FORTRAN routines into a C++ program ------------------- begin : Mon Aug 27 2003 copyright : (C) 2003 by Andrew O'Neill,HiRes Grad Student email : oneill@phys.columbia.edu ***************************************************************************/ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GEOPACK_H #define GEOPACK_H #include "aon_debug.h" #include "aon_vector.h" //#ifdef INTEL //#else //#include // has type conversion info for g77 //#endif typedef float real; // Define the fortran subroutines as "C" externs, so that we can use // them in C++ // Function: recalc() // sets up FORTRAN common blocks which hold the parameters for the // model // INPUT: date extern "C" { void recalc_ (int& IYEAR, int& IDAY, int& IHOUR, int& MIN, int& ISEC); } // Function: igrf_geo() // Calculates the magnetic field at a specific point in space and time // INPUT: Position (r, theta, phi) in R_Earths, radians, radians // OUTPUT: Magnetic field, B (r, theta, phi) (in nanotesla) // i.e. the outward radial, south and east components of the // magnetic field // NOTE: The common blocks defined above must previously be set up // by calling recalc() #ifdef INTEL extern "C" { void igrf_geo_ (real& R, real& THETA, real& PHI, real& BR, real& BTHETA, real& BPHI); } #else // NOTE: The second underscore is a weird requirement for FORTRAN subroutines // which contain underscores already, at least on GNU systems extern "C" { void igrf_geo__ (real& R, real& THETA, real& PHI, real& BR, real& BTHETA, real& BPHI); } // void igrf_geo_(real& R, real& THETA, real& PHI, real& BR, real& BTHETA, // real& BPHI) { igrf_geo__(R, THETA, PHI, BR, BTHETA, BPHI); } #endif // Function: bspcar() // Transforms r, theta, phi components of mag field // at position (Phi, Lambda) into XYZ cartesian // INPUT: Spherical position Theta, Phi in radians (spherical coords, not // latitude/lonitude // Components of field along spherical unit vectors // OUTPUT: components of field along cartesian unit vectors extern "C" { void bspcar_ (real& THETA,real& PHI, real& BR, real& BTHETA, real& BPHI, real& BX, real& BY, real& BZ); } #endif