Ignore:
Timestamp:
08/16/16 18:08:36 (8 years ago)
Author:
sdipsl
Message:

Call xios_parser.py and ensure field_compname.xml file and file_def_*_companme.xml are coherent. See #256

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh

    r1289 r1338  
    256256 
    257257#======================================================================= 
     258function IGCM_comp_PrepareXiosFiles 
     259{ 
     260  IGCM_debug_PushStack "IGCM_comp_PrepareXiosFiles" $@ 
     261 
     262  typeset file 
     263  [ X${2} != X. ] && file=$( basename ${2} ) || file=$( basename ${1} ) 
     264 
     265  if [ $( echo ${file} | grep "^field_def_" | wc -l ) = 1 ] ; then 
     266    eval FieldDef[${#FieldDef[@]}]=${file} > /dev/null 2>&1 
     267  fi 
     268  if [ $( echo ${file} | grep "^file_def_" | wc -l ) = 1 ] ; then 
     269    eval FileDef[${#FileDef[@]}]=${file} > /dev/null 2>&1 
     270  fi 
     271   
     272  IGCM_debug_PopStack "IGCM_comp_PrepareXiosFiles" 
     273} 
     274 
     275#======================================================================= 
    258276function IGCM_comp_GetInputInitialStateFiles 
    259277{ 
     
    578596    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1 
    579597 
     598    # Initialize array hosting file_def and field_def files to check and/or modify 
     599    unset FieldDef 
     600    unset FileDef 
     601 
    580602    # Debug Print : 
    581603    IGCM_debug_Print 3 "Parameters ${compname}" 
     
    600622        IGCM_sys_Cp ${file_in} ${file_out} 
    601623        IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out} 
     624        IGCM_comp_PrepareXiosFiles    ${file_in} ${file_out} 
    602625 
    603626        (( i=i+2 )) 
    604627      done 
     628    fi 
     629 
     630    if [ ${#FileDef[@]} -ne 0 ] ; then 
     631      # Check XMLs coherency now 
     632      ${libIGCM}/libIGCM_post/xios_parser.py check --field ${FieldDef} --file ${FileDef} 
     633      if [ $? = 0 ] ; then 
     634        IGCM_debug_Print 3 "${compname} XIOS XMLs are consistent" 
     635      else 
     636        IGCM_debug_Print 3 "${compname} XIOS XMLs ARE NOT consistent" 
     637        ${libIGCM}/libIGCM_post/xios_parser.py -v modify --field ${FieldDef} --file ${FileDef} 
     638        [ $? != 0] &&  IGCM_debug_Exit "Failed to fix XIOS xml files for ${compname}" 
     639      fi 
    605640    fi 
    606641  done 
Note: See TracChangeset for help on using the changeset viewer.