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 10568 for NEMO/trunk/doc – NEMO

Changeset 10568 for NEMO/trunk/doc


Ignore:
Timestamp:
2019-01-24T15:10:59+01:00 (5 years ago)
Author:
nicolasmartin
Message:

Fix for a consistent output of the index entries to review in the NEMO manual

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/bin/manuals_checking.sh

    r10550 r10568  
    99fi 
    1010 
    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  
    1611for model in $models; do 
    1712    [[ $model =~ ^(SI3|TOP)$ ]] && continue 
    1813 
    19     tex_files=$( find latex/$model -type f -name *.tex ) 
     14    files=$( find latex/$model -type f -name *.tex ) 
    2015 
    2116    echo '¤ Missing namelist groups in '$model' manual' 
    2217 
    2318    for nlst in $( ls namelists ); do 
    24         [[ ! $( grep \\nlst{$nlst} ${tex_files} ) ]] && printf '%s ' $nlst 
     19        [[ ! $( grep \\nlst{$nlst} $files ) ]] && printf '%s ' $nlst 
    2520    done 
    2621 
    2722    echo; echo 
    28     echo '¤ Chapters with vanished entries in '$model' manual (\{hf,jp,key,mdl,ngn,nlst,np,rou}{...})' 
     23    echo '¤ Vanished index entries in '$model' manual (\{hf,jp,key,mdl,ngn,nlst,np,rou}{...})' 
    2924 
    30     for file in ${tex_files}; do 
     25    for file in $files; do 
    3126 
    3227        items=$( grep -Eho "(hf|jp|key|mdl|ngn|nlst|np|rou){[a-zA-Z0-9_\]*}" $file | sort -u ) 
    3328 
    34         [[ $items == '' ]] && continue 
    35  
    36         printf $file': ' 
     29        if [[ $items == '' ]]; then 
     30            continue 
     31        else 
     32            printf ${file/latex\/*\/subfiles\/}': ' 
     33        fi 
    3734 
    3835        for item in $items; do 
    3936 
    40             if [[ ( $item =~ 'hf'   && ! $( find ../src -type f -name   $arg.h90               ) ) || \ 
    41                   ( $item =~ 'jp'   && ! $( grep ":: *$arg"             ../src/OCE/par_oce.F90 ) ) || \ 
    42                   ( $item =~ 'key'  && ! $( grep -ri "#if .* $arg"      ../src                 ) ) || \ 
    43                   ( $item =~ 'mdl'  && ! $( find ../src -type f -name   $arg.[Ff]90            ) ) || \ 
    44                   ( $item =~ 'ngn'  && ! $( grep \&$arg                 namelists/*            ) ) || \ 
    45                   ( $item =~ 'nlst' && ! -f namelists/$arg                                       ) || \ 
    46                   ( $item =~ 'np'   && ! $( grep " $arg *="             namelists/*            ) ) || \ 
    47                   ( $item =~ 'rou'  && ! $( grep -ri "SUBROUTINE *$arg" ../src                 ) )      ]]; then 
     37            arg=$( echo $item | sed 's/.*{\([^}]*\)}/\1/' | tr -d '\\' ) 
     38 
     39            if [[ ( $item =~ ^hf   && ! $( find ../src -type f -name   $arg.h90               ) ) || \ 
     40                  ( $item =~ ^jp   && ! $( grep ":: *$arg"             ../src/OCE/par_oce.F90 ) ) || \ 
     41                  ( $item =~ ^key  && ! $( grep -ri "#if .* $arg"      ../src                 ) ) || \ 
     42                  ( $item =~ ^mdl  && ! $( find ../src -type f -name   $arg.[Ff]90            ) ) || \ 
     43                  ( $item =~ ^ngn  && ! $( grep \&$arg                 namelists/*            ) ) || \ 
     44                  ( $item =~ ^nlst && ! -f namelists/$arg                                       ) || \ 
     45                  ( $item =~ ^np   && ! $( grep " $arg *="             namelists/*            ) ) || \ 
     46                  ( $item =~ ^rou  && ! $( grep -ri "SUBROUTINE *$arg" ../src                 ) )      ]]; then 
    4847                printf $item' ' 
    4948            fi 
Note: See TracChangeset for help on using the changeset viewer.