29JAN25 |
The MORSE code is entirely self-contained; you don't need any other libraries.
MORSE is distributed as a compressed 'tar' file which can be unpacked by moving it to a new folder and typing
This will expand into several hundred modules with the extension .f90, and a 'makefile'.tar -xzf morse_v4.00.tar.gz
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
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 morsegfortran *.f90 -o 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.
and the makefile is executed.make
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:
At the end of this you should have an executable called morse# 'makefile' for MORSE created by IDL program make.pro # 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! ...
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).