/[MITgcm]/MITgcm/doc/devel_HOWTO.sgml
ViewVC logotype

Diff of /MITgcm/doc/devel_HOWTO.sgml

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.6 by jmc, Tue Dec 23 22:42:20 2003 UTC revision 1.10 by jmc, Thu Jan 21 23:59:17 2010 UTC
# Line 22  Line 22 
22            Initial version.            Initial version.
23          </revremark>          </revremark>
24        </revision>        </revision>
25          <revision>
26            <revnumber>0.02</revnumber>
27            <date>2010-01-21</date>
28            <authorinitials>jmc</authorinitials>
29            <revremark>
30              update links.
31            </revremark>
32          </revision>
33      </revhistory>      </revhistory>
34    
35      <abstract>      <abstract>
# Line 37  Line 45 
45      <sect2>      <sect2>
46        <title>New Versions of This Document</title> <para>You can        <title>New Versions of This Document</title> <para>You can
47        obtain the latest version of this document <ulink        obtain the latest version of this document <ulink
48        url="http://mitgcm.org/dev_docs/devel_HOWTO/">online</ulink> in        url="http://mitgcm.org/public/docs.html">online</ulink> in
49        various formats.</para>        various formats.</para>
50      </sect2>      </sect2>
51      <sect2>      <sect2>
# Line 56  Line 64 
64        <title>User Manual</title>        <title>User Manual</title>
65    
66        <para>Before jumping into development, please familiarize yourself with        <para>Before jumping into development, please familiarize yourself with
67          the <ulink url="http://mitgcm.org/docs.html"> MITgcm user manual          the <ulink url="http://mitgcm.org/public/docs.html"> MITgcm user manual
68          </ulink>.  This document contains volumes of useful information and is          </ulink>.  This document contains volumes of useful information and is
69          included here by reference.</para>          included here by reference.</para>
70    
# Line 130  Line 138 
138     e|- tools     e|- tools
139     ?|  tutorial_examples        documented tests     ?|  tutorial_examples        documented tests
140      |                             only populated on release1 branch      |                             only populated on release1 branch
141      |                             and not validated during "testscript"      |                             and not validated during "testreport"
142      '- utils      '- utils
143         verification             std tests         verification             std tests
144    
# Line 182  Line 190 
190        <title>Branches</title>        <title>Branches</title>
191    
192        <para>As shown in the online <ulink        <para>As shown in the online <ulink
193        url="http://dev.mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/doc/tag-index?graph=1.174">ViewCVS-generated        url="http://mitgcm.org/viewvc/MITgcm/MITgcm/doc/tag-index?view=graph">
194        tree</ulink>, the MITgcm codebase is split into to two branches        ViewCVS-generated tree</ulink>, the MITgcm codebase is split into to two
195        or "lines" under which development proceeds.  These two lines        branches or "lines" under which development proceeds.  These two lines are
196        are referred to as the "MAIN" and "ecco" versions of the code.        referred to as the "MAIN" and "ecco" versions of the code.  While not
197        While not identical, the bulk of the MAIN and ecco lines are        identical, the bulk of the MAIN and ecco lines are composed of files from
198        composed of files from the same codebase.        the same codebase.
199        </para>        </para>
200    
201        <para>Periodically, a "Release" branch is formed from the "MAIN"        <para>Periodically, a "Release" branch is formed from the "MAIN"
202        development branch.  This is done in order to create a        development branch.  This is done in order to create a relatively stable
203        relatively stable reference point for both users and developers.        reference point for both users and developers.  The intent is that once a
204        The intent is that once a relese branch has been created, only        relese branch has been created, only bug-fixes will be added to it.
205        bug-fixes will be added to it.  Meanwhile, development (which        Meanwhile, development (which might "break" or otherwise render invalid
206        might "break" or otherwise render invalid the documentation,        the documentation, tutorials, and/or examples contained within a release
207        tutorials, and/or examples contained within a release branch) is        branch) is allowed to continue along the MAIN and ecco lines.</para>
       allowed to continue along the MAIN and ecco lines.</para>  
208      </sect2>      </sect2>
209    
210      <sect2>      <sect2>
211        <title>Tagging</title>        <title>Tagging</title>
212    
213        <para>The intent of tagging is to create "known-good"        <para>The intent of tagging is to create "known-good" checkpoints that
214        checkpoints that developers can use as references.        developers can use as references.  Traditionally, MITgcm tagging has
215        Traditionally, MITgcm tagging has maintained the following        maintained the following conventions:</para>
       conventions:</para>  
216    
217        <orderedlist>        <orderedlist>
218          <listitem>          <listitem>
219            <para>Developer checks out code into a local CVS-managed            <para>Developer checks out code into a local CVS-managed directory,
220            directory, makes various changes/additions, tests these            makes various changes/additions, tests these edits, and eventually
221            edits, and eventually reaches a point where (s)he is            reaches a point where (s)he is satisfied that the changes form a new
222            satisfied that the changes form a new "useful" point in the            "useful" point in the evolution of the code.</para>
           evolution of the code.</para>  
223          </listitem>          </listitem>
224    
225          <listitem>          <listitem>
226            <para>The developer then runs the <ulink            <para>The developer then runs the <ulink
227            url="http://dev.mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/verification/testscript">testscript</ulink>            url="http://mitgcm.org/viewvc/MITgcm/MITgcm/verification/testreport">
228            shell script to see if any problems are introduced.  While            testreport</ulink> shell script to see if any problems are introduced.
229            not intended to be exhaustive, the test cases within the            While not intended to be exhaustive, the test cases within the
230            verification directory do provide some indication whether            verification directory do provide some indication whether gross errors
231            gross errors have been introduced.            have been introduced.
232            </para>            </para>
233          </listitem>          </listitem>
234    
# Line 233  Line 238 
238            then:</para>            then:</para>
239            <orderedlist>            <orderedlist>
240              <listitem>              <listitem>
241                <para>adds a "checkpointXY_pre" comment (where X is a                <para>adds a "checkpointXY_pre" comment (where X is a checkpoint
242                checkpoint number and Y is a letter) to the <ulink                number and Y is a letter) to the <ulink
243                url="http://dev.mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/doc/tag-index">tag-index</ulink>                url="http://mitgcm.org/viewvc/MITgcm/MITgcm/doc/tag-index">
244                file and checks it into the CVS repository</para>                tag-index</ulink> file and checks it into the CVS
245                  repository</para>
246              </listitem>              </listitem>
247              <listitem>              <listitem>
248                <para>submits the set of changes to the CVS repository                <para>submits the set of changes to the CVS repository and adds
249                and adds comments to <filename>tag-index</filename>                comments to <filename>tag-index</filename> describing what the
250                describing what the changes are along with a matching                changes are along with a matching "checkpointXY_post" entry</para>
               "checkpointXY_post" entry</para>  
251              </listitem>              </listitem>
252            </orderedlist>            </orderedlist>
253          </listitem>          </listitem>
254        </orderedlist>        </orderedlist>
255    
256        <para>The result of this tagging procedure is a sequence of        <para>The result of this tagging procedure is a sequence of development
257        development checkpoints with comments which resembles:</para>        checkpoints with comments which resembles:</para>
258    
259  <programlisting>  <programlisting>
260  checkpoint50e_post  checkpoint50e_post
# Line 271  o fix small problem with in ptracers_wri Line 276  o fix small problem with in ptracers_wri
276  checkpoint50d_pre  checkpoint50d_pre
277  </programlisting>  </programlisting>
278    
279        <para>This information can be used to refer to various stages of        <para>This information can be used to refer to various stages of the code
280        the code development.  For example, bugs can be traced to        development.  For example, bugs can be traced to individual sets of CVS
281        individual sets of CVS checkins based upon their first        checkins based upon their first appearance when comparing the results from
282        appearance when comparing the results from different        different checkpoints.</para>
       checkpoints.</para>  
283    
284      </sect2>      </sect2>
285    </sect1>    </sect1>
# Line 287  checkpoint50d_pre Line 291  checkpoint50d_pre
291      <sect2 id="documentation_getting">      <sect2 id="documentation_getting">
292        <title>Getting the Docs and Code</title>        <title>Getting the Docs and Code</title>
293    
294        <para>The first step towards editing the documentation is to        <para>The first step towards editing the documentation is to checkout a
295        checkout a copy of code, docs, and build scripts from the CVS        copy of code, docs, and build scripts from the CVS server using:</para>
       server using:</para>  
296    
297  <screen>  <screen>
298    $ export CVS_RSH=ssh    $ export CVS_RSH=ssh
299    $ export CVSROOT=':ext:auden.lcs.mit.edu:/u/u3/gcmpack'    $ export CVSROOT=':ext:NAME@mitgcm.org:/u/gcmpack'
300    $ mkdir scratch    $ mkdir scratch
301    $ cvs co MITgcm manual mitgcm.org    $ cvs co -P MITgcm manual mitgcm.org
302  </screen>  </screen>
303    
304        <para>These commands extract the necessary information from the        <para>These commands extract the necessary information from the CVS server
305        CVS server and create a temporary (called        and create a temporary (called <filename>scratch</filename>) directory for
306        <filename>scratch</filename>) directory for the storage of the        the storage of the HTML and other files that will be created.  Please note
307        HTML and other files that will be created.  Please note that you        that you must either create <filename>scratch</filename> as shown or edit
308        must either create <filename>scratch</filename> as shown or edit        the various <filename>Makefile</filename>s and scripts used to create the
309        the various <filename>Makefile</filename>s and scripts used to        documentation.</para>
       create the documentation.</para>  
310      </sect2>      </sect2>
311    
312      <sect2>      <sect2>
313        <title>Editing the Documentation</title>        <title>Editing the Documentation</title>
314    
315        <para>The documentation is contained in the        <para>The documentation is contained in the <filename>manual</filename>
316        <filename>manual</filename> directory in a raw LaTeX format.        directory in a raw LaTeX format.  The main document is
317        The main document is <filename>manual.tex</filename> and it uses        <filename>manual.tex</filename> and it uses <command>\input{}</command>s
318        <command>\input{}</command>s to include the chapters and        to include the chapters and subsections.</para>
319        subsections.</para>  
320          <para>Since the same LaTeX source is used to produce PostScript, PDF, and
321        <para>Since the same LaTeX source is used to produce PostScript,        HTML output, care should be taken to follow certain conventions.  Two of
322        PDF, and HTML output, care should be taken to follow certain        the most important are the usage of the <command>\filelink{}{}</command>
323        conventions.  Two of the most important are the usage of the        and <command>\varlink{}{}</command> commands.  Both of these commands have
324        <command>\filelink{}{}</command> and        been defined to simplify the connection between the automatically
325        <command>\varlink{}{}</command> commands.  Both of these        generated ("code browser") HTML and the HTML version of the manual
326        commands have been defined to simplify the connection between        produced by LaTeX2HTML.  They each take two arguments (corresponding to
327        the automatically generated ("code browser") HTML and the HTML        the contents of the two sets of curly braces) which are the text that the
328        version of the manual produced by LaTeX2HTML.  They each take        author wishes to be "wrapped" within the link, and a specially formatted
329        two arguments (corresponding to the contents of the two sets of        link thats relative to the <filename>MITgcm</filename> directory within
330        curly braces) which are the text that the author wishes to be        the CVS tree.</para>
       "wrapped" within the link, and a specially formatted link thats  
       relative to the <filename>MITgcm</filename> directory within the  
       CVS tree.</para>  
331    
332        <para>The result is a command that resembles either</para>        <para>The result is a command that resembles either</para>
333                
# Line 367  checkpoint50d_pre Line 366  checkpoint50d_pre
366    $ make All    $ make All
367  </screen>  </screen>
368    
369        <para>Which builds the PDF from the LaTeX source, creates the        <para>Which builds the PDF from the LaTeX source, creates the HTML output
370        HTML output from the LaTeX source, parses the FORTRAN code base        from the LaTeX source, parses the FORTRAN code base to produce a
371        to produce a hyperlinked HTML version of the source, and then        hyperlinked HTML version of the source, and then determines the
372        determines the cross-linking between the various HTML        cross-linking between the various HTML components.</para>
373        components.</para>  
374          <para>If there are no errors, the result of the build process (which can
375        <para>If there are no errors, the result of the build process        take 30+ minutes on a P4/2.5Ghz) will be contained within a single
376        (which can take 30+ minutes on a P4/2.5Ghz) will be contained        directory called <filename>scratch/dev_docs</filename>.  This is a freshly
377        within a single directory called        built version of the entire on-line users manual.  If you have the correct
378        <filename>scratch/dev_docs</filename>.  This is a freshly built        permissions, it can be directly copied to the web server area:</para>
       version of the entire on-line users manual.  If you have the  
       correct permissions, it can be directly copied to the web server  
       area:</para>  
379    
380  <screen>  <screen>
381    $ mv scratch/dev_docs /u/u0/httpd/html    $ mv scratch/dev_docs /u/u0/httpd/html
# Line 799  checkpoint50d_pre Line 795  checkpoint50d_pre
795                special command option (see "-command" below) to invoke the MPI                special command option (see "-command" below) to invoke the MPI
796                executable.  Examples of PBS scripts using MPI with testreport can be                executable.  Examples of PBS scripts using MPI with testreport can be
797                found in the <ulink                found in the <ulink
798                url="http://dev.mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm_contrib/test_scripts/">                url="http://mitgcm.org/viewvc/MITgcm/MITgcm_contrib/test_scripts/">
799                MITgcm-contrib area</ulink></para>                MITgcm-contrib area</ulink></para>
800              </listitem>              </listitem>
801            </varlistentry>            </varlistentry>
# Line 811  checkpoint50d_pre Line 807  checkpoint50d_pre
807                output.txt" is not sufficient.  This option allows a more general                output.txt" is not sufficient.  This option allows a more general
808                command (or shell script) to be invoked.  Examples of PBS scripts                command (or shell script) to be invoked.  Examples of PBS scripts
809                using MPI with testreport can be found in the <ulink                using MPI with testreport can be found in the <ulink
810                url="http://dev.mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm_contrib/test_scripts/">                url="http://mitgcm.org/viewvc/MITgcm/MITgcm_contrib/test_scripts/">
811                MITgcm-contrib area</ulink></para>                MITgcm-contrib area</ulink></para>
812              </listitem>              </listitem>
813            </varlistentry>            </varlistentry>
# Line 898  o  Each package gets its runtime configu Line 894  o  Each package gets its runtime configu
894     Package runtime config. options are imported     Package runtime config. options are imported
895     into a common block held in a header file     into a common block held in a header file
896     called "${PKG}.h".     called "${PKG}.h".
897       Note: In some packages, the header file "${PKG}.h" is splitted
898       into "${PKG}_PARAMS.h" that contains the package parameters and
899       ${PKG}_VARS.h" for the field arrays.
900    
901  o  The core driver part of the model can check  o  The core driver part of the model can check
902     for runtime enabling or disabling of individual packages     for runtime enabling or disabling of individual packages
# Line 920  CPP Flags Line 919  CPP Flags
919      1. Within the core driver code flags of the form      1. Within the core driver code flags of the form
920         ALLOW_${PKG} are used to include or exclude         ALLOW_${PKG} are used to include or exclude
921         whole packages. The ALLOW_${PKG} flags are included         whole packages. The ALLOW_${PKG} flags are included
922         from a PKG_CPP_OPTIONS block which is currently         from a PACKAGES_CONFIG.h file that is automatically
923           generated by genmake2 (see genmake2 section).
924         held in-line in the CPP_OPTIONS.h header file.         held in-line in the CPP_OPTIONS.h header file.
925         e.g.         e.g.
926    
927         Core model code .....         Core model code .....
928    
929           #include "PACKAGES_CONFIG.h"
930         #include "CPP_OPTIONS.h"         #include "CPP_OPTIONS.h"
931           :           :
932           :           :
# Line 937  CPP Flags Line 938  CPP Flags
938    
939      2. Within an individual package a header file,      2. Within an individual package a header file,
940         "${PKG}_OPTIONS.h", is used to set CPP flags         "${PKG}_OPTIONS.h", is used to set CPP flags
941         specific to that package. It is not recommended         specific to that package. It also includes
942         to include this file in "CPP_OPTIONS.h".         "PACKAGES_CONFIG.h" and "CPP_OPTIONS.h".
943    
944    
945  Package Boot Sequence  Package Boot Sequence
# Line 990  Package Output Line 991  Package Output
991    
992          #ifdef ALLOW_${PKG}          #ifdef ALLOW_${PKG}
993            if ( use${Pkg} )            if ( use${Pkg} )
994       &       CALL ${PKG}_DIAGS( )       &       CALL ${PKG}_OUTPUT( )
995          #endif          #endif
996    
997       7. S/R PACKAGES_WRITE_PICKUP()       7. S/R PACKAGES_WRITE_PICKUP()
# Line 1006  Description Line 1007  Description
1007        - ${PKG}_READPARMS()        - ${PKG}_READPARMS()
1008      is responsible for reading      is responsible for reading
1009      in the package parameters file data.${pkg}, and storing      in the package parameters file data.${pkg}, and storing
1010      the package parameters in "${PKG}.h".      the package parameters in "${PKG}.h" (or in "${PKG}_PARAMS.h").
1011      -> called from INITIALISE_FIXED in PACKAGES_READPARMS      -> called from INITIALISE_FIXED in PACKAGES_READPARMS
1012    
1013       - ${PKG}_INIT_FIXED()       - ${PKG}_INIT_FIXED()
# Line 1036  Description Line 1037  Description
1037       use for e.g. ${PKG}_INI_VARS, ${PKG}_INIT_VARIABLES, or the old       use for e.g. ${PKG}_INI_VARS, ${PKG}_INIT_VARIABLES, or the old
1038       form ${PKG}_INIT       form ${PKG}_INIT
1039    
1040       - ${PKG}_DIAGS()       - ${PKG}_OUTPUT( )
1041       is responsible for writing time-average diagnostics to output       is responsible for writing time-average fields to output files
1042       files (but the cumulating step is done within the package main S/R).       (but the cumulating step is done within the package main S/R).
1043       Can also contain other diagnostics (.e.g. CALL ${PKG}_MONITOR)       Can also contain other diagnostics (.e.g. CALL ${PKG}_MONITOR)
1044       and write snap-shot fields that are hold in common blocks. Other       and write snap-shot fields that are hold in common blocks. Other
1045       temporary fields are directly dump to file where they are available.       temporary fields are directly dump to file where they are available.
1046       NOTE: this part does not yet have a standard form and should be called       NOTE: 1) the S/R old name ${PKG}_DIAGS is used in some packages
1047         from a package dedicated S/R such as PACKAGE_WRITE_DIAGS                but is beeing replaced by ${PKG}_OUTPUT
1048                  to avoid confusion with pkg/diagnostics functionality.
1049               2) the output part is not yet in a standard form and might still
1050                  evolve a lot.
1051      -> called within DO_THE_MODEL_IO      -> called within DO_THE_MODEL_IO
1052    
1053       - ${PKG}_WRITE_PICKUP()       - ${PKG}_WRITE_PICKUP()
# Line 1070  Summary Line 1074  Summary
1074    -----------------------    -----------------------
1075    * ${PKG}_OPTIONS.h     has further package-specific CPP options    * ${PKG}_OPTIONS.h     has further package-specific CPP options
1076    * ${PKG}.h             package-specific common block variables, fields    * ${PKG}.h             package-specific common block variables, fields
1077       or  ${PKG}_PARAMS.h   package-specific common block parameters
1078       and ${PKG}_VARS.h     package-specific common block fields
1079    
1080  - FORTRAN source files  - FORTRAN source files
1081    -----------------------    -----------------------
# Line 1078  Summary Line 1084  Summary
1084    * ${pkg}_check.F        checks package dependencies and consistencies    * ${pkg}_check.F        checks package dependencies and consistencies
1085    * ${pkg}_init_varia.F   initialises package-related fields    * ${pkg}_init_varia.F   initialises package-related fields
1086    * ${pkg}_... .F         package source code    * ${pkg}_... .F         package source code
1087    * ${pkg}_diags.F        write diagnostics to file.    * ${pkg}_output.F       write output to file.
1088    * ${pkg}_write_pickup.F write a package pickup file to restart the model    * ${pkg}_write_pickup.F write a package pickup file to restart the model
1089    
1090      New: Subroutine in one package (pkgA) that only contains code which
1091           is connected to a 2nd package (pkgB) (e.g.: gmredi_diagnostics_init.F)
1092           will be named: pkgA_pkgB_something.F
1093    
1094  - parameter file  - parameter file
1095    -----------------------    -----------------------
1096    * data.${pkg}          parameter file    * data.${pkg}          parameter file

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22