Changeset 1619


Ignore:
Timestamp:
12/15/11 11:34:32 (12 years ago)
Author:
jgipsl
Message:
  • Moved IGCM_card_DefineArrayFromSection higher up in the script to that IGCM_card_DefineVariableFromOption can be removed from several places.
  • Corrected test if UserSpec? variable exist in config.card.



File:
1 edited

Legend:

Unmodified
Added
Removed
  • modipsl/trunk/util/ins_job

    r1618 r1619  
    110110 print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}"; 
    111111 
     112 if [ ! X$( echo ${j} | grep USER_SPEC ) = X ] ; then 
     113 # Do not treat config.card if it is in sub-directory of USER_SPEC 
     114 # Continue to next config.card 
     115     echo "USER_SPEC directory exist in path, do not use this config.card" 
     116     continue 
     117 fi 
     118  
     119 # Get all variables declared in section UserChoices in config.card 
     120 IGCM_card_DefineArrayFromSection ${j}'/'${F_CFG} UserChoices 
     121 # Set default values 
     122 config_UserChoices_JobClass=mono 
     123 config_UserChoices_JobNumProcTot=1 
     124 config_UserChoices_UserSpec="" 
     125 typeset option 
     126 for option in ${config_UserChoices[*]} ; do 
     127     IGCM_card_DefineVariableFromOption ${j}'/'${F_CFG} UserChoices ${option} 
     128 done 
     129 
    112130# Add specific treatment for new type of directory structure  
    113   if [ ! X$( echo ${j} | grep USER_SPEC ) = X ] ; then 
    114       echo "USER_SPEC directory exist in path, do not use this config.card" 
    115       continue 
    116   fi 
    117  
    118131  if [ -d ${j}/USER_SPEC ] && [ -d ${j}/GENERAL ] ; then 
    119132      echo "This is new configuration structure" 
    120       IGCM_card_DefineVariableFromOption ${j}'/'${F_CFG} UserChoices JobName 
    121       IGCM_card_DefineVariableFromOption ${j}'/'${F_CFG} UserChoices UserSpec 
    122133      echo "JobName=${config_UserChoices_JobName}" 
    123       if [ X${config_UserChoices_UserSpec} = X ] ; then 
    124         echo "The variable UserSpec must be added in config.card in section UserChoices" 
    125         echo "UserSpec gives the directory for the .card configurtaion files for the wanted experiement. For exemple UserSpec=IPSLCM5/historical" 
    126         echo "UserSpec= $Config_UserChoices_UserSpec " 
    127         continue 
     134 
     135      if [ "X${config_UserChoices_UserSpec}" = X ] ; then 
     136        echo "\nERROR in ${j}/config.card" 
     137        echo "ins_job stops here" 
     138        echo "=> The variable UserSpec must be added in config.card in section UserChoices" 
     139        echo "=> UserSpec gives the directory for the .card configurtaion files for the wanted experiement. For exemple UserSpec=IPSLCM5/historical" 
     140        exit 4 
    128141      else 
    129         echo "UserSpec= $Config_UserChoices_UserSpec " 
     142        echo "UserSpec= ${config_UserChoices_UserSpec}" 
    130143      fi 
    131144 
     
    150163 RESOL_ATM_3D=this_is_a_test_string 
    151164 RESOL=this_is_another_test_string 
    152  IGCM_card_DefineVariableFromOption ${j}'/'${F_CFG} UserChoices JobName 
    153165 if [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL_ATM_3D} ) = X ] ; then 
    154166    TRUERESOL=$( find ../ -name ".resol" -exec tail -1 {} \; | awk "-F=" '{print $2}' ) 
     
    163175 fi 
    164176  
    165  # Other options are not always needed 
    166  IGCM_card_DefineArrayFromSection ${j}'/'${F_CFG} UserChoices 
    167  # Default values 
    168  config_UserChoices_JobClass=mono 
    169  config_UserChoices_JobNumProcTot=1 
    170  # config.card optionnal values 
    171  typeset option 
    172  for option in ${config_UserChoices[*]} ; do 
    173      IGCM_card_DefineVariableFromOption ${j}'/'${F_CFG} UserChoices ${option} 
    174  done 
    175177 # File name for Job 
    176178 n_f='Job_'${config_UserChoices_JobName}; 
Note: See TracChangeset for help on using the changeset viewer.