Compiling MORSE


System Requirements

Compiling MORSE is essentially the same as RFM v5.0. You will need a FORTRAN 2003 or later compiler (any generic Fortran compiler will probably work).

The MORSE code is entirely self-contained; you don't need any other libraries.

Unpacking the MORSE tar file

MORSE is distributed as a compressed 'tar' file which can be unpacked by moving it to a new folder and typing

tar -xzf morse_v4.00.tar.gz
This will expand into several hundred modules with the extension .f90, and a 'makefile'.

There is a single program module morse.f90 and a number of modules containing single subroutines *_sub.f90, functions *_fnc.f90 and data *_dat.f90. Also a few 'generic' modules *_gen.f90 containing different versions of subroutines or functions for operating on different data types (real, double precision etc).

To compile MORSE on a linux operating system, you can either use the simple method, or use the makefile.

Simple Compilation

Type, e.g.
gfortran *.f90 -o morse
This command runs a compiler (gfortran in this example, [
Web-page] ), taking as input all files in the local directory with extension .f90, and creates an executable program (-o) called morse

However, due to the nature of FORTRAN 90, modules cannot be compiled until all the included modules have also been compiled, so it will take about 10 or so repeats of this command until everything is resolved.

Compiling with the makefile

For a more systematic approach, the MORSE distribution also includes a makefile [More ...], which is basically a set of instructions to ensure that everything gets compiled in the right order, but also it means that if you alter one module only the other modules which use this altered module are recompiled rather than everything. To invoke this you simply type
and the makefile is executed.

The makefile is currently set up to use the gfortran compiler together with checks on array-bound errors (which slows down the code) as well as all compilation warnings. If you want your own options, edit the lines near the start of the file, which are reproduced below:

# 'makefile' for MORSE created by IDL program # To create/update MORSE executable: just type 'make' # To clean up (by deleting all .o,.mod files): type 'make clean' # Edit next 2 lines to change compiler and options F90 = gfortran FLAGS = -fbounds-check -Wall # if you don't need any flags, just change to: FLAGS = # change anything beyond this point and you're on your own! ...
At the end of this you should have an executable called morse


Occasionally there will be revised or new modules to fix various bugs.

For the simple compilation you can just place these in the same directory as the other modules and recompile in the usual way.

With the makefile, if it is a direct replacement of an existing module, just typing 'make' will work. On the other hand, any new modules should be compiled individually (as in 'gfortran newmod_sub.f90 -c') to ensure that the .mod file is created before running 'make' (if you don't, 'make' will complain that it can't find newmod_sub.mod).