- Timestamp:
- 2017-11-29T05:08:05+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/ROMS_WAD_7832/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh
r4162 r8841 37 37 echo ' ./chk_iomput.sh' 38 38 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/"' 40 40 echo 41 41 exit ;; … … 51 51 done 52 52 # 53 [ ! -f "$xmlfile" ] && echo "$xmlfile not found, we stop..." && exit 53 echo $xmlfile 54 echo $srcdir 55 56 for i in $xmlfile 57 do 58 [ ! -f "$xmlfile" ] && echo "$xmlfile not found, we stop..." && exit 59 done 54 60 for i in $srcdir 55 61 do … … 60 66 # 61 67 external=$( grep -c "<field_definition *\([^ ].* \)*src=" $xmlfile ) 62 if [ $external - eq1 ]68 if [ $external -ge 1 ] 63 69 then 64 70 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 66 75 else 67 76 xmlfield_def=$xmlfile 68 77 fi 78 external=$( grep -c "<file_definition *\([^ ].* \)*src=" $xmlfile ) 79 if [ $external -ge 1 ] 80 then 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 86 else 87 xmlfile_def=$xmlfile 88 fi 89 69 90 [ $inxml -eq 1 ] && grep "< *field *\([^ ].* \)*id *=" $xmlfield_def 70 91 [ $insrc -eq 1 ] && find $srcdir -name "*.[Ffh]90" -exec grep -iH "^[^\!]*call *iom_put *(" {} \; … … 95 116 # list of variables to be outputed in the xml file 96 117 # 97 varlistout=$( grep "< *field *\([^ ].* \)*field_ref *=" $xmlfile | sed -e "s/^.*< *field .*field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )118 varlistout=$( grep "< *field *\([^ ].* \)*field_ref *=" $xmlfile_def | sed -e "s/^.*< *field .*field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 98 119 # 99 120 echo "--------------------------------------------------"
Note: See TracChangeset
for help on using the changeset viewer.