|NDSPMHD Documentation: home | installing | running the examples | basic tutorial | references|
See the main NDSPMHD page for details about the code.
See the install page for details about how to compile the code.
See the examples page for details about how to run the examples that come with the code.
mkdir test-run cd test-runUse the script in the ndspmhd/scripts directory to write a local Makefile:
~/where-I-put-it/ndspmhd/scripts/writemake.sh 1D > Makefilethen, after setting the location of the code via the NDSPMHD_DIR environment variable (best to set this permanently by putting it in your .bash_profile or equivalent)
export NDSPMHD_DIR=~/where-I-put-it/ndspmhdNow you can simply type
makewhich should compile the code and copy the binary to the current directory. A directory listing shows the binary and the local Makefile:
$ ls 1DSPMHD* Makefile
$ ./1DSPMHD test.in number of runs = 1 run = 1 runname = test.in input file test.in not found would you like to create one with default options? y input file test.in created successfully STOP exiting...
When run with an input file as the argument, the code runs from scratch with the particle setup specified by the SETUP1D, SETUP2D or SETUP3D variable in src/Makefile. To edit the currently compiled setup, use
make editwhich will load the relevant file into your favourite editor (requires setting the EDITOR environment variable to be your favourite text editor). Alternatively you can make a new setup_blah.f90 file and specify this using SETUP1D=setup_blah.f90 in the Makefile. Then
maketo rebuild the code in the local directory with the edited file.
You can also specify the setup in the local Makefile by giving an extra argument to the writemake script, i.e.,
~/where-I-put-it/ndspmhd/scripts/writemake.sh 1D setup_blah.f90 > MakefileThen when you type "make" the code will always build using setup_blah.f90 as the initial conditions. This is how the Makefiles in the examples directories have been written.
./1DSPMHD test1.in test2.in test3.inthe code will run each test concurrently (provided the previous test finishes normally). This is a convenient way of performing parameter sweeps (in serial) without any scripting.
./1DSPMHD test_00020.datwhich will look for input options in a file called test.in.