Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/cfgs/SHARED/namelist_ref
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/cfgs/SHARED/namelist_ref	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/cfgs/SHARED/namelist_ref	(revision 13806)
@@ -280,5 +280,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !!   
    ! Sea-ice specific: (IF: nn_ice >=1 )
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/IOM/iom.F90
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/IOM/iom.F90	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/IOM/iom.F90	(revision 13806)
@@ -7,5 +7,5 @@
    !!            2.0  ! 2006-02  (S. Masson) Adaptation to NEMO
    !!            3.0  ! 2007-07  (D. Storkey) Changes to iom_gettime
-   !!            3.4  ! 2012-12  (R. Bourdalle-Badie and G. Reffray)  add C1D case  
+   !!            3.4  ! 2012-12  (R. Bourdalle-Badie and G. Reffray)  add C1D case
    !!            3.6  ! 2014-15  DIMG format removed
    !!            3.6  ! 2015-15  (J. Harle) Added procedure to read REAL attributes
@@ -21,5 +21,5 @@
    !!----------------------------------------------------------------------
    USE dom_oce         ! ocean space and time domain
-   USE domutl          ! 
+   USE domutl          !
    USE c1d             ! 1D vertical configuration
    USE flo_oce         ! floats module declarations
@@ -44,10 +44,10 @@
    USE trc, ONLY    :  profsed
 #endif
-   USE lib_fortran 
+   USE lib_fortran
    USE diu_bulk, ONLY : ln_diurnal_only, ln_diurnal
 
    IMPLICIT NONE
    PUBLIC   !   must be public to be able to access iom_def through iom
-   
+
 #if defined key_iomput
    LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .TRUE.        !: iom_put flag
@@ -91,5 +91,5 @@
       MODULE PROCEDURE iom_p0d_dp, iom_p1d_dp, iom_p2d_dp, iom_p3d_dp, iom_p4d_dp
    END INTERFACE iom_put
-  
+
    !! * Substitutions
 #  include "do_loop_substitute.h90"
@@ -101,9 +101,9 @@
 CONTAINS
 
-   SUBROUTINE iom_init( cdname, fname, ld_closedef ) 
+   SUBROUTINE iom_init( cdname, fname, ld_closedef )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE   ***
       !!
-      !! ** Purpose :   
+      !! ** Purpose :
       !!
       !!----------------------------------------------------------------------
@@ -136,5 +136,5 @@
       llrst_context =  (TRIM(cdname) == TRIM(crxios_context) .OR. TRIM(cdname) == TRIM(cwxios_context))
 
-      ! Calendar type is now defined in xml file 
+      ! Calendar type is now defined in xml file
       IF (.NOT.(xios_getvar('ref_year' ,irefyear ))) irefyear  = 1900
       IF (.NOT.(xios_getvar('ref_month',irefmonth))) irefmonth = 01
@@ -153,6 +153,6 @@
       IF(.NOT.llrst_context) CALL set_scalar
       !
-      IF( TRIM(cdname) == TRIM(cxios_context) ) THEN  
-         CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. ) 
+      IF( TRIM(cdname) == TRIM(cxios_context) ) THEN
+         CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. )
          CALL set_grid( "U", glamu, gphiu, .FALSE., .FALSE. )
          CALL set_grid( "V", glamv, gphiv, .FALSE., .FALSE. )
@@ -172,11 +172,11 @@
       ENDIF
       !
-      IF( TRIM(cdname) == TRIM(cxios_context)//"_crs" ) THEN  
+      IF( TRIM(cdname) == TRIM(cxios_context)//"_crs" ) THEN
          CALL dom_grid_crs   ! Save the parent grid information  & Switch to coarse grid domain
          !
-         CALL set_grid( "T", glamt_crs, gphit_crs, .FALSE., .FALSE. ) 
-         CALL set_grid( "U", glamu_crs, gphiu_crs, .FALSE., .FALSE. ) 
-         CALL set_grid( "V", glamv_crs, gphiv_crs, .FALSE., .FALSE. ) 
-         CALL set_grid( "W", glamt_crs, gphit_crs, .FALSE., .FALSE. ) 
+         CALL set_grid( "T", glamt_crs, gphit_crs, .FALSE., .FALSE. )
+         CALL set_grid( "U", glamu_crs, gphiu_crs, .FALSE., .FALSE. )
+         CALL set_grid( "V", glamv_crs, gphiv_crs, .FALSE., .FALSE. )
+         CALL set_grid( "W", glamt_crs, gphit_crs, .FALSE., .FALSE. )
          CALL set_grid_znl( gphit_crs )
           !
@@ -203,5 +203,5 @@
 
           ! ABL
-          IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios) 
+          IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios)
              ALLOCATE( ght_abl(jpka), ghw_abl(jpka), e3t_abl(jpka), e3w_abl(jpka) )   ! default allocation needed by iom
              ght_abl(:) = -1._wp   ;   ghw_abl(:) = -1._wp
@@ -210,5 +210,5 @@
           CALL iom_set_axis_attr( "ght_abl", ght_abl(2:jpka) )
           CALL iom_set_axis_attr( "ghw_abl", ghw_abl(2:jpka) )
-          
+
           ! Add vertical grid bounds
           zt_bnds(2,:      ) = gdept_1d(:)
@@ -302,5 +302,5 @@
       !!                   ***  SUBROUTINE  iom_set_rstw_var_active  ***
       !!
-      !! ** Purpose :  enable variable in restart file when writing with XIOS 
+      !! ** Purpose :  enable variable in restart file when writing with XIOS
       !!---------------------------------------------------------------------
    CHARACTER(len = *), INTENT(IN) :: field
@@ -313,5 +313,5 @@
 
    DO i = 1, max_rst_fields
-       IF(TRIM(rst_wfields(i)%vname) == field) THEN 
+       IF(TRIM(rst_wfields(i)%vname) == field) THEN
           rst_wfields(i)%active = .TRUE.
           llis_set = .TRUE.
@@ -321,5 +321,5 @@
 !Warn if variable is not in defined in rst_wfields
    IF(.NOT.llis_set) THEN
-      WRITE(ctmp1,*) 'iom_set_rstw_var_active: variable ', field ,' is available for writing but not defined' 
+      WRITE(ctmp1,*) 'iom_set_rstw_var_active: variable ', field ,' is available for writing but not defined'
       CALL ctl_stop( 'iom_set_rstw_var_active:', ctmp1 )
    ENDIF
@@ -336,5 +336,5 @@
       !!
       !! ** Purpose :  define file name in XIOS context for reading restart file,
-      !!               enable variables present in restart file for reading with XIOS 
+      !!               enable variables present in restart file for reading with XIOS
       !!---------------------------------------------------------------------
 
@@ -374,5 +374,5 @@
                  CASE ("grid_N")
                     CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), &
-                        domain_ref="grid_N", operation = "instant") 
+                        domain_ref="grid_N", operation = "instant")
                 CASE ("grid_vector")
                     CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), &
@@ -393,5 +393,5 @@
       !!                   ***  SUBROUTINE  iom_set_rstw_core  ***
       !!
-      !! ** Purpose :  set variables which are always in restart file 
+      !! ** Purpose :  set variables which are always in restart file
       !!---------------------------------------------------------------------
    CHARACTER (len=*), INTENT (IN) :: cdmdl ! model OPA or SAS
@@ -430,6 +430,6 @@
       !!                   ***  SUBROUTINE iom_set_rst_vars   ***
       !!
-      !! ** Purpose :  Fill array fields with the information about all 
-      !!               possible variables and corresponding grids definition 
+      !! ** Purpose :  Fill array fields with the information about all
+      !!               possible variables and corresponding grids definition
       !!               for reading/writing restart with XIOS
       !!---------------------------------------------------------------------
@@ -442,5 +442,5 @@
         i = i + 1; fields(i)%vname="ub";             fields(i)%grid="grid_N_3D"
         i = i + 1; fields(i)%vname="vn";             fields(i)%grid="grid_N_3D"
-        i = i + 1; fields(i)%vname="vb";             fields(i)%grid="grid_N_3D"  
+        i = i + 1; fields(i)%vname="vb";             fields(i)%grid="grid_N_3D"
         i = i + 1; fields(i)%vname="tn";             fields(i)%grid="grid_N_3D"
         i = i + 1; fields(i)%vname="tb";             fields(i)%grid="grid_N_3D"
@@ -458,5 +458,5 @@
         i = i + 1; fields(i)%vname="emp_b";          fields(i)%grid="grid_N"
         i = i + 1; fields(i)%vname="sfx_b";          fields(i)%grid="grid_N"
-        i = i + 1; fields(i)%vname="en" ;            fields(i)%grid="grid_N_3D" 
+        i = i + 1; fields(i)%vname="en" ;            fields(i)%grid="grid_N_3D"
         i = i + 1; fields(i)%vname="avt_k";            fields(i)%grid="grid_N_3D"
         i = i + 1; fields(i)%vname="avm_k";            fields(i)%grid="grid_N_3D"
@@ -565,13 +565,13 @@
         CALL xios_get_handle("file_definition", filegroup_hdl )
         CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart')
-        IF(nxioso.eq.1) THEN 
-           CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 
-                                    mode="write", output_freq=xios_timestep) 
-           if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 
-        ELSE  
-           CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 
-                                    mode="write", output_freq=xios_timestep) 
-           if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 
-        ENDIF 
+        IF(nxioso.eq.1) THEN
+           CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,&
+                                    mode="write", output_freq=xios_timestep)
+           if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode'
+        ELSE
+           CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,&
+                                    mode="write", output_freq=xios_timestep)
+           if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode'
+        ENDIF
         CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file))
 !define fields for restart context
@@ -585,5 +585,5 @@
                  CASE ("grid_N")
                     CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), &
-                        domain_ref="grid_N", prec = 8, operation = "instant") 
+                        domain_ref="grid_N", prec = 8, operation = "instant")
                  CASE ("grid_vector")
                     CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), &
@@ -598,36 +598,36 @@
    END SUBROUTINE iom_set_rstw_active
 
-   SUBROUTINE iom_set_rst_context(ld_rstr) 
+   SUBROUTINE iom_set_rst_context(ld_rstr)
      !!---------------------------------------------------------------------
       !!                   ***  SUBROUTINE  iom_set_rst_context  ***
       !!
-      !! ** Purpose : Define domain, axis and grid for restart (read/write) 
-      !!              context 
-      !!               
+      !! ** Purpose : Define domain, axis and grid for restart (read/write)
+      !!              context
+      !!
       !!---------------------------------------------------------------------
    LOGICAL, INTENT(IN)               :: ld_rstr
-!ld_rstr is true for restart context. There is no need to define grid for 
+!ld_rstr is true for restart context. There is no need to define grid for
 !restart read, because it's read from file
 #if defined key_iomput
-   TYPE(xios_domaingroup)            :: domaingroup_hdl 
-   TYPE(xios_domain)                 :: domain_hdl 
-   TYPE(xios_axisgroup)              :: axisgroup_hdl 
-   TYPE(xios_axis)                   :: axis_hdl 
-   TYPE(xios_scalar)                 :: scalar_hdl 
-   TYPE(xios_scalargroup)            :: scalargroup_hdl 
-
-     CALL xios_get_handle("domain_definition",domaingroup_hdl) 
-     CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N") 
-     CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr) 
- 
-     CALL xios_get_handle("axis_definition",axisgroup_hdl) 
-     CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev") 
+   TYPE(xios_domaingroup)            :: domaingroup_hdl
+   TYPE(xios_domain)                 :: domain_hdl
+   TYPE(xios_axisgroup)              :: axisgroup_hdl
+   TYPE(xios_axis)                   :: axis_hdl
+   TYPE(xios_scalar)                 :: scalar_hdl
+   TYPE(xios_scalargroup)            :: scalargroup_hdl
+
+     CALL xios_get_handle("domain_definition",domaingroup_hdl)
+     CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N")
+     CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr)
+
+     CALL xios_get_handle("axis_definition",axisgroup_hdl)
+     CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev")
 !AGRIF fails to compile when unit= is in call to xios_set_axis_attr
-!    CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down") 
+!    CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down")
      CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels in meters", positive="down")
-     CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d ) 
-
-     CALL xios_get_handle("scalar_definition", scalargroup_hdl) 
-     CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") 
+     CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d )
+
+     CALL xios_get_handle("scalar_definition", scalargroup_hdl)
+     CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar")
 #endif
    END SUBROUTINE iom_set_rst_context
@@ -671,8 +671,8 @@
       CHARACTER(LEN=256)    ::   clname    ! the name of the file based on cdname [[+clcpu]+clcpu]
       CHARACTER(LEN=256)    ::   cltmpn    ! tempory name to store clname (in writting mode)
-      CHARACTER(LEN=10)     ::   clsuffix  ! ".nc" 
+      CHARACTER(LEN=10)     ::   clsuffix  ! ".nc"
       CHARACTER(LEN=15)     ::   clcpu     ! the cpu number (max jpmax_digits digits)
       CHARACTER(LEN=256)    ::   clinfo    ! info character
-      LOGICAL               ::   llok      ! check the existence 
+      LOGICAL               ::   llok      ! check the existence
       LOGICAL               ::   llwrt     ! local definition of ldwrt
       LOGICAL               ::   llstop    ! local definition of ldstop
@@ -680,5 +680,5 @@
       INTEGER               ::   icnt      ! counter for digits in clcpu (max = jpmax_digits)
       INTEGER               ::   iln, ils  ! lengths of character
-      INTEGER               ::   istop     ! 
+      INTEGER               ::   istop     !
       ! local number of points for x,y dimensions
       ! position of first local point for x,y dimensions
@@ -716,5 +716,5 @@
       clname   = trim(cdname)
       IF ( .NOT. Agrif_Root() .AND. .NOT. lliof ) THEN
-         iln    = INDEX(clname,'/') 
+         iln    = INDEX(clname,'/')
          cltmpn = clname(1:iln)
          clname = clname(iln+1:LEN_TRIM(clname))
@@ -740,5 +740,5 @@
          clname = clname(1:iln-1)//'_'//TRIM(clcpu)//TRIM(clsuffix)
          icnt = 0
-         INQUIRE( FILE = clname, EXIST = llok ) 
+         INQUIRE( FILE = clname, EXIST = llok )
          ! we try different formats for the cpu number by adding 0
          DO WHILE( .NOT.llok .AND. icnt < jpmax_digits )
@@ -758,16 +758,16 @@
       ! if no file was found...
       IF( .NOT. llok ) THEN
-         IF( .NOT. llwrt ) THEN   ! we are in read mode 
+         IF( .NOT. llwrt ) THEN   ! we are in read mode
             IF( llstop ) THEN   ;   CALL ctl_stop( TRIM(clinfo), 'File '//TRIM(cltmpn)//'* not found' )
             ELSE                ;   istop = nstop + 1   ! make sure that istop /= nstop so we don't open the file
             ENDIF
-         ELSE                     ! we are in write mode so we 
+         ELSE                     ! we are in write mode so we
             clname = cltmpn       ! get back the file name without the cpu number
          ENDIF
       ELSE
-         IF( llwrt .AND. .NOT. ln_clobber ) THEN   ! we stop as we want to write in a new file 
+         IF( llwrt .AND. .NOT. ln_clobber ) THEN   ! we stop as we want to write in a new file
             CALL ctl_stop( TRIM(clinfo), 'We want to write in a new file but '//TRIM(clname)//' already exists...' )
             istop = nstop + 1                      ! make sure that istop /= nstop so we don't open the file
-         ELSEIF( llwrt ) THEN     ! the file exists and we are in write mode with permission to 
+         ELSEIF( llwrt ) THEN     ! the file exists and we are in write mode with permission to
             clname = cltmpn       ! overwrite so get back the file name without the cpu number
          ENDIF
@@ -810,5 +810,5 @@
             IF( iom_file(jf)%nfid > 0 ) THEN
                CALL iom_nf90_close( jf )
-               iom_file(jf)%nfid       = 0          ! free the id 
+               iom_file(jf)%nfid       = 0          ! free the id
                IF( PRESENT(kiomid) )   kiomid = 0   ! return 0 as id to specify that the file was closed
                IF(lwp) WRITE(numout,*) TRIM(clinfo)//' close file: '//TRIM(iom_file(jf)%name)//' ok'
@@ -819,9 +819,9 @@
          END DO
       ENDIF
-      !    
+      !
    END SUBROUTINE iom_close
 
 
-   FUNCTION iom_varid ( kiomid, cdvar, kdimsz, kndims, lduld, ldstop )  
+   FUNCTION iom_varid ( kiomid, cdvar, kdimsz, kndims, lduld, ldstop )
       !!-----------------------------------------------------------------------
       !!                  ***  FUNCTION  iom_varid  ***
@@ -849,5 +849,5 @@
       IF( kiomid > 0 ) THEN
          clinfo = 'iom_varid, file: '//trim(iom_file(kiomid)%name)//', var: '//trim(cdvar)
-         IF( iom_file(kiomid)%nfid == 0 ) THEN 
+         IF( iom_file(kiomid)%nfid == 0 ) THEN
             CALL ctl_stop( trim(clinfo), 'the file is not open' )
          ELSE
@@ -868,8 +868,8 @@
                         &                      'increase the parameter jpmax_vars')
                ENDIF
-               IF( llstop .AND. iom_varid == -1 )   CALL ctl_stop( TRIM(clinfo)//' not found' ) 
+               IF( llstop .AND. iom_varid == -1 )   CALL ctl_stop( TRIM(clinfo)//' not found' )
             ELSE
                iom_varid = iiv
-               IF( PRESENT(kdimsz) ) THEN 
+               IF( PRESENT(kdimsz) ) THEN
                   i_nvd = iom_file(kiomid)%ndims(iiv)
                   IF( i_nvd <= size(kdimsz) ) THEN
@@ -1001,5 +1001,5 @@
       REAL(dp)        , ALLOCATABLE  , DIMENSION(:)           ::   ztmp_pvar ! tmp var to read field
       INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number
-      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis
       LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
@@ -1024,5 +1024,5 @@
       REAL(dp)        , INTENT(  out), DIMENSION(:)           ::   pvar      ! read field
       INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number
-      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis
       LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
@@ -1045,5 +1045,5 @@
       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold
       INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis
       LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
@@ -1070,5 +1070,5 @@
       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold
       INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis
       LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
@@ -1091,5 +1091,5 @@
       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold
       INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis
       LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
@@ -1116,5 +1116,5 @@
       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold
       INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
+      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading
       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis
       LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS
@@ -1150,5 +1150,5 @@
       REAL(dp)                   , INTENT(in   ), OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold
       INTEGER                    , INTENT(in   ), OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk
-      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis 
+      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis
       INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kcount    ! number of points to be read in each axis
       LOGICAL                    , INTENT(in   ), OPTIONAL ::   ldxios    ! use XIOS to read restart
@@ -1156,17 +1156,17 @@
       LOGICAL                        ::   llok        ! true if ok!
       LOGICAL                        ::   llxios      ! local definition for XIOS read
-      INTEGER                        ::   jl          ! loop on number of dimension 
+      INTEGER                        ::   jl          ! loop on number of dimension
       INTEGER                        ::   idom        ! type of domain
       INTEGER                        ::   idvar       ! id of the variable
       INTEGER                        ::   inbdim      ! number of dimensions of the variable
-      INTEGER                        ::   idmspc      ! number of spatial dimensions 
+      INTEGER                        ::   idmspc      ! number of spatial dimensions
       INTEGER                        ::   itime       ! record number
       INTEGER                        ::   istop       ! temporary value of nstop
       INTEGER                        ::   ix1, ix2, iy1, iy2   ! subdomain indexes
       INTEGER                        ::   ji, jj      ! loop counters
-      INTEGER                        ::   irankpv     ! 
+      INTEGER                        ::   irankpv     !
       INTEGER                        ::   ind1, ind2  ! substring index
       INTEGER, DIMENSION(jpmax_dims) ::   istart      ! starting point to read for each axis
-      INTEGER, DIMENSION(jpmax_dims) ::   icnt        ! number of value to read along each axis 
+      INTEGER, DIMENSION(jpmax_dims) ::   icnt        ! number of value to read along each axis
       INTEGER, DIMENSION(jpmax_dims) ::   idimsz      ! size of the dimensions of the variable
       INTEGER, DIMENSION(jpmax_dims) ::   ishape      ! size of the dimensions of the variable
@@ -1176,5 +1176,5 @@
       CHARACTER(LEN=256)             ::   clinfo      ! info character
       CHARACTER(LEN=256)             ::   clname      ! file name
-      CHARACTER(LEN=1)               ::   clrankpv, cldmspc      ! 
+      CHARACTER(LEN=1)               ::   clrankpv, cldmspc      !
       CHARACTER(LEN=1)               ::   cl_type     ! local value of cd_type
       LOGICAL                        ::   ll_only3rd  ! T => if kstart, kcount present then *only* use values for 3rd spatial dimension.
@@ -1205,5 +1205,5 @@
          ! Search for the variable in the data base (eventually actualize data)
          !
-         idvar = iom_varid( kiomid, cdvar ) 
+         idvar = iom_varid( kiomid, cdvar )
          IF( idvar > 0 ) THEN
             !
@@ -1212,8 +1212,8 @@
             idmspc = inbdim                                   ! number of spatial dimensions in the file
             IF( iom_file(kiomid)%luld(idvar) )   idmspc = inbdim - 1
-            IF( idmspc > 3 )   CALL ctl_stop(trim(clinfo), 'the file has more than 3 spatial dimensions this case is not coded...') 
+            IF( idmspc > 3 )   CALL ctl_stop(trim(clinfo), 'the file has more than 3 spatial dimensions this case is not coded...')
             !
             ! Identify the domain in case of jpdom_auto definition
-            IF( idom == jpdom_auto .OR. idom == jpdom_auto_xy ) THEN            
+            IF( idom == jpdom_auto .OR. idom == jpdom_auto_xy ) THEN
                idom = jpdom_global   ! default
                ! else: if the file name finishes with _xxxx.nc with xxxx any number
@@ -1252,5 +1252,5 @@
                      CALL ctl_warn( trim(clinfo), '2D array input but 3 spatial dimensions in the file...'              ,   &
                            &         'As the size of the z dimension is 1 and as we try to read the first record, ',   &
-                           &         'we accept this case, even if there is a possible mix-up between z and time dimension' )   
+                           &         'we accept this case, even if there is a possible mix-up between z and time dimension' )
                      idmspc = idmspc - 1
                   !!GS: possibility to read 3D ABL atmopsheric forcing and use 1st level to force BULK simulation
@@ -1264,11 +1264,11 @@
             ! definition of istart and icnt
             !
-            icnt  (:) = 1              ! default definition (simple way to deal with special cases listed above) 
-            istart(:) = 1              ! default definition (simple way to deal with special cases listed above) 
+            icnt  (:) = 1              ! default definition (simple way to deal with special cases listed above)
+            istart(:) = 1              ! default definition (simple way to deal with special cases listed above)
             istart(idmspc+1) = itime   ! temporal dimenstion
             !
             IF( idom == jpdom_unknown ) THEN
-               IF( PRESENT(kstart) .AND. idom /= jpdom_auto_xy ) THEN 
-                  istart(1:idmspc) = kstart(1:idmspc) 
+               IF( PRESENT(kstart) .AND. idom /= jpdom_auto_xy ) THEN
+                  istart(1:idmspc) = kstart(1:idmspc)
                   icnt  (1:idmspc) = kcount(1:idmspc)
                ELSE
@@ -1276,5 +1276,5 @@
                ENDIF
             ELSE   !   not a 1D array as pv_r1d requires jpdom_unknown
-               ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0 
+               ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0
                IF( idom == jpdom_global )   istart(1:2) = (/ mig0(Nis0), mjg0(Njs0) /)
                icnt(1:2) = (/ Ni_0, Nj_0 /)
@@ -1296,10 +1296,10 @@
                   WRITE( ctmp1, FMT="('(istart(', i1, ') + icnt(', i1, ') - 1) = ', i5)" ) jl, jl, itmp
                   WRITE( ctmp2, FMT="(' is larger than idimsz(', i1,') = ', i5)"         ) jl, idimsz(jl)
-                  CALL ctl_stop( trim(clinfo), 'start and count too big regarding to the size of the data, ', ctmp1, ctmp2 )     
+                  CALL ctl_stop( trim(clinfo), 'start and count too big regarding to the size of the data, ', ctmp1, ctmp2 )
                ENDIF
             END DO
             !
             ! check that icnt matches the input array
-            !-     
+            !-
             IF( idom == jpdom_unknown ) THEN
                IF( irankpv == 1 )        ishape(1:1) = SHAPE(pv_r1d)
@@ -1311,8 +1311,8 @@
                   ishape(1:2) = SHAPE(pv_r2d(Nis0:Nie0,Njs0:Nje0  ))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0)'
                ENDIF
-               IF( irankpv == 3 ) THEN 
+               IF( irankpv == 3 ) THEN
                   ishape(1:3) = SHAPE(pv_r3d(Nis0:Nie0,Njs0:Nje0,:))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0,:)'
                ENDIF
-            ENDIF         
+            ENDIF
             DO jl = 1, irankpv
                WRITE( ctmp2, FMT="(', ', i1,'): ', i5,' /= icnt(', i1,'):', i5)" ) jl, ishape(jl), jl, icnt(jl)
@@ -1323,5 +1323,5 @@
 
          ! read the data
-         !-     
+         !-
          IF( idvar > 0 .AND. istop == nstop ) THEN   ! no additional errors until this point...
             !
@@ -1330,5 +1330,5 @@
             ELSE                               ;   ix1 = 1      ;   ix2 = icnt(1)   ;   iy1 = 1      ;   iy2 = icnt(2)
             ENDIF
-      
+
             CALL iom_nf90_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, pv_r1d, pv_r2d, pv_r3d )
 
@@ -1359,5 +1359,5 @@
 #if defined key_iomput
 !would be good to be able to check which context is active and swap only if current is not restart
-         CALL iom_swap( TRIM(crxios_context) ) 
+         CALL iom_swap( TRIM(crxios_context) )
          IF( PRESENT(pv_r3d) ) THEN
             IF(lwp) WRITE(numout,*) 'XIOS RST READ (3D): ',TRIM(cdvar)
@@ -1374,5 +1374,5 @@
          CALL iom_swap( TRIM(cxios_context) )
 #else
-         istop = istop + 1 
+         istop = istop + 1
          clinfo = 'Can not use XIOS in iom_get_123d, file: '//trim(clname)//', var:'//trim(cdvar)
 #endif
@@ -1387,5 +1387,5 @@
       zofs = iom_file(kiomid)%ofs(idvar)      ! offset
       IF(     PRESENT(pv_r1d) ) THEN
-         IF( zscf /= 1. )   pv_r1d(:) = pv_r1d(:) * zscf 
+         IF( zscf /= 1. )   pv_r1d(:) = pv_r1d(:) * zscf
          IF( zofs /= 0. )   pv_r1d(:) = pv_r1d(:) + zofs
       ELSEIF( PRESENT(pv_r2d) ) THEN
@@ -1401,5 +1401,5 @@
    SUBROUTINE iom_get_var( cdname, z2d)
       CHARACTER(LEN=*), INTENT(in ) ::   cdname
-      REAL(wp), DIMENSION(jpi,jpj) ::   z2d 
+      REAL(wp), DIMENSION(jpi,jpj) ::   z2d
 #if defined key_iomput
       IF( xios_field_is_active( cdname, at_current_timestep_arg = .TRUE. ) ) THEN
@@ -1413,5 +1413,5 @@
 
 
-   FUNCTION iom_getszuld ( kiomid )  
+   FUNCTION iom_getszuld ( kiomid )
       !!-----------------------------------------------------------------------
       !!                  ***  FUNCTION  iom_getszuld  ***
@@ -1429,5 +1429,5 @@
       ENDIF
    END FUNCTION iom_getszuld
-   
+
 
    !!----------------------------------------------------------------------
@@ -1493,5 +1493,5 @@
       ENDIF
    END SUBROUTINE iom_g1d_ratt
-   
+
    SUBROUTINE iom_g0d_catt( kiomid, cdatt, cdatt0d, cdvar )
       INTEGER               , INTENT(in   )           ::   kiomid    ! Identifier of the file
@@ -1552,5 +1552,5 @@
       ENDIF
    END SUBROUTINE iom_p1d_ratt
-   
+
    SUBROUTINE iom_p0d_catt( kiomid, cdatt, cdatt0d, cdvar )
       INTEGER               , INTENT(in   )           ::   kiomid    ! Identifier of the file
@@ -1571,5 +1571,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(sp)        , INTENT(in)                         ::   pvar     ! written field
@@ -1601,5 +1601,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(dp)        , INTENT(in)                         ::   pvar     ! written field
@@ -1632,5 +1632,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(sp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field
@@ -1662,5 +1662,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(dp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field
@@ -1693,5 +1693,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(sp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field
@@ -1723,5 +1723,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(dp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field
@@ -1754,5 +1754,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(sp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field
@@ -1784,5 +1784,5 @@
       INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step
       INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step
-      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
+      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
       REAL(dp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field
@@ -1854,8 +1854,8 @@
          !
       ENDIF
-      
+
    END SUBROUTINE iom_delay_rst
-  
-   
+
+
 
    !!----------------------------------------------------------------------
@@ -1869,5 +1869,5 @@
 !!clem      zz(:,:)=pfield0d
 !!clem      CALL xios_send_field(cdname, zz)
-      CALL xios_send_field(cdname, (/pfield0d/)) 
+      CALL xios_send_field(cdname, (/pfield0d/))
 #else
       IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings
@@ -1882,5 +1882,5 @@
 !!clem      zz(:,:)=pfield0d
 !!clem      CALL xios_send_field(cdname, zz)
-      CALL xios_send_field(cdname, (/pfield0d/)) 
+      CALL xios_send_field(cdname, (/pfield0d/))
 #else
       IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings
@@ -2026,6 +2026,6 @@
       TYPE(xios_gridgroup) :: gridgroup_hdl
       TYPE(xios_grid)      :: grid_hdl
-      TYPE(xios_domain)    :: domain_hdl 
-      TYPE(xios_axis)      :: axis_hdl 
+      TYPE(xios_domain)    :: domain_hdl
+      TYPE(xios_axis)      :: axis_hdl
       CHARACTER(LEN=64)    :: cldomrefid   ! domain_ref name
       CHARACTER(len=1)     :: cl1          ! last character of this name
@@ -2047,5 +2047,5 @@
          CALL xios_add_child(grid_hdl, axis_hdl, 'depth'//cl1)              ! add its axis
       ENDIF
-      !      
+      !
    END SUBROUTINE iom_set_zoom_domain_attr
 
@@ -2140,5 +2140,5 @@
       !!----------------------------------------------------------------------
       !!----------------------------------------------------------------------
-      INTEGER         , INTENT(in) ::   kt 
+      INTEGER         , INTENT(in) ::   kt
       CHARACTER(LEN=*), INTENT(in) ::   cdname
       !!----------------------------------------------------------------------
@@ -2155,5 +2155,5 @@
       !!----------------------------------------------------------------------
       clname = cdname
-      IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname 
+      IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname
       IF( xios_is_valid_context(clname) ) THEN
          CALL iom_swap( cdname )   ! swap to cdname context
@@ -2181,8 +2181,8 @@
       CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=Ni0glo,nj_glo=Nj0glo,ibegin=mig0(Nis0)-1,jbegin=mjg0(Njs0)-1,ni=Ni_0,nj=Nj_0)
       CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = -nn_hls, data_ni = jpi, data_jbegin = -nn_hls, data_nj = jpj)
-!don't define lon and lat for restart reading context. 
+!don't define lon and lat for restart reading context.
       IF ( .NOT.ldrxios ) &
          CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = real(RESHAPE(plon(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp),   &
-         &                                        latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp ))  
+         &                                        latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp ))
       !
       IF ( ln_mskland .AND. (.NOT.ldxios) ) THEN
@@ -2281,5 +2281,5 @@
       CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = -nn_hls, data_ni = jpi, data_jbegin = -nn_hls, data_nj = jpj)
       CALL iom_set_domain_attr("gznl", lonvalue = real(zlon, dp),   &
-         &                             latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp))  
+         &                             latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp))
       CALL iom_set_zoom_domain_attr("ptr", ibegin=ix-1, jbegin=0, ni=1, nj=Nj0glo)
       !
@@ -2330,5 +2330,5 @@
       TYPE(xios_duration)            ::   f_op, f_of
       !!----------------------------------------------------------------------
-      ! 
+      !
       ! frequency of the call of iom_put (attribut: freq_op)
       f_op%timestep = 1        ;  f_of%timestep =  0  ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of)
@@ -2341,18 +2341,18 @@
       ! output file names (attribut: name)
       DO ji = 1, 9
-         WRITE(cl1,'(i1)') ji 
+         WRITE(cl1,'(i1)') ji
          CALL iom_update_file_name('file'//cl1)
       END DO
       DO ji = 1, 99
-         WRITE(cl2,'(i2.2)') ji 
+         WRITE(cl2,'(i2.2)') ji
          CALL iom_update_file_name('file'//cl2)
       END DO
       DO ji = 1, 999
-         WRITE(cl3,'(i3.3)') ji 
+         WRITE(cl3,'(i3.3)') ji
          CALL iom_update_file_name('file'//cl3)
       END DO
 
       ! Zooms...
-      clgrd = (/ 'T', 'U', 'W' /) 
+      clgrd = (/ 'T', 'U', 'W' /)
       DO jg = 1, SIZE(clgrd)                                                                   ! grid type
          cl1 = clgrd(jg)
@@ -2419,18 +2419,18 @@
                IF( zlon == -10. .AND. zlat ==   4. ) THEN   ;   zlon = 0.   ;   zlat = 0.   ;   ENDIF
                CALL dom_ngb( zlon, zlat, ix, iy, cl1 )
-               IF( zlon >= 0. ) THEN  
+               IF( zlon >= 0. ) THEN
                   IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT( zlon), 'e'
                   ELSE                                      ;   WRITE(clon, '(f5.1,a)')       zlon , 'e'
                   ENDIF
-               ELSE             
+               ELSE
                   IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT(-zlon), 'w'
                   ELSE                                      ;   WRITE(clon, '(f5.1,a)')      -zlon , 'w'
                   ENDIF
                ENDIF
-               IF( zlat >= 0. ) THEN  
+               IF( zlat >= 0. ) THEN
                   IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT( zlat), 'n'
                   ELSE                                      ;   WRITE(clat, '(f4.1,a)')       zlat , 'n'
                   ENDIF
-               ELSE             
+               ELSE
                   IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT(-zlat), 's'
                   ELSE                                      ;   WRITE(clat, '(f4.1,a)')      -zlat , 's'
@@ -2446,13 +2446,13 @@
          END DO
       END DO
-      
+
    END SUBROUTINE set_mooring
 
-   
+
    SUBROUTINE iom_update_file_name( cdid )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE iom_update_file_name  ***
       !!
-      !! ** Purpose :   
+      !! ** Purpose :
       !!
       !!----------------------------------------------------------------------
@@ -2468,5 +2468,5 @@
       REAL(wp)           ::   zsec
       LOGICAL            ::   llexist
-      TYPE(xios_duration)   ::   output_freq 
+      TYPE(xios_duration)   ::   output_freq
       !!----------------------------------------------------------------------
       !
@@ -2477,8 +2477,8 @@
          IF( jn == 2 )   CALL iom_get_file_attr( cdid, name_suffix = clname )
          !
-         IF ( TRIM(clname) /= '' ) THEN 
+         IF ( TRIM(clname) /= '' ) THEN
             !
             idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                clname = clname(1:idx-1)//TRIM(cexper)//clname(idx+9:LEN_TRIM(clname))
                idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@')
@@ -2486,25 +2486,25 @@
             !
             idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
               IF ( output_freq%timestep /= 0) THEN
-                  WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts' 
+                  WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE IF ( output_freq%second /= 0 ) THEN
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%second),'s' 
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%second),'s'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE IF ( output_freq%minute /= 0 ) THEN
-                  WRITE(clfreq,'(I18,A2)')INT(output_freq%minute),'mi' 
+                  WRITE(clfreq,'(I18,A2)')INT(output_freq%minute),'mi'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE IF ( output_freq%hour /= 0 ) THEN
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h' 
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE IF ( output_freq%day /= 0 ) THEN
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d' 
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
-              ELSE IF ( output_freq%month /= 0 ) THEN   
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m' 
+              ELSE IF ( output_freq%month /= 0 ) THEN
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
-              ELSE IF ( output_freq%year /= 0 ) THEN   
-                  WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y' 
+              ELSE IF ( output_freq%year /= 0 ) THEN
+                  WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y'
                   itrlen = LEN_TRIM(ADJUSTL(clfreq))
               ELSE
@@ -2517,5 +2517,5 @@
             !
             idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                cldate = iom_sdate( fjulday - rn_Dt / rday )
                clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+11:LEN_TRIM(clname))
@@ -2524,5 +2524,5 @@
             !
             idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                cldate = iom_sdate( fjulday - rn_Dt / rday, ldfull = .TRUE. )
                clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+15:LEN_TRIM(clname))
@@ -2531,5 +2531,5 @@
             !
             idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                cldate = iom_sdate( fjulday + rn_Dt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE. )
                clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+9:LEN_TRIM(clname))
@@ -2538,5 +2538,5 @@
             !
             idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@')
-            DO WHILE ( idx /= 0 ) 
+            DO WHILE ( idx /= 0 )
                cldate = iom_sdate( fjulday + rn_Dt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE., ldfull = .TRUE. )
                clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+13:LEN_TRIM(clname))
@@ -2566,5 +2566,5 @@
       !
       CHARACTER(LEN=20) ::   iom_sdate
-      CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date 
+      CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date
       INTEGER           ::   iyear, imonth, iday, ihour, iminute, isec
       REAL(wp)          ::   zsec
@@ -2588,11 +2588,11 @@
       ENDIF
       !
-      IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date 
+      IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date
       ELSE                       ;   WRITE(clfmt, "('i',i1,',2i2.2')") INT(LOG10(REAL(iyear,wp))) + 1
       ENDIF
       !
-!$AGRIF_DO_NOT_TREAT      
+!$AGRIF_DO_NOT_TREAT
       ! needed in the conv
-      IF( llfull ) THEN 
+      IF( llfull ) THEN
          clfmt = TRIM(clfmt)//",'_',i2.2,':',i2.2,':',i2.2"
          ihour   = isec / 3600
@@ -2604,5 +2604,5 @@
          WRITE(iom_sdate, '('//TRIM(clfmt)//')') iyear, imonth, iday                          ! date of the end of run
       ENDIF
-!$AGRIF_END_DO_NOT_TREAT      
+!$AGRIF_END_DO_NOT_TREAT
       !
    END FUNCTION iom_sdate
@@ -2613,5 +2613,5 @@
    !!----------------------------------------------------------------------
    SUBROUTINE iom_setkt( kt, cdname )
-      INTEGER         , INTENT(in)::   kt 
+      INTEGER         , INTENT(in)::   kt
       CHARACTER(LEN=*), INTENT(in) ::   cdname
       IF( .FALSE. )   WRITE(numout,*) kt, cdname   ! useless test to avoid compilation warnings
@@ -2641,6 +2641,6 @@
    SUBROUTINE iom_miss_val( cdname, pmiss_val )
       CHARACTER(LEN=*), INTENT(in ) ::   cdname
-      REAL(wp)        , INTENT(out) ::   pmiss_val   
-      REAL(dp)                      ::   ztmp_pmiss_val   
+      REAL(wp)        , INTENT(out) ::   pmiss_val
+      REAL(dp)                      ::   ztmp_pmiss_val
 #if defined key_iomput
       ! get missing value
@@ -2652,5 +2652,5 @@
 #endif
    END SUBROUTINE iom_miss_val
-  
+
    !!======================================================================
 END MODULE iom
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbc_ice.F90
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbc_ice.F90	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbc_ice.F90	(revision 13806)
@@ -20,5 +20,5 @@
 # endif
 # if defined key_cice
-   USE ice_domain_size, only: ncat 
+   USE ice_domain_size, only: ncat
 #endif
    USE lib_mpp          ! MPP library
@@ -32,5 +32,5 @@
 # if defined  key_si3
    LOGICAL         , PUBLIC, PARAMETER ::   lk_si3     = .TRUE.   !: SI3 ice model
-   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE 
+   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE
 # endif
 # if defined  key_cice
@@ -47,6 +47,6 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   alb_ice        !: ice albedo                                       [-]
 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qml_ice        !: heat available for snow / ice surface melting     [W/m2] 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qcn_ice        !: heat conduction flux in the layer below surface   [W/m2] 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qml_ice        !: heat available for snow / ice surface melting     [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qcn_ice        !: heat conduction flux in the layer below surface   [W/m2]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qtr_ice_top    !: solar flux transmitted below the ice surface      [W/m2]
 
@@ -87,9 +87,9 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fr_iu              !: ice fraction at NEMO U point
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fr_iv              !: ice fraction at NEMO V point
-   
+
    ! variables used in the coupled interface
    INTEGER , PUBLIC, PARAMETER ::   jpl = ncat
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice 
-   
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice
+
    ! already defined in ice.F90 for SI3
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  a_i
@@ -98,6 +98,4 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   tatm_ice       !: air temperature [K]
 #endif
-
-   !#LB: REAL(wp), PUBLIC, SAVE ::   pp_cldf = 0.81    !: cloud fraction over sea ice, summer CLIO value   [-] !#LB => moved to sbc_phy.F90 !!!
 
    !! arrays relating to embedding ice in the ocean
@@ -145,5 +143,5 @@
          &                     v_ice(jpi,jpj)        , alb_ice(jpi,jpj,1)    , &
          &                     emp_ice(jpi,jpj)      , qns_ice(jpi,jpj,1)    , dqns_ice(jpi,jpj,1)   , &
-         &                     STAT= ierr(3) )      
+         &                     STAT= ierr(3) )
       IF( ln_cpl )   ALLOCATE( h_i(jpi,jpj,jpl) , h_s(jpi,jpj,jpl) , STAT=ierr(4) )
 #endif
@@ -168,6 +166,6 @@
    LOGICAL         , PUBLIC, PARAMETER ::   lk_si3     = .FALSE.  !: no SI3 ice model
    LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .FALSE.  !: no CICE ice model
-   !#LB: REAL(wp)        , PUBLIC, PARAMETER ::   pp_cldf    = 0.81     !: cloud fraction over sea ice, summer CLIO value   [-] !#LB => moved to sbc_phy.F90 !!!  
-   INTEGER         , PUBLIC, PARAMETER ::   jpl = 1 
+
+   INTEGER         , PUBLIC, PARAMETER ::   jpl = 1
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice                        ! jpi, jpj
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tn_ice, alb_ice, qns_ice, dqns_ice  ! (jpi,jpj,jpl)
@@ -178,6 +176,6 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   topmelt, botmelt
    !
-   !! arrays related to embedding ice in the ocean. 
-   !! These arrays need to be declared even if no ice model is required. 
+   !! arrays related to embedding ice in the ocean.
+   !! These arrays need to be declared even if no ice model is required.
    !! In the no ice model or traditional levitating ice cases they contain only zeros
    !! ---------------------
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbc_oce.F90
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbc_oce.F90	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbc_oce.F90	(revision 13806)
@@ -159,5 +159,4 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   frq_m     !: mean (nn_fsbc time-step) fraction of solar net radiation absorbed in the 1st T level [-]
 
-   !#LB:
    !!----------------------------------------------------------------------
    !!                     Surface atmospheric fields
@@ -165,5 +164,4 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: q_air_zt       !: specific humidity of air at z=zt [kg/kg]ww
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: theta_air_zt   !: potential temperature of air at z=zt [K]
-   !#LB.
 
    
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk.F90
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk.F90	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk.F90	(revision 13806)
@@ -107,8 +107,8 @@
    !
    !#LB:
-   LOGICAL  ::   ln_Cx_ice_cst      ! use constant ice-air bulk transfer coefficients (value given in namelist's rn_Cd_i, rn_Ce_i & rn_Ch_i)
-   REAL(wp) ::   rn_Cd_i, rn_Ce_i, rn_Ch_i
-   LOGICAL  ::   ln_Cx_ice_LU12      ! ice-atm drag = F( ice concentration )                        (Lupkes et al. JGR2012)
-   LOGICAL  ::   ln_Cx_ice_LG15      ! ice-atm drag = F( ice concentration, atmospheric stability ) (Lupkes et al. JGR2015)
+   LOGICAL  ::   ln_Cx_ice_cst             ! use constant air-ice bulk transfer coefficients (value given in namelist's rn_Cd_i, rn_Ce_i & rn_Ch_i)
+   REAL(wp) ::   rn_Cd_i, rn_Ce_i, rn_Ch_i ! values for  "    "
+   LOGICAL  ::   ln_Cx_ice_LU12            ! air-ice bulk transfer coefficients based on Lupkes et al., 2012)
+   LOGICAL  ::   ln_Cx_ice_LG15            ! air-ice bulk transfer coefficients based on Lupkes & Gryanik, 2015)
    !#LB.
    !
@@ -137,5 +137,5 @@
    LOGICAL  ::   ln_humi_dpt    ! humidity read in files ("sn_humi") is dew-point temperature [K] if .true. !LB
    LOGICAL  ::   ln_humi_rlh    ! humidity read in files ("sn_humi") is relative humidity     [%] if .true. !LB
-   LOGICAL  ::   ln_tpot        !!GS: flag to compute or not potential temperature
+   LOGICAL  ::   ln_tair_pot    ! temperature read in files ("sn_tair") is already potential temperature (not absolute)
    !
    INTEGER  ::   nhumi          ! choice of the bulk algorithm
@@ -218,12 +218,12 @@
       NAMELIST/namsbc_blk/ ln_NCAR, ln_COARE_3p0, ln_COARE_3p6, ln_ECMWF, ln_ANDREAS, &   ! bulk algorithm
          &                 rn_zqt, rn_zu, nn_iter_algo, ln_skin_cs, ln_skin_wl,       &
-         &                 rn_pfac, rn_efac,                                &
-         &                 ln_crt_fbk, rn_stau_a, rn_stau_b,                &   ! current feedback
-         &                 ln_humi_sph, ln_humi_dpt, ln_humi_rlh, ln_tpot,  &
-         &                 ln_Cx_ice_cst, rn_Cd_i, rn_Ce_i, rn_Ch_i,        &
-         &                 ln_Cx_ice_LU12, ln_Cx_ice_LG15,                  &
-         &                 cn_dir,                                          &
-         &                 sn_wndi, sn_wndj, sn_qsr, sn_qlw ,               &   ! input fields
-         &                 sn_tair, sn_humi, sn_prec, sn_snow, sn_slp,      &
+         &                 rn_pfac, rn_efac,                                          &
+         &                 ln_crt_fbk, rn_stau_a, rn_stau_b,                          &   ! current feedback
+         &                 ln_humi_sph, ln_humi_dpt, ln_humi_rlh, ln_tair_pot,        &
+         &                 ln_Cx_ice_cst, rn_Cd_i, rn_Ce_i, rn_Ch_i,                  &
+         &                 ln_Cx_ice_LU12, ln_Cx_ice_LG15,                            &
+         &                 cn_dir,                                                    &
+         &                 sn_wndi, sn_wndj, sn_qsr, sn_qlw ,                         &   ! input fields
+         &                 sn_tair, sn_humi, sn_prec, sn_snow, sn_slp,                &
          &                 sn_uoatm, sn_voatm, sn_cc, sn_hpgi, sn_hpgj
 
@@ -567,11 +567,11 @@
          !      based on adiabatic lapse-rate (see Josey, Gulev & Yu, 2013) / doi=10.1016/B978-0-12-391851-2.00005-2
          !      (most reanalysis products provide absolute temp., not potential temp.)
-         IF( ln_tpot ) THEN
+         IF( ln_tair_pot ) THEN
+            ! temperature read into file is already potential temperature, do nothing...
+            theta_air_zt(:,:) = sf(jp_tair )%fnow(:,:,1)            
+         ELSE
             ! temperature read into file is ABSOLUTE temperature (that's the case for ECMWF products for example...)
-            IF((kt==nit000).AND.lwp) WRITE(numout,*) ' *** sbc_blk() => computing air POTENTIAL temperature out of ABSOLUTE temperature!'
+            IF((kt==nit000).AND.lwp) WRITE(numout,*) ' *** sbc_blk() => air temperature converted from ABSOLUTE to POTENTIAL!'
             theta_air_zt(:,:) = sf(jp_tair )%fnow(:,:,1) + gamma_moist( sf(jp_tair )%fnow(:,:,1), q_air_zt(:,:) ) * rn_zqt
-         ELSE
-            ! temperature read into file is already potential temperature
-            theta_air_zt(:,:) = sf(jp_tair )%fnow(:,:,1)
          ENDIF
          !
@@ -683,13 +683,13 @@
       CALL wnd_cyc( kt, zwnd_i, zwnd_j )    ! add analytical tropical cyclone (Vincent et al. JGR 2012)
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-      zwnd_i(ji,jj) = pwndi(ji,jj) + zwnd_i(ji,jj)
-      zwnd_j(ji,jj) = pwndj(ji,jj) + zwnd_j(ji,jj)
-      ! ... scalar wind at T-point (not masked)
-      wndm(ji,jj) = SQRT( zwnd_i(ji,jj) * zwnd_i(ji,jj) + zwnd_j(ji,jj) * zwnd_j(ji,jj) )
+         zwnd_i(ji,jj) = pwndi(ji,jj) + zwnd_i(ji,jj)
+         zwnd_j(ji,jj) = pwndj(ji,jj) + zwnd_j(ji,jj)
+         ! ... scalar wind at T-point (not masked)
+         wndm(ji,jj) = SQRT( zwnd_i(ji,jj) * zwnd_i(ji,jj) + zwnd_j(ji,jj) * zwnd_j(ji,jj) )
       END_2D
 #else
       ! ... scalar wind module at T-point (not masked)
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-      wndm(ji,jj) = SQRT(  pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj)  )
+         wndm(ji,jj) = SQRT(  pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj)  )
       END_2D
 #endif
@@ -787,10 +787,10 @@
       IF( ln_abl ) THEN         !==  ABL formulation  ==!   multiplication by rho_air and turbulent fluxes computation done in ablstp
          DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         zztmp = zU_zu(ji,jj)
-         wndm(ji,jj)   = zztmp                   ! Store zU_zu in wndm to compute ustar2 in ablmod
-         pcd_du(ji,jj) = zztmp * zcd_oce(ji,jj)
-         psen(ji,jj)   = zztmp * zch_oce(ji,jj)
-         pevp(ji,jj)   = zztmp * zce_oce(ji,jj)
-         rhoa(ji,jj)   = rho_air( ptair(ji,jj), pqair(ji,jj), pslp(ji,jj) )
+            zztmp = zU_zu(ji,jj)
+            wndm(ji,jj)   = zztmp                   ! Store zU_zu in wndm to compute ustar2 in ablmod
+            pcd_du(ji,jj) = zztmp * zcd_oce(ji,jj)
+            psen(ji,jj)   = zztmp * zch_oce(ji,jj)
+            pevp(ji,jj)   = zztmp * zce_oce(ji,jj)
+            rhoa(ji,jj)   = rho_air( ptair(ji,jj), pqair(ji,jj), pslp(ji,jj) )
          END_2D
       ELSE                      !==  BLK formulation  ==!   turbulent fluxes computation
@@ -825,8 +825,8 @@
             zstmax = MIN( rn_stau_a * 3._wp + rn_stau_b, 0._wp )   ! set the max value of Stau corresponding to a wind of 3 m/s (<0)
             DO_2D( 0, 1, 0, 1 )   ! end at jpj and jpi, as ztau_j(ji,jj+1) ztau_i(ji+1,jj) used in the next loop
-            zstau = MIN( rn_stau_a * wndm(ji,jj) + rn_stau_b, zstmax )   ! stau (<0) must be smaller than zstmax
-            ztau_i(ji,jj) = ztau_i(ji,jj) + zstau * ( 0.5_wp * ( pu(ji-1,jj  ) + pu(ji,jj) ) - puatm(ji,jj) )
-            ztau_j(ji,jj) = ztau_j(ji,jj) + zstau * ( 0.5_wp * ( pv(ji  ,jj-1) + pv(ji,jj) ) - pvatm(ji,jj) )
-            taum(ji,jj) = SQRT( ztau_i(ji,jj) * ztau_i(ji,jj) + ztau_j(ji,jj) * ztau_j(ji,jj) )
+               zstau = MIN( rn_stau_a * wndm(ji,jj) + rn_stau_b, zstmax )   ! stau (<0) must be smaller than zstmax
+               ztau_i(ji,jj) = ztau_i(ji,jj) + zstau * ( 0.5_wp * ( pu(ji-1,jj  ) + pu(ji,jj) ) - puatm(ji,jj) )
+               ztau_j(ji,jj) = ztau_j(ji,jj) + zstau * ( 0.5_wp * ( pv(ji  ,jj-1) + pv(ji,jj) ) - pvatm(ji,jj) )
+               taum(ji,jj) = SQRT( ztau_i(ji,jj) * ztau_i(ji,jj) + ztau_j(ji,jj) * ztau_j(ji,jj) )
             END_2D
          ENDIF
@@ -836,10 +836,9 @@
          !     Note that coastal wind stress is not used in the code... so this extra care has no effect
          DO_2D( 0, 0, 0, 0 )              ! start loop at 2, in case ln_crt_fbk = T
-         utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( ztau_i(ji,jj) + ztau_i(ji+1,jj  ) ) &
-            &              * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1))
-         vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( ztau_j(ji,jj) + ztau_j(ji  ,jj+1) ) &
-            &              * MAX(tmask(ji,jj,1),tmask(ji,jj+1,1))
+            utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( ztau_i(ji,jj) + ztau_i(ji+1,jj  ) ) &
+               &              * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1))
+            vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( ztau_j(ji,jj) + ztau_j(ji  ,jj+1) ) &
+               &              * MAX(tmask(ji,jj,1),tmask(ji,jj+1,1))
          END_2D
-
 
          IF( ln_crt_fbk ) THEN
@@ -870,5 +869,5 @@
    END SUBROUTINE blk_oce_1
 
-   
+
    SUBROUTINE blk_oce_2( ptair, pdqlw, pprec, psnow, &   ! <<= in
       &                   ptsk, psen, plat, pevp     )   ! <<= in
@@ -1339,6 +1338,6 @@
          DO jl = 1, jpl
             DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-            zhe = ( rn_cnd_s * phi(ji,jj,jl) + rcnd_i * phs(ji,jj,jl) ) * zfac                            ! Effective thickness
-            IF( zhe >=  zfac2 )   zgfac(ji,jj,jl) = MIN( 2._wp, 0.5_wp * ( 1._wp + LOG( zhe * zfac3 ) ) ) ! Enhanced conduction factor
+               zhe = ( rn_cnd_s * phi(ji,jj,jl) + rcnd_i * phs(ji,jj,jl) ) * zfac                            ! Effective thickness
+               IF( zhe >=  zfac2 )   zgfac(ji,jj,jl) = MIN( 2._wp, 0.5_wp * ( 1._wp + LOG( zhe * zfac3 ) ) ) ! Enhanced conduction factor
             END_2D
          END DO
@@ -1354,25 +1353,25 @@
       DO jl = 1, jpl
          DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-         !
-         zkeff_h = zfac * zgfac(ji,jj,jl) / &                                    ! Effective conductivity of the snow-ice system divided by thickness
-            &      ( rcnd_i * phs(ji,jj,jl) + rn_cnd_s * MAX( 0.01, phi(ji,jj,jl) ) )
-         ztsu    = ptsu(ji,jj,jl)                                                ! Store current iteration temperature
-         ztsu0   = ptsu(ji,jj,jl)                                                ! Store initial surface temperature
-         zqa0    = qsr_ice(ji,jj,jl) - qtr_ice_top(ji,jj,jl) + qns_ice(ji,jj,jl) ! Net initial atmospheric heat flux
-         !
-         DO iter = 1, nit     ! --- Iterative loop
-            zqc   = zkeff_h * ( ztsu - ptb(ji,jj) )                              ! Conduction heat flux through snow-ice system (>0 downwards)
-            zqnet = zqa0 + dqns_ice(ji,jj,jl) * ( ztsu - ptsu(ji,jj,jl) ) - zqc  ! Surface energy budget
-            ztsu  = ztsu - zqnet / ( dqns_ice(ji,jj,jl) - zkeff_h )              ! Temperature update
-         END DO
-         !
-         ptsu   (ji,jj,jl) = MIN( rt0, ztsu )
-         qcn_ice(ji,jj,jl) = zkeff_h * ( ptsu(ji,jj,jl) - ptb(ji,jj) )
-         qns_ice(ji,jj,jl) = qns_ice(ji,jj,jl) + dqns_ice(ji,jj,jl) * ( ptsu(ji,jj,jl) - ztsu0 )
-         qml_ice(ji,jj,jl) = ( qsr_ice(ji,jj,jl) - qtr_ice_top(ji,jj,jl) + qns_ice(ji,jj,jl) - qcn_ice(ji,jj,jl) )  &
-            &   * MAX( 0._wp , SIGN( 1._wp, ptsu(ji,jj,jl) - rt0 ) )
-
-         ! --- Diagnose the heat loss due to changing non-solar flux (as in icethd_zdf_bl99) --- !
-         hfx_err_dif(ji,jj) = hfx_err_dif(ji,jj) - ( dqns_ice(ji,jj,jl) * ( ptsu(ji,jj,jl) - ztsu0 ) ) * a_i_b(ji,jj,jl)
+            !
+            zkeff_h = zfac * zgfac(ji,jj,jl) / &                                    ! Effective conductivity of the snow-ice system divided by thickness
+               &      ( rcnd_i * phs(ji,jj,jl) + rn_cnd_s * MAX( 0.01, phi(ji,jj,jl) ) )
+            ztsu    = ptsu(ji,jj,jl)                                                ! Store current iteration temperature
+            ztsu0   = ptsu(ji,jj,jl)                                                ! Store initial surface temperature
+            zqa0    = qsr_ice(ji,jj,jl) - qtr_ice_top(ji,jj,jl) + qns_ice(ji,jj,jl) ! Net initial atmospheric heat flux
+            !
+            DO iter = 1, nit     ! --- Iterative loop
+               zqc   = zkeff_h * ( ztsu - ptb(ji,jj) )                              ! Conduction heat flux through snow-ice system (>0 downwards)
+               zqnet = zqa0 + dqns_ice(ji,jj,jl) * ( ztsu - ptsu(ji,jj,jl) ) - zqc  ! Surface energy budget
+               ztsu  = ztsu - zqnet / ( dqns_ice(ji,jj,jl) - zkeff_h )              ! Temperature update
+            END DO
+            !
+            ptsu   (ji,jj,jl) = MIN( rt0, ztsu )
+            qcn_ice(ji,jj,jl) = zkeff_h * ( ptsu(ji,jj,jl) - ptb(ji,jj) )
+            qns_ice(ji,jj,jl) = qns_ice(ji,jj,jl) + dqns_ice(ji,jj,jl) * ( ptsu(ji,jj,jl) - ztsu0 )
+            qml_ice(ji,jj,jl) = ( qsr_ice(ji,jj,jl) - qtr_ice_top(ji,jj,jl) + qns_ice(ji,jj,jl) - qcn_ice(ji,jj,jl) )  &
+               &   * MAX( 0._wp , SIGN( 1._wp, ptsu(ji,jj,jl) - rt0 ) )
+
+            ! --- Diagnose the heat loss due to changing non-solar flux (as in icethd_zdf_bl99) --- !
+            hfx_err_dif(ji,jj) = hfx_err_dif(ji,jj) - ( dqns_ice(ji,jj,jl) * ( ptsu(ji,jj,jl) - ztsu0 ) ) * a_i_b(ji,jj,jl)
 
          END_2D
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_skin_ecmwf.F90
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_skin_ecmwf.F90	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_skin_ecmwf.F90	(revision 13806)
@@ -160,8 +160,8 @@
       REAL(wp) :: zalfa     !: thermal expansion coefficient of sea-water [1/K]
       REAL(wp) :: zdTwl_b, zdTwl_n  !: temp. diff. between "almost surface (right below viscous layer) and bottom of WL
-      REAL(wp) :: zfr, zeta 
-      REAL(wp) :: zusw, zusw2 
-      REAL(wp) :: zLa, zfLa 
-      REAL(wp) :: flg, zwf, zQabs 
+      REAL(wp) :: zfr, zeta
+      REAL(wp) :: zusw, zusw2
+      REAL(wp) :: zLa, zfLa
+      REAL(wp) :: flg, zwf, zQabs
       REAL(wp) :: ZA, ZB, zL1, zL2
       REAL(wp) :: zcst0, zcst1, zcst2, zcst3
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcmod.F90
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcmod.F90	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcmod.F90	(revision 13806)
@@ -46,5 +46,5 @@
    USE sbcssr         ! surface boundary condition: sea surface restoring
    USE sbcrnf         ! surface boundary condition: runoffs
-   USE sbcapr         ! surface boundary condition: atmo pressure 
+   USE sbcapr         ! surface boundary condition: atmo pressure
    USE sbcfwb         ! surface boundary condition: freshwater budget
    USE icbstp         ! Icebergs
@@ -137,5 +137,5 @@
          WRITE(numout,*) '         ocean-atmosphere coupled formulation       ln_cpl        = ', ln_cpl
          WRITE(numout,*) '         mixed forced-coupled     formulation       ln_mixcpl     = ', ln_mixcpl
-!!gm  lk_oasis is controlled by key_oasis3  ===>>>  It shoud be removed from the namelist 
+!!gm  lk_oasis is controlled by key_oasis3  ===>>>  It shoud be removed from the namelist
          WRITE(numout,*) '         OASIS coupling (with atm or sas)           lk_oasis      = ', lk_oasis
          WRITE(numout,*) '         components of your executable              nn_components = ', nn_components
@@ -162,5 +162,5 @@
       IF( .NOT.ln_wave ) THEN
          ln_sdw = .false. ; ln_cdgw = .false. ; ln_tauwoc = .false. ; ln_tauw = .false. ; ln_stcor = .false.
-      ENDIF 
+      ENDIF
       IF( ln_sdw ) THEN
          IF( .NOT.(nn_sdrift==jp_breivik_2014 .OR. nn_sdrift==jp_li_2017 .OR. nn_sdrift==jp_peakfr) ) &
@@ -187,5 +187,5 @@
       !                       !**  check option consistency
       !
-      IF(lwp) WRITE(numout,*)       !* Single / Multi - executable (NEMO / OPA+SAS) 
+      IF(lwp) WRITE(numout,*)       !* Single / Multi - executable (NEMO / OPA+SAS)
       SELECT CASE( nn_components )
       CASE( jp_iam_nemo )
@@ -219,5 +219,5 @@
       SELECT CASE( nn_ice )
       CASE( 0 )                        !- no ice in the domain
-      CASE( 1 )                        !- Ice-cover climatology ("Ice-if" model)  
+      CASE( 1 )                        !- Ice-cover climatology ("Ice-if" model)
       CASE( 2 )                        !- SI3  ice model
          IF( .NOT.( ln_blk .OR. ln_cpl .OR. ln_abl .OR. ln_usr ) )   &
@@ -227,8 +227,8 @@
             &                   CALL ctl_stop( 'sbc_init : CICE sea-ice model requires ln_blk or ln_cpl or ln_abl or ln_usr = T' )
          IF( lk_agrif                                )   &
-            &                   CALL ctl_stop( 'sbc_init : CICE sea-ice model not currently available with AGRIF' ) 
+            &                   CALL ctl_stop( 'sbc_init : CICE sea-ice model not currently available with AGRIF' )
       CASE DEFAULT                     !- not supported
       END SELECT
-      IF( ln_diurnal .AND. .NOT. ln_blk  )   CALL ctl_stop( "sbc_init: diurnal flux processing only implemented for bulk forcing" )
+      IF( ln_diurnal .AND. .NOT. (ln_blk.OR.ln_abl) )   CALL ctl_stop( "sbc_init: diurnal flux processing only implemented for bulk forcing" )
       !
       !                       !**  allocate and set required variables
@@ -242,5 +242,5 @@
       !
       IF( sbc_ssr_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_init : unable to allocate sbc_ssr arrays' )
-      IF( .NOT.ln_ssr ) THEN               !* Initialize qrp and erp if no restoring 
+      IF( .NOT.ln_ssr ) THEN               !* Initialize qrp and erp if no restoring
          qrp(:,:) = 0._wp
          erp(:,:) = 0._wp
@@ -331,5 +331,5 @@
          &   CALL ctl_warn( 'sbc_init : diurnal cycle for qsr: the sampling of the diurnal cycle is too small...' )
       !
-   
+
       !                       !**  associated modules : initialization
       !
@@ -395,5 +395,5 @@
       !
       REAL(wp) ::     zthscl        ! wd  tanh scale
-      REAL(wp), DIMENSION(jpi,jpj) ::  zwdht, zwght  ! wd dep over wd limit, wgt  
+      REAL(wp), DIMENSION(jpi,jpj) ::  zwdht, zwght  ! wd dep over wd limit, wgt
 
       !!---------------------------------------------------------------------
@@ -427,8 +427,8 @@
       !
       !                                            !==  sbc formulation  ==!
-      !                                                   
+      !
       SELECT CASE( nsbc )                                ! Compute ocean surface boundary condition
       !                                                  ! (i.e. utau,vtau, qns, qsr, emp, sfx)
-      CASE( jp_usr   )     ;   CALL usrdef_sbc_oce( kt, Kbb )                        ! user defined formulation 
+      CASE( jp_usr   )     ;   CALL usrdef_sbc_oce( kt, Kbb )                        ! user defined formulation
       CASE( jp_flx     )   ;   CALL sbc_flx       ( kt )                             ! flux formulation
       CASE( jp_blk     )
@@ -447,5 +447,5 @@
       IF( ln_mixcpl )          CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice, Kbb, Kmm )  ! forced-coupled mixed formulation after forcing
       !
-      IF ( ln_wave .AND. (ln_tauwoc .OR. ln_tauw) ) CALL sbc_wstress( )              ! Wind stress provided by waves 
+      IF ( ln_wave .AND. (ln_tauwoc .OR. ln_tauw) ) CALL sbc_wstress( )              ! Wind stress provided by waves
       !
       !                                            !==  Misc. Options  ==!
@@ -461,6 +461,6 @@
       IF( ln_icebergs    )   THEN
                                      CALL icb_stp( kt )           ! compute icebergs
-         ! Icebergs do not melt over the haloes. 
-         ! So emp values over the haloes are no more consistent with the inner domain values. 
+         ! Icebergs do not melt over the haloes.
+         ! So emp values over the haloes are no more consistent with the inner domain values.
          ! A lbc_lnk is therefore needed to ensure reproducibility and restartability.
          ! see ticket #2113 for discussion about this lbc_lnk.
@@ -476,5 +476,5 @@
       ! Special treatment of freshwater fluxes over closed seas in the model domain
       ! Should not be run if ln_diurnal_only
-      IF( l_sbc_clo      )   CALL sbc_clo( kt )   
+      IF( l_sbc_clo      )   CALL sbc_clo( kt )
 
 !!$!RBbug do not understand why see ticket 667
@@ -482,5 +482,5 @@
 !!$      CALL lbc_lnk( 'sbcmod', emp, 'T', 1.0_wp )
       IF( ll_wd ) THEN     ! If near WAD point limit the flux for now
-         zthscl = atanh(rn_wd_sbcfra)                     ! taper frac default is .999 
+         zthscl = atanh(rn_wd_sbcfra)                     ! taper frac default is .999
          zwdht(:,:) = ssh(:,:,Kmm) + ht_0(:,:) - rn_wdmin1   ! do this calc of water
                                                      ! depth above wd limit once
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce+ice/namelist_ecmwf-cstc_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce+ice/namelist_ecmwf-cstc_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce+ice/namelist_ecmwf-cstc_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !!   
    ! Sea-ice specific: (IF: nn_ice >=1 )
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce+ice/namelist_ecmwf-lg15_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce+ice/namelist_ecmwf-lg15_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce+ice/namelist_ecmwf-lg15_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !!   
    ! Sea-ice specific: (IF: nn_ice >=1 )
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce+ice/namelist_ecmwf-lu12_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce+ice/namelist_ecmwf-lu12_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce+ice/namelist_ecmwf-lu12_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !!   
    ! Sea-ice specific: (IF: nn_ice >=1 )
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_andreas_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_andreas_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_andreas_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_coare3p6_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_coare3p6_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_coare3p6_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_ecmwf_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_ecmwf_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_ecmwf_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_ncar_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_ncar_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/ERA5_arctic/oce/namelist_ncar_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .true.  !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .false. !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_andreas_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_andreas_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_andreas_cfg	(revision 13806)
@@ -125,5 +125,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_coare3p0_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_coare3p0_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_coare3p0_cfg	(revision 13806)
@@ -125,5 +125,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_coare3p6_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_coare3p6_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_coare3p6_cfg	(revision 13806)
@@ -125,5 +125,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_ecmwf_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_ecmwf_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_ecmwf_cfg	(revision 13806)
@@ -125,5 +125,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_ncar_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_ncar_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/IDEALIZED/oce/namelist_ncar_cfg	(revision 13806)
@@ -125,5 +125,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_andreas_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_andreas_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_andreas_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_coare3p6_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_coare3p6_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_coare3p6_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ecmwf_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ecmwf_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ecmwf_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ncar_cfg
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ncar_cfg	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/PAPA/oce/namelist_ncar_cfg	(revision 13806)
@@ -121,5 +121,5 @@
    ln_humi_dpt = .false. !  humidity "sn_humi" is dew-point temperature [K]
    ln_humi_rlh = .true.  !  humidity "sn_humi" is relative humidity     [%]
-   ln_tpot     = .true.  !!GS: compute potential temperature or not
+   ln_tair_pot = .false. !  air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
    !
    cn_dir      = './'      !  root directory for the bulk data location
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 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/launch_sasf.sh	(revision 13806)
@@ -36,9 +36,9 @@
 
 # MPI launch command for your system
-# Even though we are running on 1 proc, NEMO has been compiled with MPI, so fill the following:
+# Even though we are running on 1 proc here, NEMO has likely been compiled with MPI,
+# if it's not the case then just leave "MPI_LAUNCH" void...
 MPI_LAUNCH="mpirun -n 1"
 
 ####### End of normal user configurable section #######
-
 #================================================================================
 
@@ -97,5 +97,4 @@
 
 SASF_EXPREF=`pwd`  ; # STATION_ASF EXPREF directory from which to use namelists and XIOS xml files...
-
 
 CFGS_SHARED="${NEMO_REF_DIR}/cfgs/SHARED"
Index: MO/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 13805)
+++ 	(revision )
@@ -1,162 +1,0 @@
-# *Station Air-Sea Fluxes* demonstration case
-
-Last successful test done with NEMOGCM trunk: `r13263`
-
-Author: Laurent Brodeau, 2020
-
-NOTE: if working with the trunk of NEMO, you are strongly advised to use the same test-case but on the `NEMO-examples` GitHub depo:
-https://github.com/NEMO-ocean/NEMO-examples/tree/master/STATION_ASF
-
-## Objectives
-
-```STATION_ASF``` is a demonstration test-case that mimics a (static) in-situ station (buoy, platform) dedicated to the estimation of surface air-sea fluxes by means of *widely-measured* (bulk) meteorological surface parameters.
-
-```STATION_ASF``` has been constructed by merging the *single column* and the *standalone surface module* configurations of NEMO. In short, it can be defined as "SAS meets C1D". As such, the spatial domain of ```STATION_ASF``` is punctual (1D, well actually 3 x 3 as in C1D).
-
-```STATION_ASF``` is therefore a versatile tool, and extremely lightweight in terms of computing requirements, to test the different bulk algorithms and cool-skin/warm-layer parameterization options included in NEMO.
-
-As input ```STATION_ASF``` will require the traditional *bulk* sea surface parameters:
-
-- Bulk sea surface temperature (SST) at _z<sub>SST</sub>_ meters below the surface
-- Surface current vector
-- Sea surface salinity
-
-as well as the usual surface atmospheric state:
-
-- air temperature at _z<sub>t</sub>_ meters above the surface
-- air humidity  at _z<sub>t</sub>_ meters above the surface (specific humidity or relative humidity or dew-point temperature)
-- wind speed vector at _z<sub>u</sub>_ meters above the surface
-- Sea level atmospheric pressure (SLP)
-- Downwelling solar radiation
-- Downwelling longwave radiation
-
-### Example of diagnostics from `STATION_ASF`
-
-(Generated with script `./EXPREF/plot_station_asf_simple.py`)
-
-![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/01_temperatures_ECMWF.svg)
-
-![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/Cd.svg)
-
-![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/dT_skin.svg)
-
-![plot](https://github.com/NEMO-ocean/NEMO-examples/blob/master/STATION_ASF/figs/Qlat.svg)
-
-
-## Physical description
-
-### Important namelist parameters specific to STATION_ASF
-
-* ```rn_dept1@namusr_def:``` depth (m) at which the prescribed SST is taken (*i.e.* depth of first T-point); important due to impact on warm-layer estimate, the deeper, the more pronounced!
-
-* ```rn_lat1d,rn_lon1d@namc1d:``` fixed coordinates of the location of the station (buoy, platform, etc).
-
-* ```namsbc_blk:``` to be filled carefully, just as for "C1D", the prescribed surface ATMOSPHERIC state (files) are time series of shape 3x3 in space
-
-* ```namsbc_sas:``` to be filled carefully, just as for "C1D", the prescribed surface OCEAN state (files) are time series of shape 3x3 in space
-
-
-
-## Input files to test STATION ASF
-
-One full year (2018) of processed hourly data from the PAPA station (buoy) is found into the `input_data` directory.
-These three files are everything you need to play with the set of *namelists* provided for this test-case.
-
-- ```Station_PAPA_50N-145W_atm_hourly_y2018.nc```  → contains hourly surface atmospheric state
-- ```Station_PAPA_50N-145W_precip_daily_y2018.nc``` → contains daily precipitation
-- ```Station_PAPA_50N-145W_oce_hourly_y2018.nc``` → contains hourly sea surface state
-
-For station PAPA (50.1 N, 144.9 W), air temperature and humidity are measured at 2.5 m, the wind speed at 4 m, and the SST at 1 m below the surface, hence the following namelist parameters are given:
-
-- `&namusr_def`
-  - ```rn_dept1 =    1.  ```
-- `&namc1d`
-  - ```rn_lat1d =  50.1 ```
-  - ```rn_lon1d = 215.1```
-- `&namsbc_blk`
-  - ```rn_zqt   =   2.5```
-  - ```rn_zu    =    4.```
-
-
-
-## 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 ``sanity_check_SBCBLK.sh``, double check that the variables given a value in the first lines are consistent with your setup (it should).
-
-Launch the script:
-
-    $ ./sanity_check_SBCBLK.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 `sanity_check_SBCBLK.sh` with the "more" argument: 
-
-    $ ./sanity_check_SBCBLK.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```
-
-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```)
-
-- ```PROD_DIR``` :  Directory where to run the simulation
-
-- ```DATA_IN_DIR``` : Directory containing sea-surface + atmospheric forcings (found here in ```input_data/```)
-
-If everything goes according to plan, ``launch_sasf.sh`` should have generated the 3 following sets of output files into `${PROD_DIR}/output`:
-
-    STATION_ASF-COARE3p6_1h_20180101_20181231_gridT.nc
-    STATION_ASF-COARE3p6_1h_20180101_20181231_gridU.nc 
-    STATION_ASF-COARE3p6_1h_20180101_20181231_gridV.nc 
-    STATION_ASF-ECMWF_1h_20180101_20181231_gridT.nc 
-    STATION_ASF-ECMWF_1h_20180101_20181231_gridU.nc 
-    STATION_ASF-ECMWF_1h_20180101_20181231_gridV.nc 
-    STATION_ASF-NCAR_1h_20180101_20181231_gridT.nc 
-    STATION_ASF-NCAR_1h_20180101_20181231_gridU.nc 
-    STATION_ASF-NCAR_1h_20180101_20181231_gridV.nc
-
----
-
-*/Laurent, July 2020.*
-
Index: /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/README.rst
===================================================================
--- /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/README.rst	(revision 13805)
+++ /NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/README.rst	(revision 13806)
@@ -2,11 +2,6 @@
 ===========================================
 
-Last successful test done with NEMOGCM trunk: ``r13263``
-
-Author: Laurent Brodeau, 2020
-
-NOTE: if working with the trunk of NEMO, you are strongly advised to use
-the same test-case but on the ``NEMO-examples`` GitHub depo:
-`https://github.com/NEMO-ocean/NEMO-examples/tree/master/STATION_ASF <https://github.com/NEMO-ocean/NEMO-examples/tree/master/STATION_ASF>`__
+.. raw:: html
+
 
 Objectives
