Changeset 2545 for trunk/NEMOGCM/SETTE/fcm_job.sh
- Timestamp:
- 2011-01-10T17:48:53+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/SETTE/fcm_job.sh
r2507 r2545 1 #!/bin/bash2 1 ###################################################### 3 2 # Author : Simona Flavoni for NEMO … … 67 66 #- 68 67 # 68 69 usage=" Usage : ./fcm_job.sh input_CONFIG_NAME.cfg NUMBER_OF_PROCS" 70 usage=" example : ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 8" 71 72 73 minargcount=2 74 if [ ${#} -lt ${minargcount} ] 75 then 76 echo "not enought arguments for fcm_job.sh script" 77 echo "control number of argument of fcm_job.sh in sette.sh" 78 echo "${usage}" 79 exit 1 80 fi 81 unset minargcount 82 if [ -f ${SETTE_DIR}/output.sette ] ; then 83 echo "file output already present. Append comments" 84 echo "`ls ${SETTE_DIR}/output.sette`" 85 else 86 echo "file output not present" 87 touch ${SETTE_DIR}/output.sette 88 echo "`ls ${SETTE_DIR}/output.sette`" 89 fi 90 echo "executing script : fcm_job $@" >> ${SETTE_DIR}/output.sette 91 echo " " >> ${SETTE_DIR}/output.sette 92 69 93 # SET INPUT 70 94 # get the input tarfile if needed 71 95 tar_file=$(sed -ne "1,1p" $1) 72 96 if [ "$(cat $1 | grep -c ".tar" )" -ne 0 ] ; then 97 echo "looking for tar file" >> ${SETTE_DIR}/output.sette 98 echo " " >> ${SETTE_DIR}/output.sette 73 99 cp ${FORCING_DIR}/${tar_file} ${INPUT_DIR}/. 74 100 cd ${INPUT_DIR} ; tar xvf ${INPUT_DIR}/*.tar ; gunzip *gz … … 76 102 77 103 if [ -f ${INPUT_DIR}/namelist_ice_lim2 ] ; then 104 echo "choosing for namelist ice " >> ${SETTE_DIR}/output.sette 105 echo " " >> ${SETTE_DIR}/output.sette 78 106 cp ${INPUT_DIR}/namelist_ice_lim2 ${INPUT_DIR}/namelist_ice 79 107 elif [ -f ${INPUT_DIR}/namelist_ice_lim3 ] ; then … … 84 112 if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "agrif" )" -ne 0 ] ; then 85 113 #- Namelist for ocean and ice (agrif fine grid) 114 echo "choosing for namelist for AGRIF" >> ${SETTE_DIR}/output.sette 115 echo " " >> ${SETTE_DIR}/output.sette 86 116 cp ${INPUT_DIR}/1_namelist_ice_lim2 ${INPUT_DIR}/1_namelist_ice 87 117 fi … … 93 123 NB_PROC=$2 94 124 if [ ${NB_PROC} == 1 ] ; then 125 opa_command='./opa' # !! to test if executable is created 126 type ${opa_command} 127 status_type=${?} 128 if [ ${status_type} -ne 0 ] 129 then 130 echo "opa not found" 131 exit 1 132 fi 133 echo "running opa" >> ${SETTE_DIR}/output.sette 134 echo " " >> ${SETTE_DIR}/output.sette 95 135 ./opa 96 136 else 137 opa_command='mpirun' # !! to test if executable is created 138 type ${opa_command} 139 status_type=${?} 140 if [ ${status_type} -ne 0 ] 141 then 142 echo "mpi opa not found" 143 exit 1 144 fi 97 145 # example for brodie (NEC SX8) machine 146 echo "running opa in MPI" >> ${SETTE_DIR}/output.sette 147 echo " " >> ${SETTE_DIR}/output.sette 98 148 mpirun -np ${NB_PROC} opa 99 149 # example for dedale machine … … 108 158 109 159 #- Save ocean output files 160 echo "saving ocean & ice output, debug & restarts files" >> ${SETTE_DIR}/output.sette 161 echo " " >> ${SETTE_DIR}/output.sette 110 162 [ ! -d ${OUTPUT_DIR} ] && mkdir ${OUTPUT_DIR} 111 163 [ -f *ocean.output ] && mv *ocean.output ${OUTPUT_DIR}/.
Note: See TracChangeset
for help on using the changeset viewer.