script_clim_restart.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. # This computes a climatology of restarts.
  4. #
  5. # History : Virginie Guemas - Initial version - April 2014
  6. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. # Arguments
  8. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9. # Name of the experiment from which to compute the climatology
  10. expin='i00v'
  11. # Name tag given to the output climatology
  12. expout='chis'
  13. # Start month : MMDD
  14. MM=1031
  15. # First year used to compute climatology
  16. year0=1981
  17. # Last year used to compute climatology
  18. yearf=2010
  19. # ocean or ice ?
  20. typ='ice'
  21. # configuration : ORCA1_LIM2, ORCA1_LIM3, ORCA025_LIM2, ORCA025_LIM3 for ice
  22. # ORCA1, ORCA1L46, ORCA025L46, ORCA025L75 for ocean
  23. config='ORCA1_LIM2'
  24. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. case $typ in
  26. 'ocean') suf='.nc' ;;
  27. 'ice') suf='_ice.nc' ;;
  28. esac
  29. for ((jmemb=0;jmemb<=4;jmemb++)) ; do
  30. for ((year=$year0;year<=$yearf;year++)) ; do
  31. cp /cfu/releases/ic/$typ/${config}/${expin}/${expin}_fc${jmemb}_${year}${MM}_restart${suf}.gz .
  32. gunzip ${expin}_fc${jmemb}_${year}${MM}_restart${suf}.gz
  33. done
  34. ncea ${expin}_fc${jmemb}_*${MM}_restart${suf} ${expout}_fc${jmemb}_${MM}_restart${suf}
  35. gzip ${expout}_fc${jmemb}_${MM}_restart${suf}
  36. mv ${expout}_fc${jmemb}_${MM}_restart${suf}.gz /cfu/releases/ic/$typ/${config}/${expout}/
  37. rm -f ${expin}_fc${jmemb}_*${MM}_restart${suf}
  38. done