sync_puma_restart_test 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/csh
  2. # Perform restart test by comparing the restart file of a two-year
  3. # contiguos run with a yearly restarted run
  4. # this version test the two instances synchronized version
  5. unset noclobber
  6. rm -f puma_restart*
  7. rm -f Abort_Message
  8. # 1. modify namelists to create a two years run
  9. sed -i -e 's/KICK.*/KICK=0/' puma_namelist_00
  10. sed -i -e 's/NGUI.*/NGUI=0/' puma_namelist_00
  11. sed -i -e 's/NYEARS.*/NYEARS=2/' puma_namelist_00
  12. sed -i -e 's/KICK.*/KICK=0/' puma_namelist_01
  13. sed -i -e 's/NGUI.*/NGUI=0/' puma_namelist_01
  14. sed -i -e 's/NYEARS.*/NYEARS=2/' puma_namelist_01
  15. # 2. start first run
  16. echo "Executing two years contiguous run"
  17. time openmpirun -np 2 most_puma.x
  18. mv puma_diag_00 00_ONE_DIAG.001
  19. mv puma_diag_01 01_ONE_DIAG.001
  20. mv puma_status_00 00_ONE_REST
  21. mv puma_status_01 01_ONE_REST
  22. # 3. modify namelist to create a year run
  23. sed -i -e 's/NYEARS.*/NYEARS=1/' puma_namelist_00
  24. sed -i -e 's/NYEARS.*/NYEARS=1/' puma_namelist_01
  25. echo "Executing 1st. year"
  26. time openmpirun -np 2 most_puma.x
  27. mv puma_status_00 puma_restart_00
  28. mv puma_status_01 puma_restart_01
  29. echo "Executing 2nd. year from restart"
  30. time openmpirun -np 2 most_puma.x
  31. mv puma_status_00 00_TWO_REST
  32. mv puma_status_01 01_TWO_REST
  33. # 4. compare restart files - should be identical
  34. diff 00_ONE_REST 00_TWO_REST
  35. if ($? == 0) echo "Restart test instance 0 passed OK"
  36. diff 01_ONE_REST 01_TWO_REST
  37. if ($? == 0) echo "Restart test instance 1 passed OK"