
In this tutorial you will be led through the process of modefying the code created in the first tutorial to run using PARAMESH as a library.
Step 1. - Edit the file AMRDIR/headers/paramesh_preprocessorh.fh' so that it contains ONLY the following lines.
#define LIBRARY ! compile paramesh a LIBRARY !#define REAL4 #define REAL8 ! Select precision of real variables
Explanation:
This is all that needs to be defined in
paramesh_preprocessor.fh. The only thing you might want to change is
the precision flag which is defined to be REAL8 here. One could
easily build and link to two sets of libraries, one for single
precision, and one for double precision, if this is required. If you do
this, you should never need to recompile PARAMESH !
Step 2. - Build the PARAMESH libraries.
gmake -f make_tutor clean
gmake -f make_tutor
Explanation:
The build process creates three library files and
copies these files to 'AMRDIR/libs/'. The files are called
'libmodules.a', 'libmpi_paramesh.a' and 'libparamesh.a'.
Step 3. - Build your executable.
gmake -f make_tutor your_tutorial
Step 4. - Copy the file 'AMRDIR/amr_runtime_parameters' to the directory where the executable, 'tutor' will be run from (i.e. the directory where you are when you type 'mpirun').
Step 5. - Edit the 'amr_runtime_parameters' so that it looks like:
Notes:
You should set the 'no_permanant_guardcells' field in amr_runtime_parameters to be .true. if you ARE NOT using permanent guardcell storage in your tutorial code. Leave it as above otherwise.
For more information on the format of the amr_runtime_parameters file and the meanings of the variables click here.
Step 5. - Run it !
mpirun -np X your_tutorial/tutorIn this case 'amr_runtime_parameters' is assumed to be located in AMRDIR.
The results should be indentical to those you got in the last tutorial.
You can change any of the values in 'amr_runtime_parameters' and rerun the code WITHOUT having to recompile !