Compiling the FORTRAN code for CoMP analysis

The CoMP-type coronal polarimetry forward modeling use Fortran routines requiring a Fortran compiler.

IMPORTANT—PROBABLY YOU NEED TO COMPILE ON THE SAME MACHINE YOU RUN ON.

  • First make sure you have a Fortran compiler. GFORTRAN and G77 are possibilities (note G77 is considered obsolete however).

  • Mac/Linux
    • Rename compiler if necessary: edit makefile
      • In the first few lines, FC and LINK should be changed from gfortran to g77 if that is your compiler
    • Remove any old .o files and compiled code (if they are there), and recompile the fortran code on your machine.
      • cd $FORWARD/FORCOMP
      • rm forcomp
      • rm *.o
      • make forcomp
      • If this fails, you may need to install command line tools in Xcode, from command line try: "xcode-select —install".
        Or else you may be able to do this from the XCode preferences/downloads.
    • SAVE your executable (forcomp) to $FORWARD_WORKING_DIR.
      • By saving your own, platform-specific executable you don't have to recompile every time FORWARD updates.
        If you run into problems, you might check the date stamp on the files in $FORWARD/FORCOMP.
        The Fortran codes are not updated often, but if they are, you need to recompile.

  • Windows
    • Open command line under Windows
      • Note: to change to directory in Windows terminal, sometimes you need first to change disks. Example, say you are in D, but want to go to C, from prompt type: "C:", then you can chage to a directory in that disk: "CD C:\G77".
    • Rename compiler if necessary:
      • In the first few lines, FC and LINK should be changed from gfortran to g77 if that is your compiler.
    • You may have to initialize the compiler
      • (for example, if you have G77):
        • g77setup
    • ALSO you may need to add these lines to your SSWIDL.BAT file:
      • (for example, if you have G77):
        • SET OLDPATH=%PATH%
        • PATH=C:\g77\bin;%PATH%
        • SET LIBRARY_PATH=C:\g77\lib
    • Compile
      • From command line type: "make forcomp"
    • SAVE your executable (forcomp) to $FORWARD_WORKING_DIR.
      • By saving your own, platform-specific executable you don't have to recompile every time FORWARD updates.
        If you run into problems, you might check the date stamp on the files in $FORWARD/FORCOMP.
        The Fortran codes are not updated often, but if they are, you need to recompile.