Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/analyze_output.py
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/analyze_output.py	(revision 13681)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/analyze_output.py	(revision 13682)
@@ -17,9 +17,5 @@
 import math
 import numpy as nmp
-from netCDF4 import Dataset,num2date
-import matplotlib as mpl
-mpl.use('Agg')
-import matplotlib.pyplot as plt
-import matplotlib.dates as mdates
+from netCDF4 import Dataset
 
 l_t_shift = False  ; # because time interp. is set to FALSE into "&namsbc_blk" of NEMO...
@@ -59,4 +55,8 @@
 if narg==4:
     l_more = ( sys.argv[3] in ['m','M'] )
+    import matplotlib as mpl
+    mpl.use('Agg')
+    import matplotlib.pyplot as plt
+
 
 
Index: MO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/context_nemo.xml
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/context_nemo.xml	(revision 13681)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link context_nemo_OCE+ICE.xml
Index: MO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/domain_def_nemo.xml
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/domain_def_nemo.xml	(revision 13681)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../../../cfgs/SHARED/domain_def_nemo.xml
Index: MO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/field_def_nemo-oce.xml
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/field_def_nemo-oce.xml	(revision 13681)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../../../cfgs/SHARED/field_def_nemo-oce.xml
Index: MO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/grid_def_nemo.xml
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/grid_def_nemo.xml	(revision 13681)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../../../cfgs/SHARED/grid_def_nemo.xml
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/launch_sasf.sh
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/launch_sasf.sh	(revision 13681)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/launch_sasf.sh	(revision 13682)
@@ -15,5 +15,5 @@
 
 # Root directory NEMOGCM reference depository where to fetch compiled STATION_ASF nemo.exe + default namelists:
-NEMO_REF_DIR="/home/laurent/DEV/NEMO/NEMOGCM_dev_r13648_ASINTER-04_laurent_bulk_ice"
+NEMO_REF_DIR="`dirname ${PWD} | sed -e 's|/tests/STATION_ASF||g'`" ; # that should normally do the trick!
 
 # NEMOGCM root directory where to fetch compiled STATION_ASF nemo.exe:
@@ -32,6 +32,6 @@
 i_sea_ice=0 ; # default does not compute fluxes over sea-ice
 #
-#NFORC="ERA5_arctic" ; i_sea_ice=1 ; FORC="ERA5_arctic_surface_81N_36p75E_1h" ; # string sufficient to copy relevant files as in "*${FORC}*.nc"
-NFORC="PAPA" ; FORC="Station_PAPA_50N-145W" ; # string sufficient to copy relevant files as in "*${FORC}*.nc"
+NFORC="ERA5_arctic" ; i_sea_ice=1 ; FORC="ERA5_arctic_surface_81N_36p75E_1h" ; # string sufficient to copy relevant files as in "*${FORC}*.nc"
+#NFORC="PAPA" ; FORC="Station_PAPA_50N-145W" ; # string sufficient to copy relevant files as in "*${FORC}*.nc"
 
 
@@ -57,5 +57,5 @@
 i_si3=0
 FCPP="${SASF_WRK_DIR}/cpp_${CONFIG_BLD}.fcm"
-if [ ! -f ${FCPP} ]; then echo " Mhhh, we did not find 'cpp_STATION_ASF.fcm' into `dirname ${FCPP}` !"; exit; fi
+if [ ! -f ${FCPP} ]; then echo " Mhhh, we could not find 'cpp_STATION_ASF.fcm' into `dirname ${FCPP}` !"; exit; fi
 ca=`cat ${FCPP} | grep 'key_si3'`
 
@@ -78,5 +78,5 @@
     LIST_OA_ALGOS="ECMWF" ;          # list of air-sea algorithms to test
     LIST_IA_ALGOS="LG15 LU12 CSTC" ; # list of air-ice algorithms to test
-    DIR_NL=${NFORC}/ice ; # where to fetch the namelists from...
+    DIR_NL=${NFORC}/oce+ice ; # where to fetch the namelists from...
 else
     # Only OPEN-OCEAN/AIR flux computation
@@ -96,5 +96,8 @@
 
 
-if [ ! -d ${DATA_IN_DIR} ]; then echo "PROBLEM!!! => did not find directory 'input_data' with input forcing..."; exit; fi
+CFGS_SHARED="${NEMO_REF_DIR}/cfgs/SHARED"
+if [ ! -d ${CFGS_SHARED} ]; then echo "PROBLEM!!! => could not find directory ${CFGS_SHARED} !"; exit; fi
+
+if [ ! -d ${DATA_IN_DIR} ]; then echo "PROBLEM!!! => could not find directory 'input_data' with input forcing..."; exit; fi
 
 cdt_cmpl="`\ls -l ${NEMO_EXE} | cut -d' ' -f 6,7,8`"
@@ -125,8 +128,10 @@
 ################
 
-list_xml="iodef.xml file_def_nemo-oce.xml field_def_nemo-oce.xml"
+list_xml_ref="field_def_nemo-oce.xml domain_def_nemo.xml grid_def_nemo.xml"
+list_xml_cfg="iodef.xml file_def_nemo-oce.xml"
 fcntxt="context_nemo_OCE.xml"
 if [ ${i_sea_ice} -eq 1 ]; then
-    list_xml+=" file_def_nemo-ice.xml field_def_nemo-ice.xml"
+    list_xml_ref+=" field_def_nemo-ice.xml"
+    list_xml_cfg+=" file_def_nemo-ice.xml"
     fcntxt="context_nemo_OCE+ICE.xml"
 fi
@@ -137,15 +142,11 @@
 
 # All remaining "*.xml" files:
-for ff in ${list_xml} ; do
+for ff in ${list_xml_cfg} ; do
     if [ ! -f ${SASF_EXPREF}/${ff} ]; then echo " Mhhh, ${ff} not found into ${SASF_EXPREF} !"; exit; fi
     rsync -avPL ${SASF_EXPREF}/${ff} ${PROD_DIR}/
 done
-
-
-# Getting reference/defaults files from reference NEMO distro:
-rdir="${NEMO_REF_DIR}/cfgs/SHARED"
-for ff in "domain_def_nemo.xml" "grid_def_nemo.xml"; do
-    if [ ! -f ${rdir}/${ff} ]; then echo " Mhhh, ${ff} not found into ${rdir} !"; exit; fi
-    ln -sf ${rdir}/${ff} ${PROD_DIR}/.
+for ff in ${list_xml_ref} ; do
+    if [ ! -f ${CFGS_SHARED}/${ff} ]; then echo " Mhhh, ${ff} not found into ${CFGS_SHARED} !"; exit; fi
+    rsync -avPL ${CFGS_SHARED}/${ff} ${PROD_DIR}/
 done
 
@@ -186,8 +187,8 @@
         # The namelists:
         rsync -avPL ${SASF_EXPREF}/${DIR_NL}/namelist_${scase}_cfg ${PROD_DIR}/namelist_cfg
-        rsync -avPL ${SASF_EXPREF}/namelist_ref                   ${PROD_DIR}/namelist_ref
+        rsync -avPL ${CFGS_SHARED}/namelist_ref                    ${PROD_DIR}/namelist_ref
         if [ ${i_sea_ice} -eq 1 ]; then
-            rsync -avPL ${SASF_EXPREF}/namelist_ice_ref ${PROD_DIR}/namelist_ice_ref
             rsync -avPL ${SASF_EXPREF}/namelist_ice_cfg ${PROD_DIR}/namelist_ice_cfg
+            rsync -avPL ${CFGS_SHARED}/namelist_ice_ref ${PROD_DIR}/namelist_ice_ref
         fi
         
Index: MO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/namelist_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/namelist_cfg	(revision 13681)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ERA5_arctic/oce+ice/namelist_ecmwf-lg15_cfg
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/namelist_ice_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/namelist_ice_cfg	(revision 13682)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/namelist_ice_cfg	(revision 13682)
@@ -0,0 +1,85 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! SI3 configuration namelist: Overwrites SHARED/namelist_ice_ref
+!!              1 - Generic parameters                 (nampar)
+!!              2 - Ice thickness discretization       (namitd)
+!!              3 - Ice dynamics                       (namdyn)
+!!              4 - Ice ridging/rafting                (namdyn_rdgrft)
+!!              5 - Ice rheology                       (namdyn_rhg)
+!!              6 - Ice advection                      (namdyn_adv)
+!!              7 - Ice surface boundary conditions    (namsbc)
+!!              8 - Ice thermodynamics                 (namthd)
+!!              9 - Ice heat diffusion                 (namthd_zdf)
+!!             10 - Ice lateral melting                (namthd_da)
+!!             11 - Ice growth in open water           (namthd_do)
+!!             12 - Ice salinity                       (namthd_sal)
+!!             13 - Ice melt ponds                     (namthd_pnd)
+!!             14 - Ice initialization                 (namini)
+!!             15 - Ice/snow albedos                   (namalb)
+!!             16 - Ice diagnostics                    (namdia)
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!
+!------------------------------------------------------------------------------
+&nampar         !   Generic parameters
+!------------------------------------------------------------------------------
+   jpl              =   1             !  number of ice  categories
+/
+!------------------------------------------------------------------------------
+&namitd         !   Ice discretization
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdyn         !   Ice dynamics
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdyn_rdgrft  !   Ice ridging/rafting
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdyn_rhg     !   Ice rheology
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdyn_adv     !   Ice advection
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namsbc         !   Ice surface boundary conditions
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd         !   Ice thermodynamics
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_zdf     !   Ice heat diffusion
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_da      !   Ice lateral melting
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_do      !   Ice growth in open water
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_sal     !   Ice salinity
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namthd_pnd     !   Melt ponds
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namini         !   Ice initialization
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namalb         !   albedo parameters
+!------------------------------------------------------------------------------
+/
+!------------------------------------------------------------------------------
+&namdia         !   Diagnostics
+!------------------------------------------------------------------------------
+/
Index: MO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/namelist_ref
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/namelist_ref	(revision 13681)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../../../cfgs/SHARED/namelist_ref
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/sbcblk_sanity_check.sh
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/sbcblk_sanity_check.sh	(revision 13681)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/sbcblk_sanity_check.sh	(revision 13682)
@@ -25,5 +25,5 @@
 
 # Root directory NEMOGCM reference depository where to fetch compiled STATION_ASF nemo.exe + default namelists:
-NEMO_REF_DIR="/home/laurent/DEV/NEMO/NEMOGCM_dev_r13648_ASINTER-04_laurent_bulk_ice"
+NEMO_REF_DIR="`dirname ${PWD} | sed -e 's|/tests/STATION_ASF||g'`" ; # that should normally do the trick!
 
 # NEMOGCM root directory where to fetch compiled STATION_ASF nemo.exe:
@@ -41,5 +41,5 @@
 #############################################################################################
 i_sea_ice=0 ; # default does not compute fluxes over sea-ice
-NFORC="IDEALIZED" ; i_sea_ice=0 ; FORC="input_output_VALIDATION_IDEALIZED.nc"
+NFORC="IDEALIZED" ; i_sea_ice=0 ; FORC="input_output_VALIDATION_IDEALIZED.nc" ; # for now the sanity test does not test ice-atmo bulk parameterizations
 
 
@@ -47,4 +47,17 @@
 
 #================================================================================
+
+# Should the `analyze_output.py` script provide more output ???
+cmore=""
+if [ "$1" != "" ]; then
+    if [ "$1" = "more" ]; then
+        cmore="m"
+    else
+        echo "Only 'more' is accepted as argument for script `basename $0` !"
+        exit
+    fi
+fi
+
+
 
 rm -f SBCBLK.success SBCBLK.fail
@@ -191,5 +204,5 @@
 
 cd ${HERE}
-python3 ./analyze_output.py ${DATA_IN_DIR}/${FORC} ${PROD_DIR}/output
-
-
+python3 ./analyze_output.py ${DATA_IN_DIR}/${FORC} ${PROD_DIR}/output ${cmore}
+
+
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/README.md
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/README.md	(revision 13681)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/README.md	(revision 13682)
@@ -80,11 +80,62 @@
 
 
+## Testing the sanity of the SBCBLK (bulk atmospheric forcing) interface of NEMO
+
+`STATION_ASF` can be used to perform a sanity test of the SBCBLK interface of
+NEMO.  It will test all the bulk-parameterization algorithms using an idealized
+forcing that includes a wide range of *SSX / surface atmospheric state*
+conditions to detect potential error / inconsitencies.  Both a short report and
+boolean output: *passed* or *failed* is provided as an output.
+
+First compile the `STATION_ASF` test-case as follows (compile with xios-2.5 support → check your ARCH file):
+    
+```./makenemo -a STATION_ASF -m <your_arch> -n STATION_ASF2 -j 4```
+
+(successfull compilation generates ```tests/STATION_ASF2/BLD/bin/nemo.exe```
+
+Move to: ```tests/STATION_ASF/EXPREF/```
+
+There, in script ``sbcblk_sanity_check.sh``, double check that the variables given a value in the first lines are consistent with your setup (it should).
+
+Launch the script:
+
+    $ ./sbcblk_sanity_check.sh
+
+
+The report is both interactively shown in the standard output and spwaned in the report file:
+
+- `SBCBLK.success` the test passed :)
+- `SBCBLK.fail` the test failed :(
+
+In case of failure, read the rapport to know which algorithm/computed variables did not pass the test... You should also re-run the script ``sbcblk_sanity_check.sh`` with the "more" argument: 
+
+    $ ./sbcblk_sanity_check.sh more
+
+ This will generate more output such as figure of time series for the tested variables.
+
+### Dependencies
+
+In order for the python script `analyze_output.py` to work, you need `Python 3` with the following modules:
+- numpy
+- netCDF4
+- (matplotlib)
+
+
+
+
+
+
 ## Playing with STATION_ASF
 
 First compile the test-case as follows (compile with xios-2.5 support → check your ARCH file):
-
+    
 ```./makenemo -a STATION_ASF -m <your_arch> -n STATION_ASF2 -j 4```
 
-Then you can use the script ``launch_sasf.sh`` found in  ```EXPREF/``` to launch 3 simulations (one for each bulk parameterization available). You need to adapt the following variable to your environment in the script:
+Move to: ```tests/STATION_ASF/EXPREF/```
+
+
+
+
+to launch 3 simulations (one for each bulk parameterization available). You need to adapt the following variable to your environment in the script:
 
 - ```NEMO_ROOT_DIR``` : NEMO root directory where to fetch compiled STATION_ASF ```nemo.exe``` + setup (such as ```${NEMO_ROOT_DIR}/tests/STATION_ASF```)
