mod_testinfo.F90 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. module mod_testinfo
  2. type testinfo
  3. real :: min, max
  4. character(len=8) :: fldname
  5. integer :: toosmall, toolarge
  6. end type testinfo
  7. contains
  8. subroutine tests_init(tests, numtest)
  9. implicit none
  10. integer, intent(in) :: numtest
  11. type(testinfo) , dimension(numtest), intent(out) :: tests
  12. integer :: k
  13. tests(:)%toosmall=0
  14. tests(:)%toolarge=0
  15. tests(:)%fldname=''
  16. do k=1,numtest
  17. select case (k)
  18. case (1)
  19. tests(k)%fldname='temp'
  20. tests(k)%max =40.
  21. tests(k)%min =-4.8
  22. case (2)
  23. tests(k)%fldname='saln'
  24. tests(k)%max =40.
  25. tests(k)%min =0.
  26. case (3)
  27. tests(k)%fldname='dp'
  28. tests(k)%max =10000*9806.0
  29. tests(k)%min =0.0
  30. case (4)
  31. tests(k)%fldname='u'
  32. tests(k)%max =4
  33. tests(k)%min =-4
  34. case (5)
  35. tests(k)%fldname='v'
  36. tests(k)%max =4
  37. tests(k)%min =-4
  38. case (6)
  39. tests(k)%fldname='ubavg'
  40. tests(k)%max =2
  41. tests(k)%min =-2
  42. case (7)
  43. tests(k)%fldname='vbavg'
  44. tests(k)%max =2
  45. tests(k)%min =-2
  46. case (8)
  47. #if defined (SINGLE_RESTART)
  48. tests(k)%fldname='ficem'
  49. #else
  50. tests(k)%fldname='icec'
  51. #endif
  52. tests(k)%min =0.0
  53. tests(k)%max =1.0
  54. case (9)
  55. #if defined (SINGLE_RESTART)
  56. tests(k)%fldname='hicem'
  57. #else
  58. tests(k)%fldname='hice'
  59. #endif
  60. tests(k)%min =0.0
  61. tests(k)%max =20.0
  62. case default
  63. print *,'Not set up test for k=',k
  64. end select
  65. end do
  66. end subroutine tests_init
  67. subroutine matchtest(cfld,tests,numtest,testindex)
  68. implicit none
  69. integer, intent(in) :: numtest
  70. character(len=*), intent(in) :: cfld
  71. type(testinfo), dimension(numtest), intent(in) :: tests
  72. integer, intent(out) :: testindex
  73. integer :: i
  74. testindex=-1
  75. do i=1,numtest
  76. if (trim(cfld)==trim(tests(i)%fldname)) testindex=i
  77. end do
  78. end subroutine matchtest
  79. end module mod_testinfo