Changeset 6671 for modipsl/trunk


Ignore:
Timestamp:
11/07/23 15:46:26 (7 months ago)
Author:
jgipsl
Message:

Add possibility to extract a sub-configuration of IPSLCM7 configuration.

Location:
modipsl/trunk/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modipsl/trunk/util/mod.def

    r6657 r6671  
    318318#-H- IPSLCM7_work  CONFIG/IPSLCM7 rev HEAD 
    319319#-H- IPSLCM7_work  libIGCM trunk rev 1552 
    320 #-C- IPSLCM7_work  master                                       3558d704         21   DYNAMICO       modeles 
    321 #-C- IPSLCM7_work  ICOSA_LMDZ                                       4616         20   ICOSA_LMDZ     modeles 
    322 #-C- IPSLCM7_work  IOIPSL/tags/v2_2_5                               6058         8   IOIPSL         modeles 
    323 #-C- IPSLCM7_work  branches/ORCHIDEE_2_2/ORCHIDEE                   7991        14   ORCHIDEE_2_2   modeles 
    324 #-C- IPSLCM7_work  trunk/ORCHIDEE                                   8175        14   ORCHIDEE_trunk modeles 
    325 #-C- IPSLCM7_work  CPL/oasis3-mct/branches/OASIS3-MCT_5.0_branch    6331         8   oasis3-mct     . 
    326 #-C- IPSLCM7_work  LMDZ6/trunk                                      4515        20   LMDZ           modeles 
    327 #-C- IPSLCM7_work  CONFIG/UNIFORM/v7/IPSLCM7                        HEAD         8   IPSLCM7        config 
    328 #-C- IPSLCM7_work  trunk/libIGCM                                    1581        10   libIGCM        . 
    329 #-C- IPSLCM7_work  4.2.0                                            HEAD         22  NEMO           modeles 
    330 #-C- IPSLCM7_work  trunk/INCA6                                      1091         9   INCA           modeles 
    331 #-C- IPSLCM7_work  XIOS2/trunk                                      2439        12   XIOS           modeles 
     320#-C- IPSLCM7_work  master                                       3558d704         21  DYNAMICO       modeles   DYNAMICO  
     321#-C- IPSLCM7_work  ICOSA_LMDZ                                       4616         20  ICOSA_LMDZ     modeles   DYNAMICO 
     322#-C- IPSLCM7_work  IOIPSL/tags/v2_2_5                               6058         8   IOIPSL         modeles   IOIPSL 
     323#-C- IPSLCM7_work  branches/ORCHIDEE_2_2/ORCHIDEE                   7991        14   ORCHIDEE_2_2   modeles   ORCHIDEE 
     324#-C- IPSLCM7_work  trunk/ORCHIDEE                                   8175        14   ORCHIDEE_trunk modeles   ORCHIDEE 
     325#-C- IPSLCM7_work  CPL/oasis3-mct/branches/OASIS3-MCT_5.0_branch    6331         8   oasis3-mct     .         OASIS 
     326#-C- IPSLCM7_work  LMDZ6/trunk                                      4515        20   LMDZ           modeles   LMDZ 
     327#-C- IPSLCM7_work  CONFIG/UNIFORM/v7/IPSLCM7                        HEAD         8   IPSLCM7        config    CONFIG 
     328#-C- IPSLCM7_work  trunk/libIGCM                                    1581        10   libIGCM        .         libIGCM 
     329#-C- IPSLCM7_work  4.2.0                                            HEAD         22  NEMO           modeles   NEMO 
     330#-C- IPSLCM7_work  trunk/INCA6                                      1091         9   INCA           modeles   INCA 
     331#-C- IPSLCM7_work  XIOS2/trunk                                      2439        12   XIOS           modeles   XIOS 
    332332 
    333333 
  • modipsl/trunk/util/model

    r6269 r6671  
    4545# Retrieve the model name 
    4646#- 
    47 [[ ${#} -gt 1 ]] && \ 
     47[[ ${#} -gt 2 ]] && \ 
    4848  { echo 'Only one model can be specified' 1>&2; exit 3; } 
    4949[[ ${#} -eq 1 ]] && { m_n="${1}"; } 
     50sub_conf="FULL" 
     51[[ ${#} -eq 2 ]] && { m_n="${1}"; sub_conf="${2}"; } 
    5052[[ ${m_a} != 'help' && -z ${m_n} ]] && \ 
    5153 { 
     
    5456  exit 3; 
    5557 } 
     58 
     59case ${m_n} in 
     60    ( IPSLCM7* ) 
     61    # subconfiguration is optional 
     62    if [ ${sub_conf} == "LMDZOR" ] ; then 
     63        comp_to_exclude="NEMO OASIS INCA DYNAMICO" 
     64    elif [ ${sub_conf} == "LMDZORINCA" ] ; then 
     65        comp_to_exclude="NEMO OASIS DYNAMICO" 
     66    elif [ ${sub_conf} == "ICOLMDZOR" ] ; then 
     67        comp_to_exclude="NEMO OASIS INCA" 
     68    elif [ ${sub_conf} == "ICOLMDZORINCA" ] ; then 
     69        comp_to_exclude="NEMO OASIS" 
     70    elif [ ${sub_conf} == "FULL" ] ; then 
     71        comp_to_exculde=" " 
     72    else 
     73        echo Sub-configuration ${sub_conf} is not supported. 
     74        echo Choose between ICOLMDZOR, ICOLMDZORINCA, LMDZOR or LMDZORINCA 
     75        echo For full configuration, do not specify the second argument or choose FULL 
     76        exit 
     77    fi 
     78    ;; 
     79    ( * ) 
     80    # sub configuration is not possible 
     81    if [ ${sub_conf} != "FULL" ] ; then 
     82        echo Extraction of a sub-configuration is not supported for this model. Remove second argument and retry. 
     83        exit 
     84    fi 
     85esac 
     86 
    5687#- 
    5788# Test availability of the definition file 
     
    102133    unset v0 v1 v2 v3; 
    103134    #- Extract the model informations 
    104     qi=0; 
    105     while read v0 v1 v2 v3 v4 v5 v6 
     135    qi=0;   
     136    while read v0 v1 v2 v3 v4 v5 v6 v7 
    106137      do 
    107         [[ -n "${v1}" && "${v1}" = "${m_n}" ]] && \ 
     138        [[ -n "${v1}" && "${v1}" = "${m_n}" ]] && \ 
    108139         { 
    109140          #- model manager email address 
     
    148179            m_l[${qi}]=${v6}; 
    149180            [[ -z "${m_l[${qi}]}" ]] && { m_l[${qi}]="modeles"; } 
     181            m_7[${qi}]=${v7}; 
     182            [[ -z "${m_7[${qi}]}" ]] && { m_7[${qi}]="none"; } 
    150183           } 
    151184         } 
    152185      done <${F_DEF} 
    153     unset v0 v1 v2 v3 v4 v5 v6 
     186    unset v0 v1 v2 v3 v4 v5 v6 v7 
    154187    #- Validate the model informations 
    155188    #- m_m: model manager email address. If not found in mod.def then set default adress. 
     
    202235  else 
    203236    echo 'model : '${m_n}; 
     237    [[ ${sub_conf} != "FULL" ]] && echo "Subconfiguration : ${sub_conf} (following components will not be extracted:  ${comp_to_exclude})" 
    204238    echo ' '; 
    205239    while read v0 v1 v2 
     
    215249      do 
    216250        ((qi=qi+1)); 
     251         
     252        # Check if the component is in the list of compents to exclude from installation 
     253        # If that's the case, continue to next component 
     254        z7=${m_7[${qi}]} 
     255        if [ "X$( echo ${comp_to_exclude} | grep $z7 )" != "X" ] ; then 
     256            [[ ${m_v} = 'verbose' ]] && { echo Component ${z7} will not be extracted. ; } 
     257            continue 
     258        fi 
    217259        echo 'Component '${qi}' : '${m_c[${qi}]}; 
    218260        echo 'Revision  '${qi}' : '${m_t[${qi}]}; 
     
    221263        echo 'Directory '${qi}' : '${m_d[${qi}]}; 
    222264        echo 'Local Dir '${qi}' : '${m_l[${qi}]}; 
     265        echo 'Comp name '${qi}' : '${z7}; 
     266        echo '' 
    223267      done 
    224268  fi 
     
    272316    zp=${m_p[${qi}]}; zs=${m_s[${qi}]}; 
    273317    zd=${m_d[${qi}]}; zl=${m_l[${qi}]}; 
    274      
     318    z7=${m_7[${qi}]}; 
     319 
     320    # Check if the component is in the list of compents to exclude from installation 
     321    # If that's the case, continue to next component 
     322    if [ "X$( echo ${comp_to_exclude} | grep $z7 )" != "X" ] ; then 
     323        [[ ${m_v} = 'verbose' ]] && { echo Component ${z7} will not be extracted. ; } 
     324        continue 
     325    fi 
     326 
    275327# Maybe change some information marked with DEFAULT.  
    276328# Check if key word DEFAULT is used in component name 
     
    305357       echo '--- Directory  : '${zd}; 
    306358       echo '--- Local Dir  : '${zl}; 
     359       echo '--- Component name : '${z7}; 
    307360    else 
    308361       echo '--- Component : '${zd}; 
     
    317370       echo '--- Server     : '${zs}; 
    318371       echo '--- Directory  : '${zd}; 
    319        echo '--- Local Dir  : '${zl}; } >>"${F_LOG}" 
     372       echo '--- Local Dir  : '${zl}; 
     373       echo '--- Component name  : '${z7}; } >>"${F_LOG}" 
    320374#--- 
    321375    [[ ${zp} = 'cvs' ]] && \ 
     
    447501esac 
    448502 
     503case ${m_n} in ( IPSLCM7* ) 
     504               if [ ${sub_conf} == "LMDZOR" ] ; then 
     505                   rm -fr ../config/IPSLCM7*/EXPERIMENTS/IPSLCM* 
     506                   rm -fr ../config/IPSLCM7*/EXPERIMENTS/ICOLMDZ* 
     507                   rm -fr ../config/IPSLCM7*/EXPERIMENTS/*INCA* 
     508               elif [ ${sub_conf} == "LMDZORINCA" ] ; then 
     509                   rm -fr ../config/IPSLCM7*/EXPERIMENTS/IPSLCM* 
     510                   rm -fr ../config/IPSLCM7*/EXPERIMENTS/ICOLMDZ* 
     511               elif [ ${sub_conf} == "ICOLMDZOR" ] ; then 
     512                   rm -fr ../config/IPSLCM7*/EXPERIMENTS/IPSLCM* 
     513                   rm -fr ../config/IPSLCM7*/EXPERIMENTS/*INCA* 
     514               elif [ ${sub_conf} == "ICOLMDZORINCA" ] ; then 
     515                   rm -fr ../config/IPSLCM7*/EXPERIMENTS/IPSLCM* 
     516               fi 
     517               ;; 
     518esac 
     519 
    449520#--- Create Makefiles using the script ins_make 
    450521#    ins_make will detect target machine among predefined targets in AA_make.gdef and  
Note: See TracChangeset for help on using the changeset viewer.