Changeset 1806 for modipsl


Ignore:
Timestamp:
07/12/12 20:10:19 (12 years ago)
Author:
jgipsl
Message:

Added capability to have severel configurations with .resol files in same modipsl. This was not possible for the case when JobName? contains RESOL_ATM_3D variable (CREATE job).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modipsl/branches/newconfig/util/ins_job

    r1781 r1806  
    122122     print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}"; 
    123123 fi 
     124 
     125 # Find out if new structure and set .resol filename 
     126 if [ -d ${j}/EXPERIMENTS ] && [ -d ${j}/GENERAL ] ; then 
     127     # New Structure 
     128     echo "This is new configuration structure" 
     129     new_struct=yes 
     130     resolfile=$j/.resol 
     131 else 
     132     # Old Structure 
     133     new_struct=no 
     134     resolfile=$j/../.resol 
     135 fi 
    124136  
    125137 # Get all variables declared in section UserChoices in config.card 
     
    138150# Find the JobName : JobName might contain the variable RESOL_ATM_3D that will be replaced by what is in .resol file 
    139151 if [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL_ATM_3D} ) = X ] ; then 
    140     TRUERESOL=$( find ../ -name ".resol" -exec tail -1 {} \; | awk "-F=" '{print $2}' ) 
     152    TRUERESOL=$( tail -1 $resolfile | awk "-F=" '{print $2}' ) 
     153    echo TRUERESOL = $TRUERESOL 
    141154    JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL_ATM_3D}/${TRUERESOL}/" ) 
    142155    IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName} 
    143156 elif [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL} ) = X ] ; then 
    144      TRUERESOL=$( find ../ -name ".resol" -exec head -1 {} \; ) 
     157     TRUERESOL=$( head -1 $resolfile ) 
    145158     JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL}/${TRUERESOL}/" ) 
    146159     IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName} 
     
    151164 
    152165# Add specific treatment for new type of directory structure  
    153   if [ -d ${j}/EXPERIMENTS ] && [ -d ${j}/GENERAL ] ; then 
    154       echo "This is new configuration structure" 
     166  if [ ${new_struct} == yes ] ; then 
    155167 
    156168      if [ "X${config_UserChoices_ExpType}" = X ] ; then 
Note: See TracChangeset for help on using the changeset viewer.