Home Contact Us Site Map  
 
       
    next up previous contents
Next: 3.2.2 Method 2 - Up: 3.2 Obtaining the code Previous: 3.2 Obtaining the code   Contents

Subsections


3.2.1 Method 1 - Checkout from CVS

If CVS is available on your system, we strongly encourage you to use it. CVS provides an efficient and elegant way of organizing your code and keeping track of your changes. If CVS is not available on your machine, you can also download a tar file.

Before you can use CVS, the following environment variable(s) should be set within your shell. For a csh or tcsh shell, put the following

% setenv CVSROOT :pserver:cvsanon@mitgcm.org:/u/gcmpack
in your .cshrc or .tcshrc file. For bash or sh shells, put:
% export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack'
in your .profile or .bashrc file.

To get MITgcm through CVS, first register with the MITgcm CVS server using command:

% cvs login ( CVS password: cvsanon )
You only need to do a ``cvs login'' once.

To obtain the latest sources type:

% cvs co -P MITgcm
or to get a specific release type:
% cvs co -P -r checkpoint52i_post MITgcm
The CVS command ``cvs co'' is the abreviation of the full-name ``cvs checkout'' command and using the option ``-P'' (cvs co -P) will prevent to download unnecessary empty directories.

The MITgcm web site contains further directions concerning the source code and CVS. It also contains a web interface to our CVS archive so that one may easily view the state of files, revisions, and other development milestones:

http://mitgcm.org/viewvc/MITgcm/MITgcm/

As a convenience, the MITgcm CVS server contains aliases which are named subsets of the codebase. These aliases can be especially helpful when used over slow internet connections or on machines with restricted storage space. Table 3.1 contains a list of CVS aliases

Table 3.1: MITgcm CVS Modules
Alias Name Information (directories) Contained
MITgcm_code Only the source code - none of the verification examples.
MITgcm_verif_basic Source code plus a small set of the verification examples (global_ocean.90x40x15, aim.5l_cs, hs94.128x64x5, front_relax, and plume_on_slope).
MITgcm_verif_atmos Source code plus all of the atmospheric examples.
MITgcm_verif_ocean Source code plus all of the oceanic examples.
MITgcm_verif_all Source code plus all of the verification examples.


The checkout process creates a directory called MITgcm. If the directory MITgcm exists this command updates your code based on the repository. Each directory in the source tree contains a directory CVS. This information is required by CVS to keep track of your file versions with respect to the repository. Don't edit the files in CVS! You can also use CVS to download code updates. More extensive information on using CVS for maintaining MITgcm code can be found here . It is important to note that the CVS aliases in Table 3.1 cannot be used in conjunction with the CVS -d DIRNAME option. However, the MITgcm directories they create can be changed to a different name following the check-out:

   %  cvs co -P MITgcm_verif_basic
   %  mv MITgcm MITgcm_verif_basic

Note that it is possible to checkout code without ``cvs login'' and without setting any shell environment variables by specifying the pserver name and password in one line, for example:

   %  cvs -d :pserver:cvsanon:cvsanon@mitgcm.org:/u/gcmpack co -P MITgcm

3.2.1.1 Upgrading from an earlier version

If you already have an earlier version of the code you can ``upgrade'' your copy instead of downloading the entire repository again. First, ``cd'' (change directory) to the top of your working copy:

% cd MITgcm
and then issue the cvs update command such as:
% cvs -q update -d -P -r checkpoint52i_post
This will update the ``tag'' to ``checkpoint52i_post'', add any new directories (-d) and remove any empty directories (-P). The -q option means be quiet which will reduce the number of messages you'll see in the terminal. If you have modified the code prior to upgrading, CVS will try to merge your changes with the upgrades. If there is a conflict between your modifications and the upgrade, it will report that file with a ``C'' in front, e.g.:
C model/src/ini_parms.F
If the list of conflicts scrolled off the screen, you can re-issue the cvs update command and it will report the conflicts. Conflicts are indicated in the code by the delimites ``$ <<<<<<<$ '', ``======='' and ``$ >>>>>>>$ ''. For example,
<<<<<<< ini_parms.F
     & bottomDragLinear,myOwnBottomDragCoefficient,
=======
     & bottomDragLinear,bottomDragQuadratic,
>>>>>>> 1.18
means that you added ``myOwnBottomDragCoefficient'' to a namelist at the same time and place that we added ``bottomDragQuadratic''. You need to resolve this conflict and in this case the line should be changed to:
     & bottomDragLinear,bottomDragQuadratic,myOwnBottomDragCoefficient,
and the lines with the delimiters ($ <<<<<<$ ,======,$ >>>>>>$ ) be deleted. Unless you are making modifications which exactly parallel developments we make, these types of conflicts should be rare.

Upgrading to the current pre-release version

We don't make a ``release'' for every little patch and bug fix in order to keep the frequency of upgrades to a minimum. However, if you have run into a problem for which ``we have already fixed in the latest code'' and we haven't made a ``tag'' or ``release'' since that patch then you'll need to get the latest code:

% cvs -q update -d -P -A
Unlike, the ``check-out'' and ``update'' procedures above, there is no ``tag'' or release name. The -A tells CVS to upgrade to the very latest version. As a rule, we don't recommend this since you might upgrade while we are in the processes of checking in the code so that you may only have part of a patch. Using this method of updating also means we can't tell what version of the code you are working with. So please be sure you understand what you're doing.


next up previous contents
Next: 3.2.2 Method 2 - Up: 3.2 Obtaining the code Previous: 3.2 Obtaining the code   Contents
mitgcm-support@mitgcm.org
Copyright © 2006 Massachusetts Institute of Technology Last update 2018-01-23