Running gnumake in this directory will create an executable named "interpic".
Its function is to take an input CAM history tape in netcdf format 
and interpolate the all time sample to an arbitrary
horizontal and/or vertical resolution.  The primary reason one would want to
do this is to create an initial dataset at a resolution for which they don't
already have one.  The code will also automatically reorder the dimensions on
the created file (if necessary) so that it can be input to the CAM.

Output horizontal and vertical resolution is specified by a template netcdf
file ("-t template_file").  Output file contents are the intersection of
fields specified on the template file and the input file.

To create a template file you can use the NCL script create_template.ncl.
Edit the parameters at the top of the script and then run with

ncl < create_template.ncl


Note: When creating Lin/Rood template files from Guassian grids!

After running create_template.ncl and interpic, you will need to
rename the U and V fields to US and VS. This is easy to do with
the netCDF operator (NCO) ncrename as follows...

ncrename -v U,US -v V,VS filename.nc

=======================================================================================

So here is the complete sequence you need to follow to create a new dataset.

1.) Edit the "create_template.ncl" script as needed for you case.
2.) Run "create_template.ncl" to produce the template file.
3.) Build and run "interpic" on the template file you produced.
4.) For a Lin-Rood case, you then need to rename U and V to US and VS.

1.) Edit the "create_template.ncl" script as needed for you case.

Edit "create_template.ncl", for the case you wish to create. The most important
settings are:

  nlat = 73;   ; Number of latitudes
  nlon =120;   ; Number of longitudes
  nlev = 26;   ; Number of vertical levels
  ntrm = 21;   ; Truncation in "M"
  ntrk = 21;   ; Truncation in "K"
  ntrn = 21;   ; Truncation in "N"
  ; Grid type ("gaussian", "staggered" or "reduced")
  grid = "staggered";
  ; Filename to interpolate from
  interpfilename = "/fs/cgd/csm/inputdata/atm/cam1/inic/SEP1.T42L26.112000.nc";


Which define the grid-type, and horizontal and vertical resolution you would like to have
on your output grid. "interpfilename" is the file you wish to interpolate from. Standard
levels are defined for 18, 26 and 30 levels, if you need non-standard vertical levels
you will also have to edit the next section of the file, so that the right hybrid
surfaces are used.

Note: "interpfilename" needs to match the filename you will give to "interpic"
to interpolate from in step 3 below.

2.) Run "create_template.ncl" to produce the template file.

This is done by simply...

	ncl < create_template.ncl

You do need a current version of NCAR Graphics command Language (NCL) to run the script.

3.) Build and run "interpic" on the template file you produced.

To build interpic.

	gmake 

Make sure the envrionment variables INC_NETCDF and LIB_NETCDF are set to the location
where the NetCDF library is on your system.

To run first make sure your system's stacksize is sufficiently large.

limit stacksize unlimited

Then run with

	interpic -t template_file interpfilename outputfilename

Note: "interpfilename" above HAS TO match the value you set when you edited
the "create_template.ncl" script.

4.) For a Lin-Rood case, you then need to rename U and V to US and VS.

When interpolating from a Gaussian grid to a Lin-Rood grid you then need to rename
U and V to US and VS.

	ncrename -v U,US -v V,VS filename.nc
