Difference between revisions of "Glam:testing"

From SourceWiki
Jump to navigation Jump to search
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
The glam respository now contains a test script to provide a quick check for whether code changes impact on model output.  The comparison is based on output files from glam in netcdf format.
 +
 +
The test script is valid if the following hold:
 +
 +
* You can build GLAM using '''make'''.
 +
 +
* The '''GLAM/knowngood/glam_2d.nc''' file contains up to date known good velocity fields.
 +
 +
* '''NC_DIR''' in the makefile points to a valid netcdf installation for your compiler.
 +
 +
 +
==Running the test script==
 +
 +
The test script can be run using the makefile as follows:
 +
 +
<pre>
 
make test
 
make test
 +
</pre>
  
GLAM/knowngood/glam_2d.nc
+
This will build the executable '''GLAM/nccompare.exe''' (from compare.cpp) and run the test script '''GLAM/test.sh'''.  The test results are printed directly to the screen.  Default tolerances for the test are hard coded in compare.cpp, and can be overriden with command line options (which would need to go into the test script).
 
 
  
from Steve:
+
==Further plans==
> ... as noted in previous, I think if you run the test case now it will
 
> report back a failure (rather than ok). That is because I changed the
 
> bcs, which should have been periodic (rather than u=v=0). Re-running the
 
> code now should generate a result that can be used as the 'knowngood' for
 
> the test case.
 
  
Okey doke.  You can just overwrite (cp) the file in the GLAM/knowngood dir and commit the change.
+
* automate the test as part of a nightly build (probably on one of the Bristol machines), if possible accross multiple compilers.
  
Rupert, I can provide Duncan with the tar file to install the Sun compiler on your machine of choice.
+
* make the netcdf output filename a namelist option
  
Yes, it is nice to end up where we were headed.  We do have some significantly better code as a consequence of all our labours, however:)
+
* create further tests, with a namelist file providing configuration information for each, and build these into the test script.
  
Cheers,
+
* add fields to the netcdf outputting as needed
Gethin.
 

Latest revision as of 14:19, 3 July 2008

The glam respository now contains a test script to provide a quick check for whether code changes impact on model output. The comparison is based on output files from glam in netcdf format.

The test script is valid if the following hold:

  • You can build GLAM using make.
  • The GLAM/knowngood/glam_2d.nc file contains up to date known good velocity fields.
  • NC_DIR in the makefile points to a valid netcdf installation for your compiler.


Running the test script

The test script can be run using the makefile as follows:

make test

This will build the executable GLAM/nccompare.exe (from compare.cpp) and run the test script GLAM/test.sh. The test results are printed directly to the screen. Default tolerances for the test are hard coded in compare.cpp, and can be overriden with command line options (which would need to go into the test script).

Further plans

  • automate the test as part of a nightly build (probably on one of the Bristol machines), if possible accross multiple compilers.
  • make the netcdf output filename a namelist option
  • create further tests, with a namelist file providing configuration information for each, and build these into the test script.
  • add fields to the netcdf outputting as needed