New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 4044 for branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/SETTE/prepare_job.sh – NEMO

Ignore:
Timestamp:
2013-09-25T16:33:22+02:00 (11 years ago)
Author:
clevy
Message:

Configuration setting/add SETTE compatibility, see ticket:#1074

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/SETTE/prepare_job.sh

    r3680 r4044  
    9696# export EXE_DIR. This directory is used to execute model  
    9797# 
    98 export EXE_DIR 
    9998# 
    10099# 
     
    112111 
    113112################################################################ 
    114 # SET INPUT 
     113# SET INPUT  
    115114# get the input tarfile if needed 
    116 tar_file=$(sed -ne "1,1p" ${SETTE_DIR}/$INPUTARFILE) 
    117 if [ "$(cat ${SETTE_DIR}/$INPUTARFILE | grep -c ".tar" )" -ne 0 ] ; then 
    118    echo "looking for tar file" >> ${SETTE_DIR}/output.sette 
    119    echo "            " >> ${SETTE_DIR}/output.sette 
    120    cp ${FORCING_DIR}/${tar_file} ${INPUT_DIR}/. 
    121    echo "file in ${INPUT_DIR}" 
    122    if [ ! -f ${INPUT_DIR}/${tar_file} ] ; then  
    123       echo "PROBLEM during copy of tar file" >> ${SETTE_DIR}/output.sette 
    124       echo "tar file IS NOT present in ${INPUT_DIR} directory " >> ${SETTE_DIR}/output.sette 
    125       echo "            " >> ${SETTE_DIR}/output.sette 
    126       echo "PROBLEM during copy of tar file"  
    127       exit 1 
    128    else   
    129       cd ${EXE_DIR} ; tar xvof ${INPUT_DIR}/*.tar ; gunzip -f *gz 
    130    fi 
    131 fi  
    132  
    133 if [ ! -f ${EXE_DIR}/namelist_ice ] ; then  
    134 if [ -f ${EXE_DIR}/namelist_ice_lim2 ] ; then  
    135    echo "choosing for namelist ice " >> ${SETTE_DIR}/output.sette 
    136    echo "            " >> ${SETTE_DIR}/output.sette 
    137    cp ${EXE_DIR}/namelist_ice_lim2 ${EXE_DIR}/namelist_ice 
    138 elif  [ -f ${EXE_DIR}/namelist_ice_lim3 ] ; then  
    139    cp ${EXE_DIR}/namelist_ice_lim3 ${EXE_DIR}/namelist_ice 
    140 fi 
    141 fi 
    142  
    143  
    144 if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "agrif" )" -ne 0 ] ; then 
    145    #- Namelist for ocean and ice (agrif fine grid) 
    146       echo "choosing for namelist for AGRIF" >> ${SETTE_DIR}/output.sette 
    147       echo "            " >> ${SETTE_DIR}/output.sette 
    148    cp ${EXE_DIR}/1_namelist_ice_lim2 ${EXE_DIR}/1_namelist_ice  
     115if [ "$(cat ${SETTE_DIR}/$INPUTARFILE | wc -w)" -ne 0 ] ; then 
     116   echo "looking for input files in ${SETTE_DIR}/$INPUTARFILE " >> ${SETTE_DIR}/output.sette 
     117# number of tarfiles: NBTAR 
     118   NBTAR=`cat ${SETTE_DIR}/$INPUTARFILE |wc -l`  
     119   echo "NB of tarfiles ${NBTAR} " >> ${SETTE_DIR}/output.sette 
     120# loop on tarfiles 
     121   for nbtar_file in ${NBTAR} ; do 
     122# read file name and directory in FORCING dir 
     123      read tar_file dir_conf_forc < ${SETTE_DIR}/$INPUTARFILE 
     124      echo looking for tarfile ${tar_file} and directory ${FORCING_DIR}/${dir_conf_forc} ; echo looking for tarfile ${tar_file} and directory ${FORCING_DIR}/${dir_conf_forc} >> ${SETTE_DIR}/output.sette 
     125      if [ -f ${FORCING_DIR}/${tar_file} ] && [ -d ${FORCING_DIR}/${dir_conf_forc} ] ; then 
     126# Tarfile and input dir ar there, only check the links 
     127         echo "Tarfile and input dir ar there, only check the links" >> ${SETTE_DIR}/output.sette 
     128# extract tarfile 
     129      else  
     130 
     131if [ ! -f ${FORCING_DIR}/${tar_file} ] ; then   
     132     echo "tarfile  ${FORCING_DIR}/${tar_file} cannot be found we stop " ; exit 2 ; fi  
     133 
     134echo "mkdir ${FORCING_DIR}/${dir_conf_forc}" >> ${SETTE_DIR}/output.sette 
     135         mkdir ${FORCING_DIR}/${dir_conf_forc}   
     136         cd    ${FORCING_DIR}/${dir_conf_forc} 
     137echo " extract from tarfile ${FORCING_DIR}/${tar_file} in  ${FORCING_DIR}/${dir_conf_forc}" >> ${SETTE_DIR}/output.sette 
     138         tar xvof ${FORCING_DIR}/${tar_file} ; gunzip -f `find . -name "*.gz"`  
     139      fi 
     140# Tarfile and input dir ar there, only check the links 
     141      cd ${FORCING_DIR}/${dir_conf_forc} 
     142      for fida in * 
     143         do 
     144           [ -f ${EXE_DIR}/${fida} ] || ln -s ${FORCING_DIR}/${dir_conf_forc}/${fida} ${EXE_DIR}/${fida} 
     145         done 
     146    done 
     147 
     148else 
     149  echo "no input file to be searched " 
    149150fi 
    150151################################################################ 
Note: See TracChangeset for help on using the changeset viewer.