#-Q- platine #!/usr/bin/ksh #-Q- platine ################## #-Q- platine ## PLATINE CEA ## #-Q- platine ################## #-Q- platine #BSUB -J ::Jobname:: # nom de la requete #-Q- platine #BSUB -N # message a la fin du job #-Q- platine #BSUB -o Script_Output_::Jobname::.1 # nom du fichier de sortie #-Q- platine #BSUB -n ::JobNumProcTot:: # reservation des processeurs pour le job #-Q- platine #BSUB -W 1:00 # Limite temps #-Q- platine BATCH_NUM_PROC_TOT=$SLURM_NPROCS #-Q- sx8brodie ####################### #-Q- sx8brodie ## SX8BRODIE IDRIS ## #-Q- sx8brodie ####################### #-Q- sx8brodie #PBS -N ::Jobname:: # nom de la requete #-Q- sx8brodie #PBS -m a # message a la fin du job #-Q- sx8brodie #PBS -j o # regroupement des sorties du job : standard error et output #-Q- sx8brodie #PBS -o Script_Output_::Jobname::.1 # nom du fichier de sortie #-Q- sx8brodie #PBS -S /usr/bin/ksh # shell de soumission #-Q- sx8brodie #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot:: #-Q- sx8brodie #PBS -q ::JobClass:: # classe multi pour BATCH_NUM_PROC_TOT superieur a 2, mono sinon #-Q- sx8brodie #PBS -l cpunum_job=${BATCH_NUM_PROC_TOT} # reservation des processeurs pour le job #-Q- sx8brodie #PBS -l memsz_job=6.0gb # Limite memoire #-Q- sx8brodie #PBS -l cputim_job=1:00:00 # Limite temps #-Q- sx8mercure #!/bin/ksh #-Q- sx8mercure ###################### #-Q- sx8mercure ## SX8MERCURE CEA ## #-Q- sx8mercure ###################### #-Q- sx8mercure #PBS -N ::Jobname:: # nom de la requete #-Q- sx8mercure #PBS -m a # message a la fin du job #-Q- sx8mercure #PBS -j o # regroupement des sorties du job : standard error et output #-Q- sx8mercure #PBS -o Script_Output_::Jobname::.1 # nom du fichier de sortie #-Q- sx8mercure #PBS -S /usr/bin/ksh # shell de soumission #-Q- sx8mercure #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot:: #-Q- sx8mercure #PBS -l cpunum_job=${BATCH_NUM_PROC_TOT} # reservation des processeurs pour le job #-Q- sx8mercure #PBS -l memsz_job=6.0gb # limite memoire #-Q- sx8mercure #PBS -l elapstim_req=00:30:00 # limite en temps elapsed #-Q- default #!/bin/ksh #-Q- default ################## #-Q- default ## DEFAULT HOST ## #-Q- default ################## #-Q- default #For MPI use, uncomment next line : #-Q- default #BATCH_NUM_PROC_TOT=::JobNumProcTot:: # $Date$ # $Author$ # $Revision$ # IPSL (2006) # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC #set -eu #set -vx date echo echo "#######################################" echo "# ANOTHER GREAT SIMULATION #" echo "#######################################" echo #D--------------------------------------------------------------------== #D--------------------------------------------------------------------== #D- #D- Job to launch IGCM models #D- #D--------------------------------------------------------------------== #D--------------------------------------------------------------------== #D- MODIPSL=::modipsl:: libIGCM=${MODIPSL}/libIGCM #D--------------------------------------------------------------------== #D- -1. User modification place #D- - Job Verbosity #D- - PeriodNb #D--------------------------------------------------------------------== #D- Increased verbosity (1, 2, 3) Verbosity=3 #D- Number of execution in one job PeriodNb=1 #D- # -------------------------------------------------------------------- #D- ! Optionnal features /!\ Use with care ! # -------------------------------------------------------------------- #D- Low level debug : to bypass lib test checks and stack construction #D- Default=true DEBUG_debug=false #D- Set DEBUG_sys to false to disable output calls of function #D- Default=true #DEBUG_sys=false #D- Define running directory #D- Default=${TMPDIR} ie temporary batch directory #RUN_DIR_PATH=/workdir4/rech/ces/rces452/BABATEST/TESTPOST #D- Define submit directory #D- Default= where you launch qsub #SUBMIT_DIR=/workdir4/rech/ces/rces452/SCRIPT_V1/modipsl/config/IPSLCM4_v1_OASIS3/EXP01 #D- Turn in dry run mode ? (0,1,2,3) #D- Default=0 #DRYRUN=3 # YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! # ------------------------------------------------------------------------------------- # | DRYRUN= | Date computations, | sys_Get | Exe | sys_Put_Out; sys_Put_Rest | # | | Cp/Exe param files | | Chmod | | # | | Qsub | | | | # ------------------------------------------------------------------------------------- # | 0 | yes | yes | yes | yes | # ------------------------------------------------------------------------------------- # | 1 | yes | yes | yes | no | # ------------------------------------------------------------------------------------- # | 2 | yes | yes | no | no | # ------------------------------------------------------------------------------------- # | 3 | yes | no | no | no | # ------------------------------------------------------------------------------------- #D- Define input file root directory #D- Default=/u/rech/ces/rces452/IGCM #R_IN=/u/rech/por/rpor111/DATA #D- #D--------------------------------------------------------------------== #D- 0. System Environment #D- - Define variables for Number of processors #D- - Define MPI variables #D- - Define batch scheduler variables #D- - Source IGCM Library #D- - Get RESOLution in .resol file (temporary) #D--------------------------------------------------------------------== #D--------------------------------------------------------------------== . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ( ${DEBUG_debug} ) && IGCM_debug_Check . ${libIGCM}/libIGCM_card/libIGCM_card.ksh ( ${DEBUG_debug} ) && IGCM_card_Check . ${libIGCM}/libIGCM_date/libIGCM_date.ksh ( ${DEBUG_debug} ) && IGCM_date_Check #------- . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh . ${libIGCM}/libIGCM_config/libIGCM_config.ksh . ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh . ${libIGCM}/libIGCM_post/libIGCM_post.ksh #D--------------------------------------------------------------------== #-- Resolution FLAG for oasis input RESOL=$(cat ${SUBMIT_DIR}/../.resol) #RESOL="ORCA2xLMD9671" #D- #D--------------------------------------------------------------------== #D- 1. INITIALIZE CONFIGURATION AND THEN COMPONENTS #D--------------------------------------------------------------------== # --------------------------------------------------------------------== #D- Initialize configuration : #D- - Simulation configuration #D- - Simulation parameters #D- - Execution parameter #D- - Define input files directory #D- - Read or initialize CumulPeriod #D- - run.card #D- # --------------------------------------------------------------------== IGCM_config_Initialize # --------------------------------------------------------------------== #D- Define, create and cd RUN_DIR #D- # --------------------------------------------------------------------== RUN_DIR=${RUN_DIR_PATH}/${config_UserChoices_TagName}/${config_UserChoices_JobName} IGCM_sys_MkdirWork ${RUN_DIR} IGCM_sys_Cd ${RUN_DIR} # --------------------------------------------------------------------== #D- Initialize each components taking part #D- into simulation configuration : #D- - Define component executable #D- - Define Write Frequency by component "1M" "1D" ... #D- - Source ${comp}.driver #D- - Define Storage Places by component #D- - ${comp}_Initialize : #D- - Patterns to sed #D- - Variables from namelist #D- # --------------------------------------------------------------------== IGCM_comp_Initialize # --------------------------------------------------------------------== #D- Verify compatibility of period length and write frequencies #D- # --------------------------------------------------------------------== #IGCM_config_Check #D--------------------------------------------------------------------== #D- 2. ENTER THE DEEP EXECUTION LOOP #D- !!!! FASTEN YOUR SEAT BELTS !!!! #D- !!!!! PLEASE. !!!! #D- !! WE WILL CROSS TURBULENCES. !! #D--------------------------------------------------------------------== Period=1 while [ ${Period} -le ${PeriodNb} ]; do echo echo "Starting iteration ${Period} / ${PeriodNb}" #D- # ------------------------------------------------------------------ #D- COMPUTE AND DEFINE DATE STUFF. # ------------------------------------------------------------------ IGCM_config_PeriodStart #D- => ${PeriodDateBegin} #D- => ${PeriodDateEnd} #D- => ${CumulPeriod} #D- => ${DatesPeriod}=${PeriodDateBegin}_${PeriodDateEnd} #D- => ${PeriodLength} => JOURS=31 , 28, 29, 30 ; MOIS=0 ; ANS=0 #D- => update run.card value #D- # ------------------------------------------------------------------ #D- Get parameters text files updated by job (.def, namelist ...) #D- READ AND USE BY GCM AT EACH EXECUTION. # ------------------------------------------------------------------ IGCM_comp_GetInputParametersFiles #D- # ------------------------------------------------------------------ #D- Get initial state (Etat0, carteveg,relief...) #D- NECESSARY ONLY IF CumulPeriod= (=> NUMERO) == 1 #D- AND ???_Restart=NO #D- READ AND USE BY GCM FOR ONLY ONE EXECUTION. # ------------------------------------------------------------------ IGCM_comp_GetInputInitialStateFiles #D- # ------------------------------------------------------------------ #D- Get Boundaries Conditions (SST, WIND[X,Y,Z], LAI ...) #D- READ AND USE BY GCM AT EACH EXECUTION. # ------------------------------------------------------------------ IGCM_comp_GetInputBoundaryFiles #D- # ------------------------------------------------------------------ #D- Get restart files (restartphy.nc, orca_restart.nc ...) #D- READ AND USE BY GCM AT EACH EXECUTION. #D- #D- IF A COMPONENT DO NOT RESTART FROM PREVIOULSY COMPUTED RESTART #D- ONLY IF CumulPeriod= (=> NUMERO) == 1 #D- MUST EXECUTE CREATE ETAT0_LIMIT (TYPICALLY LMDZ AND ./create_etat0_limit.e) #D- #D- IF CumulPeriod == 1 #D- AND A COMPONENT RESTART FROM PREVIOULSY COMPUTED RESTART #D- MUST BRING THIS RESTART IN ${RUN_DIR_PATH} #D- #D- ELSE BRING RESTART FROM ${JobName} IN ${RUN_DIR_PATH} # ------------------------------------------------------------------ IGCM_comp_GetInputRestartFiles #D- # ------------------------------------------------------------------ #D- Test if all was right before Update # ------------------------------------------------------------------ IGCM_debug_Verif_Exit # ------------------------------------------------------------------ #D- Activate running environnement variables # ------------------------------------------------------------------ IGCM_sys_activ_variables #D- # ------------------------------------------------------------------ #D- UPDATE ParametersFiles (.def, namelist ...) with #D- current value of (ORCA_NIT00, ORCA_LRSTAR, RAZ_DATE, ...) # ------------------------------------------------------------------ IGCM_comp_Update #D- # ------------------------------------------------------------------ #D- Test if all was right before execution # ------------------------------------------------------------------ IGCM_debug_Verif_Exit #D- #D----------------------------------------------------------------== #D- 3. Execution #D----------------------------------------------------------------== echo echo "#######################################" echo "# DIR BEFORE RUN EXECUTION #" echo "#######################################" echo ls -lrt echo "========================================================================" if ( [ X${BATCH_NUM_PROC_TOT} != X ] && [ "${BATCH_NUM_PROC_TOT}" -gt 1 ] ) ; then MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND} eval MPIRUN_OPTIONS=${config_UserChoices_JobRunOptions} else MPIRUN_COMMAND=${MPIRUN_COMMAND:="time "} MPIRUN_OPTIONS=${MPIRUN_OPTIONS:=""} fi if [ ${DRYRUN} -le 1 ] ; then REAL_DATE_INIT=$( date ) echo "EXECUTION of : ${MPIRUN_COMMAND} ${MPIRUN_OPTIONS} ./${config_Executable_Name} > ${Exe_Output} 2>&1" typeset RET ${MPIRUN_COMMAND} ${MPIRUN_OPTIONS} ./${config_Executable_Name} > ${Exe_Output} 2>&1 RET=$? if [ ${RET} -gt 0 ] ; then echo "Return code of executable :" ${RET} IGCM_debug_Exit "EXECUTABLE" IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/${PREFIX}_${Exe_Output}_error fi echo ${REAL_DATE_INIT} >> ${Exe_Output} date >> ${Exe_Output} else echo "EXECUTION of : ${MPIRUN_COMMAND} ${MPIRUN_OPTIONS} ./${config_Executable_Name} simulated for DRYRUN = " $DRYRUN echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack fi echo "========================================================================" echo echo "#######################################" echo "# DIR AFTER RUN EXECUTION #" echo "#######################################" echo ls -lrt #D- # ------------------------------------------------------------------ #D- Desactivate running environnement variables # ------------------------------------------------------------------ IGCM_sys_desactiv_variables #D- #D----------------------------------------------------------------== #D- 4. Post execution operations #D----------------------------------------------------------------== #D- # ------------------------------------------------------------------ #D- Save on archive machine netcdf outputs, restarts #D- and text files of models # ------------------------------------------------------------------ IGCM_comp_Finalize #D- # ------------------------------------------------------------------ #D- Test if all was right after Finalize # ------------------------------------------------------------------ IGCM_debug_Verif_Exit #D- # ------------------------------------------------------------------ #D- Launch post-treatment process if necessary # ------------------------------------------------------------------ IGCM_post_Initialize #D- # ------------------------------------------------------------------ #D- Save job output #D- Manage executable size to save only different binary #D- Write in run.card user, system and elapse time #D- Check that everything went well ! No ? then we stop. #D- Determine next computed period # ------------------------------------------------------------------ IGCM_config_PeriodEnd echo "Ending iteration ${Period}" (( Period = Period + 1 )) # End loop if date end is reached if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then break ; fi done #D- #D--------------------------------------------------------------------== #D- 5. Submit next job or send mail if simulation over. #D--------------------------------------------------------------------== IGCM_config_Finalize date