Index: MO/trunk/doc/PDF_creation.sh
===================================================================
--- /NEMO/trunk/doc/PDF_creation.sh (revision 11003)
+++ (revision )
@@ -1,47 +1,0 @@
-#!/bin/sh
-
-export opts='-shell-escape -pdf -quiet'
-model='NEMO'
-
-check_python_module() {
- python -c "
-import sys
-try:
- import $1
- print('\nModule $1 is installed')
-except ImportError:
- print('\nModule $1 is NOT installed')
- print('')
- sys.exit(42)"
-}
-
-clean() {
- ## Delete latex build files
- find latex -regextype posix-extended \
- -regex ".*\.(aux|bbl|blg|dvi|fdb|fls|idx|ilg|ind|log|maf|mtc|out|pdf|toc).*" \
- -exec rm {} \;
-
- ## Remove 'minted' directories
- find latex -type d -name '_minted*' -exec rm -r {} \;
-
- ## HTML exports
- find latex -type d -name 'html*' -exec rm -r {} \;
-}
-
-build() {
- cd latex/$1/main
- latexmk $opts $1'_manual' > /dev/null
- mv $1'_manual'.pdf ../../..
- cd -
-}
-
-check_python_module pygments
-if [ $? -ne 0 ]; then echo 'Required python module pygments to correctly build the documentation is missing; exit 42'; echo ''; exit 42; fi
-
-clean
-
-[ ! -d figures ] && svn co http://forge.ipsl.jussieu.fr/nemo/svn/utils/figures
-
-build $model
-
-exit 0
Index: /NEMO/trunk/doc/latex/DEPS
===================================================================
--- /NEMO/trunk/doc/latex/DEPS (revision 11004)
+++ /NEMO/trunk/doc/latex/DEPS (revision 11004)
@@ -0,0 +1,53 @@
+amsmath
+babel
+caption
+capt-of
+carlisle
+cmap
+courier
+draftwatermark
+ec
+enumitem
+epstopdf
+etoolbox
+everypage
+fancyhdr
+fancyvrb
+float
+fncychap
+framed
+fvextra
+geometry
+graphics
+graphics-cfg
+helvetic
+hyperref
+idxlayout
+ifplatform
+latex
+latex-bin
+latexconfig
+latex-fonts
+latexmk
+lineno
+lm
+marvosym
+minitoc
+minted
+natbib
+needspace
+oberdiek
+parskip
+psnfss
+subfiles
+tabulary
+times
+titlesec
+tools
+upquote
+url
+varwidth
+wrapfig
+xcolor
+xstring
+zapfchan
Index: /NEMO/trunk/doc/manual_build.sh
===================================================================
--- /NEMO/trunk/doc/manual_build.sh (revision 11004)
+++ /NEMO/trunk/doc/manual_build.sh (revision 11004)
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+## Initialisation
+##---------------
+
+## latekmk options
+opts='-shell-escape -quiet'
+
+## Default selection for models
+if [ "$1" = 'all' ]; then
+ models='NEMO SI3 TOP'
+elif [ "$1" = '' ]; then
+ models='NEMO'
+else
+ models=$*
+fi
+
+## Avoid the use of shell builtin echo (for -e option)
+alias echo='/bin/echo -e'
+
+# Source shared functions
+. tools/shr_func.sh
+
+
+## Check dependancies
+##-------------------
+
+## LaTeX installation, find latexmk should be enough
+[ -z $( which latexmk ) ] && { echo 'latexmk binary is not present => QUIT'; exit 2; }
+
+## Retrieve figures if not already there
+if [ ! -d latex/figures ]; then
+ echo "Downloading of shared figures and logos\n"
+ svn co https://forge.ipsl.jussieu.fr/nemo/svn/utils/figures latex/figures > /dev/null
+fi
+
+## Pygments package for syntax highlighting of source code (namelists & snippets)
+[ -n "$( ./tools/check_pkg.py pygments )" ] && { exit 2; }
+
+
+## Loop on the models
+##-------------------
+
+for model in $models; do
+ echo $model"\n"
+ clean $model; build $model
+ echo "\t"'¤ End of build run'
+ echo "\t\t"'The export should be available at root'
+ echo "\t\t"'If not check LaTeX log in ./latex/'$model'/main/'$model'_manual.log'"\n"
+done
+
+exit 0
Index: MO/trunk/doc/requirements_latex.txt
===================================================================
--- /NEMO/trunk/doc/requirements_latex.txt (revision 11003)
+++ (revision )
@@ -1,53 +1,0 @@
-amsmath
-babel
-caption
-capt-of
-carlisle
-cmap
-courier
-draftwatermark
-ec
-enumitem
-epstopdf
-etoolbox
-everypage
-fancyhdr
-fancyvrb
-float
-fncychap
-framed
-fvextra
-geometry
-graphics
-graphics-cfg
-helvetic
-hyperref
-idxlayout
-ifplatform
-latex
-latex-bin
-latexconfig
-latex-fonts
-latexmk
-lineno
-lm
-marvosym
-minitoc
-minted
-natbib
-needspace
-oberdiek
-parskip
-psnfss
-subfiles
-tabulary
-times
-titlesec
-tools
-upquote
-url
-varwidth
-wrapfig
-xcolor
-xstring
-zapfchan
Index: /NEMO/trunk/doc/tools/check_pkg.py
===================================================================
--- /NEMO/trunk/doc/tools/check_pkg.py (revision 11004)
+++ /NEMO/trunk/doc/tools/check_pkg.py (revision 11004)
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+import sys, importlib
+
+for argv in sys.argv[1:]:
+ try:
+ importlib.import_module(argv)
+ except ImportError:
+ print("Package %s is missing in Python" % argv)
+
Index: /NEMO/trunk/doc/tools/manuals_checking.sh
===================================================================
--- /NEMO/trunk/doc/tools/manuals_checking.sh (revision 11004)
+++ /NEMO/trunk/doc/tools/manuals_checking.sh (revision 11004)
@@ -0,0 +1,80 @@
+#!/bin/sh
+
+#set -evx
+
+if [[ $* != '' ]]; then
+ if [[ $1 = 'all' ]]; then models='NEMO SI3 TOP'; else models=$1; fi
+else
+ models='NEMO'
+fi
+
+for model in $models; do
+ [[ $model =~ ^(SI3|TOP)$ ]] && continue
+
+ files=$( find latex/$model -type f -name *.tex )
+
+ echo '¤ Missing namelist groups in '$model' manual'
+
+ for nlst in $( ls namelists ); do
+ [[ ! $( grep \\nlst{$nlst} $files ) ]] && printf '%s ' $nlst
+ done
+
+ echo; echo
+ echo '¤ Vanished index entries in '$model' manual (\{hf,jp,key,mdl,ngn,nlst,np,rou}{...})'
+
+ for file in $files; do
+
+ items=$( grep -Eho "(hf|jp|key|mdl|ngn|nlst|np|rou){[a-zA-Z0-9_\]*}" $file | sort -u )
+
+ if [[ $items == '' ]]; then
+ continue
+ else
+ printf ${file/latex\/*\/subfiles\/}': '
+ fi
+
+ for item in $items; do
+
+ arg=$( echo $item | sed 's/.*{\([^}]*\)}/\1/' | tr -d '\\' )
+
+ if [[ ( $item =~ ^hf && ! $( find ../src -type f -name $arg.h90 ) ) || \
+ ( $item =~ ^jp && ! $( grep ":: *$arg" ../src/OCE/par_oce.F90 ) ) || \
+ ( $item =~ ^key && ! $( grep -ri "#if .* $arg" ../src ) ) || \
+ ( $item =~ ^mdl && ! $( find ../src -type f -name $arg.[Ff]90 ) ) || \
+ ( $item =~ ^ngn && ! $( grep \&$arg namelists/* ) ) || \
+ ( $item =~ ^nlst && ! -f namelists/$arg ) || \
+ ( $item =~ ^np && ! $( grep " $arg *=" namelists/* ) ) || \
+ ( $item =~ ^rou && ! $( grep -ri "SUBROUTINE *$arg" ../src ) ) ]]; then
+ printf $item' '
+ fi
+
+ done
+
+ echo
+
+ done
+
+done
+
+echo
+echo '¤ Namelist parameters unfollowing naming conventions (^[cdlnr]n_* or uppercase somewhere)'
+
+for nlst in $( ls namelists ); do
+ np_list=$( sed '/^ *[!/&]/d; s|[!/&].*||' namelists/$nlst | tr -d ' ' | cut -d= -f1 )
+ array=()
+
+ for np in ${np_list}; do
+
+ if [[ ! ${np:0:3} =~ ^[cdlnr]n_$ || $( echo $np | grep [A-Z] ) ]]; then
+ array+=$np' '
+ fi
+
+ done
+
+ if (( ${#array[@]} != 0 )); then
+ printf '%15s: ' $nlst
+ echo ${array[@]}
+ fi
+
+done
+
+exit 0
Index: /NEMO/trunk/doc/tools/nlsts_releases.sh
===================================================================
--- /NEMO/trunk/doc/tools/nlsts_releases.sh (revision 11004)
+++ /NEMO/trunk/doc/tools/nlsts_releases.sh (revision 11004)
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+## Estimate changes in namelists between two releases
+#####################################################
+
+## Prerequisites: f90nml to parse Fortran namelists (http://f90nml.readthedocs.org)
+## Launch under ./doc, edit the path to previous namelists accordingly
+
+for nlst in ../../releases/release-3.6/DOC/Namelists/*; do
+
+ if [ -f namelists/$( basename $nlst ) ]; then
+ printf "%s: " $( basename $nlst )
+ f90nml namelists/$( basename $nlst ) | awk '/=/ { print $0 }' | sort > nlst_new.txt
+ f90nml $nlst | awk '/=/ { print $0 }' | sort > nlst_old.txt
+
+ if [[ $( diff -q nlst_*.txt ) ]]; then
+ diff -y --suppress-common-lines nlst_*.txt | wc -l
+ else
+ echo 0
+ fi
+
+ fi
+
+done | sort -k2rn
+
+\rm nlst_*.txt
Index: /NEMO/trunk/doc/tools/nlsts_update.sh
===================================================================
--- /NEMO/trunk/doc/tools/nlsts_update.sh (revision 11004)
+++ /NEMO/trunk/doc/tools/nlsts_update.sh (revision 11004)
@@ -0,0 +1,247 @@
+#! /bin/sh
+#
+# usage for NEMO doc to create an update of the Namelists directory :
+# 1- delete the existing directory (You can also choose to save it somewhere)
+# rm -rf Namelists
+# 2- create the updated Namelists directory from the SHARED/namelist_ref :
+# ./namelist_split.sh -i ../NEMOGCM/CONFIG/SHARED/namelist_ref -o Namelists
+#
+# .. _namelist_split.sh:
+#
+# =================
+# namelist_split.sh
+# =================
+#
+# ----------------
+# split a namelist
+# ----------------
+#
+# SYNOPSIS
+# ========
+#
+# .. code-block:: bash
+#
+# namelist_split.sh -i namelist -o dirout [-n]
+#
+# DESCRIPTION
+# ===========
+#
+# Split a namelist file (NEMO convention syntax) given in parameter
+# into files in a given output directory.
+#
+# .. option:: -i
+# .. option:: -o