PageRenderTime 33ms CodeModel.GetById 7ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://cfmip-obs-sim.googlecode.com/
Korn Shell | 95 lines | 46 code | 12 blank | 37 comment | 8 complexity | fb07999b600620848f2012289fe125d4 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. clear
  37. make test_isccp_cloud_types || exit 1
  38. # Test RNG gives correct results
  39. ./test_congvec.ksh || exit 1
  40. echo Running ISCCP simulator tests - may take a few minutes....
  41. rm -f stdout
  42. ./rcsid isccp_cloud_types.f > stdout
  43. for top_height_direction in 1 2
  44. do
  45. for top in 1 2 3
  46. do
  47. for overlap in 1 2 3
  48. do
  49. echo $top > stdin
  50. echo $overlap >> stdin
  51. echo $top_height_direction >> stdin
  52. (
  53. echo top=$top
  54. echo overlap=$overlap
  55. echo top_height_direction=$top_height_direction
  56. rm -f ftn09.*
  57. if [ $(hostname) = "tx01" ]
  58. then
  59. dir=$(pwd)
  60. rsh sx601 "cd $dir ; ./test_isccp_cloud_types < stdin"
  61. else
  62. ./test_isccp_cloud_types < stdin
  63. fi
  64. ) | sed 's/ \./ 0./g;s/ *$//' >> stdout
  65. for file in ftn09.*
  66. do
  67. export LC_ALL=C
  68. #sort < $file | uniq -c >> stdout
  69. sort < $file |sort >> stdout
  70. done
  71. done
  72. done
  73. done
  74. if diff stdout stdout.expected > stdout.diff
  75. then
  76. echo tests passed ok.
  77. exit 0
  78. else
  79. echo there may be a problem with the test - files stdout and stdout.expected do not match.
  80. echo tkdiff stdout stdout.expected
  81. less stdout.diff
  82. exit 1
  83. fi