Changeset 10443
- Timestamp:
- 2018-12-21T15:36:36+01:00 (4 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/doc/bin/manuals_checking.sh
r10442 r10443 1 1 #!/bin/sh 2 2 3 #set -evx 4 3 5 if [[ $* != '' ]]; then 4 5 if [[ $1 = 'all' ]]; then 6 models='NEMO SI3 TOP' 7 else 8 models=$1 9 fi 10 6 if [[ $1 = 'all' ]]; then models='NEMO SI3 TOP'; else models=$1; fi 11 7 else 12 8 models='NEMO' 13 9 fi 14 10 11 extract_arg() { 12 ## $1: macro name, $2: prefix for filtering args (optional) 13 eval grep -Poh "\\$1{\\$2\\\K[^}]+" ${tex_files} | tr -d '\\' | sort -u 14 } 15 15 16 for model in $models; do 16 [[ $model =~ ^(SI3|TOP)$ ]] && continue 17 echo 'Namelists not included in the '$model' manual:' 17 [[ $model =~ ^(SI3|TOP)$ ]] && continue 18 18 19 for nlst in $( ls namelists ); do19 tex_files=$( find latex/$model -type f -name *.tex ) 20 20 21 if [[ ! $( grep "\\nlst{$nlst}" ./latex/$model/subfiles/*.tex ) ]]; then 22 printf "$nlst " 21 echo '¤ Missing namelist groups in '$model' manual' 22 23 for nlst in $( ls namelists ); do 24 [[ ! $( grep \\nlst{$nlst} ${tex_files} ) ]] && printf '%s ' $nlst 25 done 26 27 echo; echo 28 echo '¤ Vanished references in '$model' manual (\\autoref{...})' 29 30 for item in 'mdl' 'ngn' 'nlst' 'np' 'rou'; do 31 echo '- '$item':' 32 args_list=$( extract_arg $item ) 33 34 for arg in ${args_list}; do 35 36 if [[ "$item" == 'nlst' && ! -f namelists/$arg ]]; then 37 printf '%15s: ' $arg 38 grep -l \\nlst{$arg} ${tex_files} | sed 's/^.*\///' 39 elif [[ ( "$item" == 'mdl' && ! $( find ../src -type f -name $arg.[Ffh]90 ) ) || \ 40 ( "$item" == 'ngn' && ! $( grep \&$arg namelists/* ) ) || \ 41 ( "$item" == 'rou' && ! $( grep -ri "SUBROUTINE *$arg" ../src ) ) || \ 42 ( "$item" == 'np' && ! $( grep " $arg *=" namelists/* ) ) ]]; then 43 printf '%s ' $arg 44 fi 45 46 done 47 48 [ "$item" != 'nlst' ] && echo 49 done 50 51 done 52 53 echo 54 echo '¤ Namelist parameters unfollowing naming conventions (^[cdlnr]n_*)' 55 56 for nlst in $( ls namelists ); do 57 np_list=$( f90nml namelists/$nlst 2> /dev/null | awk '/=/ { print $1 }' ) 58 array=() 59 60 for np in ${np_list}; do 61 62 if [[ ! ${np:0:3} =~ ^[cdlnr]n_$ ]]; then 63 array+=$np' ' 23 64 fi 24 65 25 66 done 26 67 27 echo 68 if (( ${#array[@]} != 0 )); then 69 printf '%15s: ' $nlst 70 echo ${array[@]} 71 fi 28 72 29 73 done
Note: See TracChangeset
for help on using the changeset viewer.