PageRenderTime 45ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/icarus-scops-4.1-bsd/test_congvec.ksh

http://cfmip-obs-sim.googlecode.com/
Korn Shell | 70 lines | 22 code | 9 blank | 39 comment | 3 complexity | 4b78a3c5d3fef340ed95fc90058ef7b0 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. #!/bin/ksh
  2. # *****************************COPYRIGHT****************************
  3. # (c) British Crown Copyright 2009, the Met Office.
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the
  8. # following conditions are met:
  9. #
  10. # * Redistributions of source code must retain the above
  11. # copyright notice, this list of conditions and the following
  12. # disclaimer.
  13. # * Redistributions in binary form must reproduce the above
  14. # copyright notice, this list of conditions and the following
  15. # disclaimer in the documentation and/or other materials
  16. # provided with the distribution.
  17. # * Neither the name of the Met Office nor the names of its
  18. # contributors may be used to endorse or promote products
  19. # derived from this software without specific prior written
  20. # permission.
  21. #
  22. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  25. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  26. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  27. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  28. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  29. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  30. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  32. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. #
  34. # *****************************COPYRIGHT*******************************
  35. # *****************************COPYRIGHT*******************************
  36. # $Id: test_congvec.ksh,v 4.0 2009/02/13 08:21:07 hadmw Exp $
  37. rm -f test_congvec congvec.out congvec.compare
  38. make test_congvec || exit 1
  39. #grep '^F77=' Makefile > congvec.out
  40. # NEC sx6 rsh from front end
  41. if [ $(hostname) = "tx01" ]
  42. then
  43. dir=$(pwd)
  44. rsh sx601 "cd $dir ; ./test_congvec " >> congvec.out
  45. else
  46. ./test_congvec >> congvec.out
  47. fi
  48. #tkdiff congvec.out congvec.expected
  49. cat congvec.out | cut -c1-6 | sort | uniq -c | sort -k2 -n > congvec.compare
  50. if diff -w congvec.compare congvec.expected
  51. then
  52. echo congvec random number generator tests passed ok.
  53. exit 0
  54. else
  55. echo there may be a problem with the test - files congvec.compare and congvec.expected do not match.
  56. set -x
  57. grep ^F77= Makefile
  58. head -20 congvec.out
  59. tkdiff congvec.compare congvec.expected
  60. exit 1
  61. fi