<p><b>ringler@lanl.gov</b> 2009-10-27 14:34:20 -0600 (Tue, 27 Oct 2009)</p><p><br>
adding very basic code testing, see testing/tc2/test_tc2<br>
<br>
this regression procedure should (at some point) be rewritten by someone who knows shells better than I do.<br>
</p><hr noshade><pre><font color="gray">Added: trunk/swmodel/testing/tc2/analysis/scanit
===================================================================
--- trunk/swmodel/testing/tc2/analysis/scanit         (rev 0)
+++ trunk/swmodel/testing/tc2/analysis/scanit        2009-10-27 20:34:20 UTC (rev 65)
@@ -0,0 +1,87 @@
+ifort -o scanner scanner.F90
+rm -f summary
+
+setenv ANALYSIS /Volumes/Simulations/MPAS/svn-mpas-model.cgd.ucar.edu/trunk/swmodel/run/tc2/analysis
+
+setenv SPACE
+date "+D20%y%m%d" > summary
+echo $SPACE >> summary
+cd /Volumes/Simulations/MPAS/svn-mpas-model.cgd.ucar.edu/trunk/swmodel
+svn info >> $ANALYSIS/summary
+svn info > $ANALYSIS/svn.info
+
+cd $ANALYSIS
+
+#-------------------------------------------------------------------------
+# strip data from netcdf files
+setenv RES 2562
+ncdump -v h ../$RES/output.nc > thickness.$RES.out
+
+setenv RES 10242
+ncdump -v h ../$RES/output.nc > thickness.$RES.out
+
+setenv RES 40962
+ncdump -v h ../$RES/output.nc > thickness.$RES.out
+
+setenv RES 163842
+ncdump -v h ../$RES/output.nc > thickness.$RES.out
+
+setenv RES 655362
+ncdump -v h ../$RES/output.nc > thickness.$RES.out
+# end strip data
+#-------------------------------------------------------------------------
+
+
+#-------------------------------------------------------------------------
+# scan data for diagnostics
+setenv NDAYS 16
+setenv NSKIP 66
+rm -f fort.10
+
+setenv NDATA 2562
+rm -f input
+echo $NDAYS > input
+echo $NDATA >> input
+echo $NSKIP >> input
+cp -f thickness.$NDATA.out fort.10
+scanner < input > minmax.$NDATA.out
+rm -f fort.10
+
+setenv NDATA 10242
+rm -f input
+echo $NDAYS > input
+echo $NDATA >> input
+echo $NSKIP >> input
+cp -f thickness.$NDATA.out fort.10
+scanner < input > minmax.$NDATA.out
+rm -f fort.10
+
+setenv NDATA 40962
+rm -f input
+echo $NDAYS > input
+echo $NDATA >> input
+echo $NSKIP >> input
+cp -f thickness.$NDATA.out fort.10
+scanner < input > minmax.$NDATA.out
+rm -f fort.10
+
+#setenv NDATA 163842
+rm -f input
+echo $NDAYS > input
+echo $NDATA >> input
+echo $NSKIP >> input
+cp -f thickness.$NDATA.out fort.10
+scanner < input > minmax.$NDATA.out
+rm -f fort.10
+
+#setenv NDATA 655362
+rm -f input
+echo $NDAYS > input
+echo $NDATA >> input
+echo $NSKIP >> input
+cp -f thickness.$NDATA.out fort.10
+scanner < input > minmax.$NDATA.out
+rm -f fort.10
+
+#end scan data
+#-------------------------------------------------------------------------
Added: trunk/swmodel/testing/tc2/analysis/scanner.F90
===================================================================
--- trunk/swmodel/testing/tc2/analysis/scanner.F90         (rev 0)
+++ trunk/swmodel/testing/tc2/analysis/scanner.F90        2009-10-27 20:34:20 UTC (rev 65)
@@ -0,0 +1,45 @@
+program scanner
+
+integer iday, ndays
+integer idata, ndata, nskip
+character*80 :: tmp, rev
+
+real, allocatable, dimension(:,:) :: h
+
+open(12,file='summary',form='formatted',access='append')
+
+
+!open(13,file='svn.info',form='formatted')
+!do i=1,4
+!read(13,*) tmp
+!enddo
+!read(13,*) tmp, idata
+!write(8,*) idata
+!close(8)
+!read(8,'(a4)') rev
+!rev = trim(rev)
+!write(9,'(a4)') rev
+!stop
+
+read(5,*) ndays
+read(5,*) ndata
+read(5,*) nskip
+allocate(h(ndata,ndays))
+h=0
+
+do i=1,nskip
+read(10,*)
+enddo
+
+do idays=1,ndays
+do idata=1,ndata
+read(10,*) h(idata,idays)
+enddo
+enddo
+
+do idays=1,ndays
+write(6,'(2e20.10)') minval(h(:,idays)), maxval(h(:,idays))
+if(idays.eq.ndays) write(12,'(i8,2e20.10)') ndata, minval(h(:,idays)), maxval(h(:,idays))
+enddo
+
+end program scanner
Added: trunk/swmodel/testing/tc2/test_tc2
===================================================================
--- trunk/swmodel/testing/tc2/test_tc2         (rev 0)
+++ trunk/swmodel/testing/tc2/test_tc2        2009-10-27 20:34:20 UTC (rev 65)
@@ -0,0 +1,79 @@
+
+#
+# TC == test case to run (note: must be also set in $DIR/namelist.input)
+# PROCS == number of procs to run
+# GRID == head directory for all the grid resolutions to be run
+# DIR == head directory where output will be stored and scanned (directory tree must already exist)
+# BASE == is the path to Makefile to build swmodel
+# SCRATCH == path to where simulations will be run (NOTE: this directory will be recursively REMOVED)
+
+setenv TC tc2
+setenv PROCS 4
+setenv GRID /Volumes/Simulations/MPAS/svn-mpas-model.cgd.ucar.edu/trunk/swmodel/grids
+setenv DIR /Volumes/Simulations/MPAS/svn-mpas-model.cgd.ucar.edu/trunk/swmodel/testing/$TC
+setenv BASE /Volumes/Simulations/MPAS/svn-mpas-model.cgd.ucar.edu/trunk/swmodel
+setenv SCRATCH /Volumes/Simulations/scratch
+
+cd $BASE
+make clean
+make
+
+rm -f -r $SCRATCH
+mkdir $SCRATCH
+cd $SCRATCH
+
+mv $BASE/swmodel .
+cp $DIR/namelist.input .
+
+# 2562
+setenv RES 2562
+cp $GRID/$RES/grid.nc .
+cp $GRID/$RES/graph.info.part.$PROCS .
+mpirun -np $PROCS swmodel
+rm -f $DIR/$RES/output.nc $DIR/$RES/log*
+cp output.nc $DIR/$RES/.
+cp log* $DIR/$RES
+rm -f grid.nc graph.info.part.$PROCS log* output.nc
+
+# 10242
+setenv RES 10242
+cp $GRID/$RES/grid.nc .
+cp $GRID/$RES/graph.info.part.$PROCS .
+mpirun -np $PROCS swmodel
+rm -f $DIR/$RES/output.nc $DIR/$RES/log*
+cp output.nc $DIR/$RES/.
+cp log* $DIR/$RES
+rm -f grid.nc graph.info.part.$PROCS log* output.nc
+
+# 40962
+setenv RES 40962
+cp $GRID/$RES/grid.nc .
+cp $GRID/$RES/graph.info.part.$PROCS .
+mpirun -np $PROCS swmodel
+rm -f $DIR/$RES/output.nc $DIR/$RES/log*
+cp output.nc $DIR/$RES/.
+cp log* $DIR/$RES
+rm -f grid.nc graph.info.part.$PROCS log* output.nc
+
+# 163842
+setenv RES 163842
+cp $GRID/$RES/grid.nc .
+cp $GRID/$RES/graph.info.part.$PROCS .
+mpirun -np $PROCS swmodel
+rm -f $DIR/$RES/output.nc $DIR/$RES/log*
+cp output.nc $DIR/$RES/.
+cp log* $DIR/$RES
+rm -f grid.nc graph.info.part.$PROCS log* output.nc
+
+# 655362
+setenv RES 655362
+cp $GRID/$RES/grid.nc .
+cp $GRID/$RES/graph.info.part.$PROCS .
+mpirun -np $PROCS swmodel
+rm -f $DIR/$RES/output.nc $DIR/$RES/log*
+cp output.nc $DIR/$RES/.
+cp log* $DIR/$RES
+rm -f grid.nc graph.info.part.$PROCS log* output.nc
+
+cd $DIR/analysis
+csh scanit
</font>
</pre>