Starting a configuration for OpenAD
19-Aug-2005, heimbach@mit.edu, utke@mcs.anl.gov, cnh@mit.edu
############################################################

This experiment is derived from global_ocean.90x40x15.
Additionally it tests packages gmredi, kpp, and ggl90.

--------------------------------------
Part 1, using OpenAD Adjoint Compiler:
-------

The built process needed to be modified, and some routines
needed changes. Most changes were commited to default routines,
the remaining changes are kept in code_oad/ for now.

To build:
# (chdir to build/; assume we are in build/)

# Clean-up (if not starting from clean build dir):
> make CLEAN
--------------
# generate makefile using gfortran and genmake2:
> ../../../tools/genmake2  -oad -of ../../../tools/build_options/linux_amd64_gfortran -mods ../code_oad

# compile everything else
> make adAll

# Note: might want to split the full single step above (make adAll) in several intermediate steps
# such as:
# a) invoke script to convert COMMON block headers to MODULE headers
# converts FILE.h to FILE_mod.h which uses newi module FILE_mod.F90
> make cb2m
#
# b) re-generate makefile which takes into account newly created files
# FILE_mod.h, FILE_mod.F90
> make makefile
#
# c) make .f, .f90
> make small_f
#
# d) first compile all module files .f90
> make allmods
#
# e) then finaly compile all f90 src files:
> make adAll

To clean:
--------
# Since soft links get overwritten, for now do:
> make CLEAN

To run:
# chdir to run/; assume we are in run/, if not:
> cd ../run
------
# paremeter files are in input_oad/
> ln -s ../input_oad/* .
# link other forcing fields (binary files) from exp.  tutorial_global_oce_latlon
> ../input_oad/prepare_run

# run a short test:
> ln -s ../build/mitgcmuv_ad
> ./mitgcmuv_ad > output.txt

-----------------------------------
Part 2, using TAF Adjoint Compiler:
-------
similar to above but using set-up specific code from code_ad/ and input files from input_ad/

To build:
# assume we are in build/

# Clean-up (if not starting from clean build dir):
> make CLEAN
# generate makefile using gfortran and genmake2:
> ../../../tools/genmake2  -of ../../../tools/build_options/linux_amd64_gfortran -mods ../code_ad

# generate dependencies:
> make depend

# generate AD src code and compile
> make adall

To run:
# assume we are in run/, if not:
> cd ../run

# link parameter files:
> ln -s ../input_ad/* .
# link other forcing fields (binary files) from exp.  tutorial_global_oce_latlon
> ../input_ad/prepare_run

# run a short test:
> ln -s ../build/mitgcmuv_ad
> ./mitgcmuv_ad > output.txt
