New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 12928 for NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests – NEMO

Ignore:
Timestamp:
2020-05-14T21:46:00+02:00 (4 years ago)
Author:
smueller
Message:

Synchronizing with /NEMO/trunk@12925 (ticket #2170)

Location:
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser
Files:
1 deleted
104 edited
11 copied

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser

    • Property svn:externals
      •  

        old new  
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8 
         9# SETTE 
         10^/utils/CI/sette@HEAD         sette 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/BENCH/EXPREF/namelist_cfg_orca025_like

    r12178 r12928  
    3636&namdom        !   time and space domain 
    3737!----------------------------------------------------------------------- 
    38    rn_rdt      =    900.   !  time step for the dynamics (and tracer if nn_acc=0) 
     38   rn_Dt      =    900.   !  time step for the dynamics (and tracer if nn_acc=0) 
    3939   rn_atfp     =   0.05    !  asselin time filter parameter 
    4040/ 
     
    5050!----------------------------------------------------------------------- 
    5151  ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
     52  nn_ice      = 2         !  =0 no ice boundary condition 
     53     !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif ) 
     54     !                    !  =2 or 3 for SI3 and CICE, respectively 
    5255  ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr) 
    5356/ 
     
    189192   ln_dynspg_ts   = .true.   ! split-explicit free surface 
    190193      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    191          nn_baro      =  30         ! =F : the number of sub-step in rn_rdt seconds 
     194         nn_e      =  30         ! =F : the number of sub-step in rn_Dt seconds 
    192195/ 
    193196!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/BENCH/EXPREF/namelist_cfg_orca12_like

    r12178 r12928  
    3636&namdom        !   time and space domain 
    3737!----------------------------------------------------------------------- 
    38    rn_rdt      =    300.   !  time step for the dynamics (and tracer if nn_acc=0) 
     38   rn_Dt      =    300.   !  time step for the dynamics (and tracer if nn_acc=0) 
    3939   rn_atfp     =   0.05    !  asselin time filter parameter 
    4040/ 
     
    5050!----------------------------------------------------------------------- 
    5151  ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
     52  nn_ice      = 2         !  =0 no ice boundary condition 
     53     !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif ) 
     54     !                    !  =2 or 3 for SI3 and CICE, respectively 
    5255  ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr) 
    5356/ 
     
    188191   ln_dynspg_ts   = .true.   ! split-explicit free surface 
    189192      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    190          nn_baro      =  30         ! =F : the number of sub-step in rn_rdt seconds 
     193         nn_e      =  30         ! =F : the number of sub-step in rn_Dt seconds 
    191194/ 
    192195!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/BENCH/EXPREF/namelist_cfg_orca1_like

    r12178 r12928  
    3636&namdom        !   time and space domain 
    3737!----------------------------------------------------------------------- 
    38    rn_rdt      =   3600.   !  time step for the dynamics (and tracer if nn_acc=0) 
     38   rn_Dt      =   3600.   !  time step for the dynamics (and tracer if nn_acc=0) 
    3939   rn_atfp     =   0.05    !  asselin time filter parameter 
    4040/ 
     
    5050!----------------------------------------------------------------------- 
    5151  ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
     52  nn_ice      = 2         !  =0 no ice boundary condition 
     53     !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif ) 
     54     !                    !  =2 or 3 for SI3 and CICE, respectively 
    5255  ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr) 
    5356/ 
     
    188191   ln_dynspg_ts   = .true.   ! split-explicit free surface 
    189192      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    190          nn_baro      =  30         ! =F : the number of sub-step in rn_rdt seconds 
     193         nn_e      =  30         ! =F : the number of sub-step in rn_Dt seconds 
    191194/ 
    192195!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/BENCH/EXPREF/namelist_pisces_cfg

    r10343 r12928  
    8181/ 
    8282!----------------------------------------------------------------------- 
    83 &nampissbc     !   parameters for inputs deposition 
     83&nampisbc      !   parameters for inputs deposition 
    8484!----------------------------------------------------------------------- 
    85    ln_dust     =  .false.   ! boolean for dust input from the atmosphere 
    86    ln_solub    =  .false.   ! boolean for variable solubility of atm. Iron 
    87    ln_river    =  .false.   ! boolean for river input of nutrients 
    88    ln_ndepo    =  .false.   ! boolean for atmospheric deposition of N 
    8985   ln_ironsed  =  .false.   ! boolean for Fe input from sediments 
    9086   ln_ironice  =  .false.   ! boolean for Fe input from sea ice 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/BENCH/MY_SRC/usrdef_hgr.F90

    r9762 r12928  
    2424   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2525 
     26   !! * Substitutions 
     27#  include "do_loop_substitute.h90" 
    2628   !!---------------------------------------------------------------------- 
    2729   !! NEMO/OPA 4.0, NEMO Consortium (2016) 
     
    7274      !                           
    7375      ! Position coordinates (in grid points) 
    74       !                          ==========          
    75       DO jj = 1, jpj 
    76          DO ji = 1, jpi 
    77              
    78             zti = REAL( ji - 1 + nimpp - 1, wp )          ;  ztj = REAL( jj - 1 + njmpp - 1, wp ) 
    79             zui = REAL( ji - 1 + nimpp - 1, wp ) + 0.5_wp ;  zvj = REAL( jj - 1 + njmpp - 1, wp ) + 0.5_wp 
     76      !                          ========== 
     77      DO_2D_11_11 
     78          
     79         zti = REAL( ji - 1 + nimpp - 1, wp )          ;  ztj = REAL( jj - 1 + njmpp - 1, wp ) 
     80         zui = REAL( ji - 1 + nimpp - 1, wp ) + 0.5_wp ;  zvj = REAL( jj - 1 + njmpp - 1, wp ) + 0.5_wp 
     81          
     82         plamt(ji,jj) = zti 
     83         plamu(ji,jj) = zui 
     84         plamv(ji,jj) = zti 
     85         plamf(ji,jj) = zui 
     86          
     87         pphit(ji,jj) = ztj 
     88         pphiv(ji,jj) = zvj 
     89         pphiu(ji,jj) = ztj 
     90         pphif(ji,jj) = zvj 
    8091 
    81             plamt(ji,jj) = zti 
    82             plamu(ji,jj) = zui 
    83             plamv(ji,jj) = zti 
    84             plamf(ji,jj) = zui 
    85     
    86             pphit(ji,jj) = ztj 
    87             pphiv(ji,jj) = zvj 
    88             pphiu(ji,jj) = ztj 
    89             pphif(ji,jj) = zvj 
    90              
    91          END DO 
    92       END DO 
     92      END_2D 
    9393      !      
    9494      ! Horizontal scale factors (in meters) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/BENCH/MY_SRC/usrdef_istate.F90

    r12178 r12928  
    2828   PUBLIC   usr_def_istate   ! called by istate.F90 
    2929 
     30   !! * Substitutions 
     31#  include "do_loop_substitute.h90" 
    3032   !!---------------------------------------------------------------------- 
    3133   !! NEMO/OPA 4.0 , NEMO Consortium (2016) 
     
    6264      ! 
    6365      ! define unique value on each point. z2d ranging from 0.05 to -0.05 
    64       DO jj = 1, jpj 
    65          DO ji = 1, jpi 
    66             z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig(ji) + mjg(jj) * jpiglo, wp ) / REAL( jpiglo * jpjglo, wp ) ) 
    67          ENDDO 
    68       ENDDO 
     66      DO_2D_11_11 
     67         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig(ji) + (mjg(jj)-1) * jpiglo, wp ) / REAL( jpiglo * jpjglo, wp ) ) 
     68      END_2D 
    6969      ! 
    7070      ! sea level: 
     
    7878         pts(:,:,jk,jp_sal) = 30._wp + 1._wp * zfact + z2d(:,:)           ! 30 to 31 +/- 0.05 psu 
    7979         ! velocities: 
    80          pu(:,:,jk) = z2d(:,:) * 0.1_wp                                   ! +/- 0.005  m/s 
    81          pv(:,:,jk) = z2d(:,:) * 0.01_wp                                  ! +/- 0.0005 m/s 
     80         pu(:,:,jk) = z2d(:,:) *  0.1_wp * umask(:,:,jk)                  ! +/- 0.005  m/s 
     81         pv(:,:,jk) = z2d(:,:) * 0.01_wp * vmask(:,:,jk)                  ! +/- 0.0005 m/s 
    8282      ENDDO 
    8383      ! 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/BENCH/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    5555      !                              !!* nammpp namelist *!! 
    5656      INTEGER          ::   jpni, jpnj 
    57       LOGICAL          ::   ln_nnogather 
     57      LOGICAL          ::   ln_nnogather, ln_listonly 
    5858      !! 
    5959      NAMELIST/namusr_def/ nn_isize, nn_jsize, nn_ksize, nn_perio 
    60       NAMELIST/nammpp/ jpni, jpnj, ln_nnogather 
     60      NAMELIST/nammpp/ jpni, jpnj, ln_nnogather, ln_listonly 
    6161      !!----------------------------------------------------------------------      
    6262      ! 
    63       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6463      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 903 ) 
    6564903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
     
    7271      IF( nn_isize < 0 .AND. nn_jsize < 0 ) THEN 
    7372      ! 
    74          REWIND( numnam_ref )              ! Namelist nammpp in reference namelist: mpi variables 
    7573         READ  ( numnam_ref, nammpp, IOSTAT = ios, ERR = 901) 
    7674901      IF( ios /= 0 )   CALL ctl_nam ( ios , 'nammpp in reference namelist' ) 
    7775         ! 
    78          REWIND( numnam_cfg )              ! Namelist nammpp in configuration namelist: mpi variables 
    7976         READ  ( numnam_cfg, nammpp, IOSTAT = ios, ERR = 902 ) 
    8077902      IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist' ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/BENCH/MY_SRC/usrdef_sbc.F90

    r10179 r12928  
    3434   PUBLIC   usrdef_sbc_ice_flx  ! routine called by sbcice_lim.F90 for ice thermo 
    3535 
     36   !! * Substitutions 
     37#  include "do_loop_substitute.h90" 
    3638   !!---------------------------------------------------------------------- 
    3739   !! NEMO/OPA 4.0 , NEMO Consortium (2016) 
     
    4143CONTAINS 
    4244 
    43    SUBROUTINE usrdef_sbc_oce( kt ) 
     45   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4446      !!--------------------------------------------------------------------- 
    4547      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5658      !!---------------------------------------------------------------------- 
    5759      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     60      INTEGER, INTENT(in) ::   Kbb  ! ocean time index 
    5861      !!--------------------------------------------------------------------- 
    5962      !      
     
    101104      ! 
    102105      ! define unique value on each point. z2d ranging from 0.05 to -0.05 
    103       DO jj = 1, jpj 
    104          DO ji = 1, jpi 
    105             z2d(ji,jj) = 0.1 * ( 0.5 - REAL( nimpp + ji - 1 + ( njmpp + jj - 2 ) * jpiglo, wp ) / REAL( jpiglo * jpjglo, wp ) ) 
    106          ENDDO 
    107       ENDDO 
     106      DO_2D_11_11 
     107         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( nimpp + ji - 1 + ( njmpp + jj - 2 ) * jpiglo, wp ) / REAL( jpiglo * jpjglo, wp ) ) 
     108      END_2D 
    108109      utau_ice(:,:) = 0.1_wp +  z2d(:,:) 
    109110      vtau_ice(:,:) = 0.1_wp +  z2d(:,:) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/BENCH/MY_SRC/usrdef_zgr.F90

    r12178 r12928  
    3030   PUBLIC   usr_def_zgr        ! called by domzgr.F90 
    3131 
    32   !! * Substitutions 
    33 #  include "vectopt_loop_substitute.h90" 
    3432   !!---------------------------------------------------------------------- 
    3533   !! NEMO/OPA 4.0 , NEMO Consortium (2016) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/EXPREF/context_nemo.xml

    r12178 r12928  
    55--> 
    66<context id="nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
    88    <variable_definition> 
    9     <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
    10        <variable id="ref_year" type="int"   > 1800 </variable> 
    11        <variable id="rau0"     type="float" > 1026.0 </variable> 
    12        <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
    13        <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
    14        <variable id="rhoic"    type="float" > 917.0 </variable> 
    15        <variable id="rhosn"    type="float" > 330.0 </variable> 
    16        <variable id="missval"  type="float" > 1.e20 </variable> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"  type="float" > 1.e20 </variable>           
    1719    </variable_definition> 
     20 
    1821<!-- Fields definition --> 
    1922    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    2124<!-- Files definition --> 
    2225    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     --> 
    23     <!--  
    24 ============================================================================================================ 
    25 = grid definition = = DO NOT CHANGE = 
    26 ============================================================================================================ 
    27     --> 
    28      
    29     <axis_definition> 
    30       <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
    31       <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
    32       <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
    33       <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
    34       <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
    35       <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
    36       <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
    37       <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
    38       <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    39     </axis_definition> 
     26 
     27<!-- Axis definition --> 
     28    <axis_definition src="./axis_def_nemo.xml"/> 
    4029  
     30<!-- Domain definition --> 
    4131    <domain_definition src="./domain_def_nemo.xml"/> 
     32 
     33<!-- Grids definition --> 
     34    <grid_definition   src="./grid_def_nemo.xml"/> 
    4235   
    43     <grid_definition src="./grid_def_nemo.xml"/> 
    4436 
    4537</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/EXPREF/field_def_nemo-oce.xml

    r9572 r12928  
    11<?xml version="1.0"?>  
    22    <!-- $id$ --> 
     3 
     4    <field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined --> 
     5 
     6    <!-- 
     7       ===================================================================================================== 
     8       =                                   Configurable diagnostics                                        = 
     9       ===================================================================================================== 
     10      --> 
     11 
     12    <field_group id="diamlr_fields"> 
     13 
     14    <!-- 
     15       ===================================================================================================== 
     16                         Configuration of multiple-linear-regression analysis (diamlr) 
     17       ===================================================================================================== 
     18        
     19       This field group configures diamlr for tidal harmonic analysis of field 
     20       ssh: in addition to a regressor for fitting the mean value (diamlr_r101), 
     21       it includes the regressors for the analysis of the tidal constituents 
     22       that are available in the tidal-forcing implementation (see 
     23       ./src/OCE/SBC/tide.h90). 
     24 
     25      --> 
     26 
     27      <!-- Time --> 
     28      <field id="diamlr_time" grid_ref="diamlr_grid_T_2D" prec="8" /> 
     29 
     30      <!-- Regressors for tidal harmonic analysis --> 
     31      <field id="diamlr_r001"  field_ref="diamlr_time" expr="sin( __TDE_M2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:M2"   /> 
     32      <field id="diamlr_r002"  field_ref="diamlr_time" expr="cos( __TDE_M2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:M2"   /> 
     33      <field id="diamlr_r003"  field_ref="diamlr_time" expr="sin( __TDE_N2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:N2"   /> 
     34      <field id="diamlr_r004"  field_ref="diamlr_time" expr="cos( __TDE_N2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:N2"   /> 
     35      <field id="diamlr_r005"  field_ref="diamlr_time" expr="sin( __TDE_2N2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:2N2"  /> 
     36      <field id="diamlr_r006"  field_ref="diamlr_time" expr="cos( __TDE_2N2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:2N2"  /> 
     37      <field id="diamlr_r007"  field_ref="diamlr_time" expr="sin( __TDE_S2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:S2"   /> 
     38      <field id="diamlr_r008"  field_ref="diamlr_time" expr="cos( __TDE_S2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:S2"   /> 
     39      <field id="diamlr_r009"  field_ref="diamlr_time" expr="sin( __TDE_K2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:K2"   /> 
     40      <field id="diamlr_r010"  field_ref="diamlr_time" expr="cos( __TDE_K2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:K2"   /> 
     41      <field id="diamlr_r011"  field_ref="diamlr_time" expr="sin( __TDE_K1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:K1"   /> 
     42      <field id="diamlr_r012"  field_ref="diamlr_time" expr="cos( __TDE_K1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:K1"   /> 
     43      <field id="diamlr_r013"  field_ref="diamlr_time" expr="sin( __TDE_O1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:O1"   /> 
     44      <field id="diamlr_r014"  field_ref="diamlr_time" expr="cos( __TDE_O1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:O1"   /> 
     45      <field id="diamlr_r015"  field_ref="diamlr_time" expr="sin( __TDE_Q1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Q1"   /> 
     46      <field id="diamlr_r016"  field_ref="diamlr_time" expr="cos( __TDE_Q1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Q1"   /> 
     47      <field id="diamlr_r017"  field_ref="diamlr_time" expr="sin( __TDE_P1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:P1"   /> 
     48      <field id="diamlr_r018"  field_ref="diamlr_time" expr="cos( __TDE_P1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:P1"   /> 
     49      <field id="diamlr_r019"  field_ref="diamlr_time" expr="sin( __TDE_M4_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:M4"   /> 
     50      <field id="diamlr_r020"  field_ref="diamlr_time" expr="cos( __TDE_M4_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:M4"   /> 
     51      <field id="diamlr_r021"  field_ref="diamlr_time" expr="sin( __TDE_Mf_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Mf"   /> 
     52      <field id="diamlr_r022"  field_ref="diamlr_time" expr="cos( __TDE_Mf_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Mf"   /> 
     53      <field id="diamlr_r023"  field_ref="diamlr_time" expr="sin( __TDE_Mm_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Mm"   /> 
     54      <field id="diamlr_r024"  field_ref="diamlr_time" expr="cos( __TDE_Mm_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Mm"   /> 
     55      <field id="diamlr_r025"  field_ref="diamlr_time" expr="sin( __TDE_Msqm_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Msqm" /> 
     56      <field id="diamlr_r026"  field_ref="diamlr_time" expr="cos( __TDE_Msqm_omega__ * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Msqm" /> 
     57      <field id="diamlr_r027"  field_ref="diamlr_time" expr="sin( __TDE_Mtm_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:Mtm"  /> 
     58      <field id="diamlr_r028"  field_ref="diamlr_time" expr="cos( __TDE_Mtm_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:Mtm"  /> 
     59      <field id="diamlr_r029"  field_ref="diamlr_time" expr="sin( __TDE_S1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:S1"   /> 
     60      <field id="diamlr_r030"  field_ref="diamlr_time" expr="cos( __TDE_S1_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:S1"   /> 
     61      <field id="diamlr_r031"  field_ref="diamlr_time" expr="sin( __TDE_MU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:MU2"  /> 
     62      <field id="diamlr_r032"  field_ref="diamlr_time" expr="cos( __TDE_MU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:MU2"  /> 
     63      <field id="diamlr_r033"  field_ref="diamlr_time" expr="sin( __TDE_NU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:NU2"  /> 
     64      <field id="diamlr_r034"  field_ref="diamlr_time" expr="cos( __TDE_NU2_omega__  * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:NU2"  /> 
     65      <field id="diamlr_r035"  field_ref="diamlr_time" expr="sin( __TDE_L2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:L2"   /> 
     66      <field id="diamlr_r036"  field_ref="diamlr_time" expr="cos( __TDE_L2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:L2"   /> 
     67      <field id="diamlr_r037"  field_ref="diamlr_time" expr="sin( __TDE_T2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:sin:T2"   /> 
     68      <field id="diamlr_r038"  field_ref="diamlr_time" expr="cos( __TDE_T2_omega__   * diamlr_time )" enabled=".TRUE."  comment="harmonic:cos:T2"   /> 
     69      <field id="diamlr_r101"  field_ref="diamlr_time" expr="diamlr_time^0.0"                         enabled=".TRUE."  comment="mean"              /> 
     70 
     71      <!-- Fields selected for regression analysis --> 
     72      <field id="diamlr_f001" field_ref="ssh" enabled=".TRUE." /> 
     73 
     74    </field_group> 
    375     
    476    <!--  
     
    880============================================================================================================ 
    981    --> 
    10    <field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined --> 
     82 
     83    <field_group id="diadetide_fields"> 
     84 
     85    <!-- 
     86       ===================================================================================================== 
     87                 Weight fields for the computation of daily detided model diagnostics (diadetide) 
     88       ===================================================================================================== 
     89 
     90       --> 
     91 
     92      <field id="diadetide_weight" grid_ref="diadetide_grid_T_2D" enabled=".TRUE." /> 
     93      <field id="diadetide_weight_grid_T_2D" field_ref="diadetide_weight" grid_ref="diadetide_grid_T_2D" enabled=".TRUE." > this </field> 
     94      <field id="diadetide_weight_grid_U_2D" field_ref="diadetide_weight" grid_ref="diadetide_grid_U_2D" enabled=".TRUE." > this </field> 
     95      <field id="diadetide_weight_grid_V_2D" field_ref="diadetide_weight" grid_ref="diadetide_grid_V_2D" enabled=".TRUE." > this </field> 
     96      <field id="diadetide_weight_grid_T_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_T_3D" enabled=".TRUE." > this </field> 
     97      <field id="diadetide_weight_grid_U_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_U_3D" enabled=".TRUE." > this </field> 
     98      <field id="diadetide_weight_grid_V_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_V_3D" enabled=".TRUE." > this </field> 
     99      <field id="diadetide_weight_grid_W_3D" field_ref="diadetide_weight" grid_ref="diadetide_grid_2D_to_grid_W_3D" enabled=".TRUE." > this </field> 
     100 
     101    </field_group> 
    11102 
    12103    <!--  
     
    19110       
    20111      <field_group id="grid_T" grid_ref="grid_T_2D" > 
    21          <field id="salgrad"          long_name="module of salinity gradient"              unit="psu/m"   grid_ref="grid_T_3D"/> 
    22          <field id="salgrad2"         long_name="square of module of salinity gradient"    unit="psu2/m2" grid_ref="grid_T_3D"/> 
    23          <field id="ke"             long_name="kinetic energy"                           unit="m2/s2"   grid_ref="grid_T_3D"/> 
    24          <field id="ke_zint"        long_name="vertical integration of kinetic energy"   unit="m3/s2"   /> 
    25          <field id="relvor"           long_name="relative vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/> 
    26          <field id="absvor"           long_name="absolute vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/> 
    27          <field id="potvor"           long_name="potential vorticity"                      unit="s-1"    grid_ref="grid_T_3D"/> 
    28          <field id="e3t"          long_name="T-cell thickness"   standard_name="cell_thickness"   unit="m"   grid_ref="grid_T_3D"/> 
    29          <field id="e3t_surf"     long_name="T-cell thickness"   field_ref="e3t"  standard_name="cell_thickness"   unit="m"   grid_ref="grid_T_SFC"/> 
    30          <field id="e3t_0"        long_name="Initial T-cell thickness"   standard_name="ref_cell_thickness"   unit="m"   grid_ref="grid_T_3D"/> 
    31  
    32          <field id="toce"         long_name="temperature"         standard_name="sea_water_potential_temperature"   unit="degC"     grid_ref="grid_T_3D"/> 
    33          <field id="toce_e3t"     long_name="temperature (thickness weighted)"                                      unit="degC"     grid_ref="grid_T_3D" > toce * e3t </field > 
    34          <field id="soce"         long_name="salinity"            standard_name="sea_water_practical_salinity"      unit="1e-3"     grid_ref="grid_T_3D"/> 
    35          <field id="soce_e3t"     long_name="salinity    (thickness weighted)"                                      unit="1e-3"     grid_ref="grid_T_3D" > soce * e3t </field > 
    36  
    37          <!-- t-eddy viscosity coefficients (ldfdyn) --> 
    38     <field id="ahmt_2d"      long_name=" surface t-eddy viscosity coefficient"   unit="m2/s or m4/s" /> 
    39     <field id="ahmt_3d"      long_name=" 3D      t-eddy viscosity coefficient"   unit="m2/s or m4/s"                           grid_ref="grid_T_3D"/> 
    40  
    41          <field id="sst"          long_name="sea surface temperature"             standard_name="sea_surface_temperature"             unit="degC"     /> 
    42          <field id="sst2"         long_name="square of sea surface temperature"   standard_name="square_of_sea_surface_temperature"   unit="degC2"     > sst * sst </field > 
    43          <field id="sstmax"       long_name="max of sea surface temperature"   field_ref="sst"   operation="maximum"                                  /> 
    44          <field id="sstmin"       long_name="min of sea surface temperature"   field_ref="sst"   operation="minimum"                                  /> 
    45          <field id="sstgrad"      long_name="module of sst gradient"                                                                  unit="degC/m"   /> 
    46          <field id="sstgrad2"     long_name="square of module of sst gradient"                                                        unit="degC2/m2" /> 
    47          <field id="sbt"          long_name="sea bottom temperature"                                                                  unit="degC"     /> 
    48          <field id="tosmint"      long_name="vertical integral of temperature times density"   standard_name="integral_wrt_depth_of_product_of_density_and_potential_temperature"  unit="(kg m2) degree_C" /> 
    49          <field id="sst_wl"       long_name="Delta SST of warm layer"                                                                 unit="degC"     /> 
    50          <field id="sst_cs"       long_name="Delta SST of cool skin"                                                                  unit="degC"     /> 
    51     <field id="temp_3m"      long_name="temperature at 3m"                                                                       unit="degC"     /> 
    52           
    53          <field id="sss"          long_name="sea surface salinity"             standard_name="sea_surface_salinity"   unit="1e-3" /> 
    54          <field id="sss2"         long_name="square of sea surface salinity"                                          unit="1e-6"  > sss * sss </field > 
    55          <field id="sssmax"       long_name="max of sea surface salinity"   field_ref="sss"   operation="maximum"                 /> 
    56          <field id="sssmin"       long_name="min of sea surface salinity"   field_ref="sss"   operation="minimum"                 /> 
    57          <field id="sbs"          long_name="sea bottom salinity"                                                     unit="0.001" /> 
    58          <field id="somint"       long_name="vertical integral of salinity times density"   standard_name="integral_wrt_depth_of_product_of_density_and_salinity"  unit="(kg m2) x (1e-3)" />  
    59  
    60          <field id="taubot"       long_name="bottom stress module"                                                    unit="N/m2" />  
    61  
    62          <field id="ssh"          long_name="sea surface height"             standard_name="sea_surface_height_above_geoid"             unit="m" /> 
    63          <field id="ssh2"         long_name="square of sea surface height"   standard_name="square_of_sea_surface_height_above_geoid"   unit="m2" > ssh * ssh </field > 
    64          <field id="wetdep"       long_name="wet depth"                      standard_name="wet_depth"                unit="m" /> 
    65          <field id="sshmax"       long_name="max of sea surface height"   field_ref="ssh"   operation="maximum"                                  /> 
    66  
    67          <field id="mldkz5"       long_name="Turbocline depth (Kz = 5e-4)"                       standard_name="ocean_mixed_layer_thickness_defined_by_vertical_tracer_diffusivity"                unit="m"          /> 
    68          <field id="mldr10_1"     long_name="Mixed Layer Depth (dsigma = 0.01 wrt 10m)"          standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"          /> 
    69          <field id="mldr10_1max"  long_name="Max of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="maximum"                                                                          /> 
    70          <field id="mldr10_1min"  long_name="Min of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="minimum"                                                                          /> 
    71          <field id="heatc"        long_name="Heat content vertically integrated"                 standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"       /> 
    72          <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3*kg/m2" /> 
    73          <field id="salt2c"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3*kg/m2" /> 
    74  
    75          <!-- EOS --> 
    76          <field id="alpha"        long_name="thermal expansion"                                                         unit="degC-1" grid_ref="grid_T_3D" /> 
    77          <field id="beta"         long_name="haline contraction"                                                        unit="1e3"    grid_ref="grid_T_3D" /> 
    78          <field id="bn2"          long_name="squared Brunt-Vaisala frequency"                                           unit="s-1"    grid_ref="grid_T_3D" /> 
    79          <field id="rhop"         long_name="potential density (sigma0)"        standard_name="sea_water_sigma_theta"   unit="kg/m3"  grid_ref="grid_T_3D" /> 
    80  
    81          <!-- Energy - horizontal divergence --> 
    82          <field id="eken"         long_name="kinetic energy"          standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_3D" /> 
    83          <field id="hdiv"         long_name="horizontal divergence"                                                          unit="s-1"    grid_ref="grid_T_3D" /> 
    84  
    85          <!-- variables available with MLE --> 
    86          <field id="Lf_NHpf"      long_name="MLE: Lf = N H / f"   unit="m" /> 
    87  
    88          <!-- next variables available with key_diahth --> 
    89          <field id="mlddzt"       long_name="Thermocline Depth (depth of max dT/dz)"         standard_name="depth_at_maximum_upward_derivative_of_sea_water_potential_temperature"             unit="m"                         /> 
    90          <field id="mldr10_3"     long_name="Mixed Layer Depth (dsigma = 0.03 wrt 10m)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
    91          <field id="mldr0_1"      long_name="Mixed Layer Depth (dsigma = 0.01 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
    92          <field id="mldr0_3"      long_name="Mixed Layer Depth (dsigma = 0.03 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
    93          <field id="mld_dt02"     long_name="Mixed Layer Depth (|dT| = 0.2 wrt 10m)"         standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         /> 
    94          <field id="topthdep"     long_name="Top of Thermocline Depth (dT = -0.2 wrt 10m)"   standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         /> 
    95          <field id="pycndep"      long_name="Pycnocline Depth (dsigma[dT=-0.2] wrt 10m)"     standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
    96          <field id="BLT"          long_name="Barrier Layer Thickness"                                                                                                                          unit="m"                          > topthdep - pycndep </field> 
    97          <field id="tinv"         long_name="Max of vertical invertion of temperature"                                                                                                         unit="degC"                      /> 
    98          <field id="depti"        long_name="Depth of max. vert. inv. of temperature"                                                                                                          unit="m"                         /> 
    99          <field id="20d"          long_name="Depth of 20C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"      axis_ref="iax_20C" /> 
    100          <field id="28d"          long_name="Depth of 28C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"      axis_ref="iax_28C" /> 
    101          <field id="hc300"        long_name="Heat content 0-300m"                            standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      /> 
    102  
    103          <!-- variables available with diaar5 --> 
    104          <field id="botpres"      long_name="Sea Water Pressure at Sea Floor"   standard_name="sea_water_pressure_at_sea_floor"   unit="dbar" /> 
    105          <field id="sshdyn"       long_name="dynamic sea surface height"     standard_name="dynamic_sea_surface_height_above_geoid"     unit="m" /> 
    106          <field id="sshdyn2"      long_name="square of dynamic sea surface height"     standard_name="dynamic_sea_surface_height_above_geoid_squared"     unit="m2" > sshdyn * sshdyn </field> 
    107          <field id="tnpeo"      long_name="Tendency of ocean potential energy content"          unit="W/m2"                           /> 
    108  
    109          <!-- variables available ln_linssh=.FALSE. --> 
    110          <field id="tpt_dep"      long_name="T-point depth"                  standard_name="depth_below_geoid"   unit="m"   grid_ref="grid_T_3D" /> 
    111          <field id="e3tdef"       long_name="T-cell thickness deformation"                                       unit="%"   grid_ref="grid_T_3D" /> 
     112 
     113        <field id="salgrad"          long_name="module of salinity gradient"              unit="psu/m"   grid_ref="grid_T_3D"/> 
     114        <field id="salgrad2"         long_name="square of module of salinity gradient"    unit="psu2/m2" grid_ref="grid_T_3D"/> 
     115        <field id="ke"               long_name="kinetic energy"                           unit="m2/s2"   grid_ref="grid_T_3D"/> 
     116        <field id="ke_zint"          long_name="vertical integration of kinetic energy"   unit="m3/s2"   /> 
     117        <field id="relvor"           long_name="relative vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/> 
     118        <field id="absvor"           long_name="absolute vorticity"                       unit="s-1"    grid_ref="grid_T_3D"/> 
     119        <field id="potvor"           long_name="potential vorticity"                      unit="s-1"    grid_ref="grid_T_3D"/> 
     120        <field id="sstgrad2"         long_name="square of module of sst gradient"         unit="degC2/m2" /> 
     121    
     122        <field id="e3t"          long_name="T-cell thickness"                    standard_name="cell_thickness"        unit="m"   grid_ref="grid_T_3D" /> 
     123        <field id="e3ts"         long_name="T-cell thickness"   field_ref="e3t"  standard_name="cell_thickness"        unit="m"   grid_ref="grid_T_SFC"/> 
     124        <field id="e3t_0"        long_name="Initial T-cell thickness"            standard_name="ref_cell_thickness"    unit="m"   grid_ref="grid_T_3D" /> 
     125        <field id="e3tb"         long_name="bottom T-cell thickness"             standard_name="bottom_cell_thickness" unit="m"   grid_ref="grid_T_2D"/>  
     126        <field id="e3t_300"      field_ref="e3t"                grid_ref="grid_T_zoom_300"       detect_missing_value="true" /> 
     127        <field id="e3t_vsum300"  field_ref="e3t_300"            grid_ref="grid_T_vsum"   detect_missing_value="true" /> 
     128   <field id="masscello"    long_name="Sea Water Mass per unit area"   standard_name="sea_water_mass_per_unit_area"   unit="kg/m2"   grid_ref="grid_T_3D"/> 
     129        <field id="volcello"     long_name="Ocean Volume"                   standard_name="ocean_volume"   unit="m3"       grid_ref="grid_T_3D"/>  
     130        <field id="toce"         long_name="temperature"                         standard_name="sea_water_potential_temperature"   unit="degC"     grid_ref="grid_T_3D"/> 
     131        <field id="toce_e3t"     long_name="temperature (thickness weighted)"                                                      unit="degC"     grid_ref="grid_T_3D" > toce * e3t </field > 
     132        <field id="soce"         long_name="salinity"                            standard_name="sea_water_practical_salinity"      unit="1e-3"     grid_ref="grid_T_3D"/> 
     133        <field id="soce_e3t"     long_name="salinity    (thickness weighted)"                                                      unit="1e-3"     grid_ref="grid_T_3D" > soce * e3t </field > 
     134 
     135        <field id="toce_e3t_300"      field_ref="toce_e3t"          unit="degree_C"     grid_ref="grid_T_zoom_300"      detect_missing_value="true" /> 
     136        <field id="toce_e3t_vsum300"  field_ref="toce_e3t_300"      unit="degress_C*m"  grid_ref="grid_T_vsum"  detect_missing_value="true" /> 
     137        <field id="toce_vmean300"     field_ref="toce_e3t_vsum300"  unit="degree_C"     grid_ref="grid_T_vsum"  detect_missing_value="true" > toce_e3t_vsum300/e3t_vsum300 </field> 
     138 
     139        <!-- AGRIF sponge --> 
     140        <field id="agrif_spt"         long_name=" AGRIF t-sponge coefficient"   unit=" " /> 
     141 
     142        <!-- t-eddy viscosity coefficients (ldfdyn) --> 
     143   <field id="ahmt_2d"      long_name=" surface t-eddy viscosity coefficient"   unit="m2/s or m4/s"                      /> 
     144   <field id="ahmt_3d"      long_name=" 3D      t-eddy viscosity coefficient"   unit="m2/s or m4/s"  grid_ref="grid_T_3D"/> 
     145 
     146        <field id="sst"          long_name="Bulk sea surface temperature"                       standard_name="bulk_sea_surface_temperature"        unit="degC"     /> 
     147        <field id="t_skin"       long_name="Skin temperature aka SSST"                          standard_name="skin_temperature"                    unit="degC"     /> 
     148        <field id="sst2"         long_name="square of sea surface temperature"                  standard_name="square_of_sea_surface_temperature"   unit="degC2"     > sst * sst </field > 
     149        <field id="sstmax"       long_name="max of sea surface temperature"   field_ref="sst"   operation="maximum"                                                 /> 
     150        <field id="sstmin"       long_name="min of sea surface temperature"   field_ref="sst"   operation="minimum"                                                 /> 
     151        <field id="sstgrad"      long_name="module of sst gradient"                                                                                 unit="degC/m"   /> 
     152        <field id="sstgrad2"     long_name="square of module of sst gradient"                                                                       unit="degC2/m2" /> 
     153        <field id="sbt"          long_name="sea bottom temperature"                                                                                 unit="degC"     /> 
     154        <field id="tosmint"      long_name="vertical integral of temperature times density"     standard_name="integral_wrt_depth_of_product_of_density_and_potential_temperature"  unit="(kg m2) degree_C" /> 
     155        <field id="sst_wl"       long_name="Delta SST of warm layer"                                                                                unit="degC"     /> 
     156        <field id="sst_cs"       long_name="Delta SST of cool skin"                                                                                 unit="degC"     /> 
     157   <field id="temp_3m"      long_name="temperature at 3m"                                                                                      unit="degC"     /> 
     158         
     159        <field id="sss"          long_name="sea surface salinity"                               standard_name="sea_surface_salinity"                unit="1e-3"     /> 
     160        <field id="sss2"         long_name="square of sea surface salinity"                                                                         unit="1e-6"      > sss * sss </field > 
     161        <field id="sssmax"       long_name="max of sea surface salinity"      field_ref="sss"   operation="maximum"                                                 /> 
     162        <field id="sssmin"       long_name="min of sea surface salinity"      field_ref="sss"   operation="minimum"                                                 /> 
     163        <field id="sbs"          long_name="sea bottom salinity"                                                                                    unit="0.001"    /> 
     164        <field id="somint"       long_name="vertical integral of salinity times density"        standard_name="integral_wrt_depth_of_product_of_density_and_salinity"  unit="(kg m2) x (1e-3)" />  
     165 
     166        <field id="taubot"       long_name="bottom stress module"                                                                                   unit="N/m2"     />  
     167 
     168         <!-- Case EOS = TEOS-10 : output potential temperature --> 
     169   <field id="toce_pot"     long_name="Sea Water Potential Temperature"              standard_name="sea_water_potential_temperature"   unit="degC"     grid_ref="grid_T_3D"/> 
     170        <field id="sst_pot"      long_name="potential sea surface temperature"             standard_name="sea_surface_temperature"             unit="degC"     /> 
     171        <field id="tosmint_pot"  long_name="vertical integral of potential temperature times density"   standard_name="integral_wrt_depth_of_product_of_density_and_potential_temperature"  unit="(kg m2) degree_C" /> 
     172 
     173 
     174        <field id="ssh"          long_name="sea surface height"                                 standard_name="sea_surface_height_above_geoid"             unit="m" /> 
     175        <field id="ssh2"         long_name="square of sea surface height"                       standard_name="square_of_sea_surface_height_above_geoid"   unit="m2" > ssh * ssh </field > 
     176        <field id="wetdep"       long_name="wet depth"                                          standard_name="wet_depth"                                  unit="m" /> 
     177        <field id="sshmax"       long_name="max of sea surface height"        field_ref="ssh"   operation="maximum"                                                 /> 
     178 
     179        <field id="mldkz5"       long_name="Turbocline depth (Kz = 5e-4)"                       standard_name="ocean_mixed_layer_thickness_defined_by_vertical_tracer_diffusivity"                unit="m"          /> 
     180        <field id="mldr10_1"     long_name="Mixed Layer Depth (dsigma = 0.01 wrt 10m)"          standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"          /> 
     181        <field id="mldr10_1max"  long_name="Max of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="maximum"                                                                          /> 
     182        <field id="mldr10_1min"  long_name="Min of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="minimum"                                                                          /> 
     183        <field id="heatc"        long_name="Heat content vertically integrated"                 standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"       /> 
     184        <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3*kg/m2" /> 
     185 
     186        <!-- EOS --> 
     187        <field id="alpha"        long_name="thermal expansion"                                                         unit="degC-1" grid_ref="grid_T_3D" /> 
     188        <field id="beta"         long_name="haline contraction"                                                        unit="1e3"    grid_ref="grid_T_3D" /> 
     189        <field id="bn2"          long_name="squared Brunt-Vaisala frequency"                                           unit="s-1"    grid_ref="grid_T_3D" /> 
     190        <field id="rhop"         long_name="potential density (sigma0)"        standard_name="sea_water_sigma_theta"   unit="kg/m3"  grid_ref="grid_T_3D" /> 
     191 
     192        <!-- Energy - horizontal divergence --> 
     193        <field id="eken"         long_name="kinetic energy"          standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_3D" /> 
     194        <field id="hdiv"         long_name="horizontal divergence"                                                          unit="s-1"    grid_ref="grid_T_3D" /> 
     195 
     196        <!-- variables available with MLE --> 
     197        <field id="Lf_NHpf"      long_name="MLE: Lf = N H / f"   unit="m" /> 
     198 
     199        <!-- next variables available with ln_zad_Aimp=.true. --> 
     200        <field id="Courant"      long_name="Courant number"                                                                 unit="#"   grid_ref="grid_T_3D" /> 
     201        <field id="wimp"         long_name="Implicit vertical velocity"                                                     unit="m/s" grid_ref="grid_T_3D" /> 
     202        <field id="wexp"         long_name="Explicit vertical velocity"                                                     unit="m/s" grid_ref="grid_T_3D" /> 
     203        <field id="wi_cff"       long_name="Fraction of implicit vertical velocity"                                         unit="#"   grid_ref="grid_T_3D" /> 
     204 
     205        <!-- next variables available with key_diahth --> 
     206        <field id="mlddzt"       long_name="Thermocline Depth (depth of max dT/dz)"         standard_name="depth_at_maximum_upward_derivative_of_sea_water_potential_temperature"             unit="m"                         /> 
     207        <field id="mldr10_3"     long_name="Mixed Layer Depth (dsigma = 0.03 wrt 10m)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
     208        <field id="mldr0_1"      long_name="Mixed Layer Depth (dsigma = 0.01 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
     209        <field id="mldr0_3"      long_name="Mixed Layer Depth (dsigma = 0.03 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
     210        <field id="mld_dt02"     long_name="Mixed Layer Depth (|dT| = 0.2 wrt 10m)"         standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         /> 
     211        <field id="topthdep"     long_name="Top of Thermocline Depth (dT = -0.2 wrt 10m)"   standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         /> 
     212        <field id="pycndep"      long_name="Pycnocline Depth (dsigma[dT=-0.2] wrt 10m)"     standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         /> 
     213        <field id="BLT"          long_name="Barrier Layer Thickness"                                                                                                                          unit="m"   > topthdep - pycndep </field> 
     214        <field id="tinv"         long_name="Max of vertical invertion of temperature"                                                                                                         unit="degC"                      /> 
     215        <field id="depti"        long_name="Depth of max. vert. inv. of temperature"                                                                                                          unit="m"                         /> 
     216   <field id="20d"          long_name="Depth of 20C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   axis_ref="iax_20C" /> 
     217        <field id="26d"          long_name="Depth of 26C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   axis_ref="iax_26C"   /> 
     218        <field id="28d"          long_name="Depth of 28C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"   axis_ref="iax_28C" /> 
     219        <field id="hc300"        long_name="Heat content 0-300m"                            standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      /> 
     220        <field id="hc700"        long_name="Heat content 0-700m"                            standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      /> 
     221        <field id="hc2000"       long_name="Heat content 0-2000m"                           standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      /> 
     222 
     223        <!-- variables available with diaar5 --> 
     224        <field id="botpres"      long_name="Sea Water Pressure at Sea Floor"          standard_name="sea_water_pressure_at_sea_floor"                    unit="dbar" /> 
     225        <field id="sshdyn"       long_name="dynamic sea surface height"               standard_name="dynamic_sea_surface_height_above_geoid"             unit="m"    /> 
     226        <field id="sshdyn2"      long_name="square of dynamic sea surface height"     standard_name="dynamic_sea_surface_height_above_geoid_squared"     unit="m2"    > sshdyn * sshdyn </field> 
     227        <field id="tnpeo"      long_name="Tendency of ocean potential energy content"                                                                    unit="W/m2" /> 
     228 
     229        <!-- variables available ln_linssh=.FALSE. --> 
     230        <field id="tpt_dep"      long_name="T-point depth"                  standard_name="depth_below_geoid"   unit="m"   grid_ref="grid_T_3D" /> 
     231        <field id="e3tdef"       long_name="T-cell thickness deformation"                                       unit="%"   grid_ref="grid_T_3D" /> 
     232 
     233        <!-- variables available with ln_diacfl=.true. --> 
     234        <field id="cfl_cu"       long_name="u-courant number"   unit="#" /> 
     235        <field id="cfl_cv"       long_name="v-courant number"   unit="#" /> 
     236        <field id="cfl_cw"       long_name="w-courant number"   unit="#" /> 
     237 
     238      </field_group> <!-- grid_T --> 
     239 
     240      <!-- Tides --> 
     241 
     242      <field_group id="Tides_T" grid_ref="grid_T_2D" operation="once" > 
     243        <!-- Tidal potential --> 
     244        <field id="tide_pot"      long_name="Total tidal potential" unit="m" /> 
     245        <field id="tide_pot_M2"   long_name="M2 tidal potential"    unit="m" /> 
     246        <field id="tide_pot_N2"   long_name="N2 tidal potential"    unit="m" /> 
     247        <field id="tide_pot_2N2"  long_name="2N2 tidal potential"   unit="m" /> 
     248        <field id="tide_pot_S2"   long_name="S2 tidal potential"    unit="m" /> 
     249        <field id="tide_pot_K2"   long_name="K2 tidal potential"    unit="m" /> 
     250        <field id="tide_pot_K1"   long_name="K1 tidal potential"    unit="m" /> 
     251        <field id="tide_pot_O1"   long_name="O1 tidal potential"    unit="m" /> 
     252        <field id="tide_pot_Q1"   long_name="Q1 tidal potential"    unit="m" /> 
     253        <field id="tide_pot_P1"   long_name="P1 tidal potential"    unit="m" /> 
     254        <field id="tide_pot_M4"   long_name="M4 tidal potential"    unit="m" /> 
     255        <field id="tide_pot_Mf"   long_name="Mf tidal potential"    unit="m" /> 
     256        <field id="tide_pot_Mm"   long_name="Mm tidal potential"    unit="m" /> 
     257        <field id="tide_pot_Msqm" long_name="Msqm tidal potential"  unit="m" /> 
     258        <field id="tide_pot_Mtm"  long_name="Mtm tidal potential"   unit="m" /> 
     259        <field id="tide_pot_S1"   long_name="S1 tidal potential"    unit="m" /> 
     260        <field id="tide_pot_MU2"  long_name="MU2 tidal potential"   unit="m" /> 
     261        <field id="tide_pot_NU2"  long_name="NU2 tidal potential"   unit="m" /> 
     262        <field id="tide_pot_L2"   long_name="L2 tidal potential"    unit="m" /> 
     263        <field id="tide_pot_T2"   long_name="T2 tidal potential"    unit="m" /> 
    112264      </field_group> 
    113265 
    114       <!-- Tides --> 
    115  
    116       <field_group id="Tides_T" grid_ref="grid_T_2D" operation="once" > 
    117          <!-- tidal composante --> 
    118          <field id="M2x"          long_name="M2 Elevation harmonic real part "                             unit="m"        /> 
    119          <field id="M2y"          long_name="M2 Elevation harmonic imaginary part"                         unit="m"        /> 
    120          <field id="S2x"          long_name="S2 Elevation harmonic real part "                             unit="m"        /> 
    121          <field id="S2y"          long_name="S2 Elevation harmonic imaginary part"                         unit="m"        /> 
    122          <field id="N2x"          long_name="N2 Elevation harmonic real part "                             unit="m"        /> 
    123          <field id="N2y"          long_name="N2 Elevation harmonic imaginary part"                         unit="m"        /> 
    124          <field id="K1x"          long_name="K1 Elevation harmonic real part "                             unit="m"        /> 
    125          <field id="K1y"          long_name="K1 Elevation harmonic imaginary part"                         unit="m"        /> 
    126          <field id="O1x"          long_name="O1 Elevation harmonic real part "                             unit="m"        /> 
    127          <field id="O1y"          long_name="O1 Elevation harmonic imaginary part"                         unit="m"        /> 
    128          <field id="Q1x"          long_name="Q1 Elevation harmonic real part "                             unit="m"        /> 
    129          <field id="Q1y"          long_name="Q1 Elevation harmonic imaginary part"                         unit="m"        /> 
    130          <field id="M4x"          long_name="M4 Elevation harmonic real part "                             unit="m"        /> 
    131          <field id="M4y"          long_name="M4 Elevation harmonic imaginary part"                         unit="m"        /> 
    132          <field id="K2x"          long_name="K2 Elevation harmonic real part "                             unit="m"        /> 
    133          <field id="K2y"          long_name="K2 Elevation harmonic imaginary part"                         unit="m"        /> 
    134          <field id="P1x"          long_name="P1 Elevation harmonic real part "                             unit="m"        /> 
    135          <field id="P1y"          long_name="P1 Elevation harmonic imaginary part"                         unit="m"        /> 
    136          <field id="Mfx"          long_name="Mf Elevation harmonic real part "                             unit="m"        /> 
    137          <field id="Mfy"          long_name="Mf Elevation harmonic imaginary part"                         unit="m"        /> 
    138          <field id="Mmx"          long_name="Mm Elevation harmonic real part "                             unit="m"        /> 
    139          <field id="Mmy"          long_name="Mm Elevation harmonic imaginary part"                         unit="m"        /> 
     266      <!-- OSMOSIS variables (available with ln_zdfosm=.true.) --> 
     267 
     268      <field_group id="OSMOSIS_T" grid_ref="grid_T_2D"> 
     269        <field id="zwth0"               long_name="surface non-local temperature flux"       unit="deg m/s" /> 
     270        <field id="zws0"                long_name="surface non-local salinity flux"          unit="psu m/s" /> 
     271        <field id="hbl"                 long_name="boundary layer depth"                     unit="m"       /> 
     272        <field id="hbli"                long_name="initial boundary layer depth"             unit="m"       /> 
     273        <field id="dstokes"             long_name="stokes drift  depth scale"                unit="m"       /> 
     274        <field id="zustke"              long_name="magnitude of stokes drift  at T-points"   unit="m/s"     /> 
     275        <field id="zwstrc"              long_name="convective velocity scale"                unit="m/s"     /> 
     276        <field id="zwstrl"              long_name="langmuir velocity scale"                  unit="m/s"     /> 
     277        <field id="zustar"              long_name="friction velocity"                        unit="m/s"     /> 
     278        <field id="zhbl"                long_name="boundary layer depth"                     unit="m"       /> 
     279        <field id="zhml"                long_name="mixed layer depth"                        unit="m"       /> 
     280        <field id="wind_wave_abs_power" long_name="\rho |U_s| x u*^2"                        unit="mW"      /> 
     281        <field id="wind_wave_power"     long_name="U_s \dot  tau"                            unit="mW"      /> 
     282        <field id="wind_power"          long_name="\rho  u*^3"                               unit="mW"      /> 
     283 
     284        <!-- extra OSMOSIS diagnostics --> 
     285        <field id="zwthav"              long_name="av turb flux of T in ml"                  unit="deg m/s" /> 
     286        <field id="zt_ml"               long_name="av T in ml"                               unit="deg"     /> 
     287        <field id="zwth_ent"            long_name="entrainment turb flux of T"               unit="deg m/s" /> 
     288        <field id="zhol"                long_name="Hoenekker number"                         unit="#"       /> 
     289        <field id="zdh"                 long_name="Pycnocline  depth - grid"                 unit=" m"      /> 
    140290      </field_group> 
    141      
    142       <field_group id="Tides_U" grid_ref="grid_U_2D" operation="once" > 
    143          <field id="M2x_u"        long_name="M2 current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    144          <field id="M2y_u"        long_name="M2 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    145          <field id="S2x_u"        long_name="S2 current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    146          <field id="S2y_u"        long_name="S2 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    147          <field id="N2x_u"        long_name="N2 current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    148          <field id="N2y_u"        long_name="N2 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    149          <field id="K1x_u"        long_name="K1 current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    150          <field id="K1y_u"        long_name="K1 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    151          <field id="O1x_u"        long_name="O1 current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    152          <field id="O1y_u"        long_name="O1 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    153          <field id="Q1x_u"        long_name="Q1 current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    154          <field id="Q1y_u"        long_name="Q1 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    155          <field id="M4x_u"        long_name="M4 current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    156          <field id="M4y_u"        long_name="M4 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    157          <field id="K2x_u"        long_name="K2 current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    158          <field id="K2y_u"        long_name="K2 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    159          <field id="P1x_u"        long_name="P1 current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    160          <field id="P1y_u"        long_name="P1 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    161          <field id="Mfx_u"        long_name="Mf current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    162          <field id="Mfy_u"        long_name="Mf current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
    163          <field id="Mmx_u"        long_name="Mm current barotrope along i-axis harmonic real part "        unit="m/s"      /> 
    164          <field id="Mmy_u"        long_name="Mm current barotrope along i-axis harmonic imaginary part "   unit="m/s"      /> 
     291 
     292      <field_group id="OSMOSIS_W" grid_ref="grid_W_3D" operation="instant" > 
     293        <field id="ghamt"       long_name="non-local temperature flux"                       unit="deg m/s" /> 
     294        <field id="ghams"       long_name="non-local salinity flux"                          unit="psu m/s" /> 
     295        <field id="zdtdz_pyc"   long_name="Pycnocline temperature gradient"                  unit=" deg/m"  /> 
    165296      </field_group> 
    166      
    167       <field_group id="Tides_V" grid_ref="grid_V_2D" operation="once" > 
    168          <field id="M2x_v"        long_name="M2 current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    169          <field id="M2y_v"        long_name="M2 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    170          <field id="S2x_v"        long_name="S2 current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    171          <field id="S2y_v"        long_name="S2 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    172          <field id="N2x_v"        long_name="N2 current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    173          <field id="N2y_v"        long_name="N2 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    174          <field id="K1x_v"        long_name="K1 current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    175          <field id="K1y_v"        long_name="K1 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    176          <field id="O1x_v"        long_name="O1 current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    177          <field id="O1y_v"        long_name="O1 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    178          <field id="Q1x_v"        long_name="Q1 current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    179          <field id="Q1y_v"        long_name="Q1 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    180          <field id="M4x_v"        long_name="M4 current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    181          <field id="M4y_v"        long_name="M4 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    182          <field id="K2x_v"        long_name="K2 current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    183          <field id="K2y_v"        long_name="K2 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    184          <field id="P1x_v"        long_name="P1 current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    185          <field id="P1y_v"        long_name="P1 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    186          <field id="Mfx_v"        long_name="Mf current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    187          <field id="Mfy_v"        long_name="Mf current barotrope along j-axis harmonic imaginary part "   unit="m/s"      /> 
    188          <field id="Mmx_v"        long_name="Mm current barotrope along j-axis harmonic real part "        unit="m/s"      /> 
    189          <field id="Mmy_v"        long_name="Mm current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />   
     297 
     298      <field_group id="OSMOSIS_U" grid_ref="grid_U_2D" > 
     299        <field id="ghamu"       long_name="non-local u-momentum flux"   grid_ref="grid_U_3D" unit="m^2/s^2" /> 
     300        <field id="us_x"        long_name="i component of Stokes drift"                      unit="m/s"     /> 
    190301      </field_group> 
    191302 
    192       <!-- OSMOSIS variables (available with ln_zdfosm=.true.) --> 
    193  
    194       <field_group id="OSMOSIS_T" grid_ref="grid_T_2D"> 
    195          <field id="zwth0"               long_name="surface non-local temperature flux"       unit="deg m/s" /> 
    196          <field id="zws0"                long_name="surface non-local salinity flux"          unit="psu m/s" /> 
    197          <field id="hbl"                 long_name="boundary layer depth"                     unit="m"       /> 
    198          <field id="hbli"                long_name="initial boundary layer depth"             unit="m"       /> 
    199          <field id="dstokes"             long_name="stokes drift  depth scale"                unit="m"       /> 
    200          <field id="zustke"              long_name="magnitude of stokes drift  at T-points"   unit="m/s"     /> 
    201          <field id="zwstrc"              long_name="convective velocity scale"                unit="m/s"     /> 
    202          <field id="zwstrl"              long_name="langmuir velocity scale"                  unit="m/s"     /> 
    203          <field id="zustar"              long_name="friction velocity"                        unit="m/s"     /> 
    204          <field id="zhbl"                long_name="boundary layer depth"                     unit="m"       /> 
    205          <field id="zhml"                long_name="mixed layer depth"                        unit="m"       /> 
    206          <field id="wind_wave_abs_power" long_name="\rho |U_s| x u*^2"                        unit="mW"      /> 
    207          <field id="wind_wave_power"     long_name="U_s \dot  tau"                            unit="mW"      /> 
    208          <field id="wind_power"          long_name="\rho  u*^3"                               unit="mW"      /> 
    209  
    210          <!-- extra OSMOSIS diagnostics --> 
    211          <field id="zwthav"              long_name="av turb flux of T in ml"                  unit="deg m/s" /> 
    212          <field id="zt_ml"               long_name="av T in ml"                               unit="deg"     /> 
    213          <field id="zwth_ent"            long_name="entrainment turb flux of T"               unit="deg m/s" /> 
    214          <field id="zhol"                long_name="Hoenekker number"                         unit="#"       /> 
    215          <field id="zdh"                 long_name="Pycnocline  depth - grid"                 unit=" m"      /> 
     303      <field_group id="OSMOSIS_V" grid_ref="grid_V_2D" > 
     304        <field id="ghamv"       long_name="non-local v-momentum flux"   grid_ref="grid_V_3D" unit="m^2/s^2" /> 
     305        <field id="us_y"        long_name="j component of Stokes drift"                      unit="m/s"     /> 
    216306      </field_group> 
    217  
    218       <field_group id="OSMOSIS_W" grid_ref="grid_W_3D" operation="instant" > 
    219          <field id="ghamt"       long_name="non-local temperature flux"                       unit="deg m/s" /> 
    220          <field id="ghams"       long_name="non-local salinity flux"                          unit="psu m/s" /> 
    221          <field id="zdtdz_pyc"   long_name="Pycnocline temperature gradient"                  unit=" deg/m"  /> 
     307       
     308      <!-- SBC --> 
     309      <field_group id="SBC" > <!-- time step automaticaly defined based on nn_fsbc --> 
     310 
     311        <field_group id="SBC_2D" grid_ref="grid_T_2D" > 
     312 
     313          <field id="empmr"        long_name="Net Upward Water Flux"                standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   /> 
     314          <field id="empbmr"       long_name="Net Upward Water Flux at pre. tstep"  standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   /> 
     315          <field id="emp_oce"      long_name="Evap minus Precip over ocean"         standard_name="evap_minus_precip_over_sea_water"                                     unit="kg/m2/s"   /> 
     316          <field id="emp_ice"      long_name="Evap minus Precip over ice"           standard_name="evap_minus_precip_over_sea_ice"                                       unit="kg/m2/s"   /> 
     317          <field id="saltflx"      long_name="Downward salt flux"                                                                                                        unit="1e-3/m2/s" /> 
     318          <field id="fmmflx"       long_name="Water flux due to freezing/melting"                                                                                        unit="kg/m2/s"   /> 
     319          <field id="snowpre"      long_name="Snow precipitation"                   standard_name="snowfall_flux"                                                        unit="kg/m2/s"   /> 
     320          <field id="runoffs"      long_name="River Runoffs"                        standard_name="water_flux_into_sea_water_from_rivers"                                unit="kg/m2/s"   /> 
     321          <field id="precip"       long_name="Total precipitation"                  standard_name="precipitation_flux"                                                   unit="kg/m2/s"   /> 
     322          <field id="wclosea"      long_name="closed sea empmr correction"          standard_name="closea_empmr"                                                         unit="kg/m2/s"   /> 
     323      
     324          <field id="qt"           long_name="Net Downward Heat Flux"                standard_name="surface_downward_heat_flux_in_sea_water"                              unit="W/m2"                           /> 
     325          <field id="qns"          long_name="non solar Downward Heat Flux"                                                                                               unit="W/m2"                           /> 
     326          <field id="qsr"          long_name="Shortwave Radiation"                   standard_name="net_downward_shortwave_flux_at_sea_water_surface"                     unit="W/m2"                           /> 
     327          <field id="qsr3d"        long_name="Shortwave Radiation 3D distribution"   standard_name="downwelling_shortwave_flux_in_sea_water"                              unit="W/m2"      grid_ref="grid_T_3D" /> 
     328          <field id="qrp"          long_name="Surface Heat Flux: Damping"            standard_name="heat_flux_into_sea_water_due_to_newtonian_relaxation"                 unit="W/m2"                           /> 
     329          <field id="qclosea"      long_name="closed sea heat content flux"          standard_name="closea_heat_content_downward_flux"                                    unit="W/m2"     /> 
     330          <field id="erp"          long_name="Surface Water Flux: Damping"           standard_name="water_flux_out_of_sea_water_due_to_newtonian_relaxation"              unit="kg/m2/s"                        /> 
     331          <field id="taum"         long_name="wind stress module"                    standard_name="magnitude_of_surface_downward_stress"                                 unit="N/m2"                           /> 
     332          <field id="wspd"         long_name="wind speed module"                     standard_name="wind_speed"                                                           unit="m/s"                            /> 
     333           
     334          <!-- * variable relative to atmospheric pressure forcing : available with ln_apr_dyn --> 
     335          <field id="ssh_ib"       long_name="Inverse barometer sea surface height"  standard_name="sea_surface_height_correction_due_to_air_pressure_at_low_frequency"   unit="m"        /> 
     336 
     337          <!-- * variable related to ice shelf forcing * --> 
     338          <field id="isftfrz_cav"     long_name="freezing point temperature at ocean/isf interface"                unit="degC"     /> 
     339          <field id="isftfrz_par"     long_name="freezing point temperature in the parametrization boundary layer" unit="degC"     /> 
     340          <field id="fwfisf_cav"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  /> 
     341          <field id="fwfisf_par"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  /> 
     342          <field id="qoceisf_cav"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     /> 
     343          <field id="qoceisf_par"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     /> 
     344          <field id="qlatisf_cav"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     /> 
     345          <field id="qlatisf_par"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     /> 
     346          <field id="qhcisf_cav"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     /> 
     347          <field id="qhcisf_par"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     /> 
     348          <field id="fwfisf3d_cav"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" /> 
     349          <field id="fwfisf3d_par"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" /> 
     350          <field id="qoceisf3d_cav"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
     351          <field id="qoceisf3d_par"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
     352          <field id="qlatisf3d_cav"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
     353          <field id="qlatisf3d_par"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
     354          <field id="qhcisf3d_cav"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" /> 
     355          <field id="qhcisf3d_par"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" /> 
     356          <field id="ttbl_cav"        long_name="temperature in Losch tbl"                      unit="degC"     /> 
     357          <field id="ttbl_par"        long_name="temperature in the parametrisation boundary layer" unit="degC" /> 
     358          <field id="isfthermald_cav" long_name="thermal driving of ice shelf melting"          unit="degC"     /> 
     359          <field id="isfthermald_par" long_name="thermal driving of ice shelf melting"          unit="degC"     /> 
     360          <field id="isfgammat"       long_name="Ice shelf heat-transfert velocity"             unit="m/s"      /> 
     361          <field id="isfgammas"       long_name="Ice shelf salt-transfert velocity"             unit="m/s"      /> 
     362          <field id="stbl"            long_name="salinity in the Losh tbl"                      unit="1e-3"     /> 
     363          <field id="utbl"            long_name="zonal current in the Losh tbl at T point"      unit="m/s"      /> 
     364          <field id="vtbl"            long_name="merid current in the Losh tbl at T point"      unit="m/s"      /> 
     365          <field id="isfustar"        long_name="ustar at T point used in ice shelf melting"    unit="m/s"      /> 
     366          <field id="qconisf"         long_name="Conductive heat flux through the ice shelf"    unit="W/m2"     /> 
     367 
     368          <!-- *_oce variables available with ln_blk_clio or ln_blk_core --> 
     369          <field id="rho_air"      long_name="Air density at 10m above sea surface"         standard_name="rho_air_10m"                                        unit="kg/m3" /> 
     370          <field id="dt_skin"      long_name="SSST-SST temperature difference"              standard_name="SSST-SST"                                             unit="K"   /> 
     371          <field id="qlw_oce"      long_name="Longwave Downward Heat Flux over open ocean"  standard_name="surface_net_downward_longwave_flux"                 unit="W/m2"  /> 
     372          <field id="qsb_oce"      long_name="Sensible Downward Heat Flux over open ocean"  standard_name="surface_downward_sensible_heat_flux"                unit="W/m2"  /> 
     373          <field id="qla_oce"      long_name="Latent Downward Heat Flux over open ocean"    standard_name="surface_downward_latent_heat_flux"                  unit="W/m2"  /> 
     374          <field id="evap_oce"     long_name="Evaporation over open ocean"                  standard_name="evaporation"                                        unit="kg/m2/s" /> 
     375          <field id="qt_oce"       long_name="total flux at ocean surface"                  standard_name="surface_downward_heat_flux_in_sea_water"            unit="W/m2"  /> 
     376          <field id="qsr_oce"      long_name="solar heat flux at ocean surface"             standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"  /> 
     377          <field id="qns_oce"      long_name="non-solar heat flux at ocean surface (including E-P)"                                                            unit="W/m2"  /> 
     378          <field id="qemp_oce"     long_name="Downward Heat Flux from E-P over open ocean"                                                                     unit="W/m2"  /> 
     379          <field id="taum_oce"     long_name="wind stress module over open ocean"           standard_name="magnitude_of_surface_downward_stress"               unit="N/m2"  /> 
     380 
     381          <!-- available key_oasis3 --> 
     382          <field id="snow_ao_cea"  long_name="Snow over ice-free ocean (cell average)"   standard_name="snowfall_flux"                             unit="kg/m2/s"  /> 
     383          <field id="snow_ai_cea"  long_name="Snow over sea-ice (cell average)"          standard_name="snowfall_flux"                             unit="kg/m2/s"  /> 
     384          <field id="subl_ai_cea"  long_name="Sublimation over sea-ice (cell average)"   standard_name="surface_snow_and_ice_sublimation_flux"     unit="kg/m2/s"  /> 
     385          <field id="icealb_cea"   long_name="Ice albedo (cell average)"                 standard_name="sea_ice_albedo"                            unit="1"        /> 
     386          <field id="calving_cea"  long_name="Calving"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
     387          <field id="iceberg_cea"  long_name="Iceberg"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
     388          <field id="iceshelf_cea" long_name="Iceshelf"                                  standard_name="water_flux_into_sea_water_from_iceshelf"   unit="kg/m2/s"  /> 
     389 
     390 
     391          <!-- available if key_oasis3 + conservative method --> 
     392     <field id="rain"          long_name="Liquid precipitation"                                     standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  /> 
     393          <field id="rain_ao_cea"   long_name="Liquid precipitation over ice-free ocean (cell average)"  standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  /> 
     394          <field id="evap_ao_cea"   long_name="Evaporation over ice-free ocean (cell average)"           standard_name="water_evaporation_flux"                                                        unit="kg/m2/s"  /> 
     395          <field id="isnwmlt_cea"   long_name="Snow over Ice melting (cell average)"                     standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  /> 
     396          <field id="fsal_virt_cea" long_name="Virtual salt flux due to ice formation (cell average)"    standard_name="virtual_salt_flux_into_sea_water_due_to_sea_ice_thermodynamics"                unit="kg/m2/s"  /> 
     397          <field id="fsal_real_cea" long_name="Real salt flux due to ice formation (cell average)"       standard_name="downward_sea_ice_basal_salt_flux"                                              unit="kg/m2/s"  /> 
     398          <field id="hflx_rain_cea" long_name="heat flux due to rainfall"                                standard_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"        unit="W/m2"     /> 
     399          <field id="hflx_evap_cea" long_name="heat flux due to evaporation"                             standard_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water"   unit="W/m2"     /> 
     400          <field id="hflx_snow_cea" long_name="heat flux due to snow falling"                            standard_name="heat_flux_onto_ocean_and_ice_due_to_snow_thermodynamics"                       unit="W/m2"     /> 
     401          <field id="hflx_snow_ai_cea" long_name="heat flux due to snow falling over ice"                standard_name="heat_flux_onto_ice_due_to_snow_thermodynamics"                                 unit="W/m2"     /> 
     402          <field id="hflx_snow_ao_cea" long_name="heat flux due to snow falling over ice-free ocean"     standard_name="heat_flux_onto_sea_water_due_to_snow_thermodynamics"                           unit="W/m2"     /> 
     403          <field id="hflx_ice_cea"  long_name="heat flux due to ice thermodynamics"                      standard_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                        unit="W/m2"     /> 
     404          <field id="hflx_rnf_cea"  long_name="heat flux due to runoffs"                                 standard_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"          unit="W/m2"     /> 
     405          <field id="hflx_cal_cea"  long_name="heat flux due to calving"                                 standard_name="heat_flux_into_sea_water_due_to_calving"                                       unit="W/m2"     /> 
     406          <field id="hflx_icb_cea"  long_name="heat flux due to iceberg"                                 standard_name="heat_flux_into_sea_water_due_to_icebergs"                                      unit="W/m2"     /> 
     407          <field id="hflx_isf_cea"  long_name="heat flux due to iceshelf"                                standard_name="heat_flux_into_sea_water_due_to_iceshelf"                                      unit="W/m2"     /> 
     408          <field id="bicemel_cea"   long_name="Rate of Melt at Sea Ice Base (cell average)"              standard_name="tendency_of_sea_ice_amount_due_to_basal_melting"                               unit="kg/m2/s"  /> 
     409          <field id="licepro_cea"   long_name="Lateral Sea Ice Growth Rate (cell average)"               standard_name="tendency_of_sea_ice_amount_due_to_lateral_growth_of_ice_floes"                 unit="kg/m2/s"  /> 
     410          <field id="snowmel_cea"   long_name="Snow Melt Rate (cell average)"                            standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  /> 
     411          <field id="sntoice_cea"   long_name="Snow-Ice Formation Rate (cell average)"                   standard_name="tendency_of_sea_ice_amount_due_to_snow_conversion"                             unit="kg/m2/s"  /> 
     412          <field id="ticemel_cea"   long_name="Rate of Melt at Upper Surface of Sea Ice (cell average)"  standard_name="tendency_of_sea_ice_amount_due_to_surface_melting"                             unit="kg/m2/s"  /> 
     413 
     414          <!-- ice field (nn_ice=1)  --> 
     415          <field id="ice_cover"    long_name="Ice fraction"                                                 standard_name="sea_ice_area_fraction"                              unit="1"            /> 
     416           
     417          <!-- dilution --> 
     418          <field id="emp_x_sst"    long_name="Concentration/Dilution term on SST"                                                                                              unit="kg*degC/m2/s" /> 
     419          <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*1e-3/m2/s" />         
     420          <field id="rnf_x_sst"    long_name="Runoff term on SST"                                                                                                              unit="kg*degC/m2/s" /> 
     421          <field id="rnf_x_sss"    long_name="Runoff term on SSS"                                                                                                              unit="kg*1e-3/m2/s" /> 
     422      
     423     <!-- sbcssm variables --> 
     424          <field id="sst_m"    unit="degC" /> 
     425          <field id="sss_m"    unit="psu"  /> 
     426          <field id="ssu_m"    unit="m/s"  /> 
     427          <field id="ssv_m"    unit="m/s"  /> 
     428          <field id="ssh_m"    unit="m"    /> 
     429          <field id="e3t_m"    unit="m"    /> 
     430          <field id="frq_m"    unit="-"    /> 
     431 
     432   </field_group> 
     433    
     434 
     435      </field_group> <!-- SBC --> 
     436       
     437      <!-- ABL --> 
     438      <field_group id="ABL" > <!-- time step automaticaly defined based on nn_fsbc --> 
     439 
     440   <!-- variables available with ABL on atmospheric T grid--> 
     441   <field_group id="grid_ABL3D" grid_ref="grid_TA_3D" > 
     442          <field id="u_abl"      long_name="ABL i-horizontal velocity"     standard_name="abl_x_velocity" unit="m/s"      /> 
     443          <field id="v_abl"      long_name="ABL j-horizontal velocity"     standard_name="abl_y_velocity" unit="m/s"      /> 
     444          <field id="t_abl"      long_name="ABL potential temperature"     standard_name="abl_theta"      unit="K"        /> 
     445          <field id="q_abl"      long_name="ABL specific humidity"         standard_name="abl_qspe"       unit="kg/kg"    /> 
     446          <!-- debug (to be removed) --> 
     447          <field id="u_dta"      long_name="DTA i-horizontal velocity"     standard_name="dta_x_velocity" unit="m/s"      /> 
     448          <field id="v_dta"      long_name="DTA j-horizontal velocity"     standard_name="dta_y_velocity" unit="m/s"      /> 
     449          <field id="t_dta"      long_name="DTA potential temperature"     standard_name="dta_theta"      unit="K"        /> 
     450          <field id="q_dta"      long_name="DTA specific humidity"         standard_name="dta_qspe"       unit="kg/kg"    /> 
     451          <field id="coeft"      long_name="ABL nudging coefficient"       standard_name="coeft"          unit=""         /> 
     452          <field id="tke_abl"    long_name="ABL turbulent kinetic energy"  standard_name="abl_tke"        unit="m2/s2"    /> 
     453          <field id="avm_abl"    long_name="ABL turbulent viscosity"       standard_name="abl_avm"        unit="m2/s"     /> 
     454          <field id="avt_abl"    long_name="ABL turbulent diffusivity"     standard_name="abl_avt"        unit="m2/s"     /> 
     455          <field id="mxl_abl"    long_name="ABL mixing length"             standard_name="abl_mxl"        unit="m"        /> 
     456   </field_group> 
     457 
     458   <field_group id="grid_ABL2D" grid_ref="grid_TA_2D" > 
     459          <field id="pblh"       long_name="ABL height"                    standard_name="abl_height"     unit="m"        /> 
     460          <field id="uz1_abl"    long_name="ABL i-horizontal velocity"     standard_name="abl_x_velocity" unit="m/s"      /> 
     461          <field id="vz1_abl"    long_name="ABL j-horizontal velocity"     standard_name="abl_y_velocity" unit="m/s"      /> 
     462          <field id="uvz1_abl"   long_name="ABL wind speed module"         standard_name="abl_wind_speed" unit="m/s"       > sqrt( uz1_abl^2 + vz1_abl^2 ) </field> 
     463          <field id="tz1_abl"    long_name="ABL potential temperature"     standard_name="abl_theta"      unit="K"        /> 
     464          <field id="qz1_abl"    long_name="ABL specific humidity"         standard_name="abl_qspe"       unit="kg/kg"    /> 
     465          <field id="uz1_dta"    long_name="DTA i-horizontal velocity"     standard_name="dta_x_velocity" unit="m/s"      /> 
     466          <field id="vz1_dta"    long_name="DTA j-horizontal velocity"     standard_name="dta_y_velocity" unit="m/s"      /> 
     467          <field id="uvz1_dta"   long_name="DTA wind speed module"         standard_name="dta_wind_speed" unit="m/s"       > sqrt( uz1_dta^2 + vz1_dta^2 ) </field>  
     468          <field id="tz1_dta"    long_name="DTA potential temperature"     standard_name="dta_theta"      unit="K"        /> 
     469          <field id="qz1_dta"    long_name="DTA specific humidity"         standard_name="dta_qspe"       unit="kg/kg"    /> 
     470          <!-- debug (to be removed) --> 
     471          <field id="uz1_geo"    long_name="GEO i-horizontal velocity"     standard_name="geo_x_velocity" unit="m/s"      /> 
     472          <field id="vz1_geo"    long_name="GEO j-horizontal velocity"     standard_name="geo_y_velocity" unit="m/s"      /> 
     473          <field id="uvz1_geo"   long_name="GEO wind speed module"         standard_name="geo_wind_speed" unit="m/s"       > sqrt( uz1_geo^2 + vz1_geo^2 ) </field>  
     474   </field_group> 
     475 
     476      </field_group> <!-- ABL --> 
     477 
     478       
     479      <!-- U grid --> 
     480       
     481      <field_group id="grid_U"   grid_ref="grid_U_2D"> 
     482        <field id="e2u"           long_name="U-cell width in meridional direction"                   standard_name="cell_width"                  unit="m"                               /> 
     483        <field id="e3u"           long_name="U-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_U_3D" /> 
     484        <field id="e3u_0"         long_name="Initial U-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_U_3D"/> 
     485        <field id="utau"          long_name="Wind Stress along i-axis"                               standard_name="surface_downward_x_stress"   unit="N/m2"                            /> 
     486        <field id="uoce"          long_name="ocean current along i-axis"                             standard_name="sea_water_x_velocity"        unit="m/s"        grid_ref="grid_U_3D" /> 
     487      <field id="uoce_e3u"      long_name="ocean current along i-axis  (thickness weighted)"                                                   unit="m/s"        grid_ref="grid_U_3D"  > uoce * e3u </field> 
     488      <field id="uoce_e3u_vsum" long_name="ocean current along i-axis * e3u summed on the vertical"  field_ref="uoce_e3u"    unit="m3/s"       grid_ref="grid_U_vsum"/> 
     489        <field id="uocetr_vsum"   long_name="ocean transport along i-axis  summed on the vertical"         field_ref="e2u"       unit="m3/s"> this * uoce_e3u_vsum  </field>  
     490 
     491        <field id="uocetr_vsum_op"    long_name="ocean current along i-axis * e3u * e2u summed on the vertical"  read_access="true"  freq_op="1mo"    field_ref="e2u"       unit="m3/s"> @uocetr_vsum </field> 
     492        <field id="uocetr_vsum_cumul" long_name="ocean current along i-axis * e3u * e2u cumulated from southwest point" freq_offset="_reset_" operation="instant" freq_op="1mo"  unit="m3/s" />  
     493        <field id="msftbarot"         long_name="ocean_barotropic_mass_streamfunction"   unit="kg s-1" > uocetr_vsum_cumul * $rau0 </field> 
     494 
     495 
     496        <field id="ssu"          long_name="ocean surface current along i-axis"                                                                 unit="m/s"                             /> 
     497        <field id="sbu"          long_name="ocean bottom current along i-axis"                                                                  unit="m/s"                             /> 
     498        <field id="ubar"         long_name="ocean barotropic current along i-axis"                                                              unit="m/s"                             /> 
     499        <field id="uocetr_eff"   long_name="Effective ocean transport along i-axis"                 standard_name="ocean_volume_x_transport"    unit="m3/s"       grid_ref="grid_U_3D" /> 
     500        <field id="uocet"        long_name="ocean transport along i-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_U_3D" /> 
     501        <field id="uoces"        long_name="ocean transport along i-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_U_3D" /> 
     502        <field id="ssuww"        long_name="ocean surface wind work along i-axis"                   standard_name="surface_x_wind_work"         unit="N/m*s"                            > utau * ssu </field> 
     503        <!-- AGRIF sponge --> 
     504        <field id="agrif_spu"    long_name=" AGRIF u-sponge coefficient"   unit=" " /> 
     505        <!-- u-eddy diffusivity coefficients (available if ln_traldf_OFF=F) --> 
     506        <field id="ahtu_2d"      long_name=" surface u-eddy diffusivity coefficient"   unit="m2/s or m4/s" /> 
     507        <field id="ahtu_3d"      long_name=" 3D u-EIV coefficient"                     unit="m2/s or m4/s"      grid_ref="grid_U_3D"/> 
     508        <!-- u-eiv diffusivity coefficients (available if ln_ldfeiv=F) --> 
     509        <field id="aeiu_2d"      long_name=" surface u-EIV coefficient"                unit="m2/s" /> 
     510        <field id="aeiu_3d"      long_name=" 3D u-EIV coefficient"                     unit="m2/s"              grid_ref="grid_U_3D"/> 
     511 
     512        <!-- variables available with MLE (ln_mle=T) --> 
     513        <field id="psiu_mle"     long_name="MLE streamfunction along i-axis"   unit="m3/s"   grid_ref="grid_U_3D" /> 
     514 
     515        <!-- uoce_eiv: available EIV (ln_ldfeiv=T and ln_ldfeiv_dia=T) --> 
     516      <field id="uoce_eiv"      long_name="EIV ocean current along i-axis"                                  standard_name="bolus_sea_water_x_velocity"                     unit="m/s"   grid_ref="grid_U_3D" /> 
     517        <field id="ueiv_masstr"   long_name="EIV Ocean Mass X Transport"                                      standard_name="bolus_ocean_mass_x_transport"                   unit="kg/s"  grid_ref="grid_U_3D" /> 
     518        <field id="ueiv_heattr"   long_name="ocean bolus heat transport along i-axis"                         standard_name="ocean_heat_x_transport_due_to_bolus_advection"  unit="W"                         /> 
     519        <field id="ueiv_salttr"   long_name="ocean bolus salt transport along i-axis"                         standard_name="ocean_salt_x_transport_due_to_bolus_advection"  unit="Kg"                        /> 
     520        <field id="ueiv_heattr3d" long_name="ocean bolus heat transport along i-axis"                         standard_name="ocean_heat_x_transport_due_to_bolus_advection"  unit="W"     grid_ref="grid_U_3D" /> 
     521        <field id="ueiv_salttr3d" long_name="ocean bolus salt transport along i-axis"                         standard_name="ocean_salt_x_transport_due_to_bolus_advection"  unit="kg"    grid_ref="grid_U_3D" /> 
     522 
     523        <!-- uoce_bbl: available with ln_trabbl=T and nn_bbl_adv=1 --> 
     524        <field id="uoce_bbl"     long_name="BBL ocean current along i-axis"    unit="m/s"  /> 
     525        <!-- ahu_bbl : available with ln_trabbl=T and nn_bbl_ldf=1 --> 
     526        <field id="ahu_bbl"      long_name="BBL diffusive flux along i-axis"   unit="m3/s" /> 
     527 
     528        <!-- variables available with WAVE (ln_wave=T) --> 
     529        <field id="ustokes"      long_name="Stokes Drift Velocity i-axis"      standard_name="StokesDrift_x_velocity"      unit="m/s"        grid_ref="grid_U_3D" /> 
     530        <field id="ustokes_e3u"  long_name="Stokes Drift Velocity i-axis  (thickness weighted)"                            unit="m/s"        grid_ref="grid_U_3D"  > ustokes * e3u </field> 
     531 
     532        <!-- variable for ice shelves --> 
     533        <field id="utbl"         long_name="zonal current in the Losh tbl"     unit="m/s" /> 
     534 
     535        <!-- variables available with diaar5 --> 
     536        <field id="u_masstr"      long_name="Ocean Mass X Transport"                                          standard_name="ocean_mass_x_transport"                         unit="kg/s"  grid_ref="grid_U_3D" /> 
     537        <field id="u_masstr_vint" long_name="vertical integral of ocean eulerian mass transport along i-axis" standard_name="vertical_integral_of_ocean_mass_x_transport"    unit="kg/s"                      /> 
     538        <field id="u_heattr"      long_name="ocean eulerian heat transport along i-axis"                      standard_name="ocean_heat_x_transport"                         unit="W"                         /> 
     539        <field id="u_salttr"      long_name="ocean eulerian salt transport along i-axis"                      standard_name="ocean_salt_x_transport"                         unit="1e-3*kg/s"                 /> 
     540        <field id="uadv_heattr"   long_name="ocean advective heat transport along i-axis"                     standard_name="advectice_ocean_heat_x_transport"               unit="W"                         /> 
     541        <field id="uadv_salttr"   long_name="ocean advective salt transport along i-axis"                     standard_name="advectice_ocean_salt_x_transport"               unit="1e-3*kg/s"                 /> 
     542        <field id="udiff_heattr"  long_name="ocean diffusion heat transport along i-axis"                     standard_name="ocean_heat_x_transport_due_to_diffusion"        unit="W"                         /> 
     543        <field id="udiff_salttr"  long_name="ocean diffusion salt transport along i-axis"                     standard_name="ocean_salt_x_transport_due_to_diffusion"        unit="1e-3*kg/s"                 /> 
    222544      </field_group> 
    223  
    224       <field_group id="OSMOSIS_U" grid_ref="grid_U_2D" > 
    225          <field id="ghamu"       long_name="non-local u-momentum flux"   grid_ref="grid_U_3D" unit="m^2/s^2" /> 
    226          <field id="us_x"        long_name="i component of Stokes drift"                      unit="m/s"     /> 
     545       
     546      <!-- V grid --> 
     547       
     548      <field_group id="grid_V"   grid_ref="grid_V_2D"> 
     549        <field id="e1v"          long_name="V-cell width in longitudinal direction"                 standard_name="cell_width"                  unit="m"                              /> 
     550        <field id="e3v"          long_name="V-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_V_3D" /> 
     551        <field id="e3v_0"        long_name="Initial V-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_V_3D" /> 
     552        <field id="vtau"         long_name="Wind Stress along j-axis"                               standard_name="surface_downward_y_stress"   unit="N/m2"                            /> 
     553        <field id="voce"         long_name="ocean current along j-axis"                             standard_name="sea_water_y_velocity"        unit="m/s"        grid_ref="grid_V_3D" /> 
     554        <field id="voce_e3v"     long_name="ocean current along j-axis  (thickness weighted)"                                                   unit="m/s"        grid_ref="grid_V_3D"  > voce * e3v </field> 
     555        <field id="ssv"          long_name="ocean surface current along j-axis"                                                                 unit="m/s"                             /> 
     556        <field id="sbv"          long_name="ocean bottom current along j-axis"                                                                  unit="m/s"                             /> 
     557        <field id="vbar"         long_name="ocean barotropic current along j-axis"                                                              unit="m/s"                             /> 
     558        <field id="vocetr_eff"   long_name="Effective ocean transport along j-axis"                 standard_name="ocean_volume_y_transport"    unit="m3/s"       grid_ref="grid_V_3D" /> 
     559        <field id="vocet"        long_name="ocean transport along j-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_V_3D" /> 
     560        <field id="voces"        long_name="ocean transport along j-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_V_3D" /> 
     561        <field id="ssvww"        long_name="ocean surface wind work along j-axis"                   standard_name="surface_y_wind_work"         unit="N/m*s"                            > vtau * ssv </field> 
     562        <!-- AGRIF sponge --> 
     563        <field id="agrif_spv"    long_name=" AGRIF v-sponge coefficient"   unit=" " /> 
     564        <!-- v-eddy diffusivity coefficients (available if ln_traldf_OFF=F) --> 
     565        <field id="ahtv_2d"      long_name=" surface v-eddy diffusivity coefficient"     unit="m2/s or (m4/s)^1/2" /> 
     566        <field id="ahtv_3d"      long_name=" 3D v-eddy diffusivity coefficient"          unit="m2/s or (m4/s)^1/2"           grid_ref="grid_V_3D"/> 
     567        <!-- v-eiv diffusivity coefficients (available if ln_ldfeiv=F) --> 
     568        <field id="aeiv_2d"      long_name=" surface v-EIV coefficient"                  unit="m2/s" /> 
     569        <field id="aeiv_3d"      long_name=" 3D v-EIV coefficient"                       unit="m2/s"                         grid_ref="grid_V_3D" /> 
     570 
     571        <!-- variables available with MLE (ln_mle=T) --> 
     572        <field id="psiv_mle"     long_name="MLE streamfunction along j-axis"   unit="m3/s"   grid_ref="grid_V_3D" /> 
     573 
     574        <!-- voce_eiv: available EIV (ln_ldfeiv=T and ln_ldfeiv_dia=T)  --> 
     575   <field id="voce_eiv"     long_name="EIV ocean current along j-axis"  standard_name="bolus_sea_water_y_velocity"     unit="m/s"   grid_ref="grid_V_3D" /> 
     576        <field id="veiv_masstr"  long_name="EIV Ocean Mass Y Transport"      standard_name="bolus_ocean_mass_y_transport"   unit="kg/s"  grid_ref="grid_V_3D" /> 
     577        <field id="veiv_heattr"   long_name="ocean bolus heat transport along j-axis"       standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"                         /> 
     578        <field id="veiv_salttr"   long_name="ocean bolus salt transport along j-axis"       standard_name="ocean_salt_x_transport_due_to_bolus_advection"   unit="Kg"                        /> 
     579        <field id="veiv_heattr3d" long_name="ocean bolus heat transport along j-axis"       standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"    grid_ref="grid_V_3D" /> 
     580        <field id="veiv_salttr3d" long_name="ocean bolus salt transport along j-axis"       standard_name="ocean_salt_y_transport_due_to_bolus_advection"   unit="kg"   grid_ref="grid_V_3D" /> 
     581 
     582 
     583        <!-- voce_bbl: available with ln_trabbl=T and nn_bbl_adv=1 --> 
     584        <field id="voce_bbl"     long_name="BBL ocean current along j-axis"    unit="m/s"  /> 
     585        <!-- ahu_bbl : available with ln_trabbl=T and nn_bbl_ldf=1 --> 
     586        <field id="ahv_bbl"      long_name="BBL diffusive flux along j-axis"   unit="m3/s" /> 
     587 
     588        <!-- variables available with WAVE (ln_wave=T) --> 
     589        <field id="vstokes"      long_name="Stokes Drift Velocity j-axis"      standard_name="StokesDrift_y_velocity"      unit="m/s"        grid_ref="grid_V_3D" /> 
     590        <field id="vstokes_e3v"  long_name="Stokes Drift Velocity j-axis  (thickness weighted)"                            unit="m/s"        grid_ref="grid_V_3D"  > vstokes * e3v </field> 
     591 
     592        <!-- variable for ice shelves --> 
     593        <field id="vtbl"         long_name="meridional current in the Losh tbl"   unit="m/s" /> 
     594 
     595        <!-- variables available with diaar5 --> 
     596        <field id="v_masstr"      long_name="ocean eulerian mass transport along j-axis"    standard_name="ocean_mass_y_transport"                          unit="kg/s" grid_ref="grid_V_3D" /> 
     597        <field id="v_heattr"      long_name="ocean eulerian heat transport along j-axis"    standard_name="ocean_heat_y_transport"                          unit="W"                         /> 
     598        <field id="v_salttr"      long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_y_transport"                          unit="1e-3*kg/s"                 /> 
     599        <field id="vadv_heattr"   long_name="ocean advective heat transport along j-axis"   standard_name="advectice_ocean_heat_y_transport"                unit="W"                         /> 
     600        <field id="vadv_salttr"   long_name="ocean advective salt transport along j-axis"   standard_name="advectice_ocean_salt_y_transport"                unit="1e-3*kg/s"                 /> 
     601        <field id="vdiff_heattr"  long_name="ocean diffusion heat transport along j-axis"   standard_name="ocean_heat_y_transport_due_to_diffusion"         unit="W"                         /> 
     602        <field id="vdiff_salttr"  long_name="ocean diffusion salt transport along j-axis"   standard_name="ocean_salt_y_transport_due_to_diffusion"         unit="1e-3*kg/s"                 /> 
    227603      </field_group> 
    228  
    229       <field_group id="OSMOSIS_V" grid_ref="grid_V_2D" > 
    230          <field id="ghamv"       long_name="non-local v-momentum flux"   grid_ref="grid_V_3D" unit="m^2/s^2" /> 
    231          <field id="us_y"        long_name="j component of Stokes drift"                      unit="m/s"     /> 
     604       
     605      <!-- W grid --> 
     606       
     607      <field_group id="grid_W" grid_ref="grid_W_3D"> 
     608        <field id="e3w"          long_name="W-cell thickness"                              standard_name="cell_thickness"                         unit="m"    /> 
     609   <field id="woce"         long_name="ocean vertical velocity"                       standard_name="upward_sea_water_velocity"              unit="m/s"  /> 
     610   <field id="woce_e3w"     long_name="ocean vertical velocity * e3w"                                                                        unit="m2/s"  > woce * e3w </field>   
     611        <field id="wocetr_eff"   long_name="effective ocean vertical transport"                                                                   unit="m3/s" /> 
     612 
     613        <!-- woce_eiv: available with EIV  (ln_ldfeiv=T and ln_ldfeiv_dia=T)  --> 
     614        <field id="woce_eiv"     long_name="EIV ocean vertical velocity"                    standard_name="bolus_upward_sea_water_velocity"       unit="m/s"  /> 
     615        <field id="weiv_masstr"  long_name="EIV Upward Ocean Mass Transport"  standard_name="bolus_upward_ocean_mass_transport"             unit="kg/s"   /> 
     616        <field id="weiv_heattr3d" long_name="ocean bolus heat transport"    standard_name="ocean_heat_z_transport_due_to_bolus_advection"   unit="W"    /> 
     617        <field id="weiv_salttr3d" long_name="ocean bolus salt transport"    standard_name="ocean_salt_z_transport_due_to_bolus_advection"   unit="kg"   /> 
     618 
     619   <field id="avt"          long_name="vertical eddy diffusivity"                      standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" /> 
     620        <field id="avt_e3w"      long_name="vertical heat diffusivity * e3w"                unit="m3/s" > avt * e3w </field>      
     621        <field id="logavt"       long_name="logarithm of vertical eddy diffusivity"         standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" /> 
     622        <field id="avm"          long_name="vertical eddy viscosity"                        standard_name="ocean_vertical_momentum_diffusivity"   unit="m2/s" /> 
     623        <field id="avm_e3w"      long_name="vertical eddy viscosity * e3w"   unit="m3/s" > avm * e3w </field>  
     624 
     625        <!-- avs: /= avt with ln_zdfddm=T --> 
     626        <field id="avs"          long_name="salt vertical eddy diffusivity"                 standard_name="ocean_vertical_salt_diffusivity"       unit="m2/s" /> 
     627        <field id="avs_e3w"      long_name="vertical salt diffusivity * e3w"   unit="m3/s" > avs * e3w </field>  
     628   <field id="logavs"       long_name="logarithm of salt vertical eddy diffusivity"    standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" /> 
     629 
     630        <!-- avt_evd and avm_evd: available with ln_zdfevd --> 
     631        <field id="avt_evd"      long_name="convective enhancement of vertical diffusivity" standard_name="ocean_vertical_tracer_diffusivity_due_to_convection"     unit="m2/s" /> 
     632        <field id="avt_evd_e3w"  long_name="convective enhancement to vertical diffusivity * e3w "    unit="m3/s" > avt_evd * e3w </field>  
     633   <field id="avm_evd"      long_name="convective enhancement of vertical viscosity"   standard_name="ocean_vertical_momentum_diffusivity_due_to_convection"   unit="m2/s" /> 
     634 
     635        <!-- avt_tide: available with ln_zdfiwm=T --> 
     636        <field id="av_ratio"     long_name="S over T diffusivity ratio"                     standard_name="salinity_over_temperature_diffusivity_ratio"                     unit="1"    /> 
     637        <field id="av_wave"      long_name="internal wave-induced vertical diffusivity"     standard_name="ocean_vertical_tracer_diffusivity_due_to_internal_waves"         unit="m2/s" /> 
     638        <field id="bflx_iwm"     long_name="internal wave-induced buoyancy flux"            standard_name="buoyancy_flux_due_to_internal_waves"                             unit="W/kg" /> 
     639        <field id="pcmap_iwm"    long_name="power consumed by wave-driven mixing"           standard_name="vertically_integrated_power_consumption_by_wave_driven_mixing"   unit="W/m2"      grid_ref="grid_W_2D" /> 
     640        <field id="emix_iwm"     long_name="power density available for mixing"             standard_name="power_available_for_mixing_from_breaking_internal_waves"         unit="W/kg" /> 
     641 
     642        <!-- variables available with WAVE (ln_wave=T) --> 
     643        <field id="wstokes"      long_name="Stokes Drift vertical velocity"                 standard_name="upward_StokesDrift_velocity"   unit="m/s" /> 
     644 
     645        <!-- variables available with diaar5 -->    
     646        <field id="w_masstr"     long_name="vertical mass transport"                        standard_name="upward_ocean_mass_transport"             unit="kg/s"   /> 
     647        <field id="w_masstr2"    long_name="square of vertical mass transport"              standard_name="square_of_upward_ocean_mass_transport"   unit="kg2/s2" /> 
     648 
    232649      </field_group> 
    233650       
    234       <!-- SBC --> 
    235  
    236       <field_group id="SBC" grid_ref="grid_T_2D" > <!-- time step automaticaly defined based on nn_fsbc --> 
    237          <field id="empmr"        long_name="Net Upward Water Flux"                standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   /> 
    238          <field id="empbmr"       long_name="Net Upward Water Flux at pre. tstep"  standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   /> 
    239          <field id="emp_oce"      long_name="Evap minus Precip over ocean"         standard_name="evap_minus_precip_over_sea_water"                                     unit="kg/m2/s"   /> 
    240          <field id="emp_ice"      long_name="Evap minus Precip over ice"           standard_name="evap_minus_precip_over_sea_ice"                                       unit="kg/m2/s"   /> 
    241          <field id="saltflx"      long_name="Downward salt flux"                                                                                                        unit="1e-3/m2/s" /> 
    242          <field id="fmmflx"       long_name="Water flux due to freezing/melting"                                                                                        unit="kg/m2/s"   /> 
    243          <field id="snowpre"      long_name="Snow precipitation"                   standard_name="snowfall_flux"                                                        unit="kg/m2/s"   /> 
    244          <field id="runoffs"      long_name="River Runoffs"                        standard_name="water_flux_into_sea_water_from_rivers"                                unit="kg/m2/s"   /> 
    245          <field id="precip"       long_name="Total precipitation"                  standard_name="precipitation_flux"                                                   unit="kg/m2/s"   /> 
    246   
    247          <field id="qt"           long_name="Net Downward Heat Flux"                standard_name="surface_downward_heat_flux_in_sea_water"                              unit="W/m2"                           /> 
    248          <field id="qns"          long_name="non solar Downward Heat Flux"                                                                                               unit="W/m2"                           /> 
    249          <field id="qsr"          long_name="Shortwave Radiation"                   standard_name="net_downward_shortwave_flux_at_sea_water_surface"                     unit="W/m2"                           /> 
    250          <field id="qsr3d"        long_name="Shortwave Radiation 3D distribution"   standard_name="downwelling_shortwave_flux_in_sea_water"                              unit="W/m2"      grid_ref="grid_T_3D" /> 
    251          <field id="qrp"          long_name="Surface Heat Flux: Damping"            standard_name="heat_flux_into_sea_water_due_to_newtonian_relaxation"                 unit="W/m2"                           /> 
    252          <field id="erp"          long_name="Surface Water Flux: Damping"           standard_name="water_flux_out_of_sea_water_due_to_newtonian_relaxation"              unit="kg/m2/s"                        /> 
    253          <field id="taum"         long_name="wind stress module"                    standard_name="magnitude_of_surface_downward_stress"                                 unit="N/m2"                           /> 
    254          <field id="wspd"         long_name="wind speed module"                     standard_name="wind_speed"                                                           unit="m/s"                            /> 
    255           
    256          <!-- * variable relative to atmospheric pressure forcing : available with ln_apr_dyn --> 
    257          <field id="ssh_ib"       long_name="Inverse barometer sea surface height"  standard_name="sea_surface_height_correction_due_to_air_pressure_at_low_frequency"   unit="m"        /> 
    258  
    259          <!-- * variable related to ice shelf forcing * --> 
    260          <field id="fwfisf"       long_name="Ice shelf melting"                             unit="kg/m2/s"  /> 
    261          <field id="fwfisf3d"     long_name="Ice shelf melting"                             unit="kg/m2/s"  grid_ref="grid_T_3D" /> 
    262          <field id="qlatisf"      long_name="Ice shelf latent heat flux"                    unit="W/m2"     /> 
    263          <field id="qlatisf3d"    long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
    264          <field id="qhcisf"       long_name="Ice shelf heat content flux"                   unit="W/m2"     /> 
    265          <field id="qhcisf3d"     long_name="Ice shelf heat content flux"                   unit="W/m2"     grid_ref="grid_T_3D" /> 
    266          <field id="isfgammat"    long_name="transfert coefficient for isf (temperature) "  unit="m/s"      /> 
    267          <field id="isfgammas"    long_name="transfert coefficient for isf (salinity)    "  unit="m/s"      /> 
    268          <field id="stbl"         long_name="salinity in the Losh tbl                    "  unit="PSU"      /> 
    269          <field id="ttbl"         long_name="temperature in the Losh tbl                 "  unit="C"        /> 
    270          <field id="utbl"         long_name="zonal current in the Losh tbl at T point    "  unit="m/s"      /> 
    271          <field id="vtbl"         long_name="merid current in the Losh tbl at T point    "  unit="m/s"      /> 
    272          <field id="thermald"     long_name="thermal driving of ice shelf melting        "  unit="C"        /> 
    273          <field id="tfrz"         long_name="top freezing point (used to compute melt)   "  unit="C"        /> 
    274          <field id="tinsitu"      long_name="top insitu temperature (used to cmpt melt)  "  unit="C"        /> 
    275          <field id="ustar"        long_name="ustar at T point used in ice shelf melting  "  unit="m/s"      /> 
    276  
    277          <!-- *_oce variables available with ln_blk_clio or ln_blk_core --> 
    278          <field id="qlw_oce"      long_name="Longwave Downward Heat Flux over open ocean"  standard_name="surface_net_downward_longwave_flux"                 unit="W/m2"  /> 
    279          <field id="qsb_oce"      long_name="Sensible Downward Heat Flux over open ocean"  standard_name="surface_downward_sensible_heat_flux"                unit="W/m2"  /> 
    280          <field id="qla_oce"      long_name="Latent Downward Heat Flux over open ocean"    standard_name="surface_downward_latent_heat_flux"                  unit="W/m2"  /> 
    281          <field id="qt_oce"       long_name="total flux at ocean surface"                  standard_name="surface_downward_heat_flux_in_sea_water"            unit="W/m2"  /> 
    282          <field id="qsr_oce"      long_name="solar heat flux at ocean surface"             standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"  /> 
    283          <field id="qns_oce"      long_name="non-solar heat flux at ocean surface (including E-P)"                                                            unit="W/m2"  /> 
    284          <field id="qemp_oce"     long_name="Downward Heat Flux from E-P over open ocean"                                                                     unit="W/m2"  /> 
    285          <field id="taum_oce"     long_name="wind stress module over open ocean"           standard_name="magnitude_of_surface_downward_stress"               unit="N/m2"  /> 
    286  
    287          <!-- available key_oasis3 --> 
    288          <field id="snow_ao_cea"  long_name="Snow over ice-free ocean (cell average)"   standard_name="snowfall_flux"                             unit="kg/m2/s"  /> 
    289          <field id="snow_ai_cea"  long_name="Snow over sea-ice (cell average)"          standard_name="snowfall_flux"                             unit="kg/m2/s"  /> 
    290          <field id="subl_ai_cea"  long_name="Sublimation over sea-ice (cell average)"   standard_name="surface_snow_and_ice_sublimation_flux"     unit="kg/m2/s"  /> 
    291          <field id="icealb_cea"   long_name="Ice albedo (cell average)"                 standard_name="sea_ice_albedo"                            unit="1"        /> 
    292          <field id="calving_cea"  long_name="Calving"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
    293          <field id="iceberg_cea"  long_name="Iceberg"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
    294          <field id="iceshelf_cea" long_name="Iceshelf"                                  standard_name="water_flux_into_sea_water_from_iceshelf"   unit="kg/m2/s"  /> 
    295  
    296  
    297          <!-- available if key_oasis3 + conservative method --> 
    298          <field id="rain"          long_name="Liquid precipitation"                                     standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  /> 
    299          <field id="evap_ao_cea"   long_name="Evaporation over ice-free ocean (cell average)"           standard_name="water_evaporation_flux"                                                        unit="kg/m2/s"  /> 
    300          <field id="isnwmlt_cea"   long_name="Snow over Ice melting (cell average)"                     standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  /> 
    301          <field id="fsal_virt_cea" long_name="Virtual salt flux due to ice formation (cell average)"    standard_name="virtual_salt_flux_into_sea_water_due_to_sea_ice_thermodynamics"                unit="kg/m2/s"  /> 
    302          <field id="fsal_real_cea" long_name="Real salt flux due to ice formation (cell average)"       standard_name="downward_sea_ice_basal_salt_flux"                                              unit="kg/m2/s"  /> 
    303          <field id="hflx_rain_cea" long_name="heat flux due to rainfall"                                standard_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"        unit="W/m2"     /> 
    304          <field id="hflx_evap_cea" long_name="heat flux due to evaporation"                             standard_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water"   unit="W/m2"     /> 
    305          <field id="hflx_snow_cea" long_name="heat flux due to snow falling"                            standard_name="heat_flux_onto_ocean_and_ice_due_to_snow_thermodynamics"                       unit="W/m2"     /> 
    306          <field id="hflx_snow_ai_cea" long_name="heat flux due to snow falling over ice"                standard_name="heat_flux_onto_ice_due_to_snow_thermodynamics"                                 unit="W/m2"     /> 
    307          <field id="hflx_snow_ao_cea" long_name="heat flux due to snow falling over ice-free ocean"     standard_name="heat_flux_onto_sea_water_due_to_snow_thermodynamics"                           unit="W/m2"     /> 
    308          <field id="hflx_ice_cea"  long_name="heat flux due to ice thermodynamics"                      standard_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                        unit="W/m2"     /> 
    309          <field id="hflx_rnf_cea"  long_name="heat flux due to runoffs"                                 standard_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"          unit="W/m2"     /> 
    310          <field id="hflx_cal_cea"  long_name="heat flux due to calving"                                 standard_name="heat_flux_into_sea_water_due_to_calving"                                       unit="W/m2"     /> 
    311          <field id="hflx_icb_cea"  long_name="heat flux due to iceberg"                                 standard_name="heat_flux_into_sea_water_due_to_icebergs"                                      unit="W/m2"     /> 
    312          <field id="hflx_isf_cea"  long_name="heat flux due to iceshelf"                                standard_name="heat_flux_into_sea_water_due_to_iceshelf"                                      unit="W/m2"     /> 
    313          <field id="bicemel_cea"   long_name="Rate of Melt at Sea Ice Base (cell average)"              standard_name="tendency_of_sea_ice_amount_due_to_basal_melting"                               unit="kg/m2/s"  /> 
    314          <field id="licepro_cea"   long_name="Lateral Sea Ice Growth Rate (cell average)"               standard_name="tendency_of_sea_ice_amount_due_to_lateral_growth_of_ice_floes"                 unit="kg/m2/s"  /> 
    315          <field id="snowmel_cea"   long_name="Snow Melt Rate (cell average)"                            standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  /> 
    316          <field id="sntoice_cea"   long_name="Snow-Ice Formation Rate (cell average)"                   standard_name="tendency_of_sea_ice_amount_due_to_snow_conversion"                             unit="kg/m2/s"  /> 
    317          <field id="ticemel_cea"   long_name="Rate of Melt at Upper Surface of Sea Ice (cell average)"  standard_name="tendency_of_sea_ice_amount_due_to_surface_melting"                             unit="kg/m2/s"  /> 
    318  
    319          <!-- ice field (nn_ice=1)  --> 
    320          <field id="ice_cover"    long_name="Ice fraction"                                                 standard_name="sea_ice_area_fraction"                              unit="1"            /> 
    321           
    322          <!-- dilution --> 
    323          <field id="emp_x_sst"    long_name="Concentration/Dilution term on SST"                                                                                              unit="kg*degC/m2/s" /> 
    324          <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*1e-3/m2/s" />         
    325          <field id="rnf_x_sst"    long_name="Runoff term on SST"                                                                                                              unit="kg*degC/m2/s" /> 
    326          <field id="rnf_x_sss"    long_name="Runoff term on SSS"                                                                                                              unit="kg*1e-3/m2/s" /> 
    327         
    328     <!-- sbcssm variables --> 
    329          <field id="sst_m"    unit="degC" /> 
    330          <field id="sss_m"    unit="psu"  /> 
    331          <field id="ssu_m"    unit="m/s"  /> 
    332          <field id="ssv_m"    unit="m/s"  /> 
    333          <field id="ssh_m"    unit="m"    /> 
    334          <field id="e3t_m"    unit="m"    /> 
    335          <field id="frq_m"    unit="-"    /> 
    336  
    337       </field_group> 
    338  
    339       <!-- U grid --> 
    340        
    341       <field_group id="grid_U"   grid_ref="grid_U_2D"> 
    342          <field id="e3u"          long_name="U-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_U_3D" /> 
    343          <field id="e3u_0"        long_name="Initial U-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_U_3D"/> 
    344          <field id="utau"         long_name="Wind Stress along i-axis"                               standard_name="surface_downward_x_stress"   unit="N/m2"                            /> 
    345          <field id="uoce"         long_name="ocean current along i-axis"                             standard_name="sea_water_x_velocity"        unit="m/s"        grid_ref="grid_U_3D" /> 
    346          <field id="uoce_e3u"     long_name="ocean current along i-axis  (thickness weighted)"                                                   unit="m/s"        grid_ref="grid_U_3D"  > uoce * e3u </field> 
    347          <field id="ssu"          long_name="ocean surface current along i-axis"                                                                 unit="m/s"                             /> 
    348          <field id="sbu"          long_name="ocean bottom current along i-axis"                                                                  unit="m/s"                             /> 
    349          <field id="ubar"         long_name="ocean barotropic current along i-axis"                                                              unit="m/s"                             /> 
    350          <field id="uocetr_eff"   long_name="Effective ocean transport along i-axis"                 standard_name="ocean_volume_x_transport"    unit="m3/s"       grid_ref="grid_U_3D" /> 
    351          <field id="uocet"        long_name="ocean transport along i-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_U_3D" /> 
    352          <field id="uoces"        long_name="ocean transport along i-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_U_3D" /> 
    353  
    354          <!-- u-eddy diffusivity coefficients (available if ln_traldf_OFF=F) --> 
    355          <field id="ahtu_2d"      long_name=" surface u-eddy diffusivity coefficient"   unit="m2/s or m4/s" /> 
    356          <field id="ahtu_3d"      long_name=" 3D u-EIV coefficient"                     unit="m2/s or m4/s"      grid_ref="grid_U_3D"/> 
    357          <!-- u-eiv diffusivity coefficients (available if ln_ldfeiv=F) --> 
    358          <field id="aeiu_2d"      long_name=" surface u-EIV coefficient"                unit="m2/s" /> 
    359          <field id="aeiu_3d"      long_name=" 3D u-EIV coefficient"                     unit="m2/s"              grid_ref="grid_U_3D"/> 
    360  
    361          <!-- variables available with MLE (ln_mle=T) --> 
    362          <field id="psiu_mle"     long_name="MLE streamfunction along i-axis"   unit="m3/s"   grid_ref="grid_U_3D" /> 
    363  
    364          <!-- uoce_eiv: available EIV (ln_ldfeiv=T and ln_ldfeiv_dia=T) --> 
    365          <field id="uoce_eiv"     long_name="EIV ocean current along i-axis"   standard_name="bolus_sea_water_x_velocity"   unit="m/s"   grid_ref="grid_U_3D" /> 
    366  
    367          <!-- uoce_bbl: available with ln_trabbl=T and nn_bbl_adv=1 --> 
    368          <field id="uoce_bbl"     long_name="BBL ocean current along i-axis"    unit="m/s"  /> 
    369          <!-- ahu_bbl : available with ln_trabbl=T and nn_bbl_ldf=1 --> 
    370          <field id="ahu_bbl"      long_name="BBL diffusive flux along i-axis"   unit="m3/s" /> 
    371  
    372          <!-- variable for ice shelves --> 
    373          <field id="utbl"         long_name="zonal current in the Losh tbl"     unit="m/s" /> 
    374  
    375          <field id="u_masstr"     long_name="Ocean Mass X Transport"    standard_name="ocean_mass_x_transport"                          unit="kg/s"        grid_ref="grid_U_3D" /> 
    376          <field id="u_masstr_vint" long_name="vertical integral of ocean eulerian mass transport along i-axis"    standard_name="vertical_integral_of_ocean_mass_x_transport"  unit="kg/s" /> 
    377          <field id="u_heattr"     long_name="ocean eulerian heat transport along i-axis"    standard_name="ocean_heat_x_transport"                          unit="W"                                /> 
    378          <field id="u_salttr"     long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_x_transport"                          unit="1e-3*kg/s"                        /> 
    379          <field id="uadv_heattr"  long_name="ocean advective heat transport along i-axis"    standard_name="advectice_ocean_heat_x_transport"               unit="W"                                /> 
    380          <field id="uadv_salttr"  long_name="ocean advective salt transport along i-axis"    standard_name="advectice_ocean_salt_x_transport"               unit="1e-3*kg/s"                      /> 
    381          <field id="ueiv_heattr"  long_name="ocean bolus heat transport along i-axis"       standard_name="ocean_heat_x_transport_due_to_bolus_advection"   unit="W"                                /> 
    382          <field id="ueiv_salttr"  long_name="ocean bolus salt transport along i-axis"       standard_name="ocean_salt_x_transport_due_to_bolus_advection"   unit="Kg"                                /> 
    383          <field id="ueiv_heattr3d" long_name="ocean bolus heat transport along i-axis"    standard_name="ocean_heat_x_transport_due_to_bolus_advection"   unit="W"    grid_ref="grid_U_3D" /> 
    384          <field id="ueiv_salttr3d" long_name="ocean bolus salt transport along i-axis"    standard_name="ocean_salt_x_transport_due_to_bolus_advection"   unit="kg"   grid_ref="grid_U_3D" /> 
    385          <field id="udiff_heattr" long_name="ocean diffusion heat transport along i-axis"   standard_name="ocean_heat_x_transport_due_to_diffusion"         unit="W"                                /> 
    386          <field id="udiff_salttr" long_name="ocean diffusion salt transport along i-axis"   standard_name="ocean_salt_x_transport_due_to_diffusion"         unit="1e-3*kg/s"                                /> 
    387       </field_group> 
    388        
    389       <!-- V grid --> 
    390        
    391       <field_group id="grid_V"   grid_ref="grid_V_2D"> 
    392          <field id="e3v"          long_name="V-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_V_3D" /> 
    393          <field id="e3v_0"        long_name="Initial V-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_V_3D"/> 
    394          <field id="vtau"         long_name="Wind Stress along j-axis"                               standard_name="surface_downward_y_stress"   unit="N/m2"                            /> 
    395          <field id="voce"         long_name="ocean current along j-axis"                             standard_name="sea_water_y_velocity"        unit="m/s"        grid_ref="grid_V_3D" /> 
    396          <field id="voce_e3v"     long_name="ocean current along j-axis  (thickness weighted)"                                                   unit="m/s"        grid_ref="grid_V_3D"  > voce * e3v </field> 
    397          <field id="ssv"          long_name="ocean surface current along j-axis"                                                                 unit="m/s"                             /> 
    398          <field id="sbv"          long_name="ocean bottom current along j-axis"                                                                  unit="m/s"                             /> 
    399          <field id="vbar"         long_name="ocean barotropic current along j-axis"                                                              unit="m/s"                             /> 
    400          <field id="vocetr_eff"   long_name="Effective ocean transport along j-axis"                 standard_name="ocean_volume_y_transport"    unit="m3/s"       grid_ref="grid_V_3D" /> 
    401          <field id="vocet"        long_name="ocean transport along j-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_V_3D" /> 
    402          <field id="voces"        long_name="ocean transport along j-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_V_3D" /> 
    403  
    404          <!-- v-eddy diffusivity coefficients (available if ln_traldf_OFF=F) --> 
    405          <field id="ahtv_2d"      long_name=" surface v-eddy diffusivity coefficient"     unit="m2/s or (m4/s)^1/2" /> 
    406          <field id="ahtv_3d"      long_name=" 3D v-eddy diffusivity coefficient"          unit="m2/s or (m4/s)^1/2"           grid_ref="grid_V_3D"/> 
    407          <!-- v-eiv diffusivity coefficients (available if ln_ldfeiv=F) --> 
    408          <field id="aeiv_2d"      long_name=" surface v-EIV coefficient"                  unit="m2/s" /> 
    409          <field id="aeiv_3d"      long_name=" 3D v-EIV coefficient"                       unit="m2/s"                         grid_ref="grid_V_3D" /> 
    410  
    411          <!-- variables available with MLE (ln_mle=T) --> 
    412          <field id="psiv_mle"     long_name="MLE streamfunction along j-axis"   unit="m3/s"   grid_ref="grid_V_3D" /> 
    413  
    414          <!-- voce_eiv: available EIV (ln_ldfeiv=T and ln_ldfeiv_dia=T)  --> 
    415          <field id="voce_eiv"     long_name="EIV ocean current along j-axis"   standard_name="bolus_sea_water_y_velocity"   unit="m/s"   grid_ref="grid_V_3D" /> 
    416  
    417          <!-- voce_bbl: available with ln_trabbl=T and nn_bbl_adv=1 --> 
    418          <field id="voce_bbl"     long_name="BBL ocean current along j-axis"    unit="m/s"  /> 
    419          <!-- ahu_bbl : available with ln_trabbl=T and nn_bbl_ldf=1 --> 
    420          <field id="ahv_bbl"      long_name="BBL diffusive flux along j-axis"   unit="m3/s" /> 
    421  
    422          <!-- variable for ice shelves --> 
    423          <field id="vtbl"         long_name="meridional current in the Losh tbl"   unit="m/s" /> 
    424  
    425          <!-- variables available with diaar5 --> 
    426          <field id="v_masstr"     long_name="ocean eulerian mass transport along j-axis"    standard_name="ocean_mass_y_transport"                          unit="kg/s"        grid_ref="grid_V_3D" /> 
    427          <field id="v_heattr"     long_name="ocean eulerian heat transport along j-axis"    standard_name="ocean_heat_y_transport"                          unit="W"                                /> 
    428          <field id="v_salttr"     long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_y_transport"                          unit="1e-3*kg/s"                        /> 
    429          <field id="vadv_heattr"  long_name="ocean advective heat transport along j-axis"   standard_name="advectice_ocean_heat_y_transport"                unit="W"                      /> 
    430          <field id="vadv_salttr"  long_name="ocean advective salt transport along j-axis"   standard_name="advectice_ocean_salt_y_transport"                unit="1e-3*kg/s"              /> 
    431          <field id="veiv_heattr"  long_name="ocean bolus heat transport along j-axis"       standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"                                /> 
    432          <field id="veiv_salttr"  long_name="ocean bolus salt transport along j-axis"       standard_name="ocean_salt_x_transport_due_to_bolus_advection"   unit="Kg"                                /> 
    433          <field id="veiv_heattr3d" long_name="ocean bolus heat transport along j-axis"    standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"    grid_ref="grid_V_3D" /> 
    434          <field id="veiv_salttr3d" long_name="ocean bolus salt transport along j-axis"    standard_name="ocean_salt_y_transport_due_to_bolus_advection"   unit="kg"   grid_ref="grid_V_3D" /> 
    435          <field id="vdiff_heattr" long_name="ocean diffusion heat transport along j-axis"   standard_name="ocean_heat_y_transport_due_to_diffusion"         unit="W"                                /> 
    436          <field id="vdiff_salttr" long_name="ocean diffusion salt transport along j-axis"   standard_name="ocean_salt_y_transport_due_to_diffusion"         unit="1e-3*kg/s"                        /> 
    437       </field_group> 
    438        
    439       <!-- W grid --> 
    440        
    441       <field_group id="grid_W" grid_ref="grid_W_3D"> 
    442          <field id="e3w"          long_name="W-cell thickness"                     standard_name="cell_thickness"              unit="m"    /> 
    443          <field id="woce"         long_name="ocean vertical velocity"              standard_name="upward_sea_water_velocity"   unit="m/s"  /> 
    444          <field id="wocetr_eff"   long_name="effective ocean vertical transport"                                               unit="m3/s" /> 
    445  
    446          <!-- woce_eiv: available with EIV  (ln_ldfeiv=T and ln_ldfeiv_dia=T)  --> 
    447          <field id="woce_eiv"     long_name="EIV ocean vertical velocity"   standard_name="bolus_upward_sea_water_velocity"   unit="m/s" /> 
    448  
    449          <field id="avt"          long_name="vertical eddy diffusivity"   standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" /> 
    450          <field id="logavt"       long_name="logarithm of vertical eddy diffusivity"   standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" /> 
    451          <field id="avm"          long_name="vertical eddy viscosity"     standard_name="ocean_vertical_momentum_diffusivity"   unit="m2/s" /> 
    452  
    453          <!-- avs: /= avt with ln_zdfddm=T --> 
    454          <field id="avs"          long_name="salt vertical eddy diffusivity"   standard_name="ocean_vertical_salt_diffusivity"   unit="m2/s" /> 
    455          <field id="logavs"       long_name="logarithm of salt vertical eddy diffusivity"   standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" /> 
    456  
    457          <!-- avt_evd and avm_evd: available with ln_zdfevd --> 
    458          <field id="avt_evd"      long_name="convective enhancement of vertical diffusivity"   standard_name="ocean_vertical_tracer_diffusivity_due_to_convection"     unit="m2/s" /> 
    459          <field id="avm_evd"      long_name="convective enhancement of vertical viscosity"     standard_name="ocean_vertical_momentum_diffusivity_due_to_convection"   unit="m2/s" /> 
    460  
    461          <!-- avt_tide: available with ln_zdfiwm=T --> 
    462          <field id="av_ratio"     long_name="S over T diffusivity ratio"                     standard_name="salinity_over_temperature_diffusivity_ratio"                     unit="1"    /> 
    463          <field id="av_wave"      long_name="internal wave-induced vertical diffusivity"     standard_name="ocean_vertical_tracer_diffusivity_due_to_internal_waves"         unit="m2/s" /> 
    464          <field id="bflx_iwm"     long_name="internal wave-induced buoyancy flux"            standard_name="buoyancy_flux_due_to_internal_waves"                             unit="W/kg" /> 
    465          <field id="pcmap_iwm"    long_name="power consumed by wave-driven mixing"           standard_name="vertically_integrated_power_consumption_by_wave_driven_mixing"   unit="W/m2"      grid_ref="grid_W_2D" /> 
    466          <field id="emix_iwm"     long_name="power density available for mixing"             standard_name="power_available_for_mixing_from_breaking_internal_waves"         unit="W/kg" /> 
    467  
    468          <!-- variables available with diaar5 -->    
    469          <field id="w_masstr"     long_name="vertical mass transport"             standard_name="upward_ocean_mass_transport"             unit="kg/s"   /> 
    470          <field id="w_masstr2"    long_name="square of vertical mass transport"   standard_name="square_of_upward_ocean_mass_transport"   unit="kg2/s2" /> 
    471  
    472       </field_group> 
    473          
    474651      <!-- F grid --> 
     652      <!-- AGRIF sponge --> 
     653      <field id="agrif_spf"    long_name=" AGRIF f-sponge coefficient"   unit=" " /> 
    475654      <!-- f-eddy viscosity coefficients (ldfdyn) --> 
    476655      <field id="ahmf_2d"      long_name=" surface f-eddy viscosity coefficient"   unit="m2/s or m4/s" /> 
    477       <field id="ahmf_3d"      long_name=" 3D      f-eddy viscosity coefficient"   unit="m2/s or m4/s"                           grid_ref="grid_T_3D"/> 
    478  
    479       <field_group id="scalar"  grid_ref="grid_T_2D"  > 
    480           <!-- Need to have a salinity reference climatological file : sali_ref_clim_monthly --> 
    481          <field id="voltot"     long_name="global total volume"                          standard_name="sea_water_volume"                               unit="m3"   /> 
    482          <field id="sshtot"     long_name="global mean ssh"                              standard_name="global_average_sea_level_change"                unit="m"    /> 
    483          <field id="sshsteric"  long_name="global mean ssh steric"                       standard_name="global_average_steric_sea_level_change"         unit="m"    /> 
    484          <field id="sshthster"  long_name="global mean ssh thermosteric"                 standard_name="global_average_thermosteric_sea_level_change"   unit="m"    /> 
    485          <field id="masstot"    long_name="global total mass"                            standard_name="sea_water_mass"                                 unit="kg"   /> 
    486          <field id="temptot"    long_name="global mean temperature"                      standard_name="sea_water_potential_temperature"                unit="degC" /> 
    487          <field id="saltot"     long_name="global mean salinity"                         standard_name="sea_water_salinity"                             unit="1e-3" /> 
    488          <field id="fram_trans" long_name="Sea Ice Mass Transport Through Fram Strait"   standard_name="sea_ice_transport_across_line"                  unit="kg/s" /> 
    489  
    490           <!-- available with ln_diahsb --> 
    491          <field id="bgtemper"     long_name="drift in global mean temperature wrt timestep 1"                 standard_name="change_over_time_in_sea_water_potential_temperature"   unit="degC"     /> 
    492          <field id="bgsaline"     long_name="drift in global mean salinity wrt timestep 1"                    standard_name="change_over_time_in_sea_water_practical_salinity"      unit="1e-3"     /> 
    493          <field id="bgheatco"     long_name="drift in global mean heat content wrt timestep 1"                                                                                      unit="1.e20J"   /> 
    494          <field id="bgheatfx"     long_name="drift in global mean heat flux    wrt timestep 1"                                                                                      unit="W/m2"     /> 
    495          <field id="bgsaltco"     long_name="drift in global mean salt content wrt timestep 1"                                                                                      unit="1e-3*km3" /> 
    496          <field id="bgvolssh"     long_name="drift in global mean ssh volume wrt timestep 1"                                                                                        unit="km3"      /> 
    497          <field id="bgvole3t"     long_name="drift in global mean volume variation (e3t) wrt timestep 1"                                                                            unit="km3"      /> 
    498          <field id="bgfrcvol"     long_name="global mean volume from forcing"                                                                                                       unit="km3"      /> 
    499          <field id="bgfrctem"     long_name="global mean heat content from forcing"                                                                                                 unit="1.e20J"   /> 
    500          <field id="bgfrchfx"     long_name="global mean heat flux from forcing"                                                                                                    unit="W/m2"     /> 
    501          <field id="bgfrcsal"     long_name="global mean salt content from forcing"                                                                                                 unit="1e-3*km3" /> 
    502          <field id="bgmistem"     long_name="global mean temperature error due to free surface (linssh true)"                                                                            unit="degC"     /> 
    503          <field id="bgmissal"     long_name="global mean salinity error due to free surface (linssh true)"                                                                               unit="1e-3"     /> 
     656      <field id="ahmf_3d"      long_name=" 3D      f-eddy viscosity coefficient"   unit="m2/s or m4/s"  grid_ref="grid_T_3D"/> 
     657 
     658      <field_group id="scalar"  grid_ref="grid_scalar"  > 
     659         <!-- Need to have a salinity reference climatological file : sali_ref_clim_monthly --> 
     660        <field id="voltot"     long_name="global total volume"                          standard_name="sea_water_volume"                               unit="m3"   /> 
     661        <field id="sshtot"     long_name="global mean ssh"                              standard_name="global_average_sea_level_change"                unit="m"    /> 
     662        <field id="sshsteric"  long_name="global mean ssh steric"                       standard_name="global_average_steric_sea_level_change"         unit="m"    /> 
     663        <field id="sshthster"  long_name="global mean ssh thermosteric"                 standard_name="global_average_thermosteric_sea_level_change"   unit="m"    /> 
     664        <field id="masstot"    long_name="global total mass"                            standard_name="sea_water_mass"                                 unit="kg"   /> 
     665        <field id="temptot"    long_name="global mean temperature"                      standard_name="sea_water_potential_temperature"                unit="degC" /> 
     666   <field id="saltot"     long_name="global mean salinity"                         standard_name="sea_water_salinity"                             unit="1e-3" /> 
     667        <field id="ssttot"     long_name="global mean sea surface temperature"          standard_name="sea_water_conservative_temperature"             unit="degC" /> 
     668         <!-- EOS = TEOS-10 --> 
     669        <field id="temptot_pot" long_name="global mean potential temperature"            standard_name="sea_water_potential_temperature"               unit="degC" /> 
     670 
     671         <!-- available with ln_diahsb --> 
     672        <field id="bgtemper"     long_name="drift in global mean temperature wrt timestep 1"                 standard_name="change_over_time_in_sea_water_potential_temperature"   unit="degC"     /> 
     673        <field id="bgsaline"     long_name="drift in global mean salinity wrt timestep 1"                    standard_name="change_over_time_in_sea_water_practical_salinity"      unit="1e-3"     /> 
     674        <field id="bgheatco"     long_name="drift in global mean heat content wrt timestep 1"                                                                                      unit="1.e20J"   /> 
     675        <field id="bgheatfx"     long_name="drift in global mean heat flux    wrt timestep 1"                                                                                      unit="W/m2"     /> 
     676        <field id="bgsaltco"     long_name="drift in global mean salt content wrt timestep 1"                                                                                      unit="1e-3*km3" /> 
     677        <field id="bgvolssh"     long_name="drift in global mean ssh volume wrt timestep 1"                                                                                        unit="km3"      /> 
     678        <field id="bgvole3t"     long_name="drift in global mean volume variation (e3t) wrt timestep 1"                                                                            unit="km3"      /> 
     679        <field id="bgfrcvol"     long_name="global mean volume from forcing"                                                                                                       unit="km3"      /> 
     680        <field id="bgfrctem"     long_name="global mean heat content from forcing"                                                                                                 unit="1.e20J"   /> 
     681        <field id="bgfrchfx"     long_name="global mean heat flux from forcing"                                                                                                    unit="W/m2"     /> 
     682        <field id="bgfrcsal"     long_name="global mean salt content from forcing"                                                                                                 unit="1e-3*km3" /> 
     683        <field id="bgmistem"     long_name="global mean temperature error due to free surface (linssh true)"                                                                       unit="degC"     /> 
     684        <field id="bgmissal"     long_name="global mean salinity error due to free surface (linssh true)"                                                                          unit="1e-3"     /> 
    504685      </field_group> 
    505    
    506       <!-- variables available with key_float --> 
     686 
     687 
     688      <!-- transects --> 
     689      <field_group id="oce_straits"> 
     690         <field id="uoce_e3u_ave"         long_name="Monthly average of u*e3u"                        field_ref="uoce_e3u"                    freq_op="1mo"   freq_offset="_reset_" > @uoce_e3u </field> 
     691         <field id="uoce_e3u_ave_vsum"    long_name="Vertical sum of u*e3u"                           field_ref="uoce_e3u_ave"         grid_ref="grid_U_vsum"     /> 
     692         <field id="uocetr_vsum_section"  long_name="Total 2D transport in i-direction"               field_ref="uoce_e3u_ave_vsum"    grid_ref="grid_U_scalar"  detect_missing_value="true"> this * e2u </field> 
     693         <field id="uocetr_strait"        long_name="Total transport across lines in i-direction"     field_ref="uocetr_vsum_section"  grid_ref="grid_U_4strait" /> 
     694         <field id="u_masstr_strait"      long_name="Sea water transport across line in i-direction"  field_ref="uocetr_strait"        grid_ref="grid_U_4strait_hsum" unit="kg/s"> this * maskMFO_u * $rau0 </field> 
     695 
     696         <field id="voce_e3v_ave"         long_name="Monthly average of v*e3v"                        field_ref="voce_e3v"                    freq_op="1mo"   freq_offset="_reset_" > @voce_e3v </field> 
     697         <field id="voce_e3v_ave_vsum"    long_name="Vertical sum of v*e3v"                           field_ref="voce_e3v_ave"         grid_ref="grid_V_vsum"      /> 
     698         <field id="vocetr_vsum_section"  long_name="Total 2D transport of in j-direction"            field_ref="voce_e3v_ave_vsum"    grid_ref="grid_V_scalar"  detect_missing_value="true"> this * e1v </field> 
     699         <field id="vocetr_strait"        long_name="Total transport across lines in j-direction"     field_ref="vocetr_vsum_section"  grid_ref="grid_V_4strait"  /> 
     700         <field id="v_masstr_strait"      long_name="Sea water transport across line in j-direction"  field_ref="vocetr_strait"        grid_ref="grid_V_4strait_hsum" unit="kg/s"> this * maskMFO_v * $rau0 </field> 
     701 
     702         <field id="masstr_strait"        long_name="Sea water transport across line"                                                  grid_ref="grid_4strait"  > u_masstr_strait + v_masstr_strait </field> 
     703      </field_group> 
     704 
     705       
     706      <!-- variables available with ln_floats --> 
    507707 
    508708      <field_group id="floatvar" grid_ref="grid_T_nfloat"  operation="instant" > 
    509          <field id="traj_lon"      long_name="floats longitude"                                                           unit="degrees_east"  /> 
    510          <field id="traj_lat"      long_name="floats latitude"                                                            unit="degrees_north" /> 
    511          <field id="traj_dep"      long_name="floats depth"                                                               unit="m"             /> 
    512          <field id="traj_temp"     long_name="floats temperature"       standard_name="sea_water_potential_temperature"   unit="degC"          /> 
    513          <field id="traj_salt"     long_name="floats salinity"          standard_name="sea_water_practical_salinity"      unit="1e-3"          /> 
    514          <field id="traj_dens"     long_name="floats in-situ density"   standard_name="sea_water_density"                 unit="kg/m3"         /> 
    515          <field id="traj_group"    long_name="floats group"                                                               unit="1"             /> 
     709        <field id="traj_lon"      long_name="floats longitude"                                                           unit="degrees_east"  /> 
     710        <field id="traj_lat"      long_name="floats latitude"                                                            unit="degrees_north" /> 
     711        <field id="traj_dep"      long_name="floats depth"                                                               unit="m"             /> 
     712        <field id="traj_temp"     long_name="floats temperature"       standard_name="sea_water_potential_temperature"   unit="degC"          /> 
     713        <field id="traj_salt"     long_name="floats salinity"          standard_name="sea_water_practical_salinity"      unit="1e-3"          /> 
     714        <field id="traj_dens"     long_name="floats in-situ density"   standard_name="sea_water_density"                 unit="kg/m3"         /> 
     715        <field id="traj_group"    long_name="floats group"                                                               unit="1"             /> 
    516716      </field_group> 
    517717 
     
    519719 
    520720      <field_group id="icbvar" domain_ref="grid_T"  >  
    521          <field id="berg_melt"          long_name="icb melt rate of icebergs"                       unit="kg/m2/s"                    /> 
    522          <field id="berg_buoy_melt"     long_name="icb buoyancy component of iceberg melt rate"     unit="kg/m2/s"                    /> 
    523          <field id="berg_eros_melt"     long_name="icb erosion component of iceberg melt rate"      unit="kg/m2/s"                    /> 
    524          <field id="berg_conv_melt"     long_name="icb convective component of iceberg melt rate"   unit="kg/m2/s"                    /> 
    525          <field id="berg_virtual_area"  long_name="icb virtual coverage by icebergs"                unit="m2"                         /> 
    526          <field id="bits_src"           long_name="icb mass source of bergy bits"                   unit="kg/m2/s"                    /> 
    527          <field id="bits_melt"          long_name="icb melt rate of bergy bits"                     unit="kg/m2/s"                    /> 
    528          <field id="bits_mass"          long_name="icb bergy bit density field"                     unit="kg/m2"                      /> 
    529          <field id="berg_mass"          long_name="icb iceberg density field"                       unit="kg/m2"                      /> 
    530          <field id="calving"            long_name="icb calving mass input"                          unit="kg/s"                       /> 
    531          <field id="berg_floating_melt" long_name="icb melt rate of icebergs + bits"                unit="kg/m2/s"                    /> 
    532          <field id="berg_real_calving"  long_name="icb calving into iceberg class"                  unit="kg/s"     axis_ref="icbcla" /> 
    533          <field id="berg_stored_ice"    long_name="icb accumulated ice mass by class"               unit="kg"       axis_ref="icbcla" /> 
     721        <field id="berg_melt"          long_name="icb melt rate of icebergs"                       unit="kg/m2/s"                    /> 
     722        <field id="berg_melt_hcflx"    long_name="icb heat flux to ocean due to melting heat content"   unit="J/m2/s"                /> 
     723        <field id="berg_melt_qlat"     long_name="icb heat flux to ocean due to melting latent heat"    unit="J/m2/s"                /> 
     724        <field id="berg_buoy_melt"     long_name="icb buoyancy component of iceberg melt rate"     unit="kg/m2/s"                    /> 
     725        <field id="berg_eros_melt"     long_name="icb erosion component of iceberg melt rate"      unit="kg/m2/s"                    /> 
     726        <field id="berg_conv_melt"     long_name="icb convective component of iceberg melt rate"   unit="kg/m2/s"                    /> 
     727        <field id="berg_virtual_area"  long_name="icb virtual coverage by icebergs"                unit="m2"                         /> 
     728        <field id="bits_src"           long_name="icb mass source of bergy bits"                   unit="kg/m2/s"                    /> 
     729        <field id="bits_melt"          long_name="icb melt rate of bergy bits"                     unit="kg/m2/s"                    /> 
     730        <field id="bits_mass"          long_name="icb bergy bit density field"                     unit="kg/m2"                      /> 
     731        <field id="berg_mass"          long_name="icb iceberg density field"                       unit="kg/m2"                      /> 
     732        <field id="calving"            long_name="icb calving mass input"                          unit="kg/s"                       /> 
     733        <field id="berg_floating_melt" long_name="icb melt rate of icebergs + bits"                unit="kg/m2/s"                    /> 
     734        <field id="berg_real_calving"  long_name="icb calving into iceberg class"                  unit="kg/s"     axis_ref="icbcla" /> 
     735        <field id="berg_stored_ice"    long_name="icb accumulated ice mass by class"               unit="kg"       axis_ref="icbcla" /> 
    534736      </field_group> 
    535737 
    536738      <!-- Poleward transport : ptr -->      
    537739      <field_group id="diaptr" >   
    538          <field id="zomsfglo"          long_name="Meridional Stream-Function: Global"           unit="Sv"       grid_ref="gznl_W_3D" /> 
    539          <field id="zomsfatl"          long_name="Meridional Stream-Function: Atlantic"         unit="Sv"       grid_ref="gznl_W_3D" /> 
    540          <field id="zomsfpac"          long_name="Meridional Stream-Function: Pacific"          unit="Sv"       grid_ref="gznl_W_3D" /> 
    541          <field id="zomsfind"          long_name="Meridional Stream-Function: Indian"           unit="Sv"       grid_ref="gznl_W_3D" /> 
    542          <field id="zomsfipc"          long_name="Meridional Stream-Function: Pacific+Indian"   unit="Sv"       grid_ref="gznl_W_3D" /> 
    543          <field id="zotemglo"          long_name="Zonal Mean Temperature : Global"              unit="degree_C"     grid_ref="gznl_T_3D" /> 
    544          <field id="zotematl"          long_name="Zonal Mean Temperature : Atlantic"            unit="degree_C"     grid_ref="gznl_T_3D" /> 
    545          <field id="zotempac"          long_name="Zonal Mean Temperature : Pacific"             unit="degree_C"     grid_ref="gznl_T_3D" /> 
    546          <field id="zotemind"          long_name="Zonal Mean Temperature : Indian"              unit="degree_C"     grid_ref="gznl_T_3D" /> 
    547          <field id="zotemipc"          long_name="Zonal Mean Temperature : Pacific+Indian"      unit="degree_C"     grid_ref="gznl_T_3D" /> 
    548          <field id="zosalglo"          long_name="Zonal Mean Salinity : Global"                 unit="0.001"     grid_ref="gznl_T_3D" /> 
    549          <field id="zosalatl"          long_name="Zonal Mean Salinity : Atlantic"               unit="0.001"     grid_ref="gznl_T_3D" /> 
    550          <field id="zosalpac"          long_name="Zonal Mean Salinity : Pacific"                unit="0.001"     grid_ref="gznl_T_3D" /> 
    551          <field id="zosalind"          long_name="Zonal Mean Salinity : Indian"                 unit="0.001"     grid_ref="gznl_T_3D" /> 
    552          <field id="zosalipc"          long_name="Zonal Mean Salinity : Pacific+Indian"         unit="0.001"     grid_ref="gznl_T_3D" /> 
    553          <field id="zosrfglo"          long_name="Zonal Mean Surface"                           unit="m2"       grid_ref="gznl_T_3D" /> 
    554          <field id="zosrfatl"          long_name="Zonal Mean Surface : Atlantic"                unit="m2"       grid_ref="gznl_T_3D" /> 
    555          <field id="zosrfpac"          long_name="Zonal Mean Surface : Pacific"                 unit="m2"       grid_ref="gznl_T_3D" /> 
    556          <field id="zosrfind"          long_name="Zonal Mean Surface : Indian"                  unit="m2"       grid_ref="gznl_T_3D" /> 
    557          <field id="zosrfipc"          long_name="Zonal Mean Surface : Pacific+Indian"          unit="m2"       grid_ref="gznl_T_3D" /> 
    558          <field id="sophtadv"          long_name="Advective Heat Transport"                     unit="PW"       grid_ref="gznl_T_2D" /> 
    559          <field id="sophtadv_atl"      long_name="Advective Heat Transport: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
    560          <field id="sophtadv_pac"      long_name="Advective Heat Transport: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
    561          <field id="sophtadv_ind"      long_name="Advective Heat Transport: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
    562          <field id="sophtadv_ipc"      long_name="Advective Heat Transport: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
    563          <field id="sophtldf"          long_name="Diffusive Heat Transport"                     unit="PW"       grid_ref="gznl_T_2D" /> 
    564          <field id="sophtldf_atl"      long_name="Diffusive Heat Transport: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
    565          <field id="sophtldf_pac"      long_name="Diffusive Heat Transport: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
    566          <field id="sophtldf_ind"      long_name="Diffusive Heat Transport: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
    567          <field id="sophtldf_ipc"      long_name="Diffusive Heat Transport: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
    568          <field id="sophtove"          long_name="Overturning Heat Transport"                     unit="PW"       grid_ref="gznl_T_2D" /> 
    569          <field id="sophtove_atl"      long_name="Overturning Heat Transport: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
    570          <field id="sophtove_pac"      long_name="Overturning Heat Transport: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
    571          <field id="sophtove_ind"      long_name="Overturning Heat Transport: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
    572          <field id="sophtove_ipc"      long_name="Overturning Heat Transport: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
    573          <field id="sophtbtr"          long_name="Barotropic Heat Transport"                     unit="PW"       grid_ref="gznl_T_2D" /> 
    574          <field id="sophtbtr_atl"      long_name="Barotropic Heat Transport: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
    575          <field id="sophtbtr_pac"      long_name="Barotropic Heat Transport: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
    576          <field id="sophtbtr_ind"      long_name="Barotropic Heat Transport: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
    577          <field id="sophtbtr_ipc"      long_name="Barotropic Heat Transport: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
    578          <field id="sophteiv"          long_name="Heat Transport from mesoscale eddy advection"                     unit="PW"       grid_ref="gznl_T_2D" /> 
    579          <field id="sophteiv_atl"      long_name="Heat Transport from mesoscale eddy advection: Atlantic"           unit="PW"       grid_ref="gznl_T_2D" /> 
    580          <field id="sophteiv_pac"      long_name="Heat Transport from mesoscale eddy advection: Pacific"            unit="PW"       grid_ref="gznl_T_2D" /> 
    581          <field id="sophteiv_ind"      long_name="Heat Transport from mesoscale eddy advection: Indian"             unit="PW"       grid_ref="gznl_T_2D" /> 
    582          <field id="sophteiv_ipc"      long_name="Heat Transport from mesoscale eddy advection: Pacific+Indian"     unit="PW"       grid_ref="gznl_T_2D" /> 
    583          <field id="sopstadv"          long_name="Advective Salt Transport"                     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    584          <field id="sopstadv_atl"      long_name="Advective Salt Transport: Atlantic"           unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    585          <field id="sopstadv_pac"      long_name="Advective Salt Transport: Pacific"            unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    586          <field id="sopstadv_ind"      long_name="Advective Salt Transport: Indian"             unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    587          <field id="sopstadv_ipc"      long_name="Advective Salt Transport: Pacific+Indian"     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    588          <field id="sopstove"          long_name="Overturning Salt Transport"                     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    589          <field id="sopstove_atl"      long_name="Overturning Salt Transport: Atlantic"           unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    590          <field id="sopstove_pac"      long_name="Overturning Salt Transport: Pacific"            unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    591          <field id="sopstove_ind"      long_name="Overturning Salt Transport: Indian"             unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    592          <field id="sopstove_ipc"      long_name="Overturning Salt Transport: Pacific+Indian"     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    593          <field id="sopstbtr"          long_name="Barotropic Salt Transport"                     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    594          <field id="sopstbtr_atl"      long_name="Barotropic Salt Transport: Atlantic"           unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    595          <field id="sopstbtr_pac"      long_name="Barotropic Salt Transport: Pacific"            unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    596          <field id="sopstbtr_ind"      long_name="Barotropic Salt Transport: Indian"             unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    597          <field id="sopstbtr_ipc"      long_name="Barotropic Salt Transport: Pacific+Indian"     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    598          <field id="sopstldf"          long_name="Diffusive Salt Transport"                     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    599          <field id="sopstldf_atl"      long_name="Diffusive Salt Transport: Atlantic"           unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    600          <field id="sopstldf_pac"      long_name="Diffusive Salt Transport: Pacific"            unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    601          <field id="sopstldf_ind"      long_name="Diffusive Salt Transport: Indian"             unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    602          <field id="sopstldf_ipc"      long_name="Diffusive Salt Transport: Pacific+Indian"     unit="Giga g/s" grid_ref="gznl_T_2D" /> 
    603          <field id="sopsteiv"          long_name="Salt Transport from mesoscale eddy advection"                     unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
    604           <field id="sopsteiv_atl"      long_name="Salt Transport from mesoscale eddy advection: Atlantic"           unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
    605          <field id="sopsteiv_pac"      long_name="Salt Transport from mesoscale eddy advection: Pacific"            unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
    606          <field id="sopsteiv_ind"      long_name="Salt Transport from mesoscale eddy advection: Indian"             unit="Giga g/s"       grid_ref="gznl_T_2D" /> 
    607          <field id="sopsteiv_ipc"      long_name="Salt Transport from mesoscale eddy advection: Pacific+Indian"     unit="Giga g/s"       grid_ref="gznl_T_2D" />        
    608       </field_group> 
     740        <field id="zomsf"         long_name="Overturning Stream-Function : All basins"                     unit="Sv"         grid_ref="grid_znl_W_3D" /> 
     741        <field id="zotem"         long_name="Zonal Mean Temperature : All basins"                          unit="degree_C"   grid_ref="grid_znl_T_3D" /> 
     742        <field id="zosal"         long_name="Zonal Mean Salinity : All basins"                             unit="0.001"      grid_ref="grid_znl_T_3D" /> 
     743        <field id="zosrf"         long_name="Zonal Mean Surface : All basins"                              unit="m2"         grid_ref="grid_znl_T_3D" /> 
     744        <field id="sophtove"      long_name="Overturning Heat Transport: All basins"                       unit="PW"         grid_ref="grid_znl_T_2D" /> 
     745        <field id="sopstove"      long_name="Overturning Salt Transport: All basins"                       unit="Giga g/s"   grid_ref="grid_znl_T_2D" /> 
     746        <field id="sophtbtr"      long_name="Barotropic Heat Transport: All basins"                        unit="PW"         grid_ref="grid_znl_T_2D" /> 
     747        <field id="sopstbtr"      long_name="Barotropic Salt Transport: All basins"                        unit="Giga g/s"   grid_ref="grid_znl_T_2D" />  
     748        <field id="sophtadv"      long_name="Advective Heat Transport: All basins"                         unit="PW"         grid_ref="grid_znl_T_2D" /> 
     749        <field id="sopstadv"      long_name="Advective Salt Transport: All basins"                         unit="Giga g/s"   grid_ref="grid_znl_T_2D" /> 
     750        <field id="sophtldf"      long_name="Diffusive Heat Transport: All basins"                         unit="PW"         grid_ref="grid_znl_T_2D" /> 
     751        <field id="sopstldf"      long_name="Diffusive Salt Transport: All basins"                         unit="Giga g/s"   grid_ref="grid_znl_T_2D" /> 
     752        <field id="sophtvtr"      long_name="Heat Transport : All basins"                                  unit="PW"         grid_ref="grid_znl_T_2D" /> 
     753        <field id="sopstvtr"      long_name="Salt Transport : All basins"                                  unit="Giga g/s"   grid_ref="grid_znl_T_2D" />   
     754        <field id="sophteiv"      long_name="Heat Transport from mesoscale eddy advection: All basins"     unit="PW"         grid_ref="grid_znl_T_2D" /> 
     755        <field id="sopsteiv"      long_name="Salt Transport from mesoscale eddy advection : All basins"    unit="Giga g/s"   grid_ref="grid_znl_T_2D" /> 
     756   <field id="sopstadv"      long_name="Advective Salt Transport"                                     unit="Giga g/s"   grid_ref="grid_znl_T_2D" /> 
     757        <field id="sophtgyre"     long_name="Overturning heat transport due to gyre" field_ref="sophtove"  unit="W"          grid_ref="grid_znl_T_2D" > sophtvtr - sophtove  </field> 
     758   <field id="sopstgyre"     long_name="Overturning salt transport due to gyre" field_ref="sopstove"  unit="kg/s"       grid_ref="grid_znl_T_2D" > sophtvtr - sopstove  </field> 
     759       </field_group> 
     760 
     761       <field_group id="constant_fields"  grid_ref="grid_T_2D"  operation="once" > 
     762         <field id="bathy"       long_name="Sea floor depth below geoid"               standard_name="sea_floor_depth_below_geoid"               unit="m"/> 
     763         <field id="areacello"   long_name="Horizontal area of ocean grid cells"       standard_name="cell_area"                                 unit="m2" /> 
     764         <field id="hfgeou"      long_name="Upward geothermal heat flux at sea floor"  standard_name="upward_geothermal_heat_flux_at_sea_floor"  unit="W/m2"/> 
     765         <field id="basins"      long_name="ocean tracer region masks"                 standard_name="ocean_tracer_region_masks"   unit="none" grid_ref="grid_basin"  /> 
     766       </field_group> 
     767 
    609768 
    610769    <!--  
     
    617776   <!-- Asselin trends  calculated on odd time steps--> 
    618777   <field_group id="trendT_odd"  grid_ref="grid_T_3D"> 
    619       <field id="ttrd_atf"      long_name="temperature-trend: asselin time filter"       unit="degree_C/s" /> 
    620       <field id="strd_atf"      long_name="salinity   -trend: asselin time filter"       unit="0.001/s" /> 
    621       <!-- Thickness weighted versions: --> 
    622       <field id="ttrd_atf_e3t"      unit="degC/s * m"  >  ttrd_atf * e3t </field> 
    623       <field id="strd_atf_e3t"      unit="1e-3/s * m"  >  strd_atf * e3t </field> 
    624       <!-- OMIP  layer-integrated trends --> 
    625       <field id="ttrd_atf_li"      long_name="layer integrated heat-trend: asselin time filter "       unit="W/m^2" > ttrd_atf_e3t * 1026.0 * 3991.86795711963  </field> 
    626       <field id="strd_atf_li"      long_name="layer integrated salt   -trend: asselin time filter "       unit="kg/(m^2 s)" > strd_atf_e3t * 1026.0 * 0.001 </field> 
    627     </field_group> 
    628  
    629     <!-- Other trends  calculated on even time steps--> 
    630     <field_group id="trendT_even" grid_ref="grid_T_3D"> 
    631        <field id="ttrd_xad"      long_name="temperature-trend: i-advection"                                                                                          unit="degC/s"                        /> 
    632        <field id="strd_xad"      long_name="salinity   -trend: i-advection"                                                                                          unit="1e-3/s"                        /> 
    633        <field id="ttrd_yad"      long_name="temperature-trend: j-advection"                                                                                          unit="degC/s"                        /> 
    634        <field id="strd_yad"      long_name="salinity   -trend: j-advection"                                                                                          unit="1e-3/s"                        /> 
    635        <field id="ttrd_zad"      long_name="temperature-trend: k-advection"                                                                                          unit="degC/s"                        /> 
    636        <field id="strd_zad"      long_name="salinity   -trend: k-advection"                                                                                          unit="1e-3/s"                        /> 
    637        <field id="ttrd_ad"       long_name="temperature-trend: advection"               standard_name="tendency_of_sea_water_temperature_due_to_advection"           unit="degC/s"                         > sqrt( ttrd_xad^2 + ttrd_yad^2 + ttrd_zad^2 ) </field> 
    638        <field id="strd_ad"       long_name="salinity   -trend: advection"               standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                         > sqrt( strd_xad^2 + strd_yad^2 + strd_zad^2 ) </field> 
    639        <field id="ttrd_totad"    long_name="temperature-trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="degC/s"                        /> 
    640        <field id="strd_totad"    long_name="salinity   -trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                        /> 
    641        <field id="ttrd_sad"      long_name="temperature-trend: surface adv. (linssh true)"                                                                                unit="degC/s"   grid_ref="grid_T_2D" /> 
    642        <field id="strd_sad"      long_name="salinity   -trend: surface adv. (linssh true)"                                                                                unit="1e-3/s"   grid_ref="grid_T_2D" /> 
    643        <field id="ttrd_ldf"      long_name="temperature-trend: lateral  diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_horizontal_mixing"   unit="degC/s"                        /> 
    644        <field id="strd_ldf"      long_name="salinity   -trend: lateral  diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_horizontal_mixing"      unit="1e-3/s"                        /> 
    645        <field id="ttrd_zdf"      long_name="temperature-trend: vertical diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_vertical_mixing"     unit="degC/s"                        /> 
    646        <field id="strd_zdf"      long_name="salinity   -trend: vertical diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_vertical_mixing"        unit="1e-3/s"                        /> 
    647        <field id="ttrd_evd"      long_name="temperature-trend: EVD convection"                                                                                       unit="degC/s"                        /> 
    648        <field id="strd_evd"      long_name="salinity   -trend: EVD convection"                                                                                       unit="1e-3/s"                        /> 
    649  
    650        <!-- ln_traldf_iso=T only (iso-neutral diffusion) --> 
    651        <field id="ttrd_iso"      long_name="temperature-trend: isopycnal diffusion"                             unit="degC/s" > ttrd_ldf + ttrd_zdf - ttrd_zdfp </field> 
    652        <field id="strd_iso"      long_name="salinity   -trend: isopycnal diffusion"                             unit="1e-3/s" > strd_ldf + strd_zdf - strd_zdfp </field> 
    653        <field id="ttrd_zdfp"     long_name="temperature-trend: pure vert. diffusion"   unit="degC/s" /> 
    654        <field id="strd_zdfp"     long_name="salinity   -trend: pure vert. diffusion"   unit="1e-3/s" /> 
    655  
    656        <!-- --> 
    657        <field id="ttrd_dmp"      long_name="temperature-trend: interior restoring"        unit="degC/s" /> 
    658        <field id="strd_dmp"      long_name="salinity   -trend: interior restoring"        unit="1e-3/s" /> 
    659        <field id="ttrd_bbl"      long_name="temperature-trend: bottom boundary layer"     unit="degC/s" /> 
    660        <field id="strd_bbl"      long_name="salinity   -trend: bottom boundary layer"     unit="1e-3/s" /> 
    661        <field id="ttrd_npc"      long_name="temperature-trend: non-penetrative conv."     unit="degC/s" /> 
    662        <field id="strd_npc"      long_name="salinity   -trend: non-penetrative conv."     unit="1e-3/s" /> 
    663        <field id="ttrd_qns"      long_name="temperature-trend: non-solar flux + runoff"   unit="degC/s" grid_ref="grid_T_2D" /> 
    664        <field id="strd_cdt"      long_name="salinity   -trend: C/D term       + runoff"   unit="degC/s" grid_ref="grid_T_2D" /> 
    665        <field id="ttrd_qsr"      long_name="temperature-trend: solar penetr. heating"     unit="degC/s" /> 
    666        <field id="ttrd_bbc"      long_name="temperature-trend: geothermal heating"        unit="degC/s" /> 
    667  
    668        <!-- Thickness weighted versions: --> 
    669        <field id="ttrd_xad_e3t"      unit="degC/s * m" >  ttrd_xad * e3t </field> 
    670        <field id="strd_xad_e3t"      unit="1e-3/s * m" >  strd_xad * e3t </field> 
    671        <field id="ttrd_yad_e3t"      unit="degC/s * m" >  ttrd_yad * e3t </field> 
    672        <field id="strd_yad_e3t"      unit="1e-3/s * m" >  strd_yad * e3t </field> 
    673        <field id="ttrd_zad_e3t"      unit="degC/s * m" >  ttrd_zad * e3t </field> 
    674        <field id="strd_zad_e3t"      unit="1e-3/s * m" >  strd_zad * e3t </field> 
    675        <field id="ttrd_ad_e3t"       unit="degC/s * m" >  ttrd_ad  * e3t </field> 
    676        <field id="strd_ad_e3t"       unit="1e-3/s * m" >  strd_ad  * e3t </field> 
    677        <field id="ttrd_totad_e3t"    unit="degC/s * m" >  ttrd_totad  * e3t </field> 
    678        <field id="strd_totad_e3t"    unit="1e-3/s * m" >  strd_totad  * e3t </field> 
    679        <field id="ttrd_ldf_e3t"      unit="degC/s * m" >  ttrd_ldf * e3t </field> 
    680        <field id="strd_ldf_e3t"      unit="1e-3/s * m" >  strd_ldf * e3t </field> 
    681        <field id="ttrd_zdf_e3t"      unit="degC/s * m" >  ttrd_zdf * e3t </field> 
    682        <field id="strd_zdf_e3t"      unit="1e-3/s * m" >  strd_zdf * e3t </field> 
    683        <field id="ttrd_evd_e3t"      unit="degC/s * m" >  ttrd_evd * e3t </field> 
    684        <field id="strd_evd_e3t"      unit="1e-3/s * m" >  strd_evd * e3t </field> 
    685  
    686        <!-- ln_traldf_iso=T only (iso-neutral diffusion) --> 
    687        <field id="ttrd_iso_e3t"      unit="degC/s * m"  >  ttrd_iso * e3t </field> 
    688        <field id="strd_iso_e3t"      unit="1e-3/s * m"  >  strd_iso * e3t </field> 
    689        <field id="ttrd_zdfp_e3t"     unit="degC/s * m"  >  ttrd_zdfp * e3t </field> 
    690        <field id="strd_zdfp_e3t"     unit="1e-3/s * m"  >  strd_zdfp * e3t </field> 
    691  
    692        <!-- --> 
    693        <field id="ttrd_dmp_e3t"      unit="degC/s * m"  >  ttrd_dmp * e3t </field> 
    694        <field id="strd_dmp_e3t"      unit="1e-3/s * m"  >  strd_dmp * e3t </field> 
    695        <field id="ttrd_bbl_e3t"      unit="degC/s * m"  >  ttrd_bbl * e3t </field> 
    696        <field id="strd_bbl_e3t"      unit="1e-3/s * m"  >  strd_bbl * e3t </field> 
    697        <field id="ttrd_npc_e3t"      unit="degC/s * m"  >  ttrd_npc * e3t </field> 
    698        <field id="strd_npc_e3t"      unit="1e-3/s * m"  >  strd_npc * e3t </field> 
    699        <field id="ttrd_qns_e3t"      unit="degC/s * m"  >  ttrd_qns * e3t_surf </field> 
    700        <field id="strd_cdt_e3t"      unit="degC/s * m"  >  strd_cdt * e3t_surf </field> 
    701        <field id="ttrd_qsr_e3t"      unit="degC/s * m"  >  ttrd_qsr * e3t </field> 
    702        <field id="ttrd_bbc_e3t"      unit="degC/s * m"  >  ttrd_bbc * e3t </field> 
    703  
    704        <!-- OMIP  layer-integrated trends --> 
    705        <field id="ttrd_totad_li"    long_name="layer integrated heat-trend : total advection"       unit="W/m^2"     > ttrd_totad_e3t * 1026.0 * 3991.86795711963 </field> 
    706        <field id="strd_totad_li"    long_name="layer integrated salt   -trend : total advection"      unit="kg/(m^2 s)"    > strd_totad_e3t * 1026.0 * 0.001  </field> 
    707        <field id="ttrd_evd_li"      long_name="layer integrated heat-trend : EVD convection"         unit="W/m^2"    > ttrd_evd_e3t * 1026.0 * 3991.86795711963 </field> 
    708        <field id="strd_evd_li"      long_name="layer integrated salt   -trend : EVD convection"      unit="kg/(m^2 s)"  > strd_evd_e3t * 1026.0 * 0.001  </field> 
    709        <field id="ttrd_iso_li"      long_name="layer integrated heat-trend : isopycnal diffusion"    unit="W/m^2" > ttrd_iso_e3t * 1026.0 * 3991.86795711963 </field> 
    710        <field id="strd_iso_li"      long_name="layer integrated salt   -trend : isopycnal diffusion"   unit="kg/(m^2 s)" > strd_iso_e3t * 1026.0 * 0.001  </field> 
    711        <field id="ttrd_zdfp_li"     long_name="layer integrated heat-trend : pure vert. diffusion"   unit="W/m^2" > ttrd_zdfp_e3t * 1026.0 * 3991.86795711963 </field> 
    712        <field id="strd_zdfp_li"     long_name="layer integrated salt   -trend : pure vert. diffusion"   unit="kg/(m^2 s)" > strd_zdfp_e3t * 1026.0 * 0.001  </field> 
    713        <field id="ttrd_qns_li"      long_name="layer integrated heat-trend : non-solar flux + runoff"  unit="W/m^2" grid_ref="grid_T_2D"> ttrd_qns_e3t * 1026.0 * 3991.86795711963 </field> 
    714        <field id="ttrd_qsr_li"      long_name="layer integrated heat-trend : solar flux"   unit="W/m^2"  grid_ref="grid_T_3D"> ttrd_qsr_e3t * 1026.0 * 3991.86795711963 </field> 
    715        <field id="ttrd_bbl_li"      long_name="layer integrated heat-trend: bottom boundary layer "     unit="W/m^2" > ttrd_bbl_e3t * 1026.0 * 3991.86795711963 </field> 
    716        <field id="strd_bbl_li"      long_name="layer integrated salt   -trend: bottom boundary layer "     unit="kg/(m^2 s)" > strd_bbl_e3t * 1026.0 * 0.001  </field> 
    717        <field id="ttrd_evd_li"      long_name="layer integrated heat -trend: evd convection "       unit="W/m^2" >ttrd_evd_e3t * 1026.0 * 3991.86795711963  </field> 
    718        <field id="strd_evd_li"      long_name="layer integrated salt -trend: evd convection "       unit="kg/(m^2 s)" > strd_evd_e3t * 1026.0 * 0.001  </field> 
    719  
    720     </field_group> 
    721  
    722     <!--  Total trends calculated every time step--> 
    723     <field_group id="trendT" grid_ref="grid_T_3D"> 
    724        <field id="ttrd_tot"      long_name="temperature-trend: total model trend"         unit="degC/s" /> 
    725        <field id="strd_tot"      long_name="salinity   -trend: total model trend"         unit="1e-3/s" /> 
    726        <!-- Thickness weighted versions: --> 
    727        <field id="ttrd_tot_e3t"      unit="degC/s * m"  >  ttrd_tot * e3t </field> 
    728        <field id="strd_tot_e3t"      unit="1e-3/s * m"  >  strd_tot * e3t </field> 
    729        <!-- OMIP  layer-integrated total trends --> 
    730        <field id="ttrd_tot_li"      long_name="layer integrated heat-trend: total model trend :"         unit="W/m^2" > ttrd_tot_e3t * 1026.0 * 3991.86795711963 </field> 
    731        <field id="strd_tot_li"      long_name="layer integrated salt   -trend: total model trend :"         unit="kg/(m^2 s)" > strd_tot_e3t * 1026.0 * 0.001  </field> 
    732  
    733        <!-- **** these trends have not been apportioned to all/even/odd ts yet **** --> 
    734        <!-- variables available with ln_KE_trd --> 
    735        <field id="ketrd_hpg"     long_name="ke-trend: hydrostatic pressure gradient"          unit="W/s^3"                        /> 
    736        <field id="ketrd_spg"     long_name="ke-trend: surface     pressure gradient"          unit="W/s^3"                        /> 
    737        <field id="ketrd_spgexp"  long_name="ke-trend: surface pressure gradient (explicit)"   unit="W/s^3"                        /> 
    738        <field id="ketrd_spgflt"  long_name="ke-trend: surface pressure gradient (filter)"     unit="W/s^3"                        /> 
    739        <field id="ssh_flt"       long_name="filtered contribution to ssh (dynspg_flt)"        unit="m"       grid_ref="grid_T_2D" /> 
    740        <field id="w0"            long_name="surface vertical velocity"                        unit="m/s"     grid_ref="grid_T_2D" /> 
    741        <field id="pw0_exp"       long_name="surface pressure flux due to ssh"                 unit="W/s^2"   grid_ref="grid_T_2D" /> 
    742        <field id="pw0_flt"       long_name="surface pressure flux due to filtered ssh"        unit="W/s^2"   grid_ref="grid_T_2D" /> 
    743        <field id="ketrd_keg"     long_name="ke-trend: KE gradient         or hor. adv."       unit="W/s^3"                        /> 
    744        <field id="ketrd_rvo"     long_name="ke-trend: relative  vorticity or metric term"     unit="W/s^3"                        /> 
    745        <field id="ketrd_pvo"     long_name="ke-trend: planetary vorticity"                    unit="W/s^3"                        /> 
    746        <field id="ketrd_zad"     long_name="ke-trend: vertical  advection"                    unit="W/s^3"                        /> 
    747        <field id="ketrd_udx"     long_name="ke-trend: U.dx[U]"                                unit="W/s^3"                        /> 
    748        <field id="ketrd_ldf"     long_name="ke-trend: lateral   diffusion"                    unit="W/s^3"                        /> 
    749        <field id="ketrd_zdf"     long_name="ke-trend: vertical  diffusion"                    unit="W/s^3"                        /> 
    750        <field id="ketrd_tau"     long_name="ke-trend: wind stress "                           unit="W/s^3"   grid_ref="grid_T_2D" /> 
    751        <field id="ketrd_bfr"     long_name="ke-trend: bottom friction (explicit)"             unit="W/s^3"                        />    
    752        <field id="ketrd_bfri"    long_name="ke-trend: bottom friction (implicit)"             unit="W/s^3"                        />    
    753        <field id="ketrd_atf"     long_name="ke-trend: asselin time filter trend"              unit="W/s^3"                        />   
    754        <field id="ketrd_convP2K" long_name="ke-trend: conversion (potential to kinetic)"      unit="W/s^3"                        /> 
    755        <field id="KE"            long_name="kinetic energy: u(n)*u(n+1)/2"                    unit="W/s^2"                        />    
    756  
    757       <!-- variables available when explicit lateral mixing is used (ln_dynldf_OFF=F) --> 
    758       <field id="dispkexyfo"    long_name="KE-trend: lateral  mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_xy_friction"                   unit="W/m^2" grid_ref="grid_T_2D" />    
    759       <field id="dispkevfo"     long_name="KE-trend: vertical mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_vertical_friction"             unit="W/m^2" grid_ref="grid_T_2D" />    
    760       <!-- variables available with ln_traadv_eiv=T and ln_diaeiv=T --> 
    761       <field id="eketrd_eiv"    long_name="EKE-trend due to parameterized eddy advection"   standard_name="tendency_of_ocean_eddy_kinetic_energy_content_due_to_parameterized_eddy_advection"   unit="W/m^2" grid_ref="grid_T_2D" />    
    762  
    763        <!-- variables available with ln_PE_trd --> 
    764        <field id="petrd_xad"     long_name="pe-trend: i-advection"                unit="W/m^3"                        /> 
    765        <field id="petrd_yad"     long_name="pe-trend: j-advection"                unit="W/m^3"                        /> 
    766        <field id="petrd_zad"     long_name="pe-trend: k-advection"                unit="W/m^3"                        /> 
    767        <field id="petrd_sad"     long_name="pe-trend: surface adv. (linssh true)" unit="W/m^3"   grid_ref="grid_T_2D" /> 
    768        <field id="petrd_ldf"     long_name="pe-trend: lateral  diffusion"         unit="W/m^3"                        /> 
    769        <field id="petrd_zdf"     long_name="pe-trend: vertical diffusion"         unit="W/m^3"                        /> 
    770        <field id="petrd_zdfp"    long_name="pe-trend: pure vert. diffusion"       unit="W/m^3"                        /> 
    771        <field id="petrd_dmp"     long_name="pe-trend: interior restoring"         unit="W/m^3"                        /> 
    772        <field id="petrd_bbl"     long_name="pe-trend: bottom boundary layer"      unit="W/m^3"                        /> 
    773        <field id="petrd_npc"     long_name="pe-trend: non-penetrative conv."      unit="W/m^3"                        /> 
    774        <field id="petrd_nsr"     long_name="pe-trend: surface forcing + runoff"   unit="W/m^3"                        /> 
    775        <field id="petrd_qsr"     long_name="pe-trend: solar penetr. heating"      unit="W/m^3"                        /> 
    776        <field id="petrd_bbc"     long_name="pe-trend: geothermal heating"         unit="W/m^3"                        /> 
    777        <field id="petrd_atf"     long_name="pe-trend: asselin time filter"        unit="W/m^3"                        /> 
    778        <field id="PEanom"        long_name="potential energy anomaly"             unit="1"                            />    
    779        <field id="alphaPE"       long_name="partial deriv. of PEanom wrt T"       unit="degC-1"                       />    
    780        <field id="betaPE"        long_name="partial deriv. of PEanom wrt S"       unit="1e3"                          />    
    781     </field_group> 
    782  
    783     <field_group id="trendU" grid_ref="grid_U_3D"> 
    784        <!-- variables available with ln_dyn_trd --> 
    785        <field id="utrd_hpg"       long_name="i-trend: hydrostatic pressure gradient"          unit="m/s^2"                        /> 
    786        <field id="utrd_spg"       long_name="i-trend: surface     pressure gradient"          unit="m/s^2"                        /> 
    787        <field id="utrd_spgexp"    long_name="i-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        /> 
    788        <field id="utrd_spgflt"    long_name="i-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        /> 
    789        <field id="utrd_keg"       long_name="i-trend: KE gradient         or hor. adv."       unit="m/s^2"                        /> 
    790        <field id="utrd_rvo"       long_name="i-trend: relative  vorticity or metric term"     unit="m/s^2"                        /> 
    791        <field id="utrd_pvo"       long_name="i-trend: planetary vorticity"                    unit="m/s^2"                        /> 
    792        <field id="utrd_zad"       long_name="i-trend: vertical  advection"                    unit="m/s^2"                        /> 
    793        <field id="utrd_udx"       long_name="i-trend: U.dx[U]"                                unit="m/s^2"                        /> 
    794        <field id="utrd_ldf"       long_name="i-trend: lateral   diffusion"                    unit="m/s^2"                        /> 
    795        <field id="utrd_zdf"       long_name="i-trend: vertical  diffusion"                    unit="m/s^2"                        /> 
    796        <field id="utrd_tau"       long_name="i-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_U_2D" /> 
    797        <field id="utrd_bfr"       long_name="i-trend: bottom friction (explicit)"             unit="m/s^2"                        />    
    798        <field id="utrd_bfri"      long_name="i-trend: bottom friction (implicit)"             unit="m/s^2"                        />    
    799        <field id="utrd_tot"       long_name="i-trend: total momentum trend before atf"        unit="m/s^2"                        />    
    800        <field id="utrd_atf"       long_name="i-trend: asselin time filter trend"              unit="m/s^2"                        />    
    801     </field_group> 
    802  
    803     <field_group id="trendV" grid_ref="grid_V_3D"> 
    804        <!-- variables available with ln_dyn_trd --> 
    805        <field id="vtrd_hpg"       long_name="j-trend: hydrostatic pressure gradient"          unit="m/s^2"                        /> 
    806        <field id="vtrd_spg"       long_name="j-trend: surface     pressure gradient"          unit="m/s^2"                        /> 
    807        <field id="vtrd_spgexp"    long_name="j-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        /> 
    808        <field id="vtrd_spgflt"    long_name="j-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        /> 
    809        <field id="vtrd_keg"       long_name="j-trend: KE gradient         or hor. adv."       unit="m/s^2"                        /> 
    810        <field id="vtrd_rvo"       long_name="j-trend: relative  vorticity or metric term"     unit="m/s^2"                        /> 
    811        <field id="vtrd_pvo"       long_name="j-trend: planetary vorticity"                    unit="m/s^2"                        /> 
    812        <field id="vtrd_zad"       long_name="j-trend: vertical  advection"                    unit="m/s^2"                        /> 
    813        <field id="vtrd_vdy"       long_name="i-trend: V.dx[V]"                                unit="m/s^2"                        /> 
    814        <field id="vtrd_ldf"       long_name="j-trend: lateral   diffusion"                    unit="m/s^2"                        /> 
    815        <field id="vtrd_zdf"       long_name="j-trend: vertical  diffusion"                    unit="m/s^2"                        /> 
    816        <field id="vtrd_tau"       long_name="j-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_V_2D" /> 
    817        <field id="vtrd_bfr"       long_name="j-trend: bottom friction (explicit)"             unit="m/s^2"                        />    
    818        <field id="vtrd_bfri"      long_name="j-trend: bottom friction (implicit)"             unit="m/s^2"                        />    
    819        <field id="vtrd_tot"       long_name="j-trend: total momentum trend before atf"        unit="m/s^2"                        />    
    820        <field id="vtrd_atf"       long_name="j-trend: asselin time filter trend"              unit="m/s^2"                        />    
    821     </field_group> 
     778     <field id="ttrd_atf"      long_name="temperature-trend: asselin time filter"       unit="degree_C/s" /> 
     779     <field id="strd_atf"      long_name="salinity   -trend: asselin time filter"       unit="0.001/s" /> 
     780     <!-- Thickness weighted versions: --> 
     781     <field id="ttrd_atf_e3t"      unit="degC/s * m"  >  ttrd_atf * e3t </field> 
     782     <field id="strd_atf_e3t"      unit="1e-3/s * m"  >  strd_atf * e3t </field> 
     783     <!-- OMIP  layer-integrated trends --> 
     784     <field id="ttrd_atf_li"      long_name="layer integrated heat-trend: asselin time filter "       unit="W/m^2" > ttrd_atf_e3t * 1026.0 * 3991.86795711963  </field> 
     785     <field id="strd_atf_li"      long_name="layer integrated salt   -trend: asselin time filter "       unit="kg/(m^2 s)" > strd_atf_e3t * 1026.0 * 0.001 </field> 
     786   </field_group> 
     787 
     788   <!-- Other trends  calculated on even time steps--> 
     789   <field_group id="trendT_even" grid_ref="grid_T_3D"> 
     790     <field id="ttrd_xad"      long_name="temperature-trend: i-advection"                                                                                          unit="degC/s"                        /> 
     791     <field id="strd_xad"      long_name="salinity   -trend: i-advection"                                                                                          unit="1e-3/s"                        /> 
     792     <field id="ttrd_yad"      long_name="temperature-trend: j-advection"                                                                                          unit="degC/s"                        /> 
     793     <field id="strd_yad"      long_name="salinity   -trend: j-advection"                                                                                          unit="1e-3/s"                        /> 
     794     <field id="ttrd_zad"      long_name="temperature-trend: k-advection"                                                                                          unit="degC/s"                        /> 
     795     <field id="strd_zad"      long_name="salinity   -trend: k-advection"                                                                                          unit="1e-3/s"                        /> 
     796     <field id="ttrd_ad"       long_name="temperature-trend: advection"               standard_name="tendency_of_sea_water_temperature_due_to_advection"           unit="degC/s"                         > sqrt( ttrd_xad^2 + ttrd_yad^2 + ttrd_zad^2 ) </field> 
     797     <field id="strd_ad"       long_name="salinity   -trend: advection"               standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                         > sqrt( strd_xad^2 + strd_yad^2 + strd_zad^2 ) </field> 
     798     <field id="ttrd_totad"    long_name="temperature-trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="degC/s"                        /> 
     799     <field id="strd_totad"    long_name="salinity   -trend: total advection"         standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                        /> 
     800     <field id="ttrd_sad"      long_name="temperature-trend: surface adv. (linssh true)"                                                                           unit="degC/s"   grid_ref="grid_T_2D" /> 
     801     <field id="strd_sad"      long_name="salinity   -trend: surface adv. (linssh true)"                                                                           unit="1e-3/s"   grid_ref="grid_T_2D" /> 
     802     <field id="ttrd_ldf"      long_name="temperature-trend: lateral  diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_horizontal_mixing"   unit="degC/s"                        /> 
     803     <field id="strd_ldf"      long_name="salinity   -trend: lateral  diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_horizontal_mixing"      unit="1e-3/s"                        /> 
     804     <field id="ttrd_zdf"      long_name="temperature-trend: vertical diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_vertical_mixing"     unit="degC/s"                        /> 
     805     <field id="strd_zdf"      long_name="salinity   -trend: vertical diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_vertical_mixing"        unit="1e-3/s"                        /> 
     806     <field id="ttrd_evd"      long_name="temperature-trend: EVD convection"                                                                                       unit="degC/s"                        /> 
     807     <field id="strd_evd"      long_name="salinity   -trend: EVD convection"                                                                                       unit="1e-3/s"                        /> 
     808 
     809     <!-- ln_traldf_iso=T only (iso-neutral diffusion) --> 
     810     <field id="ttrd_iso"      long_name="temperature-trend: isopycnal diffusion"                             unit="degC/s" > ttrd_ldf + ttrd_zdf - ttrd_zdfp </field> 
     811     <field id="strd_iso"      long_name="salinity   -trend: isopycnal diffusion"                             unit="1e-3/s" > strd_ldf + strd_zdf - strd_zdfp </field> 
     812     <field id="ttrd_zdfp"     long_name="temperature-trend: pure vert. diffusion"   unit="degC/s" /> 
     813     <field id="strd_zdfp"     long_name="salinity   -trend: pure vert. diffusion"   unit="1e-3/s" /> 
     814 
     815     <!-- --> 
     816     <field id="ttrd_dmp"      long_name="temperature-trend: interior restoring"        unit="degC/s" /> 
     817     <field id="strd_dmp"      long_name="salinity   -trend: interior restoring"        unit="1e-3/s" /> 
     818     <field id="ttrd_bbl"      long_name="temperature-trend: bottom boundary layer"     unit="degC/s" /> 
     819     <field id="strd_bbl"      long_name="salinity   -trend: bottom boundary layer"     unit="1e-3/s" /> 
     820     <field id="ttrd_npc"      long_name="temperature-trend: non-penetrative conv."     unit="degC/s" /> 
     821     <field id="strd_npc"      long_name="salinity   -trend: non-penetrative conv."     unit="1e-3/s" /> 
     822     <field id="ttrd_qns"      long_name="temperature-trend: non-solar flux + runoff"   unit="degC/s" grid_ref="grid_T_2D" /> 
     823     <field id="strd_cdt"      long_name="salinity   -trend: C/D term       + runoff"   unit="degC/s" grid_ref="grid_T_2D" /> 
     824     <field id="ttrd_qsr"      long_name="temperature-trend: solar penetr. heating"     unit="degC/s" /> 
     825     <field id="ttrd_bbc"      long_name="temperature-trend: geothermal heating"        unit="degC/s" /> 
     826 
     827     <!-- Thickness weighted versions: --> 
     828     <field id="ttrd_xad_e3t"      unit="degC/s * m" >  ttrd_xad * e3t </field> 
     829     <field id="strd_xad_e3t"      unit="1e-3/s * m" >  strd_xad * e3t </field> 
     830     <field id="ttrd_yad_e3t"      unit="degC/s * m" >  ttrd_yad * e3t </field> 
     831     <field id="strd_yad_e3t"      unit="1e-3/s * m" >  strd_yad * e3t </field> 
     832     <field id="ttrd_zad_e3t"      unit="degC/s * m" >  ttrd_zad * e3t </field> 
     833     <field id="strd_zad_e3t"      unit="1e-3/s * m" >  strd_zad * e3t </field> 
     834     <field id="ttrd_ad_e3t"       unit="degC/s * m" >  ttrd_ad  * e3t </field> 
     835     <field id="strd_ad_e3t"       unit="1e-3/s * m" >  strd_ad  * e3t </field> 
     836     <field id="ttrd_totad_e3t"    unit="degC/s * m" >  ttrd_totad  * e3t </field> 
     837     <field id="strd_totad_e3t"    unit="1e-3/s * m" >  strd_totad  * e3t </field> 
     838     <field id="ttrd_ldf_e3t"      unit="degC/s * m" >  ttrd_ldf * e3t </field> 
     839     <field id="strd_ldf_e3t"      unit="1e-3/s * m" >  strd_ldf * e3t </field> 
     840     <field id="ttrd_zdf_e3t"      unit="degC/s * m" >  ttrd_zdf * e3t </field> 
     841     <field id="strd_zdf_e3t"      unit="1e-3/s * m" >  strd_zdf * e3t </field> 
     842     <field id="ttrd_evd_e3t"      unit="degC/s * m" >  ttrd_evd * e3t </field> 
     843     <field id="strd_evd_e3t"      unit="1e-3/s * m" >  strd_evd * e3t </field> 
     844 
     845     <!-- ln_traldf_iso=T only (iso-neutral diffusion) --> 
     846     <field id="ttrd_iso_e3t"      unit="degC/s * m"  >  ttrd_iso * e3t </field> 
     847     <field id="strd_iso_e3t"      unit="1e-3/s * m"  >  strd_iso * e3t </field> 
     848     <field id="ttrd_zdfp_e3t"     unit="degC/s * m"  >  ttrd_zdfp * e3t </field> 
     849     <field id="strd_zdfp_e3t"     unit="1e-3/s * m"  >  strd_zdfp * e3t </field> 
     850 
     851     <!-- --> 
     852     <field id="ttrd_dmp_e3t"      unit="degC/s * m"  >  ttrd_dmp * e3t </field> 
     853     <field id="strd_dmp_e3t"      unit="1e-3/s * m"  >  strd_dmp * e3t </field> 
     854     <field id="ttrd_bbl_e3t"      unit="degC/s * m"  >  ttrd_bbl * e3t </field> 
     855     <field id="strd_bbl_e3t"      unit="1e-3/s * m"  >  strd_bbl * e3t </field> 
     856     <field id="ttrd_npc_e3t"      unit="degC/s * m"  >  ttrd_npc * e3t </field> 
     857     <field id="strd_npc_e3t"      unit="1e-3/s * m"  >  strd_npc * e3t </field> 
     858     <field id="ttrd_qns_e3t"      unit="degC/s * m"  >  ttrd_qns * e3ts </field> 
     859     <field id="strd_cdt_e3t"      unit="degC/s * m"  >  strd_cdt * e3ts </field> 
     860     <field id="ttrd_qsr_e3t"      unit="degC/s * m"  >  ttrd_qsr * e3t </field> 
     861     <field id="ttrd_bbc_e3t"      unit="degC/s * m"  >  ttrd_bbc * e3t </field> 
     862 
     863     <!-- OMIP  layer-integrated trends --> 
     864     <field id="ttrd_totad_li"    long_name="layer integrated heat-trend: total advection"         unit="W/m^2"     > ttrd_totad_e3t * 1026.0 * 3991.86795711963 </field> 
     865     <field id="strd_totad_li"    long_name="layer integrated salt-trend: total advection"         unit="kg/(m^2 s)"    > strd_totad_e3t * 1026.0 * 0.001  </field> 
     866     <field id="ttrd_evd_li"      long_name="layer integrated heat-trend: EVD convection"          unit="W/m^2"    > ttrd_evd_e3t * 1026.0 * 3991.86795711963 </field> 
     867     <field id="strd_evd_li"      long_name="layer integrated salt-trend: EVD convection"          unit="kg/(m^2 s)"  > strd_evd_e3t * 1026.0 * 0.001  </field> 
     868     <field id="ttrd_iso_li"      long_name="layer integrated heat-trend: isopycnal diffusion"     unit="W/m^2" > ttrd_iso_e3t * 1026.0 * 3991.86795711963 </field> 
     869     <field id="strd_iso_li"      long_name="layer integrated salt-trend: isopycnal diffusion"     unit="kg/(m^2 s)" > strd_iso_e3t * 1026.0 * 0.001  </field> 
     870     <field id="ttrd_zdfp_li"     long_name="layer integrated heat-trend: pure vert. diffusion"    unit="W/m^2" > ttrd_zdfp_e3t * 1026.0 * 3991.86795711963 </field> 
     871     <field id="strd_zdfp_li"     long_name="layer integrated salt-trend: pure vert. diffusion"    unit="kg/(m^2 s)" > strd_zdfp_e3t * 1026.0 * 0.001  </field> 
     872     <field id="ttrd_qns_li"      long_name="layer integrated heat-trend: non-solar flux + runoff" unit="W/m^2" grid_ref="grid_T_2D"> ttrd_qns_e3t * 1026.0 * 3991.86795711963 </field> 
     873     <field id="ttrd_qsr_li"      long_name="layer integrated heat-trend: solar flux"              unit="W/m^2"  grid_ref="grid_T_3D"> ttrd_qsr_e3t * 1026.0 * 3991.86795711963 </field> 
     874     <field id="ttrd_bbl_li"      long_name="layer integrated heat-trend: bottom boundary layer "  unit="W/m^2" > ttrd_bbl_e3t * 1026.0 * 3991.86795711963 </field> 
     875     <field id="strd_bbl_li"      long_name="layer integrated salt-trend: bottom boundary layer "  unit="kg/(m^2 s)" > strd_bbl_e3t * 1026.0 * 0.001  </field> 
     876     <field id="ttrd_evd_li"      long_name="layer integrated heat-trend: evd convection "         unit="W/m^2" >ttrd_evd_e3t * 1026.0 * 3991.86795711963  </field> 
     877     <field id="strd_evd_li"      long_name="layer integrated salt-trend: evd convection "         unit="kg/(m^2 s)" > strd_evd_e3t * 1026.0 * 0.001  </field> 
     878 
     879   </field_group> 
     880 
     881   <!--  Total trends calculated every time step--> 
     882   <field_group id="trendT" grid_ref="grid_T_3D"> 
     883     <field id="ttrd_tot"      long_name="temperature-trend: total model trend"         unit="degC/s" /> 
     884     <field id="strd_tot"      long_name="salinity   -trend: total model trend"         unit="1e-3/s" /> 
     885     <!-- Thickness weighted versions: --> 
     886     <field id="ttrd_tot_e3t"      unit="degC/s * m"  >  ttrd_tot * e3t </field> 
     887     <field id="strd_tot_e3t"      unit="1e-3/s * m"  >  strd_tot * e3t </field> 
     888     <!-- OMIP  layer-integrated total trends --> 
     889     <field id="ttrd_tot_li"      long_name="layer integrated heat-trend: total model trend :"         unit="W/m^2" > ttrd_tot_e3t * 1026.0 * 3991.86795711963 </field> 
     890     <field id="strd_tot_li"      long_name="layer integrated salt-trend: total model trend :"         unit="kg/(m^2 s)" > strd_tot_e3t * 1026.0 * 0.001  </field> 
     891 
     892     <!-- **** these trends have not been apportioned to all/even/odd ts yet **** --> 
     893     <!-- variables available with ln_KE_trd --> 
     894     <field id="ketrd_hpg"     long_name="ke-trend: hydrostatic pressure gradient"          unit="W/s^3"                        /> 
     895     <field id="ketrd_spg"     long_name="ke-trend: surface     pressure gradient"          unit="W/s^3"                        /> 
     896     <field id="ketrd_spgexp"  long_name="ke-trend: surface pressure gradient (explicit)"   unit="W/s^3"                        /> 
     897     <field id="ketrd_spgflt"  long_name="ke-trend: surface pressure gradient (filter)"     unit="W/s^3"                        /> 
     898     <field id="ssh_flt"       long_name="filtered contribution to ssh (dynspg_flt)"        unit="m"       grid_ref="grid_T_2D" /> 
     899     <field id="w0"            long_name="surface vertical velocity"                        unit="m/s"     grid_ref="grid_T_2D" /> 
     900     <field id="pw0_exp"       long_name="surface pressure flux due to ssh"                 unit="W/s^2"   grid_ref="grid_T_2D" /> 
     901     <field id="pw0_flt"       long_name="surface pressure flux due to filtered ssh"        unit="W/s^2"   grid_ref="grid_T_2D" /> 
     902     <field id="ketrd_keg"     long_name="ke-trend: KE gradient         or hor. adv."       unit="W/s^3"                        /> 
     903     <field id="ketrd_rvo"     long_name="ke-trend: relative  vorticity or metric term"     unit="W/s^3"                        /> 
     904     <field id="ketrd_pvo"     long_name="ke-trend: planetary vorticity"                    unit="W/s^3"                        /> 
     905     <field id="ketrd_zad"     long_name="ke-trend: vertical  advection"                    unit="W/s^3"                        /> 
     906     <field id="ketrd_udx"     long_name="ke-trend: U.dx[U]"                                unit="W/s^3"                        /> 
     907     <field id="ketrd_ldf"     long_name="ke-trend: lateral   diffusion"                    unit="W/s^3"                        /> 
     908     <field id="ketrd_zdf"     long_name="ke-trend: vertical  diffusion"                    unit="W/s^3"                        /> 
     909     <field id="ketrd_tau"     long_name="ke-trend: wind stress "                           unit="W/s^3"   grid_ref="grid_T_2D" /> 
     910     <field id="ketrd_bfr"     long_name="ke-trend: bottom friction (explicit)"             unit="W/s^3"                        />    
     911     <field id="ketrd_bfri"    long_name="ke-trend: bottom friction (implicit)"             unit="W/s^3"                        />    
     912     <field id="ketrd_atf"     long_name="ke-trend: asselin time filter trend"              unit="W/s^3"                        />   
     913     <field id="ketrd_convP2K" long_name="ke-trend: conversion (potential to kinetic)"      unit="W/s^3"                        /> 
     914     <field id="KE"            long_name="kinetic energy: u(n)*u(n+1)/2"                    unit="W/s^2"                        />    
     915 
     916     <!-- variables available when explicit lateral mixing is used (ln_dynldf_OFF=F) --> 
     917     <field id="dispkexyfo"    long_name="KE-trend: lateral  mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_xy_friction"                   unit="W/m^2" grid_ref="grid_T_2D" />    
     918     <field id="dispkevfo"     long_name="KE-trend: vertical mixing induced dissipation"   standard_name="ocean_kinetic_energy_dissipation_per_unit_area_due_to_vertical_friction"             unit="W/m^2" grid_ref="grid_T_2D" />    
     919     <!-- variables available with ln_traadv_eiv=T and ln_diaeiv=T --> 
     920     <field id="eketrd_eiv"    long_name="EKE-trend due to parameterized eddy advection"   standard_name="tendency_of_ocean_eddy_kinetic_energy_content_due_to_parameterized_eddy_advection"   unit="W/m^2" grid_ref="grid_T_2D" />    
     921 
     922     <!-- variables available with ln_PE_trd --> 
     923     <field id="petrd_xad"     long_name="pe-trend: i-advection"                unit="W/m^3"                        /> 
     924     <field id="petrd_yad"     long_name="pe-trend: j-advection"                unit="W/m^3"                        /> 
     925     <field id="petrd_zad"     long_name="pe-trend: k-advection"                unit="W/m^3"                        /> 
     926     <field id="petrd_sad"     long_name="pe-trend: surface adv. (linssh true)" unit="W/m^3"   grid_ref="grid_T_2D" /> 
     927     <field id="petrd_ldf"     long_name="pe-trend: lateral  diffusion"         unit="W/m^3"                        /> 
     928     <field id="petrd_zdf"     long_name="pe-trend: vertical diffusion"         unit="W/m^3"                        /> 
     929     <field id="petrd_zdfp"    long_name="pe-trend: pure vert. diffusion"       unit="W/m^3"                        /> 
     930     <field id="petrd_dmp"     long_name="pe-trend: interior restoring"         unit="W/m^3"                        /> 
     931     <field id="petrd_bbl"     long_name="pe-trend: bottom boundary layer"      unit="W/m^3"                        /> 
     932     <field id="petrd_npc"     long_name="pe-trend: non-penetrative conv."      unit="W/m^3"                        /> 
     933     <field id="petrd_nsr"     long_name="pe-trend: surface forcing + runoff"   unit="W/m^3"                        /> 
     934     <field id="petrd_qsr"     long_name="pe-trend: solar penetr. heating"      unit="W/m^3"                        /> 
     935     <field id="petrd_bbc"     long_name="pe-trend: geothermal heating"         unit="W/m^3"                        /> 
     936     <field id="petrd_atf"     long_name="pe-trend: asselin time filter"        unit="W/m^3"                        /> 
     937     <field id="PEanom"        long_name="potential energy anomaly"             unit="1"                            />    
     938     <field id="alphaPE"       long_name="partial deriv. of PEanom wrt T"       unit="degC-1"                       />    
     939     <field id="betaPE"        long_name="partial deriv. of PEanom wrt S"       unit="1e3"                          />    
     940   </field_group> 
     941 
     942   <field_group id="trendU" grid_ref="grid_U_3D"> 
     943     <!-- variables available with ln_dyn_trd --> 
     944     <field id="utrd_hpg"       long_name="i-trend: hydrostatic pressure gradient"          unit="m/s^2"                        /> 
     945     <field id="utrd_spg"       long_name="i-trend: surface     pressure gradient"          unit="m/s^2"                        /> 
     946     <field id="utrd_spgexp"    long_name="i-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        /> 
     947     <field id="utrd_spgflt"    long_name="i-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        /> 
     948     <field id="utrd_keg"       long_name="i-trend: KE gradient         or hor. adv."       unit="m/s^2"                        /> 
     949     <field id="utrd_rvo"       long_name="i-trend: relative  vorticity or metric term"     unit="m/s^2"                        /> 
     950     <field id="utrd_pvo"       long_name="i-trend: planetary vorticity"                    unit="m/s^2"                        /> 
     951     <field id="utrd_zad"       long_name="i-trend: vertical  advection"                    unit="m/s^2"                        /> 
     952     <field id="utrd_udx"       long_name="i-trend: U.dx[U]"                                unit="m/s^2"                        /> 
     953     <field id="utrd_ldf"       long_name="i-trend: lateral   diffusion"                    unit="m/s^2"                        /> 
     954     <field id="utrd_zdf"       long_name="i-trend: vertical  diffusion"                    unit="m/s^2"                        /> 
     955     <field id="utrd_tau"       long_name="i-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_U_2D" /> 
     956     <field id="utrd_bfr"       long_name="i-trend: bottom friction (explicit)"             unit="m/s^2"                        />    
     957     <field id="utrd_bfri"      long_name="i-trend: bottom friction (implicit)"             unit="m/s^2"                        />    
     958     <field id="utrd_tot"       long_name="i-trend: total momentum trend before atf"        unit="m/s^2"                        />    
     959     <field id="utrd_atf"       long_name="i-trend: asselin time filter trend"              unit="m/s^2"                        />    
     960   </field_group> 
     961 
     962   <field_group id="trendV" grid_ref="grid_V_3D"> 
     963     <!-- variables available with ln_dyn_trd --> 
     964     <field id="vtrd_hpg"       long_name="j-trend: hydrostatic pressure gradient"          unit="m/s^2"                        /> 
     965     <field id="vtrd_spg"       long_name="j-trend: surface     pressure gradient"          unit="m/s^2"                        /> 
     966     <field id="vtrd_spgexp"    long_name="j-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        /> 
     967     <field id="vtrd_spgflt"    long_name="j-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        /> 
     968     <field id="vtrd_keg"       long_name="j-trend: KE gradient         or hor. adv."       unit="m/s^2"                        /> 
     969     <field id="vtrd_rvo"       long_name="j-trend: relative  vorticity or metric term"     unit="m/s^2"                        /> 
     970     <field id="vtrd_pvo"       long_name="j-trend: planetary vorticity"                    unit="m/s^2"                        /> 
     971     <field id="vtrd_zad"       long_name="j-trend: vertical  advection"                    unit="m/s^2"                        /> 
     972     <field id="vtrd_vdy"       long_name="i-trend: V.dx[V]"                                unit="m/s^2"                        /> 
     973     <field id="vtrd_ldf"       long_name="j-trend: lateral   diffusion"                    unit="m/s^2"                        /> 
     974     <field id="vtrd_zdf"       long_name="j-trend: vertical  diffusion"                    unit="m/s^2"                        /> 
     975     <field id="vtrd_tau"       long_name="j-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_V_2D" /> 
     976     <field id="vtrd_bfr"       long_name="j-trend: bottom friction (explicit)"             unit="m/s^2"                        />    
     977     <field id="vtrd_bfri"      long_name="j-trend: bottom friction (implicit)"             unit="m/s^2"                        />    
     978     <field id="vtrd_tot"       long_name="j-trend: total momentum trend before atf"        unit="m/s^2"                        />    
     979     <field id="vtrd_atf"       long_name="j-trend: asselin time filter trend"              unit="m/s^2"                        />    
     980   </field_group> 
    822981 
    823982 
     
    828987    --> 
    829988 
    830      <field_group id="TRD" > 
    831           <field field_ref="ttrd_totad_li"   name="opottempadvect"  /> 
    832           <field field_ref="ttrd_iso_li"     name="opottemppmdiff"  /> 
    833           <field field_ref="ttrd_zdfp_li"    name="opottempdiff"  /> 
    834           <field field_ref="ttrd_evd_li"     name="opottempevd" /> 
    835           <field field_ref="strd_evd_li"     name="osaltevd" /> 
    836           <field field_ref="ttrd_qns_li"     name="opottempqns"  /> 
    837           <field field_ref="ttrd_qsr_li"     name="rsdoabsorb" operation="accumulate" /> 
    838           <field field_ref="strd_totad_li"   name="osaltadvect" /> 
    839           <field field_ref="strd_iso_li"     name="osaltpmdiff"  /> 
    840           <field field_ref="strd_zdfp_li"    name="osaltdiff" /> 
     989    <field_group id="TRD" > 
     990      <field field_ref="ttrd_totad_li"   name="opottempadvect"  /> 
     991      <field field_ref="ttrd_iso_li"     name="opottemppmdiff"  /> 
     992      <field field_ref="ttrd_zdfp_li"    name="opottempdiff"  /> 
     993      <field field_ref="ttrd_evd_li"     name="opottempevd" /> 
     994      <field field_ref="strd_evd_li"     name="osaltevd" /> 
     995      <field field_ref="ttrd_qns_li"     name="opottempqns"  /> 
     996      <field field_ref="ttrd_qsr_li"     name="rsdoabsorb" operation="accumulate" /> 
     997      <field field_ref="strd_totad_li"   name="osaltadvect" /> 
     998      <field field_ref="strd_iso_li"     name="osaltpmdiff"  /> 
     999      <field field_ref="strd_zdfp_li"    name="osaltdiff" /> 
    8411000    </field_group> 
    8421001     
    8431002    <field_group id="mooring" > 
    844        <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"      /> 
    845        <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                   /> 
    846        <field field_ref="uoce"         name="uo"       long_name="sea_water_x_velocity"                 /> 
    847        <field field_ref="voce"         name="vo"       long_name="sea_water_y_velocity"                 /> 
    848        <field field_ref="woce"         name="wo"       long_name="sea_water_z_velocity"                 /> 
    849        <field field_ref="avt"          name="difvho"   long_name="ocean_vertical_heat_diffusivity"      /> 
    850        <field field_ref="avm"          name="difvmo"   long_name="ocean_vertical_momentum_diffusivity"  /> 
    851     
    852        <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       /> 
    853        <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             /> 
    854        <field field_ref="sstgrad"      name="tosgrad"  long_name="module_of_sea_surface_temperature_gradient"    /> 
    855        <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          /> 
    856        <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                /> 
    857        <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     /> 
    858        <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           /> 
    859        <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          /> 
    860        <field field_ref="taum"                                                                                   /> 
    861        <field field_ref="20d"                                                                                    /> 
    862        <field field_ref="mldkz5"                                                                                 /> 
    863        <field field_ref="mldr10_1"                                                                               /> 
    864        <field field_ref="mldr10_3"                                                                               /> 
    865        <field field_ref="mldr0_1"                                                                                /> 
    866        <field field_ref="mldr0_3"                                                                                /> 
    867        <field field_ref="mld_dt02"                                                                               /> 
    868        <field field_ref="topthdep"                                                                               /> 
    869        <field field_ref="pycndep"                                                                                /> 
    870        <field field_ref="tinv"                                                                                   /> 
    871        <field field_ref="depti"                                                                                  /> 
    872        <field field_ref="BLT"          name="blt"      long_name="barrier_layer_thickness"                       /> 
    873        <field field_ref="utau"         name="tauuo"    long_name="surface_downward_x_stress"                     /> 
    874        <field field_ref="vtau"         name="tauvo"    long_name="surface_downward_y_stress"                     /> 
     1003      <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"      /> 
     1004      <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                   /> 
     1005      <field field_ref="uoce"         name="uo"       long_name="sea_water_x_velocity"                 /> 
     1006      <field field_ref="voce"         name="vo"       long_name="sea_water_y_velocity"                 /> 
     1007      <field field_ref="woce"         name="wo"       long_name="sea_water_z_velocity"                 /> 
     1008      <field field_ref="avt"          name="difvho"   long_name="ocean_vertical_heat_diffusivity"      /> 
     1009      <field field_ref="avm"          name="difvmo"   long_name="ocean_vertical_momentum_diffusivity"  /> 
     1010       
     1011      <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       /> 
     1012      <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             /> 
     1013      <field field_ref="sstgrad"      name="tosgrad"  long_name="module_of_sea_surface_temperature_gradient"    /> 
     1014      <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          /> 
     1015      <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                /> 
     1016      <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     /> 
     1017      <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           /> 
     1018      <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          /> 
     1019      <field field_ref="taum"                                                                                   /> 
     1020      <field field_ref="20d"                                                                                    /> 
     1021      <field field_ref="mldkz5"                                                                                 /> 
     1022      <field field_ref="mldr10_1"                                                                               /> 
     1023      <field field_ref="mldr10_3"                                                                               /> 
     1024      <field field_ref="mldr0_1"                                                                                /> 
     1025      <field field_ref="mldr0_3"                                                                                /> 
     1026      <field field_ref="mld_dt02"                                                                               /> 
     1027      <field field_ref="topthdep"                                                                               /> 
     1028      <field field_ref="pycndep"                                                                                /> 
     1029      <field field_ref="tinv"                                                                                   /> 
     1030      <field field_ref="depti"                                                                                  /> 
     1031      <field field_ref="BLT"          name="blt"      long_name="barrier_layer_thickness"                       /> 
     1032      <field field_ref="utau"         name="tauuo"    long_name="surface_downward_x_stress"                     /> 
     1033      <field field_ref="vtau"         name="tauvo"    long_name="surface_downward_y_stress"                     /> 
    8751034    </field_group> 
    8761035 
    8771036    <field_group id="groupT" > 
    878        <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               /> 
    879        <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            /> 
    880        <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       /> 
    881        <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             /> 
    882        <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          /> 
    883        <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                /> 
    884        <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     /> 
    885        <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           /> 
    886        <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          /> 
    887        <field field_ref="taum"                                                                                   /> 
    888        <field field_ref="20d"                                                                                    /> 
    889        <field field_ref="mldkz5"                                                                                 /> 
    890        <field field_ref="mldr10_1"                                                                               /> 
    891        <field field_ref="mldr10_3"                                                                               /> 
    892        <field field_ref="mld_dt02"                                                                               /> 
    893        <field field_ref="topthdep"                                                                               /> 
    894        <field field_ref="pycndep"                                                                                /> 
    895        <field field_ref="tinv"                                                                                   /> 
    896        <field field_ref="depti"                                                                                  /> 
    897        <field field_ref="BLT"          name="blt"      long_name="Barrier Layer Thickness"                       /> 
     1037      <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               /> 
     1038      <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            /> 
     1039      <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       /> 
     1040      <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             /> 
     1041      <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          /> 
     1042      <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                /> 
     1043      <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     /> 
     1044      <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           /> 
     1045      <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          /> 
     1046      <field field_ref="taum"                                                                                   /> 
     1047      <field field_ref="20d"                                                                                    /> 
     1048      <field field_ref="mldkz5"                                                                                 /> 
     1049      <field field_ref="mldr10_1"                                                                               /> 
     1050      <field field_ref="mldr10_3"                                                                               /> 
     1051      <field field_ref="mld_dt02"                                                                               /> 
     1052      <field field_ref="topthdep"                                                                               /> 
     1053      <field field_ref="pycndep"                                                                                /> 
     1054      <field field_ref="tinv"                                                                                   /> 
     1055      <field field_ref="depti"                                                                                  /> 
     1056      <field field_ref="BLT"          name="blt"      long_name="Barrier Layer Thickness"                       /> 
    8981057    </field_group> 
    8991058     
    9001059    <field_group id="groupU" > 
    901        <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      /> 
    902        <field field_ref="ssu"          name="uos"     long_name="sea_surface_x_velocity"    /> 
    903        <field field_ref="utau"         name="tauuo"   long_name="surface_downward_x_stress" /> 
     1060      <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      /> 
     1061      <field field_ref="utau"         name="tauuo"   long_name="surface_downward_x_stress" /> 
    9041062    </field_group> 
    9051063     
    9061064    <field_group id="groupV" > 
    907        <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      /> 
    908        <field field_ref="ssv"          name="vos"     long_name="sea_surface_y_velocity"    /> 
    909        <field field_ref="vtau"         name="tauvo"   long_name="surface_downward_y_stress" /> 
     1065      <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      /> 
     1066      <field field_ref="vtau"         name="tauvo"   long_name="surface_downward_y_stress" /> 
    9101067    </field_group> 
    9111068     
    9121069    <field_group id="groupW" > 
    913        <field field_ref="woce"         name="wo"       long_name="ocean vertical velocity"  /> 
    914     </field_group> 
    915  
    916     <!-- TMB diagnostic output --> 
    917     <field_group  id="1h_grid_T_tmb" grid_ref="grid_T_2D" operation="instant"> 
    918        <field id="top_temp"           name="votemper_top"  unit="degC"  /> 
    919        <field id="mid_temp"           name="votemper_mid"  unit="degC"  /> 
    920        <field id="bot_temp"           name="votemper_bot"  unit="degC"  /> 
    921        <field id="top_sal"            name="vosaline_top"  unit="psu"   /> 
    922        <field id="mid_sal"            name="vosaline_mid"  unit="psu"   /> 
    923        <field id="bot_sal"            name="vosaline_bot"  unit="psu"   /> 
    924        <field id="sshnmasked"         name="sossheig"      unit="m"     />  
     1070      <field field_ref="woce"         name="wo"       long_name="ocean vertical velocity"  /> 
    9251071    </field_group> 
    9261072 
    9271073    <field_group  id="1h_grid_U_tmb" grid_ref="grid_U_2D" operation="instant"> 
    928        <field id="top_u"           name="vozocrtx_top"  unit="m/s"  /> 
    929        <field id="mid_u"           name="vozocrtx_mid"  unit="m/s"  /> 
    930        <field id="bot_u"           name="vozocrtx_bot"  unit="m/s"  /> 
    931        <field id="baro_u"          name="vobtcrtx"      unit="m/s"  /> 
     1074      <field id="top_u"           name="vozocrtx_top"  unit="m/s"  /> 
     1075      <field id="mid_u"           name="vozocrtx_mid"  unit="m/s"  /> 
     1076      <field id="bot_u"           name="vozocrtx_bot"  unit="m/s"  /> 
     1077      <field id="baro_u"          name="vobtcrtx"      unit="m/s"  /> 
    9321078    </field_group> 
    9331079 
    9341080    <field_group  id="1h_grid_V_tmb" grid_ref="grid_V_2D" operation="instant"> 
    935        <field id="top_v"           name="vomecrty_top"  unit="m/s"  /> 
    936        <field id="mid_v"           name="vomecrty_mid"  unit="m/s"  /> 
    937        <field id="bot_v"           name="vomecrty_bot"  unit="m/s"  /> 
    938        <field id="baro_v"          name="vobtcrty"      unit="m/s"  /> 
     1081      <field id="top_v"           name="vomecrty_top"  unit="m/s"  /> 
     1082      <field id="mid_v"           name="vomecrty_mid"  unit="m/s"  /> 
     1083      <field id="bot_v"           name="vomecrty_bot"  unit="m/s"  /> 
     1084      <field id="baro_v"          name="vobtcrty"      unit="m/s"  /> 
    9391085    </field_group> 
    9401086 
    9411087    <!-- 25h diagnostic output --> 
    9421088    <field_group id="25h_grid_T" grid_ref="grid_T_3D" operation="instant"> 
    943        <field id="temper25h"         name="potential temperature 25h mean"    unit="degC" /> 
    944        <field id="tempis25h"         name="insitu temperature 25h mean"    unit="degC" /> 
    945        <field id="salin25h"          name="salinity 25h mean"                 unit="psu"  /> 
    946        <field id="ssh25h"            name="sea surface height 25h mean"  grid_ref="grid_T_2D"      unit="m"    /> 
     1089      <field id="temper25h"         name="potential temperature 25h mean"    unit="degC" /> 
     1090      <field id="tempis25h"         name="insitu temperature 25h mean"    unit="degC" /> 
     1091      <field id="salin25h"          name="salinity 25h mean"                 unit="psu"  /> 
     1092      <field id="ssh25h"            name="sea surface height 25h mean"  grid_ref="grid_T_2D"      unit="m"    /> 
    9471093    </field_group> 
    9481094 
    9491095    <field_group id="25h_grid_U" grid_ref="grid_U_3D" operation="instant" > 
    950        <field id="vozocrtx25h"         name="i current 25h mean"    unit="m/s"   /> 
     1096      <field id="vozocrtx25h"         name="i current 25h mean"    unit="m/s"   /> 
    9511097    </field_group> 
    9521098 
    9531099    <field_group id="25h_grid_V" grid_ref="grid_V_3D" operation="instant"> 
    954        <field id="vomecrty25h"         name="j current 25h mean"    unit="m/s"    /> 
     1100      <field id="vomecrty25h"         name="j current 25h mean"    unit="m/s"    /> 
    9551101    </field_group> 
    9561102 
    9571103    <field_group id="25h_grid_W" grid_ref="grid_W_3D" operation="instant"> 
    958        <field id="vomecrtz25h"         name="k current 25h mean"                 unit="m/s"      /> 
    959        <field id="avt25h"             name="vertical diffusivity25h mean"       unit="m2/s" /> 
    960        <field id="avm25h"              name="vertical viscosity 25h mean"        unit="m2/s" /> 
    961        <field id="tke25h"              name="turbulent kinetic energy 25h mean" /> 
    962        <field id="mxln25h"             name="mixing length 25h mean"             unit="m" /> 
    963     </field_group> 
    964  
    965      <!--  
     1104      <field id="vovecrtz25h"         name="k current 25h mean"                 unit="m/s"      /> 
     1105      <field id="avt25h"              name="vertical diffusivity25h mean"       unit="m2/s" /> 
     1106      <field id="avm25h"              name="vertical viscosity 25h mean"        unit="m2/s" /> 
     1107      <field id="tke25h"              name="turbulent kinetic energy 25h mean" /> 
     1108      <field id="mxln25h"             name="mixing length 25h mean"             unit="m" /> 
     1109    </field_group> 
     1110 
     1111    <!--  
    9661112============================================================================================================ 
    967        --> 
    968      <!-- output variables for my configuration (example) -->  
    969   
     1113    --> 
     1114    <!-- output variables for my configuration (example) -->  
     1115     
    9701116    <field_group id="myvarOCE" > 
    971        <!-- grid T -->  
    972        <field field_ref="e3t"          name="e3t"      long_name="vertical scale factor"           /> 
    973        <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"         /> 
    974        <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"            /> 
    975        <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"  /> 
    976        
    977        <!-- grid U -->  
    978        <field field_ref="e3u"          name="e3u"     long_name="vertical scale factor"            /> 
    979        <field field_ref="ssu"          name="uos"     long_name="sea_surface_x_velocity"           /> 
    980        
    981        <!-- grid V -->  
    982        <field field_ref="e3v"          name="e3v"     long_name="vertical scale factor"            /> 
    983        <field field_ref="ssv"          name="vos"     long_name="sea_surface_y_velocity"           />      
     1117      <!-- grid T -->  
     1118      <field field_ref="e3t"          name="e3t"      long_name="vertical scale factor"           /> 
     1119      <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"         /> 
     1120      <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"            /> 
     1121      <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"  /> 
     1122       
     1123      <!-- grid U -->  
     1124      <field field_ref="e3u"          name="e3u"     long_name="vertical scale factor"            /> 
     1125      <field field_ref="ssu"          name="uos"     long_name="sea_surface_x_velocity"           /> 
     1126       
     1127      <!-- grid V -->  
     1128      <field field_ref="e3v"          name="e3v"     long_name="vertical scale factor"            /> 
     1129      <field field_ref="ssv"          name="vos"     long_name="sea_surface_y_velocity"           />      
    9841130    </field_group>     
    9851131 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/EXPREF/namelist_cfg

    r12178 r12928  
    5959!----------------------------------------------------------------------- 
    6060   ln_linssh   =  .false.  !  =T  linear free surface  ==>>  model level are fixed in time 
    61    rn_rdt      =   1440.   !  time step for the dynamics (and tracer if nn_acc=0) 
     61   rn_Dt      =   1440.   !  time step for the dynamics (and tracer if nn_acc=0) 
    6262   rn_atfp     =   0.05    !  asselin time filter parameter 
    6363/ 
     
    208208      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    209209         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    210          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    211          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     210         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     211         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    212212      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    213          nn_baro      =  24         ! =F : the number of sub-step in rn_rdt seconds 
     213         nn_e      =  24         ! =F : the number of sub-step in rn_Dt seconds 
    214214/ 
    215215!----------------------------------------------------------------------- 
     
    276276!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    277277!!   namflo       float parameters                                      (default: OFF) 
    278 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    279278!!   nam_diadct   transports through some sections                      (default: OFF) 
    280 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    281279!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    282280!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/MY_SRC/diawri.F90

    r12178 r12928  
    2626   !!---------------------------------------------------------------------- 
    2727   USE oce            ! ocean dynamics and tracers  
     28   USE isf_oce 
     29   USE isfcpl 
     30   USE abl            ! abl variables in case ln_abl = .true. 
    2831   USE dom_oce        ! ocean space and time domain 
    2932   USE phycst         ! physical constants 
     
    4649   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
    4750   USE in_out_manager ! I/O manager 
    48    USE diatmb         ! Top,middle,bottom output 
    4951   USE dia25h         ! 25h Mean output 
    5052   USE iom            !  
     
    5759   USE lib_mpp         ! MPP library 
    5860   USE timing          ! preformance summary 
    59    USE diurnal_bulk    ! diurnal warm layer 
    60    USE cool_skin       ! Cool skin 
     61   USE diu_bulk        ! diurnal warm layer 
     62   USE diu_coolskin    ! Cool skin 
    6163 
    6264   IMPLICIT NONE 
     
    6668   PUBLIC   dia_wri_state 
    6769   PUBLIC   dia_wri_alloc           ! Called by nemogcm module 
    68  
     70#if ! defined key_iomput    
     71   PUBLIC   dia_wri_alloc_abl       ! Called by sbcabl  module (if ln_abl = .true.) 
     72#endif 
    6973   INTEGER ::   nid_T, nz_T, nh_T, ndim_T, ndim_hT   ! grid_T file 
    7074   INTEGER ::          nb_T              , ndim_bT   ! grid_T file 
     
    7276   INTEGER ::   nid_V, nz_V, nh_V, ndim_V, ndim_hV   ! grid_V file 
    7377   INTEGER ::   nid_W, nz_W, nh_W                    ! grid_W file 
     78   INTEGER ::   nid_A, nz_A, nh_A, ndim_A, ndim_hA   ! grid_ABL file    
    7479   INTEGER ::   ndex(1)                              ! ??? 
    7580   INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hT, ndex_hU, ndex_hV 
     81   INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hA, ndex_A ! ABL 
    7682   INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_T, ndex_U, ndex_V 
    7783   INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_bT 
    7884 
    7985   !! * Substitutions 
    80 #  include "vectopt_loop_substitute.h90" 
     86#  include "do_loop_substitute.h90" 
    8187   !!---------------------------------------------------------------------- 
    8288   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    97103 
    98104    
    99    SUBROUTINE dia_wri( kt ) 
     105   SUBROUTINE dia_wri( kt, Kmm ) 
    100106      !!--------------------------------------------------------------------- 
    101107      !!                  ***  ROUTINE dia_wri  *** 
     
    107113      !!---------------------------------------------------------------------- 
    108114      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     115      INTEGER, INTENT( in ) ::   Kmm     ! ocean time level index 
    109116      !! 
    110117      INTEGER ::   ji, jj, jk       ! dummy loop indices 
     
    115122      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d   ! 2D workspace 
    116123      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   z3d   ! 3D workspace 
    117       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   bu, bv   ! volume of u- and v-boxes 
    118       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   r1_bt    ! inverse of t-box volume 
    119124      !!---------------------------------------------------------------------- 
    120125      !  
     
    123128      ! Output the initial state and forcings 
    124129      IF( ninist == 1 ) THEN                        
    125          CALL dia_wri_state( 'output.init' ) 
     130         CALL dia_wri_state( Kmm, 'output.init' ) 
    126131         ninist = 0 
    127132      ENDIF 
     
    132137      CALL iom_put("e3v_0", e3v_0(:,:,:) ) 
    133138      ! 
    134       CALL iom_put( "e3t" , e3t_n(:,:,:) ) 
    135       CALL iom_put( "e3u" , e3u_n(:,:,:) ) 
    136       CALL iom_put( "e3v" , e3v_n(:,:,:) ) 
    137       CALL iom_put( "e3w" , e3w_n(:,:,:) ) 
     139      CALL iom_put( "e3t" , e3t(:,:,:,Kmm) ) 
     140      CALL iom_put( "e3u" , e3u(:,:,:,Kmm) ) 
     141      CALL iom_put( "e3v" , e3v(:,:,:,Kmm) ) 
     142      CALL iom_put( "e3w" , e3w(:,:,:,Kmm) ) 
    138143      IF( iom_use("e3tdef") )   & 
    139          CALL iom_put( "e3tdef"  , ( ( e3t_n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 ) 
     144         CALL iom_put( "e3tdef"  , ( ( e3t(:,:,:,Kmm) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 ) 
    140145 
    141146      IF( ll_wd ) THEN 
    142          CALL iom_put( "ssh" , (sshn+ssh_ref)*tmask(:,:,1) )   ! sea surface height (brought back to the reference used for wetting and drying) 
     147         CALL iom_put( "ssh" , (ssh(:,:,Kmm)+ssh_ref)*tmask(:,:,1) )   ! sea surface height (brought back to the reference used for wetting and drying) 
    143148      ELSE 
    144          CALL iom_put( "ssh" , sshn )              ! sea surface height 
     149         CALL iom_put( "ssh" , ssh(:,:,Kmm) )              ! sea surface height 
    145150      ENDIF 
    146151 
    147152      IF( iom_use("wetdep") )   &                  ! wet depth 
    148          CALL iom_put( "wetdep" , ht_0(:,:) + sshn(:,:) ) 
     153         CALL iom_put( "wetdep" , ht_0(:,:) + ssh(:,:,Kmm) ) 
    149154       
    150       CALL iom_put( "toce", tsn(:,:,:,jp_tem) )    ! 3D temperature 
    151       CALL iom_put(  "sst", tsn(:,:,1,jp_tem) )    ! surface temperature 
     155      CALL iom_put( "toce", ts(:,:,:,jp_tem,Kmm) )    ! 3D temperature 
     156      CALL iom_put(  "sst", ts(:,:,1,jp_tem,Kmm) )    ! surface temperature 
    152157      IF ( iom_use("sbt") ) THEN 
    153          DO jj = 1, jpj 
    154             DO ji = 1, jpi 
    155                ikbot = mbkt(ji,jj) 
    156                z2d(ji,jj) = tsn(ji,jj,ikbot,jp_tem) 
    157             END DO 
    158          END DO 
     158         DO_2D_11_11 
     159            ikbot = mbkt(ji,jj) 
     160            z2d(ji,jj) = ts(ji,jj,ikbot,jp_tem,Kmm) 
     161         END_2D 
    159162         CALL iom_put( "sbt", z2d )                ! bottom temperature 
    160163      ENDIF 
    161164       
    162       CALL iom_put( "soce", tsn(:,:,:,jp_sal) )    ! 3D salinity 
    163       CALL iom_put(  "sss", tsn(:,:,1,jp_sal) )    ! surface salinity 
     165      CALL iom_put( "soce", ts(:,:,:,jp_sal,Kmm) )    ! 3D salinity 
     166      CALL iom_put(  "sss", ts(:,:,1,jp_sal,Kmm) )    ! surface salinity 
    164167      IF ( iom_use("sbs") ) THEN 
    165          DO jj = 1, jpj 
    166             DO ji = 1, jpi 
    167                ikbot = mbkt(ji,jj) 
    168                z2d(ji,jj) = tsn(ji,jj,ikbot,jp_sal) 
    169             END DO 
    170          END DO 
     168         DO_2D_11_11 
     169            ikbot = mbkt(ji,jj) 
     170            z2d(ji,jj) = ts(ji,jj,ikbot,jp_sal,Kmm) 
     171         END_2D 
    171172         CALL iom_put( "sbs", z2d )                ! bottom salinity 
    172173      ENDIF 
    173174 
    174175      IF ( iom_use("taubot") ) THEN                ! bottom stress 
    175          zztmp = rau0 * 0.25 
     176         zztmp = rho0 * 0.25 
    176177         z2d(:,:) = 0._wp 
    177          DO jj = 2, jpjm1 
    178             DO ji = fs_2, fs_jpim1   ! vector opt. 
    179                zztmp2 = (  ( rCdU_bot(ji+1,jj)+rCdU_bot(ji  ,jj) ) * un(ji  ,jj,mbku(ji  ,jj))  )**2   & 
    180                   &   + (  ( rCdU_bot(ji  ,jj)+rCdU_bot(ji-1,jj) ) * un(ji-1,jj,mbku(ji-1,jj))  )**2   & 
    181                   &   + (  ( rCdU_bot(ji,jj+1)+rCdU_bot(ji,jj  ) ) * vn(ji,jj  ,mbkv(ji,jj  ))  )**2   & 
    182                   &   + (  ( rCdU_bot(ji,jj  )+rCdU_bot(ji,jj-1) ) * vn(ji,jj-1,mbkv(ji,jj-1))  )**2 
    183                z2d(ji,jj) = zztmp * SQRT( zztmp2 ) * tmask(ji,jj,1)  
    184                ! 
    185             END DO 
    186          END DO 
     178         DO_2D_00_00 
     179            zztmp2 = (  ( rCdU_bot(ji+1,jj)+rCdU_bot(ji  ,jj) ) * uu(ji  ,jj,mbku(ji  ,jj),Kmm)  )**2   & 
     180               &   + (  ( rCdU_bot(ji  ,jj)+rCdU_bot(ji-1,jj) ) * uu(ji-1,jj,mbku(ji-1,jj),Kmm)  )**2   & 
     181               &   + (  ( rCdU_bot(ji,jj+1)+rCdU_bot(ji,jj  ) ) * vv(ji,jj  ,mbkv(ji,jj  ),Kmm)  )**2   & 
     182               &   + (  ( rCdU_bot(ji,jj  )+rCdU_bot(ji,jj-1) ) * vv(ji,jj-1,mbkv(ji,jj-1),Kmm)  )**2 
     183            z2d(ji,jj) = zztmp * SQRT( zztmp2 ) * tmask(ji,jj,1)  
     184            ! 
     185         END_2D 
    187186         CALL lbc_lnk( 'diawri', z2d, 'T', 1. ) 
    188187         CALL iom_put( "taubot", z2d )            
    189188      ENDIF 
    190189          
    191       CALL iom_put( "uoce", un(:,:,:) )            ! 3D i-current 
    192       CALL iom_put(  "ssu", un(:,:,1) )            ! surface i-current 
     190      CALL iom_put( "uoce", uu(:,:,:,Kmm) )            ! 3D i-current 
     191      CALL iom_put(  "ssu", uu(:,:,1,Kmm) )            ! surface i-current 
    193192      IF ( iom_use("sbu") ) THEN 
    194          DO jj = 1, jpj 
    195             DO ji = 1, jpi 
    196                ikbot = mbku(ji,jj) 
    197                z2d(ji,jj) = un(ji,jj,ikbot) 
    198             END DO 
    199          END DO 
     193         DO_2D_11_11 
     194            ikbot = mbku(ji,jj) 
     195            z2d(ji,jj) = uu(ji,jj,ikbot,Kmm) 
     196         END_2D 
    200197         CALL iom_put( "sbu", z2d )                ! bottom i-current 
    201198      ENDIF 
    202199       
    203       CALL iom_put( "voce", vn(:,:,:) )            ! 3D j-current 
    204       CALL iom_put(  "ssv", vn(:,:,1) )            ! surface j-current 
     200      CALL iom_put( "voce", vv(:,:,:,Kmm) )            ! 3D j-current 
     201      CALL iom_put(  "ssv", vv(:,:,1,Kmm) )            ! surface j-current 
    205202      IF ( iom_use("sbv") ) THEN 
    206          DO jj = 1, jpj 
    207             DO ji = 1, jpi 
    208                ikbot = mbkv(ji,jj) 
    209                z2d(ji,jj) = vn(ji,jj,ikbot) 
    210             END DO 
    211          END DO 
     203         DO_2D_11_11 
     204            ikbot = mbkv(ji,jj) 
     205            z2d(ji,jj) = vv(ji,jj,ikbot,Kmm) 
     206         END_2D 
    212207         CALL iom_put( "sbv", z2d )                ! bottom j-current 
    213208      ENDIF 
    214209 
    215       CALL iom_put( "woce", wn )                   ! vertical velocity 
     210      IF( ln_zad_Aimp ) ww = ww + wi               ! Recombine explicit and implicit parts of vertical velocity for diagnostic output 
     211      ! 
     212      CALL iom_put( "woce", ww )                   ! vertical velocity 
    216213      IF( iom_use('w_masstr') .OR. iom_use('w_masstr2') ) THEN   ! vertical mass transport & its square value 
    217214         ! Caution: in the VVL case, it only correponds to the baroclinic mass transport. 
    218          z2d(:,:) = rau0 * e1e2t(:,:) 
     215         z2d(:,:) = rho0 * e1e2t(:,:) 
    219216         DO jk = 1, jpk 
    220             z3d(:,:,jk) = wn(:,:,jk) * z2d(:,:) 
     217            z3d(:,:,jk) = ww(:,:,jk) * z2d(:,:) 
    221218         END DO 
    222219         CALL iom_put( "w_masstr" , z3d )   
    223220         IF( iom_use('w_masstr2') )   CALL iom_put( "w_masstr2", z3d(:,:,:) * z3d(:,:,:) ) 
    224221      ENDIF 
     222      ! 
     223      IF( ln_zad_Aimp ) ww = ww - wi               ! Remove implicit part of vertical velocity that was added for diagnostic output 
    225224 
    226225      CALL iom_put( "avt" , avt )                  ! T vert. eddy diff. coef. 
     
    231230      IF( iom_use('logavs') )   CALL iom_put( "logavs", LOG( MAX( 1.e-20_wp, avs(:,:,:) ) ) ) 
    232231 
    233       IF ( iom_use("salgrad") .OR. iom_use("salgrad2") ) THEN 
    234          z3d(:,:,jpk) = 0. 
    235          DO jk = 1, jpkm1 
    236             DO jj = 2, jpjm1                                    ! sal gradient 
    237                DO ji = fs_2, fs_jpim1   ! vector opt. 
    238                   zztmp  = tsn(ji,jj,jk,jp_sal) 
    239                   zztmpx = ( tsn(ji+1,jj,jk,jp_sal) - zztmp ) * r1_e1u(ji,jj) + ( zztmp - tsn(ji-1,jj  ,jk,jp_sal) ) * r1_e1u(ji-1,jj) 
    240                   zztmpy = ( tsn(ji,jj+1,jk,jp_sal) - zztmp ) * r1_e2v(ji,jj) + ( zztmp - tsn(ji  ,jj-1,jk,jp_sal) ) * r1_e2v(ji,jj-1) 
    241                   z3d(ji,jj,jk) = 0.25 * ( zztmpx * zztmpx + zztmpy * zztmpy )   & 
    242                      &                 * umask(ji,jj,jk) * umask(ji-1,jj,jk) * vmask(ji,jj,jk) * umask(ji,jj-1,jk) 
    243                END DO 
    244             END DO 
    245          END DO 
    246          CALL lbc_lnk( 'diawri', z3d, 'T', 1. ) 
    247          CALL iom_put( "salgrad2",  z3d )          ! square of module of sal gradient 
    248          z3d(:,:,:) = SQRT( z3d(:,:,:) ) 
    249          CALL iom_put( "salgrad" ,  z3d )          ! module of sal gradient 
    250       ENDIF 
    251           
    252232      IF ( iom_use("sstgrad") .OR. iom_use("sstgrad2") ) THEN 
    253          DO jj = 2, jpjm1                                    ! sst gradient 
    254             DO ji = fs_2, fs_jpim1   ! vector opt. 
    255                zztmp  = tsn(ji,jj,1,jp_tem) 
    256                zztmpx = ( tsn(ji+1,jj,1,jp_tem) - zztmp ) * r1_e1u(ji,jj) + ( zztmp - tsn(ji-1,jj  ,1,jp_tem) ) * r1_e1u(ji-1,jj) 
    257                zztmpy = ( tsn(ji,jj+1,1,jp_tem) - zztmp ) * r1_e2v(ji,jj) + ( zztmp - tsn(ji  ,jj-1,1,jp_tem) ) * r1_e2v(ji,jj-1) 
    258                z2d(ji,jj) = 0.25 * ( zztmpx * zztmpx + zztmpy * zztmpy )   & 
    259                   &              * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * umask(ji,jj-1,1) 
    260             END DO 
    261          END DO 
     233         DO_2D_00_00 
     234            zztmp  = ts(ji,jj,1,jp_tem,Kmm) 
     235            zztmpx = ( ts(ji+1,jj,1,jp_tem,Kmm) - zztmp ) * r1_e1u(ji,jj) + ( zztmp - ts(ji-1,jj  ,1,jp_tem,Kmm) ) * r1_e1u(ji-1,jj) 
     236            zztmpy = ( ts(ji,jj+1,1,jp_tem,Kmm) - zztmp ) * r1_e2v(ji,jj) + ( zztmp - ts(ji  ,jj-1,1,jp_tem,Kmm) ) * r1_e2v(ji,jj-1) 
     237            z2d(ji,jj) = 0.25 * ( zztmpx * zztmpx + zztmpy * zztmpy )   & 
     238               &              * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * umask(ji,jj-1,1) 
     239         END_2D 
    262240         CALL lbc_lnk( 'diawri', z2d, 'T', 1. ) 
    263241         CALL iom_put( "sstgrad2",  z2d )          ! square of module of sst gradient 
     
    269247      IF( iom_use("heatc") ) THEN 
    270248         z2d(:,:)  = 0._wp  
    271          DO jk = 1, jpkm1 
    272             DO jj = 1, jpj 
    273                DO ji = 1, jpi 
    274                   z2d(ji,jj) = z2d(ji,jj) + e3t_n(ji,jj,jk) * tsn(ji,jj,jk,jp_tem) * tmask(ji,jj,jk) 
    275                END DO 
    276             END DO 
    277          END DO 
    278          CALL iom_put( "heatc", rau0_rcp * z2d )   ! vertically integrated heat content (J/m2) 
     249         DO_3D_11_11( 1, jpkm1 ) 
     250            z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_tem,Kmm) * tmask(ji,jj,jk) 
     251         END_3D 
     252         CALL iom_put( "heatc", rho0_rcp * z2d )   ! vertically integrated heat content (J/m2) 
    279253      ENDIF 
    280254 
    281255      IF( iom_use("saltc") ) THEN 
    282256         z2d(:,:)  = 0._wp  
    283          DO jk = 1, jpkm1 
    284             DO jj = 1, jpj 
    285                DO ji = 1, jpi 
    286                   z2d(ji,jj) = z2d(ji,jj) + e3t_n(ji,jj,jk) * tsn(ji,jj,jk,jp_sal) * tmask(ji,jj,jk) 
    287                END DO 
    288             END DO 
    289          END DO 
    290          CALL iom_put( "saltc", rau0 * z2d )          ! vertically integrated salt content (PSU*kg/m2) 
     257         DO_3D_11_11( 1, jpkm1 ) 
     258            z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) * tmask(ji,jj,jk) 
     259         END_3D 
     260         CALL iom_put( "saltc", rho0 * z2d )          ! vertically integrated salt content (PSU*kg/m2) 
    291261      ENDIF 
    292262      ! 
    293263      IF( iom_use("salt2c") ) THEN 
    294264         z2d(:,:)  = 0._wp  
    295          DO jk = 1, jpkm1 
    296             DO jj = 1, jpj 
    297                DO ji = 1, jpi 
    298                   z2d(ji,jj) = z2d(ji,jj) + e3t_n(ji,jj,jk) * tsn(ji,jj,jk,jp_sal) * tsn(ji,jj,jk,jp_sal) * tmask(ji,jj,jk) 
    299                END DO 
    300             END DO 
    301          END DO 
    302          CALL iom_put( "salt2c", rau0 * z2d )          ! vertically integrated salt content (PSU*kg/m2) 
     265         DO_3D_11_11( 1, jpkm1 ) 
     266            z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) * tmask(ji,jj,jk) 
     267         END_3D 
     268         CALL iom_put( "salt2c", rho0 * z2d )          ! vertically integrated salt content (PSU*kg/m2) 
    303269      ENDIF 
    304270      ! 
    305271      IF ( iom_use("eken") ) THEN 
    306272         z3d(:,:,jpk) = 0._wp  
    307          DO jk = 1, jpkm1 
    308             DO jj = 2, jpj 
    309                DO ji = 2, jpi 
    310                   zztmpx = 0.5 * ( un(ji-1,jj  ,jk) + un(ji,jj,jk) ) 
    311                   zztmpy = 0.5 * ( vn(ji  ,jj-1,jk) + vn(ji,jj,jk) ) 
    312                   z3d(ji,jj,jk) = 0.5 * ( zztmpx*zztmpx + zztmpy*zztmpy ) 
    313                END DO 
    314             END DO 
    315          END DO 
     273         DO_3D_00_00( 1, jpkm1 ) 
     274            zztmp  = 0.25_wp * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm) 
     275            z3d(ji,jj,jk) = zztmp * (  uu(ji-1,jj,jk,Kmm)**2 * e2u(ji-1,jj) * e3u(ji-1,jj,jk,Kmm)   & 
     276               &                     + uu(ji  ,jj,jk,Kmm)**2 * e2u(ji  ,jj) * e3u(ji  ,jj,jk,Kmm)   & 
     277               &                     + vv(ji,jj-1,jk,Kmm)**2 * e1v(ji,jj-1) * e3v(ji,jj-1,jk,Kmm)   & 
     278               &                     + vv(ji,jj  ,jk,Kmm)**2 * e1v(ji,jj  ) * e3v(ji,jj  ,jk,Kmm)   ) 
     279         END_3D 
    316280         CALL lbc_lnk( 'diawri', z3d, 'T', 1. ) 
    317281         CALL iom_put( "eken", z3d )                 ! kinetic energy 
     
    323287         z3d(1,:, : ) = 0._wp 
    324288         z3d(:,1, : ) = 0._wp 
    325          DO jk = 1, jpkm1 
    326             DO jj = 2, jpj 
    327                DO ji = 2, jpi 
    328                   z3d(ji,jj,jk) = 0.25_wp * ( un(ji  ,jj,jk) * un(ji  ,jj,jk) * e1e2u(ji  ,jj) * e3u_n(ji  ,jj,jk)  & 
    329                      &                      + un(ji-1,jj,jk) * un(ji-1,jj,jk) * e1e2u(ji-1,jj) * e3u_n(ji-1,jj,jk)  & 
    330                      &                      + vn(ji,jj  ,jk) * vn(ji,jj  ,jk) * e1e2v(ji,jj  ) * e3v_n(ji,jj  ,jk)  & 
    331                      &                      + vn(ji,jj-1,jk) * vn(ji,jj-1,jk) * e1e2v(ji,jj-1) * e3v_n(ji,jj-1,jk)  )  & 
    332                      &                    * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) * tmask(ji,jj,jk) 
    333                END DO 
    334             END DO 
    335          END DO 
    336           
     289         DO_3D_00_00( 1, jpkm1 ) 
     290            z3d(ji,jj,jk) = 0.25_wp * ( uu(ji  ,jj,jk,Kmm) * uu(ji  ,jj,jk,Kmm) * e1e2u(ji  ,jj) * e3u(ji  ,jj,jk,Kmm)  & 
     291               &                      + uu(ji-1,jj,jk,Kmm) * uu(ji-1,jj,jk,Kmm) * e1e2u(ji-1,jj) * e3u(ji-1,jj,jk,Kmm)  & 
     292               &                      + vv(ji,jj  ,jk,Kmm) * vv(ji,jj  ,jk,Kmm) * e1e2v(ji,jj  ) * e3v(ji,jj  ,jk,Kmm)  & 
     293               &                      + vv(ji,jj-1,jk,Kmm) * vv(ji,jj-1,jk,Kmm) * e1e2v(ji,jj-1) * e3v(ji,jj-1,jk,Kmm)  )  & 
     294               &                    * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm) * tmask(ji,jj,jk) 
     295         END_3D 
    337296         CALL lbc_lnk( 'diawri', z3d, 'T', 1. ) 
    338297         CALL iom_put( "ke", z3d ) ! kinetic energy 
    339298 
    340299         z2d(:,:)  = 0._wp  
    341          DO jk = 1, jpkm1 
    342             DO jj = 1, jpj 
    343                DO ji = 1, jpi 
    344                   z2d(ji,jj) = z2d(ji,jj) + e3t_n(ji,jj,jk) * z3d(ji,jj,jk) * tmask(ji,jj,jk) 
    345                END DO 
    346             END DO 
    347          END DO 
     300         DO_3D_11_11( 1, jpkm1 ) 
     301            z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * z3d(ji,jj,jk) * tmask(ji,jj,jk) 
     302         END_3D 
    348303         CALL iom_put( "ke_zint", z2d )   ! vertically integrated kinetic energy 
    349304 
    350305      ENDIF 
    351306      ! 
    352       CALL iom_put( "hdiv", hdivn )                  ! Horizontal divergence 
     307      CALL iom_put( "hdiv", hdiv )                  ! Horizontal divergence 
    353308 
    354309      IF ( iom_use("relvor") .OR. iom_use("absvor") .OR. iom_use("potvor") ) THEN 
    355310          
    356311         z3d(:,:,jpk) = 0._wp  
    357          DO jk = 1, jpkm1 
    358             DO jj = 1, jpjm1 
    359                DO ji = 1, fs_jpim1   ! vector opt. 
    360                   z3d(ji,jj,jk) = (  e2v(ji+1,jj  ) * vn(ji+1,jj  ,jk) - e2v(ji,jj) * vn(ji,jj,jk)    & 
    361                      &              - e1u(ji  ,jj+1) * un(ji  ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk)  ) * r1_e1e2f(ji,jj) 
    362                END DO 
    363             END DO 
    364          END DO 
     312         DO_3D_00_00( 1, jpkm1 ) 
     313            z3d(ji,jj,jk) = (   e2v(ji+1,jj  ) * vv(ji+1,jj  ,jk,Kmm) - e2v(ji,jj) * vv(ji,jj,jk,Kmm)    & 
     314               &              - e1u(ji  ,jj+1) * uu(ji  ,jj+1,jk,Kmm) + e1u(ji,jj) * uu(ji,jj,jk,Kmm)  ) * r1_e1e2f(ji,jj) 
     315         END_3D 
    365316         CALL lbc_lnk( 'diawri', z3d, 'F', 1. ) 
    366317         CALL iom_put( "relvor", z3d )                  ! relative vorticity 
    367318 
    368          DO jk = 1, jpkm1 
    369             DO jj = 1, jpj 
    370                DO ji = 1, jpi 
    371                   z3d(ji,jj,jk) = ff_f(ji,jj) + z3d(ji,jj,jk)  
    372                END DO 
    373             END DO 
    374          END DO 
     319         DO_3D_11_11( 1, jpkm1 ) 
     320            z3d(ji,jj,jk) = ff_f(ji,jj) + z3d(ji,jj,jk)  
     321         END_3D 
    375322         CALL iom_put( "absvor", z3d )                  ! absolute vorticity 
    376323 
    377          DO jk = 1, jpkm1 
    378             DO jj = 1, jpjm1 
    379                DO ji = 1, fs_jpim1   ! vector opt. 
    380                   ze3  = (  e3t_n(ji,jj+1,jk)*tmask(ji,jj+1,jk) + e3t_n(ji+1,jj+1,jk)*tmask(ji+1,jj+1,jk)   & 
    381                      &    + e3t_n(ji,jj  ,jk)*tmask(ji,jj  ,jk) + e3t_n(ji+1,jj  ,jk)*tmask(ji+1,jj  ,jk)  ) 
    382                   IF( ze3 /= 0._wp ) THEN   ;   ze3 = 4._wp / ze3 
    383                   ELSE                      ;   ze3 = 0._wp 
    384                   ENDIF 
    385                   z3d(ji,jj,jk) = ze3 * z3d(ji,jj,jk)  
    386                END DO 
    387             END DO 
    388          END DO 
     324         DO_3D_00_00( 1, jpkm1 ) 
     325            ze3  = (  e3t(ji,jj+1,jk,Kmm)*tmask(ji,jj+1,jk) + e3t(ji+1,jj+1,jk,Kmm)*tmask(ji+1,jj+1,jk)   & 
     326               &    + e3t(ji,jj  ,jk,Kmm)*tmask(ji,jj  ,jk) + e3t(ji+1,jj  ,jk,Kmm)*tmask(ji+1,jj  ,jk)  ) 
     327            IF( ze3 /= 0._wp ) THEN   ;   ze3 = 4._wp / ze3 
     328            ELSE                      ;   ze3 = 0._wp 
     329            ENDIF 
     330            z3d(ji,jj,jk) = ze3 * z3d(ji,jj,jk)  
     331         END_3D 
    389332         CALL lbc_lnk( 'diawri', z3d, 'F', 1. ) 
    390333         CALL iom_put( "potvor", z3d )                  ! potential vorticity 
    391334 
    392335      ENDIF 
    393     
    394336      ! 
    395337      IF( iom_use("u_masstr") .OR. iom_use("u_masstr_vint") .OR. iom_use("u_heattr") .OR. iom_use("u_salttr") ) THEN 
     
    397339         z2d(:,:) = 0.e0 
    398340         DO jk = 1, jpkm1 
    399             z3d(:,:,jk) = rau0 * un(:,:,jk) * e2u(:,:) * e3u_n(:,:,jk) * umask(:,:,jk) 
     341            z3d(:,:,jk) = rho0 * uu(:,:,jk,Kmm) * e2u(:,:) * e3u(:,:,jk,Kmm) * umask(:,:,jk) 
    400342            z2d(:,:) = z2d(:,:) + z3d(:,:,jk) 
    401343         END DO 
     
    406348      IF( iom_use("u_heattr") ) THEN 
    407349         z2d(:,:) = 0._wp  
    408          DO jk = 1, jpkm1 
    409             DO jj = 2, jpjm1 
    410                DO ji = fs_2, fs_jpim1   ! vector opt. 
    411                   z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( tsn(ji,jj,jk,jp_tem) + tsn(ji+1,jj,jk,jp_tem) ) 
    412                END DO 
    413             END DO 
    414          END DO 
     350         DO_3D_00_00( 1, jpkm1 ) 
     351            z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji+1,jj,jk,jp_tem,Kmm) ) 
     352         END_3D 
    415353         CALL lbc_lnk( 'diawri', z2d, 'U', -1. ) 
    416354         CALL iom_put( "u_heattr", 0.5*rcp * z2d )    ! heat transport in i-direction 
     
    419357      IF( iom_use("u_salttr") ) THEN 
    420358         z2d(:,:) = 0.e0  
    421          DO jk = 1, jpkm1 
    422             DO jj = 2, jpjm1 
    423                DO ji = fs_2, fs_jpim1   ! vector opt. 
    424                   z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( tsn(ji,jj,jk,jp_sal) + tsn(ji+1,jj,jk,jp_sal) ) 
    425                END DO 
    426             END DO 
    427          END DO 
     359         DO_3D_00_00( 1, jpkm1 ) 
     360            z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji+1,jj,jk,jp_sal,Kmm) ) 
     361         END_3D 
    428362         CALL lbc_lnk( 'diawri', z2d, 'U', -1. ) 
    429363         CALL iom_put( "u_salttr", 0.5 * z2d )        ! heat transport in i-direction 
     
    434368         z3d(:,:,jpk) = 0.e0 
    435369         DO jk = 1, jpkm1 
    436             z3d(:,:,jk) = rau0 * vn(:,:,jk) * e1v(:,:) * e3v_n(:,:,jk) * vmask(:,:,jk) 
     370            z3d(:,:,jk) = rho0 * vv(:,:,jk,Kmm) * e1v(:,:) * e3v(:,:,jk,Kmm) * vmask(:,:,jk) 
    437371         END DO 
    438372         CALL iom_put( "v_masstr", z3d )              ! mass transport in j-direction 
     
    441375      IF( iom_use("v_heattr") ) THEN 
    442376         z2d(:,:) = 0.e0  
    443          DO jk = 1, jpkm1 
    444             DO jj = 2, jpjm1 
    445                DO ji = fs_2, fs_jpim1   ! vector opt. 
    446                   z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( tsn(ji,jj,jk,jp_tem) + tsn(ji,jj+1,jk,jp_tem) ) 
    447                END DO 
    448             END DO 
    449          END DO 
     377         DO_3D_00_00( 1, jpkm1 ) 
     378            z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji,jj+1,jk,jp_tem,Kmm) ) 
     379         END_3D 
    450380         CALL lbc_lnk( 'diawri', z2d, 'V', -1. ) 
    451381         CALL iom_put( "v_heattr", 0.5*rcp * z2d )    !  heat transport in j-direction 
     
    454384      IF( iom_use("v_salttr") ) THEN 
    455385         z2d(:,:) = 0._wp  
    456          DO jk = 1, jpkm1 
    457             DO jj = 2, jpjm1 
    458                DO ji = fs_2, fs_jpim1   ! vector opt. 
    459                   z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( tsn(ji,jj,jk,jp_sal) + tsn(ji,jj+1,jk,jp_sal) ) 
    460                END DO 
    461             END DO 
    462          END DO 
     386         DO_3D_00_00( 1, jpkm1 ) 
     387            z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji,jj+1,jk,jp_sal,Kmm) ) 
     388         END_3D 
    463389         CALL lbc_lnk( 'diawri', z2d, 'V', -1. ) 
    464390         CALL iom_put( "v_salttr", 0.5 * z2d )        !  heat transport in j-direction 
     
    467393      IF( iom_use("tosmint") ) THEN 
    468394         z2d(:,:) = 0._wp 
    469          DO jk = 1, jpkm1 
    470             DO jj = 2, jpjm1 
    471                DO ji = fs_2, fs_jpim1   ! vector opt. 
    472                   z2d(ji,jj) = z2d(ji,jj) + e3t_n(ji,jj,jk) *  tsn(ji,jj,jk,jp_tem) 
    473                END DO 
    474             END DO 
    475          END DO 
     395         DO_3D_00_00( 1, jpkm1 ) 
     396            z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) *  ts(ji,jj,jk,jp_tem,Kmm) 
     397         END_3D 
    476398         CALL lbc_lnk( 'diawri', z2d, 'T', -1. ) 
    477          CALL iom_put( "tosmint", rau0 * z2d )        ! Vertical integral of temperature 
     399         CALL iom_put( "tosmint", rho0 * z2d )        ! Vertical integral of temperature 
    478400      ENDIF 
    479401      IF( iom_use("somint") ) THEN 
    480402         z2d(:,:)=0._wp 
    481          DO jk = 1, jpkm1 
    482             DO jj = 2, jpjm1 
    483                DO ji = fs_2, fs_jpim1   ! vector opt. 
    484                   z2d(ji,jj) = z2d(ji,jj) + e3t_n(ji,jj,jk) * tsn(ji,jj,jk,jp_sal) 
    485                END DO 
    486             END DO 
    487          END DO 
     403         DO_3D_00_00( 1, jpkm1 ) 
     404            z2d(ji,jj) = z2d(ji,jj) + e3t(ji,jj,jk,Kmm) * ts(ji,jj,jk,jp_sal,Kmm) 
     405         END_3D 
    488406         CALL lbc_lnk( 'diawri', z2d, 'T', -1. ) 
    489          CALL iom_put( "somint", rau0 * z2d )         ! Vertical integral of salinity 
     407         CALL iom_put( "somint", rho0 * z2d )         ! Vertical integral of salinity 
    490408      ENDIF 
    491409 
    492410      CALL iom_put( "bn2", rn2 )                      ! Brunt-Vaisala buoyancy frequency (N^2) 
    493411      ! 
    494  
    495       IF (ln_diatmb)   CALL dia_tmb                   ! tmb values  
    496            
    497       IF (ln_dia25h)   CALL dia_25h( kt )             ! 25h averaging 
     412       
     413      IF (ln_dia25h)   CALL dia_25h( kt, Kmm )        ! 25h averaging 
    498414 
    499415      IF( ln_timing )   CALL timing_stop('dia_wri') 
     
    510426      INTEGER, DIMENSION(2) :: ierr 
    511427      !!---------------------------------------------------------------------- 
    512       ierr = 0 
    513       ALLOCATE( ndex_hT(jpi*jpj) , ndex_T(jpi*jpj*jpk) ,     & 
    514          &      ndex_hU(jpi*jpj) , ndex_U(jpi*jpj*jpk) ,     & 
    515          &      ndex_hV(jpi*jpj) , ndex_V(jpi*jpj*jpk) , STAT=ierr(1) ) 
     428      IF( nn_write == -1 ) THEN 
     429         dia_wri_alloc = 0 
     430      ELSE     
     431         ierr = 0 
     432         ALLOCATE( ndex_hT(jpi*jpj) , ndex_T(jpi*jpj*jpk) ,     & 
     433            &      ndex_hU(jpi*jpj) , ndex_U(jpi*jpj*jpk) ,     & 
     434            &      ndex_hV(jpi*jpj) , ndex_V(jpi*jpj*jpk) , STAT=ierr(1) ) 
    516435         ! 
    517       dia_wri_alloc = MAXVAL(ierr) 
    518       CALL mpp_sum( 'diawri', dia_wri_alloc ) 
     436         dia_wri_alloc = MAXVAL(ierr) 
     437         CALL mpp_sum( 'diawri', dia_wri_alloc ) 
     438         ! 
     439      ENDIF 
    519440      ! 
    520441   END FUNCTION dia_wri_alloc 
     442  
     443   INTEGER FUNCTION dia_wri_alloc_abl() 
     444      !!---------------------------------------------------------------------- 
     445     ALLOCATE(   ndex_hA(jpi*jpj), ndex_A (jpi*jpj*jpkam1), STAT=dia_wri_alloc_abl) 
     446      CALL mpp_sum( 'diawri', dia_wri_alloc_abl ) 
     447      ! 
     448   END FUNCTION dia_wri_alloc_abl 
    521449 
    522450    
    523    SUBROUTINE dia_wri( kt ) 
     451   SUBROUTINE dia_wri( kt, Kmm ) 
    524452      !!--------------------------------------------------------------------- 
    525453      !!                  ***  ROUTINE dia_wri  *** 
     
    534462      !!---------------------------------------------------------------------- 
    535463      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     464      INTEGER, INTENT( in ) ::   Kmm  ! ocean time level index 
    536465      ! 
    537466      LOGICAL ::   ll_print = .FALSE.                        ! =T print and flush numout 
     
    541470      INTEGER  ::   ierr                                     ! error code return from allocation 
    542471      INTEGER  ::   iimi, iima, ipk, it, itmod, ijmi, ijma   ! local integers 
     472      INTEGER  ::   ipka                                     ! ABL 
    543473      INTEGER  ::   jn, ierror                               ! local integers 
    544474      REAL(wp) ::   zsto, zout, zmax, zjulian                ! local scalars 
     
    546476      REAL(wp), DIMENSION(jpi,jpj)   :: zw2d       ! 2D workspace 
    547477      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zw3d       ! 3D workspace 
     478      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zw3d_abl   ! ABL 3D workspace 
    548479      !!---------------------------------------------------------------------- 
    549480      ! 
    550481      IF( ninist == 1 ) THEN     !==  Output the initial state and forcings  ==! 
    551          CALL dia_wri_state( 'output.init' ) 
     482         CALL dia_wri_state( Kmm, 'output.init' ) 
    552483         ninist = 0 
    553484      ENDIF 
     
    566497      clop = "x"         ! no use of the mask value (require less cpu time and otherwise the model crashes) 
    567498#if defined key_diainstant 
    568       zsto = nn_write * rdt 
     499      zsto = nn_write * rn_Dt 
    569500      clop = "inst("//TRIM(clop)//")" 
    570501#else 
    571       zsto=rdt 
     502      zsto=rn_Dt 
    572503      clop = "ave("//TRIM(clop)//")" 
    573504#endif 
    574       zout = nn_write * rdt 
    575       zmax = ( nitend - nit000 + 1 ) * rdt 
     505      zout = nn_write * rn_Dt 
     506      zmax = ( nitend - nit000 + 1 ) * rn_Dt 
    576507 
    577508      ! Define indices of the horizontal output zoom and vertical limit storage 
     
    579510      ijmi = 1      ;      ijma = jpj 
    580511      ipk = jpk 
     512      IF(ln_abl) ipka = jpkam1 
    581513 
    582514      ! define time axis 
     
    593525 
    594526         ! Compute julian date from starting date of the run 
    595          CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian ) 
     527         CALL ymds2ju( nyear, nmonth, nday, rn_Dt, zjulian ) 
    596528         zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    597529         IF(lwp)WRITE(numout,*) 
     
    615547         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
    616548            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    617             &          nit000-1, zjulian, rdt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set ) 
     549            &          nit000-1, zjulian, rn_Dt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set ) 
    618550         CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept 
    619551            &           "m", ipk, gdept_1d, nz_T, "down" ) 
     
    651583         CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu 
    652584            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    653             &          nit000-1, zjulian, rdt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set ) 
     585            &          nit000-1, zjulian, rn_Dt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set ) 
    654586         CALL histvert( nid_U, "depthu", "Vertical U levels",      &  ! Vertical grid: gdept 
    655587            &           "m", ipk, gdept_1d, nz_U, "down" ) 
     
    664596         CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv 
    665597            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    666             &          nit000-1, zjulian, rdt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set ) 
     598            &          nit000-1, zjulian, rn_Dt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set ) 
    667599         CALL histvert( nid_V, "depthv", "Vertical V levels",      &  ! Vertical grid : gdept 
    668600            &          "m", ipk, gdept_1d, nz_V, "down" ) 
     
    677609         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
    678610            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    679             &          nit000-1, zjulian, rdt, nh_W, nid_W, domain_id=nidom, snc4chunks=snc4set ) 
     611            &          nit000-1, zjulian, rn_Dt, nh_W, nid_W, domain_id=nidom, snc4chunks=snc4set ) 
    680612         CALL histvert( nid_W, "depthw", "Vertical W levels",      &  ! Vertical grid: gdepw 
    681613            &          "m", ipk, gdepw_1d, nz_W, "down" ) 
    682614 
     615         IF( ln_abl ) THEN  
     616         ! Define the ABL grid FILE ( nid_A ) 
     617            CALL dia_nam( clhstnam, nn_write, 'grid_ABL' ) 
     618            IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
     619            CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
     620               &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
     621               &          nit000-1, zjulian, rn_Dt, nh_A, nid_A, domain_id=nidom, snc4chunks=snc4set ) 
     622            CALL histvert( nid_A, "ght_abl", "Vertical T levels",      &  ! Vertical grid: gdept 
     623               &           "m", ipka, ght_abl(2:jpka), nz_A, "up" ) 
     624            !                                                            ! Index of ocean points 
     625         ALLOCATE( zw3d_abl(jpi,jpj,ipka) )  
     626         zw3d_abl(:,:,:) = 1._wp  
     627         CALL wheneq( jpi*jpj*ipka, zw3d_abl, 1, 1., ndex_A , ndim_A  )      ! volume 
     628            CALL wheneq( jpi*jpj     , zw3d_abl, 1, 1., ndex_hA, ndim_hA )      ! surface 
     629         DEALLOCATE(zw3d_abl) 
     630         ENDIF 
    683631 
    684632         ! Declare all the output fields as NETCDF variables 
     
    690638            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
    691639         IF(  .NOT.ln_linssh  ) THEN 
    692             CALL histdef( nid_T, "vovvle3t", "Level thickness"                    , "m"      ,&  ! e3t_n 
     640            CALL histdef( nid_T, "vovvle3t", "Level thickness"                    , "m"      ,&  ! e3t(:,:,:,Kmm) 
    693641            &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
    694             CALL histdef( nid_T, "vovvldep", "T point depth"                      , "m"      ,&  ! e3t_n 
     642            CALL histdef( nid_T, "vovvldep", "T point depth"                      , "m"      ,&  ! e3t(:,:,:,Kmm) 
    695643            &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
    696             CALL histdef( nid_T, "vovvldef", "Squared level deformation"          , "%^2"    ,&  ! e3t_n 
     644            CALL histdef( nid_T, "vovvldef", "Squared level deformation"          , "%^2"    ,&  ! e3t(:,:,:,Kmm) 
    697645            &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
    698646         ENDIF 
     
    711659            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    712660         IF(  ln_linssh  ) THEN 
    713             CALL histdef( nid_T, "sosst_cd", "Concentration/Dilution term on temperature"     &  ! emp * tsn(:,:,1,jp_tem) 
     661            CALL histdef( nid_T, "sosst_cd", "Concentration/Dilution term on temperature"     &  ! emp * ts(:,:,1,jp_tem,Kmm) 
    714662            &                                                                  , "KgC/m2/s",  &  ! sosst_cd 
    715663            &             jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    716             CALL histdef( nid_T, "sosss_cd", "Concentration/Dilution term on salinity"        &  ! emp * tsn(:,:,1,jp_sal) 
     664            CALL histdef( nid_T, "sosss_cd", "Concentration/Dilution term on salinity"        &  ! emp * ts(:,:,1,jp_sal,Kmm) 
    717665            &                                                                  , "KgPSU/m2/s",&  ! sosss_cd 
    718666            &             jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     
    730678         CALL histdef( nid_T, "sowindsp", "wind speed at 10m"                  , "m/s"    ,   &  ! wndm 
    731679            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    732 ! 
     680         ! 
     681         IF( ln_abl ) THEN 
     682            CALL histdef( nid_A, "t_abl", "Potential Temperature"     , "K"        ,       &  ! t_abl 
     683               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 
     684            CALL histdef( nid_A, "q_abl", "Humidity"                  , "kg/kg"    ,       &  ! q_abl 
     685               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     686            CALL histdef( nid_A, "u_abl", "Atmospheric U-wind   "     , "m/s"        ,     &  ! u_abl 
     687               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 
     688            CALL histdef( nid_A, "v_abl", "Atmospheric V-wind   "     , "m/s"    ,         &  ! v_abl 
     689               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     690            CALL histdef( nid_A, "tke_abl", "Atmospheric TKE   "     , "m2/s2"    ,        &  ! tke_abl 
     691               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     692            CALL histdef( nid_A, "avm_abl", "Atmospheric turbulent viscosity", "m2/s"   ,  &  ! avm_abl 
     693               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     694            CALL histdef( nid_A, "avt_abl", "Atmospheric turbulent diffusivity", "m2/s2",  &  ! avt_abl 
     695               &          jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout )  
     696            CALL histdef( nid_A, "pblh", "Atmospheric boundary layer height "  , "m",      &  ! pblh 
     697               &          jpi, jpj, nh_A,  1  , 1, 1   , -99 , 32, clop, zsto, zout )                  
     698#if defined key_si3 
     699            CALL histdef( nid_A, "oce_frac", "Fraction of open ocean"  , " ",      &  ! ato_i 
     700               &          jpi, jpj, nh_A,  1  , 1, 1   , -99 , 32, clop, zsto, zout ) 
     701#endif 
     702            CALL histend( nid_A, snc4chunks=snc4set ) 
     703         ENDIF 
     704         ! 
    733705         IF( ln_icebergs ) THEN 
    734706            CALL histdef( nid_T, "calving"             , "calving mass input"                       , "kg/s"   , & 
     
    790762 
    791763         !                                                                                      !!! nid_U : 3D 
    792          CALL histdef( nid_U, "vozocrtx", "Zonal Current"                      , "m/s"    ,   &  ! un 
     764         CALL histdef( nid_U, "vozocrtx", "Zonal Current"                      , "m/s"    ,   &  ! uu(:,:,:,Kmm) 
    793765            &          jpi, jpj, nh_U, ipk, 1, ipk, nz_U, 32, clop, zsto, zout ) 
    794766         IF( ln_wave .AND. ln_sdw) THEN 
     
    803775 
    804776         !                                                                                      !!! nid_V : 3D 
    805          CALL histdef( nid_V, "vomecrty", "Meridional Current"                 , "m/s"    ,   &  ! vn 
     777         CALL histdef( nid_V, "vomecrty", "Meridional Current"                 , "m/s"    ,   &  ! vv(:,:,:,Kmm) 
    806778            &          jpi, jpj, nh_V, ipk, 1, ipk, nz_V, 32, clop, zsto, zout ) 
    807779         IF( ln_wave .AND. ln_sdw) THEN 
     
    816788 
    817789         !                                                                                      !!! nid_W : 3D 
    818          CALL histdef( nid_W, "vovecrtz", "Vertical Velocity"                  , "m/s"    ,   &  ! wn 
     790         CALL histdef( nid_W, "vovecrtz", "Vertical Velocity"                  , "m/s"    ,   &  ! ww 
    819791            &          jpi, jpj, nh_W, ipk, 1, ipk, nz_W, 32, clop, zsto, zout ) 
    820792         CALL histdef( nid_W, "votkeavt", "Vertical Eddy Diffusivity"          , "m2/s"   ,   &  ! avt 
     
    854826 
    855827      IF( .NOT.ln_linssh ) THEN 
    856          CALL histwrite( nid_T, "votemper", it, tsn(:,:,:,jp_tem) * e3t_n(:,:,:) , ndim_T , ndex_T  )   ! heat content 
    857          CALL histwrite( nid_T, "vosaline", it, tsn(:,:,:,jp_sal) * e3t_n(:,:,:) , ndim_T , ndex_T  )   ! salt content 
    858          CALL histwrite( nid_T, "sosstsst", it, tsn(:,:,1,jp_tem) * e3t_n(:,:,1) , ndim_hT, ndex_hT )   ! sea surface heat content 
    859          CALL histwrite( nid_T, "sosaline", it, tsn(:,:,1,jp_sal) * e3t_n(:,:,1) , ndim_hT, ndex_hT )   ! sea surface salinity content 
     828         CALL histwrite( nid_T, "votemper", it, ts(:,:,:,jp_tem,Kmm) * e3t(:,:,:,Kmm) , ndim_T , ndex_T  )   ! heat content 
     829         CALL histwrite( nid_T, "vosaline", it, ts(:,:,:,jp_sal,Kmm) * e3t(:,:,:,Kmm) , ndim_T , ndex_T  )   ! salt content 
     830         CALL histwrite( nid_T, "sosstsst", it, ts(:,:,1,jp_tem,Kmm) * e3t(:,:,1,Kmm) , ndim_hT, ndex_hT )   ! sea surface heat content 
     831         CALL histwrite( nid_T, "sosaline", it, ts(:,:,1,jp_sal,Kmm) * e3t(:,:,1,Kmm) , ndim_hT, ndex_hT )   ! sea surface salinity content 
    860832      ELSE 
    861          CALL histwrite( nid_T, "votemper", it, tsn(:,:,:,jp_tem) , ndim_T , ndex_T  )   ! temperature 
    862          CALL histwrite( nid_T, "vosaline", it, tsn(:,:,:,jp_sal) , ndim_T , ndex_T  )   ! salinity 
    863          CALL histwrite( nid_T, "sosstsst", it, tsn(:,:,1,jp_tem) , ndim_hT, ndex_hT )   ! sea surface temperature 
    864          CALL histwrite( nid_T, "sosaline", it, tsn(:,:,1,jp_sal) , ndim_hT, ndex_hT )   ! sea surface salinity 
     833         CALL histwrite( nid_T, "votemper", it, ts(:,:,:,jp_tem,Kmm) , ndim_T , ndex_T  )   ! temperature 
     834         CALL histwrite( nid_T, "vosaline", it, ts(:,:,:,jp_sal,Kmm) , ndim_T , ndex_T  )   ! salinity 
     835         CALL histwrite( nid_T, "sosstsst", it, ts(:,:,1,jp_tem,Kmm) , ndim_hT, ndex_hT )   ! sea surface temperature 
     836         CALL histwrite( nid_T, "sosaline", it, ts(:,:,1,jp_sal,Kmm) , ndim_hT, ndex_hT )   ! sea surface salinity 
    865837      ENDIF 
    866838      IF( .NOT.ln_linssh ) THEN 
    867          zw3d(:,:,:) = ( ( e3t_n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 
    868          CALL histwrite( nid_T, "vovvle3t", it, e3t_n (:,:,:) , ndim_T , ndex_T  )   ! level thickness 
    869          CALL histwrite( nid_T, "vovvldep", it, gdept_n(:,:,:) , ndim_T , ndex_T  )   ! t-point depth 
     839         zw3d(:,:,:) = ( ( e3t(:,:,:,Kmm) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 
     840         CALL histwrite( nid_T, "vovvle3t", it, e3t (:,:,:,Kmm) , ndim_T , ndex_T  )   ! level thickness 
     841         CALL histwrite( nid_T, "vovvldep", it, gdept(:,:,:,Kmm) , ndim_T , ndex_T  )   ! t-point depth 
    870842         CALL histwrite( nid_T, "vovvldef", it, zw3d             , ndim_T , ndex_T  )   ! level thickness deformation 
    871843      ENDIF 
    872       CALL histwrite( nid_T, "sossheig", it, sshn          , ndim_hT, ndex_hT )   ! sea surface height 
     844      CALL histwrite( nid_T, "sossheig", it, ssh(:,:,Kmm)          , ndim_hT, ndex_hT )   ! sea surface height 
    873845      CALL histwrite( nid_T, "sowaflup", it, ( emp-rnf )   , ndim_hT, ndex_hT )   ! upward water flux 
    874846      CALL histwrite( nid_T, "sorunoff", it, rnf           , ndim_hT, ndex_hT )   ! river runoffs 
     
    877849                                                                                  ! in linear free surface case) 
    878850      IF( ln_linssh ) THEN 
    879          zw2d(:,:) = emp (:,:) * tsn(:,:,1,jp_tem) 
     851         zw2d(:,:) = emp (:,:) * ts(:,:,1,jp_tem,Kmm) 
    880852         CALL histwrite( nid_T, "sosst_cd", it, zw2d, ndim_hT, ndex_hT )          ! c/d term on sst 
    881          zw2d(:,:) = emp (:,:) * tsn(:,:,1,jp_sal) 
     853         zw2d(:,:) = emp (:,:) * ts(:,:,1,jp_sal,Kmm) 
    882854         CALL histwrite( nid_T, "sosss_cd", it, zw2d, ndim_hT, ndex_hT )          ! c/d term on sss 
    883855      ENDIF 
     
    888860      CALL histwrite( nid_T, "soicecov", it, fr_i          , ndim_hT, ndex_hT )   ! ice fraction    
    889861      CALL histwrite( nid_T, "sowindsp", it, wndm          , ndim_hT, ndex_hT )   ! wind speed    
    890 ! 
     862      ! 
     863      IF( ln_abl ) THEN  
     864         ALLOCATE( zw3d_abl(jpi,jpj,jpka) ) 
     865         IF( ln_mskland )   THEN  
     866            DO jk=1,jpka 
     867               zw3d_abl(:,:,jk) = tmask(:,:,1) 
     868            END DO        
     869         ELSE 
     870            zw3d_abl(:,:,:) = 1._wp      
     871         ENDIF        
     872         CALL histwrite( nid_A,  "pblh"   , it, pblh(:,:)                  *zw3d_abl(:,:,1     ), ndim_hA, ndex_hA )   ! pblh  
     873         CALL histwrite( nid_A,  "u_abl"  , it, u_abl   (:,:,2:jpka,nt_n  )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! u_abl 
     874         CALL histwrite( nid_A,  "v_abl"  , it, v_abl   (:,:,2:jpka,nt_n  )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! v_abl 
     875         CALL histwrite( nid_A,  "t_abl"  , it, tq_abl  (:,:,2:jpka,nt_n,1)*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! t_abl 
     876         CALL histwrite( nid_A,  "q_abl"  , it, tq_abl  (:,:,2:jpka,nt_n,2)*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! q_abl        
     877         CALL histwrite( nid_A,  "tke_abl", it, tke_abl (:,:,2:jpka,nt_n  )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! tke_abl 
     878         CALL histwrite( nid_A,  "avm_abl", it, avm_abl (:,:,2:jpka       )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! avm_abl 
     879         CALL histwrite( nid_A,  "avt_abl", it, avt_abl (:,:,2:jpka       )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A  )   ! avt_abl  
     880#if defined key_si3 
     881         CALL histwrite( nid_A,  "oce_frac"   , it, ato_i(:,:)                                  , ndim_hA, ndex_hA )   ! ato_i 
     882#endif 
     883         DEALLOCATE(zw3d_abl) 
     884      ENDIF 
     885      ! 
    891886      IF( ln_icebergs ) THEN 
    892887         ! 
     
    915910         CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping 
    916911         CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping 
    917          zw2d(:,:) = erp(:,:) * tsn(:,:,1,jp_sal) * tmask(:,:,1) 
     912         zw2d(:,:) = erp(:,:) * ts(:,:,1,jp_sal,Kmm) * tmask(:,:,1) 
    918913         CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping 
    919914      ENDIF 
     
    928923#endif 
    929924 
    930       CALL histwrite( nid_U, "vozocrtx", it, un            , ndim_U , ndex_U )    ! i-current 
     925      CALL histwrite( nid_U, "vozocrtx", it, uu(:,:,:,Kmm)            , ndim_U , ndex_U )    ! i-current 
    931926      CALL histwrite( nid_U, "sozotaux", it, utau          , ndim_hU, ndex_hU )   ! i-wind stress 
    932927 
    933       CALL histwrite( nid_V, "vomecrty", it, vn            , ndim_V , ndex_V  )   ! j-current 
     928      CALL histwrite( nid_V, "vomecrty", it, vv(:,:,:,Kmm)            , ndim_V , ndex_V  )   ! j-current 
    934929      CALL histwrite( nid_V, "sometauy", it, vtau          , ndim_hV, ndex_hV )   ! j-wind stress 
    935930 
    936       CALL histwrite( nid_W, "vovecrtz", it, wn             , ndim_T, ndex_T )    ! vert. current 
     931      IF( ln_zad_Aimp ) THEN 
     932         CALL histwrite( nid_W, "vovecrtz", it, ww + wi     , ndim_T, ndex_T )    ! vert. current 
     933      ELSE 
     934         CALL histwrite( nid_W, "vovecrtz", it, ww          , ndim_T, ndex_T )    ! vert. current 
     935      ENDIF 
    937936      CALL histwrite( nid_W, "votkeavt", it, avt            , ndim_T, ndex_T )    ! T vert. eddy diff. coef. 
    938937      CALL histwrite( nid_W, "votkeavm", it, avm            , ndim_T, ndex_T )    ! T vert. eddy visc. coef. 
     
    954953         CALL histclo( nid_V ) 
    955954         CALL histclo( nid_W ) 
     955         IF(ln_abl) CALL histclo( nid_A ) 
    956956      ENDIF 
    957957      ! 
     
    961961#endif 
    962962 
    963    SUBROUTINE dia_wri_state( cdfile_name ) 
     963   SUBROUTINE dia_wri_state( Kmm, cdfile_name ) 
    964964      !!--------------------------------------------------------------------- 
    965965      !!                 ***  ROUTINE dia_wri_state  *** 
     
    974974      !!      File 'output.abort.nc' is created in case of abnormal job end 
    975975      !!---------------------------------------------------------------------- 
     976      INTEGER           , INTENT( in ) ::   Kmm              ! time level index 
    976977      CHARACTER (len=* ), INTENT( in ) ::   cdfile_name      ! name of the file created 
    977978      !! 
    978       INTEGER :: inum 
     979      INTEGER :: inum, jk 
    979980      !!---------------------------------------------------------------------- 
    980981      !  
     
    983984      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~   and forcing fields file created ' 
    984985      IF(lwp) WRITE(numout,*) '                and named :', cdfile_name, '...nc' 
    985  
    986 #if defined key_si3 
    987      CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., kdlev = jpl ) 
    988 #else 
    989      CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE. ) 
    990 #endif 
    991  
    992       CALL iom_rstput( 0, 0, inum, 'votemper', tsn(:,:,:,jp_tem) )    ! now temperature 
    993       CALL iom_rstput( 0, 0, inum, 'vosaline', tsn(:,:,:,jp_sal) )    ! now salinity 
    994       CALL iom_rstput( 0, 0, inum, 'sossheig', sshn              )    ! sea surface height 
    995       CALL iom_rstput( 0, 0, inum, 'vozocrtx', un                )    ! now i-velocity 
    996       CALL iom_rstput( 0, 0, inum, 'vomecrty', vn                )    ! now j-velocity 
    997       CALL iom_rstput( 0, 0, inum, 'vovecrtz', wn                )    ! now k-velocity 
     986      ! 
     987      CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE. ) 
     988      ! 
     989      CALL iom_rstput( 0, 0, inum, 'votemper', ts(:,:,:,jp_tem,Kmm) )    ! now temperature 
     990      CALL iom_rstput( 0, 0, inum, 'vosaline', ts(:,:,:,jp_sal,Kmm) )    ! now salinity 
     991      CALL iom_rstput( 0, 0, inum, 'sossheig', ssh(:,:,Kmm)              )    ! sea surface height 
     992      CALL iom_rstput( 0, 0, inum, 'vozocrtx', uu(:,:,:,Kmm)                )    ! now i-velocity 
     993      CALL iom_rstput( 0, 0, inum, 'vomecrty', vv(:,:,:,Kmm)                )    ! now j-velocity 
     994      IF( ln_zad_Aimp ) THEN 
     995         CALL iom_rstput( 0, 0, inum, 'vovecrtz', ww + wi        )    ! now k-velocity 
     996      ELSE 
     997         CALL iom_rstput( 0, 0, inum, 'vovecrtz', ww             )    ! now k-velocity 
     998      ENDIF 
     999      CALL iom_rstput( 0, 0, inum, 'risfdep', risfdep            )    ! now k-velocity 
     1000      CALL iom_rstput( 0, 0, inum, 'ht'     , ht                 )    ! now water column height 
     1001      ! 
     1002      IF ( ln_isf ) THEN 
     1003         IF (ln_isfcav_mlt) THEN 
     1004            CALL iom_rstput( 0, 0, inum, 'fwfisf_cav', fwfisf_cav          )    ! now k-velocity 
     1005            CALL iom_rstput( 0, 0, inum, 'rhisf_cav_tbl', rhisf_tbl_cav    )    ! now k-velocity 
     1006            CALL iom_rstput( 0, 0, inum, 'rfrac_cav_tbl', rfrac_tbl_cav    )    ! now k-velocity 
     1007            CALL iom_rstput( 0, 0, inum, 'misfkb_cav', REAL(misfkb_cav,wp) )    ! now k-velocity 
     1008            CALL iom_rstput( 0, 0, inum, 'misfkt_cav', REAL(misfkt_cav,wp) )    ! now k-velocity 
     1009            CALL iom_rstput( 0, 0, inum, 'mskisf_cav', REAL(mskisf_cav,wp), ktype = jp_i1 ) 
     1010         END IF 
     1011         IF (ln_isfpar_mlt) THEN 
     1012            CALL iom_rstput( 0, 0, inum, 'isfmsk_par', REAL(mskisf_par,wp) )    ! now k-velocity 
     1013            CALL iom_rstput( 0, 0, inum, 'fwfisf_par', fwfisf_par          )    ! now k-velocity 
     1014            CALL iom_rstput( 0, 0, inum, 'rhisf_par_tbl', rhisf_tbl_par    )    ! now k-velocity 
     1015            CALL iom_rstput( 0, 0, inum, 'rfrac_par_tbl', rfrac_tbl_par    )    ! now k-velocity 
     1016            CALL iom_rstput( 0, 0, inum, 'misfkb_par', REAL(misfkb_par,wp) )    ! now k-velocity 
     1017            CALL iom_rstput( 0, 0, inum, 'misfkt_par', REAL(misfkt_par,wp) )    ! now k-velocity 
     1018            CALL iom_rstput( 0, 0, inum, 'mskisf_par', REAL(mskisf_par,wp), ktype = jp_i1 ) 
     1019         END IF 
     1020      END IF 
     1021      ! 
    9981022      IF( ALLOCATED(ahtu) ) THEN 
    9991023         CALL iom_rstput( 0, 0, inum,  'ahtu', ahtu              )    ! aht at u-point 
     
    10111035      CALL iom_rstput( 0, 0, inum, 'sometauy', vtau              )    ! j-wind stress 
    10121036      IF(  .NOT.ln_linssh  ) THEN              
    1013          CALL iom_rstput( 0, 0, inum, 'vovvldep', gdept_n        )    !  T-cell depth  
    1014          CALL iom_rstput( 0, 0, inum, 'vovvle3t', e3t_n          )    !  T-cell thickness   
     1037         CALL iom_rstput( 0, 0, inum, 'vovvldep', gdept(:,:,:,Kmm)        )    !  T-cell depth  
     1038         CALL iom_rstput( 0, 0, inum, 'vovvle3t', e3t(:,:,:,Kmm)          )    !  T-cell thickness   
    10151039      END IF 
    10161040      IF( ln_wave .AND. ln_sdw ) THEN 
     
    10191043         CALL iom_rstput( 0, 0, inum, 'sdvecrtz', wsd            )    ! now StokesDrift k-velocity 
    10201044      ENDIF 
    1021   
     1045      IF ( ln_abl ) THEN 
     1046         CALL iom_rstput ( 0, 0, inum, "uz1_abl",   u_abl(:,:,2,nt_a  ) )   ! now first level i-wind 
     1047         CALL iom_rstput ( 0, 0, inum, "vz1_abl",   v_abl(:,:,2,nt_a  ) )   ! now first level j-wind 
     1048         CALL iom_rstput ( 0, 0, inum, "tz1_abl",  tq_abl(:,:,2,nt_a,1) )   ! now first level temperature 
     1049         CALL iom_rstput ( 0, 0, inum, "qz1_abl",  tq_abl(:,:,2,nt_a,2) )   ! now first level humidity 
     1050      ENDIF 
     1051      ! 
     1052      CALL iom_close( inum ) 
     1053      !  
    10221054#if defined key_si3 
    10231055      IF( nn_ice == 2 ) THEN   ! condition needed in case agrif + ice-model but no-ice in child grid 
     1056         CALL iom_open( TRIM(cdfile_name)//'_ice', inum, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 
    10241057         CALL ice_wri_state( inum ) 
     1058         CALL iom_close( inum ) 
    10251059      ENDIF 
    10261060#endif 
    1027       ! 
    1028       CALL iom_close( inum ) 
    1029       !  
     1061 
    10301062   END SUBROUTINE dia_wri_state 
    10311063 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/MY_SRC/domvvl.F90

    r12178 r12928  
    88   !!            3.3  !  2011-10  (M. Leclair) totally rewrote domvvl: vvl option includes z_star and z_tilde coordinates 
    99   !!            3.6  !  2014-11  (P. Mathiot) add ice shelf capability 
     10   !!            4.1  !  2019-08  (A. Coward, D. Storkey) rename dom_vvl_sf_swp -> dom_vvl_sf_update for new timestepping 
    1011   !!---------------------------------------------------------------------- 
    1112 
     
    1314   !!   dom_vvl_init     : define initial vertical scale factors, depths and column thickness 
    1415   !!   dom_vvl_sf_nxt   : Compute next vertical scale factors 
    15    !!   dom_vvl_sf_swp   : Swap vertical scale factors and update the vertical grid 
     16   !!   dom_vvl_sf_update   : Swap vertical scale factors and update the vertical grid 
    1617   !!   dom_vvl_interpol : Interpolate vertical scale factors from one grid point to another 
    1718   !!   dom_vvl_rst      : read/write restart file 
     
    3637 
    3738   PUBLIC  dom_vvl_init       ! called by domain.F90 
     39   PUBLIC  dom_vvl_zgr        ! called by isfcpl.F90 
    3840   PUBLIC  dom_vvl_sf_nxt     ! called by step.F90 
    39    PUBLIC  dom_vvl_sf_swp     ! called by step.F90 
     41   PUBLIC  dom_vvl_sf_update  ! called by step.F90 
    4042   PUBLIC  dom_vvl_interpol   ! called by dynnxt.F90 
    4143 
     
    6264 
    6365   !! * Substitutions 
    64 #  include "vectopt_loop_substitute.h90" 
     66#  include "do_loop_substitute.h90" 
    6567   !!---------------------------------------------------------------------- 
    6668   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    9395 
    9496 
    95    SUBROUTINE dom_vvl_init 
     97   SUBROUTINE dom_vvl_init( Kbb, Kmm, Kaa ) 
    9698      !!---------------------------------------------------------------------- 
    9799      !!                ***  ROUTINE dom_vvl_init  *** 
     
    102104      !! ** Method  :  - use restart file and/or initialize 
    103105      !!               - interpolate scale factors 
     106      !! 
     107      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     108      !!              - Regrid: e3[u/v](:,:,:,Kmm) 
     109      !!                        e3[u/v](:,:,:,Kmm)        
     110      !!                        e3w(:,:,:,Kmm)            
     111      !!                        e3[u/v]w_b 
     112      !!                        e3[u/v]w_n       
     113      !!                        gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm) and gde3w 
     114      !!              - h(t/u/v)_0 
     115      !!              - frq_rst_e3t and frq_rst_hdv 
     116      !! 
     117      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
     118      !!---------------------------------------------------------------------- 
     119      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     120      ! 
     121      IF(lwp) WRITE(numout,*) 
     122      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
     123      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
     124      ! 
     125      CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
     126      ! 
     127      !                    ! Allocate module arrays 
     128      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
     129      ! 
     130      !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
     131      CALL dom_vvl_rst( nit000, Kbb, Kmm, 'READ' ) 
     132      e3t(:,:,jpk,Kaa) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
     133      ! 
     134      CALL dom_vvl_zgr(Kbb, Kmm, Kaa) ! interpolation scale factor, depth and water column 
     135      ! 
     136   END SUBROUTINE dom_vvl_init 
     137   ! 
     138   SUBROUTINE dom_vvl_zgr(Kbb, Kmm, Kaa) 
     139      !!---------------------------------------------------------------------- 
     140      !!                ***  ROUTINE dom_vvl_init  *** 
     141      !!                    
     142      !! ** Purpose :  Interpolation of all scale factors,  
     143      !!               depths and water column heights 
     144      !! 
     145      !! ** Method  :  - interpolate scale factors 
    104146      !! 
    105147      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     
    115157      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
    116158      !!---------------------------------------------------------------------- 
     159      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     160      !!---------------------------------------------------------------------- 
    117161      INTEGER ::   ji, jj, jk 
    118162      INTEGER ::   ii0, ii1, ij0, ij1 
     
    120164      !!---------------------------------------------------------------------- 
    121165      ! 
    122       IF(lwp) WRITE(numout,*) 
    123       IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
    124       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
    125       ! 
    126       CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
    127       ! 
    128       !                    ! Allocate module arrays 
    129       IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
    130       ! 
    131       !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
    132       CALL dom_vvl_rst( nit000, 'READ' ) 
    133       e3t_a(:,:,jpk) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
    134       ! 
    135166      !                    !== Set of all other vertical scale factors  ==!  (now and before) 
    136167      !                                ! Horizontal interpolation of e3t 
    137       CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' )    ! from T to U 
    138       CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' ) 
    139       CALL dom_vvl_interpol( e3t_b(:,:,:), e3v_b(:,:,:), 'V' )    ! from T to V  
    140       CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' ) 
    141       CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F' )    ! from U to F 
     168      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3u(:,:,:,Kbb), 'U' )    ! from T to U 
     169      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3u(:,:,:,Kmm), 'U' ) 
     170      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3v(:,:,:,Kbb), 'V' )    ! from T to V  
     171      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3v(:,:,:,Kmm), 'V' ) 
     172      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F' )    ! from U to F 
    142173      !                                ! Vertical interpolation of e3t,u,v  
    143       CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  )  ! from T to W 
    144       CALL dom_vvl_interpol( e3t_b(:,:,:), e3w_b (:,:,:), 'W'  ) 
    145       CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' )  ! from U to UW 
    146       CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' ) 
    147       CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' )  ! from V to UW 
    148       CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' ) 
     174      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3w (:,:,:,Kmm), 'W'  )  ! from T to W 
     175      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3w (:,:,:,Kbb), 'W'  ) 
     176      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3uw(:,:,:,Kmm), 'UW' )  ! from U to UW 
     177      CALL dom_vvl_interpol( e3u(:,:,:,Kbb), e3uw(:,:,:,Kbb), 'UW' ) 
     178      CALL dom_vvl_interpol( e3v(:,:,:,Kmm), e3vw(:,:,:,Kmm), 'VW' )  ! from V to UW 
     179      CALL dom_vvl_interpol( e3v(:,:,:,Kbb), e3vw(:,:,:,Kbb), 'VW' ) 
    149180 
    150181      ! We need to define e3[tuv]_a for AGRIF initialisation (should not be a problem for the restartability...) 
    151       e3t_a(:,:,:) = e3t_n(:,:,:) 
    152       e3u_a(:,:,:) = e3u_n(:,:,:) 
    153       e3v_a(:,:,:) = e3v_n(:,:,:) 
     182      e3t(:,:,:,Kaa) = e3t(:,:,:,Kmm) 
     183      e3u(:,:,:,Kaa) = e3u(:,:,:,Kmm) 
     184      e3v(:,:,:,Kaa) = e3v(:,:,:,Kmm) 
    154185      ! 
    155186      !                    !==  depth of t and w-point  ==!   (set the isf depth as it is in the initial timestep) 
    156       gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1)       ! reference to the ocean surface (used for MLD and light penetration) 
    157       gdepw_n(:,:,1) = 0.0_wp 
    158       gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:)  ! reference to a common level z=0 for hpg 
    159       gdept_b(:,:,1) = 0.5_wp * e3w_b(:,:,1) 
    160       gdepw_b(:,:,1) = 0.0_wp 
    161       DO jk = 2, jpk                               ! vertical sum 
    162          DO jj = 1,jpj 
    163             DO ji = 1,jpi 
    164                !    zcoef = tmask - wmask    ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
    165                !                             ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 
    166                !                             ! 0.5 where jk = mikt      
    167 !!gm ???????   BUG ?  gdept_n as well as gde3w_n  does not include the thickness of ISF ?? 
    168                zcoef = ( tmask(ji,jj,jk) - wmask(ji,jj,jk) ) 
    169                gdepw_n(ji,jj,jk) = gdepw_n(ji,jj,jk-1) + e3t_n(ji,jj,jk-1) 
    170                gdept_n(ji,jj,jk) =      zcoef  * ( gdepw_n(ji,jj,jk  ) + 0.5 * e3w_n(ji,jj,jk))  & 
    171                   &                + (1-zcoef) * ( gdept_n(ji,jj,jk-1) +       e3w_n(ji,jj,jk))  
    172                gde3w_n(ji,jj,jk) = gdept_n(ji,jj,jk) - sshn(ji,jj) 
    173                gdepw_b(ji,jj,jk) = gdepw_b(ji,jj,jk-1) + e3t_b(ji,jj,jk-1) 
    174                gdept_b(ji,jj,jk) =      zcoef  * ( gdepw_b(ji,jj,jk  ) + 0.5 * e3w_b(ji,jj,jk))  & 
    175                   &                + (1-zcoef) * ( gdept_b(ji,jj,jk-1) +       e3w_b(ji,jj,jk))  
    176             END DO 
    177          END DO 
     187      gdept(:,:,1,Kmm) = 0.5_wp * e3w(:,:,1,Kmm)       ! reference to the ocean surface (used for MLD and light penetration) 
     188      gdepw(:,:,1,Kmm) = 0.0_wp 
     189      gde3w(:,:,1) = gdept(:,:,1,Kmm) - ssh(:,:,Kmm)  ! reference to a common level z=0 for hpg 
     190      gdept(:,:,1,Kbb) = 0.5_wp * e3w(:,:,1,Kbb) 
     191      gdepw(:,:,1,Kbb) = 0.0_wp 
     192      DO_3D_11_11( 2, jpk ) 
     193         !    zcoef = tmask - wmask    ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     194         !                             ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 
     195         !                             ! 0.5 where jk = mikt      
     196!!gm ???????   BUG ?  gdept(:,:,:,Kmm) as well as gde3w  does not include the thickness of ISF ?? 
     197         zcoef = ( tmask(ji,jj,jk) - wmask(ji,jj,jk) ) 
     198         gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 
     199         gdept(ji,jj,jk,Kmm) =      zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm))  & 
     200            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm))  
     201         gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 
     202         gdepw(ji,jj,jk,Kbb) = gdepw(ji,jj,jk-1,Kbb) + e3t(ji,jj,jk-1,Kbb) 
     203         gdept(ji,jj,jk,Kbb) =      zcoef  * ( gdepw(ji,jj,jk  ,Kbb) + 0.5 * e3w(ji,jj,jk,Kbb))  & 
     204            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kbb) +       e3w(ji,jj,jk,Kbb))  
     205      END_3D 
     206      ! 
     207      !                    !==  thickness of the water column  !!   (ocean portion only) 
     208      ht(:,:) = e3t(:,:,1,Kmm) * tmask(:,:,1)   !!gm  BUG  :  this should be 1/2 * e3w(k=1) .... 
     209      hu(:,:,Kbb) = e3u(:,:,1,Kbb) * umask(:,:,1) 
     210      hu(:,:,Kmm) = e3u(:,:,1,Kmm) * umask(:,:,1) 
     211      hv(:,:,Kbb) = e3v(:,:,1,Kbb) * vmask(:,:,1) 
     212      hv(:,:,Kmm) = e3v(:,:,1,Kmm) * vmask(:,:,1) 
     213      DO jk = 2, jpkm1 
     214         ht(:,:) = ht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
     215         hu(:,:,Kbb) = hu(:,:,Kbb) + e3u(:,:,jk,Kbb) * umask(:,:,jk) 
     216         hu(:,:,Kmm) = hu(:,:,Kmm) + e3u(:,:,jk,Kmm) * umask(:,:,jk) 
     217         hv(:,:,Kbb) = hv(:,:,Kbb) + e3v(:,:,jk,Kbb) * vmask(:,:,jk) 
     218         hv(:,:,Kmm) = hv(:,:,Kmm) + e3v(:,:,jk,Kmm) * vmask(:,:,jk) 
    178219      END DO 
    179220      ! 
    180       !                    !==  thickness of the water column  !!   (ocean portion only) 
    181       ht_n(:,:) = e3t_n(:,:,1) * tmask(:,:,1)   !!gm  BUG  :  this should be 1/2 * e3w(k=1) .... 
    182       hu_b(:,:) = e3u_b(:,:,1) * umask(:,:,1) 
    183       hu_n(:,:) = e3u_n(:,:,1) * umask(:,:,1) 
    184       hv_b(:,:) = e3v_b(:,:,1) * vmask(:,:,1) 
    185       hv_n(:,:) = e3v_n(:,:,1) * vmask(:,:,1) 
    186       DO jk = 2, jpkm1 
    187          ht_n(:,:) = ht_n(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
    188          hu_b(:,:) = hu_b(:,:) + e3u_b(:,:,jk) * umask(:,:,jk) 
    189          hu_n(:,:) = hu_n(:,:) + e3u_n(:,:,jk) * umask(:,:,jk) 
    190          hv_b(:,:) = hv_b(:,:) + e3v_b(:,:,jk) * vmask(:,:,jk) 
    191          hv_n(:,:) = hv_n(:,:) + e3v_n(:,:,jk) * vmask(:,:,jk) 
    192       END DO 
    193       ! 
    194221      !                    !==  inverse of water column thickness   ==!   (u- and v- points) 
    195       r1_hu_b(:,:) = ssumask(:,:) / ( hu_b(:,:) + 1._wp - ssumask(:,:) )    ! _i mask due to ISF 
    196       r1_hu_n(:,:) = ssumask(:,:) / ( hu_n(:,:) + 1._wp - ssumask(:,:) ) 
    197       r1_hv_b(:,:) = ssvmask(:,:) / ( hv_b(:,:) + 1._wp - ssvmask(:,:) ) 
    198       r1_hv_n(:,:) = ssvmask(:,:) / ( hv_n(:,:) + 1._wp - ssvmask(:,:) ) 
     222      r1_hu(:,:,Kbb) = ssumask(:,:) / ( hu(:,:,Kbb) + 1._wp - ssumask(:,:) )    ! _i mask due to ISF 
     223      r1_hu(:,:,Kmm) = ssumask(:,:) / ( hu(:,:,Kmm) + 1._wp - ssumask(:,:) ) 
     224      r1_hv(:,:,Kbb) = ssvmask(:,:) / ( hv(:,:,Kbb) + 1._wp - ssvmask(:,:) ) 
     225      r1_hv(:,:,Kmm) = ssvmask(:,:) / ( hv(:,:,Kmm) + 1._wp - ssvmask(:,:) ) 
    199226 
    200227      !                    !==   z_tilde coordinate case  ==!   (Restoring frequencies) 
     
    208235         IF( ln_vvl_ztilde_as_zstar ) THEN   ! z-star emulation using z-tile 
    209236            frq_rst_e3t(:,:) = 0._wp               !Ignore namelist settings 
    210             frq_rst_hdv(:,:) = 1._wp / rdt 
     237            frq_rst_hdv(:,:) = 1._wp / rn_Dt 
    211238         ENDIF 
    212239         IF ( ln_vvl_zstar_at_eqtor ) THEN   ! use z-star in vicinity of the Equator 
    213             DO jj = 1, jpj 
    214                DO ji = 1, jpi 
     240            DO_2D_11_11 
    215241!!gm  case |gphi| >= 6 degrees is useless   initialized just above by default 
    216                   IF( ABS(gphit(ji,jj)) >= 6.) THEN 
    217                      ! values outside the equatorial band and transition zone (ztilde) 
    218                      frq_rst_e3t(ji,jj) =  2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.e0_wp ) 
    219                      frq_rst_hdv(ji,jj) =  2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.e0_wp ) 
    220                   ELSEIF( ABS(gphit(ji,jj)) <= 2.5) THEN    ! Equator strip ==> z-star 
    221                      ! values inside the equatorial band (ztilde as zstar) 
    222                      frq_rst_e3t(ji,jj) =  0.0_wp 
    223                      frq_rst_hdv(ji,jj) =  1.0_wp / rdt 
    224                   ELSE                                      ! transition band (2.5 to 6 degrees N/S) 
    225                      !                                      ! (linearly transition from z-tilde to z-star) 
    226                      frq_rst_e3t(ji,jj) = 0.0_wp + (frq_rst_e3t(ji,jj)-0.0_wp)*0.5_wp   & 
    227                         &            * (  1.0_wp - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
    228                         &                                          * 180._wp / 3.5_wp ) ) 
    229                      frq_rst_hdv(ji,jj) = (1.0_wp / rdt)                                & 
    230                         &            + (  frq_rst_hdv(ji,jj)-(1.e0_wp / rdt) )*0.5_wp   & 
    231                         &            * (  1._wp  - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
    232                         &                                          * 180._wp / 3.5_wp ) ) 
    233                   ENDIF 
    234                END DO 
    235             END DO 
     242               IF( ABS(gphit(ji,jj)) >= 6.) THEN 
     243                  ! values outside the equatorial band and transition zone (ztilde) 
     244                  frq_rst_e3t(ji,jj) =  2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.e0_wp ) 
     245                  frq_rst_hdv(ji,jj) =  2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.e0_wp ) 
     246               ELSEIF( ABS(gphit(ji,jj)) <= 2.5) THEN    ! Equator strip ==> z-star 
     247                  ! values inside the equatorial band (ztilde as zstar) 
     248                  frq_rst_e3t(ji,jj) =  0.0_wp 
     249                  frq_rst_hdv(ji,jj) =  1.0_wp / rn_Dt 
     250               ELSE                                      ! transition band (2.5 to 6 degrees N/S) 
     251                  !                                      ! (linearly transition from z-tilde to z-star) 
     252                  frq_rst_e3t(ji,jj) = 0.0_wp + (frq_rst_e3t(ji,jj)-0.0_wp)*0.5_wp   & 
     253                     &            * (  1.0_wp - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     254                     &                                          * 180._wp / 3.5_wp ) ) 
     255                  frq_rst_hdv(ji,jj) = (1.0_wp / rn_Dt)                                & 
     256                     &            + (  frq_rst_hdv(ji,jj)-(1.e0_wp / rn_Dt) )*0.5_wp   & 
     257                     &            * (  1._wp  - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     258                     &                                          * 180._wp / 3.5_wp ) ) 
     259               ENDIF 
     260            END_2D 
    236261            IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN 
    237262               IF( nn_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2 
     
    239264                  ij0 = 128   ;   ij1 = 135   ;    
    240265                  frq_rst_e3t( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  0.0_wp 
    241                   frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rdt 
     266                  frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rn_Dt 
    242267               ENDIF 
    243268            ENDIF 
     
    263288      ENDIF 
    264289      ! 
    265    END SUBROUTINE dom_vvl_init 
    266  
    267  
    268    SUBROUTINE dom_vvl_sf_nxt( kt, kcall )  
     290   END SUBROUTINE dom_vvl_zgr 
     291 
     292 
     293   SUBROUTINE dom_vvl_sf_nxt( kt, Kbb, Kmm, Kaa, kcall )  
    269294      !!---------------------------------------------------------------------- 
    270295      !!                ***  ROUTINE dom_vvl_sf_nxt  *** 
     
    288313      !! Reference  : Leclair, M., and Madec, G. 2011, Ocean Modelling. 
    289314      !!---------------------------------------------------------------------- 
    290       INTEGER, INTENT( in )           ::   kt      ! time step 
    291       INTEGER, INTENT( in ), OPTIONAL ::   kcall   ! optional argument indicating call sequence 
     315      INTEGER, INTENT( in )           ::   kt             ! time step 
     316      INTEGER, INTENT( in )           ::   Kbb, Kmm, Kaa  ! time step 
     317      INTEGER, INTENT( in ), OPTIONAL ::   kcall          ! optional argument indicating call sequence 
    292318      ! 
    293319      INTEGER                ::   ji, jj, jk            ! dummy loop indices 
    294320      INTEGER , DIMENSION(3) ::   ijk_max, ijk_min      ! temporary integers 
    295       REAL(wp)               ::   z2dt, z_tmin, z_tmax  ! local scalars 
     321      REAL(wp)               ::   z_tmin, z_tmax        ! local scalars 
    296322      LOGICAL                ::   ll_do_bclinic         ! local logical 
    297323      REAL(wp), DIMENSION(jpi,jpj)     ::   zht, z_scale, zwu, zwv, zhdiv 
     
    321347      !                                                ! --------------------------------------------- ! 
    322348      ! 
    323       z_scale(:,:) = ( ssha(:,:) - sshb(:,:) ) * ssmask(:,:) / ( ht_0(:,:) + sshn(:,:) + 1. - ssmask(:,:) ) 
     349      z_scale(:,:) = ( ssh(:,:,Kaa) - ssh(:,:,Kbb) ) * ssmask(:,:) / ( ht_0(:,:) + ssh(:,:,Kmm) + 1. - ssmask(:,:) ) 
    324350      DO jk = 1, jpkm1 
    325          ! formally this is the same as e3t_a = e3t_0*(1+ssha/ht_0) 
    326          e3t_a(:,:,jk) = e3t_b(:,:,jk) + e3t_n(:,:,jk) * z_scale(:,:) * tmask(:,:,jk) 
     351         ! formally this is the same as e3t(:,:,:,Kaa) = e3t_0*(1+ssha/ht_0) 
     352         e3t(:,:,jk,Kaa) = e3t(:,:,jk,Kbb) + e3t(:,:,jk,Kmm) * z_scale(:,:) * tmask(:,:,jk) 
    327353      END DO 
    328354      ! 
    329       IF( ln_vvl_ztilde .OR. ln_vvl_layer .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
    330          !                                                            ! ------baroclinic part------ ! 
     355      IF( (ln_vvl_ztilde .OR. ln_vvl_layer) .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
     356         !                                                               ! ------baroclinic part------ ! 
    331357         ! I - initialization 
    332358         ! ================== 
     
    337363         zht(:,:)   = 0._wp 
    338364         DO jk = 1, jpkm1 
    339             zhdiv(:,:) = zhdiv(:,:) + e3t_n(:,:,jk) * hdivn(:,:,jk) 
    340             zht  (:,:) = zht  (:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     365            zhdiv(:,:) = zhdiv(:,:) + e3t(:,:,jk,Kmm) * hdiv(:,:,jk) 
     366            zht  (:,:) = zht  (:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    341367         END DO 
    342368         zhdiv(:,:) = zhdiv(:,:) / ( zht(:,:) + 1. - tmask_i(:,:) ) 
     
    347373            IF( kt > nit000 ) THEN 
    348374               DO jk = 1, jpkm1 
    349                   hdiv_lf(:,:,jk) = hdiv_lf(:,:,jk) - rdt * frq_rst_hdv(:,:)   & 
    350                      &          * ( hdiv_lf(:,:,jk) - e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) ) 
     375                  hdiv_lf(:,:,jk) = hdiv_lf(:,:,jk) - rn_Dt * frq_rst_hdv(:,:)   & 
     376                     &          * ( hdiv_lf(:,:,jk) - e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) ) 
    351377               END DO 
    352378            ENDIF 
     
    361387         IF( ln_vvl_ztilde ) THEN     ! z_tilde case 
    362388            DO jk = 1, jpkm1 
    363                tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) - ( e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) - hdiv_lf(:,:,jk) ) 
     389               tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) - ( e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) - hdiv_lf(:,:,jk) ) 
    364390            END DO 
    365391         ELSE                         ! layer case 
    366392            DO jk = 1, jpkm1 
    367                tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) -   e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) * tmask(:,:,jk) 
     393               tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) -   e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) * tmask(:,:,jk) 
    368394            END DO 
    369395         ENDIF 
     
    381407         zwu(:,:) = 0._wp 
    382408         zwv(:,:) = 0._wp 
    383          DO jk = 1, jpkm1        ! a - first derivative: diffusive fluxes 
    384             DO jj = 1, jpjm1 
    385                DO ji = 1, fs_jpim1   ! vector opt. 
    386                   un_td(ji,jj,jk) = rn_ahe3 * umask(ji,jj,jk) * e2_e1u(ji,jj)           & 
    387                      &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji+1,jj  ,jk) ) 
    388                   vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj)           &  
    389                      &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji  ,jj+1,jk) ) 
    390                   zwu(ji,jj) = zwu(ji,jj) + un_td(ji,jj,jk) 
    391                   zwv(ji,jj) = zwv(ji,jj) + vn_td(ji,jj,jk) 
    392                END DO 
    393             END DO 
    394          END DO 
    395          DO jj = 1, jpj          ! b - correction for last oceanic u-v points 
    396             DO ji = 1, jpi 
    397                un_td(ji,jj,mbku(ji,jj)) = un_td(ji,jj,mbku(ji,jj)) - zwu(ji,jj) 
    398                vn_td(ji,jj,mbkv(ji,jj)) = vn_td(ji,jj,mbkv(ji,jj)) - zwv(ji,jj) 
    399             END DO 
    400          END DO 
    401          DO jk = 1, jpkm1        ! c - second derivative: divergence of diffusive fluxes 
    402             DO jj = 2, jpjm1 
    403                DO ji = fs_2, fs_jpim1   ! vector opt. 
    404                   tilde_e3t_a(ji,jj,jk) = tilde_e3t_a(ji,jj,jk) + (   un_td(ji-1,jj  ,jk) - un_td(ji,jj,jk)    & 
    405                      &                                          +     vn_td(ji  ,jj-1,jk) - vn_td(ji,jj,jk)    & 
    406                      &                                            ) * r1_e1e2t(ji,jj) 
    407                END DO 
    408             END DO 
    409          END DO 
     409         DO_3D_10_10( 1, jpkm1 ) 
     410            un_td(ji,jj,jk) = rn_ahe3 * umask(ji,jj,jk) * e2_e1u(ji,jj)           & 
     411               &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji+1,jj  ,jk) ) 
     412            vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj)           &  
     413               &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji  ,jj+1,jk) ) 
     414            zwu(ji,jj) = zwu(ji,jj) + un_td(ji,jj,jk) 
     415            zwv(ji,jj) = zwv(ji,jj) + vn_td(ji,jj,jk) 
     416         END_3D 
     417         DO_2D_11_11 
     418            un_td(ji,jj,mbku(ji,jj)) = un_td(ji,jj,mbku(ji,jj)) - zwu(ji,jj) 
     419            vn_td(ji,jj,mbkv(ji,jj)) = vn_td(ji,jj,mbkv(ji,jj)) - zwv(ji,jj) 
     420         END_2D 
     421         DO_3D_00_00( 1, jpkm1 ) 
     422            tilde_e3t_a(ji,jj,jk) = tilde_e3t_a(ji,jj,jk) + (   un_td(ji-1,jj  ,jk) - un_td(ji,jj,jk)    & 
     423               &                                          +     vn_td(ji  ,jj-1,jk) - vn_td(ji,jj,jk)    & 
     424               &                                            ) * r1_e1e2t(ji,jj) 
     425         END_3D 
    410426         !                       ! d - thickness diffusion transport: boundary conditions 
    411427         !                             (stored for tracer advction and continuity equation) 
     
    414430         ! 4 - Time stepping of baroclinic scale factors 
    415431         ! --------------------------------------------- 
    416          ! Leapfrog time stepping 
    417          ! ~~~~~~~~~~~~~~~~~~~~~~ 
    418          IF( neuler == 0 .AND. kt == nit000 ) THEN 
    419             z2dt =  rdt 
    420          ELSE 
    421             z2dt = 2.0_wp * rdt 
    422          ENDIF 
    423432         CALL lbc_lnk( 'domvvl', tilde_e3t_a(:,:,:), 'T', 1._wp ) 
    424          tilde_e3t_a(:,:,:) = tilde_e3t_b(:,:,:) + z2dt * tmask(:,:,:) * tilde_e3t_a(:,:,:) 
     433         tilde_e3t_a(:,:,:) = tilde_e3t_b(:,:,:) + rDt * tmask(:,:,:) * tilde_e3t_a(:,:,:) 
    425434 
    426435         ! Maximum deformation control 
     
    476485            zht(:,:)  = zht(:,:) + tilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
    477486         END DO 
    478          z_scale(:,:) =  - zht(:,:) / ( ht_0(:,:) + sshn(:,:) + 1. - ssmask(:,:) ) 
     487         z_scale(:,:) =  - zht(:,:) / ( ht_0(:,:) + ssh(:,:,Kmm) + 1. - ssmask(:,:) ) 
    479488         DO jk = 1, jpkm1 
    480             dtilde_e3t_a(:,:,jk) = dtilde_e3t_a(:,:,jk) + e3t_n(:,:,jk) * z_scale(:,:) * tmask(:,:,jk) 
     489            dtilde_e3t_a(:,:,jk) = dtilde_e3t_a(:,:,jk) + e3t(:,:,jk,Kmm) * z_scale(:,:) * tmask(:,:,jk) 
    481490         END DO 
    482491 
     
    486495      !                                           ! ---baroclinic part--------- ! 
    487496         DO jk = 1, jpkm1 
    488             e3t_a(:,:,jk) = e3t_a(:,:,jk) + dtilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
     497            e3t(:,:,jk,Kaa) = e3t(:,:,jk,Kaa) + dtilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
    489498         END DO 
    490499      ENDIF 
     
    501510         zht(:,:) = 0.0_wp 
    502511         DO jk = 1, jpkm1 
    503             zht(:,:) = zht(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
    504          END DO 
    505          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + sshn(:,:) - zht(:,:) ) ) 
     512            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
     513         END DO 
     514         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kmm) - zht(:,:) ) ) 
    506515         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    507          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshn-SUM(e3t_n))) =', z_tmax 
     516         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshn-SUM(e3t(:,:,:,Kmm)))) =', z_tmax 
    508517         ! 
    509518         zht(:,:) = 0.0_wp 
    510519         DO jk = 1, jpkm1 
    511             zht(:,:) = zht(:,:) + e3t_a(:,:,jk) * tmask(:,:,jk) 
    512          END DO 
    513          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssha(:,:) - zht(:,:) ) ) 
     520            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kaa) * tmask(:,:,jk) 
     521         END DO 
     522         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kaa) - zht(:,:) ) ) 
    514523         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    515          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+ssha-SUM(e3t_a))) =', z_tmax 
     524         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+ssha-SUM(e3t(:,:,:,Kaa)))) =', z_tmax 
    516525         ! 
    517526         zht(:,:) = 0.0_wp 
    518527         DO jk = 1, jpkm1 
    519             zht(:,:) = zht(:,:) + e3t_b(:,:,jk) * tmask(:,:,jk) 
    520          END DO 
    521          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + sshb(:,:) - zht(:,:) ) ) 
     528            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kbb) * tmask(:,:,jk) 
     529         END DO 
     530         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kbb) - zht(:,:) ) ) 
    522531         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    523          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshb-SUM(e3t_b))) =', z_tmax 
    524          ! 
    525          z_tmax = MAXVAL( tmask(:,:,1) *  ABS( sshb(:,:) ) ) 
     532         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshb-SUM(e3t(:,:,:,Kbb)))) =', z_tmax 
     533         ! 
     534         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kbb) ) ) 
    526535         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    527          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(sshb))) =', z_tmax 
    528          ! 
    529          z_tmax = MAXVAL( tmask(:,:,1) *  ABS( sshn(:,:) ) ) 
     536         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kbb)))) =', z_tmax 
     537         ! 
     538         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kmm) ) ) 
    530539         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    531          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(sshn))) =', z_tmax 
    532          ! 
    533          z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssha(:,:) ) ) 
     540         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kmm)))) =', z_tmax 
     541         ! 
     542         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kaa) ) ) 
    534543         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    535          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssha))) =', z_tmax 
     544         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kaa)))) =', z_tmax 
    536545      END IF 
    537546 
     
    540549      ! *********************************** ! 
    541550 
    542       CALL dom_vvl_interpol( e3t_a(:,:,:), e3u_a(:,:,:), 'U' ) 
    543       CALL dom_vvl_interpol( e3t_a(:,:,:), e3v_a(:,:,:), 'V' ) 
     551      CALL dom_vvl_interpol( e3t(:,:,:,Kaa), e3u(:,:,:,Kaa), 'U' ) 
     552      CALL dom_vvl_interpol( e3t(:,:,:,Kaa), e3v(:,:,:,Kaa), 'V' ) 
    544553 
    545554      ! *********************************** ! 
     
    547556      ! *********************************** ! 
    548557 
    549       hu_a(:,:) = e3u_a(:,:,1) * umask(:,:,1) 
    550       hv_a(:,:) = e3v_a(:,:,1) * vmask(:,:,1) 
     558      hu(:,:,Kaa) = e3u(:,:,1,Kaa) * umask(:,:,1) 
     559      hv(:,:,Kaa) = e3v(:,:,1,Kaa) * vmask(:,:,1) 
    551560      DO jk = 2, jpkm1 
    552          hu_a(:,:) = hu_a(:,:) + e3u_a(:,:,jk) * umask(:,:,jk) 
    553          hv_a(:,:) = hv_a(:,:) + e3v_a(:,:,jk) * vmask(:,:,jk) 
     561         hu(:,:,Kaa) = hu(:,:,Kaa) + e3u(:,:,jk,Kaa) * umask(:,:,jk) 
     562         hv(:,:,Kaa) = hv(:,:,Kaa) + e3v(:,:,jk,Kaa) * vmask(:,:,jk) 
    554563      END DO 
    555564      !                                        ! Inverse of the local depth 
    556565!!gm BUG ?  don't understand the use of umask_i here ..... 
    557       r1_hu_a(:,:) = ssumask(:,:) / ( hu_a(:,:) + 1._wp - ssumask(:,:) ) 
    558       r1_hv_a(:,:) = ssvmask(:,:) / ( hv_a(:,:) + 1._wp - ssvmask(:,:) ) 
     566      r1_hu(:,:,Kaa) = ssumask(:,:) / ( hu(:,:,Kaa) + 1._wp - ssumask(:,:) ) 
     567      r1_hv(:,:,Kaa) = ssvmask(:,:) / ( hv(:,:,Kaa) + 1._wp - ssvmask(:,:) ) 
    559568      ! 
    560569      IF( ln_timing )   CALL timing_stop('dom_vvl_sf_nxt') 
     
    563572 
    564573 
    565    SUBROUTINE dom_vvl_sf_swp( kt ) 
    566       !!---------------------------------------------------------------------- 
    567       !!                ***  ROUTINE dom_vvl_sf_swp  *** 
     574   SUBROUTINE dom_vvl_sf_update( kt, Kbb, Kmm, Kaa ) 
     575      !!---------------------------------------------------------------------- 
     576      !!                ***  ROUTINE dom_vvl_sf_update  *** 
    568577      !!                    
    569       !! ** Purpose :  compute time filter and swap of scale factors  
     578      !! ** Purpose :  for z tilde case: compute time filter and swap of scale factors  
    570579      !!               compute all depths and related variables for next time step 
    571580      !!               write outputs and restart file 
    572581      !! 
    573       !! ** Method  :  - swap of e3t with trick for volume/tracer conservation 
     582      !! ** Method  :  - swap of e3t with trick for volume/tracer conservation (ONLY FOR Z TILDE CASE) 
    574583      !!               - reconstruct scale factor at other grid points (interpolate) 
    575584      !!               - recompute depths and water height fields 
    576585      !! 
    577       !! ** Action  :  - e3t_(b/n), tilde_e3t_(b/n) and e3(u/v)_n ready for next time step 
     586      !! ** Action  :  - tilde_e3t_(b/n) ready for next time step 
    578587      !!               - Recompute: 
    579588      !!                    e3(u/v)_b        
    580       !!                    e3w_n            
     589      !!                    e3w(:,:,:,Kmm)            
    581590      !!                    e3(u/v)w_b       
    582591      !!                    e3(u/v)w_n       
    583       !!                    gdept_n, gdepw_n  and gde3w_n 
     592      !!                    gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm)  and gde3w 
    584593      !!                    h(u/v) and h(u/v)r 
    585594      !! 
     
    587596      !!              Leclair, M., and G. Madec, 2011, Ocean Modelling. 
    588597      !!---------------------------------------------------------------------- 
    589       INTEGER, INTENT( in ) ::   kt   ! time step 
     598      INTEGER, INTENT( in ) ::   kt              ! time step 
     599      INTEGER, INTENT( in ) ::   Kbb, Kmm, Kaa   ! time level indices 
    590600      ! 
    591601      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     
    595605      IF( ln_linssh )   RETURN      ! No calculation in linear free surface 
    596606      ! 
    597       IF( ln_timing )   CALL timing_start('dom_vvl_sf_swp') 
     607      IF( ln_timing )   CALL timing_start('dom_vvl_sf_update') 
    598608      ! 
    599609      IF( kt == nit000 )   THEN 
    600610         IF(lwp) WRITE(numout,*) 
    601          IF(lwp) WRITE(numout,*) 'dom_vvl_sf_swp : - time filter and swap of scale factors' 
    602          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~   - interpolate scale factors and compute depths for next time step' 
     611         IF(lwp) WRITE(numout,*) 'dom_vvl_sf_update : - interpolate scale factors and compute depths for next time step' 
     612         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~' 
    603613      ENDIF 
    604614      ! 
     
    607617      ! - ML - e3(t/u/v)_b are allready computed in dynnxt. 
    608618      IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN 
    609          IF( neuler == 0 .AND. kt == nit000 ) THEN 
     619         IF( l_1st_euler ) THEN 
    610620            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) 
    611621         ELSE 
    612622            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) &  
    613             &         + atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) ) 
     623            &         + rn_atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) ) 
    614624         ENDIF 
    615625         tilde_e3t_n(:,:,:) = tilde_e3t_a(:,:,:) 
    616626      ENDIF 
    617       gdept_b(:,:,:) = gdept_n(:,:,:) 
    618       gdepw_b(:,:,:) = gdepw_n(:,:,:) 
    619  
    620       e3t_n(:,:,:) = e3t_a(:,:,:) 
    621       e3u_n(:,:,:) = e3u_a(:,:,:) 
    622       e3v_n(:,:,:) = e3v_a(:,:,:) 
    623627 
    624628      ! Compute all missing vertical scale factor and depths 
     
    626630      ! Horizontal scale factor interpolations 
    627631      ! -------------------------------------- 
    628       ! - ML - e3u_b and e3v_b are allready computed in dynnxt 
    629       ! - JC - hu_b, hv_b, hur_b, hvr_b also 
     632      ! - ML - e3u(:,:,:,Kbb) and e3v(:,:,:,Kbb) are already computed in dynnxt 
     633      ! - JC - hu(:,:,:,Kbb), hv(:,:,:,:,Kbb), hur_b, hvr_b also 
    630634       
    631       CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F'  ) 
     635      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F'  ) 
    632636       
    633637      ! Vertical scale factor interpolations 
    634       CALL dom_vvl_interpol( e3t_n(:,:,:),  e3w_n(:,:,:), 'W'  ) 
    635       CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' ) 
    636       CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' ) 
    637       CALL dom_vvl_interpol( e3t_b(:,:,:),  e3w_b(:,:,:), 'W'  ) 
    638       CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' ) 
    639       CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' ) 
     638      CALL dom_vvl_interpol( e3t(:,:,:,Kmm),  e3w(:,:,:,Kmm), 'W'  ) 
     639      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3uw(:,:,:,Kmm), 'UW' ) 
     640      CALL dom_vvl_interpol( e3v(:,:,:,Kmm), e3vw(:,:,:,Kmm), 'VW' ) 
     641      CALL dom_vvl_interpol( e3t(:,:,:,Kbb),  e3w(:,:,:,Kbb), 'W'  ) 
     642      CALL dom_vvl_interpol( e3u(:,:,:,Kbb), e3uw(:,:,:,Kbb), 'UW' ) 
     643      CALL dom_vvl_interpol( e3v(:,:,:,Kbb), e3vw(:,:,:,Kbb), 'VW' ) 
    640644 
    641645      ! t- and w- points depth (set the isf depth as it is in the initial step) 
    642       gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1) 
    643       gdepw_n(:,:,1) = 0.0_wp 
    644       gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:) 
    645       DO jk = 2, jpk 
    646          DO jj = 1,jpj 
    647             DO ji = 1,jpi 
    648               !    zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))   ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
    649                                                                  ! 1 for jk = mikt 
    650                zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
    651                gdepw_n(ji,jj,jk) = gdepw_n(ji,jj,jk-1) + e3t_n(ji,jj,jk-1) 
    652                gdept_n(ji,jj,jk) =    zcoef  * ( gdepw_n(ji,jj,jk  ) + 0.5 * e3w_n(ji,jj,jk) )  & 
    653                    &             + (1-zcoef) * ( gdept_n(ji,jj,jk-1) +       e3w_n(ji,jj,jk) )  
    654                gde3w_n(ji,jj,jk) = gdept_n(ji,jj,jk) - sshn(ji,jj) 
    655             END DO 
    656          END DO 
    657       END DO 
     646      gdept(:,:,1,Kmm) = 0.5_wp * e3w(:,:,1,Kmm) 
     647      gdepw(:,:,1,Kmm) = 0.0_wp 
     648      gde3w(:,:,1) = gdept(:,:,1,Kmm) - ssh(:,:,Kmm) 
     649      DO_3D_11_11( 2, jpk ) 
     650        !    zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))   ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     651                                                           ! 1 for jk = mikt 
     652         zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
     653         gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 
     654         gdept(ji,jj,jk,Kmm) =    zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm) )  & 
     655             &             + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm) )  
     656         gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 
     657      END_3D 
    658658 
    659659      ! Local depth and Inverse of the local depth of the water 
    660660      ! ------------------------------------------------------- 
    661       hu_n(:,:) = hu_a(:,:)   ;   r1_hu_n(:,:) = r1_hu_a(:,:) 
    662       hv_n(:,:) = hv_a(:,:)   ;   r1_hv_n(:,:) = r1_hv_a(:,:) 
    663       ! 
    664       ht_n(:,:) = e3t_n(:,:,1) * tmask(:,:,1) 
     661      ! 
     662      ht(:,:) = e3t(:,:,1,Kmm) * tmask(:,:,1) 
    665663      DO jk = 2, jpkm1 
    666          ht_n(:,:) = ht_n(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     664         ht(:,:) = ht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    667665      END DO 
    668666 
    669667      ! write restart file 
    670668      ! ================== 
    671       IF( lrst_oce  )   CALL dom_vvl_rst( kt, 'WRITE' ) 
    672       ! 
    673       IF( ln_timing )   CALL timing_stop('dom_vvl_sf_swp') 
    674       ! 
    675    END SUBROUTINE dom_vvl_sf_swp 
     669      IF( lrst_oce  )   CALL dom_vvl_rst( kt, Kbb, Kmm, 'WRITE' ) 
     670      ! 
     671      IF( ln_timing )   CALL timing_stop('dom_vvl_sf_update') 
     672      ! 
     673   END SUBROUTINE dom_vvl_sf_update 
    676674 
    677675 
     
    704702         ! 
    705703      CASE( 'U' )                   !* from T- to U-point : hor. surface weighted mean 
    706          DO jk = 1, jpk 
    707             DO jj = 1, jpjm1 
    708                DO ji = 1, fs_jpim1   ! vector opt. 
    709                   pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2u(ji,jj)   & 
    710                      &                       * (   e1e2t(ji  ,jj) * ( pe3_in(ji  ,jj,jk) - e3t_0(ji  ,jj,jk) )     & 
    711                      &                           + e1e2t(ji+1,jj) * ( pe3_in(ji+1,jj,jk) - e3t_0(ji+1,jj,jk) ) ) 
    712                END DO 
    713             END DO 
    714          END DO 
     704         DO_3D_10_10( 1, jpk ) 
     705            pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2u(ji,jj)   & 
     706               &                       * (   e1e2t(ji  ,jj) * ( pe3_in(ji  ,jj,jk) - e3t_0(ji  ,jj,jk) )     & 
     707               &                           + e1e2t(ji+1,jj) * ( pe3_in(ji+1,jj,jk) - e3t_0(ji+1,jj,jk) ) ) 
     708         END_3D 
    715709         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'U', 1._wp ) 
    716710         pe3_out(:,:,:) = pe3_out(:,:,:) + e3u_0(:,:,:) 
    717711         ! 
    718712      CASE( 'V' )                   !* from T- to V-point : hor. surface weighted mean 
    719          DO jk = 1, jpk 
    720             DO jj = 1, jpjm1 
    721                DO ji = 1, fs_jpim1   ! vector opt. 
    722                   pe3_out(ji,jj,jk) = 0.5_wp * ( vmask(ji,jj,jk)  * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2v(ji,jj)   & 
    723                      &                       * (   e1e2t(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3t_0(ji,jj  ,jk) )     & 
    724                      &                           + e1e2t(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3t_0(ji,jj+1,jk) ) ) 
    725                END DO 
    726             END DO 
    727          END DO 
     713         DO_3D_10_10( 1, jpk ) 
     714            pe3_out(ji,jj,jk) = 0.5_wp * ( vmask(ji,jj,jk)  * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2v(ji,jj)   & 
     715               &                       * (   e1e2t(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3t_0(ji,jj  ,jk) )     & 
     716               &                           + e1e2t(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3t_0(ji,jj+1,jk) ) ) 
     717         END_3D 
    728718         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'V', 1._wp ) 
    729719         pe3_out(:,:,:) = pe3_out(:,:,:) + e3v_0(:,:,:) 
    730720         ! 
    731721      CASE( 'F' )                   !* from U-point to F-point : hor. surface weighted mean 
    732          DO jk = 1, jpk 
    733             DO jj = 1, jpjm1 
    734                DO ji = 1, fs_jpim1   ! vector opt. 
    735                   pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * umask(ji,jj+1,jk) * (1.0_wp - zlnwd) + zlnwd ) & 
    736                      &                       *    r1_e1e2f(ji,jj)                                                  & 
    737                      &                       * (   e1e2u(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3u_0(ji,jj  ,jk) )     & 
    738                      &                           + e1e2u(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3u_0(ji,jj+1,jk) ) ) 
    739                END DO 
    740             END DO 
    741          END DO 
     722         DO_3D_10_10( 1, jpk ) 
     723            pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * umask(ji,jj+1,jk) * (1.0_wp - zlnwd) + zlnwd ) & 
     724               &                       *    r1_e1e2f(ji,jj)                                                  & 
     725               &                       * (   e1e2u(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3u_0(ji,jj  ,jk) )     & 
     726               &                           + e1e2u(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3u_0(ji,jj+1,jk) ) ) 
     727         END_3D 
    742728         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'F', 1._wp ) 
    743729         pe3_out(:,:,:) = pe3_out(:,:,:) + e3f_0(:,:,:) 
     
    783769 
    784770 
    785    SUBROUTINE dom_vvl_rst( kt, cdrw ) 
     771   SUBROUTINE dom_vvl_rst( kt, Kbb, Kmm, cdrw ) 
    786772      !!--------------------------------------------------------------------- 
    787773      !!                   ***  ROUTINE dom_vvl_rst  *** 
     
    795781      !!                they are set to 0. 
    796782      !!---------------------------------------------------------------------- 
    797       INTEGER         , INTENT(in) ::   kt     ! ocean time-step 
    798       CHARACTER(len=*), INTENT(in) ::   cdrw   ! "READ"/"WRITE" flag 
     783      INTEGER         , INTENT(in) ::   kt        ! ocean time-step 
     784      INTEGER         , INTENT(in) ::   Kbb, Kmm  ! ocean time level indices 
     785      CHARACTER(len=*), INTENT(in) ::   cdrw      ! "READ"/"WRITE" flag 
    799786      ! 
    800787      INTEGER ::   ji, jj, jk 
     
    806793         IF( ln_rstart ) THEN                   !* Read the restart file 
    807794            CALL rst_read_open                  !  open the restart file if necessary 
    808             CALL iom_get( numror, jpdom_autoglo, 'sshn'   , sshn, ldxios = lrxios    ) 
     795            CALL iom_get( numror, jpdom_autoglo, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    ) 
    809796            ! 
    810797            id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. ) 
     
    813800            id4 = iom_varid( numror, 'tilde_e3t_n', ldstop = .FALSE. ) 
    814801            id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. ) 
     802            ! 
    815803            !                             ! --------- ! 
    816804            !                             ! all cases ! 
    817805            !                             ! --------- ! 
     806            ! 
    818807            IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist 
    819                CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios ) 
    820                CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios ) 
     808               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios ) 
     809               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios ) 
    821810               ! needed to restart if land processor not computed  
    822                IF(lwp) write(numout,*) 'dom_vvl_rst : e3t_b and e3t_n found in restart files' 
     811               IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files' 
    823812               WHERE ( tmask(:,:,:) == 0.0_wp )  
    824                   e3t_n(:,:,:) = e3t_0(:,:,:) 
    825                   e3t_b(:,:,:) = e3t_0(:,:,:) 
     813                  e3t(:,:,:,Kmm) = e3t_0(:,:,:) 
     814                  e3t(:,:,:,Kbb) = e3t_0(:,:,:) 
    826815               END WHERE 
    827                IF( neuler == 0 ) THEN 
    828                   e3t_b(:,:,:) = e3t_n(:,:,:) 
     816               IF( l_1st_euler ) THEN 
     817                  e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
    829818               ENDIF 
    830819            ELSE IF( id1 > 0 ) THEN 
    831                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart files' 
     820               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kmm) not found in restart files' 
    832821               IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.' 
    833                IF(lwp) write(numout,*) 'neuler is forced to 0' 
    834                CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios ) 
    835                e3t_n(:,:,:) = e3t_b(:,:,:) 
    836                neuler = 0 
     822               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
     823               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios ) 
     824               e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb) 
     825               l_1st_euler = .true. 
    837826            ELSE IF( id2 > 0 ) THEN 
    838                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_b not found in restart files' 
     827               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kbb) not found in restart files' 
    839828               IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.' 
    840                IF(lwp) write(numout,*) 'neuler is forced to 0' 
    841                CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios ) 
    842                e3t_b(:,:,:) = e3t_n(:,:,:) 
    843                neuler = 0 
     829               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
     830               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios ) 
     831               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     832               l_1st_euler = .true. 
    844833            ELSE 
    845                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart file' 
     834               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kmm) not found in restart file' 
    846835               IF(lwp) write(numout,*) 'Compute scale factor from sshn' 
    847                IF(lwp) write(numout,*) 'neuler is forced to 0' 
     836               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
    848837               DO jk = 1, jpk 
    849                   e3t_n(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:) ) & 
     838                  e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm) ) & 
    850839                      &                          / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    851840                      &          + e3t_0(:,:,jk)                               * (1._wp -tmask(:,:,jk)) 
    852841               END DO 
    853                e3t_b(:,:,:) = e3t_n(:,:,:) 
    854                neuler = 0 
     842               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     843               l_1st_euler = .true. 
    855844            ENDIF 
    856845            !                             ! ----------- ! 
     
    888877               IF( cn_cfg == 'wad' ) THEN 
    889878                  ! Wetting and drying test case 
    890                   CALL usr_def_istate( gdept_b, tmask, tsb, ub, vb, sshb  ) 
    891                   tsn  (:,:,:,:) = tsb (:,:,:,:)       ! set now values from to before ones 
    892                   sshn (:,:)     = sshb(:,:) 
    893                   un   (:,:,:)   = ub  (:,:,:) 
    894                   vn   (:,:,:)   = vb  (:,:,:) 
     879                  CALL usr_def_istate( gdept(:,:,:,Kbb), tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  ) 
     880                  ts  (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb)       ! set now values from to before ones 
     881                  ssh (:,:,Kmm)     = ssh(:,:,Kbb) 
     882                  uu   (:,:,:,Kmm)   = uu  (:,:,:,Kbb) 
     883                  vv   (:,:,:,Kmm)   = vv  (:,:,:,Kbb) 
    895884               ELSE 
    896885                  ! if not test case 
    897                   sshn(:,:) = -ssh_ref 
    898                   sshb(:,:) = -ssh_ref 
    899  
    900                   DO jj = 1, jpj 
    901                      DO ji = 1, jpi 
    902                         IF( ht_0(ji,jj)-ssh_ref <  rn_wdmin1 ) THEN ! if total depth is less than min depth 
    903  
    904                            sshb(ji,jj) = rn_wdmin1 - (ht_0(ji,jj) ) 
    905                            sshn(ji,jj) = rn_wdmin1 - (ht_0(ji,jj) ) 
    906                            ssha(ji,jj) = rn_wdmin1 - (ht_0(ji,jj) ) 
    907                         ENDIF 
    908                      ENDDO 
    909                   ENDDO 
     886                  ssh(:,:,Kmm) = -ssh_ref 
     887                  ssh(:,:,Kbb) = -ssh_ref 
     888 
     889                  DO_2D_11_11 
     890                     IF( ht_0(ji,jj)-ssh_ref <  rn_wdmin1 ) THEN ! if total depth is less than min depth 
     891                        ssh(ji,jj,Kbb) = rn_wdmin1 - (ht_0(ji,jj) ) 
     892                        ssh(ji,jj,Kmm) = rn_wdmin1 - (ht_0(ji,jj) ) 
     893                     ENDIF 
     894                  END_2D 
    910895               ENDIF !If test case else 
    911896 
    912897               ! Adjust vertical metrics for all wad 
    913898               DO jk = 1, jpk 
    914                   e3t_n(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:)  ) & 
     899                  e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm)  ) & 
    915900                    &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    916901                    &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) ) 
    917902               END DO 
    918                e3t_b(:,:,:) = e3t_n(:,:,:) 
    919  
    920                DO ji = 1, jpi 
    921                   DO jj = 1, jpj 
    922                      IF ( ht_0(ji,jj) .LE. 0.0 .AND. NINT( ssmask(ji,jj) ) .EQ. 1) THEN 
    923                        CALL ctl_stop( 'dom_vvl_rst: ht_0 must be positive at potentially wet points' ) 
    924                      ENDIF 
    925                   END DO  
    926                END DO  
     903               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     904 
     905               DO_2D_11_11 
     906                  IF ( ht_0(ji,jj) .LE. 0.0 .AND. NINT( ssmask(ji,jj) ) .EQ. 1) THEN 
     907                     CALL ctl_stop( 'dom_vvl_rst: ht_0 must be positive at potentially wet points' ) 
     908                  ENDIF 
     909               END_2D 
    927910               ! 
    928911            ELSE 
    929912               ! 
    930                ! usr_def_istate called here only to get sshb, that is needed to initialize e3t_b and e3t_n 
    931                CALL usr_def_istate( gdept_0, tmask, tsb, ub, vb, sshb  )   
    932                ! usr_def_istate will be called again in istate_init to initialize ts(bn), ssh(bn), u(bn) and v(bn) 
     913               ! usr_def_istate called here only to get ssh(Kbb) needed to initialize e3t(Kbb) and e3t(Kmm) 
     914               ! 
     915               CALL usr_def_istate( gdept_0, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )   
     916               ! 
     917               ! usr_def_istate will be called again in istate_init to initialize ts, ssh, u and v 
    933918               ! 
    934919               DO jk=1,jpk 
    935                   e3t_b(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshb(:,:) ) & 
     920                  e3t(:,:,jk,Kbb) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb) ) & 
    936921                    &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    937                     &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )   ! make sure e3t_b != 0 on land points 
     922                    &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )   ! make sure e3t(:,:,:,Kbb) != 0 on land points 
    938923               END DO 
    939                e3t_n(:,:,:) = e3t_b(:,:,:) 
    940                sshn(:,:) = sshb(:,:)   ! needed later for gde3w 
    941 !!$                e3t_n(:,:,:)=e3t_0(:,:,:) 
    942 !!$                e3t_b(:,:,:)=e3t_0(:,:,:) 
     924               e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb) 
     925               ssh(:,:,Kmm) = ssh(:,:,Kbb)                                     ! needed later for gde3w 
    943926               ! 
    944927            END IF           ! end of ll_wd edits 
     
    958941         !                                           ! all cases ! 
    959942         !                                           ! --------- ! 
    960          CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t_b(:,:,:), ldxios = lwxios ) 
    961          CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:), ldxios = lwxios ) 
     943         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lwxios ) 
     944         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lwxios ) 
    962945         !                                           ! ----------------------- ! 
    963946         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases ! 
     
    992975      !!----------------------------------------------------------------------  
    993976      ! 
    994       REWIND( numnam_ref )              ! Namelist nam_vvl in reference namelist :  
    995977      READ  ( numnam_ref, nam_vvl, IOSTAT = ios, ERR = 901) 
    996978901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nam_vvl in reference namelist' ) 
    997       REWIND( numnam_cfg )              ! Namelist nam_vvl in configuration namelist : Parameters of the run 
    998979      READ  ( numnam_cfg, nam_vvl, IOSTAT = ios, ERR = 902 ) 
    999980902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nam_vvl in configuration namelist' ) 
     
    10191000            WRITE(numout,*) '                         rn_rst_e3t     = 0.e0' 
    10201001            WRITE(numout,*) '            hard-wired : z-tilde cutoff frequency of low-pass filter (days)' 
    1021             WRITE(numout,*) '                         rn_lf_cutoff   = 1.0/rdt' 
     1002            WRITE(numout,*) '                         rn_lf_cutoff   = 1.0/rn_Dt' 
    10221003         ELSE 
    10231004            WRITE(numout,*) '      z-tilde to zstar restoration timescale (days)        rn_rst_e3t   = ', rn_rst_e3t 
     
    10341015      ! 
    10351016      IF( ioptio /= 1 )   CALL ctl_stop( 'Choose ONE vertical coordinate in namelist nam_vvl' ) 
    1036       IF( .NOT. ln_vvl_zstar .AND. ln_isf ) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' ) 
    10371017      ! 
    10381018      IF(lwp) THEN                   ! Print the choice 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/MY_SRC/stpctl.F90

    r10572 r12928  
    4242CONTAINS 
    4343 
    44    SUBROUTINE stp_ctl( kt, kindic ) 
     44   SUBROUTINE stp_ctl( kt, Kbb, Kmm, kindic ) 
    4545      !!---------------------------------------------------------------------- 
    4646      !!                    ***  ROUTINE stp_ctl  *** 
     
    6060      !!---------------------------------------------------------------------- 
    6161      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
     62      INTEGER, INTENT(in   ) ::   Kbb, Kmm      ! ocean time level index 
    6263      INTEGER, INTENT(inout) ::   kindic   ! error indicator 
    6364      !! 
     
    7273      ! 
    7374      ll_wrtstp  = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
    74       ll_colruns = ll_wrtstp .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) 
     75      ll_colruns = ll_wrtstp .AND. ( sn_cfctl%l_runstat ) 
    7576      ll_wrtruns = ll_colruns .AND. lwm 
    7677      IF( kt == nit000 .AND. lwp ) THEN 
     
    8283         !                                ! open run.stat file(s) at start whatever 
    8384         !                                ! the value of sn_cfctl%ptimincr 
    84          IF( lwm .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) ) THEN 
     85         IF( lwm .AND. ( sn_cfctl%l_runstat ) ) THEN 
    8586            CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    8687            clname = 'run.stat.nc' 
     
    9697            IF( ln_zad_Aimp ) THEN 
    9798               istatus = NF90_DEF_VAR( idrun,   'abs_wi_max', NF90_DOUBLE, (/ idtime /), idw1  ) 
    98                istatus = NF90_DEF_VAR( idrun,       'Cu_max', NF90_DOUBLE, (/ idtime /), idc1  ) 
     99               istatus = NF90_DEF_VAR( idrun,       'Cf_max', NF90_DOUBLE, (/ idtime /), idc1  ) 
    99100            ENDIF 
    100101            istatus = NF90_ENDDEF(idrun) 
     
    111112      !                                   !==  test of extrema  ==! 
    112113      IF( ll_wd ) THEN 
    113          zmax(1) = MAXVAL(  ABS( sshn(:,:) + ssh_ref*tmask(:,:,1) )  )        ! ssh max  
     114         zmax(1) = MAXVAL(  ABS( ssh(:,:,Kmm) + ssh_ref*tmask(:,:,1) )  )        ! ssh max  
    114115      ELSE 
    115          zmax(1) = MAXVAL(  ABS( sshn(:,:) )  )                               ! ssh max 
    116       ENDIF 
    117       zmax(2) = MAXVAL(  ABS( un(:,:,:) )  )                                  ! velocity max (zonal only) 
    118       zmax(3) = MAXVAL( -tsn(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp )   ! minus salinity max 
    119       zmax(4) = MAXVAL(  tsn(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp )   !       salinity max 
    120       zmax(5) = MAXVAL( -tsn(:,:,:,jp_tem) , mask = tmask(:,:,:) == 1._wp )   ! minus temperature max 
    121       zmax(6) = MAXVAL(  tsn(:,:,:,jp_tem) , mask = tmask(:,:,:) == 1._wp )   !       temperature max 
     116         zmax(1) = MAXVAL(  ABS( ssh(:,:,Kmm) )  )                               ! ssh max 
     117      ENDIF 
     118      zmax(2) = MAXVAL(  ABS( uu(:,:,:,Kmm) )  )                                  ! velocity max (zonal only) 
     119      zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm) , mask = tmask(:,:,:) == 1._wp )   ! minus salinity max 
     120      zmax(4) = MAXVAL(  ts(:,:,:,jp_sal,Kmm) , mask = tmask(:,:,:) == 1._wp )   !       salinity max 
     121      zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm) , mask = tmask(:,:,:) == 1._wp )   ! minus temperature max 
     122      zmax(6) = MAXVAL(  ts(:,:,:,jp_tem,Kmm) , mask = tmask(:,:,:) == 1._wp )   !       temperature max 
    122123      zmax(7) = REAL( nstop , wp )                                            ! stop indicator 
    123124      IF( ln_zad_Aimp ) THEN 
    124125         zmax(8) = MAXVAL(  ABS( wi(:,:,:) ) , mask = wmask(:,:,:) == 1._wp ) ! implicit vertical vel. max 
    125          zmax(9) = MAXVAL(   Cu_adv(:,:,:)   , mask = tmask(:,:,:) == 1._wp ) !       cell Courant no. max 
     126         zmax(9) = MAXVAL(   Cu_adv(:,:,:)   , mask = tmask(:,:,:) == 1._wp ) ! partitioning coeff. max 
    126127      ENDIF 
    127128      ! 
     
    147148      END IF 
    148149      !                                   !==  error handling  ==! 
    149       IF( ( ln_ctl .OR. lsomeoce ) .AND. (   &             ! have use mpp_max (because ln_ctl=.T.) or contains some ocean points 
    150          &  zmax(1) >   50._wp .OR.   &                    ! too large sea surface height ( > 50 m ) 
    151          &  zmax(2) >   20._wp .OR.   &                    ! too large velocity ( > 20 m/s) 
     150      IF( ( sn_cfctl%l_glochk .OR. lsomeoce ) .AND. (   &  ! domain contains some ocean points, check for sensible ranges 
     151         &  zmax(1) >   20._wp .OR.   &                    ! too large sea surface height ( > 20 m ) 
     152         &  zmax(2) >   10._wp .OR.   &                    ! too large velocity ( > 10 m/s) 
    152153!!$         &  zmax(3) >=   0._wp .OR.   &                    ! negative or zero sea surface salinity 
    153154!!$         &  zmax(4) >= 100._wp .OR.   &                    ! too large sea surface salinity ( > 100 ) 
    154155!!$         &  zmax(4) <    0._wp .OR.   &                    ! too large sea surface salinity (keep this line for sea-ice) 
    155156         &  ISNAN( zmax(1) + zmax(2) + zmax(3) ) ) ) THEN   ! NaN encounter in the tests 
    156          IF( lk_mpp .AND. ln_ctl ) THEN 
    157             CALL mpp_maxloc( 'stpctl', ABS(sshn)        , ssmask(:,:)  , zzz, ih  ) 
    158             CALL mpp_maxloc( 'stpctl', ABS(un)          , umask (:,:,:), zzz, iu  ) 
    159             CALL mpp_minloc( 'stpctl', tsn(:,:,:,jp_sal), tmask (:,:,:), zzz, is1 ) 
    160             CALL mpp_maxloc( 'stpctl', tsn(:,:,:,jp_sal), tmask (:,:,:), zzz, is2 ) 
     157         IF( lk_mpp .AND. sn_cfctl%l_glochk ) THEN 
     158            ! have use mpp_max (because sn_cfctl%l_glochk=.T. and distributed) 
     159            CALL mpp_maxloc( 'stpctl', ABS(ssh(:,:,Kmm))        , ssmask(:,:)  , zzz, ih  ) 
     160            CALL mpp_maxloc( 'stpctl', ABS(uu(:,:,:,Kmm))          , umask (:,:,:), zzz, iu  ) 
     161            CALL mpp_minloc( 'stpctl', ts(:,:,:,jp_sal,Kmm), tmask (:,:,:), zzz, is1 ) 
     162            CALL mpp_maxloc( 'stpctl', ts(:,:,:,jp_sal,Kmm), tmask (:,:,:), zzz, is2 ) 
    161163         ELSE 
    162             ih(:)  = MAXLOC( ABS( sshn(:,:)   )                              ) + (/ nimpp - 1, njmpp - 1    /) 
    163             iu(:)  = MAXLOC( ABS( un  (:,:,:) )                              ) + (/ nimpp - 1, njmpp - 1, 0 /) 
    164             is1(:) = MINLOC( tsn(:,:,:,jp_sal), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 
    165             is2(:) = MAXLOC( tsn(:,:,:,jp_sal), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 
     164            ! find local min and max locations 
     165            ih(:)  = MAXLOC( ABS( ssh(:,:,Kmm)   )                              ) + (/ nimpp - 1, njmpp - 1    /) 
     166            iu(:)  = MAXLOC( ABS( uu  (:,:,:,Kmm) )                              ) + (/ nimpp - 1, njmpp - 1, 0 /) 
     167            is1(:) = MINLOC( ts(:,:,:,jp_sal,Kmm), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 
     168            is2(:) = MAXLOC( ts(:,:,:,jp_sal,Kmm), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 
    166169         ENDIF 
    167170          
    168          WRITE(ctmp1,*) ' stp_ctl: |ssh| > 50 m  or  |U| > 20 m/s  or  NaN encounter in the tests' 
     171         WRITE(ctmp1,*) ' stp_ctl: |ssh| > 20 m  or  |U| > 10 m/s  or  S <= 0  or  S >= 100  or  NaN encounter in the tests' 
    169172         WRITE(ctmp2,9100) kt,   zmax(1), ih(1) , ih(2) 
    170173         WRITE(ctmp3,9200) kt,   zmax(2), iu(1) , iu(2) , iu(3) 
     
    173176         WRITE(ctmp6,*) '      ===> output of last computed fields in output.abort.nc file' 
    174177          
    175          CALL dia_wri_state( 'output.abort' )     ! create an output.abort file 
     178         CALL dia_wri_state( Kmm, 'output.abort' )     ! create an output.abort file 
    176179          
    177          IF( .NOT. ln_ctl ) THEN 
     180         IF( .NOT. sn_cfctl%l_glochk ) THEN 
    178181            WRITE(ctmp8,*) 'E R R O R message from sub-domain: ', narea 
    179182            CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp8, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ctmp6 ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/MY_SRC/trazdf.F90

    r10572 r12928  
    3636 
    3737   !! * Substitutions 
    38 #  include "vectopt_loop_substitute.h90" 
     38#  include "do_loop_substitute.h90" 
    3939   !!---------------------------------------------------------------------- 
    4040   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4444CONTAINS 
    4545 
    46    SUBROUTINE tra_zdf( kt ) 
     46   SUBROUTINE tra_zdf( kt, Kbb, Kmm, Krhs, pts, Kaa ) 
    4747      !!---------------------------------------------------------------------- 
    4848      !!                  ***  ROUTINE tra_zdf  *** 
     
    5050      !! ** Purpose :   compute the vertical ocean tracer physics. 
    5151      !!--------------------------------------------------------------------- 
    52       INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     52      INTEGER                                  , INTENT(in)    :: kt                  ! ocean time-step index 
     53      INTEGER                                  , INTENT(in)    :: Kbb, Kmm, Krhs, Kaa ! time level indices 
     54      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts                 ! active tracers and RHS of tracer equation 
    5355      ! 
    5456      INTEGER  ::   jk   ! Dummy loop indices 
     
    6466      ENDIF 
    6567      ! 
    66       IF( neuler == 0 .AND. kt == nit000 ) THEN   ;   r2dt =      rdt   ! at nit000, =   rdt (restarting with Euler time stepping) 
    67       ELSEIF( kt <= nit000 + 1           ) THEN   ;   r2dt = 2. * rdt   ! otherwise, = 2 rdt (leapfrog) 
    68       ENDIF 
    69       ! 
    7068      IF( l_trdtra )   THEN                  !* Save ta and sa trends 
    7169         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
    72          ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
    73          ztrds(:,:,:) = tsa(:,:,:,jp_sal) 
     70         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 
     71         ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa) 
    7472      ENDIF 
    7573      ! 
    7674      !                                      !* compute lateral mixing trend and add it to the general trend 
    77       CALL tra_zdf_imp( kt, nit000, 'TRA', r2dt, tsb, tsa, jpts )  
     75      CALL tra_zdf_imp( kt, nit000, 'TRA', rDt, Kbb, Kmm, Krhs, pts, Kaa, jpts )  
    7876 
    7977!!gm WHY here !   and I don't like that ! 
     
    8179      ! JMM avoid negative salinities near river outlet ! Ugly fix 
    8280      ! JMM : restore negative salinities to small salinities: 
    83 !!$      WHERE( tsa(:,:,:,jp_sal) < 0._wp )   tsa(:,:,:,jp_sal) = 0.1_wp 
     81!!$      WHERE( pts(:,:,:,jp_sal,Kaa) < 0._wp )   pts(:,:,:,jp_sal,Kaa) = 0.1_wp 
    8482!!gm 
    8583 
    8684      IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics 
    8785         DO jk = 1, jpkm1 
    88             ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem)*e3t_a(:,:,jk) - tsb(:,:,jk,jp_tem)*e3t_b(:,:,jk) ) & 
    89                &          / (e3t_n(:,:,jk)*r2dt) ) - ztrdt(:,:,jk) 
    90             ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal)*e3t_a(:,:,jk) - tsb(:,:,jk,jp_sal)*e3t_b(:,:,jk) ) & 
    91               &           / (e3t_n(:,:,jk)*r2dt) ) - ztrds(:,:,jk) 
     86            ztrdt(:,:,jk) = ( ( pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa) - pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb) ) & 
     87               &          / (e3t(:,:,jk,Kmm)*rDt) ) - ztrdt(:,:,jk) 
     88            ztrds(:,:,jk) = ( ( pts(:,:,jk,jp_sal,Kaa)*e3t(:,:,jk,Kaa) - pts(:,:,jk,jp_sal,Kbb)*e3t(:,:,jk,Kbb) ) & 
     89              &           / (e3t(:,:,jk,Kmm)*rDt) ) - ztrds(:,:,jk) 
    9290         END DO 
    9391!!gm this should be moved in trdtra.F90 and done on all trends 
    9492         CALL lbc_lnk_multi( 'trazdf', ztrdt, 'T', 1. , ztrds, 'T', 1. ) 
    9593!!gm 
    96          CALL trd_tra( kt, 'TRA', jp_tem, jptra_zdf, ztrdt ) 
    97          CALL trd_tra( kt, 'TRA', jp_sal, jptra_zdf, ztrds ) 
     94         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 
     95         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_zdf, ztrds ) 
    9896         DEALLOCATE( ztrdt , ztrds ) 
    9997      ENDIF 
    10098      !                                          ! print mean trends (used for debugging) 
    101       IF(ln_ctl)   CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' zdf  - Ta: ', mask1=tmask,               & 
    102          &                       tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
     99      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Kaa), clinfo1=' zdf  - Ta: ', mask1=tmask,               & 
     100         &                                  tab3d_2=pts(:,:,:,jp_sal,Kaa), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    103101      ! 
    104102      IF( ln_timing )   CALL timing_stop('tra_zdf') 
     
    107105 
    108106  
    109    SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, ptb, pta, kjpt )  
     107   SUBROUTINE tra_zdf_imp( kt, kit000, cdtype, p2dt, Kbb, Kmm, Krhs, pt, Kaa, kjpt )  
    110108      !!---------------------------------------------------------------------- 
    111109      !!                  ***  ROUTINE tra_zdf_imp  *** 
     
    125123      !!      If iso-neutral mixing, add to avt the contribution due to lateral mixing. 
    126124      !! 
    127       !! ** Action  : - pta  becomes the after tracer 
    128       !!--------------------------------------------------------------------- 
    129       INTEGER                              , INTENT(in   ) ::   kt       ! ocean time-step index 
    130       INTEGER                              , INTENT(in   ) ::   kit000   ! first time step index 
    131       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator) 
    132       INTEGER                              , INTENT(in   ) ::   kjpt     ! number of tracers 
    133       REAL(wp)                             , INTENT(in   ) ::   p2dt     ! tracer time-step 
    134       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb      ! before and now tracer fields 
    135       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta      ! in: tracer trend ; out: after tracer field 
     125      !! ** Action  : - pt(:,:,:,:,Kaa)  becomes the after tracer 
     126      !!--------------------------------------------------------------------- 
     127      INTEGER                                  , INTENT(in   ) ::   kt       ! ocean time-step index 
     128      INTEGER                                  , INTENT(in   ) ::   Kbb, Kmm, Krhs, Kaa  ! ocean time level indices 
     129      INTEGER                                  , INTENT(in   ) ::   kit000   ! first time step index 
     130      CHARACTER(len=3)                         , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator) 
     131      INTEGER                                  , INTENT(in   ) ::   kjpt     ! number of tracers 
     132      REAL(wp)                                 , INTENT(in   ) ::   p2dt     ! tracer time-step 
     133      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt       ! tracers and RHS of tracer equation 
    136134      ! 
    137135      INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices 
     
    158156            IF( l_ldfslp ) THEN            ! isoneutral diffusion: add the contribution  
    159157               IF( ln_traldf_msc  ) THEN     ! MSC iso-neutral operator  
    160                   DO jk = 2, jpkm1 
    161                      DO jj = 2, jpjm1 
    162                         DO ji = fs_2, fs_jpim1   ! vector opt. 
    163                            zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk)   
    164                         END DO 
    165                      END DO 
    166                   END DO 
     158                  DO_3D_00_00( 2, jpkm1 ) 
     159                     zwt(ji,jj,jk) = zwt(ji,jj,jk) + akz(ji,jj,jk)   
     160                  END_3D 
    167161               ELSE                          ! standard or triad iso-neutral operator 
    168                   DO jk = 2, jpkm1 
    169                      DO jj = 2, jpjm1 
    170                         DO ji = fs_2, fs_jpim1   ! vector opt. 
    171                            zwt(ji,jj,jk) = zwt(ji,jj,jk) + ah_wslp2(ji,jj,jk) 
    172                         END DO 
    173                      END DO 
    174                   END DO 
     162                  DO_3D_00_00( 2, jpkm1 ) 
     163                     zwt(ji,jj,jk) = zwt(ji,jj,jk) + ah_wslp2(ji,jj,jk) 
     164                  END_3D 
    175165               ENDIF 
    176166            ENDIF 
     
    178168            ! Diagonal, lower (i), upper (s)  (including the bottom boundary condition since avt is masked) 
    179169            IF( ln_zad_Aimp ) THEN         ! Adaptive implicit vertical advection 
    180                DO jk = 1, jpkm1 
    181                   DO jj = 2, jpjm1 
    182                      DO ji = fs_2, fs_jpim1   ! vector opt. (ensure same order of calculation as below if wi=0.) 
    183                         zzwi = - p2dt * zwt(ji,jj,jk  ) / e3w_n(ji,jj,jk  ) 
    184                         zzws = - p2dt * zwt(ji,jj,jk+1) / e3w_n(ji,jj,jk+1) 
    185                         zwd(ji,jj,jk) = e3t_a(ji,jj,jk) - zzwi - zzws   & 
    186                            &                 + p2dt * ( MAX( wi(ji,jj,jk  ) , 0._wp ) - MIN( wi(ji,jj,jk+1) , 0._wp ) ) 
    187                         zwi(ji,jj,jk) = zzwi + p2dt *   MIN( wi(ji,jj,jk  ) , 0._wp ) 
    188                         zws(ji,jj,jk) = zzws - p2dt *   MAX( wi(ji,jj,jk+1) , 0._wp ) 
    189                     END DO 
    190                   END DO 
    191                END DO 
     170               DO_3D_00_00( 1, jpkm1 ) 
     171                  zzwi = - p2dt * zwt(ji,jj,jk  ) / e3w(ji,jj,jk  ,Kmm) 
     172                  zzws = - p2dt * zwt(ji,jj,jk+1) / e3w(ji,jj,jk+1,Kmm) 
     173                  zwd(ji,jj,jk) = e3t(ji,jj,jk,Kaa) - zzwi - zzws   & 
     174                     &                 + p2dt * ( MAX( wi(ji,jj,jk  ) , 0._wp ) - MIN( wi(ji,jj,jk+1) , 0._wp ) ) 
     175                  zwi(ji,jj,jk) = zzwi + p2dt *   MIN( wi(ji,jj,jk  ) , 0._wp ) 
     176                  zws(ji,jj,jk) = zzws - p2dt *   MAX( wi(ji,jj,jk+1) , 0._wp ) 
     177               END_3D 
    192178            ELSE 
    193                DO jk = 1, jpkm1 
    194                   DO jj = 2, jpjm1 
    195                      DO ji = fs_2, fs_jpim1   ! vector opt. 
    196                         zwi(ji,jj,jk) = - p2dt * zwt(ji,jj,jk  ) / e3w_n(ji,jj,jk) 
    197                         zws(ji,jj,jk) = - p2dt * zwt(ji,jj,jk+1) / e3w_n(ji,jj,jk+1) 
    198                         zwd(ji,jj,jk) = e3t_a(ji,jj,jk) - zwi(ji,jj,jk) - zws(ji,jj,jk) 
    199                     END DO 
    200                   END DO 
    201                END DO 
     179               DO_3D_00_00( 1, jpkm1 ) 
     180                  zwi(ji,jj,jk) = - p2dt * zwt(ji,jj,jk  ) / e3w(ji,jj,jk,Kmm) 
     181                  zws(ji,jj,jk) = - p2dt * zwt(ji,jj,jk+1) / e3w(ji,jj,jk+1,Kmm) 
     182                  zwd(ji,jj,jk) = e3t(ji,jj,jk,Kaa) - zwi(ji,jj,jk) - zws(ji,jj,jk) 
     183               END_3D 
    202184            ENDIF 
    203185            ! 
     
    218200            !   The solution will be in the 4d array pta. 
    219201            !   The 3d array zwt is used as a work space array. 
    220             !   En route to the solution pta is used a to evaluate the rhs and then  
     202            !   En route to the solution pt(:,:,:,:,Kaa) is used a to evaluate the rhs and then  
    221203            !   used as a work space array: its value is modified. 
    222204            ! 
    223             DO jj = 2, jpjm1        !* 1st recurrence:   Tk = Dk - Ik Sk-1 / Tk-1   (increasing k) 
    224                DO ji = fs_2, fs_jpim1            ! done one for all passive tracers (so included in the IF instruction) 
    225                   zwt(ji,jj,1) = zwd(ji,jj,1) 
    226                END DO 
    227             END DO 
    228             DO jk = 2, jpkm1 
    229                DO jj = 2, jpjm1 
    230                   DO ji = fs_2, fs_jpim1 
    231                      zwt(ji,jj,jk) = zwd(ji,jj,jk) - zwi(ji,jj,jk) * zws(ji,jj,jk-1) / zwt(ji,jj,jk-1) 
    232                   END DO 
    233                END DO 
    234             END DO 
     205            DO_2D_00_00 
     206               zwt(ji,jj,1) = zwd(ji,jj,1) 
     207            END_2D 
     208            DO_3D_00_00( 2, jpkm1 ) 
     209               zwt(ji,jj,jk) = zwd(ji,jj,jk) - zwi(ji,jj,jk) * zws(ji,jj,jk-1) / zwt(ji,jj,jk-1) 
     210            END_3D 
    235211            ! 
    236212         ENDIF  
    237213         !          
    238          DO jj = 2, jpjm1           !* 2nd recurrence:    Zk = Yk - Ik / Tk-1  Zk-1 
    239             DO ji = fs_2, fs_jpim1 
    240                pta(ji,jj,1,jn) = e3t_b(ji,jj,1) * ptb(ji,jj,1,jn) + p2dt * e3t_n(ji,jj,1) * pta(ji,jj,1,jn) 
    241             END DO 
    242          END DO 
    243          DO jk = 2, jpkm1 
    244             DO jj = 2, jpjm1 
    245                DO ji = fs_2, fs_jpim1 
    246                   zrhs = e3t_b(ji,jj,jk) * ptb(ji,jj,jk,jn) + p2dt * e3t_n(ji,jj,jk) * pta(ji,jj,jk,jn)   ! zrhs=right hand side 
    247                   pta(ji,jj,jk,jn) = zrhs - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) * pta(ji,jj,jk-1,jn) 
    248                END DO 
    249             END DO 
    250          END DO 
     214         DO_2D_00_00 
     215            pt(ji,jj,1,jn,Kaa) = e3t(ji,jj,1,Kbb) * pt(ji,jj,1,jn,Kbb) + p2dt * e3t(ji,jj,1,Kmm) * pt(ji,jj,1,jn,Krhs) 
     216         END_2D 
     217         DO_3D_00_00( 2, jpkm1 ) 
     218            zrhs = e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb) + p2dt * e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk,jn,Krhs)   ! zrhs=right hand side 
     219            pt(ji,jj,jk,jn,Kaa) = zrhs - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) * pt(ji,jj,jk-1,jn,Kaa) 
     220         END_3D 
    251221         ! 
    252          DO jj = 2, jpjm1           !* 3d recurrence:    Xk = (Zk - Sk Xk+1 ) / Tk   (result is the after tracer) 
    253             DO ji = fs_2, fs_jpim1 
    254                pta(ji,jj,jpkm1,jn) = pta(ji,jj,jpkm1,jn) / zwt(ji,jj,jpkm1) * tmask(ji,jj,jpkm1) 
    255             END DO 
    256          END DO 
    257          DO jk = jpk-2, 1, -1 
    258             DO jj = 2, jpjm1 
    259                DO ji = fs_2, fs_jpim1 
    260                   pta(ji,jj,jk,jn) = ( pta(ji,jj,jk,jn) - zws(ji,jj,jk) * pta(ji,jj,jk+1,jn) )   & 
    261                      &             / zwt(ji,jj,jk) * tmask(ji,jj,jk) 
    262                END DO 
    263             END DO 
    264          END DO 
     222         DO_2D_00_00 
     223            pt(ji,jj,jpkm1,jn,Kaa) = pt(ji,jj,jpkm1,jn,Kaa) / zwt(ji,jj,jpkm1) * tmask(ji,jj,jpkm1) 
     224         END_2D 
     225         DO_3DS_00_00( jpk-2, 1, -1 ) 
     226            pt(ji,jj,jk,jn,Kaa) = ( pt(ji,jj,jk,jn,Kaa) - zws(ji,jj,jk) * pt(ji,jj,jk+1,jn,Kaa) )   & 
     227               &             / zwt(ji,jj,jk) * tmask(ji,jj,jk) 
     228         END_3D 
    265229         !                                            ! ================= ! 
    266230      END DO                                          !  end tracer loop  ! 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/MY_SRC/usrdef_hgr.F90

    r10074 r12928  
    2626   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2727 
     28   !! * Substitutions 
     29#  include "do_loop_substitute.h90" 
    2830   !!---------------------------------------------------------------------- 
    2931   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    8890#endif 
    8991          
    90       DO jj = 1, jpj 
    91          DO ji = 1, jpi 
    92             zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
    93             zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
    94  
    95             plamt(ji,jj) = zlam0 + rn_dx * zti 
    96             plamu(ji,jj) = zlam0 + rn_dx * zui 
    97             plamv(ji,jj) = plamt(ji,jj)  
    98             plamf(ji,jj) = plamu(ji,jj)  
    99     
    100             pphit(ji,jj) = zphi0 + rn_dy * ztj 
    101             pphiv(ji,jj) = zphi0 + rn_dy * zvj 
    102             pphiu(ji,jj) = pphit(ji,jj)  
    103             pphif(ji,jj) = pphiv(ji,jj)  
    104          END DO 
    105       END DO 
     92      DO_2D_11_11 
     93         zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
     94         zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
     95          
     96         plamt(ji,jj) = zlam0 + rn_dx * zti 
     97         plamu(ji,jj) = zlam0 + rn_dx * zui 
     98         plamv(ji,jj) = plamt(ji,jj)  
     99         plamf(ji,jj) = plamu(ji,jj)  
     100          
     101         pphit(ji,jj) = zphi0 + rn_dy * ztj 
     102         pphiv(ji,jj) = zphi0 + rn_dy * zvj 
     103         pphiu(ji,jj) = pphit(ji,jj)  
     104         pphif(ji,jj) = pphiv(ji,jj)  
     105      END_2D 
    106106      !      
    107107      ! Horizontal scale factors (in meters) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/MY_SRC/usrdef_istate.F90

    r10425 r12928  
    2828   PUBLIC   usr_def_istate   ! called by istate.F90 
    2929 
     30   !! * Substitutions 
     31#  include "do_loop_substitute.h90" 
    3032   !!---------------------------------------------------------------------- 
    3133   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    164166         pssh(:,1) = - ff_t(:,1) / grav * pu(:,1,1) * e2t(:,1) 
    165167         DO jl=1, jpnj 
    166             DO jj=nldj, nlej 
    167                DO ji=nldi, nlei 
    168                   pssh(ji,jj) = pssh(ji,jj-1) - ff_t(ji,jj) / grav * pu(ji,jj,1) * e2t(ji,jj) 
    169                END DO 
    170             END DO 
     168            DO_2D_00_00 
     169               pssh(ji,jj) = pssh(ji,jj-1) - ff_t(ji,jj) / grav * pu(ji,jj,1) * e2t(ji,jj) 
     170            END_2D 
    171171            CALL lbc_lnk( 'usrdef_istate', pssh, 'T',  1. ) 
    172172         END DO 
     
    183183      CASE(4)    ! geostrophic zonal pulse 
    184184    
    185          DO jj=1, jpj 
    186             DO ji=1, jpi 
    187                IF ( ABS(glamt(ji,jj)) <= zjetx ) THEN 
    188                   zdu = rn_uzonal 
    189                ELSEIF ( ABS(glamt(ji,jj)) <= zjetx + 100. ) THEN 
    190                   zdu = rn_uzonal * ( ( zjetx-ABS(glamt(ji,jj)) )/100. + 1. ) 
    191                ELSE 
    192                   zdu = 0. 
    193                END IF 
    194                IF ( ABS(gphit(ji,jj)) <= zjety ) THEN 
    195                   pssh(ji,jj) = - ff_t(ji,jj) * zdu * gphit(ji,jj) * 1.e3 / grav 
    196                   pu(ji,jj,:) = zdu 
    197                   pts(ji,jj,:,jp_sal) = zdu / rn_uzonal + 1. 
    198                ELSE 
    199                   pssh(ji,jj) = - ff_t(ji,jj) * zdu * SIGN(zjety,gphit(ji,jj)) * 1.e3 / grav  
    200                   pu(ji,jj,:) = 0. 
    201                   pts(ji,jj,:,jp_sal) = 1. 
    202                END IF 
    203             END DO 
    204          END DO 
     185         DO_2D_11_11 
     186            IF ( ABS(glamt(ji,jj)) <= zjetx ) THEN 
     187               zdu = rn_uzonal 
     188            ELSEIF ( ABS(glamt(ji,jj)) <= zjetx + 100. ) THEN 
     189               zdu = rn_uzonal * ( ( zjetx-ABS(glamt(ji,jj)) )/100. + 1. ) 
     190            ELSE 
     191               zdu = 0. 
     192            END IF 
     193            IF ( ABS(gphit(ji,jj)) <= zjety ) THEN 
     194               pssh(ji,jj) = - ff_t(ji,jj) * zdu * gphit(ji,jj) * 1.e3 / grav 
     195               pu(ji,jj,:) = zdu 
     196               pts(ji,jj,:,jp_sal) = zdu / rn_uzonal + 1. 
     197            ELSE 
     198               pssh(ji,jj) = - ff_t(ji,jj) * zdu * SIGN(zjety,gphit(ji,jj)) * 1.e3 / grav  
     199               pu(ji,jj,:) = 0. 
     200               pts(ji,jj,:,jp_sal) = 1. 
     201            END IF 
     202         END_2D 
    205203          
    206204         ! temperature: 
    207205         pts(:,:,:,jp_tem) = 10._wp * ptmask(:,:,:)         
    208206         pv(:,:,:) = 0. 
    209           
    210207          
    211208       CASE(5)    ! vortex 
     
    218215         ! 
    219216         zr_lambda2 = 1._wp / zlambda**2 
    220          zP0 = rau0 * zf0 * zumax * zlambda * SQRT(EXP(1._wp)/2._wp) 
    221          ! 
    222          DO jj=1, jpj 
    223             DO ji=1, jpi 
    224                zx = glamt(ji,jj) * 1.e3 
    225                zy = gphit(ji,jj) * 1.e3 
    226                ! Surface pressure: P(x,y,z) = F(z) * Psurf(x,y) 
    227                zpsurf = zP0 * EXP(-(zx**2+zy**2)*zr_lambda2) - rau0 * ff_t(ji,jj) * rn_uzonal * zy 
    228                ! Sea level: 
    229                pssh(ji,jj) = 0. 
    230                DO jl=1,5 
    231                   zdt = pssh(ji,jj) 
    232                   zdzF = (1._wp - EXP(zdt-zH)) / (zH - 1._wp + EXP(-zH))   ! F'(z) 
    233                   zrho1 = rau0 * (1._wp + zn2*zdt/grav) - zdzF * zpsurf / grav    ! -1/g Dz(P) = -1/g * F'(z) * Psurf(x,y) 
    234                   pssh(ji,jj) = zpsurf / (zrho1*grav) * ptmask(ji,jj,1)   ! ssh = Psurf / (Rho*g) 
    235                END DO 
    236                ! temperature: 
    237                DO jk=1,jpk 
    238                   zdt =  pdept(ji,jj,jk)  
    239                   zrho1 = rau0 * (1._wp + zn2*zdt/grav) 
    240                   IF (zdt < zH) THEN 
    241                      zdzF = (1._wp-EXP(zdt-zH)) / (zH-1._wp + EXP(-zH))   ! F'(z) 
    242                      zrho1 = zrho1 - zdzF * zpsurf / grav    ! -1/g Dz(P) = -1/g * F'(z) * Psurf(x,y) 
    243                   ENDIF 
    244                   !               pts(ji,jj,jk,jp_tem) = (20._wp + (rau0-zrho1) / 0.28_wp) * ptmask(ji,jj,jk) 
    245                   pts(ji,jj,jk,jp_tem) = (10._wp + (rau0-zrho1) / 0.28_wp) * ptmask(ji,jj,jk) 
    246                END DO 
    247             END DO 
    248          END DO 
     217         zP0 = rho0 * zf0 * zumax * zlambda * SQRT(EXP(1._wp)/2._wp) 
     218         ! 
     219         DO_2D_11_11 
     220            zx = glamt(ji,jj) * 1.e3 
     221            zy = gphit(ji,jj) * 1.e3 
     222            ! Surface pressure: P(x,y,z) = F(z) * Psurf(x,y) 
     223            zpsurf = zP0 * EXP(-(zx**2+zy**2)*zr_lambda2) - rho0 * ff_t(ji,jj) * rn_uzonal * zy 
     224            ! Sea level: 
     225            pssh(ji,jj) = 0. 
     226            DO jl=1,5 
     227               zdt = pssh(ji,jj) 
     228               zdzF = (1._wp - EXP(zdt-zH)) / (zH - 1._wp + EXP(-zH))   ! F'(z) 
     229               zrho1 = rho0 * (1._wp + zn2*zdt/grav) - zdzF * zpsurf / grav    ! -1/g Dz(P) = -1/g * F'(z) * Psurf(x,y) 
     230               pssh(ji,jj) = zpsurf / (zrho1*grav) * ptmask(ji,jj,1)   ! ssh = Psurf / (Rho*g) 
     231            END DO 
     232            ! temperature: 
     233            DO jk=1,jpk 
     234               zdt =  pdept(ji,jj,jk)  
     235               zrho1 = rho0 * (1._wp + zn2*zdt/grav) 
     236               IF (zdt < zH) THEN 
     237                  zdzF = (1._wp-EXP(zdt-zH)) / (zH-1._wp + EXP(-zH))   ! F'(z) 
     238                  zrho1 = zrho1 - zdzF * zpsurf / grav    ! -1/g Dz(P) = -1/g * F'(z) * Psurf(x,y) 
     239               ENDIF 
     240               !               pts(ji,jj,jk,jp_tem) = (20._wp + (rho0-zrho1) / 0.28_wp) * ptmask(ji,jj,jk) 
     241               pts(ji,jj,jk,jp_tem) = (10._wp + (rho0-zrho1) / 0.28_wp) * ptmask(ji,jj,jk) 
     242            END DO 
     243         END_2D 
    249244         ! 
    250245         ! salinity:   
     
    253248         ! velocities: 
    254249         za = 2._wp * zP0 / zlambda**2 
    255          DO jj=1, jpj 
    256             DO ji=1, jpim1 
    257                zx = glamu(ji,jj) * 1.e3 
    258                zy = gphiu(ji,jj) * 1.e3 
    259                DO jk=1, jpk 
    260                   zdu = 0.5_wp * (pdept(ji,jj,jk) + pdept(ji+1,jj,jk)) 
    261                   IF (zdu < zH) THEN 
    262                      zf = (zH-1._wp-zdu+EXP(zdu-zH)) / (zH-1._wp+EXP(-zH)) 
    263                      zdyPs = - za * zy * EXP(-(zx**2+zy**2)*zr_lambda2) - rau0 * ff_t(ji,jj) * rn_uzonal 
    264                      pu(ji,jj,jk) = - zf / ( rau0 * ff_t(ji,jj) ) * zdyPs * ptmask(ji,jj,jk) * ptmask(ji+1,jj,jk) 
    265                   ELSE 
    266                      pu(ji,jj,jk) = 0._wp 
    267                   ENDIF 
    268                END DO 
    269             END DO 
    270          END DO 
    271          ! 
    272          DO jj=1, jpjm1 
    273             DO ji=1, jpi 
    274                zx = glamv(ji,jj) * 1.e3 
    275                zy = gphiv(ji,jj) * 1.e3 
    276                DO jk=1, jpk 
    277                   zdv = 0.5_wp * (pdept(ji,jj,jk) + pdept(ji,jj+1,jk)) 
    278                   IF (zdv < zH) THEN 
    279                      zf = (zH-1._wp-zdv+EXP(zdv-zH)) / (zH-1._wp+EXP(-zH)) 
    280                      zdxPs = - za * zx * EXP(-(zx**2+zy**2)*zr_lambda2) 
    281                      pv(ji,jj,jk) = zf / ( rau0 * ff_f(ji,jj) ) * zdxPs * ptmask(ji,jj,jk) * ptmask(ji,jj+1,jk) 
    282                   ELSE 
    283                      pv(ji,jj,jk) = 0._wp 
    284                   ENDIF 
    285                END DO 
    286             END DO 
    287          END DO 
     250         DO_2D_00_00 
     251            zx = glamu(ji,jj) * 1.e3 
     252            zy = gphiu(ji,jj) * 1.e3 
     253            DO jk=1, jpk 
     254               zdu = 0.5_wp * (pdept(ji,jj,jk) + pdept(ji+1,jj,jk)) 
     255               IF (zdu < zH) THEN 
     256                  zf = (zH-1._wp-zdu+EXP(zdu-zH)) / (zH-1._wp+EXP(-zH)) 
     257                  zdyPs = - za * zy * EXP(-(zx**2+zy**2)*zr_lambda2) - rho0 * ff_t(ji,jj) * rn_uzonal 
     258                  pu(ji,jj,jk) = - zf / ( rho0 * ff_t(ji,jj) ) * zdyPs * ptmask(ji,jj,jk) * ptmask(ji+1,jj,jk) 
     259               ELSE 
     260                  pu(ji,jj,jk) = 0._wp 
     261               ENDIF 
     262            END DO 
     263         END_2D 
     264         ! 
     265         DO_2D_00_00 
     266            zx = glamv(ji,jj) * 1.e3 
     267            zy = gphiv(ji,jj) * 1.e3 
     268            DO jk=1, jpk 
     269               zdv = 0.5_wp * (pdept(ji,jj,jk) + pdept(ji,jj+1,jk)) 
     270               IF (zdv < zH) THEN 
     271                  zf = (zH-1._wp-zdv+EXP(zdv-zH)) / (zH-1._wp+EXP(-zH)) 
     272                  zdxPs = - za * zx * EXP(-(zx**2+zy**2)*zr_lambda2) 
     273                  pv(ji,jj,jk) = zf / ( rho0 * ff_f(ji,jj) ) * zdxPs * ptmask(ji,jj,jk) * ptmask(ji,jj+1,jk) 
     274               ELSE 
     275                  pv(ji,jj,jk) = 0._wp 
     276               ENDIF 
     277            END DO 
     278         END_2D 
    288279         !             
    289280      END SELECT 
    290  
     281       
    291282      IF (ln_sshnoise) THEN 
    292283         CALL RANDOM_NUMBER(zrandom) 
     
    294285      END IF 
    295286      CALL lbc_lnk( 'usrdef_istate', pssh, 'T',  1. ) 
    296       CALL lbc_lnk(  'usrdef_istate', pts, 'T',  1. ) 
    297       CALL lbc_lnk(   'usrdef_istate', pu, 'U', -1. ) 
    298       CALL lbc_lnk(   'usrdef_istate', pv, 'V', -1. ) 
     287      CALL lbc_lnk( 'usrdef_istate', pts , 'T',  1. ) 
     288      CALL lbc_lnk_multi( 'usrdef_istate', pu, 'U', -1., pv, 'V', -1. ) 
    299289 
    300290   END SUBROUTINE usr_def_istate 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    8484      !!---------------------------------------------------------------------- 
    8585      ! 
    86       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    8786      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    88 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', cdtxt ) 
     87902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    8988      ! 
    9089      IF(lwm)   WRITE( numond, namusr_def ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/MY_SRC/usrdef_sbc.F90

    r10074 r12928  
    3131   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo 
    3232 
    33    !! * Substitutions 
    34 #  include "vectopt_loop_substitute.h90" 
    3533   !!---------------------------------------------------------------------- 
    3634   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4038CONTAINS 
    4139 
    42    SUBROUTINE usrdef_sbc_oce( kt ) 
     40   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4341      !!--------------------------------------------------------------------- 
    4442      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5452      !! 
    5553      !!---------------------------------------------------------------------- 
    56       INTEGER, INTENT(in) ::   kt   ! ocean time step 
    57        
     54      INTEGER, INTENT(in) ::   kt        ! ocean time step 
     55      INTEGER, INTENT(in) ::   Kbb       ! ocean time index 
    5856      INTEGER  ::   ji, jj               ! dummy loop indices 
    5957      REAL(wp) :: zrhoair = 1.22     ! approximate air density [Kg/m3] 
     
    8886          
    8987         WHERE( ABS(gphit) <= rn_windszy/2. ) 
    90             zwndrel(:,:) = rn_u10 - rn_uofac * un(:,:,1) 
     88            zwndrel(:,:) = rn_u10 - rn_uofac * uu(:,:,1,Kbb) 
    9189         ELSEWHERE 
    92             zwndrel(:,:) =        - rn_uofac * un(:,:,1) 
     90            zwndrel(:,:) =        - rn_uofac * uu(:,:,1,Kbb) 
    9391         END WHERE 
    9492         utau(:,:) = zrhocd * zwndrel(:,:) * zwndrel(:,:) 
    9593 
    96          zwndrel(:,:) = - rn_uofac * vn(:,:,1) 
     94         zwndrel(:,:) = - rn_uofac * vv(:,:,1,Kbb) 
    9795         vtau(:,:) = zrhocd * zwndrel(:,:) * zwndrel(:,:) 
    9896 
     
    105103   END SUBROUTINE usrdef_sbc_ice_tau 
    106104 
    107    SUBROUTINE usrdef_sbc_ice_flx( kt ) 
     105 
     106   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi ) 
    108107      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     108      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness 
     109      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness 
    109110   END SUBROUTINE usrdef_sbc_ice_flx 
    110111 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/CANAL/MY_SRC/usrdef_zgr.F90

    r10425 r12928  
    3131   PUBLIC   usr_def_zgr        ! called by domzgr.F90 
    3232 
    33   !! * Substitutions 
    34 #  include "vectopt_loop_substitute.h90" 
    3533   !!---------------------------------------------------------------------- 
    3634   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    206204      CALL lbc_lnk( 'usrdef_zgr', z2d, 'T', 1. )           ! set surrounding land to zero (here jperio=0 ==>> closed) 
    207205      ! 
    208       k_bot(:,:) = INT( z2d(:,:) )           ! =jpkm1 over the ocean point, =0 elsewhere 
     206      k_bot(:,:) = NINT( z2d(:,:) )          ! =jpkm1 over the ocean point, =0 elsewhere 
    209207      ! 
    210208      k_top(:,:) = MIN( 1 , k_bot(:,:) )     ! = 1    over the ocean point, =0 elsewhere 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV1D/EXPREF/context_nemo.xml

    r10413 r12928  
    55--> 
    66<context id="nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
    88    <variable_definition> 
    9     <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
    10        <variable id="ref_year" type="int"   > 1800 </variable> 
    11        <variable id="rau0"     type="float" > 1026.0 </variable> 
    12        <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
    13        <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
    14        <variable id="rhoic"    type="float" > 917.0 </variable> 
    15        <variable id="rhosn"    type="float" > 330.0 </variable> 
    16        <variable id="missval"  type="float" > 1.e20 </variable> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"   type="float" > 1.e20 </variable> 
    1719    </variable_definition> 
     20 
    1821<!-- Fields definition --> 
    1922    <field_definition src="./field_def_nemo-oce.xml"/>    <!--  NEMO ocean dynamics     --> 
     
    2326    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics      --> 
    2427    <file_definition src="./file_def_nemo-ice.xml"/>     <!--  NEMO sea-ice model       --> 
    25     <!--  
    26 ============================================================================================================ 
    27 = grid definition = = DO NOT CHANGE = 
    28 ============================================================================================================ 
    29     --> 
    30      
    31     <axis_definition> 
    32       <axis id="deptht"  long_name="Vertical T levels"  unit="m" positive="down" /> 
    33       <axis id="depthu"  long_name="Vertical U levels"  unit="m" positive="down" /> 
    34       <axis id="depthv"  long_name="Vertical V levels"  unit="m" positive="down" /> 
    35       <axis id="depthw"  long_name="Vertical W levels"  unit="m" positive="down" /> 
    36       <axis id="nfloat"  long_name="Float number"       unit="-"                 /> 
    37       <axis id="icbcla"  long_name="Iceberg class"      unit="1"                 /> 
    38       <axis id="ncatice" long_name="Ice category"       unit="1"                 /> 
    39       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"              /> 
    40       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"              /> 
    41     </axis_definition> 
     28 
     29 
     30<!-- Axis definition --> 
     31    <axis_definition src="./axis_def_nemo.xml"/> 
    4232  
     33<!-- Domain definition --> 
    4334    <domain_definition src="./domain_def_nemo.xml"/> 
     35 
     36<!-- Grids definition --> 
     37    <grid_definition   src="./grid_def_nemo.xml"/> 
    4438   
    45     <grid_definition src="./grid_def_nemo.xml"/> 
    4639 
    4740</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV1D/EXPREF/namelist_cfg

    r12178 r12928  
    3939   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time 
    4040   ! 
    41    rn_rdt      =   2.     !  time step for the dynamics (and tracer if nn_acc=0) 
     41   rn_Dt      =   2.     !  time step for the dynamics (and tracer if nn_acc=0) 
    4242   ! 
    4343   ln_meshmask = .true.   !  =T  create a mesh file 
     
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203203!!   namflo       float parameters                                      (default: OFF) 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    205204!!   nam_diadct   transports through some sections                      (default: OFF) 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV1D/EXPREF/namelist_cfg_120pts

    r12178 r12928  
    3939   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time 
    4040   ! 
    41    rn_rdt      =   2.     !  time step for the dynamics (and tracer if nn_acc=0) 
     41   rn_Dt      =   2.     !  time step for the dynamics (and tracer if nn_acc=0) 
    4242   ! 
    4343   ln_meshmask = .true.   !  =T  create a mesh file 
     
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203203!!   namflo       float parameters                                      (default: OFF) 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    205204!!   nam_diadct   transports through some sections                      (default: OFF) 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV1D/EXPREF/namelist_cfg_240pts

    r12178 r12928  
    3939   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time 
    4040   ! 
    41    rn_rdt      =   2.     !  time step for the dynamics (and tracer if nn_acc=0) 
     41   rn_Dt      =   2.     !  time step for the dynamics (and tracer if nn_acc=0) 
    4242   ! 
    4343   ln_meshmask = .true.   !  =T  create a mesh file 
     
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203203!!   namflo       float parameters                                      (default: OFF) 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    205204!!   nam_diadct   transports through some sections                      (default: OFF) 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV1D/EXPREF/namelist_cfg_60pts

    r12178 r12928  
    3939   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time 
    4040   ! 
    41    rn_rdt      =   2.     !  time step for the dynamics (and tracer if nn_acc=0) 
     41   rn_Dt      =   2.     !  time step for the dynamics (and tracer if nn_acc=0) 
    4242   ! 
    4343   ln_meshmask = .true.   !  =T  create a mesh file 
     
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203203!!   namflo       float parameters                                      (default: OFF) 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    205204!!   nam_diadct   transports through some sections                      (default: OFF) 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV1D/MY_SRC/usrdef_hgr.F90

    r10513 r12928  
    2626   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2727 
     28   !! * Substitutions 
     29#  include "do_loop_substitute.h90" 
    2830   !!---------------------------------------------------------------------- 
    2931   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    7678      zphi0 = -(jpjglo-1)/2 * 1.e-3 * rn_dy 
    7779 
    78       DO jj = 1, jpj 
    79          DO ji = 1, jpi 
    80             zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
    81             zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
    82  
    83             plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 * zti 
    84             plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * zui 
    85             plamv(ji,jj) = plamt(ji,jj)  
    86             plamf(ji,jj) = plamu(ji,jj)  
    87     
    88             pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 * ztj 
    89             pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * zvj 
    90             pphiu(ji,jj) = pphit(ji,jj)  
    91             pphif(ji,jj) = pphiv(ji,jj)  
    92          END DO 
    93       END DO 
     80      DO_2D_11_11 
     81         zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
     82         zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
     83          
     84         plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 * zti 
     85         plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * zui 
     86         plamv(ji,jj) = plamt(ji,jj)  
     87         plamf(ji,jj) = plamu(ji,jj)  
     88          
     89         pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 * ztj 
     90         pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * zvj 
     91         pphiu(ji,jj) = pphit(ji,jj)  
     92         pphif(ji,jj) = pphiv(ji,jj)  
     93      END_2D 
    9494          
    9595      ! constant scale factors 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV1D/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    6363      !!---------------------------------------------------------------------- 
    6464      ! 
    65       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6665      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    6766902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV1D/MY_SRC/usrdef_sbc.F90

    r10513 r12928  
    3333   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo 
    3434 
    35    !! * Substitutions 
    36 #  include "vectopt_loop_substitute.h90" 
    3735   !!---------------------------------------------------------------------- 
    3836   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4240CONTAINS 
    4341 
    44    SUBROUTINE usrdef_sbc_oce( kt ) 
     42   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4543      !!--------------------------------------------------------------------- 
    4644      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5755      !!---------------------------------------------------------------------- 
    5856      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     57      INTEGER, INTENT(in) ::   Kbb  ! ocean time index 
    5958      !!--------------------------------------------------------------------- 
    6059      ! 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV1D/MY_SRC/usrdef_zgr.F90

    r10513 r12928  
    2525   PUBLIC   usr_def_zgr   ! called by domzgr.F90 
    2626 
    27   !! * Substitutions 
    28 #  include "vectopt_loop_substitute.h90" 
    2927   !!---------------------------------------------------------------------- 
    3028   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV2D/EXPREF/context_nemo.xml

    r10515 r12928  
    55--> 
    66<context id="nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
    88    <variable_definition> 
    9     <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
    10        <variable id="ref_year" type="int"   > 1800 </variable> 
    11        <variable id="rau0"     type="float" > 1026.0 </variable> 
    12        <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
    13        <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
    14        <variable id="rhoic"    type="float" > 917.0 </variable> 
    15        <variable id="rhosn"    type="float" > 330.0 </variable> 
    16        <variable id="missval"  type="float" > 1.e20 </variable> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"   type="float" > 1.e20 </variable> 
    1719    </variable_definition> 
     20 
    1821<!-- Fields definition --> 
    1922    <field_definition src="./field_def_nemo-oce.xml"/>    <!--  NEMO ocean dynamics     --> 
     
    2326    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics      --> 
    2427    <file_definition src="./file_def_nemo-ice.xml"/>     <!--  NEMO sea-ice model       --> 
    25     <!--  
    26 ============================================================================================================ 
    27 = grid definition = = DO NOT CHANGE = 
    28 ============================================================================================================ 
    29     --> 
    30      
    31     <axis_definition> 
    32       <axis id="deptht"  long_name="Vertical T levels"  unit="m" positive="down" /> 
    33       <axis id="depthu"  long_name="Vertical U levels"  unit="m" positive="down" /> 
    34       <axis id="depthv"  long_name="Vertical V levels"  unit="m" positive="down" /> 
    35       <axis id="depthw"  long_name="Vertical W levels"  unit="m" positive="down" /> 
    36       <axis id="nfloat"  long_name="Float number"       unit="-"                 /> 
    37       <axis id="icbcla"  long_name="Iceberg class"      unit="1"                 /> 
    38       <axis id="ncatice" long_name="Ice category"       unit="1"                 /> 
    39       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"              /> 
    40       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"              /> 
    41     </axis_definition> 
     28 
     29 
     30<!-- Axis definition --> 
     31    <axis_definition src="./axis_def_nemo.xml"/> 
    4232  
     33<!-- Domain definition --> 
    4334    <domain_definition src="./domain_def_nemo.xml"/> 
     35 
     36<!-- Grids definition --> 
     37    <grid_definition   src="./grid_def_nemo.xml"/> 
    4438   
    45     <grid_definition src="./grid_def_nemo.xml"/> 
    4639 
    4740</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV2D/EXPREF/namelist_cfg

    r12178 r12928  
    3939   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time 
    4040   ! 
    41    rn_rdt      = 1200.     !  time step for the dynamics (and tracer if nn_acc=0) 
     41   rn_Dt      = 1200.     !  time step for the dynamics (and tracer if nn_acc=0) 
    4242   ! 
    4343   ln_meshmask = .true.   !  =T  create a mesh file 
     
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203203!!   namflo       float parameters                                      (default: OFF) 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    205204!!   nam_diadct   transports through some sections                      (default: OFF) 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV2D/MY_SRC/usrdef_hgr.F90

    r10515 r12928  
    2626   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2727 
     28   !! * Substitutions 
     29#  include "do_loop_substitute.h90" 
    2830   !!---------------------------------------------------------------------- 
    2931   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    8890#endif          
    8991 
    90       DO jj = 1, jpj 
    91          DO ji = 1, jpi 
    92             zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
    93             zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
    94  
    95             plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 * zti 
    96             plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * zui 
    97             plamv(ji,jj) = plamt(ji,jj)  
    98             plamf(ji,jj) = plamu(ji,jj)  
    99     
    100             pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 * ztj 
    101             pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * zvj 
    102             pphiu(ji,jj) = pphit(ji,jj)  
    103             pphif(ji,jj) = pphiv(ji,jj)  
    104          END DO 
    105       END DO 
     92      DO_2D_11_11 
     93         zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
     94         zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
     95          
     96         plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 * zti 
     97         plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * zui 
     98         plamv(ji,jj) = plamt(ji,jj)  
     99         plamf(ji,jj) = plamu(ji,jj)  
     100          
     101         pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 * ztj 
     102         pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * zvj 
     103         pphiu(ji,jj) = pphit(ji,jj)  
     104         pphif(ji,jj) = pphiv(ji,jj)  
     105      END_2D 
    106106          
    107107         ! Horizontal scale factors (in meters) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    1414   !!   usr_def_hgr   : initialize the horizontal mesh  
    1515   !!---------------------------------------------------------------------- 
    16    USE dom_oce  , ONLY: nimpp , njmpp            ! i- & j-indices of the local domain 
     16   USE dom_oce  , ONLY: nimpp , njmpp, Agrif_Root            ! i- & j-indices of the local domain 
    1717   USE par_oce        ! ocean space and time domain 
    1818   USE phycst         ! physical constants 
     
    6363      !!---------------------------------------------------------------------- 
    6464      ! 
    65       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6665      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    6766902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV2D/MY_SRC/usrdef_sbc.F90

    r10515 r12928  
    3333   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo 
    3434 
    35    !! * Substitutions 
    36 #  include "vectopt_loop_substitute.h90" 
    3735   !!---------------------------------------------------------------------- 
    3836   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4240CONTAINS 
    4341 
    44    SUBROUTINE usrdef_sbc_oce( kt ) 
     42   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4543      !!--------------------------------------------------------------------- 
    4644      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5755      !!---------------------------------------------------------------------- 
    5856      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     57      INTEGER, INTENT(in) ::   Kbb  ! ocean time index 
    5958      !!--------------------------------------------------------------------- 
    6059      ! 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_ADV2D/MY_SRC/usrdef_zgr.F90

    r10515 r12928  
    2525   PUBLIC   usr_def_zgr   ! called by domzgr.F90 
    2626 
    27   !! * Substitutions 
    28 #  include "vectopt_loop_substitute.h90" 
    2927   !!---------------------------------------------------------------------- 
    3028   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_AGRIF/EXPREF/1_namelist_cfg

    r12178 r12928  
    3939   ln_linssh   = .true.   !  =T  linear free surface  ==>>  model level are fixed in time 
    4040   ! 
    41    rn_rdt      = 400.     !  time step for the dynamics (and tracer if nn_acc=0) 
     41   rn_Dt      = 400.     !  time step for the dynamics (and tracer if nn_acc=0) 
    4242   ! 
    4343   ln_meshmask = .true.   !  =T  create a mesh file 
     
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203203!!   namflo       float parameters                                      (default: OFF) 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    205204!!   nam_diadct   transports through some sections                      (default: OFF) 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_AGRIF/EXPREF/context_nemo.xml

    r9930 r12928  
    55--> 
    66<context id="nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
    88    <variable_definition> 
    9     <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
    10        <variable id="ref_year" type="int"   > 1800 </variable> 
    11        <variable id="rau0"     type="float" > 1026.0 </variable> 
    12        <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
    13        <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
    14        <variable id="rhoic"    type="float" > 917.0 </variable> 
    15        <variable id="rhosn"    type="float" > 330.0 </variable> 
    16        <variable id="missval"  type="float" > 1.e20 </variable> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"   type="float" > 1.e20 </variable> 
    1719    </variable_definition> 
     20 
    1821<!-- Fields definition --> 
    1922    <field_definition src="./field_def_nemo-oce.xml"/>    <!--  NEMO ocean dynamics     --> 
     
    2326    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics      --> 
    2427    <file_definition src="./file_def_nemo-ice.xml"/>     <!--  NEMO sea-ice model       --> 
    25     <!--  
    26 ============================================================================================================ 
    27 = grid definition = = DO NOT CHANGE = 
    28 ============================================================================================================ 
    29     --> 
    30      
    31     <axis_definition> 
    32       <axis id="deptht"  long_name="Vertical T levels"  unit="m" positive="down" /> 
    33       <axis id="depthu"  long_name="Vertical U levels"  unit="m" positive="down" /> 
    34       <axis id="depthv"  long_name="Vertical V levels"  unit="m" positive="down" /> 
    35       <axis id="depthw"  long_name="Vertical W levels"  unit="m" positive="down" /> 
    36       <axis id="nfloat"  long_name="Float number"       unit="-"                 /> 
    37       <axis id="icbcla"  long_name="Iceberg class"      unit="1"                 /> 
    38       <axis id="ncatice" long_name="Ice category"       unit="1"                 /> 
    39       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"              /> 
    40       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"              /> 
    41     </axis_definition> 
     28 
     29 
     30<!-- Axis definition --> 
     31    <axis_definition src="./axis_def_nemo.xml"/> 
    4232  
     33<!-- Domain definition --> 
    4334    <domain_definition src="./domain_def_nemo.xml"/> 
     35 
     36<!-- Grids definition --> 
     37    <grid_definition   src="./grid_def_nemo.xml"/> 
    4438   
    45     <grid_definition src="./grid_def_nemo.xml"/> 
    4639 
    4740</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_AGRIF/EXPREF/namelist_cfg

    r12178 r12928  
    3939   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time 
    4040   ! 
    41    rn_rdt      = 1200.     !  time step for the dynamics (and tracer if nn_acc=0) 
     41   rn_Dt      = 1200.     !  time step for the dynamics (and tracer if nn_acc=0) 
    4242   ! 
    4343   ln_meshmask = .true.   !  =T  create a mesh file 
     
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203203!!   namflo       float parameters                                      (default: OFF) 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    205204!!   nam_diadct   transports through some sections                      (default: OFF) 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90

    r10516 r12928  
    2626   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2727 
     28   !! * Substitutions 
     29#  include "do_loop_substitute.h90" 
    2830   !!---------------------------------------------------------------------- 
    2931   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    8890#endif          
    8991 
    90       DO jj = 1, jpj 
    91          DO ji = 1, jpi 
    92             zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
    93             zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
    94  
    95             plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 * zti 
    96             plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * zui 
    97             plamv(ji,jj) = plamt(ji,jj)  
    98             plamf(ji,jj) = plamu(ji,jj)  
    99     
    100             pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 * ztj 
    101             pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * zvj 
    102             pphiu(ji,jj) = pphit(ji,jj)  
    103             pphif(ji,jj) = pphiv(ji,jj)  
    104          END DO 
    105       END DO 
     92      DO_2D_11_11 
     93         zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
     94         zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
     95          
     96         plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 * zti 
     97         plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * zui 
     98         plamv(ji,jj) = plamt(ji,jj)  
     99         plamf(ji,jj) = plamu(ji,jj)  
     100          
     101         pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 * ztj 
     102         pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * zvj 
     103         pphiu(ji,jj) = pphit(ji,jj)  
     104         pphif(ji,jj) = pphiv(ji,jj)  
     105      END_2D 
    106106          
    107107         ! Horizontal scale factors (in meters) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    6363      !!---------------------------------------------------------------------- 
    6464      ! 
    65       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6665      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    6766902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
     
    9089         kpj = nbcellsy + 2 + 2*nbghostcells 
    9190      ENDIF 
    92       kpk = 1 
     91      kpk = 2 
    9392      ! 
    9493!!      zlx = (kpi-2)*rn_dx*1.e-3 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90

    r10516 r12928  
    3333   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo 
    3434 
    35    !! * Substitutions 
    36 #  include "vectopt_loop_substitute.h90" 
    3735   !!---------------------------------------------------------------------- 
    3836   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4240CONTAINS 
    4341 
    44    SUBROUTINE usrdef_sbc_oce( kt ) 
     42   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4543      !!--------------------------------------------------------------------- 
    4644      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5755      !!---------------------------------------------------------------------- 
    5856      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     57      INTEGER, INTENT(in) ::   Kbb  ! ocean time index 
    5958      !!--------------------------------------------------------------------- 
    6059      ! 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ICE_AGRIF/MY_SRC/usrdef_zgr.F90

    r10516 r12928  
    2525   PUBLIC   usr_def_zgr   ! called by domzgr.F90 
    2626 
    27   !! * Substitutions 
    28 #  include "vectopt_loop_substitute.h90" 
    2927   !!---------------------------------------------------------------------- 
    3028   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    9189      !                       !==  z-coordinate  ==!   (step-like topography) 
    9290      !                                !* bottom ocean compute from the depth of grid-points 
    93       jpkm1 = jpk 
     91      jpkm1 = jpk-1 
    9492      k_bot(:,:) = 1    ! here use k_top as a land mask 
    9593      !                                !* horizontally uniform coordinate (reference z-co everywhere) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ISOMIP/EXPREF/context_nemo.xml

    r12178 r12928  
    55--> 
    66<context id="nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
    88    <variable_definition> 
    9     <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
    10        <variable id="ref_year" type="int"   > 1800 </variable> 
    11        <variable id="rau0"     type="float" > 1026.0 </variable> 
    12        <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
    13        <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
    14        <variable id="rhoic"    type="float" > 917.0 </variable> 
    15        <variable id="rhosn"    type="float" > 330.0 </variable> 
    16        <variable id="missval"  type="float" > 1.e20 </variable> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"  type="float" > 1.e20 </variable>           
    1719    </variable_definition> 
     20 
    1821<!-- Fields definition --> 
    1922    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    2124<!-- Files definition --> 
    2225    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     --> 
    23     <!--  
    24 ============================================================================================================ 
    25 = grid definition = = DO NOT CHANGE = 
    26 ============================================================================================================ 
    27     --> 
    28      
    29     <axis_definition> 
    30       <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
    31       <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
    32       <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
    33       <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
    34       <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
    35       <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
    36       <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
    37       <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
    38       <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    39     </axis_definition> 
     26 
     27<!-- Axis definition --> 
     28    <axis_definition src="./axis_def_nemo.xml"/> 
    4029  
     30<!-- Domain definition --> 
    4131    <domain_definition src="./domain_def_nemo.xml"/> 
     32 
     33<!-- Grids definition --> 
     34    <grid_definition   src="./grid_def_nemo.xml"/> 
    4235   
    43     <grid_definition src="./grid_def_nemo.xml"/> 
    4436 
    4537</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ISOMIP/EXPREF/file_def_nemo-oce.xml

    r9572 r12928  
    2727     <field field_ref="ssh"          name="sossheig"  /> 
    2828          <!-- variable for ice shelf --> 
    29           <field field_ref="qlatisf"      name="sohflisf"  /> 
    30           <field field_ref="fwfisf"       name="sowflisf"  /> 
     29          <field field_ref="fwfisf_cav"       name="sowflisf"  /> 
    3130          <field field_ref="isfgammat"    name="sogammat"  /> 
    3231          <field field_ref="isfgammas"    name="sogammas"  /> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ISOMIP/EXPREF/namelist_cfg

    r12178 r12928  
    4444!----------------------------------------------------------------------- 
    4545   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    46    rn_rdt      = 1800.     !  time step for the dynamics (and tracer if nn_acc=0) 
    47 / 
     46   rn_Dt      = 1800.     !  time step for the dynamics (and tracer if nn_acc=0) 
     47/ 
     48!----------------------------------------------------------------------- 
     49&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg) 
     50!----------------------------------------------------------------------- 
     51/ 
     52!----------------------------------------------------------------------- 
     53&namtsd        !    Temperature & Salinity Data  (init/dmp)             (default: OFF) 
     54!----------------------------------------------------------------------- 
     55    
     56/ 
     57!----------------------------------------------------------------------- 
     58&namwad        !   Wetting and Drying (WaD)                             (default: OFF) 
     59!----------------------------------------------------------------------- 
     60/ 
     61!----------------------------------------------------------------------- 
     62&namcrs        !   coarsened grid (for outputs and/or TOP)              (ln_crs =T) 
     63!----------------------------------------------------------------------- 
     64/ 
     65!----------------------------------------------------------------------- 
     66&namc1d        !   1D configuration options                             ("key_c1d" default: PAPA station) 
     67!----------------------------------------------------------------------- 
     68/ 
     69!----------------------------------------------------------------------- 
     70&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF) 
     71!----------------------------------------------------------------------- 
     72/ 
     73!----------------------------------------------------------------------- 
     74&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF) 
     75!----------------------------------------------------------------------- 
     76 
     77/ 
     78 
    4879!!====================================================================== 
    4980!!            ***  Surface Boundary Condition namelists  ***          !! 
     
    5990!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T) 
    6091!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T) 
    61 !!   namsbc_isf      ice shelf melting/freezing                         (ln_isfcav  =T : read (ln_read_cfg=T) or set or usr_def_zgr ) 
    62 !!   namsbc_iscpl    coupling option between land ice model and ocean   (ln_isfcav  =T) 
    6392!!   namsbc_wave     external fields from wave model                    (ln_wave    =T) 
    6493!!   namberg         iceberg floats                                     (ln_icebergs=T) 
     
    6695! 
    6796!----------------------------------------------------------------------- 
    68 &namsbc        !   Surface Boundary Condition (surface module) 
    69 !----------------------------------------------------------------------- 
    70    nn_fsbc     = 1         !  frequency of surface boundary condition computation 
     97&namsbc        !   Surface Boundary Condition manager                   (default: NO selection) 
     98!----------------------------------------------------------------------- 
     99   nn_fsbc     = 1         !  frequency of SBC module call 
     100      !                    !  (control sea-ice & iceberg model call) 
    71101   ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
    72    ln_isf      = .true.    !  ice shelf melting/freezing                (T => fill namsbc_isf) 
    73 / 
    74 !----------------------------------------------------------------------- 
    75 &namsbc_isf    !  Top boundary layer (ISF)                              (ln_isfcav =T : read (ln_read_cfg=T)  
    76 !-----------------------------------------------------------------------             or set or usr_def_zgr ) 
    77 !              ! file name ! frequency (hours) ! variable ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    78 !              !           !  (if <0  months)  !   name   !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  ! filename      ! 
    79 ! nn_isf == 4 
    80    sn_fwfisf   = 'rnfisf'  ,         -12.      ,'sowflisf',     .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    81 ! nn_isf == 3 
    82    sn_rnfisf   = 'rnfisf'  ,         -12.      ,'sofwfisf',     .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    83 ! nn_isf == 2 and 3 
    84    sn_depmax_isf = 'rnfisf' ,        -12.      ,'sozisfmax' ,   .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    85    sn_depmin_isf = 'rnfisf' ,        -12.      ,'sozisfmin' ,   .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    86 ! nn_isf == 2 
    87    sn_Leff_isf = 'rnfisf'  ,         -12.      ,'Leff'    ,     .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    88 ! for all case 
    89    nn_isf      = 1         !  ice shelf melting/freezing 
    90                            !  1 = presence of ISF    2 = bg03 parametrisation  
    91                            !  3 = rnf file for isf   4 = ISF fwf specified 
    92                            !  option 1 and 4 need ln_isfcav = .true. (domzgr) 
    93 ! only for nn_isf = 1 or 2 
    94    rn_gammat0  = 1.0e-4   ! gammat coefficient used in blk formula 
    95    rn_gammas0  = 1.0e-4   ! gammas coefficient used in blk formula 
    96 ! only for nn_isf = 1 or 4 
    97    rn_hisf_tbl =  30.      ! thickness of the top boundary layer    (Losh et al. 2008) 
    98                           ! 0 => thickness of the tbl = thickness of the first wet cell 
    99 ! only for nn_isf = 1 
    100    nn_isfblk   = 1        ! 1 ISOMIP  like: 2 equations formulation (Hunter et al., 2006) 
    101                           ! 2 ISOMIP+ like: 3 equations formulation (Asay-Davis et al., 2015) 
    102    nn_gammablk = 0        ! 0 = cst Gammat (= gammat/s) 
    103                           ! 1 = velocity dependend Gamma (u* * gammat/s)  (Jenkins et al. 2010) 
    104                           ! 2 = velocity and stability dependent Gamma    (Holland et al. 1999) 
    105 / 
    106 !----------------------------------------------------------------------- 
    107 &namsbc_iscpl  !   land ice / ocean coupling option                      
    108 !----------------------------------------------------------------------- 
    109 / 
     102/ 
     103!----------------------------------------------------------------------- 
     104&namsbc_flx    !   surface boundary condition : flux formulation        (ln_flx =T) 
     105!----------------------------------------------------------------------- 
     106/ 
     107!----------------------------------------------------------------------- 
     108&namsbc_blk    !   namsbc_blk  generic Bulk formula                     (ln_blk =T) 
     109!----------------------------------------------------------------------- 
     110 
     111/ 
     112!----------------------------------------------------------------------- 
     113&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3") 
     114!----------------------------------------------------------------------- 
     115 
     116/ 
     117!----------------------------------------------------------------------- 
     118&namsbc_sas    !   Stand-Alone Surface module: ocean data               (SAS_SRC  only) 
     119!----------------------------------------------------------------------- 
     120 
     121/ 
     122!----------------------------------------------------------------------- 
     123&namsbc_iif    !   Ice-IF : use observed ice cover                      (nn_ice = 1) 
     124!----------------------------------------------------------------------- 
     125/ 
     126!----------------------------------------------------------------------- 
     127&namtra_qsr    !   penetrative solar radiation                          (ln_traqsr =T) 
     128!----------------------------------------------------------------------- 
     129    
     130/ 
     131!----------------------------------------------------------------------- 
     132&namsbc_ssr    !   surface boundary condition : sea surface restoring   (ln_ssr =T) 
     133!----------------------------------------------------------------------- 
     134 
     135/ 
     136!----------------------------------------------------------------------- 
     137&namsbc_rnf    !   runoffs                                              (ln_rnf =T) 
     138!----------------------------------------------------------------------- 
     139 
     140/ 
     141!----------------------------------------------------------------------- 
     142&namsbc_apr    !   Atmospheric pressure used as ocean forcing           (ln_apr_dyn =T) 
     143!----------------------------------------------------------------------- 
     144 
     145/ 
     146!----------------------------------------------------------------------- 
     147&namisf       !  Top boundary layer (ISF)                               (default: OFF) 
     148!----------------------------------------------------------------------- 
     149   ! 
     150   ! ---------------- ice shelf load ------------------------------- 
     151   ! 
     152   ! 
     153   ! ---------------- ice shelf melt formulation ------------------------------- 
     154   ! 
     155   ln_isf = .true.           ! activate ice shelf module 
     156      cn_isfdir = './'           ! directory for all ice shelf input file 
     157      ! 
     158      ! ---------------- cavities opened ------------------------------- 
     159      ! 
     160      ln_isfcav_mlt = .true.    ! ice shelf melting into the cavity (need ln_isfcav = .true. in domain_cfg.nc) 
     161         cn_isfcav_mlt = '2eq'   ! ice shelf melting formulation (spe/2eq/3eq/oasis) 
     162         !                       ! spe = fwfisf is read from a forcing field 
     163         !                       ! 2eq = ISOMIP  like: 2 equations formulation (Hunter et al., 2006) 
     164         !                       ! 3eq = ISOMIP+ like: 3 equations formulation (Asay-Davis et al., 2015) 
     165         !                       ! oasis = fwfisf is given by oasis and pattern by file sn_isfcav_fwf 
     166         !              !  cn_isfcav_mlt = 2eq or 3eq cases: 
     167         cn_gammablk = 'spe'    ! scheme to compute gammat/s (spe,ad15,hj99) 
     168         !                       ! ad15 = velocity dependend Gamma (u* * gammat/s)  (Jenkins et al. 2010) 
     169         !                       ! hj99 = velocity and stability dependent Gamma    (Holland et al. 1999) 
     170         rn_gammat0  = 1.e-4     ! gammat coefficient used in blk formula 
     171         rn_gammas0  = 1.e-4     ! gammas coefficient used in blk formula 
     172         ! 
     173         rn_htbl     =  30.      ! thickness of the top boundary layer    (Losh et al. 2008) 
     174         !                       ! 0 => thickness of the tbl = thickness of the first wet cell 
     175         ! 
     176/ 
     177!----------------------------------------------------------------------- 
     178&namsbc_wave   ! External fields from wave model                        (ln_wave=T) 
     179!----------------------------------------------------------------------- 
     180/ 
     181!----------------------------------------------------------------------- 
     182&namberg       !   iceberg parameters                                   (default: OFF) 
     183!----------------------------------------------------------------------- 
     184 
     185/ 
     186 
    110187!!====================================================================== 
    111188!!               ***  Lateral boundary condition  ***                 !! 
     
    124201   rn_shlat    =    0.     !  free slip 
    125202/ 
     203!----------------------------------------------------------------------- 
     204&namagrif      !  AGRIF zoom                                            ("key_agrif") 
     205!----------------------------------------------------------------------- 
     206/ 
     207!----------------------------------------------------------------------- 
     208&nam_tide      !   tide parameters                                      (default: OFF) 
     209!----------------------------------------------------------------------- 
     210/ 
     211!----------------------------------------------------------------------- 
     212&nambdy        !  unstructured open boundaries                          (default: OFF) 
     213!----------------------------------------------------------------------- 
     214/ 
     215!----------------------------------------------------------------------- 
     216&nambdy_dta    !  open boundaries - external data                       (see nam_bdy) 
     217!----------------------------------------------------------------------- 
     218 
     219/ 
     220!----------------------------------------------------------------------- 
     221&nambdy_tide   !  tidal forcing at open boundaries                      (default: OFF) 
     222!----------------------------------------------------------------------- 
     223/ 
     224 
    126225!!====================================================================== 
    127226!!                ***  Top/Bottom boundary condition  ***             !! 
     
    145244/ 
    146245!----------------------------------------------------------------------- 
    147 &namdrg_top    !   TOP friction                                         (ln_isfcav=T) 
     246&namdrg_top    !   TOP friction                                         (ln_OFF =F & ln_isfcav=T) 
    148247!----------------------------------------------------------------------- 
    149248   rn_Cd0     =  2.5e-3    !  drag coefficient [-] 
     
    156255/ 
    157256!----------------------------------------------------------------------- 
    158 &namdrg_bot    !   BOTTOM friction                                   
     257&namdrg_bot    !   BOTTOM friction                                      (ln_OFF =F) 
    159258!----------------------------------------------------------------------- 
    160259   rn_Cd0     =  1.e-3    !  drag coefficient [-] 
     
    166265      rn_boost =  50.         !  local boost factor  [-] 
    167266/ 
     267!----------------------------------------------------------------------- 
     268&nambbc        !   bottom temperature boundary condition                (default: OFF) 
     269!----------------------------------------------------------------------- 
     270 
     271/ 
     272!----------------------------------------------------------------------- 
     273&nambbl        !   bottom boundary layer scheme                         (default: OFF) 
     274!----------------------------------------------------------------------- 
     275/ 
     276 
    168277!!====================================================================== 
    169278!!                        Tracer (T-S) namelists                      !! 
     
    178287! 
    179288!----------------------------------------------------------------------- 
    180 &nameos        !   ocean Equation Of Seawater                           (default: OFF) 
     289&nameos        !   ocean Equation Of Seawater                           (default: NO selection) 
    181290!----------------------------------------------------------------------- 
    182291   ln_eos80    = .true.          !  = Use EOS80 equation of state 
     
    199308      rn_Ld        = 10.e+3         !  lateral diffusive length   [m] 
    200309/ 
     310!----------------------------------------------------------------------- 
     311&namtra_mle    !   mixed layer eddy parametrisation (Fox-Kemper)       (default: OFF) 
     312!----------------------------------------------------------------------- 
     313/ 
     314!----------------------------------------------------------------------- 
     315&namtra_eiv    !   eddy induced velocity param.                         (default: OFF) 
     316!----------------------------------------------------------------------- 
     317/ 
     318!----------------------------------------------------------------------- 
     319&namtra_dmp    !   tracer: T & S newtonian damping                      (default: OFF) 
     320!----------------------------------------------------------------------- 
     321/ 
     322 
    201323!!====================================================================== 
    202324!!                      ***  Dynamics namelists  ***                  !! 
     
    212334! 
    213335!----------------------------------------------------------------------- 
     336&nam_vvl       !   vertical coordinate options                          (default: z-star) 
     337!----------------------------------------------------------------------- 
     338/ 
     339!----------------------------------------------------------------------- 
    214340&namdyn_adv    !   formulation of the momentum advection                (default: NO selection) 
    215341!----------------------------------------------------------------------- 
     
    218344/ 
    219345!----------------------------------------------------------------------- 
    220 &namdyn_vor    !   Vorticity / Coriolis scheme                          (default: OFF) 
     346&namdyn_vor    !   Vorticity / Coriolis scheme                          (default: NO selection) 
    221347!----------------------------------------------------------------------- 
    222348   ln_dynvor_ene = .true.  !  energy conserving scheme 
     
    241367      rn_Lv      = 10.e+3           !  lateral viscous length   [m] 
    242368/ 
     369!----------------------------------------------------------------------- 
     370&namdta_dyn    !   offline ocean input files                            (OFF_SRC only) 
     371!----------------------------------------------------------------------- 
     372 
     373/ 
     374 
    243375!!====================================================================== 
    244376!!                     vertical physics namelists                     !! 
     
    253385! 
    254386!----------------------------------------------------------------------- 
    255 &namzdf        !   vertical physics                                     (default: NO selection) 
    256 !----------------------------------------------------------------------- 
    257    !                       ! type of vertical closure 
     387&namzdf        !   vertical physics manager                             (default: NO selection) 
     388!----------------------------------------------------------------------- 
     389   !                       ! type of vertical closure (required) 
    258390   ln_zdfcst   = .true.       !  constant mixing 
     391   ! 
     392   !                       ! convection 
    259393   ln_zdfevd   = .true.       !  enhanced vertical diffusion 
    260       nn_evdm     =    1         ! apply on tracer (=0) or on tracer and momentum (=1) 
    261       rn_evd      =   0.1        ! mixing coefficient [m2/s] 
     394   rn_evd      =  0.1         ! mixing coefficient [m2/s] 
     395   ! 
    262396   !                       ! coefficients 
    263    rn_avm0     =   1.e-3     !  vertical eddy viscosity   [m2/s] 
    264    rn_avt0     =   5.e-5     !  vertical eddy diffusivity [m2/s] 
    265 / 
     397   rn_avm0     =   1.e-3      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst) 
     398   rn_avt0     =   5.e-5      !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst) 
     399/ 
     400!----------------------------------------------------------------------- 
     401&namzdf_ric    !   richardson number dependent vertical diffusion       (ln_zdfric =T) 
     402!----------------------------------------------------------------------- 
     403/ 
     404!----------------------------------------------------------------------- 
     405&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T) 
     406!----------------------------------------------------------------------- 
     407/ 
     408!----------------------------------------------------------------------- 
     409&namzdf_gls    !   GLS vertical diffusion                               (ln_zdfgls =T) 
     410!----------------------------------------------------------------------- 
     411/ 
     412!----------------------------------------------------------------------- 
     413&namzdf_osm    !   OSM vertical diffusion                               (ln_zdfosm =T) 
     414!----------------------------------------------------------------------- 
     415/ 
     416!----------------------------------------------------------------------- 
     417&namzdf_iwm    !    internal wave-driven mixing parameterization        (ln_zdfiwm =T) 
     418!----------------------------------------------------------------------- 
     419/ 
     420 
    266421!!====================================================================== 
    267422!!                  ***  Diagnostics namelists  ***                   !! 
     
    273428!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    274429!!   namflo       float parameters                                      (default: OFF) 
    275 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    276430!!   nam_diadct   transports through some sections                      (default: OFF) 
    277 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    278431!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    279432!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
    280433!!====================================================================== 
    281434! 
     435!----------------------------------------------------------------------- 
     436&namtrd        !   trend diagnostics                                    (default: OFF) 
     437!----------------------------------------------------------------------- 
     438/ 
     439!----------------------------------------------------------------------- 
     440&namptr        !   Poleward Transport Diagnostic                        (default: OFF) 
     441!----------------------------------------------------------------------- 
     442/ 
     443!----------------------------------------------------------------------- 
     444&namhsb        !  Heat and salt budgets                                 (default: OFF) 
     445!----------------------------------------------------------------------- 
     446/ 
     447!----------------------------------------------------------------------- 
     448&namdiu        !   Cool skin and warm layer models                      (default: OFF) 
     449!----------------------------------------------------------------------- 
     450/ 
     451!----------------------------------------------------------------------- 
     452&namflo        !   float parameters                                     ("key_float") 
     453!----------------------------------------------------------------------- 
     454/ 
     455!----------------------------------------------------------------------- 
     456&nam_diaharm   !   Harmonic analysis of tidal constituents              ("key_diaharm") 
     457!----------------------------------------------------------------------- 
     458/ 
     459!----------------------------------------------------------------------- 
     460&namdct        ! transports through some sections                       ("key_diadct") 
     461!----------------------------------------------------------------------- 
     462/ 
     463!----------------------------------------------------------------------- 
     464&nam_diatmb    !  Top Middle Bottom Output                              (default: OFF) 
     465!----------------------------------------------------------------------- 
     466/ 
     467!----------------------------------------------------------------------- 
     468&nam_dia25h    !  25h Mean Output                                       (default: OFF) 
     469!----------------------------------------------------------------------- 
     470/ 
     471!----------------------------------------------------------------------- 
     472&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4") 
     473!----------------------------------------------------------------------- 
     474/ 
     475 
    282476!!====================================================================== 
    283477!!               ***  Observation & Assimilation  ***                 !! 
     
    287481!!====================================================================== 
    288482! 
     483!----------------------------------------------------------------------- 
     484&namobs        !  observation usage switch                              (default: OFF) 
     485!----------------------------------------------------------------------- 
     486/ 
     487!----------------------------------------------------------------------- 
     488&nam_asminc    !   assimilation increments                              ('key_asminc') 
     489!----------------------------------------------------------------------- 
     490/ 
     491 
    289492!!====================================================================== 
    290493!!                  ***  Miscellaneous namelists  ***                 !! 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ISOMIP/MY_SRC/usrdef_hgr.F90

    r10074 r12928  
    2727   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2828 
     29   !! * Substitutions 
     30#  include "do_loop_substitute.h90" 
    2931   !!---------------------------------------------------------------------- 
    3032   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    7577      ! 
    7678      !                       !==  grid point position  ==!   (in degrees) 
    77       DO jj = 1, jpj 
    78          DO ji = 1, jpi             ! longitude   (west coast at lon=0°) 
    79             plamt(ji,jj) = rn_e1deg * (  - 0.5 + REAL( ji-1 + nimpp-1 , wp )  )   
    80             plamu(ji,jj) = rn_e1deg * (          REAL( ji-1 + nimpp-1 , wp )  ) 
    81             plamv(ji,jj) = plamt(ji,jj) 
    82             plamf(ji,jj) = plamu(ji,jj) 
    83             !                       ! latitude   (south coast at lat= 81°) 
    84             pphit(ji,jj) = rn_e2deg * (  - 0.5 + REAL( jj-1 + njmpp-1 , wp )  ) - 80._wp 
    85             pphiu(ji,jj) = pphit(ji,jj) 
    86             pphiv(ji,jj) = rn_e2deg * (          REAL( jj-1 + njmpp-1 , wp )  ) - 80_wp 
    87             pphif(ji,jj) = pphiv(ji,jj) 
    88          END DO 
    89       END DO 
     79      DO_2D_11_11 
     80         !                       ! longitude   (west coast at lon=0°) 
     81         plamt(ji,jj) = rn_e1deg * (  - 0.5 + REAL( ji-1 + nimpp-1 , wp )  )   
     82         plamu(ji,jj) = rn_e1deg * (          REAL( ji-1 + nimpp-1 , wp )  ) 
     83         plamv(ji,jj) = plamt(ji,jj) 
     84         plamf(ji,jj) = plamu(ji,jj) 
     85         !                       ! latitude   (south coast at lat= 81°) 
     86         pphit(ji,jj) = rn_e2deg * (  - 0.5 + REAL( jj-1 + njmpp-1 , wp )  ) - 80._wp 
     87         pphiu(ji,jj) = pphit(ji,jj) 
     88         pphiv(ji,jj) = rn_e2deg * (          REAL( jj-1 + njmpp-1 , wp )  ) - 80_wp 
     89         pphif(ji,jj) = pphiv(ji,jj) 
     90      END_2D 
    9091      ! 
    9192      !                       !==  Horizontal scale factors  ==!   (in meters) 
    92       DO jj = 1, jpj 
    93          DO ji = 1, jpi 
    94             !                       ! e1   (zonal) 
    95             pe1t(ji,jj) = ra * rad * COS( rad * pphit(ji,jj) ) * rn_e1deg 
    96             pe1u(ji,jj) = ra * rad * COS( rad * pphiu(ji,jj) ) * rn_e1deg 
    97             pe1v(ji,jj) = ra * rad * COS( rad * pphiv(ji,jj) ) * rn_e1deg 
    98             pe1f(ji,jj) = ra * rad * COS( rad * pphif(ji,jj) ) * rn_e1deg 
    99             !                       ! e2   (meridional) 
    100             pe2t(ji,jj) = ra * rad * rn_e2deg 
    101             pe2u(ji,jj) = ra * rad * rn_e2deg 
    102             pe2v(ji,jj) = ra * rad * rn_e2deg 
    103             pe2f(ji,jj) = ra * rad * rn_e2deg 
    104          END DO 
    105       END DO 
     93      DO_2D_11_11 
     94         !                       ! e1   (zonal) 
     95         pe1t(ji,jj) = ra * rad * COS( rad * pphit(ji,jj) ) * rn_e1deg 
     96         pe1u(ji,jj) = ra * rad * COS( rad * pphiu(ji,jj) ) * rn_e1deg 
     97         pe1v(ji,jj) = ra * rad * COS( rad * pphiv(ji,jj) ) * rn_e1deg 
     98         pe1f(ji,jj) = ra * rad * COS( rad * pphif(ji,jj) ) * rn_e1deg 
     99         !                       ! e2   (meridional) 
     100         pe2t(ji,jj) = ra * rad * rn_e2deg 
     101         pe2u(ji,jj) = ra * rad * rn_e2deg 
     102         pe2v(ji,jj) = ra * rad * rn_e2deg 
     103         pe2f(ji,jj) = ra * rad * rn_e2deg 
     104      END_2D 
    106105      !                             ! NO reduction of grid size in some straits  
    107106      ke1e2u_v    = 0               !    ==>> u_ & v_surfaces will be computed in dom_ghr routine 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ISOMIP/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    6464      !!---------------------------------------------------------------------- 
    6565      ! 
    66       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6766      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    6867902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ISOMIP/MY_SRC/usrdef_sbc.F90

    r10074 r12928  
    11MODULE usrdef_sbc 
    22   !!====================================================================== 
    3    !!                       ***  MODULE usrdef_sbc  *** 
     3   !!                     ***  MODULE usrdef_sbc  *** 
    44   !!  
    55   !!                  ===  ISOMIP configuration  === 
     
    3232   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo 
    3333 
    34    !! * Substitutions 
    35 #  include "vectopt_loop_substitute.h90" 
    3634   !!---------------------------------------------------------------------- 
    3735   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4139CONTAINS 
    4240 
    43    SUBROUTINE usrdef_sbc_oce( kt ) 
     41   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4442      !!--------------------------------------------------------------------- 
    4543      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5654      !!---------------------------------------------------------------------- 
    5755      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     56      INTEGER, INTENT(in) ::   Kbb  ! ocean time index 
    5857      !!--------------------------------------------------------------------- 
    5958      ! 
     
    8180   END SUBROUTINE usrdef_sbc_ice_tau 
    8281 
    83    SUBROUTINE usrdef_sbc_ice_flx( kt ) 
     82 
     83   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi ) 
    8484      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     85      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness 
     86      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness 
    8587   END SUBROUTINE usrdef_sbc_ice_flx 
    8688 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/ISOMIP/MY_SRC/usrdef_zgr.F90

    r10491 r12928  
    3030   PUBLIC   usr_def_zgr   ! called by domzgr.F90 
    3131 
    32   !! * Substitutions 
    33 #  include "vectopt_loop_substitute.h90" 
     32   !! * Substitutions 
     33#  include "do_loop_substitute.h90" 
    3434   !!---------------------------------------------------------------------- 
    3535   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    134134            pe3vw(:,:,jk) = pe3w_1d (jk) 
    135135         END DO 
    136          DO jj = 1, jpj                      ! top scale factors and depth at T- and W-points 
    137             DO ji = 1, jpi 
    138                ik = k_top(ji,jj) 
    139                IF ( ik > 2 ) THEN 
    140                   ! pdeptw at the interface 
    141                   pdepw(ji,jj,ik  ) = MAX( zhisf(ji,jj) , pdepw(ji,jj,ik) ) 
    142                   ! e3t in both side of the interface 
    143                   pe3t (ji,jj,ik  ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 
    144                   ! pdept in both side of the interface (from previous e3t) 
    145                   pdept(ji,jj,ik  ) = pdepw(ji,jj,ik  ) + pe3t (ji,jj,ik  ) * 0.5_wp 
    146                   pdept(ji,jj,ik-1) = pdepw(ji,jj,ik  ) - pe3t (ji,jj,ik  ) * 0.5_wp 
    147                   ! pe3w on both side of the interface 
    148                   pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik  ) 
    149                   pe3w (ji,jj,ik  ) = pdept(ji,jj,ik  ) - pdept(ji,jj,ik-1) 
    150                   ! e3t into the ice shelf 
    151                   pe3t (ji,jj,ik-1) = pdepw(ji,jj,ik  ) - pdepw(ji,jj,ik-1) 
    152                   pe3w (ji,jj,ik-1) = pdept(ji,jj,ik-1) - pdept(ji,jj,ik-2) 
    153                END IF 
    154             END DO 
    155          END DO          
    156          DO jj = 1, jpj                      ! bottom scale factors and depth at T- and W-points 
    157             DO ji = 1, jpi 
    158                ik = k_bot(ji,jj) 
    159                pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) ) 
     136         ! top scale factors and depth at T- and W-points 
     137         DO_2D_11_11 
     138            ik = k_top(ji,jj) 
     139            IF ( ik > 2 ) THEN 
     140               ! pdeptw at the interface 
     141               pdepw(ji,jj,ik  ) = MAX( zhisf(ji,jj) , pdepw(ji,jj,ik) ) 
     142               ! e3t in both side of the interface 
    160143               pe3t (ji,jj,ik  ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 
    161                pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik  )  
    162                ! 
     144               ! pdept in both side of the interface (from previous e3t) 
    163145               pdept(ji,jj,ik  ) = pdepw(ji,jj,ik  ) + pe3t (ji,jj,ik  ) * 0.5_wp 
    164                pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp 
    165                pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik) 
    166             END DO 
    167          END DO          
     146               pdept(ji,jj,ik-1) = pdepw(ji,jj,ik  ) - pe3t (ji,jj,ik  ) * 0.5_wp 
     147               ! pe3w on both side of the interface 
     148               pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik  ) 
     149               pe3w (ji,jj,ik  ) = pdept(ji,jj,ik  ) - pdept(ji,jj,ik-1) 
     150               ! e3t into the ice shelf 
     151               pe3t (ji,jj,ik-1) = pdepw(ji,jj,ik  ) - pdepw(ji,jj,ik-1) 
     152               pe3w (ji,jj,ik-1) = pdept(ji,jj,ik-1) - pdept(ji,jj,ik-2) 
     153            END IF 
     154         END_2D 
     155         ! bottom scale factors and depth at T- and W-points 
     156         DO_2D_11_11 
     157            ik = k_bot(ji,jj) 
     158            pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) ) 
     159            pe3t (ji,jj,ik  ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 
     160            pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik  )  
     161            ! 
     162            pdept(ji,jj,ik  ) = pdepw(ji,jj,ik  ) + pe3t (ji,jj,ik  ) * 0.5_wp 
     163            pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp 
     164            pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik) 
     165         END_2D        
    168166         !                                   ! bottom scale factors and depth at  U-, V-, UW and VW-points 
    169167         pe3u (:,:,:) = pe3t(:,:,:) 
    170168         pe3uw(:,:,:) = pe3w(:,:,:) 
    171          DO jk = 1, jpk                      ! Computed as the minimum of neighbooring scale factors 
    172             DO jj = 1, jpjm1 
    173                DO ji = 1, jpi 
    174                   pe3v (ji,jj,jk) = MIN( pe3t(ji,jj,jk), pe3t(ji,jj+1,jk) ) 
    175                   pe3vw(ji,jj,jk) = MIN( pe3w(ji,jj,jk), pe3w(ji,jj+1,jk) ) 
    176                   pe3f (ji,jj,jk) = pe3v(ji,jj,jk) 
    177                END DO 
    178             END DO 
    179          END DO 
     169         DO_3D_00_00( 1, jpk ) 
     170         !                                   ! Computed as the minimum of neighbooring scale factors 
     171            pe3v (ji,jj,jk) = MIN( pe3t(ji,jj,jk), pe3t(ji,jj+1,jk) ) 
     172            pe3vw(ji,jj,jk) = MIN( pe3w(ji,jj,jk), pe3w(ji,jj+1,jk) ) 
     173            pe3f (ji,jj,jk) = pe3v(ji,jj,jk) 
     174         END_3D 
    180175         CALL lbc_lnk( 'usrdef_zgr', pe3v , 'V', 1._wp )   ;   CALL lbc_lnk( 'usrdef_zgr', pe3vw, 'V', 1._wp ) 
    181176         CALL lbc_lnk( 'usrdef_zgr', pe3f , 'F', 1._wp ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/context_nemo.xml

    r12178 r12928  
    55--> 
    66<context id="nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
    88    <variable_definition> 
    9     <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
    10        <variable id="ref_year" type="int"   > 1800 </variable> 
    11        <variable id="rau0"     type="float" > 1026.0 </variable> 
    12        <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
    13        <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
    14        <variable id="rhoic"    type="float" > 917.0 </variable> 
    15        <variable id="rhosn"    type="float" > 330.0 </variable> 
    16        <variable id="missval"  type="float" > 1.e20 </variable> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"  type="float" > 1.e20 </variable>           
    1719    </variable_definition> 
     20 
    1821<!-- Fields definition --> 
    1922    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    2124<!-- Files definition --> 
    2225    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     --> 
    23     <!--  
    24 ============================================================================================================ 
    25 = grid definition = = DO NOT CHANGE = 
    26 ============================================================================================================ 
    27     --> 
    28      
    29     <axis_definition> 
    30       <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
    31       <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
    32       <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
    33       <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
    34       <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
    35       <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
    36       <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
    37       <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
    38       <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    39     </axis_definition> 
     26 
     27<!-- Axis definition --> 
     28    <axis_definition src="./axis_def_nemo.xml"/> 
    4029  
     30<!-- Domain definition --> 
    4131    <domain_definition src="./domain_def_nemo.xml"/> 
     32 
     33<!-- Grids definition --> 
     34    <grid_definition   src="./grid_def_nemo.xml"/> 
    4235   
    43     <grid_definition src="./grid_def_nemo.xml"/> 
    4436 
    4537</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_flux_cen2_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_flux_ubs_cfg

    r12178 r12928  
    4747   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    4848   ! 
    49    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    50    ! 
    51    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     49   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    5250   rn_atfp     =    0.1    !  asselin time filter parameter 
    5351   ! 
     
    218216      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    219217         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    220          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    221          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     218         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     219         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    222220      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    223          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     221         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    224222/ 
    225223!----------------------------------------------------------------------- 
     
    278276!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    279277!!   namflo       float parameters                                      (default: OFF) 
    280 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    281278!!   nam_diadct   transports through some sections                      (default: OFF) 
    282 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    283279!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    284280!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_eenH_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_een_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_ene_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_ens_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_flux_cen2_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_flux_ubs_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_eenH_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_een_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_ene_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_ens_cfg

    r10075 r12928  
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    3434   ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    36    ! 
    37    rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3836   rn_atfp     =    0.1    !  asselin time filter parameter 
    3937   ! 
     
    146144      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    147145         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    148          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    149          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     146         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     147         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    150148      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    151          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     149         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    152150/ 
    153151!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/MY_SRC/usrdef_hgr.F90

    r10074 r12928  
    2626   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2727 
     28   !! * Substitutions 
     29#  include "do_loop_substitute.h90" 
    2830   !!---------------------------------------------------------------------- 
    2931   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    7274      !                       !==  grid point position  ==!   (in kilometers) 
    7375      zfact = rn_dx * 1.e-3         ! conversion in km 
    74       DO jj = 1, jpj 
    75          DO ji = 1, jpi             ! longitude 
    76             plamt(ji,jj) = zfact * (  - 0.5 + REAL( ji-1 + nimpp-1 , wp )  )   
    77             plamu(ji,jj) = zfact * (          REAL( ji-1 + nimpp-1 , wp )  ) 
    78             plamv(ji,jj) = plamt(ji,jj) 
    79             plamf(ji,jj) = plamu(ji,jj) 
    80             !                       ! latitude 
    81             pphit(ji,jj) = zfact * (  - 0.5 + REAL( jj-1 + njmpp-1 , wp )  ) 
    82             pphiu(ji,jj) = pphit(ji,jj) 
    83             pphiv(ji,jj) = zfact * (          REAL( jj-1 + njmpp-1 , wp )  ) 
    84             pphif(ji,jj) = pphiv(ji,jj) 
    85          END DO 
    86       END DO 
     76      DO_2D_11_11 
     77         !                       ! longitude 
     78         plamt(ji,jj) = zfact * (  - 0.5 + REAL( ji-1 + nimpp-1 , wp )  )   
     79         plamu(ji,jj) = zfact * (          REAL( ji-1 + nimpp-1 , wp )  ) 
     80         plamv(ji,jj) = plamt(ji,jj) 
     81         plamf(ji,jj) = plamu(ji,jj) 
     82         !                       ! latitude 
     83         pphit(ji,jj) = zfact * (  - 0.5 + REAL( jj-1 + njmpp-1 , wp )  ) 
     84         pphiu(ji,jj) = pphit(ji,jj) 
     85         pphiv(ji,jj) = zfact * (          REAL( jj-1 + njmpp-1 , wp )  ) 
     86         pphif(ji,jj) = pphiv(ji,jj) 
     87      END_2D 
    8788      ! 
    8889      !                       !==  Horizontal scale factors  ==!   (in meters)  
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/MY_SRC/usrdef_istate.F90

    r10074 r12928  
    6060      ! 
    6161      !  rn_a0 =  0.2   !  thermal expension coefficient (nn_eos= 1) 
    62       !  rho = rau0 - rn_a0 * (T-10)  
     62      !  rho = rho0 - rn_a0 * (T-10)  
    6363      !  delta_T = 25 degrees  ==>>  delta_rho = 25 * rn_a0 = 5 kg/m3 
    6464      ! 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    6060      !!---------------------------------------------------------------------- 
    6161      ! 
    62       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6362      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    6463902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/MY_SRC/usrdef_sbc.F90

    r10074 r12928  
    3131   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo 
    3232 
    33    !! * Substitutions 
    34 #  include "vectopt_loop_substitute.h90" 
    3533   !!---------------------------------------------------------------------- 
    3634   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4038CONTAINS 
    4139 
    42    SUBROUTINE usrdef_sbc_oce( kt ) 
     40   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4341      !!--------------------------------------------------------------------- 
    4442      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5553      !!---------------------------------------------------------------------- 
    5654      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     55      INTEGER, INTENT(in) ::   Kbb  ! ocean time index 
    5756      !!--------------------------------------------------------------------- 
    5857      ! 
     
    8079   END SUBROUTINE usrdef_sbc_ice_tau 
    8180 
    82    SUBROUTINE usrdef_sbc_ice_flx( kt ) 
     81 
     82   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi ) 
    8383      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     84      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness 
     85      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness 
    8486   END SUBROUTINE usrdef_sbc_ice_flx 
    8587 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/LOCK_EXCHANGE/MY_SRC/usrdef_zgr.F90

    r10425 r12928  
    2727   PUBLIC   usr_def_zgr   ! called by domzgr.F90 
    2828 
    29   !! * Substitutions 
    30 #  include "vectopt_loop_substitute.h90" 
    3129   !!---------------------------------------------------------------------- 
    3230   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/EXPREF/context_nemo.xml

    r12178 r12928  
    55--> 
    66<context id="nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
    88    <variable_definition> 
    9     <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
    10        <variable id="ref_year" type="int"   > 1800 </variable> 
    11        <variable id="rau0"     type="float" > 1026.0 </variable> 
    12        <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
    13        <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
    14        <variable id="rhoic"    type="float" > 917.0 </variable> 
    15        <variable id="rhosn"    type="float" > 330.0 </variable> 
    16        <variable id="missval"  type="float" > 1.e20 </variable> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"  type="float" > 1.e20 </variable>           
    1719    </variable_definition> 
     20 
    1821<!-- Fields definition --> 
    1922    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    2124<!-- Files definition --> 
    2225    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     --> 
    23     <!--  
    24 ============================================================================================================ 
    25 = grid definition = = DO NOT CHANGE = 
    26 ============================================================================================================ 
    27     --> 
    28      
    29     <axis_definition> 
    30       <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
    31       <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
    32       <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
    33       <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
    34       <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
    35       <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
    36       <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
    37       <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
    38       <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    39     </axis_definition> 
     26 
     27<!-- Axis definition --> 
     28    <axis_definition src="./axis_def_nemo.xml"/> 
    4029  
     30<!-- Domain definition --> 
    4131    <domain_definition src="./domain_def_nemo.xml"/> 
     32 
     33<!-- Grids definition --> 
     34    <grid_definition   src="./grid_def_nemo.xml"/> 
    4235   
    43     <grid_definition src="./grid_def_nemo.xml"/> 
    4436 
    4537</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/EXPREF/namelist_sco_FCT2_flux_cen-ahm1000_cfg

    r10075 r12928  
    3333&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    3434!----------------------------------------------------------------------- 
    35    rn_rdt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3636   rn_atfp     =    0.1    !  asselin time filter parameter 
    3737/ 
     
    155155      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    156156         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    157          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    158          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     157         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     158         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    159159      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    160          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     160         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    161161/ 
    162162!----------------------------------------------------------------------- 
     
    210210   !                       ! coefficients 
    211211   rn_avm0     =   1.e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F) 
    212    rn_avt0     =   0.0e      !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
     212   rn_avt0     =   0.0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
    213213   nn_avb      =    0        !  profile for background avt & avm (=1) or not (=0) 
    214214   nn_havtb    =    0        !  horizontal shape for avtb (=1) or not (=0) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/EXPREF/namelist_sco_FCT2_flux_ubs_cfg

    r10075 r12928  
    3333&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    3434!----------------------------------------------------------------------- 
    35    rn_rdt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3636   rn_atfp     =    0.1    !  asselin time filter parameter 
    3737/ 
     
    155155      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    156156         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    157          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    158          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     157         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     158         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    159159      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    160          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     160         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    161161/ 
    162162!----------------------------------------------------------------------- 
     
    210210   !                       ! coefficients 
    211211   rn_avm0     =   1.e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F) 
    212    rn_avt0     =   0.0e      !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
     212   rn_avt0     =   0.0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
    213213   nn_avb      =    0        !  profile for background avt & avm (=1) or not (=0) 
    214214   nn_havtb    =    0        !  horizontal shape for avtb (=1) or not (=0) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/EXPREF/namelist_sco_FCT4_flux_cen-ahm1000_cfg

    r10075 r12928  
    3333&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    3434!----------------------------------------------------------------------- 
    35    rn_rdt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3636   rn_atfp     =    0.1    !  asselin time filter parameter 
    3737/ 
     
    155155      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    156156         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    157          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    158          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     157         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     158         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    159159      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    160          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     160         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    161161/ 
    162162!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/EXPREF/namelist_sco_FCT4_flux_ubs_cfg

    r10075 r12928  
    3333&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    3434!----------------------------------------------------------------------- 
    35    rn_rdt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3636   rn_atfp     =    0.1    !  asselin time filter parameter 
    3737/ 
     
    155155      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    156156         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    157          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    158          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     157         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     158         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    159159      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    160          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     160         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    161161/ 
    162162!----------------------------------------------------------------------- 
     
    210210   !                       ! coefficients 
    211211   rn_avm0     =   1.e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F) 
    212    rn_avt0     =   0.0e      !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
     212   rn_avt0     =   0.0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
    213213   nn_avb      =    0        !  profile for background avt & avm (=1) or not (=0) 
    214214   nn_havtb    =    0        !  horizontal shape for avtb (=1) or not (=0) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/EXPREF/namelist_zps_FCT2_flux_ubs_cfg

    r10075 r12928  
    3333&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    3434!----------------------------------------------------------------------- 
    35    rn_rdt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3636   rn_atfp     =    0.1    !  asselin time filter parameter 
    3737/ 
     
    155155      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    156156         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    157          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    158          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     157         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     158         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    159159      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    160          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     160         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    161161/ 
    162162!----------------------------------------------------------------------- 
     
    211211   !                       ! coefficients 
    212212   rn_avm0     =   1.e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F) 
    213    rn_avt0     =   0.0e      !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
     213   rn_avt0     =   0.0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
    214214   nn_avb      =    0        !  profile for background avt & avm (=1) or not (=0) 
    215215   nn_havtb    =    0        !  horizontal shape for avtb (=1) or not (=0) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/EXPREF/namelist_zps_FCT4_flux_ubs_cfg

    r12178 r12928  
    3434   cn_exp      =   "OVF_zps_FCT4_flux_ubs"  !  experience name 
    3535   nn_it000    =       1   !  first time step 
    36    !nn_itend    =    6120  ! here 17h of simulation  (=6120 time-step)  
    37    nn_itend    =    5760   ! here 16h of simulation  (=5760 time-step) abort after 5802 for zps: pb of physics conditions 
     36   nn_itend    =    6120   ! here 17h of simulation  (=6120 time-step)  
    3837   nn_istate   =       0   !  output the initial state (1) or not (0) 
    39    nn_stock    =    1080   !  frequency of creation of a restart file (modulo referenced to 1) 
    40    nn_write    =    1080   !  frequency of write in the output file   (modulo referenced to nn_it000) 
     38   nn_stock    =    6120   !  frequency of creation of a restart file (modulo referenced to 1) 
     39   nn_write    =    6120   !  frequency of write in the output file   (modulo referenced to nn_it000) 
    4140/ 
    4241!----------------------------------------------------------------------- 
     
    4746&namdom        !   time and space domain 
    4847!----------------------------------------------------------------------- 
    49    rn_rdt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
     48   rn_Dt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
    5049   rn_atfp     =    0.1    !  asselin time filter parameter 
    5150/ 
     
    217216      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    218217         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    219          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    220          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     218         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     219         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    221220      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    222          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     221         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    223222/ 
    224223!----------------------------------------------------------------------- 
     
    255254&namzdf        !   vertical physics manager                             (default: NO selection) 
    256255!----------------------------------------------------------------------- 
     256   !                       ! adaptive-implicit vertical advection 
     257   ln_zad_Aimp = .true.       !  Courant number dependent scheme (Shchepetkin 2015) 
     258   ! 
    257259   !                       ! type of vertical closure (required) 
    258260   ln_zdfcst   = .true.      !  constant mixing 
     
    279281   !                       ! coefficients 
    280282   rn_avm0     =   1.e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F) 
    281    rn_avt0     =   0.0e      !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
     283   rn_avt0     =   0.0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
    282284   nn_avb      =    0        !  profile for background avt & avm (=1) or not (=0) 
    283285   nn_havtb    =    0        !  horizontal shape for avtb (=1) or not (=0) 
     
    292294!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    293295!!   namflo       float parameters                                      (default: OFF) 
    294 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    295296!!   nam_diadct   transports through some sections                      (default: OFF) 
    296 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    297297!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    298298!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/EXPREF/namelist_zps_FCT4_vect_een_cfg

    r10075 r12928  
    3333&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    3434!----------------------------------------------------------------------- 
    35    rn_rdt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
     35   rn_Dt      =   10.     !  time step for the dynamics (and tracer if nn_acc=0) 
    3636   rn_atfp     =    0.1    !  asselin time filter parameter 
    3737/ 
     
    155155      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    156156         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    157          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    158          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     157         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     158         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    159159      ln_bt_auto    = .true.     ! Number of sub-step defined from: 
    160          nn_baro      =  1         ! =F : the number of sub-step in rn_rdt seconds 
     160         nn_e      =  1         ! =F : the number of sub-step in rn_Dt seconds 
    161161/ 
    162162!----------------------------------------------------------------------- 
     
    210210   !                       ! coefficients 
    211211   rn_avm0     =   1.e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F) 
    212    rn_avt0     =   0.0e      !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
     212   rn_avt0     =   0.0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F) 
    213213   nn_avb      =    0        !  profile for background avt & avm (=1) or not (=0) 
    214214   nn_havtb    =    0        !  horizontal shape for avtb (=1) or not (=0) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/MY_SRC/usrdef_hgr.F90

    r10074 r12928  
    2626   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2727 
     28   !! * Substitutions 
     29#  include "do_loop_substitute.h90" 
    2830   !!---------------------------------------------------------------------- 
    2931   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    7274      !                       !==  grid point position  ==!   (in kilometers) 
    7375      zfact = rn_dx * 1.e-3         ! conversion in km 
    74       DO jj = 1, jpj 
    75          DO ji = 1, jpi             ! longitude 
    76             plamt(ji,jj) = zfact * (  - 0.5 + REAL( ji-1 + nimpp-1 , wp )  )   
    77             plamu(ji,jj) = zfact * (          REAL( ji-1 + nimpp-1 , wp )  ) 
    78             plamv(ji,jj) = plamt(ji,jj) 
    79             plamf(ji,jj) = plamu(ji,jj) 
    80             !                       ! latitude 
    81             pphit(ji,jj) = zfact * (  - 0.5 + REAL( jj-1 + njmpp-1 , wp )  ) 
    82             pphiu(ji,jj) = pphit(ji,jj) 
    83             pphiv(ji,jj) = zfact * (          REAL( jj-1 + njmpp-1 , wp )  ) 
    84             pphif(ji,jj) = pphiv(ji,jj) 
    85          END DO 
    86       END DO 
     76      DO_2D_11_11 
     77         !                       ! longitude 
     78         plamt(ji,jj) = zfact * (  - 0.5 + REAL( ji-1 + nimpp-1 , wp )  )   
     79         plamu(ji,jj) = zfact * (          REAL( ji-1 + nimpp-1 , wp )  ) 
     80         plamv(ji,jj) = plamt(ji,jj) 
     81         plamf(ji,jj) = plamu(ji,jj) 
     82         !                       ! latitude 
     83         pphit(ji,jj) = zfact * (  - 0.5 + REAL( jj-1 + njmpp-1 , wp )  ) 
     84         pphiu(ji,jj) = pphit(ji,jj) 
     85         pphiv(ji,jj) = zfact * (          REAL( jj-1 + njmpp-1 , wp )  ) 
     86         pphif(ji,jj) = pphiv(ji,jj) 
     87      END_2D 
    8788      ! 
    8889      !                       !==  Horizontal scale factors  ==!   (in meters)  
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/MY_SRC/usrdef_istate.F90

    r10074 r12928  
    6060      ! 
    6161      !  rn_a0 =  0.2   !  thermal expension coefficient (nn_eos= 1) 
    62       !  rho = rau0 - rn_a0 * (T-10)  
     62      !  rho = rho0 - rn_a0 * (T-10)  
    6363      !  delta_T = 10 degrees  ==>>  delta_rho = 10 * rn_a0 = 2 kg/m3 
    6464      ! 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    6161      !!---------------------------------------------------------------------- 
    6262      ! 
    63       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6463      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    6564902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/MY_SRC/usrdef_sbc.F90

    r10074 r12928  
    3131   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo 
    3232 
    33    !! * Substitutions 
    34 #  include "vectopt_loop_substitute.h90" 
    3533   !!---------------------------------------------------------------------- 
    3634   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4038CONTAINS 
    4139 
    42    SUBROUTINE usrdef_sbc_oce( kt ) 
     40   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4341      !!--------------------------------------------------------------------- 
    4442      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5553      !!---------------------------------------------------------------------- 
    5654      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     55      INTEGER, INTENT(in) ::   Kbb  ! ocean time index 
    5756      !!--------------------------------------------------------------------- 
    5857      ! 
     
    8079   END SUBROUTINE usrdef_sbc_ice_tau 
    8180 
    82    SUBROUTINE usrdef_sbc_ice_flx( kt ) 
     81 
     82   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi ) 
    8383      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     84      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness 
     85      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness 
    8486   END SUBROUTINE usrdef_sbc_ice_flx 
    8587 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/OVERFLOW/MY_SRC/usrdef_zgr.F90

    r11077 r12928  
    2929   PUBLIC   usr_def_zgr   ! called by domzgr.F90 
    3030 
    31   !! * Substitutions 
    32 #  include "vectopt_loop_substitute.h90" 
     31   !! * Substitutions 
     32#  include "do_loop_substitute.h90" 
    3333   !!---------------------------------------------------------------------- 
    3434   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    184184            pe3vw(:,:,jk) = pe3w_1d (jk) 
    185185         END DO 
    186          DO jj = 1, jpj                      ! bottom scale factors and depth at T- and W-points 
    187             DO ji = 1, jpi 
    188                ik = k_bot(ji,jj) 
    189                   pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) ) 
    190                   pe3t (ji,jj,ik  ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 
    191                   pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik  )  
    192                   ! 
    193                   pdept(ji,jj,ik  ) = pdepw(ji,jj,ik  ) + pe3t (ji,jj,ik  ) * 0.5_wp 
    194                   pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp 
    195                   pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik)              ! = pe3t (ji,jj,ik  ) 
    196             END DO 
    197          END DO          
     186         DO_2D_11_11 
     187            ik = k_bot(ji,jj) 
     188            pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) ) 
     189            pe3t (ji,jj,ik  ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 
     190            pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik  )  
     191            ! 
     192            pdept(ji,jj,ik  ) = pdepw(ji,jj,ik  ) + pe3t (ji,jj,ik  ) * 0.5_wp 
     193            pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp 
     194            pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik)              ! = pe3t (ji,jj,ik  ) 
     195         END_2D          
    198196         !                                   ! bottom scale factors and depth at  U-, V-, UW and VW-points 
    199197         !                                   ! usually Computed as the minimum of neighbooring scale factors 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/README.rst

    r10605 r12928  
    33********************** 
    44 
    5 The complete and up-to-date set of test cases is available on 
    6 `NEMO test cases Github repository <http://github.com/NEMO-ocean/NEMO-examples>`_. 
    7  
    8 Download it directly in the ``./tests`` root directory with 
     5.. todo:: 
     6 
     7   CANAL animated gif is missing 
     8 
     9.. contents:: 
     10   :local: 
     11   :depth: 1 
     12 
     13Installation 
     14============ 
     15 
     16Download 
     17-------- 
     18 
     19| The complete and up-to-date set of test cases is available on 
     20  :github:`NEMO test cases repository <NEMO-examples>`. 
     21| Download it directly into the :file:`./tests` root directory with 
    922 
    1023.. code-block:: console 
     
    1225   $ git clone http://github.com/NEMO-ocean/NEMO-examples 
    1326 
    14 .. contents:: 
    15    :local: 
    16  
    17 Procedure 
    18 ========= 
    19  
    20 Compile test cases 
    21 ------------------ 
    22  
    23 The compilation of the test cases is very similar to the manner the reference configurations are compiled. 
    24 If you are not familiar on how to compile NEMO, it is first recomended to read :doc:`the instructions <install>` 
    25  
    26 | In the same manner as the ref. cfg are compiled with '-r' option, test cases can be compile by the use of makenemo with '-a' option. 
    27 | Here an example to compile a copy named WAD2 of the wetting and drying test case (WAD) on the macport_osx architecture on 4 cores: 
     27Compilation 
     28----------- 
     29 
     30The compilation of the test cases is very similar to 
     31the manner the reference configurations are compiled. 
     32If you are not familiar on how to compile NEMO, 
     33it is first recomended to read :doc:`the instructions <install>`. 
     34 
     35| As the reference configurations are compiled with ``-r`` option, 
     36  test cases can be compiled by the use of :file:`makenemo` with ``-a`` option. 
     37| Here an example to compile a copy named WAD2 of the wetting and drying test case (WAD): 
    2838 
    2939.. code-block:: console 
    3040 
    31    $ ./makenemo -n 'WAD2' -a 'WAD' -m 'macport_osx' -j '4' 
    32  
    33 Run and analyse the test cases 
    34 ------------------------------ 
    35  
    36 There no requirement of specific input file for the test_cases presented here. The XIOS xml input files and namelist are already setup correctly.  
     41   $ ./makenemo -n 'WAD2' -a 'WAD' -m 'my_arch' -j '4' 
     42 
     43Run and analysis 
     44---------------- 
     45 
     46There no requirement of specific input file for the test_cases presented here. 
     47The XIOS xml input files and namelist are already setup correctly. 
    3748For detailed description and Jupyter notebook, the reader is directed on 
    38 the `NEMO test cases repository <http://github.com/NEMO-ocean/NEMO-examples>`_ 
     49the :github:`NEMO test cases repository <NEMO-examples>` 
    3950 
    4051The description below is a brief advertisement of some test cases. 
    4152 
     53List of test cases 
     54================== 
     55 
    4256ICE_AGRIF 
    43 ========= 
    44    
    45   This test case illustrates the advection of an ice patch across an East/West and North/South periodic channel 
    46   over a slab ocean (i.e. one ocean layer), and with an AGRIF zoom (1:3) in the center 
    47   The purpose of this configuration is to test the advection of the ice patch in   
    48   and across the AGRIF boundary 
    49   One can either impose ice velocities or ice-atm. stresses and let rheology define velocities 
    50   (see README for details) 
    51  
    52   .. image:: _static/ICE_AGRIF_UDIAG_43days_UM5.gif 
     57--------- 
     58 
     59.. figure:: _static/ICE_AGRIF_UDIAG_43days_UM5.gif 
     60   :width: 200px 
     61   :align: left 
     62 
     63   .. 
     64 
     65| This test case illustrates the advection of an ice patch across 
     66  an East/West and North/South periodic channel over a slab ocean (i.e. one ocean layer), 
     67  and with an AGRIF zoom (1:3) in the center. 
     68| The purpose of this configuration is to 
     69  test the advection of the ice patch in and across the AGRIF boundary. 
     70  One can either impose ice velocities or ice-atm. 
     71  Stresses and let rheology define velocities (see :file:`README` for details) 
    5372 
    5473VORTEX 
    55 ====== 
    56    
    57   This test case illustrates the propagation of an anticyclonic eddy over a Beta plan and a flat bottom. 
    58   It is implemented here with an online refined subdomain (1:3) out of which the vortex propagates. 
    59   It serves as a benchmark for quantitative estimates of nesting errors as in Debreu et al. (2012) :cite:`DEBREU2012`, 
    60   Penven et al. (2006) :cite:`PENVEN2006` or Spall and Holland (1991) :cite:`SPALL1991`. 
    61    
    62   The animation below (sea level anomaly in meters) illustrates with two 1:2 successively nested grids how 
    63   the vortex smoothly propagates out of the refined grids. 
    64    
    65   .. image:: _static/VORTEX_anim.gif 
     74------ 
     75 
     76.. figure:: _static/VORTEX_anim.gif 
     77   :width: 200px 
     78   :align: right 
     79 
     80   .. 
     81 
     82This test case illustrates the propagation of an anticyclonic eddy over a Beta plan and a flat bottom. 
     83It is implemented here with an online refined subdomain (1:3) out of which the vortex propagates. 
     84It serves as a benchmark for quantitative estimates of nesting errors as in :cite:`DEBREU2012`, 
     85:cite:`PENVEN2006` or :cite:`SPALL1991`. 
     86 
     87The animation (sea level anomaly in meters) illustrates with 
     88two 1:2 successively nested grids how the vortex smoothly propagates out of the refined grids. 
    6689 
    6790ISOMIP 
    68 ====== 
    69  
    70   The purpose of this test case is to evaluate the impact of various schemes and new development with the iceshelf cavities circulation and melt. 
    71   This configuration served as initial assesment of the ice shelf module in Losh et al. (2008) :cite:`LOSCH2008` and Mathiot et al. (2017) :cite:`MATHIOT2017`.  
    72   The default setup is the one described `here <http://staff.acecrc.org.au/~bkgalton/ISOMIP/test_cavities.pdf>`_. 
    73    
    74   The figure below (meridional overturning circulation) illustrates the circulation generated after 10000 days by the ice shelf melting (ice pump). 
    75  
    76   .. image:: _static/ISOMIP_moc.png 
     91------ 
     92 
     93.. figure:: _static/ISOMIP_moc.png 
     94   :width: 200px 
     95   :align: left 
     96 
     97   .. 
     98 
     99| The purpose of this test case is to evaluate the impact of various schemes and new development with 
     100  the iceshelf cavities circulation and melt. 
     101  This configuration served as initial assesment of the ice shelf module in :cite:`LOSCH2008` and 
     102  :cite:`MATHIOT2017`. 
     103  The default setup is the one described |ISOMIP|_. 
     104| The figure (meridional overturning circulation) illustrates 
     105  the circulation generated after 10000 days by the ice shelf melting (ice pump). 
     106 
     107.. |ISOMIP| replace:: here 
    77108 
    78109LOCK_EXCHANGE 
    79 ============= 
    80  
    81   The LOCK EXCHANGE experiment is a classical fluid dynamics experiment that has been adapted 
    82   by Haidvogel and Beckmann (1999) :cite:`HAIDVOGEL1999` for testing advection schemes in ocean circulation models. 
    83   It has been used by several authors including Burchard and Bolding (2002) :cite:`BURCHARD2002` and Ilicak et al. (2012) :cite:`ILICAK2012`. 
    84   The LOCK EXCHANGE experiment can in particular illustrate the impact of different choices of numerical schemes  
    85   and/or subgrid closures on spurious interior mixing. 
    86  
    87   Below the animation of the LOCK_EXCHANGE test case using the advection scheme FCT4 (forth order) for tracer and ubs for dynamics. 
    88  
    89   .. image:: _static/LOCK-FCT4_flux_ubs.gif 
     110------------- 
     111 
     112.. figure:: _static/LOCK-FCT4_flux_ubs.gif 
     113   :width: 200px 
     114   :align: right 
     115 
     116   .. 
     117 
     118| The LOCK EXCHANGE experiment is a classical fluid dynamics experiment that has been adapted 
     119  by :cite:`HAIDVOGEL1999` for testing advection schemes in ocean circulation models. 
     120  It has been used by several authors including :cite:`BURCHARD2002` and :cite:`ILICAK2012`. 
     121  The LOCK EXCHANGE experiment can in particular illustrate 
     122  the impact of different choices of numerical schemes and/or subgrid closures on 
     123  spurious interior mixing. 
     124| Here the animation of the LOCK_EXCHANGE test case using 
     125  the advection scheme FCT4 (forth order) for tracer and ubs for dynamics. 
    90126 
    91127OVERFLOW 
    92 ======== 
    93  
    94   The OVERFLOW experiment illustrates the impact of different choices of numerical schemes  
    95   and/or subgrid closures on spurious interior mixing close to bottom topography.  
    96   The OVERFLOW experiment is adapted from the non-rotating overflow configuration described  
    97   in Haidvogel and Beckmann (1999) :cite:`HAIDVOGEL1999` and further used by Ilicak et al. (2012) :cite:`ILICAK2012`. 
    98   Here we can assess the behaviour of the second-order tracer advection scheme FCT2 and fortht-order FCT4, z-coordinate and sigma coordinate (...). 
    99  
    100   Below the animation of the OVERFLOW test case in sigma coordinate with the forth-order advection scheme FCT4. 
    101  
    102   .. image:: _static/OVF-sco_FCT4_flux_cen-ahm1000.gif 
     128-------- 
     129 
     130.. figure:: _static/OVF-sco_FCT4_flux_cen-ahm1000.gif 
     131   :width: 200px 
     132   :align: left 
     133 
     134   .. 
     135 
     136| The OVERFLOW experiment illustrates the impact of different choices of numerical schemes and/or 
     137  subgrid closures on spurious interior mixing close to bottom topography. 
     138  The OVERFLOW experiment is adapted from the non-rotating overflow configuration described in 
     139  :cite:`HAIDVOGEL1999` and further used by :cite:`ILICAK2012`. 
     140  Here we can assess the behaviour of the second-order tracer advection scheme FCT2 and 
     141  forth-order FCT4, z-coordinate and sigma coordinate (...). 
     142| Here the animation of the OVERFLOW test case in sigma coordinate with 
     143  the forth-order advection scheme FCT4. 
    103144 
    104145WAD 
    105 === 
    106  
    107   A set of simple closed basin geometries for testing the Wetting and drying capabilities.  
    108   Examples range from a closed channel with EW linear bottom slope to a parabolic EW channel with a Gaussian ridge. 
    109    
    110   Below the animation of the test case 7. This test case is a simple linear slope with a mid-depth shelf with an open boundary forced with a sinusoidally varying ssh. 
    111   This test case has been introduced to emulate a typical coastal application with a tidally forced open boundary with an adverse SSH gradient that, when released, creates a surge up the slope. 
    112   The parameters are chosen such that the surge rises above sea-level before falling back and oscillating towards an equilibrium position 
    113  
    114   .. image:: _static/wad_testcase_7.gif 
     146--- 
     147 
     148.. figure:: _static/wad_testcase_7.gif 
     149   :width: 200px 
     150   :align: right 
     151 
     152   .. 
     153 
     154| A set of simple closed basin geometries for testing the Wetting and drying capabilities. 
     155  Examples range from a closed channel with EW linear bottom slope to 
     156  a parabolic EW channel with a Gaussian ridge. 
     157| Here the animation of the test case 7. 
     158  This test case is a simple linear slope with a mid-depth shelf with 
     159  an open boundary forced with a sinusoidally varying ssh. 
     160  This test case has been introduced to emulate a typical coastal application with 
     161  a tidally forced open boundary with an adverse SSH gradient that, 
     162  when released, creates a surge up the slope. 
     163  The parameters are chosen such that 
     164  the surge rises above sea-level before falling back and oscillating towards an equilibrium position. 
    115165 
    116166CANAL 
    117 ===== 
    118  
    119   East-west periodic canal of variable size with several initial states and associated geostrophic currents (zonal jets or vortex). 
    120  
    121   .. image::_static/CANAL_image.gif 
     167----- 
     168 
     169.. figure:: _static/CANAL_image.gif 
     170   :width: 200px 
     171   :align: left 
     172 
     173   .. 
     174 
     175East-west periodic canal of variable size with several initial states and 
     176associated geostrophic currents (zonal jets or vortex). 
    122177 
    123178ICE_ADV2D 
    124 ========= 
    125    
    126   This test case illustrates the advection of an ice patch across an East/West and North/South periodic channel 
    127   over a slab ocean (i.e. one ocean layer). 
     179--------- 
     180 
     181| This test case illustrates the advection of an ice patch across 
     182  an East/West and North/South periodic channel over a slab ocean (i.e. one ocean layer). 
    128183  The configuration is similar to ICE_AGRIF, except for the AGRIF zoom. 
    129   The purpose of this configuration is to test the advection schemes available in the sea-ice code 
     184| The purpose of this configuration is to test the advection schemes available in the sea-ice code 
    130185  (for now, Prather and Ultimate-Macho from 1st to 5th order), 
    131186  especially the occurence of overshoots in ice thickness 
    132    
    133187 
    134188ICE_ADV1D 
    135 ========= 
    136    
    137   This experiment is the classical Schar & Smolarkiewicz (1996) test case :cite:`SCHAR1996`, 
    138   which has been used in :cite:`LIPSCOMB2004`, 
    139   and in which very specific shapes of ice concentration, thickness and volume converge toward the center of a basin. 
     189--------- 
     190 
     191| This experiment is the classical :cite:`SCHAR1996` test case , 
     192  which has been used in :cite:`LIPSCOMB2004`, and in which very specific shapes of ice concentration, 
     193  thickness and volume converge toward the center of a basin. 
    140194  Convergence is unidirectional (in x) while fields are homogeneous in y. 
    141   The purpose of this configuration is to test the caracteristics of advection schemes available in the sea-ice code 
     195| The purpose of this configuration is to 
     196  test the caracteristics of advection schemes available in the sea-ice code 
    142197  (for now, Prather and Ultimate-Macho from 1st to 5th order), 
    143   especially the constitency between concentration, thickness and volume, and the preservation of initial shapes.   
    144  
    145 References 
    146 ========== 
    147  
    148 .. bibliography:: test_cases.bib 
    149    :all: 
    150    :style: unsrt 
    151    :labelprefix: T 
     198  especially the constitency between concentration, thickness and volume, 
     199  and the preservation of initial shapes. 
     200 
     201.. rubric:: References 
     202 
     203.. bibliography:: tests.bib 
     204   :all: 
     205   :style: unsrt 
     206   :labelprefix: T 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/EXPREF/1_context_nemo.xml

    r9930 r12928  
    55--> 
    66<context id="1_nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
     8    <variable_definition> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"  type="float" > 1.e20 </variable>           
     19    </variable_definition> 
     20 
    821<!-- Fields definition --> 
    922    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    1124<!-- Files definition --> 
    1225    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     --> 
    13     <!--  
    14 ============================================================================================================ 
    15 = grid definition = = DO NOT CHANGE = 
    16 ============================================================================================================ 
    17     --> 
    18      
    19     <axis_definition> 
    20       <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" /> 
    21       <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" /> 
    22       <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" /> 
    23       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    24       <axis id="nfloat" long_name="Float number"      unit="-"                 /> 
    25       <axis id="icbcla"  long_name="Iceberg class"      unit="1"               /> 
    26       <axis id="ncatice" long_name="Ice category"       unit="1"               /> 
    27       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            /> 
    28       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            /> 
    29     </axis_definition> 
     26 
     27<!-- Axis definition --> 
     28    <axis_definition src="./axis_def_nemo.xml"/> 
    3029  
     30<!-- Domain definition --> 
    3131    <domain_definition src="./domain_def_nemo.xml"/> 
     32 
     33<!-- Grids definition --> 
     34    <grid_definition   src="./grid_def_nemo.xml"/> 
    3235   
    33     <grid_definition src="./grid_def_nemo.xml"/> 
    34      
     36 
    3537</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/EXPREF/1_namelist_cfg

    r12178 r12928  
    4040!----------------------------------------------------------------------- 
    4141   ln_linssh   =  .false.  !  =T  linear free surface  ==>>  model level are fixed in time 
    42    rn_rdt      =    480.   !  time step for the dynamics (and tracer if nn_acc=0) 
     42   rn_Dt      =    480.   !  time step for the dynamics (and tracer if nn_acc=0) 
    4343   rn_atfp     =   0.05    !  asselin time filter parameter 
    4444/ 
     
    213213      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    214214         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    215          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    216          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     215         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     216         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    217217      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    218          nn_baro      =  24         ! =F : the number of sub-step in rn_rdt seconds 
     218         nn_e      =  24         ! =F : the number of sub-step in rn_Dt seconds 
    219219/ 
    220220!----------------------------------------------------------------------- 
     
    273273!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    274274!!   namflo       float parameters                                      (default: OFF) 
    275 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    276275!!   nam_diadct   transports through some sections                      (default: OFF) 
    277 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    278276!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    279277!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/EXPREF/context_nemo.xml

    r12178 r12928  
    55--> 
    66<context id="nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
    88    <variable_definition> 
    9     <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
    10        <variable id="ref_year" type="int"   > 1800 </variable> 
    11        <variable id="rau0"     type="float" > 1026.0 </variable> 
    12        <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
    13        <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
    14        <variable id="rhoic"    type="float" > 917.0 </variable> 
    15        <variable id="rhosn"    type="float" > 330.0 </variable> 
    16        <variable id="missval"  type="float" > 1.e20 </variable> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"  type="float" > 1.e20 </variable>           
    1719    </variable_definition> 
     20 
    1821<!-- Fields definition --> 
    1922    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    2124<!-- Files definition --> 
    2225    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     --> 
    23     <!--  
    24 ============================================================================================================ 
    25 = grid definition = = DO NOT CHANGE = 
    26 ============================================================================================================ 
    27     --> 
    28      
    29     <axis_definition> 
    30       <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
    31       <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
    32       <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
    33       <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
    34       <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
    35       <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
    36       <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
    37       <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
    38       <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    39     </axis_definition> 
     26 
     27<!-- Axis definition --> 
     28    <axis_definition src="./axis_def_nemo.xml"/> 
    4029  
     30<!-- Domain definition --> 
    4131    <domain_definition src="./domain_def_nemo.xml"/> 
     32 
     33<!-- Grids definition --> 
     34    <grid_definition   src="./grid_def_nemo.xml"/> 
    4235   
    43     <grid_definition src="./grid_def_nemo.xml"/> 
    4436 
    4537</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/EXPREF/namelist_cfg

    r12178 r12928  
    4040!----------------------------------------------------------------------- 
    4141   ln_linssh   =  .false.  !  =T  linear free surface  ==>>  model level are fixed in time 
    42    rn_rdt      =   1440.   !  time step for the dynamics (and tracer if nn_acc=0) 
     42   rn_Dt      =   1440.   !  time step for the dynamics (and tracer if nn_acc=0) 
    4343   rn_atfp     =   0.05    !  asselin time filter parameter 
    4444/ 
     
    204204      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    205205         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    206          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    207          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     206         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     207         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    208208      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    209          nn_baro      =  24         ! =F : the number of sub-step in rn_rdt seconds 
     209         nn_e      =  24         ! =F : the number of sub-step in rn_Dt seconds 
    210210/ 
    211211!----------------------------------------------------------------------- 
     
    264264!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    265265!!   namflo       float parameters                                      (default: OFF) 
    266 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default; OFF) 
    267266!!   nam_diadct   transports through some sections                      (default: OFF) 
    268 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    269267!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    270268!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/MY_SRC/domvvl.F90

    r12178 r12928  
    88   !!            3.3  !  2011-10  (M. Leclair) totally rewrote domvvl: vvl option includes z_star and z_tilde coordinates 
    99   !!            3.6  !  2014-11  (P. Mathiot) add ice shelf capability 
     10   !!            4.1  !  2019-08  (A. Coward, D. Storkey) rename dom_vvl_sf_swp -> dom_vvl_sf_update for new timestepping 
    1011   !!---------------------------------------------------------------------- 
    1112 
     
    1314   !!   dom_vvl_init     : define initial vertical scale factors, depths and column thickness 
    1415   !!   dom_vvl_sf_nxt   : Compute next vertical scale factors 
    15    !!   dom_vvl_sf_swp   : Swap vertical scale factors and update the vertical grid 
     16   !!   dom_vvl_sf_update   : Swap vertical scale factors and update the vertical grid 
    1617   !!   dom_vvl_interpol : Interpolate vertical scale factors from one grid point to another 
    1718   !!   dom_vvl_rst      : read/write restart file 
     
    3637 
    3738   PUBLIC  dom_vvl_init       ! called by domain.F90 
     39   PUBLIC  dom_vvl_zgr        ! called by isfcpl.F90 
    3840   PUBLIC  dom_vvl_sf_nxt     ! called by step.F90 
    39    PUBLIC  dom_vvl_sf_swp     ! called by step.F90 
     41   PUBLIC  dom_vvl_sf_update  ! called by step.F90 
    4042   PUBLIC  dom_vvl_interpol   ! called by dynnxt.F90 
    4143 
     
    6264 
    6365   !! * Substitutions 
    64 #  include "vectopt_loop_substitute.h90" 
     66#  include "do_loop_substitute.h90" 
    6567   !!---------------------------------------------------------------------- 
    6668   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    9395 
    9496 
    95    SUBROUTINE dom_vvl_init 
     97   SUBROUTINE dom_vvl_init( Kbb, Kmm, Kaa ) 
    9698      !!---------------------------------------------------------------------- 
    9799      !!                ***  ROUTINE dom_vvl_init  *** 
     
    102104      !! ** Method  :  - use restart file and/or initialize 
    103105      !!               - interpolate scale factors 
     106      !! 
     107      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     108      !!              - Regrid: e3[u/v](:,:,:,Kmm) 
     109      !!                        e3[u/v](:,:,:,Kmm)        
     110      !!                        e3w(:,:,:,Kmm)            
     111      !!                        e3[u/v]w_b 
     112      !!                        e3[u/v]w_n       
     113      !!                        gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm) and gde3w 
     114      !!              - h(t/u/v)_0 
     115      !!              - frq_rst_e3t and frq_rst_hdv 
     116      !! 
     117      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
     118      !!---------------------------------------------------------------------- 
     119      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     120      ! 
     121      IF(lwp) WRITE(numout,*) 
     122      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
     123      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
     124      ! 
     125      CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
     126      ! 
     127      !                    ! Allocate module arrays 
     128      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
     129      ! 
     130      !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
     131      CALL dom_vvl_rst( nit000, Kbb, Kmm, 'READ' ) 
     132      e3t(:,:,jpk,Kaa) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
     133      ! 
     134      CALL dom_vvl_zgr(Kbb, Kmm, Kaa) ! interpolation scale factor, depth and water column 
     135      ! 
     136   END SUBROUTINE dom_vvl_init 
     137   ! 
     138   SUBROUTINE dom_vvl_zgr(Kbb, Kmm, Kaa) 
     139      !!---------------------------------------------------------------------- 
     140      !!                ***  ROUTINE dom_vvl_init  *** 
     141      !!                    
     142      !! ** Purpose :  Interpolation of all scale factors,  
     143      !!               depths and water column heights 
     144      !! 
     145      !! ** Method  :  - interpolate scale factors 
    104146      !! 
    105147      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     
    115157      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
    116158      !!---------------------------------------------------------------------- 
     159      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     160      !!---------------------------------------------------------------------- 
    117161      INTEGER ::   ji, jj, jk 
    118162      INTEGER ::   ii0, ii1, ij0, ij1 
     
    120164      !!---------------------------------------------------------------------- 
    121165      ! 
    122       IF(lwp) WRITE(numout,*) 
    123       IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
    124       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
    125       ! 
    126       CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
    127       ! 
    128       !                    ! Allocate module arrays 
    129       IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
    130       ! 
    131       !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
    132       CALL dom_vvl_rst( nit000, 'READ' ) 
    133       e3t_a(:,:,jpk) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
    134       ! 
    135166      !                    !== Set of all other vertical scale factors  ==!  (now and before) 
    136167      !                                ! Horizontal interpolation of e3t 
    137       CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' )    ! from T to U 
    138       CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' ) 
    139       CALL dom_vvl_interpol( e3t_b(:,:,:), e3v_b(:,:,:), 'V' )    ! from T to V  
    140       CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' ) 
    141       CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F' )    ! from U to F 
     168      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3u(:,:,:,Kbb), 'U' )    ! from T to U 
     169      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3u(:,:,:,Kmm), 'U' ) 
     170      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3v(:,:,:,Kbb), 'V' )    ! from T to V  
     171      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3v(:,:,:,Kmm), 'V' ) 
     172      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F' )    ! from U to F 
    142173      !                                ! Vertical interpolation of e3t,u,v  
    143       CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  )  ! from T to W 
    144       CALL dom_vvl_interpol( e3t_b(:,:,:), e3w_b (:,:,:), 'W'  ) 
    145       CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' )  ! from U to UW 
    146       CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' ) 
    147       CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' )  ! from V to UW 
    148       CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' ) 
     174      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3w (:,:,:,Kmm), 'W'  )  ! from T to W 
     175      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3w (:,:,:,Kbb), 'W'  ) 
     176      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3uw(:,:,:,Kmm), 'UW' )  ! from U to UW 
     177      CALL dom_vvl_interpol( e3u(:,:,:,Kbb), e3uw(:,:,:,Kbb), 'UW' ) 
     178      CALL dom_vvl_interpol( e3v(:,:,:,Kmm), e3vw(:,:,:,Kmm), 'VW' )  ! from V to UW 
     179      CALL dom_vvl_interpol( e3v(:,:,:,Kbb), e3vw(:,:,:,Kbb), 'VW' ) 
    149180 
    150181      ! We need to define e3[tuv]_a for AGRIF initialisation (should not be a problem for the restartability...) 
    151       e3t_a(:,:,:) = e3t_n(:,:,:) 
    152       e3u_a(:,:,:) = e3u_n(:,:,:) 
    153       e3v_a(:,:,:) = e3v_n(:,:,:) 
     182      e3t(:,:,:,Kaa) = e3t(:,:,:,Kmm) 
     183      e3u(:,:,:,Kaa) = e3u(:,:,:,Kmm) 
     184      e3v(:,:,:,Kaa) = e3v(:,:,:,Kmm) 
    154185      ! 
    155186      !                    !==  depth of t and w-point  ==!   (set the isf depth as it is in the initial timestep) 
    156       gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1)       ! reference to the ocean surface (used for MLD and light penetration) 
    157       gdepw_n(:,:,1) = 0.0_wp 
    158       gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:)  ! reference to a common level z=0 for hpg 
    159       gdept_b(:,:,1) = 0.5_wp * e3w_b(:,:,1) 
    160       gdepw_b(:,:,1) = 0.0_wp 
    161       DO jk = 2, jpk                               ! vertical sum 
    162          DO jj = 1,jpj 
    163             DO ji = 1,jpi 
    164                !    zcoef = tmask - wmask    ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
    165                !                             ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 
    166                !                             ! 0.5 where jk = mikt      
    167 !!gm ???????   BUG ?  gdept_n as well as gde3w_n  does not include the thickness of ISF ?? 
    168                zcoef = ( tmask(ji,jj,jk) - wmask(ji,jj,jk) ) 
    169                gdepw_n(ji,jj,jk) = gdepw_n(ji,jj,jk-1) + e3t_n(ji,jj,jk-1) 
    170                gdept_n(ji,jj,jk) =      zcoef  * ( gdepw_n(ji,jj,jk  ) + 0.5 * e3w_n(ji,jj,jk))  & 
    171                   &                + (1-zcoef) * ( gdept_n(ji,jj,jk-1) +       e3w_n(ji,jj,jk))  
    172                gde3w_n(ji,jj,jk) = gdept_n(ji,jj,jk) - sshn(ji,jj) 
    173                gdepw_b(ji,jj,jk) = gdepw_b(ji,jj,jk-1) + e3t_b(ji,jj,jk-1) 
    174                gdept_b(ji,jj,jk) =      zcoef  * ( gdepw_b(ji,jj,jk  ) + 0.5 * e3w_b(ji,jj,jk))  & 
    175                   &                + (1-zcoef) * ( gdept_b(ji,jj,jk-1) +       e3w_b(ji,jj,jk))  
    176             END DO 
    177          END DO 
     187      gdept(:,:,1,Kmm) = 0.5_wp * e3w(:,:,1,Kmm)       ! reference to the ocean surface (used for MLD and light penetration) 
     188      gdepw(:,:,1,Kmm) = 0.0_wp 
     189      gde3w(:,:,1) = gdept(:,:,1,Kmm) - ssh(:,:,Kmm)  ! reference to a common level z=0 for hpg 
     190      gdept(:,:,1,Kbb) = 0.5_wp * e3w(:,:,1,Kbb) 
     191      gdepw(:,:,1,Kbb) = 0.0_wp 
     192      DO_3D_11_11( 2, jpk ) 
     193         !    zcoef = tmask - wmask    ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     194         !                             ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 
     195         !                             ! 0.5 where jk = mikt      
     196!!gm ???????   BUG ?  gdept(:,:,:,Kmm) as well as gde3w  does not include the thickness of ISF ?? 
     197         zcoef = ( tmask(ji,jj,jk) - wmask(ji,jj,jk) ) 
     198         gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 
     199         gdept(ji,jj,jk,Kmm) =      zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm))  & 
     200            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm))  
     201         gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 
     202         gdepw(ji,jj,jk,Kbb) = gdepw(ji,jj,jk-1,Kbb) + e3t(ji,jj,jk-1,Kbb) 
     203         gdept(ji,jj,jk,Kbb) =      zcoef  * ( gdepw(ji,jj,jk  ,Kbb) + 0.5 * e3w(ji,jj,jk,Kbb))  & 
     204            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kbb) +       e3w(ji,jj,jk,Kbb))  
     205      END_3D 
     206      ! 
     207      !                    !==  thickness of the water column  !!   (ocean portion only) 
     208      ht(:,:) = e3t(:,:,1,Kmm) * tmask(:,:,1)   !!gm  BUG  :  this should be 1/2 * e3w(k=1) .... 
     209      hu(:,:,Kbb) = e3u(:,:,1,Kbb) * umask(:,:,1) 
     210      hu(:,:,Kmm) = e3u(:,:,1,Kmm) * umask(:,:,1) 
     211      hv(:,:,Kbb) = e3v(:,:,1,Kbb) * vmask(:,:,1) 
     212      hv(:,:,Kmm) = e3v(:,:,1,Kmm) * vmask(:,:,1) 
     213      DO jk = 2, jpkm1 
     214         ht(:,:) = ht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
     215         hu(:,:,Kbb) = hu(:,:,Kbb) + e3u(:,:,jk,Kbb) * umask(:,:,jk) 
     216         hu(:,:,Kmm) = hu(:,:,Kmm) + e3u(:,:,jk,Kmm) * umask(:,:,jk) 
     217         hv(:,:,Kbb) = hv(:,:,Kbb) + e3v(:,:,jk,Kbb) * vmask(:,:,jk) 
     218         hv(:,:,Kmm) = hv(:,:,Kmm) + e3v(:,:,jk,Kmm) * vmask(:,:,jk) 
    178219      END DO 
    179220      ! 
    180       !                    !==  thickness of the water column  !!   (ocean portion only) 
    181       ht_n(:,:) = e3t_n(:,:,1) * tmask(:,:,1)   !!gm  BUG  :  this should be 1/2 * e3w(k=1) .... 
    182       hu_b(:,:) = e3u_b(:,:,1) * umask(:,:,1) 
    183       hu_n(:,:) = e3u_n(:,:,1) * umask(:,:,1) 
    184       hv_b(:,:) = e3v_b(:,:,1) * vmask(:,:,1) 
    185       hv_n(:,:) = e3v_n(:,:,1) * vmask(:,:,1) 
    186       DO jk = 2, jpkm1 
    187          ht_n(:,:) = ht_n(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
    188          hu_b(:,:) = hu_b(:,:) + e3u_b(:,:,jk) * umask(:,:,jk) 
    189          hu_n(:,:) = hu_n(:,:) + e3u_n(:,:,jk) * umask(:,:,jk) 
    190          hv_b(:,:) = hv_b(:,:) + e3v_b(:,:,jk) * vmask(:,:,jk) 
    191          hv_n(:,:) = hv_n(:,:) + e3v_n(:,:,jk) * vmask(:,:,jk) 
    192       END DO 
    193       ! 
    194221      !                    !==  inverse of water column thickness   ==!   (u- and v- points) 
    195       r1_hu_b(:,:) = ssumask(:,:) / ( hu_b(:,:) + 1._wp - ssumask(:,:) )    ! _i mask due to ISF 
    196       r1_hu_n(:,:) = ssumask(:,:) / ( hu_n(:,:) + 1._wp - ssumask(:,:) ) 
    197       r1_hv_b(:,:) = ssvmask(:,:) / ( hv_b(:,:) + 1._wp - ssvmask(:,:) ) 
    198       r1_hv_n(:,:) = ssvmask(:,:) / ( hv_n(:,:) + 1._wp - ssvmask(:,:) ) 
     222      r1_hu(:,:,Kbb) = ssumask(:,:) / ( hu(:,:,Kbb) + 1._wp - ssumask(:,:) )    ! _i mask due to ISF 
     223      r1_hu(:,:,Kmm) = ssumask(:,:) / ( hu(:,:,Kmm) + 1._wp - ssumask(:,:) ) 
     224      r1_hv(:,:,Kbb) = ssvmask(:,:) / ( hv(:,:,Kbb) + 1._wp - ssvmask(:,:) ) 
     225      r1_hv(:,:,Kmm) = ssvmask(:,:) / ( hv(:,:,Kmm) + 1._wp - ssvmask(:,:) ) 
    199226 
    200227      !                    !==   z_tilde coordinate case  ==!   (Restoring frequencies) 
     
    208235         IF( ln_vvl_ztilde_as_zstar ) THEN   ! z-star emulation using z-tile 
    209236            frq_rst_e3t(:,:) = 0._wp               !Ignore namelist settings 
    210             frq_rst_hdv(:,:) = 1._wp / rdt 
     237            frq_rst_hdv(:,:) = 1._wp / rn_Dt 
    211238         ENDIF 
    212239         IF ( ln_vvl_zstar_at_eqtor ) THEN   ! use z-star in vicinity of the Equator 
    213             DO jj = 1, jpj 
    214                DO ji = 1, jpi 
     240            DO_2D_11_11 
    215241!!gm  case |gphi| >= 6 degrees is useless   initialized just above by default 
    216                   IF( ABS(gphit(ji,jj)) >= 6.) THEN 
    217                      ! values outside the equatorial band and transition zone (ztilde) 
    218                      frq_rst_e3t(ji,jj) =  2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.e0_wp ) 
    219                      frq_rst_hdv(ji,jj) =  2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.e0_wp ) 
    220                   ELSEIF( ABS(gphit(ji,jj)) <= 2.5) THEN    ! Equator strip ==> z-star 
    221                      ! values inside the equatorial band (ztilde as zstar) 
    222                      frq_rst_e3t(ji,jj) =  0.0_wp 
    223                      frq_rst_hdv(ji,jj) =  1.0_wp / rdt 
    224                   ELSE                                      ! transition band (2.5 to 6 degrees N/S) 
    225                      !                                      ! (linearly transition from z-tilde to z-star) 
    226                      frq_rst_e3t(ji,jj) = 0.0_wp + (frq_rst_e3t(ji,jj)-0.0_wp)*0.5_wp   & 
    227                         &            * (  1.0_wp - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
    228                         &                                          * 180._wp / 3.5_wp ) ) 
    229                      frq_rst_hdv(ji,jj) = (1.0_wp / rdt)                                & 
    230                         &            + (  frq_rst_hdv(ji,jj)-(1.e0_wp / rdt) )*0.5_wp   & 
    231                         &            * (  1._wp  - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
    232                         &                                          * 180._wp / 3.5_wp ) ) 
    233                   ENDIF 
    234                END DO 
    235             END DO 
     242               IF( ABS(gphit(ji,jj)) >= 6.) THEN 
     243                  ! values outside the equatorial band and transition zone (ztilde) 
     244                  frq_rst_e3t(ji,jj) =  2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.e0_wp ) 
     245                  frq_rst_hdv(ji,jj) =  2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.e0_wp ) 
     246               ELSEIF( ABS(gphit(ji,jj)) <= 2.5) THEN    ! Equator strip ==> z-star 
     247                  ! values inside the equatorial band (ztilde as zstar) 
     248                  frq_rst_e3t(ji,jj) =  0.0_wp 
     249                  frq_rst_hdv(ji,jj) =  1.0_wp / rn_Dt 
     250               ELSE                                      ! transition band (2.5 to 6 degrees N/S) 
     251                  !                                      ! (linearly transition from z-tilde to z-star) 
     252                  frq_rst_e3t(ji,jj) = 0.0_wp + (frq_rst_e3t(ji,jj)-0.0_wp)*0.5_wp   & 
     253                     &            * (  1.0_wp - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     254                     &                                          * 180._wp / 3.5_wp ) ) 
     255                  frq_rst_hdv(ji,jj) = (1.0_wp / rn_Dt)                                & 
     256                     &            + (  frq_rst_hdv(ji,jj)-(1.e0_wp / rn_Dt) )*0.5_wp   & 
     257                     &            * (  1._wp  - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     258                     &                                          * 180._wp / 3.5_wp ) ) 
     259               ENDIF 
     260            END_2D 
    236261            IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN 
    237262               IF( nn_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2 
     
    239264                  ij0 = 128   ;   ij1 = 135   ;    
    240265                  frq_rst_e3t( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  0.0_wp 
    241                   frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rdt 
     266                  frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rn_Dt 
    242267               ENDIF 
    243268            ENDIF 
     
    263288      ENDIF 
    264289      ! 
    265    END SUBROUTINE dom_vvl_init 
    266  
    267  
    268    SUBROUTINE dom_vvl_sf_nxt( kt, kcall )  
     290   END SUBROUTINE dom_vvl_zgr 
     291 
     292 
     293   SUBROUTINE dom_vvl_sf_nxt( kt, Kbb, Kmm, Kaa, kcall )  
    269294      !!---------------------------------------------------------------------- 
    270295      !!                ***  ROUTINE dom_vvl_sf_nxt  *** 
     
    288313      !! Reference  : Leclair, M., and Madec, G. 2011, Ocean Modelling. 
    289314      !!---------------------------------------------------------------------- 
    290       INTEGER, INTENT( in )           ::   kt      ! time step 
    291       INTEGER, INTENT( in ), OPTIONAL ::   kcall   ! optional argument indicating call sequence 
     315      INTEGER, INTENT( in )           ::   kt             ! time step 
     316      INTEGER, INTENT( in )           ::   Kbb, Kmm, Kaa  ! time step 
     317      INTEGER, INTENT( in ), OPTIONAL ::   kcall          ! optional argument indicating call sequence 
    292318      ! 
    293319      INTEGER                ::   ji, jj, jk            ! dummy loop indices 
    294320      INTEGER , DIMENSION(3) ::   ijk_max, ijk_min      ! temporary integers 
    295       REAL(wp)               ::   z2dt, z_tmin, z_tmax  ! local scalars 
     321      REAL(wp)               ::   z_tmin, z_tmax        ! local scalars 
    296322      LOGICAL                ::   ll_do_bclinic         ! local logical 
    297323      REAL(wp), DIMENSION(jpi,jpj)     ::   zht, z_scale, zwu, zwv, zhdiv 
     
    321347      !                                                ! --------------------------------------------- ! 
    322348      ! 
    323       z_scale(:,:) = ( ssha(:,:) - sshb(:,:) ) * ssmask(:,:) / ( ht_0(:,:) + sshn(:,:) + 1. - ssmask(:,:) ) 
     349      z_scale(:,:) = ( ssh(:,:,Kaa) - ssh(:,:,Kbb) ) * ssmask(:,:) / ( ht_0(:,:) + ssh(:,:,Kmm) + 1. - ssmask(:,:) ) 
    324350      DO jk = 1, jpkm1 
    325          ! formally this is the same as e3t_a = e3t_0*(1+ssha/ht_0) 
    326          e3t_a(:,:,jk) = e3t_b(:,:,jk) + e3t_n(:,:,jk) * z_scale(:,:) * tmask(:,:,jk) 
     351         ! formally this is the same as e3t(:,:,:,Kaa) = e3t_0*(1+ssha/ht_0) 
     352         e3t(:,:,jk,Kaa) = e3t(:,:,jk,Kbb) + e3t(:,:,jk,Kmm) * z_scale(:,:) * tmask(:,:,jk) 
    327353      END DO 
    328354      ! 
    329       IF( ln_vvl_ztilde .OR. ln_vvl_layer .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
    330          !                                                            ! ------baroclinic part------ ! 
     355      IF( (ln_vvl_ztilde .OR. ln_vvl_layer) .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
     356         !                                                               ! ------baroclinic part------ ! 
    331357         ! I - initialization 
    332358         ! ================== 
     
    337363         zht(:,:)   = 0._wp 
    338364         DO jk = 1, jpkm1 
    339             zhdiv(:,:) = zhdiv(:,:) + e3t_n(:,:,jk) * hdivn(:,:,jk) 
    340             zht  (:,:) = zht  (:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     365            zhdiv(:,:) = zhdiv(:,:) + e3t(:,:,jk,Kmm) * hdiv(:,:,jk) 
     366            zht  (:,:) = zht  (:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    341367         END DO 
    342368         zhdiv(:,:) = zhdiv(:,:) / ( zht(:,:) + 1. - tmask_i(:,:) ) 
     
    347373            IF( kt > nit000 ) THEN 
    348374               DO jk = 1, jpkm1 
    349                   hdiv_lf(:,:,jk) = hdiv_lf(:,:,jk) - rdt * frq_rst_hdv(:,:)   & 
    350                      &          * ( hdiv_lf(:,:,jk) - e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) ) 
     375                  hdiv_lf(:,:,jk) = hdiv_lf(:,:,jk) - rn_Dt * frq_rst_hdv(:,:)   & 
     376                     &          * ( hdiv_lf(:,:,jk) - e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) ) 
    351377               END DO 
    352378            ENDIF 
     
    361387         IF( ln_vvl_ztilde ) THEN     ! z_tilde case 
    362388            DO jk = 1, jpkm1 
    363                tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) - ( e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) - hdiv_lf(:,:,jk) ) 
     389               tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) - ( e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) - hdiv_lf(:,:,jk) ) 
    364390            END DO 
    365391         ELSE                         ! layer case 
    366392            DO jk = 1, jpkm1 
    367                tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) -   e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) * tmask(:,:,jk) 
     393               tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) -   e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) * tmask(:,:,jk) 
    368394            END DO 
    369395         ENDIF 
     
    381407         zwu(:,:) = 0._wp 
    382408         zwv(:,:) = 0._wp 
    383          DO jk = 1, jpkm1        ! a - first derivative: diffusive fluxes 
    384             DO jj = 1, jpjm1 
    385                DO ji = 1, fs_jpim1   ! vector opt. 
    386                   un_td(ji,jj,jk) = rn_ahe3 * umask(ji,jj,jk) * e2_e1u(ji,jj)           & 
    387                      &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji+1,jj  ,jk) ) 
    388                   vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj)           &  
    389                      &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji  ,jj+1,jk) ) 
    390                   zwu(ji,jj) = zwu(ji,jj) + un_td(ji,jj,jk) 
    391                   zwv(ji,jj) = zwv(ji,jj) + vn_td(ji,jj,jk) 
    392                END DO 
    393             END DO 
    394          END DO 
    395          DO jj = 1, jpj          ! b - correction for last oceanic u-v points 
    396             DO ji = 1, jpi 
    397                un_td(ji,jj,mbku(ji,jj)) = un_td(ji,jj,mbku(ji,jj)) - zwu(ji,jj) 
    398                vn_td(ji,jj,mbkv(ji,jj)) = vn_td(ji,jj,mbkv(ji,jj)) - zwv(ji,jj) 
    399             END DO 
    400          END DO 
    401          DO jk = 1, jpkm1        ! c - second derivative: divergence of diffusive fluxes 
    402             DO jj = 2, jpjm1 
    403                DO ji = fs_2, fs_jpim1   ! vector opt. 
    404                   tilde_e3t_a(ji,jj,jk) = tilde_e3t_a(ji,jj,jk) + (   un_td(ji-1,jj  ,jk) - un_td(ji,jj,jk)    & 
    405                      &                                          +     vn_td(ji  ,jj-1,jk) - vn_td(ji,jj,jk)    & 
    406                      &                                            ) * r1_e1e2t(ji,jj) 
    407                END DO 
    408             END DO 
    409          END DO 
     409         DO_3D_10_10( 1, jpkm1 ) 
     410            un_td(ji,jj,jk) = rn_ahe3 * umask(ji,jj,jk) * e2_e1u(ji,jj)           & 
     411               &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji+1,jj  ,jk) ) 
     412            vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj)           &  
     413               &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji  ,jj+1,jk) ) 
     414            zwu(ji,jj) = zwu(ji,jj) + un_td(ji,jj,jk) 
     415            zwv(ji,jj) = zwv(ji,jj) + vn_td(ji,jj,jk) 
     416         END_3D 
     417         DO_2D_11_11 
     418            un_td(ji,jj,mbku(ji,jj)) = un_td(ji,jj,mbku(ji,jj)) - zwu(ji,jj) 
     419            vn_td(ji,jj,mbkv(ji,jj)) = vn_td(ji,jj,mbkv(ji,jj)) - zwv(ji,jj) 
     420         END_2D 
     421         DO_3D_00_00( 1, jpkm1 ) 
     422            tilde_e3t_a(ji,jj,jk) = tilde_e3t_a(ji,jj,jk) + (   un_td(ji-1,jj  ,jk) - un_td(ji,jj,jk)    & 
     423               &                                          +     vn_td(ji  ,jj-1,jk) - vn_td(ji,jj,jk)    & 
     424               &                                            ) * r1_e1e2t(ji,jj) 
     425         END_3D 
    410426         !                       ! d - thickness diffusion transport: boundary conditions 
    411427         !                             (stored for tracer advction and continuity equation) 
     
    414430         ! 4 - Time stepping of baroclinic scale factors 
    415431         ! --------------------------------------------- 
    416          ! Leapfrog time stepping 
    417          ! ~~~~~~~~~~~~~~~~~~~~~~ 
    418          IF( neuler == 0 .AND. kt == nit000 ) THEN 
    419             z2dt =  rdt 
    420          ELSE 
    421             z2dt = 2.0_wp * rdt 
    422          ENDIF 
    423432         CALL lbc_lnk( 'domvvl', tilde_e3t_a(:,:,:), 'T', 1._wp ) 
    424          tilde_e3t_a(:,:,:) = tilde_e3t_b(:,:,:) + z2dt * tmask(:,:,:) * tilde_e3t_a(:,:,:) 
     433         tilde_e3t_a(:,:,:) = tilde_e3t_b(:,:,:) + rDt * tmask(:,:,:) * tilde_e3t_a(:,:,:) 
    425434 
    426435         ! Maximum deformation control 
     
    476485            zht(:,:)  = zht(:,:) + tilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
    477486         END DO 
    478          z_scale(:,:) =  - zht(:,:) / ( ht_0(:,:) + sshn(:,:) + 1. - ssmask(:,:) ) 
     487         z_scale(:,:) =  - zht(:,:) / ( ht_0(:,:) + ssh(:,:,Kmm) + 1. - ssmask(:,:) ) 
    479488         DO jk = 1, jpkm1 
    480             dtilde_e3t_a(:,:,jk) = dtilde_e3t_a(:,:,jk) + e3t_n(:,:,jk) * z_scale(:,:) * tmask(:,:,jk) 
     489            dtilde_e3t_a(:,:,jk) = dtilde_e3t_a(:,:,jk) + e3t(:,:,jk,Kmm) * z_scale(:,:) * tmask(:,:,jk) 
    481490         END DO 
    482491 
     
    486495      !                                           ! ---baroclinic part--------- ! 
    487496         DO jk = 1, jpkm1 
    488             e3t_a(:,:,jk) = e3t_a(:,:,jk) + dtilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
     497            e3t(:,:,jk,Kaa) = e3t(:,:,jk,Kaa) + dtilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
    489498         END DO 
    490499      ENDIF 
     
    501510         zht(:,:) = 0.0_wp 
    502511         DO jk = 1, jpkm1 
    503             zht(:,:) = zht(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
    504          END DO 
    505          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + sshn(:,:) - zht(:,:) ) ) 
     512            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
     513         END DO 
     514         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kmm) - zht(:,:) ) ) 
    506515         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    507          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshn-SUM(e3t_n))) =', z_tmax 
     516         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshn-SUM(e3t(:,:,:,Kmm)))) =', z_tmax 
    508517         ! 
    509518         zht(:,:) = 0.0_wp 
    510519         DO jk = 1, jpkm1 
    511             zht(:,:) = zht(:,:) + e3t_a(:,:,jk) * tmask(:,:,jk) 
    512          END DO 
    513          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssha(:,:) - zht(:,:) ) ) 
     520            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kaa) * tmask(:,:,jk) 
     521         END DO 
     522         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kaa) - zht(:,:) ) ) 
    514523         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    515          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+ssha-SUM(e3t_a))) =', z_tmax 
     524         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+ssha-SUM(e3t(:,:,:,Kaa)))) =', z_tmax 
    516525         ! 
    517526         zht(:,:) = 0.0_wp 
    518527         DO jk = 1, jpkm1 
    519             zht(:,:) = zht(:,:) + e3t_b(:,:,jk) * tmask(:,:,jk) 
    520          END DO 
    521          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + sshb(:,:) - zht(:,:) ) ) 
     528            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kbb) * tmask(:,:,jk) 
     529         END DO 
     530         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kbb) - zht(:,:) ) ) 
    522531         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    523          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshb-SUM(e3t_b))) =', z_tmax 
    524          ! 
    525          z_tmax = MAXVAL( tmask(:,:,1) *  ABS( sshb(:,:) ) ) 
     532         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshb-SUM(e3t(:,:,:,Kbb)))) =', z_tmax 
     533         ! 
     534         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kbb) ) ) 
    526535         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    527          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(sshb))) =', z_tmax 
    528          ! 
    529          z_tmax = MAXVAL( tmask(:,:,1) *  ABS( sshn(:,:) ) ) 
     536         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kbb)))) =', z_tmax 
     537         ! 
     538         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kmm) ) ) 
    530539         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    531          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(sshn))) =', z_tmax 
    532          ! 
    533          z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssha(:,:) ) ) 
     540         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kmm)))) =', z_tmax 
     541         ! 
     542         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kaa) ) ) 
    534543         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    535          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssha))) =', z_tmax 
     544         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kaa)))) =', z_tmax 
    536545      END IF 
    537546 
     
    540549      ! *********************************** ! 
    541550 
    542       CALL dom_vvl_interpol( e3t_a(:,:,:), e3u_a(:,:,:), 'U' ) 
    543       CALL dom_vvl_interpol( e3t_a(:,:,:), e3v_a(:,:,:), 'V' ) 
     551      CALL dom_vvl_interpol( e3t(:,:,:,Kaa), e3u(:,:,:,Kaa), 'U' ) 
     552      CALL dom_vvl_interpol( e3t(:,:,:,Kaa), e3v(:,:,:,Kaa), 'V' ) 
    544553 
    545554      ! *********************************** ! 
     
    547556      ! *********************************** ! 
    548557 
    549       hu_a(:,:) = e3u_a(:,:,1) * umask(:,:,1) 
    550       hv_a(:,:) = e3v_a(:,:,1) * vmask(:,:,1) 
     558      hu(:,:,Kaa) = e3u(:,:,1,Kaa) * umask(:,:,1) 
     559      hv(:,:,Kaa) = e3v(:,:,1,Kaa) * vmask(:,:,1) 
    551560      DO jk = 2, jpkm1 
    552          hu_a(:,:) = hu_a(:,:) + e3u_a(:,:,jk) * umask(:,:,jk) 
    553          hv_a(:,:) = hv_a(:,:) + e3v_a(:,:,jk) * vmask(:,:,jk) 
     561         hu(:,:,Kaa) = hu(:,:,Kaa) + e3u(:,:,jk,Kaa) * umask(:,:,jk) 
     562         hv(:,:,Kaa) = hv(:,:,Kaa) + e3v(:,:,jk,Kaa) * vmask(:,:,jk) 
    554563      END DO 
    555564      !                                        ! Inverse of the local depth 
    556565!!gm BUG ?  don't understand the use of umask_i here ..... 
    557       r1_hu_a(:,:) = ssumask(:,:) / ( hu_a(:,:) + 1._wp - ssumask(:,:) ) 
    558       r1_hv_a(:,:) = ssvmask(:,:) / ( hv_a(:,:) + 1._wp - ssvmask(:,:) ) 
     566      r1_hu(:,:,Kaa) = ssumask(:,:) / ( hu(:,:,Kaa) + 1._wp - ssumask(:,:) ) 
     567      r1_hv(:,:,Kaa) = ssvmask(:,:) / ( hv(:,:,Kaa) + 1._wp - ssvmask(:,:) ) 
    559568      ! 
    560569      IF( ln_timing )   CALL timing_stop('dom_vvl_sf_nxt') 
     
    563572 
    564573 
    565    SUBROUTINE dom_vvl_sf_swp( kt ) 
    566       !!---------------------------------------------------------------------- 
    567       !!                ***  ROUTINE dom_vvl_sf_swp  *** 
     574   SUBROUTINE dom_vvl_sf_update( kt, Kbb, Kmm, Kaa ) 
     575      !!---------------------------------------------------------------------- 
     576      !!                ***  ROUTINE dom_vvl_sf_update  *** 
    568577      !!                    
    569       !! ** Purpose :  compute time filter and swap of scale factors  
     578      !! ** Purpose :  for z tilde case: compute time filter and swap of scale factors  
    570579      !!               compute all depths and related variables for next time step 
    571580      !!               write outputs and restart file 
    572581      !! 
    573       !! ** Method  :  - swap of e3t with trick for volume/tracer conservation 
     582      !! ** Method  :  - swap of e3t with trick for volume/tracer conservation (ONLY FOR Z TILDE CASE) 
    574583      !!               - reconstruct scale factor at other grid points (interpolate) 
    575584      !!               - recompute depths and water height fields 
    576585      !! 
    577       !! ** Action  :  - e3t_(b/n), tilde_e3t_(b/n) and e3(u/v)_n ready for next time step 
     586      !! ** Action  :  - tilde_e3t_(b/n) ready for next time step 
    578587      !!               - Recompute: 
    579588      !!                    e3(u/v)_b        
    580       !!                    e3w_n            
     589      !!                    e3w(:,:,:,Kmm)            
    581590      !!                    e3(u/v)w_b       
    582591      !!                    e3(u/v)w_n       
    583       !!                    gdept_n, gdepw_n  and gde3w_n 
     592      !!                    gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm)  and gde3w 
    584593      !!                    h(u/v) and h(u/v)r 
    585594      !! 
     
    587596      !!              Leclair, M., and G. Madec, 2011, Ocean Modelling. 
    588597      !!---------------------------------------------------------------------- 
    589       INTEGER, INTENT( in ) ::   kt   ! time step 
     598      INTEGER, INTENT( in ) ::   kt              ! time step 
     599      INTEGER, INTENT( in ) ::   Kbb, Kmm, Kaa   ! time level indices 
    590600      ! 
    591601      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     
    595605      IF( ln_linssh )   RETURN      ! No calculation in linear free surface 
    596606      ! 
    597       IF( ln_timing )   CALL timing_start('dom_vvl_sf_swp') 
     607      IF( ln_timing )   CALL timing_start('dom_vvl_sf_update') 
    598608      ! 
    599609      IF( kt == nit000 )   THEN 
    600610         IF(lwp) WRITE(numout,*) 
    601          IF(lwp) WRITE(numout,*) 'dom_vvl_sf_swp : - time filter and swap of scale factors' 
    602          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~   - interpolate scale factors and compute depths for next time step' 
     611         IF(lwp) WRITE(numout,*) 'dom_vvl_sf_update : - interpolate scale factors and compute depths for next time step' 
     612         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~' 
    603613      ENDIF 
    604614      ! 
     
    607617      ! - ML - e3(t/u/v)_b are allready computed in dynnxt. 
    608618      IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN 
    609          IF( neuler == 0 .AND. kt == nit000 ) THEN 
     619         IF( l_1st_euler ) THEN 
    610620            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) 
    611621         ELSE 
    612622            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) &  
    613             &         + atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) ) 
     623            &         + rn_atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) ) 
    614624         ENDIF 
    615625         tilde_e3t_n(:,:,:) = tilde_e3t_a(:,:,:) 
    616626      ENDIF 
    617       gdept_b(:,:,:) = gdept_n(:,:,:) 
    618       gdepw_b(:,:,:) = gdepw_n(:,:,:) 
    619  
    620       e3t_n(:,:,:) = e3t_a(:,:,:) 
    621       e3u_n(:,:,:) = e3u_a(:,:,:) 
    622       e3v_n(:,:,:) = e3v_a(:,:,:) 
    623627 
    624628      ! Compute all missing vertical scale factor and depths 
     
    626630      ! Horizontal scale factor interpolations 
    627631      ! -------------------------------------- 
    628       ! - ML - e3u_b and e3v_b are allready computed in dynnxt 
    629       ! - JC - hu_b, hv_b, hur_b, hvr_b also 
     632      ! - ML - e3u(:,:,:,Kbb) and e3v(:,:,:,Kbb) are already computed in dynnxt 
     633      ! - JC - hu(:,:,:,Kbb), hv(:,:,:,:,Kbb), hur_b, hvr_b also 
    630634       
    631       CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F'  ) 
     635      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F'  ) 
    632636       
    633637      ! Vertical scale factor interpolations 
    634       CALL dom_vvl_interpol( e3t_n(:,:,:),  e3w_n(:,:,:), 'W'  ) 
    635       CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' ) 
    636       CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' ) 
    637       CALL dom_vvl_interpol( e3t_b(:,:,:),  e3w_b(:,:,:), 'W'  ) 
    638       CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' ) 
    639       CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' ) 
     638      CALL dom_vvl_interpol( e3t(:,:,:,Kmm),  e3w(:,:,:,Kmm), 'W'  ) 
     639      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3uw(:,:,:,Kmm), 'UW' ) 
     640      CALL dom_vvl_interpol( e3v(:,:,:,Kmm), e3vw(:,:,:,Kmm), 'VW' ) 
     641      CALL dom_vvl_interpol( e3t(:,:,:,Kbb),  e3w(:,:,:,Kbb), 'W'  ) 
     642      CALL dom_vvl_interpol( e3u(:,:,:,Kbb), e3uw(:,:,:,Kbb), 'UW' ) 
     643      CALL dom_vvl_interpol( e3v(:,:,:,Kbb), e3vw(:,:,:,Kbb), 'VW' ) 
    640644 
    641645      ! t- and w- points depth (set the isf depth as it is in the initial step) 
    642       gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1) 
    643       gdepw_n(:,:,1) = 0.0_wp 
    644       gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:) 
    645       DO jk = 2, jpk 
    646          DO jj = 1,jpj 
    647             DO ji = 1,jpi 
    648               !    zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))   ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
    649                                                                  ! 1 for jk = mikt 
    650                zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
    651                gdepw_n(ji,jj,jk) = gdepw_n(ji,jj,jk-1) + e3t_n(ji,jj,jk-1) 
    652                gdept_n(ji,jj,jk) =    zcoef  * ( gdepw_n(ji,jj,jk  ) + 0.5 * e3w_n(ji,jj,jk) )  & 
    653                    &             + (1-zcoef) * ( gdept_n(ji,jj,jk-1) +       e3w_n(ji,jj,jk) )  
    654                gde3w_n(ji,jj,jk) = gdept_n(ji,jj,jk) - sshn(ji,jj) 
    655             END DO 
    656          END DO 
    657       END DO 
     646      gdept(:,:,1,Kmm) = 0.5_wp * e3w(:,:,1,Kmm) 
     647      gdepw(:,:,1,Kmm) = 0.0_wp 
     648      gde3w(:,:,1) = gdept(:,:,1,Kmm) - ssh(:,:,Kmm) 
     649      DO_3D_11_11( 2, jpk ) 
     650        !    zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))   ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     651                                                           ! 1 for jk = mikt 
     652         zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
     653         gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 
     654         gdept(ji,jj,jk,Kmm) =    zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm) )  & 
     655             &             + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm) )  
     656         gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 
     657      END_3D 
    658658 
    659659      ! Local depth and Inverse of the local depth of the water 
    660660      ! ------------------------------------------------------- 
    661       hu_n(:,:) = hu_a(:,:)   ;   r1_hu_n(:,:) = r1_hu_a(:,:) 
    662       hv_n(:,:) = hv_a(:,:)   ;   r1_hv_n(:,:) = r1_hv_a(:,:) 
    663       ! 
    664       ht_n(:,:) = e3t_n(:,:,1) * tmask(:,:,1) 
     661      ! 
     662      ht(:,:) = e3t(:,:,1,Kmm) * tmask(:,:,1) 
    665663      DO jk = 2, jpkm1 
    666          ht_n(:,:) = ht_n(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     664         ht(:,:) = ht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    667665      END DO 
    668666 
    669667      ! write restart file 
    670668      ! ================== 
    671       IF( lrst_oce  )   CALL dom_vvl_rst( kt, 'WRITE' ) 
    672       ! 
    673       IF( ln_timing )   CALL timing_stop('dom_vvl_sf_swp') 
    674       ! 
    675    END SUBROUTINE dom_vvl_sf_swp 
     669      IF( lrst_oce  )   CALL dom_vvl_rst( kt, Kbb, Kmm, 'WRITE' ) 
     670      ! 
     671      IF( ln_timing )   CALL timing_stop('dom_vvl_sf_update') 
     672      ! 
     673   END SUBROUTINE dom_vvl_sf_update 
    676674 
    677675 
     
    704702         ! 
    705703      CASE( 'U' )                   !* from T- to U-point : hor. surface weighted mean 
    706          DO jk = 1, jpk 
    707             DO jj = 1, jpjm1 
    708                DO ji = 1, fs_jpim1   ! vector opt. 
    709                   pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2u(ji,jj)   & 
    710                      &                       * (   e1e2t(ji  ,jj) * ( pe3_in(ji  ,jj,jk) - e3t_0(ji  ,jj,jk) )     & 
    711                      &                           + e1e2t(ji+1,jj) * ( pe3_in(ji+1,jj,jk) - e3t_0(ji+1,jj,jk) ) ) 
    712                END DO 
    713             END DO 
    714          END DO 
     704         DO_3D_10_10( 1, jpk ) 
     705            pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2u(ji,jj)   & 
     706               &                       * (   e1e2t(ji  ,jj) * ( pe3_in(ji  ,jj,jk) - e3t_0(ji  ,jj,jk) )     & 
     707               &                           + e1e2t(ji+1,jj) * ( pe3_in(ji+1,jj,jk) - e3t_0(ji+1,jj,jk) ) ) 
     708         END_3D 
    715709         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'U', 1._wp ) 
    716710         pe3_out(:,:,:) = pe3_out(:,:,:) + e3u_0(:,:,:) 
    717711         ! 
    718712      CASE( 'V' )                   !* from T- to V-point : hor. surface weighted mean 
    719          DO jk = 1, jpk 
    720             DO jj = 1, jpjm1 
    721                DO ji = 1, fs_jpim1   ! vector opt. 
    722                   pe3_out(ji,jj,jk) = 0.5_wp * ( vmask(ji,jj,jk)  * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2v(ji,jj)   & 
    723                      &                       * (   e1e2t(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3t_0(ji,jj  ,jk) )     & 
    724                      &                           + e1e2t(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3t_0(ji,jj+1,jk) ) ) 
    725                END DO 
    726             END DO 
    727          END DO 
     713         DO_3D_10_10( 1, jpk ) 
     714            pe3_out(ji,jj,jk) = 0.5_wp * ( vmask(ji,jj,jk)  * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2v(ji,jj)   & 
     715               &                       * (   e1e2t(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3t_0(ji,jj  ,jk) )     & 
     716               &                           + e1e2t(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3t_0(ji,jj+1,jk) ) ) 
     717         END_3D 
    728718         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'V', 1._wp ) 
    729719         pe3_out(:,:,:) = pe3_out(:,:,:) + e3v_0(:,:,:) 
    730720         ! 
    731721      CASE( 'F' )                   !* from U-point to F-point : hor. surface weighted mean 
    732          DO jk = 1, jpk 
    733             DO jj = 1, jpjm1 
    734                DO ji = 1, fs_jpim1   ! vector opt. 
    735                   pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * umask(ji,jj+1,jk) * (1.0_wp - zlnwd) + zlnwd ) & 
    736                      &                       *    r1_e1e2f(ji,jj)                                                  & 
    737                      &                       * (   e1e2u(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3u_0(ji,jj  ,jk) )     & 
    738                      &                           + e1e2u(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3u_0(ji,jj+1,jk) ) ) 
    739                END DO 
    740             END DO 
    741          END DO 
     722         DO_3D_10_10( 1, jpk ) 
     723            pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * umask(ji,jj+1,jk) * (1.0_wp - zlnwd) + zlnwd ) & 
     724               &                       *    r1_e1e2f(ji,jj)                                                  & 
     725               &                       * (   e1e2u(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3u_0(ji,jj  ,jk) )     & 
     726               &                           + e1e2u(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3u_0(ji,jj+1,jk) ) ) 
     727         END_3D 
    742728         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'F', 1._wp ) 
    743729         pe3_out(:,:,:) = pe3_out(:,:,:) + e3f_0(:,:,:) 
     
    783769 
    784770 
    785    SUBROUTINE dom_vvl_rst( kt, cdrw ) 
     771   SUBROUTINE dom_vvl_rst( kt, Kbb, Kmm, cdrw ) 
    786772      !!--------------------------------------------------------------------- 
    787773      !!                   ***  ROUTINE dom_vvl_rst  *** 
     
    795781      !!                they are set to 0. 
    796782      !!---------------------------------------------------------------------- 
    797       INTEGER         , INTENT(in) ::   kt     ! ocean time-step 
    798       CHARACTER(len=*), INTENT(in) ::   cdrw   ! "READ"/"WRITE" flag 
     783      INTEGER         , INTENT(in) ::   kt        ! ocean time-step 
     784      INTEGER         , INTENT(in) ::   Kbb, Kmm  ! ocean time level indices 
     785      CHARACTER(len=*), INTENT(in) ::   cdrw      ! "READ"/"WRITE" flag 
    799786      ! 
    800787      INTEGER ::   ji, jj, jk 
     
    806793         IF( ln_rstart ) THEN                   !* Read the restart file 
    807794            CALL rst_read_open                  !  open the restart file if necessary 
    808             CALL iom_get( numror, jpdom_autoglo, 'sshn'   , sshn, ldxios = lrxios    ) 
     795            CALL iom_get( numror, jpdom_autoglo, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    ) 
    809796            ! 
    810797            id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. ) 
     
    813800            id4 = iom_varid( numror, 'tilde_e3t_n', ldstop = .FALSE. ) 
    814801            id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. ) 
     802            ! 
    815803            !                             ! --------- ! 
    816804            !                             ! all cases ! 
    817805            !                             ! --------- ! 
     806            ! 
    818807            IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist 
    819                CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios ) 
    820                CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios ) 
     808               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios ) 
     809               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios ) 
    821810               ! needed to restart if land processor not computed  
    822                IF(lwp) write(numout,*) 'dom_vvl_rst : e3t_b and e3t_n found in restart files' 
     811               IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files' 
    823812               WHERE ( tmask(:,:,:) == 0.0_wp )  
    824                   e3t_n(:,:,:) = e3t_0(:,:,:) 
    825                   e3t_b(:,:,:) = e3t_0(:,:,:) 
     813                  e3t(:,:,:,Kmm) = e3t_0(:,:,:) 
     814                  e3t(:,:,:,Kbb) = e3t_0(:,:,:) 
    826815               END WHERE 
    827                IF( neuler == 0 ) THEN 
    828                   e3t_b(:,:,:) = e3t_n(:,:,:) 
     816               IF( l_1st_euler ) THEN 
     817                  e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
    829818               ENDIF 
    830819            ELSE IF( id1 > 0 ) THEN 
    831                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart files' 
     820               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kmm) not found in restart files' 
    832821               IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.' 
    833                IF(lwp) write(numout,*) 'neuler is forced to 0' 
    834                CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios ) 
    835                e3t_n(:,:,:) = e3t_b(:,:,:) 
    836                neuler = 0 
     822               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
     823               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios ) 
     824               e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb) 
     825               l_1st_euler = .true. 
    837826            ELSE IF( id2 > 0 ) THEN 
    838                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_b not found in restart files' 
     827               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kbb) not found in restart files' 
    839828               IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.' 
    840                IF(lwp) write(numout,*) 'neuler is forced to 0' 
    841                CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios ) 
    842                e3t_b(:,:,:) = e3t_n(:,:,:) 
    843                neuler = 0 
     829               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
     830               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios ) 
     831               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     832               l_1st_euler = .true. 
    844833            ELSE 
    845                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart file' 
     834               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kmm) not found in restart file' 
    846835               IF(lwp) write(numout,*) 'Compute scale factor from sshn' 
    847                IF(lwp) write(numout,*) 'neuler is forced to 0' 
     836               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
    848837               DO jk = 1, jpk 
    849                   e3t_n(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:) ) & 
     838                  e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm) ) & 
    850839                      &                          / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    851840                      &          + e3t_0(:,:,jk)                               * (1._wp -tmask(:,:,jk)) 
    852841               END DO 
    853                e3t_b(:,:,:) = e3t_n(:,:,:) 
    854                neuler = 0 
     842               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     843               l_1st_euler = .true. 
    855844            ENDIF 
    856845            !                             ! ----------- ! 
     
    888877               IF( cn_cfg == 'wad' ) THEN 
    889878                  ! Wetting and drying test case 
    890                   CALL usr_def_istate( gdept_b, tmask, tsb, ub, vb, sshb  ) 
    891                   tsn  (:,:,:,:) = tsb (:,:,:,:)       ! set now values from to before ones 
    892                   sshn (:,:)     = sshb(:,:) 
    893                   un   (:,:,:)   = ub  (:,:,:) 
    894                   vn   (:,:,:)   = vb  (:,:,:) 
     879                  CALL usr_def_istate( gdept(:,:,:,Kbb), tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  ) 
     880                  ts  (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb)       ! set now values from to before ones 
     881                  ssh (:,:,Kmm)     = ssh(:,:,Kbb) 
     882                  uu   (:,:,:,Kmm)   = uu  (:,:,:,Kbb) 
     883                  vv   (:,:,:,Kmm)   = vv  (:,:,:,Kbb) 
    895884               ELSE 
    896885                  ! if not test case 
    897                   sshn(:,:) = -ssh_ref 
    898                   sshb(:,:) = -ssh_ref 
    899  
    900                   DO jj = 1, jpj 
    901                      DO ji = 1, jpi 
    902                         IF( ht_0(ji,jj)-ssh_ref <  rn_wdmin1 ) THEN ! if total depth is less than min depth 
    903  
    904                            sshb(ji,jj) = rn_wdmin1 - (ht_0(ji,jj) ) 
    905                            sshn(ji,jj) = rn_wdmin1 - (ht_0(ji,jj) ) 
    906                            ssha(ji,jj) = rn_wdmin1 - (ht_0(ji,jj) ) 
    907                         ENDIF 
    908                      ENDDO 
    909                   ENDDO 
     886                  ssh(:,:,Kmm) = -ssh_ref 
     887                  ssh(:,:,Kbb) = -ssh_ref 
     888 
     889                  DO_2D_11_11 
     890                     IF( ht_0(ji,jj)-ssh_ref <  rn_wdmin1 ) THEN ! if total depth is less than min depth 
     891                        ssh(ji,jj,Kbb) = rn_wdmin1 - (ht_0(ji,jj) ) 
     892                        ssh(ji,jj,Kmm) = rn_wdmin1 - (ht_0(ji,jj) ) 
     893                     ENDIF 
     894                  END_2D 
    910895               ENDIF !If test case else 
    911896 
    912897               ! Adjust vertical metrics for all wad 
    913898               DO jk = 1, jpk 
    914                   e3t_n(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:)  ) & 
     899                  e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm)  ) & 
    915900                    &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    916901                    &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) ) 
    917902               END DO 
    918                e3t_b(:,:,:) = e3t_n(:,:,:) 
    919  
    920                DO ji = 1, jpi 
    921                   DO jj = 1, jpj 
    922                      IF ( ht_0(ji,jj) .LE. 0.0 .AND. NINT( ssmask(ji,jj) ) .EQ. 1) THEN 
    923                        CALL ctl_stop( 'dom_vvl_rst: ht_0 must be positive at potentially wet points' ) 
    924                      ENDIF 
    925                   END DO  
    926                END DO  
     903               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     904 
     905               DO_2D_11_11 
     906                  IF ( ht_0(ji,jj) .LE. 0.0 .AND. NINT( ssmask(ji,jj) ) .EQ. 1) THEN 
     907                     CALL ctl_stop( 'dom_vvl_rst: ht_0 must be positive at potentially wet points' ) 
     908                  ENDIF 
     909               END_2D 
    927910               ! 
    928911            ELSE 
    929912               ! 
    930                ! usr_def_istate called here only to get sshb, that is needed to initialize e3t_b and e3t_n 
    931                CALL usr_def_istate( gdept_0, tmask, tsb, ub, vb, sshb  )   
    932                ! usr_def_istate will be called again in istate_init to initialize ts(bn), ssh(bn), u(bn) and v(bn) 
     913               ! usr_def_istate called here only to get ssh(Kbb) needed to initialize e3t(Kbb) and e3t(Kmm) 
     914               ! 
     915               CALL usr_def_istate( gdept_0, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )   
     916               ! 
     917               ! usr_def_istate will be called again in istate_init to initialize ts, ssh, u and v 
    933918               ! 
    934919               DO jk=1,jpk 
    935                   e3t_b(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshb(:,:) ) & 
     920                  e3t(:,:,jk,Kbb) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb) ) & 
    936921                    &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    937                     &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )   ! make sure e3t_b != 0 on land points 
     922                    &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )   ! make sure e3t(:,:,:,Kbb) != 0 on land points 
    938923               END DO 
    939                e3t_n(:,:,:) = e3t_b(:,:,:) 
    940                sshn(:,:) = sshb(:,:)   ! needed later for gde3w 
    941 !!$                e3t_n(:,:,:)=e3t_0(:,:,:) 
    942 !!$                e3t_b(:,:,:)=e3t_0(:,:,:) 
     924               e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb) 
     925               ssh(:,:,Kmm) = ssh(:,:,Kbb)                                     ! needed later for gde3w 
    943926               ! 
    944927            END IF           ! end of ll_wd edits 
     
    958941         !                                           ! all cases ! 
    959942         !                                           ! --------- ! 
    960          CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t_b(:,:,:), ldxios = lwxios ) 
    961          CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:), ldxios = lwxios ) 
     943         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lwxios ) 
     944         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lwxios ) 
    962945         !                                           ! ----------------------- ! 
    963946         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases ! 
     
    992975      !!----------------------------------------------------------------------  
    993976      ! 
    994       REWIND( numnam_ref )              ! Namelist nam_vvl in reference namelist :  
    995977      READ  ( numnam_ref, nam_vvl, IOSTAT = ios, ERR = 901) 
    996978901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nam_vvl in reference namelist' ) 
    997       REWIND( numnam_cfg )              ! Namelist nam_vvl in configuration namelist : Parameters of the run 
    998979      READ  ( numnam_cfg, nam_vvl, IOSTAT = ios, ERR = 902 ) 
    999980902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nam_vvl in configuration namelist' ) 
     
    10191000            WRITE(numout,*) '                         rn_rst_e3t     = 0.e0' 
    10201001            WRITE(numout,*) '            hard-wired : z-tilde cutoff frequency of low-pass filter (days)' 
    1021             WRITE(numout,*) '                         rn_lf_cutoff   = 1.0/rdt' 
     1002            WRITE(numout,*) '                         rn_lf_cutoff   = 1.0/rn_Dt' 
    10221003         ELSE 
    10231004            WRITE(numout,*) '      z-tilde to zstar restoration timescale (days)        rn_rst_e3t   = ', rn_rst_e3t 
     
    10341015      ! 
    10351016      IF( ioptio /= 1 )   CALL ctl_stop( 'Choose ONE vertical coordinate in namelist nam_vvl' ) 
    1036       IF( .NOT. ln_vvl_zstar .AND. ln_isf ) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' ) 
    10371017      ! 
    10381018      IF(lwp) THEN                   ! Print the choice 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/MY_SRC/usrdef_hgr.F90

    r10074 r12928  
    2626   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2727 
     28   !! * Substitutions 
     29#  include "do_loop_substitute.h90" 
    2830   !!---------------------------------------------------------------------- 
    2931   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    8890#endif 
    8991          
    90       DO jj = 1, jpj 
    91          DO ji = 1, jpi 
    92             zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
    93             zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
    94  
    95             plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 * zti 
    96             plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * zui 
    97             plamv(ji,jj) = plamt(ji,jj)  
    98             plamf(ji,jj) = plamu(ji,jj)  
    99     
    100             pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 * ztj 
    101             pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * zvj 
    102             pphiu(ji,jj) = pphit(ji,jj)  
    103             pphif(ji,jj) = pphiv(ji,jj)  
    104          END DO 
    105       END DO 
     92      DO_2D_11_11 
     93         zti = FLOAT( ji - 1 + nimpp - 1 )          ;  ztj = FLOAT( jj - 1 + njmpp - 1 ) 
     94         zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5_wp ;  zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5_wp 
     95          
     96         plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 * zti 
     97         plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * zui 
     98         plamv(ji,jj) = plamt(ji,jj)  
     99         plamf(ji,jj) = plamu(ji,jj)  
     100          
     101         pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 * ztj 
     102         pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * zvj 
     103         pphiu(ji,jj) = pphit(ji,jj)  
     104         pphif(ji,jj) = pphiv(ji,jj)  
     105      END_2D 
    106106      !      
    107107      ! Horizontal scale factors (in meters) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/MY_SRC/usrdef_istate.F90

    r10425 r12928  
    2828   PUBLIC   usr_def_istate   ! called by istate.F90 
    2929 
     30   !! * Substitutions 
     31#  include "do_loop_substitute.h90" 
    3032   !!---------------------------------------------------------------------- 
    3133   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    6971      zH = 0.5_wp * 5000._wp 
    7072      ! 
    71       zP0 = rau0 * zf0 * zumax * zlambda * SQRT(EXP(1._wp)/2._wp) 
     73      zP0 = rho0 * zf0 * zumax * zlambda * SQRT(EXP(1._wp)/2._wp) 
    7274      ! 
    7375      ! Sea level: 
    7476      za = -zP0 * (1._wp-EXP(-zH)) / (grav*(zH-1._wp + EXP(-zH))) 
    75       DO ji=1, jpi 
    76          DO jj=1, jpj 
    77             zx = glamt(ji,jj) * 1.e3 
    78             zy = gphit(ji,jj) * 1.e3 
    79             zrho1 = rau0 + za * EXP(-(zx**2+zy**2)/zlambda**2) 
    80             pssh(ji,jj) = zP0 * EXP(-(zx**2+zy**2)/zlambda**2)/(zrho1*grav) * ptmask(ji,jj,1) 
    81          END DO 
    82       END DO 
     77      DO_2D_11_11 
     78         zx = glamt(ji,jj) * 1.e3 
     79         zy = gphit(ji,jj) * 1.e3 
     80         zrho1 = rho0 + za * EXP(-(zx**2+zy**2)/zlambda**2) 
     81         pssh(ji,jj) = zP0 * EXP(-(zx**2+zy**2)/zlambda**2)/(zrho1*grav) * ptmask(ji,jj,1) 
     82      END_2D 
    8383      ! 
    8484      ! temperature:          
    85       DO ji=1, jpi 
    86          DO jj=1, jpj 
    87             zx = glamt(ji,jj) * 1.e3 
    88             zy = gphit(ji,jj) * 1.e3 
    89             DO jk=1,jpk 
    90                zdt =  pdept(ji,jj,jk)  
    91                zrho1 = rau0 * (1._wp + zn2*zdt/grav) 
    92                IF (zdt < zH) THEN 
    93                   zrho1 = zrho1 - zP0 * (1._wp-EXP(zdt-zH)) & 
    94                           & * EXP(-(zx**2+zy**2)/zlambda**2) / (grav*(zH -1._wp + exp(-zH))); 
    95                ENDIF 
    96                pts(ji,jj,jk,jp_tem) = (20._wp + (rau0-zrho1) / 0.28_wp) * ptmask(ji,jj,jk) 
    97             END DO 
     85      DO_2D_11_11 
     86         zx = glamt(ji,jj) * 1.e3 
     87         zy = gphit(ji,jj) * 1.e3 
     88         DO jk=1,jpk 
     89            zdt =  pdept(ji,jj,jk)  
     90            zrho1 = rho0 * (1._wp + zn2*zdt/grav) 
     91            IF (zdt < zH) THEN 
     92               zrho1 = zrho1 - zP0 * (1._wp-EXP(zdt-zH)) & 
     93                  & * EXP(-(zx**2+zy**2)/zlambda**2) / (grav*(zH -1._wp + EXP(-zH))); 
     94            ENDIF 
     95            pts(ji,jj,jk,jp_tem) = (20._wp + (rho0-zrho1) / 0.28_wp) * ptmask(ji,jj,jk) 
    9896         END DO 
    99       END DO 
     97      END_2D 
    10098      ! 
    10199      ! salinity:   
     
    103101      ! 
    104102      ! velocities: 
    105       za = 2._wp * zP0 / (zf0 * rau0 * zlambda**2) 
    106       DO ji=1, jpim1 
    107          DO jj=1, jpj 
    108             zx = glamu(ji,jj) * 1.e3 
    109             zy = gphiu(ji,jj) * 1.e3 
    110             DO jk=1, jpk 
    111                zdu = 0.5_wp * (pdept(ji  ,jj,jk) + pdept(ji+1,jj,jk)) 
    112                IF (zdu < zH) THEN 
    113                   zf = (zH-1._wp-zdu+EXP(zdu-zH)) / (zH-1._wp+EXP(-zH)) 
    114                   pu(ji,jj,jk) = (za * zf * zy * EXP(-(zx**2+zy**2)/zlambda**2)) * ptmask(ji,jj,jk) * ptmask(ji+1,jj,jk) 
    115                ELSE 
    116                   pu(ji,jj,jk) = 0._wp 
    117                ENDIF 
    118             END DO 
     103      za = 2._wp * zP0 / (zf0 * rho0 * zlambda**2) 
     104      DO_2D_00_00 
     105         zx = glamu(ji,jj) * 1.e3 
     106         zy = gphiu(ji,jj) * 1.e3 
     107         DO jk=1, jpk 
     108            zdu = 0.5_wp * (pdept(ji  ,jj,jk) + pdept(ji+1,jj,jk)) 
     109            IF (zdu < zH) THEN 
     110               zf = (zH-1._wp-zdu+EXP(zdu-zH)) / (zH-1._wp+EXP(-zH)) 
     111               pu(ji,jj,jk) = (za * zf * zy * EXP(-(zx**2+zy**2)/zlambda**2)) * ptmask(ji,jj,jk) * ptmask(ji+1,jj,jk) 
     112            ELSE 
     113               pu(ji,jj,jk) = 0._wp 
     114            ENDIF 
    119115         END DO 
    120       END DO 
     116      END_2D 
    121117      ! 
    122       DO ji=1, jpi 
    123          DO jj=1, jpjm1 
    124             zx = glamv(ji,jj) * 1.e3 
    125             zy = gphiv(ji,jj) * 1.e3 
    126             DO jk=1, jpk 
    127                zdv = 0.5_wp * (pdept(ji  ,jj,jk) + pdept(ji,jj+1,jk)) 
    128                IF (zdv < zH) THEN 
    129                   zf = (zH-1._wp-zdv+EXP(zdv-zH)) / (zH-1._wp+EXP(-zH)) 
    130                   pv(ji,jj,jk) = -(za * zf * zx * EXP(-(zx**2+zy**2)/zlambda**2)) * ptmask(ji,jj,jk) * ptmask(ji,jj+1,jk) 
    131                ELSE 
    132                   pv(ji,jj,jk) = 0._wp 
    133                ENDIF 
    134             END DO 
     118      DO_2D_00_00 
     119         zx = glamv(ji,jj) * 1.e3 
     120         zy = gphiv(ji,jj) * 1.e3 
     121         DO jk=1, jpk 
     122            zdv = 0.5_wp * (pdept(ji  ,jj,jk) + pdept(ji,jj+1,jk)) 
     123            IF (zdv < zH) THEN 
     124               zf = (zH-1._wp-zdv+EXP(zdv-zH)) / (zH-1._wp+EXP(-zH)) 
     125               pv(ji,jj,jk) = -(za * zf * zx * EXP(-(zx**2+zy**2)/zlambda**2)) * ptmask(ji,jj,jk) * ptmask(ji,jj+1,jk) 
     126            ELSE 
     127               pv(ji,jj,jk) = 0._wp 
     128            ENDIF 
    135129         END DO 
    136       END DO 
    137  
    138       CALL lbc_lnk( 'usrdef_istate', pu, 'U', -1. ) 
    139       CALL lbc_lnk( 'usrdef_istate', pv, 'V', -1. ) 
     130      END_2D 
     131      ! 
     132      CALL lbc_lnk_multi( 'usrdef_istate', pu, 'U', -1., pv, 'V', -1. ) 
    140133      !    
    141134   END SUBROUTINE usr_def_istate 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    6363      !!---------------------------------------------------------------------- 
    6464      ! 
    65       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6665      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    6766902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/MY_SRC/usrdef_sbc.F90

    r10074 r12928  
    3030   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo 
    3131 
    32    !! * Substitutions 
    33 #  include "vectopt_loop_substitute.h90" 
    3432   !!---------------------------------------------------------------------- 
    3533   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    3937CONTAINS 
    4038 
    41    SUBROUTINE usrdef_sbc_oce( kt ) 
     39   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4240      !!--------------------------------------------------------------------- 
    4341      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5452      !!---------------------------------------------------------------------- 
    5553      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     54      INTEGER, INTENT(in) ::   Kbb  ! ocean time index 
    5655      !!--------------------------------------------------------------------- 
    5756      ! 
     
    7978   END SUBROUTINE usrdef_sbc_ice_tau 
    8079 
    81    SUBROUTINE usrdef_sbc_ice_flx( kt ) 
     80 
     81   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi ) 
    8282      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     83      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness 
     84      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness 
    8385   END SUBROUTINE usrdef_sbc_ice_flx 
    8486 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/VORTEX/MY_SRC/usrdef_zgr.F90

    r10425 r12928  
    2929   PUBLIC   usr_def_zgr        ! called by domzgr.F90 
    3030 
    31   !! * Substitutions 
    32 #  include "vectopt_loop_substitute.h90" 
    3331   !!---------------------------------------------------------------------- 
    3432   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    194192      CALL lbc_lnk( 'usrdef_zgr', z2d, 'T', 1. )           ! set surrounding land to zero (here jperio=0 ==>> closed) 
    195193      ! 
    196       k_bot(:,:) = INT( z2d(:,:) )           ! =jpkm1 over the ocean point, =0 elsewhere 
     194      k_bot(:,:) = NINT( z2d(:,:) )          ! =jpkm1 over the ocean point, =0 elsewhere 
    197195      ! 
    198196      k_top(:,:) = MIN( 1 , k_bot(:,:) )     ! = 1    over the ocean point, =0 elsewhere 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/WAD/EXPREF/context_nemo.xml

    r12178 r12928  
    55--> 
    66<context id="nemo"> 
    7 <!-- $id$ --> 
     7    <!-- $id$ --> 
    88    <variable_definition> 
    9     <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
    10        <variable id="ref_year" type="int"   > 1800 </variable> 
    11        <variable id="rau0"     type="float" > 1026.0 </variable> 
    12        <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
    13        <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
    14        <variable id="rhoic"    type="float" > 917.0 </variable> 
    15        <variable id="rhosn"    type="float" > 330.0 </variable> 
    16        <variable id="missval"  type="float" > 1.e20 </variable> 
     9       <!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 --> 
     10       <variable id="ref_year"  type="int"> 1900 </variable> 
     11       <variable id="ref_month" type="int"> 01 </variable> 
     12       <variable id="ref_day"   type="int"> 01 </variable> 
     13       <variable id="rau0"      type="float" > 1026.0 </variable> 
     14       <variable id="cpocean"   type="float" > 3991.86795711963 </variable> 
     15       <variable id="convSpsu"  type="float" > 0.99530670233846  </variable> 
     16       <variable id="rhoic"     type="float" > 917.0 </variable> 
     17       <variable id="rhosn"     type="float" > 330.0 </variable> 
     18       <variable id="missval"  type="float" > 1.e20 </variable>           
    1719    </variable_definition> 
     20 
    1821<!-- Fields definition --> 
    1922    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    2124<!-- Files definition --> 
    2225    <file_definition src="./file_def_nemo-oce.xml"/>     <!--  NEMO ocean dynamics                     --> 
    23     <!--  
    24 ============================================================================================================ 
    25 = grid definition = = DO NOT CHANGE = 
    26 ============================================================================================================ 
    27     --> 
    28      
    29     <axis_definition> 
    30       <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
    31       <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
    32       <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
    33       <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
    34       <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
    35       <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
    36       <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
    37       <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
    38       <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    39     </axis_definition> 
     26 
     27<!-- Axis definition --> 
     28    <axis_definition src="./axis_def_nemo.xml"/> 
    4029  
     30<!-- Domain definition --> 
    4131    <domain_definition src="./domain_def_nemo.xml"/> 
     32 
     33<!-- Grids definition --> 
     34    <grid_definition   src="./grid_def_nemo.xml"/> 
    4235   
    43     <grid_definition src="./grid_def_nemo.xml"/> 
    4436 
    4537</context> 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/WAD/EXPREF/makebdy_tc7.py

    r7609 r12928  
    44pathout = "bdyssh_tc7" 
    55 
    6 nx = 34  
     6nx = 23  
    77ny = 1 
    88nt = 24 
     
    1818 ssh = np.zeros((nt,ny,nx)) 
    1919 for nnt in range(nd*nt,(nd+1)*nt): 
    20    tx = 2.5*np.cos((3.141592654/6.0)*(nnt+1.0)) 
     20   tx = 2.5*np.cos((3.141592654/6.0)*(nnt)) 
    2121   print nnt, tx 
    2222   for nnx in range(nx): 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/WAD/EXPREF/namelist_cfg

    r12178 r12928  
    4343   ! 
    4444   ln_meshmask = .true.    !  create (>0) a mesh file or not (=0) 
    45    rn_rdt      =    18.    !  time step for the dynamics  
     45   rn_Dt      =    18.    !  time step for the dynamics  
    4646/ 
    4747!----------------------------------------------------------------------- 
     
    169169!----------------------------------------------------------------------- 
    170170    ctypebdy = 'E' 
    171     nbdyind  = 50 
     171    nbdyind  = 33 
    172172    nbdybeg  = 1 
    173     nbdyend  = 34 
     173    nbdyend  = 23 
    174174    !ctypebdy = 'W' 
    175175    !nbdyind  = 2 
     
    344344   ln_dynspg_ts  = .true.  !  split-explicit free surface 
    345345   ln_bt_auto    = .false. ! Number of sub-step defined from: 
    346    nn_baro       =  12     ! =F : the number of sub-step in rn_rdt seconds 
     346   nn_e       =  12     ! =F : the number of sub-step in rn_Dt seconds 
    347347/ 
    348348!----------------------------------------------------------------------- 
     
    422422!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    423423!!   namflo       float parameters                                      (default: OFF) 
    424 !!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
    425424!!   nam_diadct   transports through some sections                      (default: OFF) 
    426 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    427425!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    428426!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/WAD/MY_DOCS/Namelists/nam_wad_tc7

    r7609 r12928  
    1515    nb_bdy         = 1                    !  number of open boundary sets 
    1616/ 
    17 !----------------------------------------------------------------------- 
    18 &namwad  !   Wetting and drying 
    19 !----------------------------------------------------------------------- 
    20    rn_wdmin1         =  0.150   ! Minimum wet depth on dried cells 
    21 / 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/WAD/MY_SRC/usrdef_hgr.F90

    r10074 r12928  
    2626   PUBLIC   usr_def_hgr   ! called by domhgr.F90 
    2727 
     28   !! * Substitutions 
     29#  include "do_loop_substitute.h90" 
    2830   !!---------------------------------------------------------------------- 
    2931   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    7274      !                       !==  grid point position  ==!   (in kilometers) 
    7375      zfact = rn_dx * 1.e-3         ! conversion in km 
    74       DO jj = 1, jpj 
    75          DO ji = 1, jpi             ! longitude 
    76             plamt(ji,jj) = zfact * (  - 0.5 + REAL( ji-1 + nimpp-1 , wp )  )   
    77             plamu(ji,jj) = zfact * (          REAL( ji-1 + nimpp-1 , wp )  ) 
    78             plamv(ji,jj) = plamt(ji,jj) 
    79             plamf(ji,jj) = plamu(ji,jj) 
    80             !                       ! latitude 
    81             pphit(ji,jj) = zfact * (  - 0.5 + REAL( jj-1 + njmpp-1 , wp )  ) 
    82             pphiu(ji,jj) = pphit(ji,jj) 
    83             pphiv(ji,jj) = zfact * (          REAL( jj-1 + njmpp-1 , wp )  ) 
    84             pphif(ji,jj) = pphiv(ji,jj) 
    85          END DO 
    86       END DO 
     76      DO_2D_11_11 
     77         !                       ! longitude 
     78         plamt(ji,jj) = zfact * (  - 0.5 + REAL( ji-1 + nimpp-1 , wp )  )   
     79         plamu(ji,jj) = zfact * (          REAL( ji-1 + nimpp-1 , wp )  ) 
     80         plamv(ji,jj) = plamt(ji,jj) 
     81         plamf(ji,jj) = plamu(ji,jj) 
     82         !                       ! latitude 
     83         pphit(ji,jj) = zfact * (  - 0.5 + REAL( jj-1 + njmpp-1 , wp )  ) 
     84         pphiu(ji,jj) = pphit(ji,jj) 
     85         pphiv(ji,jj) = zfact * (          REAL( jj-1 + njmpp-1 , wp )  ) 
     86         pphif(ji,jj) = pphiv(ji,jj) 
     87      END_2D 
    8788      ! 
    8889      !                       !==  Horizontal scale factors  ==!   (in meters)  
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/WAD/MY_SRC/usrdef_istate.F90

    r10074 r12928  
    2626   PUBLIC   usr_def_istate   ! called in istate.F90 
    2727 
     28   !! * Substitutions 
     29#  include "do_loop_substitute.h90" 
    2830   !!---------------------------------------------------------------------- 
    2931   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    174176      ! Apply minimum wetdepth criterion 
    175177      ! 
    176       do jj = 1,jpj 
    177          do ji = 1,jpi 
    178             IF( ht_0(ji,jj) + pssh(ji,jj) < rn_wdmin1 ) THEN 
    179                pssh(ji,jj) = ptmask(ji,jj,1)*( rn_wdmin1 - ht_0(ji,jj) ) 
    180             ENDIF 
    181          end do 
    182       end do 
     178      DO_2D_11_11 
     179         IF( ht_0(ji,jj) + pssh(ji,jj) < rn_wdmin1 ) THEN 
     180            pssh(ji,jj) = ptmask(ji,jj,1)*( rn_wdmin1 - ht_0(ji,jj) ) 
     181         ENDIF 
     182      END_2D 
    183183      ! 
    184184   END SUBROUTINE usr_def_istate 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/WAD/MY_SRC/usrdef_nam.F90

    r12178 r12928  
    6161      !!---------------------------------------------------------------------- 
    6262      ! 
    63       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6463      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    6564902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/WAD/MY_SRC/usrdef_sbc.F90

    r10074 r12928  
    3131   PUBLIC   usrdef_sbc_ice_flx  ! routine called by icestp.F90 for ice thermo 
    3232 
    33    !! * Substitutions 
    34 #  include "vectopt_loop_substitute.h90" 
    3533   !!---------------------------------------------------------------------- 
    3634   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4038CONTAINS 
    4139 
    42    SUBROUTINE usrdef_sbc_oce( kt ) 
     40   SUBROUTINE usrdef_sbc_oce( kt, Kbb ) 
    4341      !!--------------------------------------------------------------------- 
    4442      !!                    ***  ROUTINE usr_def_sbc  *** 
     
    5553      !!---------------------------------------------------------------------- 
    5654      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     55      INTEGER, INTENT(in) ::   Kbb  ! ocean time index 
    5756      !!--------------------------------------------------------------------- 
    5857      ! 
     
    8079   END SUBROUTINE usrdef_sbc_ice_tau 
    8180 
    82    SUBROUTINE usrdef_sbc_ice_flx( kt ) 
     81 
     82   SUBROUTINE usrdef_sbc_ice_flx( kt, phs, phi ) 
    8383      INTEGER, INTENT(in) ::   kt   ! ocean time step 
     84      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phs    ! snow thickness 
     85      REAL(wp), DIMENSION(:,:,:), INTENT(in)  ::   phi    ! ice thickness 
    8486   END SUBROUTINE usrdef_sbc_ice_flx 
    8587 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/WAD/MY_SRC/usrdef_zgr.F90

    r10425 r12928  
    3030 
    3131   !! * Substitutions 
    32 #  include "vectopt_loop_substitute.h90" 
     32#  include "do_loop_substitute.h90" 
    3333   !!---------------------------------------------------------------------- 
    3434   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    244244      ! at v-point: averaging zht 
    245245      zhv = 0._wp 
    246       DO jj = 1, jpjm1 
    247          zhv(:,jj) = 0.5_wp * ( zht(:,jj) + zht(:,jj+1) ) 
    248       END DO 
     246      DO_2D_00_00 
     247         zhv(ji,jj) = 0.5_wp * ( zht(ji,jj) + zht(ji,jj+1) ) 
     248      END_2D 
    249249      CALL lbc_lnk( 'usrdef_zgr', zhv, 'V', 1. )     ! boundary condition: this mask the surrounding grid-points 
    250250      DO jj = mj0(1), mj1(1)   ! first  row of global domain only 
     
    281281         ht_0 = zht 
    282282         k_bot(:,:) = jpkm1 * k_top(:,:)  !* bottom ocean = jpk-1 (here use k_top as a land mask) 
    283          DO jj = 1, jpj 
    284             DO ji = 1, jpi 
    285               IF( zht(ji,jj) <= -(rn_wdld - rn_wdmin2)) THEN 
    286                 k_bot(ji,jj) = 0 
    287                 k_top(ji,jj) = 0 
    288               ENDIF 
    289            END DO 
    290          END DO 
     283         DO_2D_11_11 
     284            IF( zht(ji,jj) <= -(rn_wdld - rn_wdmin2)) THEN 
     285               k_bot(ji,jj) = 0 
     286               k_top(ji,jj) = 0 
     287            ENDIF 
     288         END_2D 
    291289         ! 
    292290         !                                !* terrain-following coordinate with e3.(k)=cst) 
    293291         !                                !  OVERFLOW case : identical with j-index (T=V, U=F) 
    294          DO jj = 1, jpjm1 
    295             DO ji = 1, jpim1 
    296               z1_jpkm1 = 1._wp / REAL( k_bot(ji,jj) - k_top(ji,jj) + 1 , wp) 
    297               DO jk = 1, jpk 
    298                   zwet = MAX( zht(ji,jj), rn_wdmin1 ) 
    299                   pdept(ji,jj,jk) = zwet * z1_jpkm1 * ( REAL( jk   , wp ) - 0.5_wp ) 
    300                   pdepw(ji,jj,jk) = zwet * z1_jpkm1 * ( REAL( jk-1 , wp )          ) 
    301                   pe3t (ji,jj,jk) = zwet * z1_jpkm1 
    302                   pe3w (ji,jj,jk) = zwet * z1_jpkm1 
    303                   zwet = MAX( zhu(ji,jj), rn_wdmin1 ) 
    304                   pe3u (ji,jj,jk) = zwet * z1_jpkm1 
    305                   pe3uw(ji,jj,jk) = zwet * z1_jpkm1 
    306                   pe3f (ji,jj,jk) = zwet * z1_jpkm1 
    307                   zwet = MAX( zhv(ji,jj), rn_wdmin1 ) 
    308                   pe3v (ji,jj,jk) = zwet * z1_jpkm1 
    309                   pe3vw(ji,jj,jk) = zwet * z1_jpkm1 
    310               END DO       
    311            END DO       
    312          END DO       
     292         DO_2D_00_00 
     293            z1_jpkm1 = 1._wp / REAL( k_bot(ji,jj) - k_top(ji,jj) + 1 , wp) 
     294            DO jk = 1, jpk 
     295               zwet = MAX( zht(ji,jj), rn_wdmin1 ) 
     296               pdept(ji,jj,jk) = zwet * z1_jpkm1 * ( REAL( jk   , wp ) - 0.5_wp ) 
     297               pdepw(ji,jj,jk) = zwet * z1_jpkm1 * ( REAL( jk-1 , wp )          ) 
     298               pe3t (ji,jj,jk) = zwet * z1_jpkm1 
     299               pe3w (ji,jj,jk) = zwet * z1_jpkm1 
     300               zwet = MAX( zhu(ji,jj), rn_wdmin1 ) 
     301               pe3u (ji,jj,jk) = zwet * z1_jpkm1 
     302               pe3uw(ji,jj,jk) = zwet * z1_jpkm1 
     303               pe3f (ji,jj,jk) = zwet * z1_jpkm1 
     304               zwet = MAX( zhv(ji,jj), rn_wdmin1 ) 
     305               pe3v (ji,jj,jk) = zwet * z1_jpkm1 
     306               pe3vw(ji,jj,jk) = zwet * z1_jpkm1 
     307            END DO 
     308         END_2D      
    313309         CALL lbc_lnk( 'usrdef_zgr', pdept, 'T', 1. ) 
    314310         CALL lbc_lnk( 'usrdef_zgr', pdepw, 'T', 1. ) 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/demo_cfgs.txt

    r10516 r12928  
    11CANAL OCE 
    22ISOMIP OCE 
     3ISOMIP+ OCE 
    34LOCK_EXCHANGE OCE 
    45OVERFLOW OCE 
     
    910WAD OCE 
    1011BENCH OCE ICE TOP 
     12STATION_ASF OCE 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/tests/test_cases.bib

    r10627 r12928  
    115115   abstract = {Many problems of fluid dynamics involve the coupled transport of several, density-like, dependent variables (for instance, densities of mass and momenta in elastic flows). In this paper, a conservative and synchronous flux-corrected transport (FCT) formalism is developed which aims at a consistent transport of such variables. The technique differs from traditional FCT algorithms in two respects. First, the limiting of transportive fluxes of the primary variables (e.g., mass and momentum) does not derive from smooth estimates of the variables, but it derives from analytic constraints implied by the Lagrangian form of the governing continuity equations, which are imposed on the specific mixing ratios of the variables (e.g., velocity components). Second, the traditional FCT limiting based on sufficiency conditions is augmented by an iterative procedure which approaches the necessity requirements. This procedure can also be used in the framework of traditional FCT schemes, and a demonstration is provided that it can significantly reduce some of the pathological behaviors of FCT algorithms. Although the approach derived is applicable to the transport of arbitrary conserved quantities, it is particularly useful for the synchronous transport of mass and momenta in elastic flows, where it assures intrinsic stability of the algorithm regardless of the magnitude of the mass-density variable. This latter property becomes especially important in fluids with large density variations, or in models with a material “vertical” coordinate (e.g., geophysical hydrostatic stratified flows in isopycnic/isentropic coordinates), where material surfaces can collapse to zero-mass layers admitting, therefore, arbitrarily large local Courant numbers.} 
    116116} 
     117 
     118@article{Brodeau_al_2017, 
     119author={Laurent Brodeau and Bernard Barnier and Sergey Gulev and Cian Woods}, 
     120title={Climatologically significant effects of some approximations in the bulk parameterizations of turbulent air-sea fluxes}, 
     121journal={J. Phys. Oceanogr.}, 
     122doi={10.1175/JPO-D-16-0169.1}, 
     123year={2017}, 
     124pages = {5-28}, 
     125volume={47}, 
     126number={1} 
     127} 
Note: See TracChangeset for help on using the changeset viewer.