#!/bin/ksh #============================================================================= # mistral batch job parameters #----------------------------------------------------------------------------- #SBATCH --account=mh0731 #SBATCH --job-name=exp.nh_rcemip_lem_small_300.run #SBATCH --partition=compute #SBATCH --workdir=/work/mh0731/rcemip/icon-2.3.00/run #SBATCH --nodes=32 #8 #10 #60 #6 for small-domain, 96 for big #SBATCH --threads-per-core=2 #SBATCH --output=/work/mh0731/rcemip/icon-2.3.00/run/LOG.exp.nh_rcemip_lem_small_300.run.%j.o #SBATCH --error=/work/mh0731/rcemip/icon-2.3.00/run/LOG.exp.nh_rcemip_lem_small_300.run.%j.o #SBATCH --exclusive #SBATCH --time=08:00:00 ##SBATCH --qos=express #============================================================================= # # ICON run script. Created by ./config/make_target_runscript # target machine is bullx # target use_compiler is intel # with mpi=yes # with openmp=yes # memory_model=large # submit with sbatch -N ${SLURM_JOB_NUM_NODES:-1} # #============================================================================= set -x . ./add_run_routines #----------------------------------------------------------------------------- # target parameters # ---------------------------- site="dkrz.de" target="bullx" compiler="intel" loadmodule="intel/16.0 ncl/6.2.1-gccsys cdo/default svn/1.8.13 fca/2.5.2431 mxm/3.4.3082 bullxmpi_mlx/bullxmpi_mlx-1.2.9.2" with_mpi="yes" with_openmp="yes" job_name="exp.nh_rcemip_lem_small_300.run" submit="sbatch -N ${SLURM_JOB_NUM_NODES:-1}" #----------------------------------------------------------------------------- # openmp environment variables # ---------------------------- export OMP_NUM_THREADS=6 export ICON_THREADS=6 export OMP_SCHEDULE=dynamic,1 export OMP_DYNAMIC="false" export OMP_STACKSIZE=200M #----------------------------------------------------------------------------- # MPI variables # ---------------------------- mpi_root=/opt/mpi/bullxmpi_mlx/1.2.9.2 no_of_nodes=${SLURM_JOB_NUM_NODES:=1} mpi_procs_pernode=$((${SLURM_JOB_CPUS_PER_NODE%%\(*} / 2 / OMP_NUM_THREADS)) ((mpi_total_procs=no_of_nodes * mpi_procs_pernode)) START="srun --cpu-freq=HighM1 --kill-on-bad-exit=1 --nodes=${SLURM_JOB_NUM_NODES:-1} --cpu_bind=verbose,cores --distribution=block:block --ntasks=$((no_of_nodes * mpi_procs_pernode)) --ntasks-per-node=${mpi_procs_pernode} --cpus-per-task=$((2 * OMP_NUM_THREADS)) --propagate=STACK" #----------------------------------------------------------------------------- # load ../setting if exists if [ -a ../setting ] then echo "Load Setting" . ../setting fi #----------------------------------------------------------------------------- bindir="${basedir}/build/x86_64-unknown-linux-gnu/bin" # binaries BUILDDIR=build/x86_64-unknown-linux-gnu #----------------------------------------------------------------------------- #============================================================================= # load profile if [ -a /etc/profile ] ; then . /etc/profile #============================================================================= #============================================================================= # load modules module purge module load "$loadmodule" module list #============================================================================= fi #============================================================================= export LD_LIBRARY_PATH=/sw/rhel6-x64/netcdf/netcdf_c-4.3.2-parallel-bullxmpi-intel14/lib:$LD_LIBRARY_PATH #============================================================================= nproma=16 cdo="cdo" cdo_diff="cdo diffn" icon_data_rootFolder="/pool/data/ICON" icon_data_poolFolder="/pool/data/ICON" icon_data_buildbotFolder="/pool/data/ICON/buildbot_data" icon_data_buildbotFolder_aes="/pool/data/ICON/buildbot_data/aes" icon_data_buildbotFolder_oes="/pool/data/ICON/buildbot_data/oes" #export EXPNAME="nh_rcemip" export KMP_AFFINITY="granularity=core,compact,1,1" export KMP_LIBRARY="turnaround" export KMP_KMP_SETTINGS="1" export OMP_WAIT_POLICY="active" export OMPI_MCA_pml="cm" export OMPI_MCA_mtl="mxm" export OMPI_MCA_coll="^fca" export MXM_RDMA_PORTS="mlx5_0:1" export HCOLL_MAIN_IB="mlx5_0:1" export HCOLL_ML_DISABLE_BARRIER="1" export HCOLL_ML_DISABLE_IBARRIER="1" export HCOLL_ML_DISABLE_BCAST="1" export HCOLL_ENABLE_MCAST_ALL="1" export HCOLL_ENABLE_MCAST="1" export OMPI_MCA_coll_sync_barrier_after_alltoallv="1" export OMPI_MCA_coll_sync_barrier_after_alltoallw="1" export MALLOC_TRIM_THRESHOLD_="-1" export MXM_HANDLE_ERRORS="bt" export UCX_HANDLE_ERRORS="bt" ulimit -s 2097152 # this can not be done in use_mpi_startrun since it depends on the # environment at time of script execution #case " $loadmodule " in # *\ mxm\ *) # START+=" --export=$(env | sed '/()=/d;/=/{;s/=.*//;b;};d' | tr '\n' ',')LD_PRELOAD=${LD_PRELOAD+$LD_PRELOAD:}${MXM_HOME}/lib/libmxm.so" # ;; #esac #============================================================================= # # Run script for RCEMIP ICON-LEM / NWP experiments. See Wing et al. (2018, # Geosci Mod Dev) for details. See also readme_icon-lem-nwp_rcemip. # # James Ruppert # james.ruppert@mpimet.mpg.de # 8 July 2018 # # ... slightly modified by # Nicolas Rochetin # nicolas.rochetin@mpimet.mpg.de # 30 August 2018 # # ... put into final form by # Tobias Becker # tobias.becker@mpimet.mpg.de # October 2018 #============================================================================= # Switch for run type; uncomment one option run_type='analytical' # Analytical sounding is used to initialize, run # on a small domain for 100 days. #run_type='ncdf' # Mean sounding from small-domain run is used to # initialize the base state, run on large # domain (must set input_sounding below). #----------------------------------------------------------------------------- # Naming convention for output directory and files exp_tag="icon_lem_3km" #"rcemip_300k" if [ ${run_type} = 'analytical' ]; then extra_tag="_small" # to differentiate these runs from primary # (large-domain) runs else extra_tag="_large" fi #----------------------------------------------------------------------------- # EXPERIMENT SETTINGS sst_set="300.0" # [K] export EXPNAME="${exp_tag}${extra_tag}_${sst_set}" # NetCDF sounding file for run_type='ncdf'. Sounding should be # generated from small-domain run using # rcemip/scripts/create_rcemip_init_sounding.sh input_sounding="${basedir}/data/${EXPNAME}_sounding_d80-100.nc" min_wind="0.0" # [m/s] minimum wind for surface fluxes ;Allison Wing proposes 1 m/s, but James and Cathy think 0.0 m/s is safer # RCEMIP radiation settings zenithang_set="42.05" # deg sol_cst_set="551.58" # W/m2 izenith_set="5" albedo_set="0.07" # Settings from Bretherton et al. 2005 #zenithang_set="50.5" # deg #sol_cst_set="650.83" # W/m2 #============================================================================= # the namelist filename atmo_namelist=NAMELIST_${EXPNAME} # #----------------------------------------------------------------------------- # model time step modelTimeStep="PT05S" # #----------------------------------------------------------------------------- # model parameters atmo_model_equations=3 # equation system # 1=hydrost. atm. (T dynamics) # 2=hydrost. atm. (theta dynamics) # 3=non-hydrost. atm., # -1=shallow water model # -2=hydrost. ocean nlev=75 # nlev = number of full levels iforcing=3 # 3 for inwp forcing; 0 for no forcing # #----------------------------------------------------------------------------- # Set run duration, grid file, output settings based on run_type if [ ${run_type} = 'analytical' ]; then # global timing start_date="2008-08-01T00:00:00Z" ### nicolas rochetin 30/08/2018 # end_date="2008-08-01T00:30:00Z" # end_date="2008-08-31T00:00:00Z" # 30 days end_date="2008-11-09T00:00:00Z" # 100 days ### # grid='134x2310_3000m' # 400x6000 km grid='100x116_1000m' # 100 km square testcase_name='RCEMIP_analytical' ### nicolas rochetin 30/08/2018 # restart_interval="P100D" # stop the simulation at this interval # checkpoint_interval="P10D" # frequency for writing restart file # file_interval="P100D" # frequency for writing new file # output_interval_3d="PT01H" # writing output to file # output_interval_2d="PT01H" # writing output to file restart_interval="P20D" # stop the simulation at this interval checkpoint_interval="P20D" # frequency for writing restart file file_interval="P20D" # frequency for writing new file output_interval_3d="PT01H" # writing output to file output_interval_2d="PT01H" # writing output to file ### # varlist_3d="'z_mc','exner','temp','tot_qv_dia'" # varlist_3d="'z_mc','z_ifc','exner','temp','ddt_temp_radsw','ddt_temp_radlw','tot_qv_dia','tot_qi_dia','tot_qc_dia'" # varlist_2d="'pres_sfc','lhfl_s','shfl_s','tqv_dia','tqc_dia','tqi_dia','tot_prec'" elif [ ${run_type} = 'ncdf' ]; then # global timing start_date="2008-08-01T00:00:00Z" ### nicolas rochetin 30/08/2018 # end_date="2008-08-01T01:00:00Z" end_date="2008-11-09T00:00:00Z" ### grid='134x2310_3000m' # 400x6000 km # grid='100x116_1000m' # 100 km square testcase_name='RCEMIP_ncdf' restart_interval="P10D" # stop the simulation at this interval checkpoint_interval="P10D" # frequency for writing restart file file_interval="P10D" # frequency for writing new file output_interval_3d="PT01H" #"PT06H" 6h also proposed in some of Allis paper versions... writing output to file output_interval_2d="PT01H" # writing output to file else echo "Pick a correct run_type" stop fi atmo_dyn_grids=Torus_Triangles_${grid}.nc # #----------------------------------------------------------------------------- # # #----------------------------------------------------------------------------- # # write icon namelist parameters # ------------------------ # for a complete list see namelist_overview and namelist_overview.pdf # cat >> ${atmo_namelist} << EOF ¶llel_nml nproma = ${nproma} p_test_run = .false. l_test_openmp = .false. l_log_checks = .false. num_io_procs = 2 num_restart_procs = 1 / &grid_nml dynamics_grid_filename = "${atmo_dyn_grids}", corio_lat = 20.0 ! irrelevant if lcoriolis = .FALSE. / &nh_testcase_nml nh_test_name = ${testcase_name} ! test case identifier ape_sst_case = 'sst_const' w_perturb = 0.1 ! m/s, default=0.05 th_perturb = 0.3 ! K, default=0.2 zenithang = ${zenithang_set} ! degrees sol_const = ${sol_cst_set} albedo_set = ${albedo_set} ! fixed surface albedo; default is 0.07 / &io_nml lkeep_in_sync = .true. lflux_avg = .FALSE. ! default is true. True = time-ave, False = accumulated. / &run_nml num_lev = ${nlev}, ! number of full levels of vertical grid modelTimeStep = ${modelTimeStep} ltransport = .TRUE. ntracer = 0 ! the model updates this for the microphysics vars iforcing = ${iforcing} ! 3: NWP forcing; 6:inhecham forcing ltestcase = .TRUE. ! run testcase ltimer = .true. ! msg_level = 10 ! detailed report during integration output = 'nml' / &nwp_phy_nml inwp_gscp = 4 ! 4:Seifert microphysics inwp_convection = 0 ! 1:Tiedtke/Bechtold inwp_radiation = 1 ! 1:RRTM radiation, 3:PSRAD inwp_cldcover = 5 ! 5: all or nothing inwp_turb = 5 ! 5: Smagorinsky diffusion (Dipankar et al.) inwp_gwd = 0 ! gravity wave drag inwp_sso = 0 ! orographic drag inwp_satad = 1 ! saturation adjustment (on/off) inwp_surface = 0 ! 0: none; 1: TERRA latm_above_top = .true. dt_conv = 300. ! Time step of cu param AND cloud cover call [s] dt_rad = 300. ! ... of radiation call / &les_nml sst = ${sst_set} isrfc_type = 5 ! 2=Fixed flux, 5=fixed SST, 3=fixed bflux expname = '${EXPNAME}' avg_interval_sec = 3600. sampl_freq_sec = 300. ldiag_les_out = .TRUE. km_min = 0.0 min_sfc_wind = ${min_wind} ! minimum wind speed (m/s) assumed for flux calculation / &turbdiff_nml lconst_z0 = .TRUE. ! horizontally homogeneous roughness length const_z0 = 0.0001 ! roughness length / &diffusion_nml lhdiff_temp = .TRUE. lhdiff_vn = .TRUE. lhdiff_w = .TRUE. hdiff_order = 5 / &radiation_nml irad_o3 = 4 ! read in external ozone file izenith = ${izenith_set} ! 5: prescribed zenith angle; 6: equinox diurnal cycle irad_aero = 0 ! switch off aerosols irad_cfc11 = 0 irad_cfc12 = 0 irad_co2 = 2 irad_ch4 = 2 irad_n2o = 2 vmr_co2 = 348.e-06 ! RCEMIP values; modern-day values vmr_ch4 = 1650.e-09 vmr_n2o = 306.e-09 / &nonhydrostatic_nml ivctype = 2 ! sleve vertical coordinate damp_height = 19000. ! top_height-damp_height should be about 15km rayleigh_type = 1 ! 1 = Classical (all vars), 2 = w only ! rayleigh_coeff = 0.25 ! default: 0.05 /s (with rayleigh_type = 2) rayleigh_coeff = 0.003 ! default: 0.05 /s (with rayleigh_type = 2) l_open_ubc = .FALSE. ! Open upper boundary condition? / &sleve_nml top_height = 48000.0 ! these settings yield an actual model top of about 34 km min_lay_thckn = 75. ! thickness of lowest model layer max_lay_thckn = 500. ! max thickness htop_thcknlimit = 40000.0 ! dont exceed max_lay_thckn below this height stretch_fac = 1.2 ! values > 1 increase dz near model top / &extpar_nml itopo = 0 ! 0: analytical topo; 1: topography/ext. data read from file / &dynamics_nml iequations = ${atmo_model_equations} ! equation system idiv_method = 1 divavg_cntrwgt = 0.50 lcoriolis = .FALSE. / &output_nml output_start = "${start_date}" output_end = "${end_date}" output_interval = "${output_interval_3d}" file_interval = "${file_interval}" include_last = .TRUE. output_filename = "${EXPNAME}_3d" filename_format = "_DOM__" ml_varlist = 'u','v','w','pres','temp','ddt_temp_radsw','ddt_temp_radlw','tot_qv_dia','tot_qi_dia','tot_qc_dia','rh','rho','qr','qs','qg','qh' output_grid = .TRUE. / &output_nml output_start = "${start_date}" output_end = "${end_date}" output_interval = "${output_interval_2d}" file_interval = "${file_interval}" include_last = .TRUE. operation = 'mean' output_filename = "${EXPNAME}_3d_bottom_mean" filename_format = "_DOM__" ml_varlist = 'u','v','temp' m_levels = 75! bottom (near surface) level, at 37,50 m output_grid = .TRUE. / &output_nml output_start = "${start_date}" output_end = "${end_date}" output_interval = "${output_interval_2d}" file_interval = "${file_interval}" include_last = .TRUE. operation = 'mean' output_filename = "${EXPNAME}_2d" filename_format = "_DOM__" ml_varlist = 'pres_sfc','tot_prec','lhfl_s','shfl_s','tqv_dia','tqc_dia','tqi_dia','sod_t','sou_t','sob_t','sou_s','sob_s','thu_s','thb_s','thb_t','swflxclr_toa','lwflxclr_toa','swflxclr_sfc','lwflxclr_sfc'!'u_10m','v_10m','t_2m','qhfl_s' output_grid = .TRUE. / &output_nml output_start = "${start_date}" output_end = "${end_date}" output_interval = "${output_interval_2d}" file_interval = "${file_interval}" include_last = .TRUE. operation = 'mean' output_filename = "${EXPNAME}_3d_mean" filename_format = "_DOM__" ml_varlist = 'swflxall','lwflxall' output_grid = .TRUE. / EOF # #---------------------------------------------------------------------------------- # add standard atmo_non-hydrostatic_files DATADIR=${basedir}/data add_link_file ${DATADIR}/rrtmg_lw.nc rrtmg_lw.nc add_link_file ${DATADIR}/ECHAM6_CldOptProps.nc ECHAM6_CldOptProps.nc add_link_file ${DATADIR}/dmin_wetgrowth_lookup.dat dmin_wetgrowth_lookup.dat #for inwp_gscp==4 if [ ${run_type} = 'ncdf' ]; then add_link_file $input_sounding sound_in.nc fi OZONEDIR=${DATADIR}/external add_link_file ${OZONEDIR}/rcemip_analytical_o3_${grid}.nc o3_icon_DOM01.nc #---------------------------------------------------------------------------------- # # End of namelist settings, automatic settings below. # Model output directory is set below. # #---------------------------------------------------------------------------------- #!/bin/ksh #============================================================================= # # This section of the run script prepares and starts the model integration. # # bindir and START must be defined as environment variables or # they must be substituted with appropriate values. # # Marco Giorgetta, MPI-M, 2010-04-21 # #----------------------------------------------------------------------------- # # directories definition # ICONDIR=${ICON_BASE_PATH} RUNSCRIPTDIR=${ICONDIR}/run if [ x$grids_folder = x ] ; then HGRIDDIR=${ICONDIR}/grids else HGRIDDIR=$grids_folder fi # experiment directory, with plenty of space, create if new ### nicolas rochetin 30/08/2018 #EXPDIR=${ICONDIR}/experiments/${EXPNAME} EXPDIR=/scratch/u/u233156/icon-2.3.00/experiments/${EXPNAME} ### if [ ! -d ${EXPDIR} ] ; then mkdir -p ${EXPDIR} fi # ls -ld ${EXPDIR} if [ ! -d ${EXPDIR} ] ; then mkdir ${EXPDIR} #else # rm -rf ${EXPDIR} # mkdir ${EXPDIR} fi ls -ld ${EXPDIR} check_error $? "${EXPDIR} does not exist?" cd ${EXPDIR} #----------------------------------------------------------------------------- # set up the model lists if they do not exist # this works for subngle model runs # for coupled runs the lists should be declared explicilty if [ x$namelist_list = x ]; then # minrank_list=( 0 ) # maxrank_list=( 65535 ) # incrank_list=( 1 ) minrank_list[0]=0 maxrank_list[0]=65535 incrank_list[0]=1 if [ x$atmo_namelist != x ]; then # this is the atmo model namelist_list[0]="$atmo_namelist" modelname_list[0]="atmo" modeltype_list[0]=1 run_atmo="true" elif [ x$ocean_namelist != x ]; then # this is the ocean model namelist_list[0]="$ocean_namelist" modelname_list[0]="ocean" modeltype_list[0]=2 elif [ x$testbed_namelist != x ]; then # this is the testbed model namelist_list[0]="$testbed_namelist" modelname_list[0]="testbed" modeltype_list[0]=99 else check_error 1 "No namelist is defined" fi fi #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # set some default values and derive some run parameteres restart=${restart:=".false."} restartSemaphoreFilename='isRestartRun.sem' #AUTOMATIC_RESTART_SETUP: if [ -f ${restartSemaphoreFilename} ]; then restart=.true. # do not delete switch-file, to enable restart after unintended abort #[[ -f ${restartSemaphoreFilename} ]] && rm ${restartSemaphoreFilename} fi #END AUTOMATIC_RESTART_SETUP # # wait 5min to let GPFS finish the write operations if [ "x$restart" != 'x.false.' -a "x$submit" != 'x' ]; then if [ x$(df -T ${EXPDIR} | cut -d ' ' -f 2) = gpfs ]; then sleep 10; fi fi # fill some checks run_atmo=${run_atmo="false"} if [ x$atmo_namelist != x ]; then run_atmo="true" fi run_jsbach=${run_jsbach="false"} run_ocean=${run_ocean="false"} if [ x$ocean_namelist != x ]; then run_ocean="true" fi #----------------------------------------------------------------------------- # add grids to required files all_grids="${atmo_dyn_grids} ${atmo_rad_grids} ${ocean_grids}" for gridfile in ${all_grids}; do ls -l ${HGRIDDIR}/$gridfile check_error $? "${HGRIDDIR}/$gridfile does not exist." add_required_file ${HGRIDDIR}/$gridfile ./ done #----------------------------------------------------------------------------- # print_required_files copy_required_files link_required_files #----------------------------------------------------------------------------- # get restart files if [ x$restart_atmo_from != "x" ] ; then rm -f restart_atm_DOM01.nc # ln -s ${ICONDIR}/experiments/${restart_from_folder}/${restart_atmo_from} ${EXPDIR}/restart_atm_DOM01.nc cp ${ICONDIR}/experiments/${restart_from_folder}/${restart_atmo_from} cp_restart_atm.nc ln -s cp_restart_atm.nc restart_atm_DOM01.nc restart=".true." fi if [ x$restart_ocean_from != "x" ] ; then rm -f restart_oce.nc # ln -s ${ICONDIR}/experiments/${restart_from_folder}/${restart_ocean_from} ${EXPDIR}/restart_oce.nc cp ${ICONDIR}/experiments/${restart_from_folder}/${restart_ocean_from} cp_restart_oce_DOM01.nc ln -s cp_restart_oce_DOM01.nc restart_oce_DOM01.nc restart=".true." fi #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # # create ICON master namelist # ------------------------ # For a complete list see Namelist_overview and Namelist_overview.pdf #----------------------------------------------------------------------------- # create master_namelist master_namelist=icon_master.namelist if [ x$end_date = x ]; then cat > $master_namelist << EOF &master_nml !!! nicolas rochetin 31/08/2018 ! lrestart = $restart lrestart = .true. !!! experimentStartDate = "$start_date" restartTimeIntval = "$restart_interval" checkpointTimeIntval = "$checkpoint_interval" / &time_nml is_relative_time = .false. / EOF else if [ x$calendar = x ]; then calendar='proleptic gregorian' calendar_type=1 else calendar=$calendar calendar_type=$calendar_type fi cat > $master_namelist << EOF &master_nml lrestart = $restart / &master_time_control_nml calendar = "$calendar" checkpointTimeIntval = "$checkpoint_interval" restartTimeIntval = "$restart_interval" experimentStartDate = "$start_date" experimentStopDate = "$end_date" / &time_nml is_relative_time = .false. / EOF fi #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # add model component to master_namelist add_component_to_master_namelist() { model_namelist_filename="$1" model_name=$2 model_type=$3 model_min_rank=$4 model_max_rank=$5 model_inc_rank=$6 cat >> $master_namelist << EOF &master_model_nml model_name="$model_name" model_namelist_filename="$model_namelist_filename" model_type=$model_type model_min_rank=$model_min_rank model_max_rank=$model_max_rank model_inc_rank=$model_inc_rank / EOF #----------- #get namelist if [ -f ${RUNSCRIPTDIR}/$model_namelist_filename ] ; then mv -f ${RUNSCRIPTDIR}/$model_namelist_filename ${EXPDIR} check_error $? "mv -f ${RUNSCRIPTDIR}/$model_namelist_filename" else check_error 1 "${RUNSCRIPTDIR}/$model_namelist_filename does not exist" fi } #----------------------------------------------------------------------------- no_of_models=${#namelist_list[*]} echo "no_of_models=$no_of_models" j=0 while [ $j -lt ${no_of_models} ] do add_component_to_master_namelist "${namelist_list[$j]}" "${modelname_list[$j]}" ${modeltype_list[$j]} ${minrank_list[$j]} ${maxrank_list[$j]} ${incrank_list[$j]} j=`expr ${j} + 1` done #----------------------------------------------------------------------------- # Add JSBACH part to master_namelist if [[ $run_jsbach == @(yes|true) ]]; then cat >> $master_namelist << EOF &jsb_control_nml is_standalone = .false. restart_jsbach = .false. debug = 0 / &jsb_model_nml model_id = 1 model_name = 'JSBACH' model_shortname = 'jsb' model_description = 'JSBACH land surface model' model_namelist_filename = "${lnd_namelist}" / EOF if [[ -f ${RUNSCRIPTDIR}/NAMELIST_${EXPNAME}_lnd && -f ${EXPDIR}/NAMELIST_${EXPNAME}_lnd ]] ; then # namelist file has already been copied to expdir by copy_required_files above rm ${RUNSCRIPTDIR}/NAMELIST_${EXPNAME}_lnd check_error $? "rm ${RUNSCRIPTDIR}/NAMELIST_${EXPNAME}_lnd" else check_error 1 "${RUNSCRIPTDIR}/NAMELIST_${EXPNAME}_lnd does not exist" fi fi #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # # get model # export MODEL=${bindir}/icon # ls -l ${MODEL} check_error $? "${MODEL} does not exist?" #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # # start experiment # rm -f finish.status # #if [ x$target = "xblizzard" ] ; then # run_model #else date ${START} ${MODEL} date #fi # if [ -r finish.status ] ; then check_error 0 "${START} ${MODEL}" else check_error -1 "${START} ${MODEL}" fi # #----------------------------------------------------------------------------- # finish_status=`cat finish.status` echo $finish_status echo "============================" echo "Script run successfully: $finish_status" echo "============================" #----------------------------------------------------------------------------- if [[ "x$use_hamocc" = "xyes" ]]; then # store HAMOCC log file strg="$(ls -rt ${EXPNAME}_hamocc_EU*.nc* | tail -1 )" prefx="${EXPNAME}_hamocc_EU_tendencies" foo=${strg##${prefx}} foo=${foo%%.*} bgcout_file="bgcout_${foo}" mv bgcout $bgcout_file fi #----------------------------------------------------------------------------- namelist_list="" #----------------------------------------------------------------------------- # check if we have to restart, ie resubmit # Note: this is a different mechanism from checking the restart if [ $finish_status = "RESTART" ] ; then echo "restart next experiment..." this_script="${RUNSCRIPTDIR}/${job_name}" echo 'this_script: ' "$this_script" touch ${restartSemaphoreFilename} cd ${RUNSCRIPTDIR} ${submit} $this_script else [[ -f ${restartSemaphoreFilename} ]] && rm ${restartSemaphoreFilename} fi #----------------------------------------------------------------------------- # automatic call/submission of post processing if available if [ "x${autoPostProcessing}" = "xtrue" ]; then # check if there is a postprocessing is available cd ${RUNSCRIPTDIR} targetPostProcessingScript="./post.${EXPNAME}.run" [[ -x $targetPostProcessingScript ]] && ${submit} ${targetPostProcessingScript} cd - fi #----------------------------------------------------------------------------- # check if we test the restart mechanism get_last_1_restart() { model_restart_param=$1 restart_list=$(ls *restart_*${model_restart_param}*_*T*Z.nc) last_restart="" last_1_restart="" for restart_file in $restart_list do last_1_restart=$last_restart last_restart=$restart_file echo $restart_file $last_restart $last_1_restart done } restart_atmo_from="" restart_ocean_from="" if [ x$test_restart = "xtrue" ] ; then # follows a restart run in the same script # set up the restart parameters restart_from_folder=${EXPNAME} # get the previous from last rstart file for atmo get_last_1_restart "atm" if [ x$last_1_restart != x ] ; then restart_atmo_from=$last_1_restart fi get_last_1_restart "oce" if [ x$last_1_restart != x ] ; then restart_ocean_from=$last_1_restart fi EXPNAME=${EXPNAME}_restart test_restart="false" fi #----------------------------------------------------------------------------- cd $RUNSCRIPTDIR #----------------------------------------------------------------------------- # exit 0 # # vim:ft=sh #-----------------------------------------------------------------------------