plasim_restart_test 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/tcsh
  2. # Perform restart test by comparing the restart file of a two-month
  3. # continuos run with a monthly restarted run (argument = executable)
  4. if ("$1" == "") then
  5. echo
  6. echo "Usage for single core executables:"
  7. echo "plasim_restart_test <executable> e.g.:"
  8. echo "plasim_restart_test most_plasim_t21_l10.x"
  9. echo
  10. echo "Usage for MPI executables:"
  11. echo "plasim_restart_test <MPI exec string> e.g.:"
  12. echo 'plasim_restart_test "mpiexec -np 2 most_plasim_t21_l10_p2.x"'
  13. exit
  14. endif
  15. unset noclobber
  16. rm -f plasim_restart
  17. rm -f Abort_Message
  18. # 1. modify namelist to create a two month run
  19. sed -i -e 's/KICK.*/KICK=0/' plasim_namelist
  20. sed -i -e 's/NGUI.*/NGUI=0/' plasim_namelist
  21. sed -i -e 's/N_RUN_YEARS.*/N_RUN_YEARS=0/' plasim_namelist
  22. sed -i -e 's/N_RUN_MONTHS.*/N_RUN_MONTHS=2/' plasim_namelist
  23. sed -i -e 's&/END&SEED=1&' plasim_namelist
  24. echo " /END" >> plasim_namelist
  25. # 2. start first run
  26. echo "Executing two month continuous run"
  27. time $1
  28. mv plasim_status ONE_REST
  29. mv plasim_diag ONE_DIAG
  30. # 3. modify namelist to create a month run
  31. sed -i -e 's/N_RUN_MONTHS.*/N_RUN_MONTHS=1/' plasim_namelist
  32. echo "Executing 1st. month"
  33. time $1
  34. mv plasim_status plasim_restart
  35. mv plasim_diag TWO_DIAG.001
  36. echo "Executing 2nd. month from restart"
  37. time $1
  38. mv plasim_status TWO_REST
  39. mv plasim_diag TWO_DIAG.002
  40. # 4. compare restart files - should be identical
  41. diff ONE_REST TWO_REST
  42. if ($? == 0) echo "Restart test passed OK"