Index: NEMO/trunk/src/OCE/IOM/in_out_manager.F90
===================================================================
--- NEMO/trunk/src/OCE/IOM/in_out_manager.F90	(revision 11536)
+++ NEMO/trunk/src/OCE/IOM/in_out_manager.F90	(revision 12377)
@@ -87,8 +87,11 @@
    LOGICAL ::   lrst_oce              !: logical to control the oce restart write 
    LOGICAL ::   lrst_ice              !: logical to control the ice restart write 
+   LOGICAL ::   lrst_abl              !: logical to control the abl restart write 
    INTEGER ::   numror = 0            !: logical unit for ocean restart (read). Init to 0 is needed for SAS (in daymod.F90)
    INTEGER ::   numrir                !: logical unit for ice   restart (read)
+   INTEGER ::   numrar                !: logical unit for abl   restart (read)
    INTEGER ::   numrow                !: logical unit for ocean restart (write)
    INTEGER ::   numriw                !: logical unit for ice   restart (write)
+   INTEGER ::   numraw                !: logical unit for abl   restart (write)
    INTEGER ::   nrst_lst              !: number of restart to output next
 
@@ -96,16 +99,22 @@
    !!                    output monitoring
    !!----------------------------------------------------------------------
-   LOGICAL ::   ln_ctl           !: run control for debugging
-   TYPE :: sn_ctl                !: optional use structure for finer control over output selection
+   TYPE :: sn_ctl                !: structure for control over output selection
+      LOGICAL :: l_glochk  = .FALSE.  !: range sanity checks are local (F) or global (T)
+                                      !  Use global setting for debugging only;
+                                      !  local breaches will still be reported
+                                      !  and stop the code in most cases.
+      LOGICAL :: l_allon   = .FALSE.  !: overall control; activate all following output options
       LOGICAL :: l_config  = .FALSE.  !: activate/deactivate finer control
-                                      !  Note if l_config is True then ln_ctl is ignored.
-                                      !  Otherwise setting ln_ctl True is equivalent to setting
-                                      !  all the following logicals in this structure True
+                                      !  Note if l_config is True then sn_cfctl%l_allon is ignored.
+                                      !  Otherwise setting sn_cfctl%l_allon T/F is equivalent to 
+                                      !  setting all the following logicals in this structure T/F
+                                      !  and disabling subsetting of processors
       LOGICAL :: l_runstat = .FALSE.  !: Produce/do not produce run.stat file (T/F)
       LOGICAL :: l_trcstat = .FALSE.  !: Produce/do not produce tracer.stat file (T/F)
       LOGICAL :: l_oceout  = .FALSE.  !: Produce all ocean.outputs    (T) or just one (F)
       LOGICAL :: l_layout  = .FALSE.  !: Produce all layout.dat files (T) or just one (F)
-      LOGICAL :: l_mppout  = .FALSE.  !: Produce/do not produce mpp.output_XXXX files (T/F)
-      LOGICAL :: l_mpptop  = .FALSE.  !: Produce/do not produce mpp.top.output_XXXX files (T/F)
+      LOGICAL :: l_prtctl  = .FALSE.  !: Produce/do not produce mpp.output_XXXX files (T/F)
+      LOGICAL :: l_prttrc  = .FALSE.  !: Produce/do not produce mpp.top.output_XXXX files (T/F)
+      LOGICAL :: l_oasout  = .FALSE.  !: Produce/do not write oasis setup info to ocean.output (T/F)
                                       !  Optional subsetting of processor report files
                                       !  Default settings of 0/1000000/1 should ensure all areas report.
@@ -139,18 +148,19 @@
    INTEGER ::   numnul          =   -1      !: logical unit for /dev/null
       !                                     !  early output can be collected; do not change
-   INTEGER ::   numnam_ref      =   -1      !: logical unit for reference namelist
-   INTEGER ::   numnam_cfg      =   -1      !: logical unit for configuration specific namelist
    INTEGER ::   numond          =   -1      !: logical unit for Output Namelist Dynamics
-   INTEGER ::   numnam_ice_ref  =   -1      !: logical unit for ice reference namelist
-   INTEGER ::   numnam_ice_cfg  =   -1      !: logical unit for ice reference namelist
    INTEGER ::   numoni          =   -1      !: logical unit for Output Namelist Ice
    INTEGER ::   numevo_ice      =   -1      !: logical unit for ice variables (temp. evolution)
    INTEGER ::   numrun          =   -1      !: logical unit for run statistics
    INTEGER ::   numdct_in       =   -1      !: logical unit for transports computing
-   INTEGER ::   numdct_vol      =   -1      !: logical unit for voulume transports output
-   INTEGER ::   numdct_heat     =   -1      !: logical unit for heat    transports output
-   INTEGER ::   numdct_salt     =   -1      !: logical unit for salt    transports output
+   INTEGER ::   numdct_vol      =   -1      !: logical unit for volume transports output
+   INTEGER ::   numdct_heat     =   -1      !: logical unit for heat   transports output
+   INTEGER ::   numdct_salt     =   -1      !: logical unit for salt   transports output
    INTEGER ::   numfl           =   -1      !: logical unit for floats ascii output
    INTEGER ::   numflo          =   -1      !: logical unit for floats ascii output
+      !
+   CHARACTER(LEN=:), ALLOCATABLE :: numnam_ref      !: character buffer for reference namelist
+   CHARACTER(LEN=:), ALLOCATABLE :: numnam_cfg      !: character buffer for configuration specific namelist
+   CHARACTER(LEN=:), ALLOCATABLE :: numnam_ice_ref  !: character buffer for ice reference namelist
+   CHARACTER(LEN=:), ALLOCATABLE :: numnam_ice_cfg  !: character buffer for ice configuration specific namelist
 
    !!----------------------------------------------------------------------
@@ -165,5 +175,5 @@
    CHARACTER(lc) ::   ctmp10                !: temporary character 10
    LOGICAL       ::   lwm      = .FALSE.    !: boolean : true on the 1st processor only (always)
-   LOGICAL       ::   lwp      = .FALSE.    !: boolean : true on the 1st processor only .OR. ln_ctl
+   LOGICAL       ::   lwp      = .FALSE.    !: boolean : true on the 1st processor only .OR. sn_cfctl%l_oceout=T
    LOGICAL       ::   lsp_area = .TRUE.     !: to make a control print over a specific area
    CHARACTER(lc) ::   cxios_context         !: context name used in xios
@@ -171,4 +181,6 @@
    CHARACTER(lc) ::   cwxios_context        !: context name used in xios to write restart file
 
+   !! * Substitutions
+#  include "do_loop_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
