shelf
=====
This directory contains Python scripts for running idealized ice shelf
experiments.

Confined Shelf Experiment
=========================

Note that this test case has been slightly altered from its previous form. 
That is, the setup is now consistent with tests 3 & 4 from the more "simple"
(i.e. not Ross) EISMINT-shelf test cases. More info on these can be found at:
http://homepages.vub.ac.be/~phuybrec/eismint/iceshelf.html

To run the confined shelf experiment, enter the following on a terminal 
command line:

For a serial job: 

python confined-shelf.py confined-shelf.config

For a parallel job: confined-shelf.py confined-shelf.config number_of_processors, for example:

python confined-shelf.py confined-shelf.config 8

... will run the test case on 8 processors.

Note that parallel support in the current "confined-shelf.py" script may be machine specific
and you may need to make minor alterations to the relevant lines of code that make the call
to MPI (e.g. "aprun" vs "mpirun"). To make one or the other active, grep for the phrase "MPI" 
in the .py script.

If you want to run in parallel, the configuration file and number of processors
must be specified (but can be 1). If no parameters are specified, the code will
run in serial using the 'confined-shelf.config' configuration file. Otherwise, it will run
the script using the configuration file that you specify.
Unlike in previous releases, there is only one configuration file which uses
the Payne/Price higher-order dynamical core (the Pattyn/Bocek/Johnson higher-
order core, while still present in the code, is no longer supported).

If there are problems with running in serial on a multcore machine, try

confined-shelf.py confined-shelf.config 1

The script performs the following three steps:
1. Create a netCDF input file for Glimmer.
2. Run Glimmer, creating a netCDF output file.
3. Move any additional files written by Glimmer to the "scratch" subdirectory.

The netCDF files are written in the "output" subdirectory. This is controlled
by a parameter in the configuration file so if you use your own configuration
file the output may be written elsewhere. The file "confined-shelf.config"  
includes the lines:

[CF input]
name = output/confined-shelf.nc

and

[CF output]
name = output/confined-shelf.out.nc

which are what direct the output to the "output" subdirectory.

PREREQUISITES:
In order to use the confined-shelf.py script, you will need to have Python and 
one of the following Python modules installed:
Scientific.IO.NetCDF, netCDF4, or pycdf

To view the results use ncview or another utility for viewing netCDF files.

WARNING: If you have files with names ending ".txt", ".log", or ".nc" in the
directory from which you are running confined-shelf.py they will get moved to 
the "scratch" subdirectory when you run confined-shelf.py.  In addition, if you
use a configuration file that specifies netCDF files (with names ending ".nc") 
are to be written in the current directory, they will get moved to the "scratch"
subdirectory after they are written.

Circular Shelf Experiment
=========================

To run the circular shelf experiment, enter the following on a terminal 
command line:

For a serial job: 

python circular-shelf.py circular-shelf.config

For a parallel job: circular-shelf.py circular-shelf.config number_of_processors, for example:

python circular-shelf.py circular-shelf.config 8

... will run the test case on 8 processors.

In addition to specifying a configuration file, you can also specify one or 
more of the following options on the command line:

--smooth-beta (or the short version, -b) specifies that a Gaussian function
will be used for beta.  The default is that there is a small square region
in the center of the domain where beta is large; Beta is one over the rest of
the domain.  There is an abrupt step from the large value (1.0e10) to one (1.0)
when using the default.

--dirichlet-center (or the short version, -d) specifies that a Dirichlet 
boundary condition (velocity = zero) will be applied in a small square at the 
center of the domain.

--sloped (or the short version, -s) specifies that the ice thickness field will
have a conical top.  The default is that the ice thickness is constant (that is,
a flat top).

Note that these additional commands must come AFTER the processor count, e.g.

python circular-shelf.py circular-shelf.config 8 --smooth-beta

In addition, if invoking these additional commands you must specify that at least one 
processor is being used, e.g. for a single processor run with the smooth-beta option
you would use the command,

python circular-shelf.py circular-shelf.config 1 --smooth-beta


To summarize, the syntax for running the circular shelf experiment is:

python circular-shelf.py circular-shelf.config [-n|proc_count] [-b|--smooth-beta] [-d|--dirichlet-center] [-s|--sloped]

The script performs the following three steps:
1. Create a netCDF input file for Glimmer.
2. Run Glimmer, creating a netCDF output file.
3. Move any additional files written by Glimmer to the "scratch" subdirectory.

The netCDF files are written in the "output" subdirectory. This is controlled
by a parameter in the configuration file so if you use your own configuration
file the output may be written elsewhere. The file "circular-shelf.config"
includes the lines:

[CF input]
name = output/circular-shelf.nc

and

[CF output]
name = output/circular-shelf.out.nc

which are what direct the output to the "output" subdirectory.

PREREQUISITES:
In order to use the circular-shelf.py script, you will need to have Python and 
one of the following Python modules installed:
Scientific.IO.NetCDF, netCDF4, or pycdf

To view the results use ncview or another utility for viewing netCDF files.

WARNING: If you have files with names ending ".txt", ".log", or ".nc" in the
directory from which you are running circular-shelf.py they will get moved to 
the "scratch" subdirectory when you run circular-shelf.py.  In addition, if you
use a configuration file that specifies netCDF files (with names ending ".nc") 
are to be written in the current directory, they will get moved to the "scratch"
subdirectory after they are written.


(last edited on 2-3-11 by SFP)
