Generate a run script (mkexp)

If you want to use a model checked out and built by someone else, all you need is read permission for that checkout.

recipe_mkexp_external.sh
  1. # Identify the model checkout you want to use
  2. MODEL_CHECKOUT='/path/to/other/checkout'
  3. # set MODEL_CHECKOUT=/path/to/other/checkout # for (t)csh
  4.  
  5. # Load modules for checkout
  6. module use $MODEL_CHECKOUT/etc/Modules
  7. module add icon-levante
  8.  
  9. # ** ONLY ** for old builds, eg. nextGEMS cycle 2: Load modules needed for run-time
  10. # module use /sw/intel/oneapi/compiler/2021.3.0/modulefiles /sw/intel/oneapi/tbb/2021.3.0/modulefiles /sw/intel/oneapi/mkl/2021.3.0/modulefiles
  11. # module add compiler mkl compiler-rt
  12.  
  13. # Create subdirectory for your setup and a subdirectory 'run'
  14. MODEL_SUBDIR='my_subdir'
  15. mkdir -p $MODEL_SUBDIR/run
  16. cd $MODEL_SUBDIR/run
  17.  
  18. # Set up your own experiment
  19. EXP_ID='xyz0123'
  20. ACCOUNT='ab4567'
  21. SCRIPT_ROOT='$HOME' # or '$WORK_ROOT' or '$DATA_ROOT' (use single quotes here!)
  22. # ** EITHER ** create a new experiment config file
  23. EXP_TYPE='amip-R2B4'
  24. setconfig $EXP_ID.config EXP_TYPE=$EXP_TYPE ACCOUNT=$ACCOUNT MODEL_SUBDIR=$MODEL_SUBDIR SCRIPT_ROOT=$SCRIPT_ROOT > $EXP_ID.config
  25. # ** OR ** adapt an existing experiment config file
  26. OTHER_CONFIG='/path/to/other.config'
  27. setconfig $OTHER_CONFIG ACCOUNT=$ACCOUNT MODEL_SUBDIR=$MODEL_SUBDIR SCRIPT_ROOT=$SCRIPT_ROOT > $EXP_ID.config
  28. # Possibly edit the result further
  29. your_editor $EXP_ID.config
  30.  
  31. # Create your own run scripts
  32. mkexp $EXP_ID.config