You can now download the latest code available in the repository by typingsetenv CVSROOT :pserver:cvsanon@mitgcm.org:/u/u0/gcmpack setenv CVS_RSH ssh setenv CVSEDITOR vi
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.cvs login ( CVS password: cvsanon ) cvs co -d directory_name -P -r ecco-branch MITgcm
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.
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.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
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
Copy the file tamc_code_ecco.f over to the platform where taf is installed.# from base directory 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 small_f cd ../adjoint/ make adrestore make allcode
With this setup you can now proceed as follows to generate the adjoint code:# create base directory mkdir directory_name cd directory_name scp -r user@compile_platform:YOURPATH/directory_name/tools . scp -r user@compile_platform:YOURPATH/directory_name/adjoint .
Copy the file tamc_code_ecco_ad.f back to your compile platform# from base directory cd adjoint/ make admodeltaf
# from base directory cd adjoint/ make adchange cd ../bin/ make
# from base directory
cd exe/
ln -s ../verification/global2x2_tot/input/* .
ln -s ${fieldStorageDir}/* .
mpirun -np 6 ./mitgcmuv
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.J.C. Gilbert & C. Lemarechal Some numerical experiments with variable-storage quasi-Newton algorithms Mathematical Programming 45 (1989), pp. 407-435
will produce a library of object files, calledmake ecco
This library will be linked with the optim/ routines (see next item).liblsopt_ecco.a
willmake
to run the line search. Some parameters need to be set in the header of the script, a typical setup of which is (see documentations for details):run_optim.csh
The script will then do the following:# set parameters for namelist ECCO_OPTIM set optimcycle = 0 set numiter = 1 set nfunc = 3 set fmin = 1.D+5 set iprint = 10 set nupdate = 4 # set parameters for namelist ECCO_PARMS set expId = MIT_CE_000 # set parameters for namelist CTRL_NML and CTRL_PACKNAMES set ctrlname = ecco_ctrl set costname = ecco_cost # set system parameters set mitgcmdir = [your_mitgcm_exe_dir] set optimdir = [your_optim_exe_dir] # IDEALLY, NO MORE EDITING BEYOND THIS LINE. # ---------------------------------------------------------------------