Ignore:
Timestamp:
07/20/12 11:01:47 (12 years ago)
Author:
jgipsl
Message:

Merged branche modipsl/newdev into modipsl/trunk . Changes are :

  • Cleaning up in mod.def. Fewer configurations are now distributed.
  • ins_job : Added option for creating job for ensembles and updated use of new configuration v5.
  • model :
    • Added coupled configuration IPSLCM5CHS and IPSLCM5CHT.
    • Added option DEFAULT : This option has for purpose to ask the user if he wants to change a component will extracting a configuration. This option is activated by adding DEFAULT in front of component name in mod.def. This option is not used for the moment.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modipsl/trunk/util/ins_job

    r1644 r1828  
    1414 
    1515Usage : 
    16   ${b_n} [-h] [-v] 
     16  ${b_n} [-h] [-v] [-e] 
    1717 
    1818Options : 
    1919  -h   : help 
    2020  -v   : verbose mode 
     21  -e   : turn on hindcast/forecast ensemble mode 
    2122" 
    2223} 
     
    3536#- 
    3637x_v='silencious'; 
    37 while getopts :hv V 
    38   do 
    39    case $V in 
    40     (h)  ins_job_Usage; exit 0;; 
    41     (v)  x_v='verbose';; 
    42     (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 
    43          exit 2;; 
    44     (\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2; 
    45          exit 2;; 
    46     esac 
    47   done 
     38x_e=false; 
     39while getopts :hve V ; do 
     40  case $V in 
     41  (h)  ins_job_Usage; exit 0;; 
     42  (v)  x_v='verbose';; 
     43  (e)  x_e=true;; 
     44  (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 
     45  exit 2;; 
     46  (\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2; 
     47  exit 2;; 
     48  esac 
     49done 
    4850shift $(($OPTIND-1)); 
    4951#- 
     
    9395#- 
    9496DEBUG_debug=false 
     97MirrorlibIGCM=false 
    9598. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh 
    9699. ${libIGCM}/libIGCM_card/libIGCM_card.ksh 
     100. ${libIGCM}/libIGCM_date/libIGCM_date.ksh 
     101. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh 
     102if [ $x_e = 'true' ] ; then 
     103  . ${libIGCM}/libIGCM_ensemble/libIGCM_ensemble.ksh 
     104fi 
    97105#- 
    98106# Define the pattern string to substitute 
     
    109117 n_f=${F_RCI##*/}; 
    110118 
    111  if [ ! X$( echo ${j} | grep USER_SPEC ) = X ] ; then 
    112  # Do not treat config.card if it is in sub-directory of USER_SPEC 
     119 if [ ! X$( echo ${j} | grep EXPERIMENTS ) = X ] ; then 
     120 # Do not treat config.card if it is in sub-directory of EXPERIMENTS 
    113121 # Continue to next config.card 
    114122     continue 
    115123 else 
    116124     print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}"; 
     125 fi 
     126 
     127 # Find out if new structure and set .resol filename 
     128 if [ -d ${j}/EXPERIMENTS ] && [ -d ${j}/GENERAL ] ; then 
     129     # New Structure 
     130     echo "This is new configuration structure" 
     131     new_struct=yes 
     132     resolfile=$j/.resol 
     133 else 
     134     # Old Structure 
     135     new_struct=no 
     136     resolfile=$j/../.resol 
    117137 fi 
    118138  
     
    122142 config_UserChoices_JobClass=mono 
    123143 config_UserChoices_JobNumProcTot=1 
    124  config_UserChoices_UserSpec="" 
     144 config_UserChoices_ExpType="" 
    125145 RESOL_ATM_3D=this_is_a_test_string 
    126146 RESOL=this_is_another_test_string 
     
    132152# Find the JobName : JobName might contain the variable RESOL_ATM_3D that will be replaced by what is in .resol file 
    133153 if [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL_ATM_3D} ) = X ] ; then 
    134     TRUERESOL=$( find ../ -name ".resol" -exec tail -1 {} \; | awk "-F=" '{print $2}' ) 
     154    TRUERESOL=$( tail -1 $resolfile | awk "-F=" '{print $2}' ) 
     155    echo TRUERESOL = $TRUERESOL 
    135156    JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL_ATM_3D}/${TRUERESOL}/" ) 
    136157    IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName} 
    137158 elif [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL} ) = X ] ; then 
    138      TRUERESOL=$( find ../ -name ".resol" -exec head -1 {} \; ) 
     159     TRUERESOL=$( head -1 $resolfile ) 
    139160     JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL}/${TRUERESOL}/" ) 
    140161     IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName} 
     
    145166 
    146167# Add specific treatment for new type of directory structure  
    147   if [ -d ${j}/USER_SPEC ] && [ -d ${j}/GENERAL ] ; then 
    148       echo "This is new configuration structure" 
    149  
    150       if [ "X${config_UserChoices_UserSpec}" = X ] ; then 
     168  if [ ${new_struct} == yes ] ; then 
     169 
     170      if [ "X${config_UserChoices_ExpType}" = X ] ; then 
    151171        echo "\nERROR in ${j}/config.card" 
    152172        echo "ins_job stops here" 
    153         echo "=> The variable UserSpec must be added in config.card in section UserChoices" 
    154         echo "=> UserSpec gives the directory for the .card configurtaion files for the wanted experiement. For exemple UserSpec=IPSLCM5/historical" 
     173        echo "=> The variable ExpType must be added in config.card in section UserChoices" 
     174        echo "=> ExpType gives the directory for the .card configurtaion files for the wanted experiement. For exemple ExpType=IPSLCM5/historical" 
    155175        exit 4 
    156176      else 
    157         echo "UserSpec= ${config_UserChoices_UserSpec}" 
     177        echo "ExpType= ${config_UserChoices_ExpType}" 
    158178      fi 
    159179 
     
    162182          continue 
    163183      fi 
    164       cp -r ${j}/USER_SPEC/${config_UserChoices_UserSpec} ${j}/${JobName} 
     184      cp -r ${j}/EXPERIMENTS/${config_UserChoices_ExpType} ${j}/${JobName} 
    165185      cp -r ${j}/GENERAL/* ${j}/${JobName}/. 
    166186      cp -f ${j}/${F_CFG}  ${j}/${JobName}/. 
     
    207227done 
    208228#- 
     229# Limited to hindcast/forecast Ensemble for the time being 
     230if [ ${x_e} = 'true' ] ; then 
     231  #.. Read input data from ensemble.card ..  
     232  # TO BE CHANGED 
     233  FileName="ensemble.card" 
     234  SUBMIT_DIR=$( pwd ) 
     235  RUN_DIR="${WORKDIR}/ENSEMBLE" 
     236  # 
     237  # Copy initial things around and define variables (hindcast/forecast case) 
     238  IGCM_ensemble_CastInit 
     239  # As it says 
     240  IGCM_sys_Cd ${SUBMIT_DIR} 
     241  IGCM_ensemble_CastPeriodicStarts 
     242  # As it says 
     243  IGCM_sys_Cd ${SUBMIT_DIR} 
     244  IGCM_ensemble_CastNonPeriodicStarts 
     245  # Done 
     246  IGCM_sys_Cp ${RUN_DIR}/CreatedDir.txt ${RUN_DIR}/Qsub.txt ${SUBMIT_DIR} 
     247  IGCM_sys_Cd ${SUBMIT_DIR} 
     248fi 
     249#- 
    209250print - ""; 
    210251#- 
Note: See TracChangeset for help on using the changeset viewer.