Setting up the ECCO global state estimation (DRAFT)

  1. Downloading the code
  2. The code resides in the online MITgcm CVS repository with tag "ecco-branch". More details on MITgcm's CVS repository can be found here. An excellent CVS manual is available online. Chapter 3 of the MITgcm online documentation contains more details on Getting started and usinf the MITgcm.

    It is assumed that CVS is installed on your platform. Before downloading the code via CVS make sure that some environment variables are set properly (e.g. add them in your .cshrc).
    setenv CVSROOT :pserver:cvsanon@mitgcm.org:/u/u0/gcmpack
    setenv CVS_RSH ssh
    setenv CVSEDITOR vi
    
    You can now download the latest code available in the repository by typing
    cvs login ( CVS password: cvsanon )
    cvs co -d directory_name -P -r ecco-branch MITgcm
    
    This will create a directory on your system with name directory_name which contains the MITgcm code tree. We will frequently refer to directory_name as the base directory for the code. You only need to do "cvs login" once but the environment should be set in you .cshrc or .tcshrc.

  3. Configuring your platform

  4. MITgcm uses a script called "genmake" which tries to identify your platform, and, if successful, determines paths to relevant preprocessor and compiler and sets appropriate options. With these information it generates a makefile that is used to compile the code. If your platform is not identified, or if you are using a compiler that is different from the default, or if you are using the default compiler but at locations different from default installations, you will need to specify some variables to provide the correct settings. The file to be modified is "tools/genmake".
    Some settings are illustrated for the case of an SGI running IRIX64 and MPI:
     case IRIX64+mpi:
        echo "Configuring for SGI Mips with MPI"
        set DEFINES    = ( ${DEFINES} '-DTARGET_SGI -DWORDLENGTH=4' )
        set FC         = ( 'mpif77' )
        set LINK       = ( 'mpif77' )
        set FFLAGS     = ( '-extend_source -bytereclen -r10000 -mips4' )
        set INCLUDES   = ( '-I/usr/local/mpi/include' )
        set LIBS       = ( '-L/usr/local/mpi/lib/ -lfmpich -lmpich' )
        breaksw
    
    You may have to make sure to find a consistent set for these variables suitable to your platform and compiler along these lines.

  5. Configuring your setup

  6. The present description refers to the ECCO global 2x2 degree state estimation setup. The "ecco-branch" of the MITgcm repository contains in its collection of verification experiments the directory "global2x2_tot. This contains two sub-directories:

  7. Building the code (without the adjoint)

  8. Assuming you have determined the right settings in genmake for your platform and compiler, and your model is configured properly, the following steps will compile the code in the directory bin/ using MPI.
    cd bin
    ln -s ../verification/global2x2_tot/code/.genmakerc .
    ln -s ../verification/global2x2_tot/code/*.h .
    ../tools/genmake -mpi -platform=my_platform -makefile 
    make depend
    make
    
    N.B.: In the earlier example, if the system variable 'uname'=IRIX64, genmake will recognize this and you do not need to provide the genmake option "-platform=IRIX64". This option only needs to be specified, if the platform is not recognized, or if you would like to use a compiler (plus its associated options/flags) different from the default in genmake.

  9. Building the code including the generation of the adjoint code

  10. This assumes you have access to either TAMC or TAF. The following commands will generate the adjoint code via TAF using the script adjoint/makefile.
    cd bin/
    ln -s ../verification/global2x2_tot/code/.genmakerc .
    ln -s ../verification/global2x2_tot/code/*.h .
    ../tools/genmake -mpi -platform=my_platform -makefile 
    make depend
    cd ../adjoint/
    make adtaf
    make adchange
    cd ../bin/
    make
    

  11. Building the code if TAF is on a different than your compile platform

  12. Running the code

  13. Upon successfull completion of the above build process you will find an executable in the exe/ directory. Link the runtime parameter files into this directory, together with all necessary fields. Usually a parallel script such as mpirun needs to be invoked to execute the model. Refer to your platform documentation regarding specifics about this and about queueing systems. A simple execution line requesting 6 processore may look like this:
    # from base directory
    cd exe/
    ln -s ../verification/global2x2_tot/input/* .
    ln -s ${fieldStorageDir}/* .
    mpirun -np 6 ./mitgcmuv
    

  14. Using the line search routine lsopt

  15. lsopt is based on a quasi-Newton variable-storage approach described in
    J.C. Gilbert & C. Lemarechal
    Some numerical experiments with variable-storage quasi-Newton algorithms
    Mathematical Programming 45 (1989), pp. 407-435
    
    The relevant routines may be found in lsopt/ and optim/. A short documentation is available in lsopt/lsopt_doc.txt as well as in section 8.2 of the MITgcm online documentation.

Patrick Heimbach
Last modified: Thu May 29 10:50:34 EDT 2003 MIT