[2136] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | #On decide d'archiver via tar une simulation entiere : |
---|
| 4 | # - si elle est trop petite |
---|
| 5 | # - si elle ne contient aucun fichier d'output correspondant a la norme etablie JobName_date |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | config_card=${1} |
---|
| 9 | |
---|
| 10 | # Declaration des variables |
---|
| 11 | |
---|
| 12 | # ---- |
---|
| 13 | export JOB_DIR=${JOB_DIR:-${TMP_MIGR_DATA}} |
---|
| 14 | export IGCM_DEM=${IGCM_DEM:-${SCRATCHDIR}/IGCM_DEM} |
---|
| 15 | export IGCM_TMP=${IGCM_TMP:-${IGCM_DEM}/tmp} |
---|
| 16 | mkdir -p ${IGCM_DEM} |
---|
| 17 | mkdir -p ${IGCM_TMP} |
---|
| 18 | clean_tmp=${clean_tmp:-yes} |
---|
| 19 | EXE_DIR=$(dirname ${0} ) |
---|
| 20 | SCRIPT_NAME=$(basename ${0} ) |
---|
| 21 | source ${EXE_DIR}/DEM_utilities.sh |
---|
| 22 | DEM_log -0 "Demmarrage de ${SCRIPT_NAME}" |
---|
| 23 | cd ${JOB_DIR} |
---|
| 24 | # ---- |
---|
| 25 | DEM_log -0 "Debut de ${SCRIPT_NAME}" |
---|
| 26 | DEM_log -0 "On va archiver via tar la simulation " ${PATH_SIMUL_FULL} |
---|
| 27 | DEM_log -0 "config_card : ${config_card}" |
---|
| 28 | |
---|
| 29 | eval $(grep JobName ${config_card}) |
---|
| 30 | eval $(grep PATH_SIMUL_FULL ${config_card}) |
---|
| 31 | eval $(grep DateBegin ${config_card}) |
---|
| 32 | eval $(grep DateEnd ${config_card}) |
---|
| 33 | eval $(grep IGCM_DEM_SIMU ${config_card}) |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | echo ${PATH_SIMUL_FULL} > ${IGCM_DEM_SIMU}/tar_full_simul.list |
---|
| 37 | |
---|
| 38 | # Dans ce cas la on efface les eventuelles listes deja creees |
---|
| 39 | rm -f ${IGCM_DEM_SIMU}/tar_no_output_files.txt |
---|
| 40 | rm -f ${IGCM_DEM_SIMU}/tar_no_restart_files.txt |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | # gpdebug : traitement des simu < 1 Go ou de type create_etat0 : il faut virer ces rep |
---|
| 44 | # (et pas slt leur contenu) pour pouvoir integrer le traitement specifique |
---|
| 45 | # de ces simu dans "enlarge_my_files.sh" (sequentiel) et "process_list.sh" (parallele) |
---|
| 46 | # rm -f ${IGCM_DEM_SIMU}/work_cp/* |
---|
| 47 | # rm -f ${IGCM_DEM_SIMU}/store_cp/* |
---|
| 48 | # rm -f ${IGCM_DEM_SIMU}/other_tar/* |
---|
| 49 | |
---|
| 50 | rm -rf ${IGCM_DEM_SIMU}/work_cp |
---|
| 51 | rm -rf ${IGCM_DEM_SIMU}/store_cp |
---|
| 52 | rm -rf ${IGCM_DEM_SIMU}/other_tar |
---|
| 53 | |
---|
| 54 | DEM_write_state ${IGCM_DEM}/config_card.liste ${config_card} WriteListTarDone |
---|
| 55 | |
---|
| 56 | DEM_log -0 "Fin de ${SCRIPT_NAME}" |
---|