Kate & Hernan have done an admirable job of designing the ROMS build process so that all files generated during the build are in a single directory. The name of this directory is specified by the makefile's SCRATCH_DIR variable. By default it is the Build subdirectory, but it can be overridden when make is called, eg, the following would cause ROMS to use a subdirectory specific to the OS and compiler
Code: Select all
export SCRATCH_DIR=build-$(uname -s -m | tr " " "-")-${FORT}
make
I said "all" the files, but there's one exception: the executable, which is create in the master directory (by which I mean the one the makefile is in).
What about creating the executable in the build directory? One would still run it from the master directory, either by specifying its path explicitly
Code: Select all
$SCRATCH_DIR/oceanS < ROMS/External/ocean.in
or with a symbolic link
Code: Select all
ln -s $SCRATCH_DIR/oceanS .
./oceanS < ROMS/External/ocean.in
This would allow one to have different builds on the same system without any interference. Eg, one might have a debug build and an optimised build, or builds with different compilers.