Changeset 3974
- Timestamp:
- 2013-07-12T18:56:39+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh
r2404 r3974 35 35 echo ' --insrc only print all variable definitions found in the source code' 36 36 echo 'Examples' 37 echo ' chk_iomput.sh'38 echo ' chk_iomput.sh --help'39 echo ' chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"'37 echo ' ./chk_iomput.sh' 38 echo ' ./chk_iomput.sh --help' 39 echo ' ./chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"' 40 40 echo 41 41 exit ;; … … 59 59 #------------------------------------------------ 60 60 # 61 [ $inxml -eq 1 ] && grep "< *field * id *=" $xmlfile 61 external=$( grep -c "<field_definition.* src=" $xmlfile ) 62 if [ $external -eq 1 ] 63 then 64 xmlfield_def=$( grep "<field_definition.* src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' ) 65 xmlfield_def=$( dirname $xmlfile )/$xmlfield_def 66 else 67 xmlfield_def=$xmlfile 68 fi 69 [ $inxml -eq 1 ] && grep "< *field * id *=" $xmlfield_def 62 70 [ $insrc -eq 1 ] && find $srcdir -name "*.[Ffh]90" -exec grep -iH "^[^\!]*call *iom_put *(" {} \; 63 71 [ $(( $insrc + $inxml )) -ge 1 ] && exit … … 71 79 # list of variables used in "CALL iom_put" 72 80 # 73 varlistsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i "^[^\!]*call *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | sort -d ) 81 badvarsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i "^[^\!]*call *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -ic iom_put ) 82 if [ $badvarsrc -ne 0 ] 83 then 84 echo "The following call to iom_put cannot be checked" 85 echo 86 find $srcdir -name "*.[Ffh]90" -exec grep -i "^[^\!]*call *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -i iom_put | sort -d 87 echo 88 fi 89 varlistsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i "^[^\!]*call *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -vi iom_put | sort -d ) 74 90 # 75 91 # list of variables defined in the xml file 76 92 # 77 varlistxml=$( grep "< *field * id *=" $xmlfile | sed -e "s/^.*< *field* id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )93 varlistxml=$( grep "< *field.* id *=" $xmlfield_def | sed -e "s/^.*< *field.* id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 78 94 # 79 95 # list of variables to be outputed in the xml file 80 96 # 81 varlistout=$( grep "< *field * ref *=" $xmlfile | sed -e "s/^.*< *field *ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )97 varlistout=$( grep "< *field.* field_ref *=" $xmlfile | sed -e "s/^.*< *field.* field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d ) 82 98 # 83 99 echo "--------------------------------------------------" 84 100 echo check if all iom_put found in $srcdir 85 echo have a corresponding variable definition in $xmlfi le101 echo have a corresponding variable definition in $xmlfield_def 86 102 echo "--------------------------------------------------" 87 103 for var in $varlistsrc … … 90 106 if [ $tst -ne 1 ] 91 107 then 92 echo "problem with $var: $tst lines corresponding to its definition in $xmlfi le, but defined in the code in"108 echo "problem with $var: $tst lines corresponding to its definition in $xmlfield_def, but defined in the code in" 93 109 for f in $srclist 94 110 do
Note: See TracChangeset
for help on using the changeset viewer.