# Platform dependent configuration functions for the 'cenaero' machine # (hpc.cenaero.be) function configure() { # This function should configure all settings/modules needed to # later prepare the NEMO run directory and set variables used # in the run script # Configure paths for building/running NEMO nemo_src_dir=${HOME}/modeles/NEMO/3.6 run_dir=$GLOBALSCRATCH/nemo/run/${exp_name} ini_data_dir=$GLOBALSCRATCH/DATA/nemo # File for standard output. # NOTE: This will be modified for restart jobs! #stdout_file=${start_dir}/out/${PBS_JOBNAME}.out # Resubmit this job for automatic restarts? [true/false] # Also, add options for the resubmit command here. resubmit_job=true # Configure and load modules pre_load_modules_cmd="module purge" module_list="module load intel/compilerpro/13.0.1.117 openmpi/1.6.4/intel-13.0.1.117 hdf5/1.8.15p1_intel13_ompi1.6.4 netcdf/intel/4.3.3.1_ompi1.6.4 cdo/intel/1.5.4" module load ${module_list} } function configure_opa() { # Configure paths for NEMO IC [ -f ${ini_data_dir}/INIT/${nem_grid}/coordinates.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/coordinates.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/bathy_meter.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/bathy_meter.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/runoff_core_monthly.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/runoff_core_monthly.nc runoffs_depth.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/ahmcoef.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/ahmcoef.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/mask_itf.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/mask_itf.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/K1rowdrg.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/K1rowdrg.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/M2rowdrg.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/M2rowdrg.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/data_1m_potential_temperature_nomask.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/data_1m_potential_temperature_nomask.nc temperature.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/data_1m_salinity_nomask.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/data_1m_salinity_nomask.nc salinity.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/subbasins.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/subbasins.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/resto.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/resto.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/chlorophyll.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/chlorophyll.nc [ -f ${ini_data_dir}/INIT/${nem_grid}/geothermal_heating.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/geothermal_heating.nc # Configure paths for NEMO Forcings ln -sf ${ini_data_dir}/BC/${nem_grid}/${nem_forcing_set}/*.nc . [ -f ${ini_data_dir}/BC/${nem_grid}/weights_core_orca2_bicubic_noc.nc ] && ln -s ${ini_data_dir}/BC/${nem_grid}/weights_core_orca2_bicubic_noc.nc [ -f ${ini_data_dir}/BC/${nem_grid}/weights_core_orca2_bilinear_noc.nc ] && ln -s ${ini_data_dir}/BC/${nem_grid}/weights_core_orca2_bilinear_noc.nc } function configure_xios() { # Configure paths for XIOS files ln -sf ${ctrl_file_dir}/*.xml . } function launch() { # Compute and check the node distribution info "=======================" info "Node/proc distribution:" info "-----------------------" info "XIOS: ${xio_numproc}" info "NEMO: ${nem_numproc}" info "=======================" cmd="mpirun" while (( "$#" )) do nranks=$1 executable=./$(basename $2) shift shift cmd+=" -np $nranks $executable" while (( "$#" )) && [ "$1" != "--" ] do cmd+=" $1" shift done shift || true (( "$#" )) && cmd+=" :" done export OMP_NUM_THREADS=1 $cmd } function finalise() { # This function should execute of any post run functionality, e.g. # platform dependent cleaning or a resubmit if ${resubmit_job} && [ $(date -d "${leg_end_date}" +%s) -lt $(date -d "${run_end_date}" +%s) ] then info "Resubmitting job ${start_dir}/${script_name} for leg $((leg_number+1))" # Need to go to start_dir to find the run script cd ${start_dir} # Submit command sbatch ./${script_name} fi }