Bern 2.5D Model
Source code
- If you have once checked out the trunk version you can always update your working copy of the trunk to the latest trunk version on the svn server by executing inside your trunk folder
bern2.5d-trunk
the command
svn update
-
For more information about how to work with subversion and the svn
command see
ServiceSvn.
Getting started
Compile
-
See also COMPILE.txt
and MACHINES.txt
- Define the following environmental variables. This can be for example done by loading modules, see below. Or with the
export
(bash) or setenv
(tcsh) command.
- FC : Fortran Compiler
- NETCDF : path to your netcdf installation, libnetcdf.a should be in $NETCDF/lib, include files in $NETCDF/include
- FFLAGS : additional compiler flags, for example set
FFLAGS=-g
for debugging
- On IAC systems you can use modules to set these variables correctly
Scripts
- List of scripts
Scriptname | Purpose |
thc.sh | Run the Bern 2.5 D model |
thc_run.sh | Run a spinup run or transient run |
create_case.sh | Create a spinup or transient case |
create_restart_file.sh | Create a restart file |
list_files.sh | List thc related files |
edit_files.sh | Edit and show variables in spinup and transient startfiles |
crestart.sh | Simple wrapper script to run crestart (obsolete) |
- All scripts come with an internal help, just run the script with option
-h
or -help
, for example
./list_files.sh -h
Run test case
- Run the test case model:
./thc.sh -s test
Run a spinup case
Run a transient case
Run a spinup run followed by a transient run
Modify startfiles
- See
edit_files.sh
script
./edit_files.sh -h
Run thc with modified startfiles
- You can modify the startfiles within the thc.sh command
./thc.sh -set kvnum=1,khnum=1,iadv=1 -s susciar4
This will set kvnum=1, khnum=1 and iadv=1. Note: This is equal to
./thc.sh -s susciar4_default
Run a transient thc with on other forcing file
How the option -set defines the name of the startfile and the case name
- If you modify the startfiles with the option -set, a MD5-string will be appended to the name of startfile and therefore to the name of the new case.
- The MD5-string is calculate from the parameters given by the -set option. Run the script
./md5.sh
to find out the MD5 sum. For example
./md5.sh kvnum=1,khnum=1,iadv=1
- Note that the MD5 sum is independent of the order of the parameters
./md5.sh kvnum=1,khnum=1,iadv=1
MD5c3478ce6723a70b7fb3a4c2e57c97737
./md5.sh iadv=1,kvnum=1,khnum=1
MD5c3478ce6723a70b7fb3a4c2e57c97737
- If you don't want to choose the string which is appended, use the option -add, for example
./thc.sh -set kvnum=1,khnum=1,iadv=1 -add setup1 -s susciar4
This will create the case susciar4_setup1.spinup instead of susciar4_MD5c3478ce6723a70b7fb3a4c2e57c97737.spinup
More options
- If you want to re-do a run, use the option
-f
(force) to overwrite everything
./thc.sh -f -s susciar4_default
- Run thc with nice 19 (
-n 19
)
./thc.sh -n 19 -s susciar4_default
- Run thc quiet (
-q
) - with no output
./thc.sh -q -s susciar4_default
- See all the available option of thc.sh by running
./thc.sh -h
Create only the case directory
List thc related files
- List available spinup start files
./list_files.sh -ls
- List available restart files (
-lr
) and available transient (-lt) start files
./list_files.sh -lr -lt
Run thc on brutus batch system
- Compile thc, see also
MACHINES.txt
module purge
module load pgi netcdf/4.0.1 # in case you want to use Portland compiler
module load intel netcdf/4.0.1 # in case you want to use Intel compiler
export FC=gfortran; module load netcdf/4.0.1 # in case you want to use GNU gfortran compiler
make clean
make
- Create a case, for example for spinup susciar4_default
./create_case.sh -s susciar4_default
- Submit batch job
bsub < ./cases/susciar4_default.spinup/susciar4_default.spinup.lsf
- Afterwards LSF log files are in the case folder, for example
cases/susciar4_default.spinup/susciar4_default.spinup-out.JOBID
cases/susciar4_default.spinup/susciar4_default.spinup-err.JOBID
Run several thc in parallel on brutus
- Use the LSF jobfile
par_thc.lsf
and the script par_thc.sh
to distribute thc-runs over several nodes. For more info see
ProjectBern25Dparallel
Setup for a crash
- Run spinup case susciar4
./thc.sh -s susciar4
- The crash can be avoided, if you start with spinup
susciar4_iadv1
, susciar4_knum1
or susciar4_knum1_iadv1
instead of susciar4
!
- Crash Matrix
Spinup | Transient | Runs without crash |
susciar4 | sres_a2_BernCC_targwfb2.5progipccar4jan09 | |
susciar4 | sres_a2_test | |
susciar4 | ar4_sres_a2_ar4_gwfb_3.2 | |
susciar4_iadv1 | sres_a2_BernCC_targwfb2.5progipccar4jan09 | |
susciar4_iadv1 | sres_a2_test | |
susciar4_iadv1 | ar4_sres_a2_ar4_gwfb_3.2 | |
susciar4_knum1 | sres_a2_BernCC_targwfb2.5progipccar4jan09 | |
susciar4_knum1 | sres_a2_test | |
susciar4_knum1 | ar4_sres_a2_ar4_gwfb_3.2 | |
susciar4_knum1_iadv1 | sres_a2_BernCC_targwfb2.5progipccar4jan09 | |
susciar4_knum1_iadv1 | sres_a2_test | |
susciar4_knum1_iadv1 | ar4_sres_a2_ar4_gwfb_3.2 | |
Benchmarks
- Summary: Best performance reached with intel compiler
Directory Layout
|-- cdf_2d (source code of cdf_2d.a)
|-- src (source code of thc)
|-- thc.sh (script to run thc *** main script ***)
|-- thc_run.sh (script to run spinup and transient cases)
|-- create_case.sh (script to create a new case)
|-- create_restart_file.sh (script to create a restart file)
|-- list_files.sh (script to list thc related files)
|-- edit_files.sh (edit/show starfiles)
|-- crestart.sh (points to old src/crestart)
|-- data (directory of data files, ???)
|-- forcing (directory of data files, forcing)
|-- start_files (directory of start files)
|-- cases (directory containing runs/cases)
| |-- susciar4.spinup (case directory for susciar4 case, spinup run)
| | |-- input (input date)
| | `-- output (output data)
| |-- susciar4.sres_a2_test (case directory for transient run sres_a2_test,
| ... spinup from susciar4 run)
|
|-- batch-template.lsf (template for batch job script)
|-- COMPILE.txt (read how to compile the model)
|-- MACHINES.txt (machine specific documentation)
|-- README.txt (general readme file)
`-- Makefile (main Makefile)
Debugging the model
- Run
thc
inside pgdbg
pgdbg src/thc
- Press Run inside the pgdbg gui
(old description for original code) Compile and run on firebolt
ProjectBern25Dold.
Access
