New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 8868 for branches/2017/dev_METO_2017/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh – NEMO

Ignore:
Timestamp:
2017-12-01T09:43:23+01:00 (6 years ago)
Author:
timgraham
Message:

Merged dev_r8789_sbc into branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_METO_2017/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh

    r4162 r8868  
    3737       echo '      ./chk_iomput.sh' 
    3838       echo '      ./chk_iomput.sh --help' 
    39        echo '      ./chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"' 
     39       echo '      ./chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/context_nemo.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"' 
    4040       echo 
    4141       exit ;; 
     
    5151done  
    5252# 
    53 [ ! -f "$xmlfile" ] && echo "$xmlfile not found, we stop..." && exit 
     53echo $xmlfile 
     54echo $srcdir 
     55 
     56for i in $xmlfile 
     57do 
     58    [ ! -f "$xmlfile" ] && echo "$xmlfile not found, we stop..." && exit 
     59done 
    5460for i in $srcdir  
    5561do 
     
    6066# 
    6167external=$( grep -c "<field_definition  *\([^ ].* \)*src=" $xmlfile ) 
    62 if [ $external -eq 1 ] 
     68if [ $external -ge 1 ] 
    6369then 
    6470    xmlfield_def=$( grep "<field_definition  *\([^ ].* \)*src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' ) 
    65     xmlfield_def=$( dirname $xmlfile )/$xmlfield_def    
     71    tmp_def="" 
     72    for fdef in $xmlfield_def ; do tmp_def="$tmp_def $( dirname $xmlfile )/$fdef" ; done 
     73    xmlfield_def=$tmp_def 
     74    echo $xmlfield_def 
    6675else 
    6776    xmlfield_def=$xmlfile 
    6877fi 
     78external=$( grep -c "<file_definition  *\([^ ].* \)*src=" $xmlfile ) 
     79if [ $external -ge 1 ] 
     80then 
     81    xmlfile_def=$( grep "<file_definition  *\([^ ].* \)*src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' ) 
     82    tmp_def="" 
     83    for fdef in $xmlfile_def ; do tmp_def="$tmp_def $( dirname $xmlfile )/$fdef" ; done 
     84    xmlfile_def=$tmp_def 
     85    echo $xmlfile_def 
     86else 
     87    xmlfile_def=$xmlfile 
     88fi 
     89 
    6990[ $inxml -eq 1 ] && grep "< *field  *\([^ ].* \)*id *=" $xmlfield_def 
    7091[ $insrc -eq 1 ] && find $srcdir -name "*.[Ffh]90" -exec grep -iH "^[^\!]*call  *iom_put *(" {} \; 
     
    95116# list of variables to be outputed in the xml file 
    96117# 
    97 varlistout=$( grep "< *field  *\([^ ].* \)*field_ref *=" $xmlfile  | sed -e "s/^.*< *field .*field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 
     118varlistout=$( grep "< *field  *\([^ ].* \)*field_ref *=" $xmlfile_def  | sed -e "s/^.*< *field .*field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 
    98119# 
    99120echo "--------------------------------------------------" 
Note: See TracChangeset for help on using the changeset viewer.