/[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.14 by jmc, Fri May 28 01:47:32 2010 UTC revision 1.17 by jmc, Wed May 16 02:33:48 2012 UTC
# Line 31  Line 31 
31          <date>2010-01-21</date>          <date>2010-01-21</date>
32          <authorinitials>jmc</authorinitials>          <authorinitials>jmc</authorinitials>
33          <revremark>          <revremark>
34            update links.            Update links.
35          </revremark>          </revremark>
36        </revision>        </revision>
37        <revision>        <revision>
# Line 42  Line 42 
42            Add subsection "Developer settings" (under CVS Repository).            Add subsection "Developer settings" (under CVS Repository).
43          </revremark>          </revremark>
44        </revision>        </revision>
45          <revision>
46            <revnumber>0.04</revnumber>
47            <date>2011-04-24</date>
48            <authorinitials>jmc</authorinitials>
49            <revremark>
50              Update subsection "The verification suite".
51            </revremark>
52          </revision>
53      </revhistory>      </revhistory>
54    
55      <abstract>      <abstract>
# Line 132  Line 140 
140         doc                      basic developpment documentation         doc                      basic developpment documentation
141         eesupp                   execution environment support code (wrapper)         eesupp                   execution environment support code (wrapper)
142         exe                      empty         exe                      empty
143         jobs                     runtime shell scripts for         jobs                     runtime shell scripts for
144                                    various platforms (not maintained)                                    various platforms (not maintained)
145         lsopt                    line search         lsopt                    line search
146         model                    main dynamics (core)         model                    main dynamics (core)
# Line 151  Line 159 
159    gfd_lab               -?-    gfd_lab               -?-
160    manual                source of MITgcm documentation    manual                source of MITgcm documentation
161    mitgcm.org            build web site    mitgcm.org            build web site
162    old_develop           old and early development source    old_develop           old and early development source
163         misc                 -?-         misc                 -?-
164         models               -?-         models               -?-
165         packages             -?-         packages             -?-
# Line 220  Line 228 
228      <sect2>      <sect2>
229        <title> Developer settings </title>        <title> Developer settings </title>
230    
231        <para>CVS is a convenient tool to keep up-to-date a personal copy of the        <para>CVS is a convenient tool to keep up-to-date a personal copy of the
232        MITgcm code (see: <ulink url="http://mitgcm.org/public/using_cvs.html">        MITgcm code (see: <ulink url="http://mitgcm.org/public/using_cvs.html">
233        using CVS </ulink>). The same tool is used by developers to        using CVS </ulink>). The same tool is used by developers to
234        incorporate any change into the repository. However, this later        incorporate any change into the repository. However, this later
235        function requires specific settings, as detailed here after:</para>        function requires specific settings, as detailed here after</para>
236        <orderedlist>        <orderedlist>
237          <listitem>          <listitem>
238            <para> You will need an account (loggin access) to the server            <para> You will need an account (login access) to the server
239             "mitgcm.org" with the proper group setting (e.g.,             "mitgcm.org" (curently: <filename>forge.csail.mit.edu</filename>)
240              group "gcmctrb" to add/modify code into MITgcm_contrib).             with the proper group setting (e.g., group "gcmctrb" to add/modify
241              This kind of account is granted only upon well motivated request.             code into MITgcm_contrib).
242              The access to the server mitgcm.org is through ssh-key authorization             This kind of account is granted only upon well motivated request
243              which will need to be set properly on both side (on your local machine             (we recommend to ask your senior MITgcm-collaborator to send such
244              and on your server account). You need to be able to             request to marshall-admin at techsquare.com with Cc to Chris Hill
245              to ssh to mitgcm.org (or <filename>ssh MY_USER_NAME@mitgcm.org</filename>             for approval).</para>
246              in case of different user-name on both sides) to proceed further.</para>            <para> The access to the server <filename>mitgcm.org</filename> is
247               through ssh-key authorization which will need to be set properly on
248               both side (on your local machine and on your server account).
249               You need to be able to ssh to <filename>mitgcm.org</filename>
250               (or <filename>ssh MY_USER_NAME@mitgcm.org</filename>
251               in case of different user-name on both sides) to proceed further.</para>
252          </listitem>          </listitem>
253    
254          <listitem>          <listitem>
255            <para> You need to register to the            <para> You need to register to the
256          <ulink url="http://mitgcm.org/mailman/listinfo/mitgcm-cvs">          <ulink url="http://mitgcm.org/mailman/listinfo/mitgcm-cvs">
257        mitgcm-cvs </ulink> mailing list.         mitgcm-cvs </ulink> mailing list.
258            This ensures that other developers will receive email notification            This ensures that other developers will receive email notification
259             when you make changes; you will also receive as well such email             when you make changes; you will also receive such email
260             when others make changes to the repository.             when others make changes to the repository.
261            </para>            </para>
262          </listitem>          </listitem>
263    
264          <listitem>          <listitem>
265            <para> It is highly recommended that you register also to the            <para> It is highly recommended that you register also to the
266          <ulink url="http://mitgcm.org/mailman/listinfo/mitgcm-devel">          <ulink url="http://mitgcm.org/mailman/listinfo/mitgcm-devel">
267        mitgcm-devel </ulink> mailing list (expect a short delay for         mitgcm-devel </ulink> mailing list (expect a short delay for
268         this request to be processed).         this request to be processed).
269            This list is intended for developer discussions.            This list is intended for developer discussions.
270            </para>            </para>
271          </listitem>          </listitem>
272    
273          <listitem>          <listitem>
274            <para> The standard anonymous mode (using "cvsanon", as mentionned            <para> The standard CVS-anonymous mode (using "cvsanon",
275          <ulink url="http://mitgcm.org/public/source_code.html">          as mentionned <ulink url="http://mitgcm.org/public/source_code.html">
276        here </ulink>) does not allow check-in ("cvs commit") permission.          here </ulink>) does not provide check-in ("cvs commit") permission.
277           Instead, you will need to set our CVS environment as follow:</para>           Instead, you will need to set our CVS environment as follow:</para>
278  <screen>  <screen>
279    $ export CVS_RSH=ssh    $ export CVS_RSH=ssh
280    $ export CVSROOT=':ext:MY_USER_NAME@mitgcm.org:/u/gcmpack'    $ export CVSROOT=':ext:MY_USER_NAME@mitgcm.org:/u/gcmpack'
281  </screen>  </screen>
282            <para> After downloading a directory, e.g.: <filename>myCopy</filename>,            <para> The reason for such limitation is that when downloading a directory,
283             from the CVS repository (e.g.,              e.g.: <filename>myCopy</filename>, from the CVS repository (e.g.,
284              <filename>MITgcm_contrib/thisPart</filename>) using the command:</para>              <filename>MITgcm_contrib/thisPart</filename>) using the command:</para>
285  <screen>  <screen>
286    $ cvs co -P -d myCopy MITgcm_contrib/thisPart    $ cvs co -P -d myCopy MITgcm_contrib/thisPart
287  </screen>  </screen>
288            <para> the type of CVS environment which has been used            <para> the type of CVS environment which has been used
289             is stored in the file <filename>myCopy/CVS/Root</filename>             is stored in the file <filename>myCopy/CVS/Root</filename>.
290             and makes it difficult to re-use, for cvs-commit purpose,             This prevent to re-use, for cvs-commit purpose,
291             a cvs local copy (<filename>myCopy</filename>) which was obtained             a cvs local copy (<filename>myCopy</filename>) which was obtained
292             using the CVS anonymous mode.</para>             using the CVS anonymous mode.</para>
293          </listitem>          </listitem>
294    
295          <listitem>          <listitem>
296            <para> At this stage, you should be able to send your modified source            <para> At this stage, you should be able to send your modified source
297            file (e.g., <filename>src_file</filename>) from your local copy directory            file (e.g., <filename>src_file</filename>) from your local copy directory
298            (<filename>myCopy</filename>) to the CVS repository            (<filename>myCopy</filename>) to the CVS repository
299            (<filename>MITgcm_contrib/thisPart</filename>) using the command            (<filename>MITgcm_contrib/thisPart</filename>) using the command
300            "cvs commit":</para>            "cvs commit":</para>
# Line 291  Line 304 
304    $ cvs diff src_file    (optional; list your changes)    $ cvs diff src_file    (optional; list your changes)
305    $ cvs commit src_file    $ cvs commit src_file
306  </screen>  </screen>
307            <para> It is essential that you provide a short description of the            <para> It is essential that you provide a short description of the
308            changes you made to <filename>src_file</filename> as you check-in            changes you made to <filename>src_file</filename> as you check-in
309            this file (the "cvs commit" command automatically opens your standard            this file (the "cvs commit" command automatically opens your standard
310            editor for this purpose).</para>            editor for this purpose).</para>
311              <para> Note:
312               Please ignore the following warnings that the "cvs commit" command
313               produces if you are not part of the "gcmpack" group:
314    <screen>
315       cvs commit: failed to create lock directory for `/u/gcmpack/CVSROOT'
316       (/u/gcmpack/CVSROOT/#cvs.history.lock): Permission denied
317       cvs commit: failed to obtain history lock in repository `/u/gcmpack'
318    </screen>
319              These warnings are not affecting the changes you made to the CVS repository.
320              </para>
321          </listitem>          </listitem>
322    
323        </orderedlist>        </orderedlist>
# Line 357  checkpoint50e_post Line 380  checkpoint50e_post
380  o make KPP work with PTRACERS  o make KPP work with PTRACERS
381   - fix gad_calc_rhs to call new routine kpp_transport_ptr, which is   - fix gad_calc_rhs to call new routine kpp_transport_ptr, which is
382     nearly a copy of kpp_transport_s     nearly a copy of kpp_transport_s
383   - there is no analogue to SurfaceTendencyS, so I have to use   - there is no analogue to SurfaceTendencyS, so I have to use
384     gPtr(of the surface layer) instead     gPtr(of the surface layer) instead
385  o add a new platform SunFire+mpi (SunFire 15000) to genmake  o add a new platform SunFire+mpi (SunFire 15000) to genmake
386  checkpoint50e_pre  checkpoint50e_pre
387    
388  checkpoint50d_post  checkpoint50d_post
389  o change kpp output from multiple-record state files to single-record state  o change kpp output from multiple-record state files to single-record state
390    files analogous to write_state.F    files analogous to write_state.F
391  o reduce the output frequency of cg3d-related stuff to the monitor frequency,  o reduce the output frequency of cg3d-related stuff to the monitor frequency,
392    analogous to the cg2d-related output.    analogous to the cg2d-related output.
393  o fix small problem with in ptracers_write_checkpoint.F: len(suff)=512,  o fix small problem with in ptracers_write_checkpoint.F: len(suff)=512,
394    so that writing to internal file fn (with length 512) fails.    so that writing to internal file fn (with length 512) fails.
395  checkpoint50d_pre  checkpoint50d_pre
396  </programlisting>  </programlisting>
# Line 401  checkpoint50d_pre Line 424  checkpoint50d_pre
424    
425        <para>The following sections describe the individual steps in the build        <para>The following sections describe the individual steps in the build
426          process.</para>          process.</para>
427          
428        <sect3 id="genmake">        <sect3 id="genmake">
429          <title>The <filename>genmake2</> Utility</title>          <title>The <filename>genmake2</> Utility</title>
430    
# Line 554  checkpoint50d_pre Line 577  checkpoint50d_pre
577                  <listitem><para>Packages either explicitly specified or                  <listitem><para>Packages either explicitly specified or
578                      provided by default (in the order given)</para></listitem>                      provided by default (in the order given)</para></listitem>
579                  <listitem><para>Packages included due to package dependencies                  <listitem><para>Packages included due to package dependencies
580                      (in the order that that package dependencies are                      (in the order that that package dependencies are
581                      parsed)</para></listitem>                      parsed)</para></listitem>
582                  <listitem><para>The "standard dirs" (which may have been                  <listitem><para>The "standard dirs" (which may have been
583                      specified by the "-standarddirs" option)</para></listitem>                      specified by the "-standarddirs" option)</para></listitem>
# Line 638  checkpoint50d_pre Line 661  checkpoint50d_pre
661            files, and links.  It is strongly recommended for "un-clean"            files, and links.  It is strongly recommended for "un-clean"
662            directories which may contain the (perhaps partial) results of            directories which may contain the (perhaps partial) results of
663            previous builds. Such "debris" can interfere with the next stage of            previous builds. Such "debris" can interfere with the next stage of
664            the build.            the build.
665            A more agressive cleaning option, "make CLEAN", can be used to also            A more agressive cleaning option, "make CLEAN", can be used to also
666            remove the executable and output files from a previous run.</para>            remove the executable and output files from a previous run.</para>
667    
668          <para>The "make depend" step will create a large number of symbolic          <para>The "make depend" step will create a large number of symbolic
# Line 673  checkpoint50d_pre Line 696  checkpoint50d_pre
696              <listitem>              <listitem>
697                <para>This target produces an <filename>mitgcmuv_ad</> executable                <para>This target produces an <filename>mitgcmuv_ad</> executable
698                  using the <filename>taf</> or <filename>staf</> adjoint                  using the <filename>taf</> or <filename>staf</> adjoint
699                  compiler.  See the <filename>genmake2</> "-adof" option for                  compiler.  See the <filename>genmake2</> "-adof" option for
700                  compiler selection.</para>                  compiler selection.</para>
701              </listitem>              </listitem>
702            </varlistentry>            </varlistentry>
# Line 699  checkpoint50d_pre Line 722  checkpoint50d_pre
722        <title>The Verification Suite</title>        <title>The Verification Suite</title>
723    
724        <para>The MITgcm CVS tree (within the <filename>$ROOTDIR/verification/</>        <para>The MITgcm CVS tree (within the <filename>$ROOTDIR/verification/</>
725          directory) includes more than a dozen examples intended for regression          directory) includes many (> 90) examples intended for regression
726          testing.  Each one of these example directories contains "known-good"          testing.  Each one of these test-experiment directories contains "known-good"
727          output files along with all the input (including both code and data          output files along with all the input (including both code and data
728          files) required for their re-calculation.  These example directories are          files) required for their re-calculation.
729          further broken down into sets of subdirectories          Also included in <filename>$ROOTDIR/verification/</> is the shell
730          (eg. <filename>/input</>, <filename>/code</>) intended to expedite the          script <filename>testreport</> to perform regression tests.</para>
731          testing process.</para>  
732          <sect3 id="test-experiment">
733            <title>Test-experiment Directory Content</title>
734    
735              <para> Each test-experiment directory (<filename>TESTDIR</>) contains
736              several standard subdirectories and files which <filename>testreport</>
737              recognizes and uses when running a regression test.
738              The directories/files that <filename>testreport</> uses are different
739              for a forward test and an adjoint test (<filename>testreport -adm</>)
740              and some test-experiments are set-up for only one type of regression
741              test whereas others allow both types of tests (forward and adjoint).</para>
742              <para>Also some test-experiment allows, using the same MITgcm executable,
743              to perform multiple tests using different parameters and input files,
744              with a primary input set-up
745              (<filename>input/ </> or <filename>input_ad/ </>)
746              and corresponding results (<filename>results/output.txt</> or
747              <filename>results/output_adm.txt</>) and with one or several secondary
748              inputs (<filename>input.OTHER/ </> or <filename>input_ad.OTHER/ </>)
749              and corresponding results (<filename>results/output.OTHER.txt </>
750              or <filename>results/output_adm.OTHER.txt</>).</para>
751            <variablelist>
752    
753              <varlistentry>
754                <term>directory <filename>TESTDIR/results/</></term>
755                <listitem>
756                  <para>contains reference standard output used for test comparison.
757                    <filename>results/output.txt</> and
758                    <filename>results/output_adm.txt</>
759                    correspond respectively to primary forward and adjoint test
760                    run on the reference platform (currently
761                    <filename>baudelaire.csail.mit.edu</>)
762                    on one processor (no MPI, single thread)
763                    using the reference compiler (curently the GNU fortran
764                    compiler <filename>gfortran</>).
765                    The presence of these files determines whether or not
766                    <filename>testreport</> is testing or skipping
767                    this test-experiment.
768                    Reference standard output for secondary tests
769                    (<filename>results/output.OTHER.txt</>
770                    or <filename>results/output_adm.OTHER.txt</>) are
771                    also expected here.</para>
772                  <para>The test comparison involves few model variables output, which are,
773                    by default and for a forward test, the 2-D solver initial residual
774                    (<filename>cg2d_init_res</>) and 3-D state variables (T,S,U,V)
775                    monitor output, and, by default and for an adjoint test, the
776                    cost-function and gradient-check. However, some test-experiments
777                    use some package-specific variable/monitor output according to
778                    the file <filename>TESTDIR/input[_ad][.OTHER]/tr_checklist</>
779                    specification.</para>
780                </listitem>
781              </varlistentry>
782    
783              <varlistentry>
784                <term>directory <filename>TESTDIR/build/</></term>
785                <listitem>
786                  <para> initially empty directory where <filename>testreport</>
787                    will build the MITgcm executable for forward and adjoint test.
788                    It might contains an experiment specific
789                    <filename>genmake_local</> file (see <xref linkend="genmake">).
790                    </para>
791                  <para> Note that the original <filename>code[_ad]/SIZE.h_mpi</>
792                    is not directly used as "SIZE.h" to build an MPI-executable ;
793                    instead, a local copy <filename>build/SIZE.h.mpi</> is derived
794                    from <filename>code[_ad]/SIZE.h_mpi</>
795                    by adjusting the number of processors (nPx,nPy) according to
796                    <filename>NUMBER_OF_PROCS</> (see <xref linkend="testreport">,
797                    <filename>testreport -MPI</>) ; then it is linked to "SIZE.h"
798                    (<filename> ln -s SIZE.h.mpi SIZE.h </>) before building
799                    the MPI-executable.</para>
800                </listitem>
801              </varlistentry>
802    
803              <varlistentry>
804                <term>directory <filename>TESTDIR/code/</></term>
805                <listitem>
806                  <para>contains the test-experiment specific source code
807                    used to build the MITgcm executable (<filename>mitgcmuv</>)
808                    for forward-test (using <filename>genmake2 -mods=../code</>).
809                    </para>
810                    <para> It can also contain specific source files with the suffix
811                    "<filename>_mpi</>" to be used
812                    <!--
813                    in the <filename>TESTDIR/build/</> directory
814                    -->
815                    in place of the corresponding file (without suffix)
816                    for an MPI test (see <xref linkend="testreport">).
817                    The presence or absence of <filename>SIZE.h_mpi</>
818                    determines whether or not an MPI test on this
819                    test-experiment is performed or skipped.</para>
820                </listitem>
821              </varlistentry>
822    
823              <varlistentry>
824                <term>directory <filename>TESTDIR/code_ad/</></term>
825                <listitem>
826                  <para>contains the test-experiment specific source code
827                    used to build the MITgcm executable (<filename>mitgcmuv_ad</>)
828                    for adjoint-test (using <filename>genmake2 -mods=../code_ad</>).
829                    It can also contain specific source files with the suffix
830                    "<filename>_mpi</>" (see above).</para>
831                </listitem>
832              </varlistentry>
833    
834              <varlistentry>
835                <term>directory <filename>TESTDIR/input/</></term>
836                <listitem>
837                  <para>contains the input and parameter files
838                    used to run the primary forward test of this test-experiment.
839                    </para>
840                  <para>It can also contain specific parameter files with the suffix
841                    "<filename>.mpi</>" to be used
842                    <!--
843                    in the <filename>TESTDIR/run/</> directory
844                    -->
845                    in place of the corresponding file (without suffix) for MPI
846                    test, or with suffix "<filename>.mth</>" to be used for
847                    multi-threaded test (see <xref linkend="testreport">).
848                    The presence or absence of <filename>eedata.mth</>
849                    determines whether or not a multi-threaded test on this
850                    test-experiment is performed or skipped.</para>
851                  <para>To save disk space and reduce downloading time, multiple
852                    copies of the same input file is avoided by using a shell
853                    script <filename>prepare_run</>.
854                    When such a script is found in <filename>TESTDIR/input/ </>,
855                    <filename>testreport</> run this script in directory
856                    <filename>TESTDIR/run/ </> after linking all the input file
857                    from <filename>TESTDIR/input/ </>.
858                    </para>
859                </listitem>
860              </varlistentry>
861    
862              <varlistentry>
863                <term>directory <filename>TESTDIR/input_ad/</></term>
864                <listitem>
865                  <para>contains the input and parameter files
866                    used to run the primary adjoint test of this test-experiment.
867                    It can also contain specific parameter files with the suffix
868                    "<filename>.mpi</>" and shell script <filename>prepare_run</>
869                    as described above.</para>
870                </listitem>
871              </varlistentry>
872    
873              <varlistentry>
874                <term>directory <filename>TESTDIR/input.OTHER/</></term>
875                <listitem>
876                  <para>contains the input and parameter files
877                    used to run the secondary OTHER forward test of this test-experiment.
878                    It can also contain specific parameter files with suffix
879                    "<filename>.mpi</>" or "<filename>.mth</>" and shell script
880                    <filename>prepare_run</> (see above).</para>
881                    <para> The presence or absence the file <filename>eedata.mth</>
882                    determines whether or not a secondary multi-threaded test on this
883                    test-experiment is performed or skipped.</para>
884                </listitem>
885              </varlistentry>
886    
887              <varlistentry>
888                <term>directory <filename>TESTDIR/input_ad.OTHER/</></term>
889                <listitem>
890                  <para>contains the input and parameter files
891                    used to run the secondary OTHER adjoint test of this test-experiment.
892                    It can also contain specific parameter files with the suffix
893                    "<filename>.mpi</>" and shell script <filename>prepare_run</>
894                    (see above).</para>
895                </listitem>
896              </varlistentry>
897                    <!--
898                    -->
899              <varlistentry>
900                <term>directory <filename>TESTDIR/run/</></term>
901                <listitem>
902                  <para> initially empty directory where <filename>testreport</>
903                    will run the MITgcm executable for primary forward and adjoint
904                    test.</para>
905                  <para>Symbolic links (using command "<filename>ln -s</>") are made
906                    for input and parameter files (from <filename>../input/ </>
907                    or from <filename>../input_ad/ </>) and for MITgcm executable
908                    (from <filename>../build/ </>) before the run proceeds.
909                    The sequence of links (function <filename>linkdata</> within shell
910                    script <filename>testreport</>) for a forward test is:</para>
911    <screen>
912    * link+rename or remove links
913           to special files with suffix ".mpi" or ".mth" from ../input/
914    * link files from ../input/
915    * execute ../input/prepare_run (if it exists)
916    </screen>
917                  <para>The sequence for an ajoint test is similar, with
918                    <filename>../input_ad/ </> replacing <filename>../input/ </>.
919                    </para>
920                </listitem>
921              </varlistentry>
922    
923              <varlistentry>
924                <term>directory <filename>TESTDIR/tr_run.OTHER/</></term>
925                <listitem>
926                  <para> directory created by <filename>testreport</>
927                    to run the MITgcm executable for secondary "OTHER" forward
928                    or adjoint test.</para>
929                  <para> The sequence of links for a forward secondary test is:</para>
930    <screen>
931    * link+rename or remove links
932           to special files with suffix ".mpi" or ".mth" from ../input.OTHER/
933    * link files from ../input.OTHER/
934    * execute ../input.OTHER/prepare_run (if it exists)
935    * link files from ../input/
936    * execute ../input/prepare_run (if it exists)
937    </screen>
938                  <para>The sequence for an ajoint test is similar, with
939                    <filename>../input_ad.OTHER/ </> and <filename>../input_ad/ </>
940                    replacing <filename>../input.OTHER/ </> and <filename>../input/ </>.
941                    </para>
942                </listitem>
943              </varlistentry>
944    
945            </variablelist>
946          </sect3>
947    
948        <sect3 id="testreport">        <sect3 id="testreport">
949          <title>The <filename>testreport</> Utility</title>          <title>The <filename>testreport</> Utility</title>
950    
951          <para>Also included in <filename>$ROOTDIR/verification/</> are shell          <para> The shell script  <filename>testreport</> (in
952            scripts for automated testing.  The newest script (which was written            <filename>$ROOTDIR/verification/</>), which was written to work with
953            to work with <filename>genmake2</>) is called <filename>testreport</>.            <filename>genmake2</>, can be used to build different versions
954            This script can be used to build different versions of the MITgcm            of the MITgcm code, run the various examples, compare the output,
955            code, run the various examples, compare the output, and (if specified)            and (if specified) email the results of each one of these tests to a
956            email the results of each one of these tests to a central            central repository.</para>
           repository.</para>  
957    
958          <para>On some systems, the testreport script can be run with a command          <para>On some systems, the testreport script can be run with a command
959          line as simple as:</para>          line as simple as:</para>
960    
961  <screen>  <screen>
962    $ cd verification    $ cd verification
963    $ ./testreport -ieee    $ ./testreport
964  </screen>  </screen>
965    
966          <para>However, some systems (those lacking or wiht a broken "/bin/sh")          <para>However, some systems (those lacking or wiht a broken "/bin/sh")
967            may require an explicit shell invocation such as:</para>            may require an explicit shell invocation such as:</para>
968    
969  <screen>  <screen>
970    $ sh ./testreport -ieee -t 'exp0 exp4'    $ sh ./testreport -t 'exp2 exp4'
971    $ /some/path/to/bash ./testreport -ieee -t 'ideal_2D_oce lab_sea natl_box'    $ /some/path/to/bash ./testreport -t 'ideal_2D_oce lab_sea natl_box'
972  </screen>  </screen>
973    
974          <para>The <filename>testreport</> script accepts a number of          <para>The <filename>testreport</> script accepts a number of
# Line 741  checkpoint50d_pre Line 978  checkpoint50d_pre
978          <variablelist>          <variablelist>
979    
980            <varlistentry>            <varlistentry>
981              <term><filename>-ieee</></term>              <term><filename>-ieee</> (default) / <filename>-noieee</></term>
982              <listitem>              <listitem>
983                <para>If allowed by the compiler (as defined in the "optfile"),                <para>If allowed by the compiler (as defined in the "optfile"),
984                  use IEEE arithmetic.  This option, along with the GCC compiler,                  use IEEE arithmetic (<filename>genmake2 -ieee</>).
985                  is how the standard results were produced.</para>                  This option, along with the gfortran / gcc compiler,
986                    is how the standard results are produced.</para>
987                </listitem>
988              </varlistentry>
989    
990              <varlistentry>
991                <term><filename>-optfile=/PATH/FILENAME</></term>
992                <term><filename>-optfile '/PATH/F1 [/PATH/F2 ...]'</></term>
993                <listitem>
994                  <para>This specifies a list of "options files" that will be passed
995                    to <filename>genmake2</>.  If multiple options files are used
996                    (say, to test different compilers or different sets of options
997                    for the same compiler), then each options file will be used with
998                    each of the test directories.</para>
999              </listitem>              </listitem>
1000            </varlistentry>            </varlistentry>
1001    
# Line 756  checkpoint50d_pre Line 1006  checkpoint50d_pre
1006                <para>This option specifies the test directory or list of test                <para>This option specifies the test directory or list of test
1007                  directories that should be used.  Each of these entries should                  directories that should be used.  Each of these entries should
1008                  exactly (note: they are case sensitive!) match the names of                  exactly (note: they are case sensitive!) match the names of
1009                  directries in <filename>$ROOTDIR/verification/</>.  If this                  directories in <filename>$ROOTDIR/verification/</>.  If this
1010                  option is omitted, then all directories that are properly                  option is omitted, then all directories that are properly
1011                  formatted (that is, containing an <filename>input</>                  formatted (that is, containing an <filename>input</>
1012                  sub-directory and a <filename>results/output.txt</> file) will                  sub-directory and a <filename>results/output.txt</> file) will
# Line 765  checkpoint50d_pre Line 1015  checkpoint50d_pre
1015            </varlistentry>            </varlistentry>
1016    
1017            <varlistentry>            <varlistentry>
             <term><filename>-optfile=/PATH/FILENAME</></term>  
             <term><filename>-optfile '/PATH/F1 [/PATH/F2 ...]'</></term>  
             <listitem>  
               <para>This specifies a list of "options files" that will be passed  
                 to <filename>genmake2</>.  If multiple options files are used  
                 (say, to test different compilers or different sets of options  
                 for the same compiler), then each options file will be used with  
                 each of the test directories.</para>  
             </listitem>  
           </varlistentry>  
   
           <varlistentry>  
1018              <term><filename>-addr EMAIL</></term>              <term><filename>-addr EMAIL</></term>
1019              <term><filename>-addr 'EMAIL1 EMAIL2 [...]'</></term>              <term><filename>-addr 'EMAIL1 EMAIL2 [...]'</></term>
1020              <listitem>              <listitem>
# Line 790  checkpoint50d_pre Line 1028  checkpoint50d_pre
1028            </varlistentry>            </varlistentry>
1029    
1030            <varlistentry>            <varlistentry>
1031                <term><filename>-MPI NUMBER_OF_PROCS</></term>
1032              <term><filename>-mpi</></term>              <term><filename>-mpi</></term>
1033              <listitem>              <listitem>
1034                <para>If the necessary files                <para>If the necessary file (<filename>TESTDIR/code/SIZE.h_mpi</>)
1035                (<filename>TESTDIR/code/CPP_EEOPTIONS.h_mpi</> and                exists, then use it (and all <filename>TESTDIR/code/*_mpi</> files)
1036                <filename>TESTDIR/code/SIZE.h_mpi</>) exist, then use them for an                for an MPI--enabled run.  The new option (<filename>-MPI</> followed
1037                MPI--enabled run.  Note that the use of MPI typically requires a                by the maximum number of processors) enable to build and run each
1038                  test-experiment using variable number of MPI processors (multiple
1039                  of <filename>nPx*nPy</> from <filename>TESTDIR/code/SIZE.h_mpi</>
1040                  and not larger than <filename>NUMBER_OF_PROCS</>).
1041                  The short option ("-mpi") can only be used to build and run on 2 MPI
1042                  processors (equivalent to "<filename>-MPI 2</>").</para>
1043                  <para>Note that the use of MPI typically requires a
1044                special command option (see "-command" below) to invoke the MPI                special command option (see "-command" below) to invoke the MPI
1045                executable.  Examples of PBS scripts using MPI with testreport can be                executable.  Examples of PBS scripts using testreport with MPI can be
1046                found in the <ulink                found in the <ulink
1047                url="http://mitgcm.org/viewvc/MITgcm/MITgcm_contrib/test_scripts/">                url="http://mitgcm.org/viewvc/MITgcm/MITgcm/tools/example_scripts/">
1048                MITgcm-contrib area</ulink></para>                tools/example_scripts directory</ulink>.</para>
1049              </listitem>              </listitem>
1050            </varlistentry>            </varlistentry>
1051    
1052            <varlistentry>            <varlistentry>
1053              <term><filename>-command='some command to run'</></term>              <term><filename>-command='some command to run'</></term>
1054              <listitem>              <listitem>
1055                <para>For some tests, particularly MPI runs, the default "make                <para>For some tests, particularly MPI runs, a specific command
1056                output.txt" is not sufficient.  This option allows a more general                might be needed to run the executable. This option allows a more general
1057                command (or shell script) to be invoked.  Examples of PBS scripts                command (or shell script) to be invoked.  Examples of PBS scripts
1058                using MPI with testreport can be found in the <ulink                using testreport with MPI can be found in the <ulink
1059                url="http://mitgcm.org/viewvc/MITgcm/MITgcm_contrib/test_scripts/">                url="http://mitgcm.org/viewvc/MITgcm/MITgcm/tools/example_scripts/">
1060                MITgcm-contrib area</ulink></para>                tools/example_scripts directory</ulink>.</para>
1061                  <para>
1062                    For the case where the number of MPI processors varies according
1063                    to each test-experiment, some key-words within the command-to-run
1064                    argument will be replaced by their effective value:</para>
1065                  <para>
1066                    <filename>TR_NPROC </> will be replaced by the actual number
1067                    of MPI processors needed to run the current test-experiment.</para>
1068                  <para>
1069                    <filename>TR_MFILE </> will be replaced by the name of local-file
1070                    that testreport creates from the full list of machines which
1071                    "<filename>testreport -mf MACHINE_FILE</>" provides, but truncated
1072                    to the exact number of machines.</para>
1073                </listitem>
1074              </varlistentry>
1075    
1076              <varlistentry>
1077                <term><filename>-mf MACHINE_FILE</></term>
1078                <listitem>
1079                  <para>
1080                    To use with <filename>-MPI NUMBER_OF_PROCS</> option, to specify
1081                    the file containing the full list of <filename>NUMBER_OF_PROCS</>
1082                    machines to use for the MPI runs.</para>
1083                </listitem>
1084              </varlistentry>
1085    
1086              <varlistentry>
1087                <term><filename>-mth</></term>
1088                <listitem>
1089                  <para>compile (with <filename>genmake2 -omp</>) and run with
1090                    multiple threads (using eedata.mth).</para>
1091              </listitem>              </listitem>
1092            </varlistentry>            </varlistentry>
1093    
1094          </variablelist>          </variablelist>
1095    
1096          <para>The <filename>testreport</> script will write progress to the          <para>The <filename>testreport</> script will create an output directory
1097            screen (stdout) as it runs.  In addition, it will create a            <filename>tr_NAME_DATE_N/ </>, with <filename>hostname</> as default
1098            <filename>tr_out.txt</> file that contains a brief comparison of the            <filename>NAME</>, <filename>DATE</> the current date followed by
1099            current output with the "known-good" output.</para>            a suffix number "N" to distinguish from previous
1100              <filename>testreport</> output directories.
1101              <filename>testreport</> writes progress to the screen (stdout)
1102              and reports into the ouput directory as it runs.
1103              In particular, one can find, in the ouput directory,
1104              the <filename>summary.txt</> file that contains a brief comparison
1105              of the current output with the "known-good" output.
1106              At the end of the testing process, the <filename>tr_out.txt</> file
1107              is generated in <filename>$ROOTDIR/verification/ </>
1108              as a compact version of <filename>summry.txt</> file.</para>
1109    
1110        </sect3>        </sect3>
1111    
1112          <sect3 id="tst_2plus2">
1113            <title>The <filename>do_tst_2+2</> Utility</title>
1114            <para> The shell script  <filename>do_tst_2+2</> (in
1115              <filename>$ROOTDIR/tools/ </>)
1116              can be used to check the accuracy of the restart procedure.
1117            </para>
1118          </sect3>
1119    
1120      </sect2>      </sect2>
1121    
1122    
# Line 863  separated from the generic fluid dynamic Line 1155  separated from the generic fluid dynamic
1155  below using generic package names ${pkg}.  below using generic package names ${pkg}.
1156  A concrete examples of a package is the code  A concrete examples of a package is the code
1157  for implementing GM/Redi mixing. This code uses  for implementing GM/Redi mixing. This code uses
1158  the package name  the package name
1159  *   ${PKG} = GMREDI  *   ${PKG} = GMREDI
1160  *   ${pkg} = gmredi  *   ${pkg} = gmredi
1161  *   ${Pkg} = gmRedi  *   ${Pkg} = gmRedi
# Line 898  o  Each package gets its runtime configu Line 1190  o  Each package gets its runtime configu
1190     Package runtime config. options are imported     Package runtime config. options are imported
1191     into a common block held in a header file     into a common block held in a header file
1192     called "${PKG}.h".     called "${PKG}.h".
1193     Note: In some packages, the header file "${PKG}.h" is splitted     Note: In some packages, the header file "${PKG}.h" is splitted
1194     into "${PKG}_PARAMS.h" that contains the package parameters and     into "${PKG}_PARAMS.h" that contains the package parameters and
1195     ${PKG}_VARS.h" for the field arrays.     ${PKG}_VARS.h" for the field arrays.
1196    
1197  o  The core driver part of the model can check  o  The core driver part of the model can check
# Line 923  CPP Flags Line 1215  CPP Flags
1215      1. Within the core driver code flags of the form      1. Within the core driver code flags of the form
1216         ALLOW_${PKG} are used to include or exclude         ALLOW_${PKG} are used to include or exclude
1217         whole packages. The ALLOW_${PKG} flags are included         whole packages. The ALLOW_${PKG} flags are included
1218         from a PACKAGES_CONFIG.h file that is automatically         from a PACKAGES_CONFIG.h file that is automatically
1219         generated by genmake2 (see genmake2 section).         generated by genmake2 (see genmake2 section).
1220         held in-line in the CPP_OPTIONS.h header file.         held in-line in the CPP_OPTIONS.h header file.
1221         e.g.         e.g.
# Line 942  CPP Flags Line 1234  CPP Flags
1234    
1235      2. Within an individual package a header file,      2. Within an individual package a header file,
1236         "${PKG}_OPTIONS.h", is used to set CPP flags         "${PKG}_OPTIONS.h", is used to set CPP flags
1237         specific to that package. It also includes         specific to that package. It also includes
1238         "PACKAGES_CONFIG.h" and "CPP_OPTIONS.h".         "PACKAGES_CONFIG.h" and "CPP_OPTIONS.h".
1239    
1240    
# Line 956  Package Boot Sequence Line 1248  Package Boot Sequence
1248      1. S/R PACKAGES_BOOT()      1. S/R PACKAGES_BOOT()
1249              :              :
1250          CALL OPEN_COPY_DATA_FILE( 'data.pkg', 'PACKAGES_BOOT', ... )          CALL OPEN_COPY_DATA_FILE( 'data.pkg', 'PACKAGES_BOOT', ... )
1251    
1252    
1253      2. S/R PACKAGES_READPARMS()      2. S/R PACKAGES_READPARMS()
1254              :              :
# Line 1008  Package Output Line 1300  Package Output
1300  Description  Description
1301  ===========  ===========
1302    
1303        - ${PKG}_READPARMS()        - ${PKG}_READPARMS()
1304      is responsible for reading      is responsible for reading
1305      in the package parameters file data.${pkg}, and storing      in the package parameters file data.${pkg}, and storing
1306      the package parameters in "${PKG}.h" (or in "${PKG}_PARAMS.h").      the package parameters in "${PKG}.h" (or in "${PKG}_PARAMS.h").
1307      -> called from INITIALISE_FIXED in PACKAGES_READPARMS      -> called from INITIALISE_FIXED in PACKAGES_READPARMS
1308    
1309       - ${PKG}_INIT_FIXED()       - ${PKG}_INIT_FIXED()
1310      is responsible for completing the internal setup of a package.      is responsible for completing the internal setup of a package.
1311      -> called from INITIALISE_FIXED in PACKAGES_INIT_FIXED      -> called from INITIALISE_FIXED in PACKAGES_INIT_FIXED
1312      note: 1) some pkg use instead:      note: 1) some pkg use instead:
1313               CALL ${PKG}_INITIALISE  ( or the old form CALL ${PKG}_INIT )               CALL ${PKG}_INITIALISE  ( or the old form CALL ${PKG}_INIT )
1314            2) for simple pkg setup, this part is done inside ${PKG}_READPARMS            2) for simple pkg setup, this part is done inside ${PKG}_READPARMS
1315    
1316       - ${PKG}_CHECK()       - ${PKG}_CHECK()
1317      is responsible for validating      is responsible for validating
1318      basic package setup and inter-package dependencies.      basic package setup and inter-package dependencies.
1319      ${PKG}_CHECK can import other package parameters it may      ${PKG}_CHECK can import other package parameters it may
# Line 1030  Description Line 1322  Description
1322      will not be reset during ${PKG}_CHECK().      will not be reset during ${PKG}_CHECK().
1323      -> called from INITIALISE_FIXED in PACKAGES_CHECK      -> called from INITIALISE_FIXED in PACKAGES_CHECK
1324    
1325       - ${PKG}_INIT_VARIA()       - ${PKG}_INIT_VARIA()
1326      is responsible for fill-in all package variables with an initial value.      is responsible for fill-in all package variables with an initial value.
1327      Contains eventually a call to ${PKG}_READ_PICKUP that will read      Contains eventually a call to ${PKG}_READ_PICKUP that will read
1328      from a pickup file the package variables required to restart the model.      from a pickup file the package variables required to restart the model.
1329      This routine is called after the core model state has been completely      This routine is called after the core model state has been completely
1330      initialised but before the core model timestepping starts.      initialised but before the core model timestepping starts.
1331      -> called from INITIALISE_VARIA in PACKAGES_INIT_VARIABLES      -> called from INITIALISE_VARIA in PACKAGES_INIT_VARIABLES
1332      note: the name ${PKG}_INIT_VARIA is not yet standard and some pkg      note: the name ${PKG}_INIT_VARIA is not yet standard and some pkg
1333       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
1334       form ${PKG}_INIT       form ${PKG}_INIT
1335    
1336       - ${PKG}_OUTPUT( )       - ${PKG}_OUTPUT( )
1337       is responsible for writing time-average fields to output files       is responsible for writing time-average fields to output files
1338       (but the cumulating step is done within the package main S/R).       (but the cumulating step is done within the package main S/R).
1339       Can also contain other diagnostics (.e.g. CALL ${PKG}_MONITOR)       Can also contain other diagnostics (.e.g. CALL ${PKG}_MONITOR)
1340       and write snap-shot fields that are hold in common blocks. Other       and write snap-shot fields that are hold in common blocks. Other
1341       temporary fields are directly dump to file where they are available.       temporary fields are directly dump to file where they are available.
1342       NOTE: 1) the S/R old name ${PKG}_DIAGS is used in some packages       NOTE: 1) the S/R old name ${PKG}_DIAGS is used in some packages
1343                but is beeing replaced by ${PKG}_OUTPUT                but is beeing replaced by ${PKG}_OUTPUT
1344                to avoid confusion with pkg/diagnostics functionality.                to avoid confusion with pkg/diagnostics functionality.
1345             2) the output part is not yet in a standard form and might still             2) the output part is not yet in a standard form and might still
1346                evolve a lot.                evolve a lot.
1347      -> called within DO_THE_MODEL_IO      -> called within DO_THE_MODEL_IO
1348    
1349       - ${PKG}_WRITE_PICKUP()       - ${PKG}_WRITE_PICKUP()
1350       is responsible for writing a package pickup file when necessary for       is responsible for writing a package pickup file when necessary for
1351       a restart. (found also the old name: ${PKG}_WRITE_CHECKPOINT )       a restart. (found also the old name: ${PKG}_WRITE_CHECKPOINT )
1352      -> called from FORWARD_STEP and THE_MODEL_MAIN in PACKAGES_WRITE_PICKUP      -> called from FORWARD_STEP and THE_MODEL_MAIN in PACKAGES_WRITE_PICKUP
1353    
# Line 1091  Summary Line 1383  Summary
1383    * ${pkg}_output.F       write output to file.    * ${pkg}_output.F       write output to file.
1384    * ${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
1385    
1386    New: Subroutine in one package (pkgA) that only contains code which    New: Subroutine in one package (pkgA) that only contains code which
1387         is connected to a 2nd package (pkgB) (e.g.: gmredi_diagnostics_init.F)         is connected to a 2nd package (pkgB) (e.g.: gmredi_diagnostics_init.F)
1388         will be named: pkgA_pkgB_something.F         will be named: pkgA_pkgB_something.F
1389    
# Line 1148  Summary Line 1440  Summary
1440        the CVS tree.</para>        the CVS tree.</para>
1441    
1442        <para>The result is a command that resembles either</para>        <para>The result is a command that resembles either</para>
1443          
1444        <orderedlist>        <orderedlist>
1445          <listitem>          <listitem>
1446            <para>a reference to a variable or subroutine name such as            <para>a reference to a variable or subroutine name such as
# Line 1167  Summary Line 1459  Summary
1459                into a "-")</para>                into a "-")</para>
1460          </listitem>          </listitem>
1461        </orderedlist>        </orderedlist>
1462                      
1463    
1464    
1465      </sect2>      </sect2>
1466    
1467      <sect2>      <sect2>
1468        <title>Building the Documentation</title>        <title>Building the Documentation</title>
1469          
1470        <para>Given the directory structure of <xref        <para>Given the directory structure of <xref
1471        linkend="documentation_getting">, the entire documentation for the web        linkend="documentation_getting">, the entire documentation for the web
1472        site can be built using:</para>        site can be built using:</para>

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.22