rotate_perturb.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. set -evx
  2. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. # This script interpolates and rotates the 10m zonal and meridional wind
  4. # perturbations.
  5. #
  6. # History : Virginie Guemas - Initial version - 2012
  7. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. # Arguments
  9. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. year='2014' # Year for which to interpolate and rotate
  11. dir='perturb1_era-dfs_mon' # Directory from where to take the perturbations
  12. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  13. for ((jmemb=1;jmemb<=4;jmemb++)) ; do
  14. cat > scrip_use_in <<EOF
  15. &remap_inputs
  16. remap_wgt = '/cfu/pub/scripts/interpolation/weights/rmp_ERAint_to_ORCA1t_unmasked_bicubic.nc'
  17. infile = '${dir}/u10_fc${jmemb}_${year}.nc'
  18. invertlat = TRUE
  19. var = 'u10'
  20. fromregular = TRUE
  21. outfile = '${dir}/u10_fc${jmemb}_eraint_${year}_orca1t_unrotated.nc'
  22. /
  23. EOF
  24. cp /cfu/pub/scripts/interpolation/scrip_use scrip_use
  25. ./scrip_use
  26. cat > scrip_use_in <<EOF
  27. &remap_inputs
  28. remap_wgt = '/cfu/pub/scripts/interpolation/weights/rmp_ERAint_to_ORCA1t_unmasked_bicubic.nc'
  29. infile = '${dir}/v10_fc${jmemb}_${year}.nc'
  30. invertlat = TRUE
  31. var = 'v10'
  32. fromregular = TRUE
  33. outfile = '${dir}/v10_fc${jmemb}_eraint_${year}_orca1t_unrotated.nc'
  34. /
  35. EOF
  36. ./scrip_use
  37. cat > namelist_rotateUVorca <<EOF
  38. &nam_rotUV
  39. Ufilein = '${dir}/u10_fc${jmemb}_eraint_${year}_orca1t_unrotated.nc'
  40. Uvarin = 'u10'
  41. Vfilein = '${dir}/v10_fc${jmemb}_eraint_${year}_orca1t_unrotated.nc'
  42. Vvarin = 'v10'
  43. meshmask = '/cfu/autosubmit/con_files/mesh_mask_nemo.N3.2_O1L42.nc'
  44. Ufileout = '${dir}/u10_fc${jmemb}_eraint_${year}_orca1t.nc'
  45. Vfileout = '${dir}/v10_fc${jmemb}_eraint_${year}_orca1t.nc'
  46. /
  47. EOF
  48. cp /cfu/pub/scripts/interpolation/rotateUVorca_orca1 rotateUVorca
  49. ./rotateUVorca
  50. rm -f ${dir}/u10_fc${jmemb}_eraint_${year}_orca1t_unrotated.nc ${dir}/v10_fc${jmemb}_eraint_${year}_orca1t_unrotated.nc
  51. done
  52. rm -f scrip_use scrip_use_in rotateUVorca namelist_rotateUVorca