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 13463 for NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests – NEMO

Ignore:
Timestamp:
2020-09-14T17:40:34+02:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2195:update to trunk 13461

Location:
NEMO/branches/2019/dev_r11351_fldread_with_XIOS
Files:
3 deleted
111 edited
12 copied

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8 
         9# SETTE 
         10^/utils/CI/sette@13382        sette 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/best_jpni_jpnj_eorca025

    r9856 r13463  
    624624    nb_cores 36180 ( 180 x 201 ), nb_points 80 ( 10 x 8 ) 
    625625    nb_cores 38560 ( 160 x 241 ), nb_points 77 ( 11 x 7 ) 
     626    nb_cores 41406 ( 206 x 201 ), nb_points 72 ( 9 x 8 ) 
     627    nb_cores 43380 ( 180 x 241 ), nb_points 70 ( 10 x 7 ) 
     628    nb_cores 48240 ( 240 x 201 ), nb_points 64 ( 8 x 8 ) 
     629    nb_cores 49646 ( 206 x 241 ), nb_points 63 ( 9 x 7 ) 
     630    nb_cores 54360 ( 180 x 302 ), nb_points 60 ( 10 x 6 ) 
     631    nb_cores 54360 ( 360 x 151 ), nb_points 60 ( 6 x 10 ) 
     632    nb_cores 57840 ( 240 x 241 ), nb_points 56 ( 8 x 7 ) 
     633    nb_cores 62212 ( 206 x 302 ), nb_points 54 ( 9 x 6 ) 
     634    nb_cores 69408 ( 288 x 241 ), nb_points 49 ( 7 x 7 ) 
     635    nb_cores 72360 ( 360 x 201 ), nb_points 48 ( 6 x 8 ) 
     636    nb_cores 82812 ( 206 x 402 ), nb_points 45 ( 9 x 5 ) 
     637    nb_cores 86760 ( 360 x 241 ), nb_points 42 ( 6 x 7 ) 
     638    nb_cores 96480 ( 240 x 402 ), nb_points 40 ( 8 x 5 ) 
     639    nb_cores 96480 ( 480 x 201 ), nb_points 40 ( 5 x 8 ) 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/best_jpni_jpnj_eorca12

    r9856 r13463  
    13001300    nb_cores 49852 ( 206 x 242 ), nb_points 345 ( 23 x 15 ) 
    13011301    nb_cores 49950 ( 270 x 185 ), nb_points 342 ( 18 x 19 ) 
     1302    nb_cores 50400 ( 288 x 175 ), nb_points 340 ( 17 x 20 ) 
     1303    nb_cores 50400 ( 240 x 210 ), nb_points 340 ( 20 x 17 ) 
     1304    nb_cores 51294 ( 309 x 166 ), nb_points 336 ( 16 x 21 ) 
     1305    nb_cores 52272 ( 216 x 242 ), nb_points 330 ( 22 x 15 ) 
     1306    nb_cores 53190 ( 270 x 197 ), nb_points 324 ( 18 x 18 ) 
     1307    nb_cores 53280 ( 288 x 185 ), nb_points 323 ( 17 x 19 ) 
     1308    nb_cores 54000 ( 240 x 225 ), nb_points 320 ( 20 x 16 ) 
     1309    nb_cores 55176 ( 228 x 242 ), nb_points 315 ( 21 x 15 ) 
     1310    nb_cores 56199 ( 393 x 143 ), nb_points 312 ( 13 x 24 ) 
     1311    nb_cores 56700 ( 270 x 210 ), nb_points 306 ( 18 x 17 ) 
     1312    nb_cores 57165 ( 309 x 185 ), nb_points 304 ( 16 x 19 ) 
     1313    nb_cores 58080 ( 240 x 242 ), nb_points 300 ( 20 x 15 ) 
     1314    nb_cores 58916 ( 206 x 286 ), nb_points 299 ( 23 x 13 ) 
     1315    nb_cores 59760 ( 360 x 166 ), nb_points 294 ( 14 x 21 ) 
     1316    nb_cores 60480 ( 288 x 210 ), nb_points 289 ( 17 x 17 ) 
     1317    nb_cores 60750 ( 270 x 225 ), nb_points 288 ( 18 x 16 ) 
     1318    nb_cores 61605 ( 333 x 185 ), nb_points 285 ( 15 x 19 ) 
     1319    nb_cores 63000 ( 360 x 175 ), nb_points 280 ( 14 x 20 ) 
     1320    nb_cores 64800 ( 288 x 225 ), nb_points 272 ( 17 x 16 ) 
     1321    nb_cores 65340 ( 270 x 242 ), nb_points 270 ( 18 x 15 ) 
     1322    nb_cores 66600 ( 360 x 185 ), nb_points 266 ( 14 x 19 ) 
     1323    nb_cores 68040 ( 216 x 315 ), nb_points 264 ( 22 x 12 ) 
     1324    nb_cores 68640 ( 240 x 286 ), nb_points 260 ( 20 x 13 ) 
     1325    nb_cores 69525 ( 309 x 225 ), nb_points 256 ( 16 x 16 ) 
     1326    nb_cores 69696 ( 288 x 242 ), nb_points 255 ( 17 x 15 ) 
     1327    nb_cores 70920 ( 360 x 197 ), nb_points 252 ( 14 x 18 ) 
     1328    nb_cores 72705 ( 393 x 185 ), nb_points 247 ( 13 x 19 ) 
     1329    nb_cores 74778 ( 309 x 242 ), nb_points 240 ( 16 x 15 ) 
     1330    nb_cores 75600 ( 360 x 210 ), nb_points 238 ( 14 x 17 ) 
     1331    nb_cores 77220 ( 270 x 286 ), nb_points 234 ( 18 x 13 ) 
     1332    nb_cores 79680 ( 480 x 166 ), nb_points 231 ( 11 x 21 ) 
     1333    nb_cores 79920 ( 432 x 185 ), nb_points 228 ( 12 x 19 ) 
     1334    nb_cores 80586 ( 333 x 242 ), nb_points 225 ( 15 x 15 ) 
     1335    nb_cores 81000 ( 360 x 225 ), nb_points 224 ( 14 x 16 ) 
     1336    nb_cores 82368 ( 288 x 286 ), nb_points 221 ( 17 x 13 ) 
     1337    nb_cores 84000 ( 480 x 175 ), nb_points 220 ( 11 x 20 ) 
     1338    nb_cores 84000 ( 240 x 350 ), nb_points 220 ( 20 x 11 ) 
     1339    nb_cores 85050 ( 270 x 315 ), nb_points 216 ( 18 x 12 ) 
     1340    nb_cores 87120 ( 360 x 242 ), nb_points 210 ( 14 x 15 ) 
     1341    nb_cores 88374 ( 309 x 286 ), nb_points 208 ( 16 x 13 ) 
     1342    nb_cores 90720 ( 288 x 315 ), nb_points 204 ( 17 x 12 ) 
     1343    nb_cores 90720 ( 432 x 210 ), nb_points 204 ( 12 x 17 ) 
     1344    nb_cores 94500 ( 270 x 350 ), nb_points 198 ( 18 x 11 ) 
     1345    nb_cores 94680 ( 360 x 263 ), nb_points 196 ( 14 x 14 ) 
     1346    nb_cores 95106 ( 393 x 242 ), nb_points 195 ( 13 x 15 ) 
     1347    nb_cores 97200 ( 432 x 225 ), nb_points 192 ( 12 x 16 ) 
     1348    nb_cores 99900 ( 540 x 185 ), nb_points 190 ( 10 x 19 ) 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/namelist_cfg_orca025_like

    r10539 r13463  
    99   nn_it000    =       1   !  first time step 
    1010   nn_itend    =    1000   !  last time step  
    11    nn_stock    =       0   !  frequency of creation of a restart file (modulo referenced to 1) 
    12    nn_write    =       0   !  frequency of write in the output file   (modulo referenced to nn_it000) 
     11   nn_stock    =      -1   !  frequency of creation of a restart file (modulo referenced to 1) 
     12   nn_write    =      -1   !  frequency of write in the output file   (modulo referenced to nn_it000) 
    1313/ 
    1414!----------------------------------------------------------------------- 
    1515&namusr_def    !   User defined :   BENCH configuration: Flat bottom, beta-plane 
    1616!----------------------------------------------------------------------- 
    17    nn_isize   =   1442     ! number of point in i-direction of global(local) domain if >0 (<0)   
    18    nn_jsize   =   1207  !!  1050    ! number of point in j-direction of global(local) domain if >0 (<0)   
     17   nn_isize   =   1440     ! number of point in i-direction of global(local) domain if >0 (<0)   
     18   nn_jsize   =   1206  !!  1049    ! number of point in j-direction of global(local) domain if >0 (<0)   
    1919   nn_ksize   =   75       ! total number of point in k-direction 
    2020   nn_perio   =   4        ! periodicity 
     
    3030&namctl        !   Control prints                                       (default: OFF) 
    3131!----------------------------------------------------------------------- 
    32    ln_ctl      = .false.   !  trends control print (expensive!) 
    33    nn_print    =    0      !  level of print (0 no extra print) 
    3432   ln_timing   = .false.   !  timing by routine write out in timing.output file 
    3533/ 
     
    3735&namdom        !   time and space domain 
    3836!----------------------------------------------------------------------- 
    39    rn_rdt      =    900.   !  time step for the dynamics (and tracer if nn_acc=0) 
     37   rn_Dt      =    900.   !  time step for the dynamics (and tracer if nn_acc=0) 
    4038   rn_atfp     =   0.05    !  asselin time filter parameter 
    4139/ 
     
    5149!----------------------------------------------------------------------- 
    5250  ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
     51  nn_ice      = 2         !  =0 no ice boundary condition 
     52     !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif ) 
     53     !                    !  =2 or 3 for SI3 and CICE, respectively 
    5354  ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr) 
    5455/ 
     
    7677!!                                                                    !! 
    7778!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    78 !!   namdrg_top    top    friction                                      (ln_OFF =F & ln_isfcav=T) 
    79 !!   namdrg_bot    bottom friction                                      (ln_OFF =F) 
     79!!   namdrg_top    top    friction                                      (ln_drg_OFF =F & ln_isfcav=T) 
     80!!   namdrg_bot    bottom friction                                      (ln_drg_OFF =F) 
    8081!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    8182!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    190191   ln_dynspg_ts   = .true.   ! split-explicit free surface 
    191192      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    192          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 
    193194/ 
    194195!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/namelist_cfg_orca12_like

    r10539 r13463  
    99   nn_it000    =       1   !  first time step 
    1010   nn_itend    =    1000   !  last time step  
    11    nn_stock    =       0   !  frequency of creation of a restart file (modulo referenced to 1) 
    12    nn_write    =       0   !  frequency of write in the output file   (modulo referenced to nn_it000) 
     11   nn_stock    =      -1   !  frequency of creation of a restart file (modulo referenced to 1) 
     12   nn_write    =      -1   !  frequency of write in the output file   (modulo referenced to nn_it000) 
    1313/ 
    1414!----------------------------------------------------------------------- 
    1515&namusr_def    !   User defined :   BENCH configuration: Flat bottom, beta-plane 
    1616!----------------------------------------------------------------------- 
    17    nn_isize   =   4322     ! number of point in i-direction of global(local) domain if >0 (<0)   
    18    nn_jsize   =   3147     ! number of point in j-direction of global(local) domain if >0 (<0)   
     17   nn_isize   =   4320     ! number of point in i-direction of global(local) domain if >0 (<0)   
     18   nn_jsize   =   3146     ! number of point in j-direction of global(local) domain if >0 (<0)   
    1919   nn_ksize   =   75       ! total number of point in k-direction 
    2020   nn_perio   =   4        ! periodicity 
     
    3030&namctl        !   Control prints                                       (default: OFF) 
    3131!----------------------------------------------------------------------- 
    32    ln_ctl      = .false.   !  trends control print (expensive!) 
    33    nn_print    =    0      !  level of print (0 no extra print) 
    3432   ln_timing   = .false.   !  timing by routine write out in timing.output file 
    3533/ 
     
    3735&namdom        !   time and space domain 
    3836!----------------------------------------------------------------------- 
    39    rn_rdt      =    300.   !  time step for the dynamics (and tracer if nn_acc=0) 
     37   rn_Dt      =    300.   !  time step for the dynamics (and tracer if nn_acc=0) 
    4038   rn_atfp     =   0.05    !  asselin time filter parameter 
    4139/ 
     
    5149!----------------------------------------------------------------------- 
    5250  ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
     51  nn_ice      = 2         !  =0 no ice boundary condition 
     52     !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif ) 
     53     !                    !  =2 or 3 for SI3 and CICE, respectively 
    5354  ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr) 
    5455/ 
     
    7677!!                                                                    !! 
    7778!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    78 !!   namdrg_top    top    friction                                      (ln_OFF =F & ln_isfcav=T) 
    79 !!   namdrg_bot    bottom friction                                      (ln_OFF =F) 
     79!!   namdrg_top    top    friction                                      (ln_drg_OFF =F & ln_isfcav=T) 
     80!!   namdrg_bot    bottom friction                                      (ln_drg_OFF =F) 
    8081!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    8182!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    189190   ln_dynspg_ts   = .true.   ! split-explicit free surface 
    190191      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    191          nn_baro      =  30         ! =F : the number of sub-step in rn_rdt seconds 
     192         nn_e      =  30         ! =F : the number of sub-step in rn_Dt seconds 
    192193/ 
    193194!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/namelist_cfg_orca1_like

    r10539 r13463  
    99   nn_it000    =       1   !  first time step 
    1010   nn_itend    =    1000   !  last time step  
    11    nn_stock    =       0   !  frequency of creation of a restart file (modulo referenced to 1) 
    12    nn_write    =       0   !  frequency of write in the output file   (modulo referenced to nn_it000) 
     11   nn_stock    =      -1   !  frequency of creation of a restart file (modulo referenced to 1) 
     12   nn_write    =      -1   !  frequency of write in the output file   (modulo referenced to nn_it000) 
    1313/ 
    1414!----------------------------------------------------------------------- 
    1515&namusr_def    !   User defined :   BENCH configuration: Flat bottom, beta-plane 
    1616!----------------------------------------------------------------------- 
    17    nn_isize   =   362      ! number of point in i-direction of global(local) domain if >0 (<0)   
    18    nn_jsize   =   332      ! number of point in j-direction of global(local) domain if >0 (<0)   
     17   nn_isize   =   360      ! number of point in i-direction of global(local) domain if >0 (<0)   
     18   nn_jsize   =   331      ! number of point in j-direction of global(local) domain if >0 (<0)   
    1919   nn_ksize   =   75       ! total number of point in k-direction 
    2020   nn_perio   =   6        ! periodicity 
     
    3030&namctl        !   Control prints                                       (default: OFF) 
    3131!----------------------------------------------------------------------- 
    32    ln_ctl      = .false.   !  trends control print (expensive!) 
    33    nn_print    =    0      !  level of print (0 no extra print) 
    3432   ln_timing   = .false.   !  timing by routine write out in timing.output file 
    3533/ 
     
    3735&namdom        !   time and space domain 
    3836!----------------------------------------------------------------------- 
    39    rn_rdt      =   3600.   !  time step for the dynamics (and tracer if nn_acc=0) 
     37   rn_Dt      =   3600.   !  time step for the dynamics (and tracer if nn_acc=0) 
    4038   rn_atfp     =   0.05    !  asselin time filter parameter 
    4139/ 
     
    5149!----------------------------------------------------------------------- 
    5250  ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
     51  nn_ice      = 2         !  =0 no ice boundary condition 
     52     !                    !  =1 use observed ice-cover                 (  => fill namsbc_iif ) 
     53     !                    !  =2 or 3 for SI3 and CICE, respectively 
    5354  ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr) 
    5455/ 
     
    7677!!                                                                    !! 
    7778!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    78 !!   namdrg_top    top    friction                                      (ln_OFF =F & ln_isfcav=T) 
    79 !!   namdrg_bot    bottom friction                                      (ln_OFF =F) 
     79!!   namdrg_top    top    friction                                      (ln_drg_OFF =F & ln_isfcav=T) 
     80!!   namdrg_bot    bottom friction                                      (ln_drg_OFF =F) 
    8081!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    8182!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    189190   ln_dynspg_ts   = .true.   ! split-explicit free surface 
    190191      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    191          nn_baro      =  30         ! =F : the number of sub-step in rn_rdt seconds 
     192         nn_e      =  30         ! =F : the number of sub-step in rn_Dt seconds 
    192193/ 
    193194!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/namelist_ice_cfg

    r10179 r13463  
    7474&namini         !   Ice initialization 
    7575!------------------------------------------------------------------------------ 
     76   rn_thres_sst     =   0.5           !  max delta temp. above Tfreeze with initial ice = (sst - tfreeze) 
    7677/ 
    7778!------------------------------------------------------------------------------ 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/namelist_pisces_cfg

    r10343 r13463  
    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_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/namelist_top_cfg

    r10343 r13463  
    5757!          !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    5858!          !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    59    sn_trcdta(1)  = 'data_DIC_nomask'        ,        -12        ,  'DIC'     ,    .false.   , .true. , 'yearly'  , ''       , ''   , '' 
    60    sn_trcdta(2)  = 'data_Alkalini_nomask'   ,        -12        ,  'Alkalini',    .false.   , .true. , 'yearly'  , ''       , ''   , '' 
    61    sn_trcdta(3)  = 'data_O2_nomask'         ,        -1         ,  'O2'      ,    .true.    , .true. , 'yearly'  , ''       , ''   , '' 
    62    sn_trcdta(5)  = 'data_PO4_nomask'        ,        -1         ,  'PO4'     ,    .true.    , .true. , 'yearly'  , ''       , ''   , '' 
    63    sn_trcdta(7)  = 'data_Si_nomask'         ,        -1         ,  'Si'      ,    .true.    , .true. , 'yearly'  , ''       , ''   , '' 
    64    sn_trcdta(10) = 'data_DOC_nomask'        ,        -12        ,  'DOC'     ,    .false.   , .true. , 'yearly'  , ''       , ''   , '' 
    65    sn_trcdta(14) = 'data_Fer_nomask'        ,        -12        ,  'Fer'     ,    .false.   , .true. , 'yearly'  , ''       , ''   , '' 
    66    sn_trcdta(23) = 'data_NO3_nomask'        ,        -1         ,  'NO3'     ,    .true.    , .true. , 'yearly'  , ''       , ''   , '' 
     59   sn_trcdta(1)  = 'data_DIC_nomask'        ,        -12.       ,  'DIC'     ,    .false.   , .true. , 'yearly'  , ''       , ''   , '' 
     60   sn_trcdta(2)  = 'data_Alkalini_nomask'   ,        -12.       ,  'Alkalini',    .false.   , .true. , 'yearly'  , ''       , ''   , '' 
     61   sn_trcdta(3)  = 'data_O2_nomask'         ,        -1.        ,  'O2'      ,    .true.    , .true. , 'yearly'  , ''       , ''   , '' 
     62   sn_trcdta(5)  = 'data_PO4_nomask'        ,        -1.        ,  'PO4'     ,    .true.    , .true. , 'yearly'  , ''       , ''   , '' 
     63   sn_trcdta(7)  = 'data_Si_nomask'         ,        -1.        ,  'Si'      ,    .true.    , .true. , 'yearly'  , ''       , ''   , '' 
     64   sn_trcdta(10) = 'data_DOC_nomask'        ,        -12.       ,  'DOC'     ,    .false.   , .true. , 'yearly'  , ''       , ''   , '' 
     65   sn_trcdta(14) = 'data_Fer_nomask'        ,        -12.       ,  'Fer'     ,    .false.   , .true. , 'yearly'  , ''       , ''   , '' 
     66   sn_trcdta(23) = 'data_NO3_nomask'        ,        -1.        ,  'NO3'     ,    .true.    , .true. , 'yearly'  , ''       , ''   , '' 
    6767   rn_trfac(1)   =   1.0e-06  !  multiplicative factor 
    6868   rn_trfac(2)   =   1.0e-06  !  -      -      -     - 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/sh_bench

    r9869 r13463  
    99machine=$( hostname | sed -e "s/[0-9]*//g" ) 
    1010case $machine in  
     11    "jean-zay")     ncore_node=40 ;; 
    1112    "beaufixlogin") ncore_node=40 ;; 
    1213    "curie")        ncore_node=16 ;; 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/EXPREF/submit_bench

    r9870 r13463  
    66# 
    77set -u 
    8 set -vx 
     8#set -vx 
    99# 
    1010cores=$1 
     
    1515# 
    1616# number of processes for each executable 
    17     nproc_exe1=$( echo $cores | bc ) 
    18   (( nproc = $nproc_exe1 )) 
    19 (( nnode = $nproc / $ncore_node )) 
    20 [ $nnode -lt 1 ] && nnode=1 
     17nproc_exe1=$( echo $cores | bc ) 
     18nproc=$nproc_exe1 
     19nnode=$(( ( $nproc + $ncore_node - 1 )  / $ncore_node )) 
    2120 
    2221nproc5=$( printf "%05d\n" ${nproc_exe1} ) 
     22 
     23case ${resolution} in 
     24    "1") 
     25   if [ $nproc_exe1 -lt 50 ] 
     26   then 
     27       timejob=3600 
     28   elif [ $nproc_exe1 -lt 100 ] 
     29   then 
     30       timejob=1800 
     31   elif [ $nproc_exe1 -lt 200 ] 
     32   then 
     33       timejob=900 
     34   else 
     35       timejob=600 
     36   fi 
     37   ;; 
     38    "025") 
     39   if [ $nproc_exe1 -lt 50 ] 
     40   then 
     41       timejob=15000 
     42   elif [ $nproc_exe1 -lt 100 ] 
     43   then 
     44       timejob=7000 
     45   elif [ $nproc_exe1 -lt 200 ] 
     46   then 
     47       timejob=3600 
     48   elif [ $nproc_exe1 -lt 400 ] 
     49   then 
     50       timejob=2000 
     51   elif [ $nproc_exe1 -lt 800 ] 
     52   then 
     53       timejob=1000 
     54   else 
     55       timejob=600 
     56   fi 
     57   ;; 
     58    "12") 
     59   if [ $nproc_exe1 -lt 200 ] 
     60   then 
     61       timejob=30000 
     62   elif [ $nproc_exe1 -lt 400 ] 
     63   then 
     64       timejob=15000 
     65   elif [ $nproc_exe1 -lt 800 ] 
     66   then 
     67       timejob=20000 
     68   elif [ $nproc_exe1 -lt 1600 ] 
     69   then 
     70       timejob=15000 
     71   elif [ $nproc_exe1 -lt 3200 ] 
     72   then 
     73       timejob=7500 
     74   elif [ $nproc_exe1 -lt 10000 ] 
     75   then 
     76       timejob=5000 
     77   elif [ $nproc_exe1 -lt 20000 ] 
     78   then 
     79       timejob=2500 
     80   else 
     81       timejob=1200 
     82   fi 
     83   ;; 
     84esac 
     85 
    2386 
    2487###################################################################### 
     
    100163if [[ ( "$machine" == "curie" ) || ( "$machine" == "irene" ) ]] 
    101164then 
    102      
    103     case ${resolution} in 
    104    "1") 
    105        if [ $nproc_exe1 -lt 50 ] 
    106        then 
    107       timejob=3600 
    108        elif [ $nproc_exe1 -lt 100 ] 
    109        then 
    110       timejob=1800 
    111        elif [ $nproc_exe1 -lt 200 ] 
    112        then 
    113       timejob=900 
    114        else 
    115       timejob=600 
    116        fi 
    117        ;; 
    118    "025") 
    119        if [ $nproc_exe1 -lt 50 ] 
    120        then 
    121       timejob=15000 
    122        elif [ $nproc_exe1 -lt 100 ] 
    123        then 
    124       timejob=7000 
    125        elif [ $nproc_exe1 -lt 200 ] 
    126        then 
    127       timejob=3600 
    128        elif [ $nproc_exe1 -lt 400 ] 
    129        then 
    130       timejob=2000 
    131        elif [ $nproc_exe1 -lt 800 ] 
    132        then 
    133       timejob=1000 
    134        else 
    135       timejob=600 
    136        fi 
    137        ;; 
    138    "12") 
    139        if [ $nproc_exe1 -lt 200 ] 
    140        then 
    141       timejob=30000 
    142        elif [ $nproc_exe1 -lt 400 ] 
    143        then 
    144       timejob=15000 
    145        elif [ $nproc_exe1 -lt 800 ] 
    146        then 
    147       timejob=8000 
    148        elif [ $nproc_exe1 -lt 1600 ] 
    149        then 
    150       timejob=5000 
    151        elif [ $nproc_exe1 -lt 3200 ] 
    152        then 
    153       timejob=2500 
    154        else 
    155       timejob=1200 
    156        fi 
    157    ;; 
    158     esac 
    159165 
    160166    [ "$machine" == "curie" ] && queuename=standard || queuename=skylake 
    161167     
    162     jobname=$HOME/binrun/jobbench 
     168    EXPjob=../EXP_${resolution}_${nproc5}_${dateref} 
     169    mkdir -p ${EXPjob} 
     170    cd ${EXPjob} 
     171    jobname=jobbench 
    163172    cat > $jobname << EOF 
    164173#!/bin/bash 
     
    176185# 
    177186 
    178 cd \${BRIDGE_MSUB_PWD}/.. 
    179  
    180  
    181 EXPjob=EXP_${resolution}_${nproc5}_${dateref} 
    182 rsync -av --exclude="*eo" EXPREF/ \${EXPjob}/ 
    183 rsync -av EXP00/nemo \${EXPjob}/nemo 
    184 cd \${EXPjob} 
     187cd \${BRIDGE_MSUB_PWD} 
     188 
     189for ff in \${BRIDGE_MSUB_PWD}/../EXPREF/namelist_*cfg \${BRIDGE_MSUB_PWD}/../EXPREF/namelist_*ref \${BRIDGE_MSUB_PWD}/../BLD/bin/nemo.exe 
     190do 
     191    cp \$ff . 
     192done 
    185193 
    186194jpni=${cores/\**/} 
    187195jpnj=${cores/?*\*/} 
    188196 
    189 sed -e "s/jpni *=.*/jpni = \${jpni}/" -e "s/jpnj *=.*/jpnj = \${jpnj}/" namelist_cfg_orca${resolution}_like > namelist_cfg 
    190  
    191 time ccc_mprun -n \${BRIDGE_MSUB_NPROC} ./nemo > jobout_${resolution}_${nproc5}_${dateref} 
     197sed -e "s/jpni *=.*/jpni = \${jpni}/" \ 
     198    -e "s/jpnj *=.*/jpnj = \${jpnj}/"\ 
     199    -e "s/ln_timing *= *.false./ln_timing   =  .true./" \ 
     200     \${BRIDGE_MSUB_PWD}/../EXPREF/namelist_cfg_orca${resolution}_like > namelist_cfg 
     201 
     202time ccc_mprun -n \${BRIDGE_MSUB_NPROC} ./nemo.exe > jobout_${resolution}_${nproc5}_${dateref} 2>&1 
    192203 
    193204EOF 
     
    196207 
    197208fi 
     209 
     210###################################################################### 
     211### Jean-Zay 
     212###################################################################### 
     213 
     214if [ "$machine" == "jean-zay" ] 
     215then 
     216    hh=$( printf "%02d\n" $(( ${timejob} / 3600 )) ) 
     217    mm=$( printf "%02d\n" $(( ( ${timejob} % 3600 ) / 60 )) ) 
     218    ss=$( printf "%02d\n" $(( ( ${timejob} % 3600 ) % 60 )) ) 
     219 
     220    EXPjob=../EXP_${resolution}_${nproc5}_${dateref} 
     221    mkdir -p ${EXPjob} 
     222    cd ${EXPjob} 
     223    jobname=jobbench 
     224    cat > $jobname << EOF 
     225#!/bin/bash 
     226#SBATCH --job-name=Seq        # nom du job 
     227#SBATCH --partition=cpu_gct3   # demande d'allocation sur la partition CPU 
     228#SBATCH --nodes=${nnode}             # nombre de noeuds 
     229#SBATCH --ntasks-per-node=${ncore_node}  # nombre de taches MPI par noeud 
     230#SBATCH --ntasks-per-core=1        # 1 processus MPI par coeur physique (pas d'hyperthreading) 
     231#SBATCH --time=${hh}:${mm}:${ss}       # temps d execution maximum demande (HH:MM:SS) 
     232#SBATCH --output=bench_${resolution}_${nproc5}_%j.eo        # nom du fichier de sortie 
     233#SBATCH --error=bench_${resolution}_${nproc5}_%j.eo         # nom du fichier d'erreur (ici en commun avec la sortie) 
     234#========================================== 
     235set -u 
     236#set -xv 
     237# 
     238#cd \${SLURM_SUBMIT_DIR} 
     239cd \${JOBSCRATCH} 
     240pwd 
     241 
     242for ff in \${SLURM_SUBMIT_DIR}/../EXPREF/namelist_*cfg \${SLURM_SUBMIT_DIR}/../EXPREF/namelist_*ref \${SLURM_SUBMIT_DIR}/../BLD/bin/nemo.exe 
     243do 
     244    cp \$ff . 
     245done 
     246 
     247jpni=${cores/\**/} 
     248jpnj=${cores/?*\*/} 
     249 
     250sed -e "s/jpni *=.*/jpni = \${jpni}/" \ 
     251    -e "s/jpnj *=.*/jpnj = \${jpnj}/" \ 
     252    -e "s/ln_timing *= *.false./ln_timing   =  .true./" \ 
     253    \${SLURM_SUBMIT_DIR}/../EXPREF/namelist_cfg_orca${resolution}_like > namelist_cfg 
     254 
     255ls -l 
     256 
     257echo  
     258echo  
     259echo " =========== start the model ===========" 
     260echo  
     261echo  
     262 
     263time srun --mpi=pmi2 --cpu-bind=cores -K1 -n ${nproc} ./nemo.exe > jobout_${resolution}_${nproc5}_${dateref} 2>&1 
     264 
     265ls -l 
     266 
     267if [ "\$( pwd )" != "\${SLURM_SUBMIT_DIR}" ] 
     268then  
     269    rsync -av namelist_cfg time.step ocean.output jobout_${resolution}_${nproc5}_${dateref} communication_report.txt layout.dat timing.output output.namelist* \${SLURM_SUBMIT_DIR} 
     270fi 
     271 
     272EOF 
     273 
     274    sbatch $jobname 
     275 
     276fi 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/MY_SRC/usrdef_hgr.F90

    r9762 r13463  
    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) 
     
    5961      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2] 
    6062      ! 
    61       INTEGER  ::   ji, jj   ! dummy loop indices 
     63      INTEGER  ::   ji, jj         ! dummy loop indices 
    6264      REAL(wp) ::   zres, zf0 
    63       REAL(wp) ::   zti, zui, ztj, zvj   ! local scalars 
     65      REAL(wp) ::   zti, ztj       ! local scalars 
    6466      !!------------------------------------------------------------------------------- 
    6567      ! 
     
    7072      IF(lwp) WRITE(numout,*) '          given by rn_dx and rn_dy'  
    7173      ! 
    72       !                           
    7374      ! 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 
     75      !                          ========== 
     76      DO_2D( 1, 1, 1, 1 ) 
     77          
     78         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos 
     79         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos 
     80          
     81         plamt(ji,jj) = zti 
     82         plamu(ji,jj) = zti + 0.5_wp 
     83         plamv(ji,jj) = zti 
     84         plamf(ji,jj) = zti + 0.5_wp 
     85          
     86         pphit(ji,jj) = ztj 
     87         pphiu(ji,jj) = ztj 
     88         pphiv(ji,jj) = ztj + 0.5_wp 
     89         pphif(ji,jj) = ztj + 0.5_wp 
    8090 
    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 
     91      END_2D 
    9392      !      
    9493      ! Horizontal scale factors (in meters) 
     
    109108      kff = 1                       !  indicate not to compute Coriolis parameter afterward 
    110109      ! 
    111       zf0   = 2._wp * omega * SIN( rad * 45 )   ! constant coriolis factor corresponding to 45°N 
     110      zf0 = 2._wp * omega * SIN( rad * 45 )   ! constant coriolis factor corresponding to 45°N 
    112111      pff_f(:,:) = zf0 
    113112      pff_t(:,:) = zf0 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/MY_SRC/usrdef_istate.F90

    r10179 r13463  
    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) 
     
    5557      REAL(wp) ::   zfact 
    5658      INTEGER  ::   ji, jj, jk 
     59      INTEGER  ::   igloi, igloj   ! to be removed in the future, see comment bellow 
    5760      !!---------------------------------------------------------------------- 
    5861      ! 
     
    6164      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~   ' 
    6265      ! 
    63       ! 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( nimpp + ji - 1 + ( njmpp + jj - 2 ) * jpiglo, wp ) / REAL( jpiglo * jpjglo, wp ) ) 
    67          ENDDO 
    68       ENDDO 
     66      ! define unique value on each point of the inner global domain. z2d ranging from 0.05 to -0.05 
     67      ! 
     68      ! WARNING: to keep compatibility with the trunk that was including periodocity into the input data,  
     69      ! we must define z2d as bellow. 
     70      ! Once we decide to forget trunk compatibility, we must simply define z2d as: 
     71!!$      DO_2D( 0, 0, 0, 0 ) 
     72!!$         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0_oldcmp(ji) + (mjg0_oldcmp(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) ) 
     73!!$      END_2D 
     74      igloi = Ni0glo + 2 * COUNT( (/ jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 /) ) 
     75      igloj = Nj0glo + 2 * COUNT( (/ jperio == 2 .OR. jperio == 7 /) ) + 1 * COUNT( (/ jperio >= 4 .AND. jperio <= 6 /) ) 
     76      DO_2D( 0, 0, 0, 0 ) 
     77         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0_oldcmp(ji) + (mjg0_oldcmp(jj)-1) * igloi, wp ) / REAL( igloi * igloj, wp ) ) 
     78      END_2D 
    6979      ! 
    7080      ! sea level: 
    7181      pssh(:,:) = z2d(:,:)                                                ! +/- 0.05 m 
    7282      ! 
    73       DO jk = 1, jpk 
     83      DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    7484         zfact = REAL(jk-1,wp) / REAL(jpk-1,wp)   ! 0 to 1 to add a basic stratification 
    75          ! temperature choosen to lead to 20% ice 
    76          pts(:,:,jk,jp_tem) = 2._wp - 0.1_wp * zfact + z2d(:,:) * 100._wp ! 2 to 1.9 +/- 5 degG 
    77          WHERE ( pts(:,:,jk,jp_tem) < -1.5_wp ) pts(:,:,jk,jp_tem) = -1.5_wp + z2d(:,:) * 0.2_wp   
     85         ! temperature choosen to lead to ~50% ice at the beginning if rn_thres_sst = 0.5 
     86         pts(:,:,jk,jp_tem) = 20._wp*z2d(:,:) - 1._wp - 0.5_wp * zfact    ! -1 to -1.5 +/-1.0 degG 
    7887         ! salinity:   
    7988         pts(:,:,jk,jp_sal) = 30._wp + 1._wp * zfact + z2d(:,:)           ! 30 to 31 +/- 0.05 psu 
    8089         ! velocities: 
    81          pu(:,:,jk) = z2d(:,:) * 0.1_wp                                   ! +/- 0.005  m/s 
    82          pv(:,:,jk) = z2d(:,:) * 0.01_wp                                  ! +/- 0.0005 m/s 
    83       ENDDO 
     90         pu(:,:,jk) = z2d(:,:) *  0.1_wp * umask(:,:,jk)                  ! +/- 0.005  m/s 
     91         pv(:,:,jk) = z2d(:,:) * 0.01_wp * vmask(:,:,jk)                  ! +/- 0.0005 m/s 
     92      END_3D 
     93      pts(:,:,jpk,:) = 0._wp 
     94      pu( :,:,jpk  ) = 0._wp 
     95      pv( :,:,jpk  ) = 0._wp 
    8496      ! 
    8597      CALL lbc_lnk('usrdef_istate', pssh, 'T',  1. )            ! apply boundary conditions 
    86       CALL lbc_lnk( 'usrdef_istate', pts, 'T',  1. )            ! apply boundary conditions 
    87       CALL lbc_lnk(  'usrdef_istate', pu, 'U', -1. )            ! apply boundary conditions 
    88       CALL lbc_lnk(  'usrdef_istate', pv, 'V', -1. )            ! apply boundary conditions 
     98      CALL lbc_lnk('usrdef_istate', pts, 'T',  1. )            ! apply boundary conditions 
     99      CALL lbc_lnk('usrdef_istate',  pu, 'U', -1. )            ! apply boundary conditions 
     100      CALL lbc_lnk('usrdef_istate',  pv, 'V', -1. )            ! apply boundary conditions 
    89101       
    90102   END SUBROUTINE usr_def_istate 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/MY_SRC/usrdef_nam.F90

    r10428 r13463  
    2929CONTAINS 
    3030 
    31    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     31   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    3232      !!---------------------------------------------------------------------- 
    3333      !!                     ***  ROUTINE dom_nam  *** 
     
    4141      !! ** input   : - namusr_def namelist found in namelist_cfg 
    4242      !!---------------------------------------------------------------------- 
    43       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    4443      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    4544      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    4847      ! 
    4948      ! 
    50       INTEGER ::   ios, ii      ! Local integer 
     49      INTEGER ::   ios         ! Local integer 
    5150      !                              !!* namusr_def namelist *!! 
    5251      INTEGER ::   nn_isize    ! number of point in i-direction of global(local) domain if >0 (<0)   
     
    5554      INTEGER ::   nn_perio    ! periodicity 
    5655      !                              !!* nammpp namelist *!! 
    57       CHARACTER(len=1) ::   cn_mpi_send 
    58       INTEGER          ::   nn_buffer, jpni, jpnj 
    59       LOGICAL          ::   ln_nnogather 
     56      INTEGER          ::   jpni, jpnj 
     57      LOGICAL          ::   ln_nnogather, ln_listonly 
    6058      !! 
    6159      NAMELIST/namusr_def/ nn_isize, nn_jsize, nn_ksize, nn_perio 
    62       NAMELIST/nammpp/ cn_mpi_send, nn_buffer, jpni, jpnj, ln_nnogather 
     60      NAMELIST/nammpp/ jpni, jpnj, nn_hls, ln_nnogather, ln_listonly 
    6361      !!----------------------------------------------------------------------      
    6462      ! 
    65       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6663      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 903 ) 
    67 903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
    68       WRITE( ldnam(:), namusr_def )       
     64903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
     65      ! 
     66      IF(lwm)   WRITE( numond, namusr_def )       
    6967      ! 
    7068      cd_cfg = 'BENCH'             ! name & resolution (not used) 
    7169      kk_cfg = 0 
    72  
     70      ! 
    7371      IF( nn_isize < 0 .AND. nn_jsize < 0 ) THEN 
    7472      ! 
    75          REWIND( numnam_ref )              ! Namelist nammpp in reference namelist: mpi variables 
    7673         READ  ( numnam_ref, nammpp, IOSTAT = ios, ERR = 901) 
    77 901      IF( ios /= 0 )   CALL ctl_nam ( ios , 'nammpp in reference namelist', lwp ) 
     74901      IF( ios /= 0 )   CALL ctl_nam ( ios , 'nammpp in reference namelist' ) 
    7875         ! 
    79          REWIND( numnam_cfg )              ! Namelist nammpp in configuration namelist: mpi variables 
    8076         READ  ( numnam_cfg, nammpp, IOSTAT = ios, ERR = 902 ) 
    81 902      IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist', lwp ) 
     77902      IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist' ) 
    8278 
    83          kpi = ( -nn_isize - 2*nn_hls ) * jpni + 2*nn_hls 
    84          kpj = ( -nn_jsize - 2*nn_hls ) * jpnj + 2*nn_hls 
     79         kpi = -nn_isize * jpni 
     80         kpj = -nn_jsize * jpnj 
    8581      ELSE 
    8682         kpi = nn_isize 
    8783         kpj = nn_jsize 
    8884      ENDIF 
    89   
     85      ! 
    9086      kpk = nn_ksize 
    9187      kperio = nn_perio 
    92  
    9388      !                             ! control print 
    94       ii = 1 
    95       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    96       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    97       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    98       WRITE(ldtxt(ii),*) '   Namelist namusr_def : BENCH test case'                                     ;   ii = ii + 1 
    99       IF( nn_isize > 0 ) THEN 
    100          WRITE(ldtxt(ii),*) '      global domain size-x            nn_isize = ',  nn_isize              ;   ii = ii + 1 
    101       ELSE 
    102          WRITE(ldtxt(ii),*) '                                          jpni = ', jpni                   ;   ii = ii + 1 
    103          WRITE(ldtxt(ii),*) '       local domain size-x           -nn_isize = ', -nn_isize              ;   ii = ii + 1 
    104          WRITE(ldtxt(ii),*) '      global domain size-x                 kpi = ', kpi                    ;   ii = ii + 1 
     89      IF(lwp) THEN 
     90         WRITE(numout,*) '   ' 
     91         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     92         WRITE(numout,*) '~~~~~~~~~~~ ' 
     93         WRITE(numout,*) '   Namelist namusr_def : BENCH test case' 
     94         IF( nn_isize > 0 ) THEN 
     95            WRITE(numout,*) '      global domain size-x            nn_isize = ',  nn_isize 
     96         ELSE 
     97            WRITE(numout,*) '                                          jpni = ', jpni 
     98            WRITE(numout,*) '       local domain size-x           -nn_isize = ', -nn_isize 
     99            WRITE(numout,*) '      global domain size-x                 kpi = ', kpi 
     100         ENDIF 
     101         IF( nn_jsize > 0 ) THEN 
     102            WRITE(numout,*) '      global domain size-y            nn_jsize = ', nn_jsize 
     103         ELSE 
     104            WRITE(numout,*) '                                          jpnj = ', jpnj 
     105            WRITE(numout,*) '       local domain size-y           -nn_jsize = ', -nn_jsize 
     106            WRITE(numout,*) '      global domain size-y                 kpj = ', kpj 
     107         ENDIF 
     108         WRITE(numout,*) '      global domain size-z            nn_ksize = ', nn_ksize 
     109         WRITE(numout,*) '      LBC of the global domain          kperio = ', kperio 
    105110      ENDIF 
    106       IF( nn_jsize > 0 ) THEN 
    107          WRITE(ldtxt(ii),*) '      global domain size-y            nn_jsize = ', nn_jsize               ;   ii = ii + 1 
    108       ELSE 
    109          WRITE(ldtxt(ii),*) '                                          jpnj = ', jpnj                   ;   ii = ii + 1 
    110          WRITE(ldtxt(ii),*) '       local domain size-y           -nn_jsize = ', -nn_jsize              ;   ii = ii + 1 
    111          WRITE(ldtxt(ii),*) '      global domain size-y                 kpj = ', kpj                    ;   ii = ii + 1 
    112       ENDIF 
    113       WRITE(ldtxt(ii),*) '      global domain size-z            nn_ksize = ', nn_ksize                  ;   ii = ii + 1 
    114       WRITE(ldtxt(ii),*) '      LBC of the global domain          kperio = ', kperio                    ;   ii = ii + 1 
    115111      ! 
    116112   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/MY_SRC/usrdef_sbc.F90

    r10179 r13463  
    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      !      
     
    9699      REAL(wp), DIMENSION(jpi,jpj) ::   z2d   ! 2D workspace 
    97100      INTEGER  ::   ji, jj 
     101      INTEGER  ::   igloi, igloj   ! to be removed in the future, see comment bellow 
    98102      !!--------------------------------------------------------------------- 
    99103#if defined key_si3 
     
    101105      ! 
    102106      ! 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 
    108       utau_ice(:,:) = 0.1_wp +  z2d(:,:) 
    109       vtau_ice(:,:) = 0.1_wp +  z2d(:,:) 
     107      ! 
     108      ! WARNING: to keep compatibility with the trunk that was including periodocity into the input data,  
     109      ! we must define z2d as bellow. 
     110      ! Once we decide to forget trunk compatibility, we must simply define z2d as: 
     111!!$      DO_2D( 0, 0, 0, 0 ) 
     112!!$         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0_oldcmp(ji) + (mjg0_oldcmp(jj)-1) * Ni0glo, wp ) / REAL( Ni0glo * Nj0glo, wp ) ) 
     113!!$      END_2D 
     114      igloi = Ni0glo + 2 * COUNT( (/ jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 /) ) 
     115      igloj = Nj0glo + 2 * COUNT( (/ jperio == 2 .OR. jperio == 7 /) ) + 1 * COUNT( (/ jperio >= 4 .AND. jperio <= 6 /) ) 
     116      DO_2D( 0, 0, 0, 0 ) 
     117         z2d(ji,jj) = 0.1 * ( 0.5 - REAL( mig0_oldcmp(ji) + (mjg0_oldcmp(jj)-1) * igloi, wp ) / REAL( igloi * igloj, wp ) ) 
     118      END_2D 
     119      utau_ice(:,:) = 0.1_wp + z2d(:,:) 
     120      vtau_ice(:,:) = 0.1_wp + z2d(:,:) 
    110121 
    111122      CALL lbc_lnk_multi( 'usrdef_sbc', utau_ice, 'U', -1., vtau_ice, 'V', -1. ) 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/BENCH/MY_SRC/usrdef_zgr.F90

    r10170 r13463  
    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) 
     
    194192      z2d(:,:) = REAL( jpkm1 , wp )          ! flat bottom 
    195193      ! 
     194      ! 
     195      ! BENCH should work without these 2 small islands on the 2 poles of the folding... 
     196      !   -> Comment out these lines if instabilities are too large... 
     197      ! 
     198       
     199!!$      IF( jperio == 3 .OR. jperio == 4 ) THEN   ! add a small island in the upper corners to avoid model instabilities... 
     200!!$         z2d(mi0(       nn_hls):mi1(                  nn_hls+2 ),mj0(jpjglo-nn_hls-1):mj1(jpjglo-nn_hls+1)) = 0. 
     201!!$         z2d(mi0(jpiglo-nn_hls):mi1(MIN(jpiglo,jpiglo-nn_hls+2)),mj0(jpjglo-nn_hls-1):mj1(jpjglo-nn_hls+1)) = 0. 
     202!!$         z2d(mi0(jpiglo/2     ):mi1(           jpiglo/2     +2 ),mj0(jpjglo-nn_hls-1):mj1(jpjglo-nn_hls+1)) = 0. 
     203!!$      ENDIF 
     204!!$      ! 
     205!!$      IF( jperio == 5 .OR. jperio == 6 ) THEN   ! add a small island in the upper corners to avoid model instabilities... 
     206!!$         z2d(mi0(       nn_hls):mi1(       nn_hls+1),mj0(jpjglo-nn_hls):mj1(jpjglo-nn_hls+1)) = 0. 
     207!!$         z2d(mi0(jpiglo-nn_hls):mi1(jpiglo-nn_hls+1),mj0(jpjglo-nn_hls):mj1(jpjglo-nn_hls+1)) = 0. 
     208!!$         z2d(mi0(jpiglo/2     ):mi1(jpiglo/2     +1),mj0(jpjglo-nn_hls):mj1(jpjglo-nn_hls+1)) = 0. 
     209!!$      ENDIF 
     210 
     211      ! 
    196212      CALL lbc_lnk( 'usrdef_zgr', z2d, 'T', 1. )           ! set surrounding land to zero (here jperio=0 ==>> closed) 
    197213      ! 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/CANAL/EXPREF/context_nemo.xml

    r9930 r13463  
    55--> 
    66<context id="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"/> 
    3436 
    3537</context> 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/CANAL/EXPREF/field_def_nemo-oce.xml

    r9572 r13463  
    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_r11351_fldread_with_XIOS/tests/CANAL/EXPREF/namelist_cfg

    r10075 r13463  
    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/ 
     
    108108!!                                                                    !! 
    109109!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    110 !!   namdrg_top    top    friction                                      (ln_OFF =F & ln_isfcav=T) 
    111 !!   namdrg_bot    bottom friction                                      (ln_OFF =F) 
     110!!   namdrg_top    top    friction                                      (ln_drg_OFF =F & ln_isfcav=T) 
     111!!   namdrg_bot    bottom friction                                      (ln_drg_OFF =F) 
    112112!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    113113!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    117117&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    118118!----------------------------------------------------------------------- 
    119    ln_OFF     = .true.    !  free-slip       : Cd = 0 
     119   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    120120/ 
    121121!!====================================================================== 
     
    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!----------------------------------------------------------------------- 
     
    275275!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    276276!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    277 !!   namflo       float parameters                                      ("key_float") 
    278 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    279 !!   namdct       transports through some sections                      ("key_diadct") 
    280 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     277!!   namflo       float parameters                                      (default: OFF) 
     278!!   nam_diadct   transports through some sections                      (default: OFF) 
    281279!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    282280!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/CANAL/MY_SRC/diawri.F90

    r10425 r13463  
    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( 1, 1, 1, 1 ) 
     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( 1, 1, 1, 1 ) 
     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( 0, 0, 0, 0 ) 
     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( 1, 1, 1, 1 ) 
     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( 1, 1, 1, 1 ) 
     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( 0, 0, 0, 0 ) 
     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( 1, 1, 1, 1, 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( 1, 1, 1, 1, 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( 1, 1, 1, 1, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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( 1, 1, 1, 1, 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( 0, 0, 0, 0, 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( 1, 1, 1, 1, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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  *** 
     
    531459      !!      define all the NETCDF files and fields 
    532460      !!      At each time step call histdef to compute the mean if ncessary 
    533       !!      Each nwrite time step, output the instantaneous or mean fields 
     461      !!      Each nn_write time step, output the instantaneous or mean fields 
    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      !!---------------------------------------------------------------------- 
     480      ! 
     481      IF( ninist == 1 ) THEN     !==  Output the initial state and forcings  ==! 
     482         CALL dia_wri_state( Kmm, 'output.init' ) 
     483         ninist = 0 
     484      ENDIF 
     485      ! 
     486      IF( nn_write == -1 )   RETURN   ! we will never do any output 
    549487      !  
    550488      IF( ln_timing )   CALL timing_start('dia_wri') 
    551       ! 
    552       IF( ninist == 1 ) THEN     !==  Output the initial state and forcings  ==! 
    553          CALL dia_wri_state( 'output.init' ) 
    554          ninist = 0 
    555       ENDIF 
    556489      ! 
    557490      ! 0. Initialisation 
     
    564497      clop = "x"         ! no use of the mask value (require less cpu time and otherwise the model crashes) 
    565498#if defined key_diainstant 
    566       zsto = nwrite * rdt 
     499      zsto = nn_write * rn_Dt 
    567500      clop = "inst("//TRIM(clop)//")" 
    568501#else 
    569       zsto=rdt 
     502      zsto=rn_Dt 
    570503      clop = "ave("//TRIM(clop)//")" 
    571504#endif 
    572       zout = nwrite * rdt 
    573       zmax = ( nitend - nit000 + 1 ) * rdt 
     505      zout = nn_write * rn_Dt 
     506      zmax = ( nitend - nit000 + 1 ) * rn_Dt 
    574507 
    575508      ! Define indices of the horizontal output zoom and vertical limit storage 
     
    577510      ijmi = 1      ;      ijma = jpj 
    578511      ipk = jpk 
     512      IF(ln_abl) ipka = jpkam1 
    579513 
    580514      ! define time axis 
     
    591525 
    592526         ! Compute julian date from starting date of the run 
    593          CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian ) 
     527         CALL ymds2ju( nyear, nmonth, nday, rn_Dt, zjulian ) 
    594528         zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    595529         IF(lwp)WRITE(numout,*) 
     
    601535         ! WRITE root name in date.file for use by postpro 
    602536         IF(lwp) THEN 
    603             CALL dia_nam( clhstnam, nwrite,' ' ) 
     537            CALL dia_nam( clhstnam, nn_write,' ' ) 
    604538            CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    605539            WRITE(inum,*) clhstnam 
     
    609543         ! Define the T grid FILE ( nid_T ) 
    610544 
    611          CALL dia_nam( clhstnam, nwrite, 'grid_T' ) 
     545         CALL dia_nam( clhstnam, nn_write, 'grid_T' ) 
    612546         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
    613547         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
    614548            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    615             &          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 ) 
    616550         CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept 
    617551            &           "m", ipk, gdept_1d, nz_T, "down" ) 
     
    645579         ! Define the U grid FILE ( nid_U ) 
    646580 
    647          CALL dia_nam( clhstnam, nwrite, 'grid_U' ) 
     581         CALL dia_nam( clhstnam, nn_write, 'grid_U' ) 
    648582         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
    649583         CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu 
    650584            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    651             &          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 ) 
    652586         CALL histvert( nid_U, "depthu", "Vertical U levels",      &  ! Vertical grid: gdept 
    653587            &           "m", ipk, gdept_1d, nz_U, "down" ) 
     
    658592         ! Define the V grid FILE ( nid_V ) 
    659593 
    660          CALL dia_nam( clhstnam, nwrite, 'grid_V' )                   ! filename 
     594         CALL dia_nam( clhstnam, nn_write, 'grid_V' )                   ! filename 
    661595         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam 
    662596         CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv 
    663597            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    664             &          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 ) 
    665599         CALL histvert( nid_V, "depthv", "Vertical V levels",      &  ! Vertical grid : gdept 
    666600            &          "m", ipk, gdept_1d, nz_V, "down" ) 
     
    671605         ! Define the W grid FILE ( nid_W ) 
    672606 
    673          CALL dia_nam( clhstnam, nwrite, 'grid_W' )                   ! filename 
     607         CALL dia_nam( clhstnam, nn_write, 'grid_W' )                   ! filename 
    674608         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam 
    675609         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
    676610            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    677             &          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 ) 
    678612         CALL histvert( nid_W, "depthw", "Vertical W levels",      &  ! Vertical grid: gdepw 
    679613            &          "m", ipk, gdepw_1d, nz_W, "down" ) 
    680614 
     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 
    681631 
    682632         ! Declare all the output fields as NETCDF variables 
     
    688638            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
    689639         IF(  .NOT.ln_linssh  ) THEN 
    690             CALL histdef( nid_T, "vovvle3t", "Level thickness"                    , "m"      ,&  ! e3t_n 
     640            CALL histdef( nid_T, "vovvle3t", "Level thickness"                    , "m"      ,&  ! e3t(:,:,:,Kmm) 
    691641            &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
    692             CALL histdef( nid_T, "vovvldep", "T point depth"                      , "m"      ,&  ! e3t_n 
     642            CALL histdef( nid_T, "vovvldep", "T point depth"                      , "m"      ,&  ! e3t(:,:,:,Kmm) 
    693643            &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
    694             CALL histdef( nid_T, "vovvldef", "Squared level deformation"          , "%^2"    ,&  ! e3t_n 
     644            CALL histdef( nid_T, "vovvldef", "Squared level deformation"          , "%^2"    ,&  ! e3t(:,:,:,Kmm) 
    695645            &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
    696646         ENDIF 
     
    709659            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    710660         IF(  ln_linssh  ) THEN 
    711             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) 
    712662            &                                                                  , "KgC/m2/s",  &  ! sosst_cd 
    713663            &             jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    714             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) 
    715665            &                                                                  , "KgPSU/m2/s",&  ! sosss_cd 
    716666            &             jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     
    728678         CALL histdef( nid_T, "sowindsp", "wind speed at 10m"                  , "m/s"    ,   &  ! wndm 
    729679            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    730 ! 
     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         ! 
    731705         IF( ln_icebergs ) THEN 
    732706            CALL histdef( nid_T, "calving"             , "calving mass input"                       , "kg/s"   , & 
     
    762736         ENDIF 
    763737 
    764          IF( .NOT. ln_cpl ) THEN 
     738         IF( ln_ssr ) THEN 
    765739            CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping"         , "W/m2"   ,   &  ! qrp 
    766740               &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     
    770744               &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    771745         ENDIF 
    772  
    773          IF( ln_cpl .AND. nn_ice <= 1 ) THEN 
    774             CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping"         , "W/m2"   ,   &  ! qrp 
    775                &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    776             CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping"        , "Kg/m2/s",   &  ! erp 
    777                &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    778             CALL histdef( nid_T, "sosafldp", "Surface salt flux: Damping"         , "Kg/m2/s",   &  ! erp * sn 
    779                &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    780          ENDIF 
    781           
     746        
    782747         clmx ="l_max(only(x))"    ! max index on a period 
    783748!         CALL histdef( nid_T, "sobowlin", "Bowl Index"                         , "W-point",   &  ! bowl INDEX  
     
    797762 
    798763         !                                                                                      !!! nid_U : 3D 
    799          CALL histdef( nid_U, "vozocrtx", "Zonal Current"                      , "m/s"    ,   &  ! un 
     764         CALL histdef( nid_U, "vozocrtx", "Zonal Current"                      , "m/s"    ,   &  ! uu(:,:,:,Kmm) 
    800765            &          jpi, jpj, nh_U, ipk, 1, ipk, nz_U, 32, clop, zsto, zout ) 
    801766         IF( ln_wave .AND. ln_sdw) THEN 
     
    810775 
    811776         !                                                                                      !!! nid_V : 3D 
    812          CALL histdef( nid_V, "vomecrty", "Meridional Current"                 , "m/s"    ,   &  ! vn 
     777         CALL histdef( nid_V, "vomecrty", "Meridional Current"                 , "m/s"    ,   &  ! vv(:,:,:,Kmm) 
    813778            &          jpi, jpj, nh_V, ipk, 1, ipk, nz_V, 32, clop, zsto, zout ) 
    814779         IF( ln_wave .AND. ln_sdw) THEN 
     
    823788 
    824789         !                                                                                      !!! nid_W : 3D 
    825          CALL histdef( nid_W, "vovecrtz", "Vertical Velocity"                  , "m/s"    ,   &  ! wn 
     790         CALL histdef( nid_W, "vovecrtz", "Vertical Velocity"                  , "m/s"    ,   &  ! ww 
    826791            &          jpi, jpj, nh_W, ipk, 1, ipk, nz_W, 32, clop, zsto, zout ) 
    827792         CALL histdef( nid_W, "votkeavt", "Vertical Eddy Diffusivity"          , "m2/s"   ,   &  ! avt 
     
    855820      ! donne le nombre d'elements, et ndex la liste des indices a sortir 
    856821 
    857       IF( lwp .AND. MOD( itmod, nwrite ) == 0 ) THEN  
     822      IF( lwp .AND. MOD( itmod, nn_write ) == 0 ) THEN  
    858823         WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step' 
    859824         WRITE(numout,*) '~~~~~~ ' 
     
    861826 
    862827      IF( .NOT.ln_linssh ) THEN 
    863          CALL histwrite( nid_T, "votemper", it, tsn(:,:,:,jp_tem) * e3t_n(:,:,:) , ndim_T , ndex_T  )   ! heat content 
    864          CALL histwrite( nid_T, "vosaline", it, tsn(:,:,:,jp_sal) * e3t_n(:,:,:) , ndim_T , ndex_T  )   ! salt content 
    865          CALL histwrite( nid_T, "sosstsst", it, tsn(:,:,1,jp_tem) * e3t_n(:,:,1) , ndim_hT, ndex_hT )   ! sea surface heat content 
    866          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 
    867832      ELSE 
    868          CALL histwrite( nid_T, "votemper", it, tsn(:,:,:,jp_tem) , ndim_T , ndex_T  )   ! temperature 
    869          CALL histwrite( nid_T, "vosaline", it, tsn(:,:,:,jp_sal) , ndim_T , ndex_T  )   ! salinity 
    870          CALL histwrite( nid_T, "sosstsst", it, tsn(:,:,1,jp_tem) , ndim_hT, ndex_hT )   ! sea surface temperature 
    871          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 
    872837      ENDIF 
    873838      IF( .NOT.ln_linssh ) THEN 
    874          zw3d(:,:,:) = ( ( e3t_n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 
    875          CALL histwrite( nid_T, "vovvle3t", it, e3t_n (:,:,:) , ndim_T , ndex_T  )   ! level thickness 
    876          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 
    877842         CALL histwrite( nid_T, "vovvldef", it, zw3d             , ndim_T , ndex_T  )   ! level thickness deformation 
    878843      ENDIF 
    879       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 
    880845      CALL histwrite( nid_T, "sowaflup", it, ( emp-rnf )   , ndim_hT, ndex_hT )   ! upward water flux 
    881846      CALL histwrite( nid_T, "sorunoff", it, rnf           , ndim_hT, ndex_hT )   ! river runoffs 
     
    884849                                                                                  ! in linear free surface case) 
    885850      IF( ln_linssh ) THEN 
    886          zw2d(:,:) = emp (:,:) * tsn(:,:,1,jp_tem) 
     851         zw2d(:,:) = emp (:,:) * ts(:,:,1,jp_tem,Kmm) 
    887852         CALL histwrite( nid_T, "sosst_cd", it, zw2d, ndim_hT, ndex_hT )          ! c/d term on sst 
    888          zw2d(:,:) = emp (:,:) * tsn(:,:,1,jp_sal) 
     853         zw2d(:,:) = emp (:,:) * ts(:,:,1,jp_sal,Kmm) 
    889854         CALL histwrite( nid_T, "sosss_cd", it, zw2d, ndim_hT, ndex_hT )          ! c/d term on sss 
    890855      ENDIF 
     
    895860      CALL histwrite( nid_T, "soicecov", it, fr_i          , ndim_hT, ndex_hT )   ! ice fraction    
    896861      CALL histwrite( nid_T, "sowindsp", it, wndm          , ndim_hT, ndex_hT )   ! wind speed    
    897 ! 
     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      ! 
    898886      IF( ln_icebergs ) THEN 
    899887         ! 
     
    919907      ENDIF 
    920908 
    921       IF( .NOT. ln_cpl ) THEN 
     909      IF( ln_ssr ) THEN 
    922910         CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping 
    923911         CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping 
    924          IF( ln_ssr ) zw2d(:,:) = erp(:,:) * tsn(:,:,1,jp_sal) * tmask(:,:,1) 
    925          CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping 
    926       ENDIF 
    927       IF( ln_cpl .AND. nn_ice <= 1 ) THEN 
    928          CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping 
    929          CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping 
    930          IF( ln_ssr ) zw2d(:,:) = erp(:,:) * tsn(:,:,1,jp_sal) * tmask(:,:,1) 
     912         zw2d(:,:) = erp(:,:) * ts(:,:,1,jp_sal,Kmm) * tmask(:,:,1) 
    931913         CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping 
    932914      ENDIF 
     
    941923#endif 
    942924 
    943       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 
    944926      CALL histwrite( nid_U, "sozotaux", it, utau          , ndim_hU, ndex_hU )   ! i-wind stress 
    945927 
    946       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 
    947929      CALL histwrite( nid_V, "sometauy", it, vtau          , ndim_hV, ndex_hV )   ! j-wind stress 
    948930 
    949       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 
    950936      CALL histwrite( nid_W, "votkeavt", it, avt            , ndim_T, ndex_T )    ! T vert. eddy diff. coef. 
    951937      CALL histwrite( nid_W, "votkeavm", it, avm            , ndim_T, ndex_T )    ! T vert. eddy visc. coef. 
     
    967953         CALL histclo( nid_V ) 
    968954         CALL histclo( nid_W ) 
     955         IF(ln_abl) CALL histclo( nid_A ) 
    969956      ENDIF 
    970957      ! 
     
    974961#endif 
    975962 
    976    SUBROUTINE dia_wri_state( cdfile_name ) 
     963   SUBROUTINE dia_wri_state( Kmm, cdfile_name ) 
    977964      !!--------------------------------------------------------------------- 
    978965      !!                 ***  ROUTINE dia_wri_state  *** 
     
    987974      !!      File 'output.abort.nc' is created in case of abnormal job end 
    988975      !!---------------------------------------------------------------------- 
     976      INTEGER           , INTENT( in ) ::   Kmm              ! time level index 
    989977      CHARACTER (len=* ), INTENT( in ) ::   cdfile_name      ! name of the file created 
    990978      !! 
    991       INTEGER :: inum 
     979      INTEGER :: inum, jk 
    992980      !!---------------------------------------------------------------------- 
    993981      !  
     
    996984      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~   and forcing fields file created ' 
    997985      IF(lwp) WRITE(numout,*) '                and named :', cdfile_name, '...nc' 
    998  
    999 #if defined key_si3 
    1000      CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., kdlev = jpl ) 
    1001 #else 
    1002      CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE. ) 
    1003 #endif 
    1004  
    1005       CALL iom_rstput( 0, 0, inum, 'votemper', tsn(:,:,:,jp_tem) )    ! now temperature 
    1006       CALL iom_rstput( 0, 0, inum, 'vosaline', tsn(:,:,:,jp_sal) )    ! now salinity 
    1007       CALL iom_rstput( 0, 0, inum, 'sossheig', sshn              )    ! sea surface height 
    1008       CALL iom_rstput( 0, 0, inum, 'vozocrtx', un                )    ! now i-velocity 
    1009       CALL iom_rstput( 0, 0, inum, 'vomecrty', vn                )    ! now j-velocity 
    1010       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      ! 
    10111022      IF( ALLOCATED(ahtu) ) THEN 
    10121023         CALL iom_rstput( 0, 0, inum,  'ahtu', ahtu              )    ! aht at u-point 
     
    10241035      CALL iom_rstput( 0, 0, inum, 'sometauy', vtau              )    ! j-wind stress 
    10251036      IF(  .NOT.ln_linssh  ) THEN              
    1026          CALL iom_rstput( 0, 0, inum, 'vovvldep', gdept_n        )    !  T-cell depth  
    1027          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   
    10281039      END IF 
    10291040      IF( ln_wave .AND. ln_sdw ) THEN 
     
    10321043         CALL iom_rstput( 0, 0, inum, 'sdvecrtz', wsd            )    ! now StokesDrift k-velocity 
    10331044      ENDIF 
    1034   
     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      !  
    10351054#if defined key_si3 
    10361055      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' ) 
    10371057         CALL ice_wri_state( inum ) 
     1058         CALL iom_close( inum ) 
    10381059      ENDIF 
    10391060#endif 
    1040       ! 
    1041       CALL iom_close( inum ) 
    1042       !  
     1061 
    10431062   END SUBROUTINE dia_wri_state 
    10441063 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/CANAL/MY_SRC/domvvl.F90

    r10425 r13463  
    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 
     11   !!            4.x  ! 2020-02  (G. Madec, S. Techene) introduce ssh to h0 ratio 
    1012   !!---------------------------------------------------------------------- 
    1113 
    12    !!---------------------------------------------------------------------- 
    13    !!   dom_vvl_init     : define initial vertical scale factors, depths and column thickness 
    14    !!   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_interpol : Interpolate vertical scale factors from one grid point to another 
    17    !!   dom_vvl_rst      : read/write restart file 
    18    !!   dom_vvl_ctl      : Check the vvl options 
    19    !!---------------------------------------------------------------------- 
    2014   USE oce             ! ocean dynamics and tracers 
    2115   USE phycst          ! physical constant 
     
    3529   PRIVATE 
    3630 
    37    PUBLIC  dom_vvl_init       ! called by domain.F90 
    38    PUBLIC  dom_vvl_sf_nxt     ! called by step.F90 
    39    PUBLIC  dom_vvl_sf_swp     ! called by step.F90 
    40    PUBLIC  dom_vvl_interpol   ! called by dynnxt.F90 
    41  
    4231   !                                                      !!* Namelist nam_vvl 
    4332   LOGICAL , PUBLIC :: ln_vvl_zstar           = .FALSE.    ! zstar  vertical coordinate 
     
    6150   REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:)   :: frq_rst_hdv                 ! retoring period for low freq. divergence 
    6251 
     52#if defined key_qco 
     53   !!---------------------------------------------------------------------- 
     54   !!   'key_qco'      EMPTY MODULE      Quasi-Eulerian vertical coordonate 
     55   !!---------------------------------------------------------------------- 
     56#else 
     57   !!---------------------------------------------------------------------- 
     58   !!   Default key      Old management of time varying vertical coordinate 
     59   !!---------------------------------------------------------------------- 
     60    
     61   !!---------------------------------------------------------------------- 
     62   !!   dom_vvl_init     : define initial vertical scale factors, depths and column thickness 
     63   !!   dom_vvl_sf_nxt   : Compute next vertical scale factors 
     64   !!   dom_vvl_sf_update   : Swap vertical scale factors and update the vertical grid 
     65   !!   dom_vvl_interpol : Interpolate vertical scale factors from one grid point to another 
     66   !!   dom_vvl_rst      : read/write restart file 
     67   !!   dom_vvl_ctl      : Check the vvl options 
     68   !!---------------------------------------------------------------------- 
     69 
     70   PUBLIC  dom_vvl_init       ! called by domain.F90 
     71   PUBLIC  dom_vvl_zgr        ! called by isfcpl.F90 
     72   PUBLIC  dom_vvl_sf_nxt     ! called by step.F90 
     73   PUBLIC  dom_vvl_sf_update  ! called by step.F90 
     74   PUBLIC  dom_vvl_interpol   ! called by dynnxt.F90 
     75    
    6376   !! * Substitutions 
    64 #  include "vectopt_loop_substitute.h90" 
     77#  include "do_loop_substitute.h90" 
    6578   !!---------------------------------------------------------------------- 
    6679   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    93106 
    94107 
    95    SUBROUTINE dom_vvl_init 
     108   SUBROUTINE dom_vvl_init( Kbb, Kmm, Kaa ) 
    96109      !!---------------------------------------------------------------------- 
    97110      !!                ***  ROUTINE dom_vvl_init  *** 
     
    102115      !! ** Method  :  - use restart file and/or initialize 
    103116      !!               - interpolate scale factors 
     117      !! 
     118      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     119      !!              - Regrid: e3[u/v](:,:,:,Kmm) 
     120      !!                        e3[u/v](:,:,:,Kmm)        
     121      !!                        e3w(:,:,:,Kmm)            
     122      !!                        e3[u/v]w_b 
     123      !!                        e3[u/v]w_n       
     124      !!                        gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm) and gde3w 
     125      !!              - h(t/u/v)_0 
     126      !!              - frq_rst_e3t and frq_rst_hdv 
     127      !! 
     128      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
     129      !!---------------------------------------------------------------------- 
     130      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     131      ! 
     132      IF(lwp) WRITE(numout,*) 
     133      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
     134      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
     135      ! 
     136      CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
     137      ! 
     138      !                    ! Allocate module arrays 
     139      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
     140      ! 
     141      !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
     142      CALL dom_vvl_rst( nit000, Kbb, Kmm, 'READ' ) 
     143      e3t(:,:,jpk,Kaa) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
     144      ! 
     145      CALL dom_vvl_zgr(Kbb, Kmm, Kaa) ! interpolation scale factor, depth and water column 
     146      ! 
     147   END SUBROUTINE dom_vvl_init 
     148 
     149 
     150   SUBROUTINE dom_vvl_zgr(Kbb, Kmm, Kaa) 
     151      !!---------------------------------------------------------------------- 
     152      !!                ***  ROUTINE dom_vvl_init  *** 
     153      !!                    
     154      !! ** Purpose :  Interpolation of all scale factors,  
     155      !!               depths and water column heights 
     156      !! 
     157      !! ** Method  :  - interpolate scale factors 
    104158      !! 
    105159      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     
    115169      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
    116170      !!---------------------------------------------------------------------- 
     171      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     172      !!---------------------------------------------------------------------- 
    117173      INTEGER ::   ji, jj, jk 
    118174      INTEGER ::   ii0, ii1, ij0, ij1 
     
    120176      !!---------------------------------------------------------------------- 
    121177      ! 
    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       ! 
    135178      !                    !== Set of all other vertical scale factors  ==!  (now and before) 
    136179      !                                ! 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 
     180      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3u(:,:,:,Kbb), 'U' )    ! from T to U 
     181      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3u(:,:,:,Kmm), 'U' ) 
     182      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3v(:,:,:,Kbb), 'V' )    ! from T to V  
     183      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3v(:,:,:,Kmm), 'V' ) 
     184      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F' )    ! from U to F 
    142185      !                                ! 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' ) 
     186      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3w (:,:,:,Kmm), 'W'  )  ! from T to W 
     187      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3w (:,:,:,Kbb), 'W'  ) 
     188      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3uw(:,:,:,Kmm), 'UW' )  ! from U to UW 
     189      CALL dom_vvl_interpol( e3u(:,:,:,Kbb), e3uw(:,:,:,Kbb), 'UW' ) 
     190      CALL dom_vvl_interpol( e3v(:,:,:,Kmm), e3vw(:,:,:,Kmm), 'VW' )  ! from V to UW 
     191      CALL dom_vvl_interpol( e3v(:,:,:,Kbb), e3vw(:,:,:,Kbb), 'VW' ) 
    149192 
    150193      ! 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(:,:,:) 
     194      e3t(:,:,:,Kaa) = e3t(:,:,:,Kmm) 
     195      e3u(:,:,:,Kaa) = e3u(:,:,:,Kmm) 
     196      e3v(:,:,:,Kaa) = e3v(:,:,:,Kmm) 
    154197      ! 
    155198      !                    !==  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 
     199      gdept(:,:,1,Kmm) = 0.5_wp * e3w(:,:,1,Kmm)       ! reference to the ocean surface (used for MLD and light penetration) 
     200      gdepw(:,:,1,Kmm) = 0.0_wp 
     201      gde3w(:,:,1) = gdept(:,:,1,Kmm) - ssh(:,:,Kmm)  ! reference to a common level z=0 for hpg 
     202      gdept(:,:,1,Kbb) = 0.5_wp * e3w(:,:,1,Kbb) 
     203      gdepw(:,:,1,Kbb) = 0.0_wp 
     204      DO_3D( 1, 1, 1, 1, 2, jpk ) 
     205         !    zcoef = tmask - wmask    ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     206         !                             ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 
     207         !                             ! 0.5 where jk = mikt      
     208!!gm ???????   BUG ?  gdept(:,:,:,Kmm) as well as gde3w  does not include the thickness of ISF ?? 
     209         zcoef = ( tmask(ji,jj,jk) - wmask(ji,jj,jk) ) 
     210         gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 
     211         gdept(ji,jj,jk,Kmm) =      zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm))  & 
     212            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm))  
     213         gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 
     214         gdepw(ji,jj,jk,Kbb) = gdepw(ji,jj,jk-1,Kbb) + e3t(ji,jj,jk-1,Kbb) 
     215         gdept(ji,jj,jk,Kbb) =      zcoef  * ( gdepw(ji,jj,jk  ,Kbb) + 0.5 * e3w(ji,jj,jk,Kbb))  & 
     216            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kbb) +       e3w(ji,jj,jk,Kbb))  
     217      END_3D 
     218      ! 
     219      !                    !==  thickness of the water column  !!   (ocean portion only) 
     220      ht(:,:) = e3t(:,:,1,Kmm) * tmask(:,:,1)   !!gm  BUG  :  this should be 1/2 * e3w(k=1) .... 
     221      hu(:,:,Kbb) = e3u(:,:,1,Kbb) * umask(:,:,1) 
     222      hu(:,:,Kmm) = e3u(:,:,1,Kmm) * umask(:,:,1) 
     223      hv(:,:,Kbb) = e3v(:,:,1,Kbb) * vmask(:,:,1) 
     224      hv(:,:,Kmm) = e3v(:,:,1,Kmm) * vmask(:,:,1) 
     225      DO jk = 2, jpkm1 
     226         ht(:,:) = ht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
     227         hu(:,:,Kbb) = hu(:,:,Kbb) + e3u(:,:,jk,Kbb) * umask(:,:,jk) 
     228         hu(:,:,Kmm) = hu(:,:,Kmm) + e3u(:,:,jk,Kmm) * umask(:,:,jk) 
     229         hv(:,:,Kbb) = hv(:,:,Kbb) + e3v(:,:,jk,Kbb) * vmask(:,:,jk) 
     230         hv(:,:,Kmm) = hv(:,:,Kmm) + e3v(:,:,jk,Kmm) * vmask(:,:,jk) 
    178231      END DO 
    179232      ! 
    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       ! 
    194233      !                    !==  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(:,:) ) 
     234      r1_hu(:,:,Kbb) = ssumask(:,:) / ( hu(:,:,Kbb) + 1._wp - ssumask(:,:) )    ! _i mask due to ISF 
     235      r1_hu(:,:,Kmm) = ssumask(:,:) / ( hu(:,:,Kmm) + 1._wp - ssumask(:,:) ) 
     236      r1_hv(:,:,Kbb) = ssvmask(:,:) / ( hv(:,:,Kbb) + 1._wp - ssvmask(:,:) ) 
     237      r1_hv(:,:,Kmm) = ssvmask(:,:) / ( hv(:,:,Kmm) + 1._wp - ssvmask(:,:) ) 
    199238 
    200239      !                    !==   z_tilde coordinate case  ==!   (Restoring frequencies) 
     
    208247         IF( ln_vvl_ztilde_as_zstar ) THEN   ! z-star emulation using z-tile 
    209248            frq_rst_e3t(:,:) = 0._wp               !Ignore namelist settings 
    210             frq_rst_hdv(:,:) = 1._wp / rdt 
     249            frq_rst_hdv(:,:) = 1._wp / rn_Dt 
    211250         ENDIF 
    212251         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 
     252            DO_2D( 1, 1, 1, 1 ) 
    215253!!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 
     254               IF( ABS(gphit(ji,jj)) >= 6.) THEN 
     255                  ! values outside the equatorial band and transition zone (ztilde) 
     256                  frq_rst_e3t(ji,jj) =  2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.e0_wp ) 
     257                  frq_rst_hdv(ji,jj) =  2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.e0_wp ) 
     258               ELSEIF( ABS(gphit(ji,jj)) <= 2.5) THEN    ! Equator strip ==> z-star 
     259                  ! values inside the equatorial band (ztilde as zstar) 
     260                  frq_rst_e3t(ji,jj) =  0.0_wp 
     261                  frq_rst_hdv(ji,jj) =  1.0_wp / rn_Dt 
     262               ELSE                                      ! transition band (2.5 to 6 degrees N/S) 
     263                  !                                      ! (linearly transition from z-tilde to z-star) 
     264                  frq_rst_e3t(ji,jj) = 0.0_wp + (frq_rst_e3t(ji,jj)-0.0_wp)*0.5_wp   & 
     265                     &            * (  1.0_wp - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     266                     &                                          * 180._wp / 3.5_wp ) ) 
     267                  frq_rst_hdv(ji,jj) = (1.0_wp / rn_Dt)                                & 
     268                     &            + (  frq_rst_hdv(ji,jj)-(1.e0_wp / rn_Dt) )*0.5_wp   & 
     269                     &            * (  1._wp  - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     270                     &                                          * 180._wp / 3.5_wp ) ) 
     271               ENDIF 
     272            END_2D 
    236273            IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN 
    237274               IF( nn_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2 
    238                   ii0 = 103   ;   ii1 = 111        
    239                   ij0 = 128   ;   ij1 = 135   ;    
     275                  ii0 = 103 + nn_hls - 1   ;   ii1 = 111 + nn_hls - 1       
     276                  ij0 = 128 + nn_hls       ;   ij1 = 135 + nn_hls 
    240277                  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 
     278                  frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rn_Dt 
    242279               ENDIF 
    243280            ENDIF 
     
    263300      ENDIF 
    264301      ! 
    265    END SUBROUTINE dom_vvl_init 
    266  
    267  
    268    SUBROUTINE dom_vvl_sf_nxt( kt, kcall )  
     302   END SUBROUTINE dom_vvl_zgr 
     303 
     304 
     305   SUBROUTINE dom_vvl_sf_nxt( kt, Kbb, Kmm, Kaa, kcall )  
    269306      !!---------------------------------------------------------------------- 
    270307      !!                ***  ROUTINE dom_vvl_sf_nxt  *** 
     
    288325      !! Reference  : Leclair, M., and Madec, G. 2011, Ocean Modelling. 
    289326      !!---------------------------------------------------------------------- 
    290       INTEGER, INTENT( in )           ::   kt      ! time step 
    291       INTEGER, INTENT( in ), OPTIONAL ::   kcall   ! optional argument indicating call sequence 
     327      INTEGER, INTENT( in )           ::   kt             ! time step 
     328      INTEGER, INTENT( in )           ::   Kbb, Kmm, Kaa  ! time step 
     329      INTEGER, INTENT( in ), OPTIONAL ::   kcall          ! optional argument indicating call sequence 
    292330      ! 
    293331      INTEGER                ::   ji, jj, jk            ! dummy loop indices 
    294332      INTEGER , DIMENSION(3) ::   ijk_max, ijk_min      ! temporary integers 
    295       REAL(wp)               ::   z2dt, z_tmin, z_tmax  ! local scalars 
     333      REAL(wp)               ::   z_tmin, z_tmax        ! local scalars 
    296334      LOGICAL                ::   ll_do_bclinic         ! local logical 
    297335      REAL(wp), DIMENSION(jpi,jpj)     ::   zht, z_scale, zwu, zwv, zhdiv 
    298       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ze3t 
     336      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ze3t 
     337      LOGICAL , DIMENSION(:,:,:), ALLOCATABLE ::   llmsk 
    299338      !!---------------------------------------------------------------------- 
    300339      ! 
     
    321360      !                                                ! --------------------------------------------- ! 
    322361      ! 
    323       z_scale(:,:) = ( ssha(:,:) - sshb(:,:) ) * ssmask(:,:) / ( ht_0(:,:) + sshn(:,:) + 1. - ssmask(:,:) ) 
     362      z_scale(:,:) = ( ssh(:,:,Kaa) - ssh(:,:,Kbb) ) * ssmask(:,:) / ( ht_0(:,:) + ssh(:,:,Kmm) + 1. - ssmask(:,:) ) 
    324363      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) 
     364         ! formally this is the same as e3t(:,:,:,Kaa) = e3t_0*(1+ssha/ht_0) 
     365         e3t(:,:,jk,Kaa) = e3t(:,:,jk,Kbb) + e3t(:,:,jk,Kmm) * z_scale(:,:) * tmask(:,:,jk) 
    327366      END DO 
    328367      ! 
    329       IF( ln_vvl_ztilde .OR. ln_vvl_layer .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
    330          !                                                            ! ------baroclinic part------ ! 
     368      IF( (ln_vvl_ztilde .OR. ln_vvl_layer) .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
     369         !                                                               ! ------baroclinic part------ ! 
    331370         ! I - initialization 
    332371         ! ================== 
     
    337376         zht(:,:)   = 0._wp 
    338377         DO jk = 1, jpkm1 
    339             zhdiv(:,:) = zhdiv(:,:) + e3t_n(:,:,jk) * hdivn(:,:,jk) 
    340             zht  (:,:) = zht  (:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     378            zhdiv(:,:) = zhdiv(:,:) + e3t(:,:,jk,Kmm) * hdiv(:,:,jk) 
     379            zht  (:,:) = zht  (:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    341380         END DO 
    342381         zhdiv(:,:) = zhdiv(:,:) / ( zht(:,:) + 1. - tmask_i(:,:) ) 
     
    347386            IF( kt > nit000 ) THEN 
    348387               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(:,:) ) ) 
     388                  hdiv_lf(:,:,jk) = hdiv_lf(:,:,jk) - rn_Dt * frq_rst_hdv(:,:)   & 
     389                     &          * ( hdiv_lf(:,:,jk) - e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) ) 
    351390               END DO 
    352391            ENDIF 
     
    361400         IF( ln_vvl_ztilde ) THEN     ! z_tilde case 
    362401            DO jk = 1, jpkm1 
    363                tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) - ( e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) - hdiv_lf(:,:,jk) ) 
     402               tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) - ( e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) - hdiv_lf(:,:,jk) ) 
    364403            END DO 
    365404         ELSE                         ! layer case 
    366405            DO jk = 1, jpkm1 
    367                tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) -   e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) * tmask(:,:,jk) 
     406               tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) -   e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) * tmask(:,:,jk) 
    368407            END DO 
    369408         ENDIF 
     
    381420         zwu(:,:) = 0._wp 
    382421         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 
     422         DO_3D( 1, 0, 1, 0, 1, jpkm1 ) 
     423            un_td(ji,jj,jk) = rn_ahe3 * umask(ji,jj,jk) * e2_e1u(ji,jj)           & 
     424               &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji+1,jj  ,jk) ) 
     425            vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj)           &  
     426               &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji  ,jj+1,jk) ) 
     427            zwu(ji,jj) = zwu(ji,jj) + un_td(ji,jj,jk) 
     428            zwv(ji,jj) = zwv(ji,jj) + vn_td(ji,jj,jk) 
     429         END_3D 
     430         DO_2D( 1, 1, 1, 1 ) 
     431            un_td(ji,jj,mbku(ji,jj)) = un_td(ji,jj,mbku(ji,jj)) - zwu(ji,jj) 
     432            vn_td(ji,jj,mbkv(ji,jj)) = vn_td(ji,jj,mbkv(ji,jj)) - zwv(ji,jj) 
     433         END_2D 
     434         DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     435            tilde_e3t_a(ji,jj,jk) = tilde_e3t_a(ji,jj,jk) + (   un_td(ji-1,jj  ,jk) - un_td(ji,jj,jk)    & 
     436               &                                          +     vn_td(ji  ,jj-1,jk) - vn_td(ji,jj,jk)    & 
     437               &                                            ) * r1_e1e2t(ji,jj) 
     438         END_3D 
    410439         !                       ! d - thickness diffusion transport: boundary conditions 
    411440         !                             (stored for tracer advction and continuity equation) 
     
    414443         ! 4 - Time stepping of baroclinic scale factors 
    415444         ! --------------------------------------------- 
    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 
    423445         CALL lbc_lnk( 'domvvl', tilde_e3t_a(:,:,:), 'T', 1._wp ) 
    424          tilde_e3t_a(:,:,:) = tilde_e3t_b(:,:,:) + z2dt * tmask(:,:,:) * tilde_e3t_a(:,:,:) 
     446         tilde_e3t_a(:,:,:) = tilde_e3t_b(:,:,:) + rDt * tmask(:,:,:) * tilde_e3t_a(:,:,:) 
    425447 
    426448         ! Maximum deformation control 
    427449         ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    428          ze3t(:,:,jpk) = 0._wp 
    429          DO jk = 1, jpkm1 
    430             ze3t(:,:,jk) = tilde_e3t_a(:,:,jk) / e3t_0(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:) 
    431          END DO 
    432          z_tmax = MAXVAL( ze3t(:,:,:) ) 
    433          CALL mpp_max( 'domvvl', z_tmax )                 ! max over the global domain 
    434          z_tmin = MINVAL( ze3t(:,:,:) ) 
    435          CALL mpp_min( 'domvvl', z_tmin )                 ! min over the global domain 
     450         ALLOCATE( ze3t(jpi,jpj,jpk), llmsk(jpi,jpj,jpk) ) 
     451         DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     452            ze3t(ji,jj,jk) = tilde_e3t_a(ji,jj,jk) / e3t_0(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) 
     453         END_3D 
     454         ! 
     455         llmsk(   1:Nis1,:,:) = .FALSE.   ! exclude halos from the checked region 
     456         llmsk(Nie1: jpi,:,:) = .FALSE. 
     457         llmsk(:,   1:Njs1,:) = .FALSE. 
     458         llmsk(:,Nje1: jpj,:) = .FALSE. 
     459         ! 
     460         llmsk(Nis0:Nie0,Njs0:Nje0,:) = tmask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp                  ! define only the inner domain 
     461         z_tmax = MAXVAL( ze3t(:,:,:), mask = llmsk )   ;   CALL mpp_max( 'domvvl', z_tmax )   ! max over the global domain 
     462         z_tmin = MINVAL( ze3t(:,:,:), mask = llmsk )   ;   CALL mpp_min( 'domvvl', z_tmin )   ! min over the global domain 
    436463         ! - ML - test: for the moment, stop simulation for too large e3_t variations 
    437464         IF( ( z_tmax >  rn_zdef_max ) .OR. ( z_tmin < - rn_zdef_max ) ) THEN 
    438             IF( lk_mpp ) THEN 
    439                CALL mpp_maxloc( 'domvvl', ze3t, tmask, z_tmax, ijk_max ) 
    440                CALL mpp_minloc( 'domvvl', ze3t, tmask, z_tmin, ijk_min ) 
    441             ELSE 
    442                ijk_max = MAXLOC( ze3t(:,:,:) ) 
    443                ijk_max(1) = ijk_max(1) + nimpp - 1 
    444                ijk_max(2) = ijk_max(2) + njmpp - 1 
    445                ijk_min = MINLOC( ze3t(:,:,:) ) 
    446                ijk_min(1) = ijk_min(1) + nimpp - 1 
    447                ijk_min(2) = ijk_min(2) + njmpp - 1 
    448             ENDIF 
     465            CALL mpp_maxloc( 'domvvl', ze3t, llmsk, z_tmax, ijk_max ) 
     466            CALL mpp_minloc( 'domvvl', ze3t, llmsk, z_tmin, ijk_min ) 
    449467            IF (lwp) THEN 
    450468               WRITE(numout, *) 'MAX( tilde_e3t_a(:,:,:) / e3t_0(:,:,:) ) =', z_tmax 
     
    455473            ENDIF 
    456474         ENDIF 
     475         DEALLOCATE( ze3t, llmsk ) 
    457476         ! - ML - end test 
    458477         ! - ML - Imposing these limits will cause a baroclinicity error which is corrected for below 
     
    476495            zht(:,:)  = zht(:,:) + tilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
    477496         END DO 
    478          z_scale(:,:) =  - zht(:,:) / ( ht_0(:,:) + sshn(:,:) + 1. - ssmask(:,:) ) 
     497         z_scale(:,:) =  - zht(:,:) / ( ht_0(:,:) + ssh(:,:,Kmm) + 1. - ssmask(:,:) ) 
    479498         DO jk = 1, jpkm1 
    480             dtilde_e3t_a(:,:,jk) = dtilde_e3t_a(:,:,jk) + e3t_n(:,:,jk) * z_scale(:,:) * tmask(:,:,jk) 
     499            dtilde_e3t_a(:,:,jk) = dtilde_e3t_a(:,:,jk) + e3t(:,:,jk,Kmm) * z_scale(:,:) * tmask(:,:,jk) 
    481500         END DO 
    482501 
     
    486505      !                                           ! ---baroclinic part--------- ! 
    487506         DO jk = 1, jpkm1 
    488             e3t_a(:,:,jk) = e3t_a(:,:,jk) + dtilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
     507            e3t(:,:,jk,Kaa) = e3t(:,:,jk,Kaa) + dtilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
    489508         END DO 
    490509      ENDIF 
     
    501520         zht(:,:) = 0.0_wp 
    502521         DO jk = 1, jpkm1 
    503             zht(:,:) = zht(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     522            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    504523         END DO 
    505          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + sshn(:,:) - zht(:,:) ) ) 
     524         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kmm) - zht(:,:) ) ) 
    506525         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 
     526         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshn-SUM(e3t(:,:,:,Kmm)))) =', z_tmax 
    508527         ! 
    509528         zht(:,:) = 0.0_wp 
    510529         DO jk = 1, jpkm1 
    511             zht(:,:) = zht(:,:) + e3t_a(:,:,jk) * tmask(:,:,jk) 
     530            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kaa) * tmask(:,:,jk) 
    512531         END DO 
    513          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssha(:,:) - zht(:,:) ) ) 
     532         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kaa) - zht(:,:) ) ) 
    514533         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 
     534         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+ssha-SUM(e3t(:,:,:,Kaa)))) =', z_tmax 
    516535         ! 
    517536         zht(:,:) = 0.0_wp 
    518537         DO jk = 1, jpkm1 
    519             zht(:,:) = zht(:,:) + e3t_b(:,:,jk) * tmask(:,:,jk) 
     538            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kbb) * tmask(:,:,jk) 
    520539         END DO 
    521          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + sshb(:,:) - zht(:,:) ) ) 
     540         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kbb) - zht(:,:) ) ) 
    522541         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(:,:) ) ) 
     542         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshb-SUM(e3t(:,:,:,Kbb)))) =', z_tmax 
     543         ! 
     544         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kbb) ) ) 
    526545         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(:,:) ) ) 
     546         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kbb)))) =', z_tmax 
     547         ! 
     548         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kmm) ) ) 
    530549         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(:,:) ) ) 
     550         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kmm)))) =', z_tmax 
     551         ! 
     552         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kaa) ) ) 
    534553         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    535          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssha))) =', z_tmax 
     554         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kaa)))) =', z_tmax 
    536555      END IF 
    537556 
     
    540559      ! *********************************** ! 
    541560 
    542       CALL dom_vvl_interpol( e3t_a(:,:,:), e3u_a(:,:,:), 'U' ) 
    543       CALL dom_vvl_interpol( e3t_a(:,:,:), e3v_a(:,:,:), 'V' ) 
     561      CALL dom_vvl_interpol( e3t(:,:,:,Kaa), e3u(:,:,:,Kaa), 'U' ) 
     562      CALL dom_vvl_interpol( e3t(:,:,:,Kaa), e3v(:,:,:,Kaa), 'V' ) 
    544563 
    545564      ! *********************************** ! 
     
    547566      ! *********************************** ! 
    548567 
    549       hu_a(:,:) = e3u_a(:,:,1) * umask(:,:,1) 
    550       hv_a(:,:) = e3v_a(:,:,1) * vmask(:,:,1) 
     568      hu(:,:,Kaa) = e3u(:,:,1,Kaa) * umask(:,:,1) 
     569      hv(:,:,Kaa) = e3v(:,:,1,Kaa) * vmask(:,:,1) 
    551570      DO jk = 2, jpkm1 
    552          hu_a(:,:) = hu_a(:,:) + e3u_a(:,:,jk) * umask(:,:,jk) 
    553          hv_a(:,:) = hv_a(:,:) + e3v_a(:,:,jk) * vmask(:,:,jk) 
     571         hu(:,:,Kaa) = hu(:,:,Kaa) + e3u(:,:,jk,Kaa) * umask(:,:,jk) 
     572         hv(:,:,Kaa) = hv(:,:,Kaa) + e3v(:,:,jk,Kaa) * vmask(:,:,jk) 
    554573      END DO 
    555574      !                                        ! Inverse of the local depth 
    556575!!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(:,:) ) 
     576      r1_hu(:,:,Kaa) = ssumask(:,:) / ( hu(:,:,Kaa) + 1._wp - ssumask(:,:) ) 
     577      r1_hv(:,:,Kaa) = ssvmask(:,:) / ( hv(:,:,Kaa) + 1._wp - ssvmask(:,:) ) 
    559578      ! 
    560579      IF( ln_timing )   CALL timing_stop('dom_vvl_sf_nxt') 
     
    563582 
    564583 
    565    SUBROUTINE dom_vvl_sf_swp( kt ) 
    566       !!---------------------------------------------------------------------- 
    567       !!                ***  ROUTINE dom_vvl_sf_swp  *** 
     584   SUBROUTINE dom_vvl_sf_update( kt, Kbb, Kmm, Kaa ) 
     585      !!---------------------------------------------------------------------- 
     586      !!                ***  ROUTINE dom_vvl_sf_update  *** 
    568587      !!                    
    569       !! ** Purpose :  compute time filter and swap of scale factors  
     588      !! ** Purpose :  for z tilde case: compute time filter and swap of scale factors  
    570589      !!               compute all depths and related variables for next time step 
    571590      !!               write outputs and restart file 
    572591      !! 
    573       !! ** Method  :  - swap of e3t with trick for volume/tracer conservation 
     592      !! ** Method  :  - swap of e3t with trick for volume/tracer conservation (ONLY FOR Z TILDE CASE) 
    574593      !!               - reconstruct scale factor at other grid points (interpolate) 
    575594      !!               - recompute depths and water height fields 
    576595      !! 
    577       !! ** Action  :  - e3t_(b/n), tilde_e3t_(b/n) and e3(u/v)_n ready for next time step 
     596      !! ** Action  :  - tilde_e3t_(b/n) ready for next time step 
    578597      !!               - Recompute: 
    579598      !!                    e3(u/v)_b        
    580       !!                    e3w_n            
     599      !!                    e3w(:,:,:,Kmm)            
    581600      !!                    e3(u/v)w_b       
    582601      !!                    e3(u/v)w_n       
    583       !!                    gdept_n, gdepw_n  and gde3w_n 
     602      !!                    gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm)  and gde3w 
    584603      !!                    h(u/v) and h(u/v)r 
    585604      !! 
     
    587606      !!              Leclair, M., and G. Madec, 2011, Ocean Modelling. 
    588607      !!---------------------------------------------------------------------- 
    589       INTEGER, INTENT( in ) ::   kt   ! time step 
     608      INTEGER, INTENT( in ) ::   kt              ! time step 
     609      INTEGER, INTENT( in ) ::   Kbb, Kmm, Kaa   ! time level indices 
    590610      ! 
    591611      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     
    595615      IF( ln_linssh )   RETURN      ! No calculation in linear free surface 
    596616      ! 
    597       IF( ln_timing )   CALL timing_start('dom_vvl_sf_swp') 
     617      IF( ln_timing )   CALL timing_start('dom_vvl_sf_update') 
    598618      ! 
    599619      IF( kt == nit000 )   THEN 
    600620         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' 
     621         IF(lwp) WRITE(numout,*) 'dom_vvl_sf_update : - interpolate scale factors and compute depths for next time step' 
     622         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~' 
    603623      ENDIF 
    604624      ! 
     
    607627      ! - ML - e3(t/u/v)_b are allready computed in dynnxt. 
    608628      IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN 
    609          IF( neuler == 0 .AND. kt == nit000 ) THEN 
     629         IF( l_1st_euler ) THEN 
    610630            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) 
    611631         ELSE 
    612632            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) &  
    613             &         + atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) ) 
     633            &         + rn_atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) ) 
    614634         ENDIF 
    615635         tilde_e3t_n(:,:,:) = tilde_e3t_a(:,:,:) 
    616636      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(:,:,:) 
    623637 
    624638      ! Compute all missing vertical scale factor and depths 
     
    626640      ! Horizontal scale factor interpolations 
    627641      ! -------------------------------------- 
    628       ! - ML - e3u_b and e3v_b are allready computed in dynnxt 
    629       ! - JC - hu_b, hv_b, hur_b, hvr_b also 
     642      ! - ML - e3u(:,:,:,Kbb) and e3v(:,:,:,Kbb) are already computed in dynnxt 
     643      ! - JC - hu(:,:,:,Kbb), hv(:,:,:,:,Kbb), hur_b, hvr_b also 
    630644       
    631       CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F'  ) 
     645      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F'  ) 
    632646       
    633647      ! 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' ) 
     648      CALL dom_vvl_interpol( e3t(:,:,:,Kmm),  e3w(:,:,:,Kmm), 'W'  ) 
     649      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3uw(:,:,:,Kmm), 'UW' ) 
     650      CALL dom_vvl_interpol( e3v(:,:,:,Kmm), e3vw(:,:,:,Kmm), 'VW' ) 
     651      CALL dom_vvl_interpol( e3t(:,:,:,Kbb),  e3w(:,:,:,Kbb), 'W'  ) 
     652      CALL dom_vvl_interpol( e3u(:,:,:,Kbb), e3uw(:,:,:,Kbb), 'UW' ) 
     653      CALL dom_vvl_interpol( e3v(:,:,:,Kbb), e3vw(:,:,:,Kbb), 'VW' ) 
    640654 
    641655      ! 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 
     656      gdept(:,:,1,Kmm) = 0.5_wp * e3w(:,:,1,Kmm) 
     657      gdepw(:,:,1,Kmm) = 0.0_wp 
     658      gde3w(:,:,1) = gdept(:,:,1,Kmm) - ssh(:,:,Kmm) 
     659      DO_3D( 1, 1, 1, 1, 2, jpk ) 
     660        !    zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))   ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     661                                                           ! 1 for jk = mikt 
     662         zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
     663         gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 
     664         gdept(ji,jj,jk,Kmm) =    zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm) )  & 
     665             &             + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm) )  
     666         gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 
     667      END_3D 
    658668 
    659669      ! Local depth and Inverse of the local depth of the water 
    660670      ! ------------------------------------------------------- 
    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) 
     671      ! 
     672      ht(:,:) = e3t(:,:,1,Kmm) * tmask(:,:,1) 
    665673      DO jk = 2, jpkm1 
    666          ht_n(:,:) = ht_n(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     674         ht(:,:) = ht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    667675      END DO 
    668676 
    669677      ! write restart file 
    670678      ! ================== 
    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 
     679      IF( lrst_oce  )   CALL dom_vvl_rst( kt, Kbb, Kmm, 'WRITE' ) 
     680      ! 
     681      IF( ln_timing )   CALL timing_stop('dom_vvl_sf_update') 
     682      ! 
     683   END SUBROUTINE dom_vvl_sf_update 
    676684 
    677685 
     
    704712         ! 
    705713      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 
     714         DO_3D( 1, 0, 1, 0, 1, jpk ) 
     715            pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2u(ji,jj)   & 
     716               &                       * (   e1e2t(ji  ,jj) * ( pe3_in(ji  ,jj,jk) - e3t_0(ji  ,jj,jk) )     & 
     717               &                           + e1e2t(ji+1,jj) * ( pe3_in(ji+1,jj,jk) - e3t_0(ji+1,jj,jk) ) ) 
     718         END_3D 
    715719         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'U', 1._wp ) 
    716720         pe3_out(:,:,:) = pe3_out(:,:,:) + e3u_0(:,:,:) 
    717721         ! 
    718722      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 
     723         DO_3D( 1, 0, 1, 0, 1, jpk ) 
     724            pe3_out(ji,jj,jk) = 0.5_wp * ( vmask(ji,jj,jk)  * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2v(ji,jj)   & 
     725               &                       * (   e1e2t(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3t_0(ji,jj  ,jk) )     & 
     726               &                           + e1e2t(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3t_0(ji,jj+1,jk) ) ) 
     727         END_3D 
    728728         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'V', 1._wp ) 
    729729         pe3_out(:,:,:) = pe3_out(:,:,:) + e3v_0(:,:,:) 
    730730         ! 
    731731      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 
     732         DO_3D( 1, 0, 1, 0, 1, jpk ) 
     733            pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * umask(ji,jj+1,jk) * (1.0_wp - zlnwd) + zlnwd ) & 
     734               &                       *    r1_e1e2f(ji,jj)                                                  & 
     735               &                       * (   e1e2u(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3u_0(ji,jj  ,jk) )     & 
     736               &                           + e1e2u(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3u_0(ji,jj+1,jk) ) ) 
     737         END_3D 
    742738         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'F', 1._wp ) 
    743739         pe3_out(:,:,:) = pe3_out(:,:,:) + e3f_0(:,:,:) 
     
    783779 
    784780 
    785    SUBROUTINE dom_vvl_rst( kt, cdrw ) 
     781   SUBROUTINE dom_vvl_rst( kt, Kbb, Kmm, cdrw ) 
    786782      !!--------------------------------------------------------------------- 
    787783      !!                   ***  ROUTINE dom_vvl_rst  *** 
     
    795791      !!                they are set to 0. 
    796792      !!---------------------------------------------------------------------- 
    797       INTEGER         , INTENT(in) ::   kt     ! ocean time-step 
    798       CHARACTER(len=*), INTENT(in) ::   cdrw   ! "READ"/"WRITE" flag 
     793      INTEGER         , INTENT(in) ::   kt        ! ocean time-step 
     794      INTEGER         , INTENT(in) ::   Kbb, Kmm  ! ocean time level indices 
     795      CHARACTER(len=*), INTENT(in) ::   cdrw      ! "READ"/"WRITE" flag 
    799796      ! 
    800797      INTEGER ::   ji, jj, jk 
     
    806803         IF( ln_rstart ) THEN                   !* Read the restart file 
    807804            CALL rst_read_open                  !  open the restart file if necessary 
    808             CALL iom_get( numror, jpdom_autoglo, 'sshn'   , sshn, ldxios = lrxios    ) 
     805            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    ) 
    809806            ! 
    810807            id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. ) 
     
    813810            id4 = iom_varid( numror, 'tilde_e3t_n', ldstop = .FALSE. ) 
    814811            id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. ) 
     812            ! 
    815813            !                             ! --------- ! 
    816814            !                             ! all cases ! 
    817815            !                             ! --------- ! 
     816            ! 
    818817            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 ) 
     818               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios ) 
     819               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios ) 
    821820               ! 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' 
     821               IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files' 
    823822               WHERE ( tmask(:,:,:) == 0.0_wp )  
    824                   e3t_n(:,:,:) = e3t_0(:,:,:) 
    825                   e3t_b(:,:,:) = e3t_0(:,:,:) 
     823                  e3t(:,:,:,Kmm) = e3t_0(:,:,:) 
     824                  e3t(:,:,:,Kbb) = e3t_0(:,:,:) 
    826825               END WHERE 
    827                IF( neuler == 0 ) THEN 
    828                   e3t_b(:,:,:) = e3t_n(:,:,:) 
     826               IF( l_1st_euler ) THEN 
     827                  e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
    829828               ENDIF 
    830829            ELSE IF( id1 > 0 ) THEN 
    831                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart files' 
     830               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kmm) not found in restart files' 
    832831               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 
     832               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
     833               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios ) 
     834               e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb) 
     835               l_1st_euler = .true. 
    837836            ELSE IF( id2 > 0 ) THEN 
    838                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_b not found in restart files' 
     837               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kbb) not found in restart files' 
    839838               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 
     839               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
     840               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios ) 
     841               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     842               l_1st_euler = .true. 
    844843            ELSE 
    845                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart file' 
     844               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kmm) not found in restart file' 
    846845               IF(lwp) write(numout,*) 'Compute scale factor from sshn' 
    847                IF(lwp) write(numout,*) 'neuler is forced to 0' 
     846               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
    848847               DO jk = 1, jpk 
    849                   e3t_n(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:) ) & 
     848                  e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm) ) & 
    850849                      &                          / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    851850                      &          + e3t_0(:,:,jk)                               * (1._wp -tmask(:,:,jk)) 
    852851               END DO 
    853                e3t_b(:,:,:) = e3t_n(:,:,:) 
    854                neuler = 0 
     852               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     853               l_1st_euler = .true. 
    855854            ENDIF 
    856855            !                             ! ----------- ! 
     
    864863               !                          ! ----------------------- ! 
    865864               IF( MIN( id3, id4 ) > 0 ) THEN  ! all required arrays exist 
    866                   CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios ) 
    867                   CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios ) 
     865                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios ) 
     866                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios ) 
    868867               ELSE                            ! one at least array is missing 
    869868                  tilde_e3t_b(:,:,:) = 0.0_wp 
     
    874873                  !                       ! ------------ ! 
    875874                  IF( id5 > 0 ) THEN  ! required array exists 
    876                      CALL iom_get( numror, jpdom_autoglo, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios ) 
     875                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios ) 
    877876                  ELSE                ! array is missing 
    878877                     hdiv_lf(:,:,:) = 0.0_wp 
     
    888887               IF( cn_cfg == 'wad' ) THEN 
    889888                  ! 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  (:,:,:) 
     889                  CALL usr_def_istate( gdept(:,:,:,Kbb), tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  ) 
     890                  ts  (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb)       ! set now values from to before ones 
     891                  ssh (:,:,Kmm)     = ssh(:,:,Kbb) 
     892                  uu   (:,:,:,Kmm)   = uu  (:,:,:,Kbb) 
     893                  vv   (:,:,:,Kmm)   = vv  (:,:,:,Kbb) 
    895894               ELSE 
    896895                  ! 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 
     896                  ssh(:,:,Kmm) = -ssh_ref 
     897                  ssh(:,:,Kbb) = -ssh_ref 
     898 
     899                  DO_2D( 1, 1, 1, 1 ) 
     900                     IF( ht_0(ji,jj)-ssh_ref <  rn_wdmin1 ) THEN ! if total depth is less than min depth 
     901                        ssh(ji,jj,Kbb) = rn_wdmin1 - (ht_0(ji,jj) ) 
     902                        ssh(ji,jj,Kmm) = rn_wdmin1 - (ht_0(ji,jj) ) 
     903                     ENDIF 
     904                  END_2D 
    910905               ENDIF !If test case else 
    911906 
    912907               ! Adjust vertical metrics for all wad 
    913908               DO jk = 1, jpk 
    914                   e3t_n(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:)  ) & 
     909                  e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm)  ) & 
    915910                    &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    916911                    &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) ) 
    917912               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  
     913               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     914 
     915               DO_2D( 1, 1, 1, 1 ) 
     916                  IF ( ht_0(ji,jj) .LE. 0.0 .AND. NINT( ssmask(ji,jj) ) .EQ. 1) THEN 
     917                     CALL ctl_stop( 'dom_vvl_rst: ht_0 must be positive at potentially wet points' ) 
     918                  ENDIF 
     919               END_2D 
    927920               ! 
    928921            ELSE 
    929922               ! 
    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) 
     923               ! usr_def_istate called here only to get ssh(Kbb) needed to initialize e3t(Kbb) and e3t(Kmm) 
     924               ! 
     925               CALL usr_def_istate( gdept_0, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )   
     926               ! 
     927               ! usr_def_istate will be called again in istate_init to initialize ts, ssh, u and v 
    933928               ! 
    934929               DO jk=1,jpk 
    935                   e3t_b(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshb(:,:) ) & 
     930                  e3t(:,:,jk,Kbb) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb) ) & 
    936931                    &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    937                     &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )   ! make sure e3t_b != 0 on land points 
     932                    &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )   ! make sure e3t(:,:,:,Kbb) != 0 on land points 
    938933               END DO 
    939                e3t_n(:,:,:) = e3t_b(:,:,:) 
    940                sshn(:,:) = sshb(:,:)   ! needed later for gde3w 
    941 !!$                e3t_n(:,:,:)=e3t_0(:,:,:) 
    942 !!$                e3t_b(:,:,:)=e3t_0(:,:,:) 
     934               e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb) 
     935               ssh(:,:,Kmm) = ssh(:,:,Kbb)                                     ! needed later for gde3w 
    943936               ! 
    944937            END IF           ! end of ll_wd edits 
     
    958951         !                                           ! all cases ! 
    959952         !                                           ! --------- ! 
    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 ) 
     953         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lwxios ) 
     954         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lwxios ) 
    962955         !                                           ! ----------------------- ! 
    963956         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases ! 
     
    992985      !!----------------------------------------------------------------------  
    993986      ! 
    994       REWIND( numnam_ref )              ! Namelist nam_vvl in reference namelist :  
    995987      READ  ( numnam_ref, nam_vvl, IOSTAT = ios, ERR = 901) 
    996 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nam_vvl in reference namelist', lwp ) 
    997       REWIND( numnam_cfg )              ! Namelist nam_vvl in configuration namelist : Parameters of the run 
     988901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nam_vvl in reference namelist' ) 
    998989      READ  ( numnam_cfg, nam_vvl, IOSTAT = ios, ERR = 902 ) 
    999 902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nam_vvl in configuration namelist', lwp ) 
     990902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nam_vvl in configuration namelist' ) 
    1000991      IF(lwm) WRITE ( numond, nam_vvl ) 
    1001992      ! 
     
    10191010            WRITE(numout,*) '                         rn_rst_e3t     = 0.e0' 
    10201011            WRITE(numout,*) '            hard-wired : z-tilde cutoff frequency of low-pass filter (days)' 
    1021             WRITE(numout,*) '                         rn_lf_cutoff   = 1.0/rdt' 
     1012            WRITE(numout,*) '                         rn_lf_cutoff   = 1.0/rn_Dt' 
    10221013         ELSE 
    10231014            WRITE(numout,*) '      z-tilde to zstar restoration timescale (days)        rn_rst_e3t   = ', rn_rst_e3t 
     
    10341025      ! 
    10351026      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' ) 
    10371027      ! 
    10381028      IF(lwp) THEN                   ! Print the choice 
     
    10501040   END SUBROUTINE dom_vvl_ctl 
    10511041 
     1042#endif 
     1043 
    10521044   !!====================================================================== 
    10531045END MODULE domvvl 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/CANAL/MY_SRC/stpctl.F90

    r10572 r13463  
    1919   USE dom_oce         ! ocean space and time domain variables  
    2020   USE c1d             ! 1D vertical configuration 
     21   USE zdf_oce ,  ONLY : ln_zad_Aimp       ! ocean vertical physics variables 
     22   USE wet_dry,   ONLY : ll_wd, ssh_ref    ! reference depth for negative bathy 
     23   !   
    2124   USE diawri          ! Standard run outputs       (dia_wri_state routine) 
    22    ! 
    2325   USE in_out_manager  ! I/O manager 
    2426   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2527   USE lib_mpp         ! distributed memory computing 
    26    USE zdf_oce ,  ONLY : ln_zad_Aimp       ! ocean vertical physics variables 
    27    USE wet_dry,   ONLY : ll_wd, ssh_ref    ! reference depth for negative bathy 
    28  
     28   ! 
    2929   USE netcdf          ! NetCDF library 
    3030   IMPLICIT NONE 
     
    3333   PUBLIC stp_ctl           ! routine called by step.F90 
    3434 
    35    INTEGER  ::   idrun, idtime, idssh, idu, ids1, ids2, idt1, idt2, idc1, idw1, istatus 
    36    LOGICAL  ::   lsomeoce 
     35   INTEGER                ::   nrunid   ! netcdf file id 
     36   INTEGER, DIMENSION(8)  ::   nvarid   ! netcdf variable id 
    3737   !!---------------------------------------------------------------------- 
    3838   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    4242CONTAINS 
    4343 
    44    SUBROUTINE stp_ctl( kt, kindic ) 
     44   SUBROUTINE stp_ctl( kt, Kmm ) 
    4545      !!---------------------------------------------------------------------- 
    4646      !!                    ***  ROUTINE stp_ctl  *** 
     
    4949      !! 
    5050      !! ** Method  : - Save the time step in numstp 
    51       !!              - Print it each 50 time steps 
    52       !!              - Stop the run IF problem encountered by setting indic=-3 
     51      !!              - Stop the run IF problem encountered by setting nstop > 0 
    5352      !!                Problems checked: |ssh| maximum larger than 10 m 
    5453      !!                                  |U|   maximum larger than 10 m/s  
     
    5756      !! ** Actions :   "time.step" file = last ocean time-step 
    5857      !!                "run.stat"  file = run statistics 
    59       !!                nstop indicator sheared among all local domain (lk_mpp=T) 
     58      !!                 nstop indicator sheared among all local domain 
    6059      !!---------------------------------------------------------------------- 
    6160      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
    62       INTEGER, INTENT(inout) ::   kindic   ! error indicator 
    63       !! 
    64       INTEGER                ::   ji, jj, jk          ! dummy loop indices 
    65       INTEGER, DIMENSION(2)  ::   ih                  ! min/max loc indices 
    66       INTEGER, DIMENSION(3)  ::   iu, is1, is2        ! min/max loc indices 
    67       REAL(wp)               ::   zzz                 ! local real  
    68       REAL(wp), DIMENSION(9) ::   zmax 
    69       LOGICAL                ::   ll_wrtstp, ll_colruns, ll_wrtruns 
    70       CHARACTER(len=20) :: clname 
    71       !!---------------------------------------------------------------------- 
    72       ! 
    73       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_wrtruns = ll_colruns .AND. lwm 
    76       IF( kt == nit000 .AND. lwp ) THEN 
    77          WRITE(numout,*) 
    78          WRITE(numout,*) 'stp_ctl : time-stepping control' 
    79          WRITE(numout,*) '~~~~~~~' 
    80          !                                ! open time.step file 
    81          IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    82          !                                ! open run.stat file(s) at start whatever 
    83          !                                ! the value of sn_cfctl%ptimincr 
    84          IF( lwm .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) ) THEN 
     61      INTEGER, INTENT(in   ) ::   Kmm      ! ocean time level index 
     62      !! 
     63      INTEGER                         ::   ji                                    ! dummy loop indices 
     64      INTEGER                         ::   idtime, istatus 
     65      INTEGER , DIMENSION(9)          ::   iareasum, iareamin, iareamax 
     66      INTEGER , DIMENSION(3,4)        ::   iloc                                  ! min/max loc indices 
     67      REAL(wp)                        ::   zzz                                   ! local real  
     68      REAL(wp), DIMENSION(9)          ::   zmax, zmaxlocal 
     69      LOGICAL                         ::   ll_wrtstp, ll_colruns, ll_wrtruns 
     70      LOGICAL, DIMENSION(jpi,jpj,jpk) ::   llmsk 
     71      CHARACTER(len=20)               ::   clname 
     72      !!---------------------------------------------------------------------- 
     73      IF( nstop > 0 .AND. ngrdstop > -1 )   RETURN   !   stpctl was already called by a child grid 
     74      ! 
     75      ll_wrtstp  = ( MOD( kt-nit000, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
     76      ll_colruns = ll_wrtstp .AND. sn_cfctl%l_runstat .AND. jpnij > 1  
     77      ll_wrtruns = ( ll_colruns .OR. jpnij == 1 ) .AND. lwm 
     78      ! 
     79      IF( kt == nit000 ) THEN 
     80         ! 
     81         IF( lwp ) THEN 
     82            WRITE(numout,*) 
     83            WRITE(numout,*) 'stp_ctl : time-stepping control' 
     84            WRITE(numout,*) '~~~~~~~' 
     85         ENDIF 
     86         !                                ! open time.step    ascii file, done only by 1st subdomain 
     87         IF( lwm )   CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     88         ! 
     89         IF( ll_wrtruns ) THEN 
     90            !                             ! open run.stat     ascii file, done only by 1st subdomain 
    8591            CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     92            !                             ! open run.stat.nc netcdf file, done only by 1st subdomain 
    8693            clname = 'run.stat.nc' 
    8794            IF( .NOT. Agrif_Root() )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 
    88             istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, idrun ) 
    89             istatus = NF90_DEF_DIM( idrun, 'time', NF90_UNLIMITED, idtime ) 
    90             istatus = NF90_DEF_VAR( idrun, 'abs_ssh_max', NF90_DOUBLE, (/ idtime /), idssh ) 
    91             istatus = NF90_DEF_VAR( idrun,   'abs_u_max', NF90_DOUBLE, (/ idtime /), idu  ) 
    92             istatus = NF90_DEF_VAR( idrun,       's_min', NF90_DOUBLE, (/ idtime /), ids1 ) 
    93             istatus = NF90_DEF_VAR( idrun,       's_max', NF90_DOUBLE, (/ idtime /), ids2 ) 
    94             istatus = NF90_DEF_VAR( idrun,       't_min', NF90_DOUBLE, (/ idtime /), idt1 ) 
    95             istatus = NF90_DEF_VAR( idrun,       't_max', NF90_DOUBLE, (/ idtime /), idt2 ) 
     95            istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, nrunid ) 
     96            istatus = NF90_DEF_DIM( nrunid, 'time', NF90_UNLIMITED, idtime ) 
     97            istatus = NF90_DEF_VAR( nrunid, 'abs_ssh_max', NF90_DOUBLE, (/ idtime /), nvarid(1) ) 
     98            istatus = NF90_DEF_VAR( nrunid,   'abs_u_max', NF90_DOUBLE, (/ idtime /), nvarid(2) ) 
     99            istatus = NF90_DEF_VAR( nrunid,       's_min', NF90_DOUBLE, (/ idtime /), nvarid(3) ) 
     100            istatus = NF90_DEF_VAR( nrunid,       's_max', NF90_DOUBLE, (/ idtime /), nvarid(4) ) 
     101            istatus = NF90_DEF_VAR( nrunid,       't_min', NF90_DOUBLE, (/ idtime /), nvarid(5) ) 
     102            istatus = NF90_DEF_VAR( nrunid,       't_max', NF90_DOUBLE, (/ idtime /), nvarid(6) ) 
    96103            IF( ln_zad_Aimp ) THEN 
    97                istatus = NF90_DEF_VAR( idrun,   'abs_wi_max', NF90_DOUBLE, (/ idtime /), idw1 ) 
    98                istatus = NF90_DEF_VAR( idrun,       'Cu_max', NF90_DOUBLE, (/ idtime /), idc1 ) 
     104               istatus = NF90_DEF_VAR( nrunid,   'Cf_max', NF90_DOUBLE, (/ idtime /), nvarid(7) ) 
     105               istatus = NF90_DEF_VAR( nrunid,'abs_wi_max',NF90_DOUBLE, (/ idtime /), nvarid(8) ) 
    99106            ENDIF 
    100             istatus = NF90_ENDDEF(idrun) 
    101             zmax(8:9) = 0._wp    ! initialise to zero in case ln_zad_Aimp option is not in use 
    102          ENDIF 
    103       ENDIF 
    104       IF( kt == nit000 )   lsomeoce = COUNT( ssmask(:,:) == 1._wp ) > 0 
    105       ! 
    106       IF(lwm .AND. ll_wrtstp) THEN        !==  current time step  ==!   ("time.step" file) 
     107            istatus = NF90_ENDDEF(nrunid) 
     108         ENDIF 
     109         !     
     110      ENDIF 
     111      ! 
     112      !                                   !==              write current time step              ==! 
     113      !                                   !==  done only by 1st subdomain at writting timestep  ==! 
     114      IF( lwm .AND. ll_wrtstp ) THEN 
    107115         WRITE ( numstp, '(1x, i8)' )   kt 
    108116         REWIND( numstp ) 
    109117      ENDIF 
    110       ! 
    111       !                                   !==  test of extrema  ==! 
     118      !                                   !==            test of local extrema           ==! 
     119      !                                   !==  done by all processes at every time step  ==! 
     120      ! 
     121      llmsk(   1:Nis1,:,:) = .FALSE.                                              ! exclude halos from the checked region 
     122      llmsk(Nie1: jpi,:,:) = .FALSE. 
     123      llmsk(:,   1:Njs1,:) = .FALSE. 
     124      llmsk(:,Nje1: jpj,:) = .FALSE. 
     125      ! 
     126      llmsk(Nis0:Nie0,Njs0:Nje0,1) = ssmask(Nis0:Nie0,Njs0:Nje0) == 1._wp         ! define only the inner domain 
    112127      IF( ll_wd ) THEN 
    113          zmax(1) = MAXVAL(  ABS( sshn(:,:) + ssh_ref*tmask(:,:,1) )  )        ! ssh max  
     128         zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) + ssh_ref ), mask = llmsk(:,:,1) )   ! ssh max 
    114129      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 
    122       zmax(7) = REAL( nstop , wp )                                            ! stop indicator 
    123       IF( ln_zad_Aimp ) THEN 
    124          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       ENDIF 
    127       ! 
     130         zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm)           ), mask = llmsk(:,:,1) )   ! ssh max 
     131      ENDIF 
     132      llmsk(Nis0:Nie0,Njs0:Nje0,:) = umask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp        ! define only the inner domain 
     133      zmax(2) = MAXVAL(  ABS( uu(:,:,:,Kmm) ), mask = llmsk )                     ! velocity max (zonal only) 
     134      llmsk(Nis0:Nie0,Njs0:Nje0,:) = tmask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp        ! define only the inner domain 
     135      zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     ! minus salinity max 
     136      zmax(4) = MAXVAL(  ts(:,:,:,jp_sal,Kmm), mask = llmsk )                     !       salinity max 
     137      IF( ll_colruns .OR. jpnij == 1 ) THEN     ! following variables are used only in the netcdf file 
     138         zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  ! minus temperature max 
     139         zmax(6) = MAXVAL(  ts(:,:,:,jp_tem,Kmm), mask = llmsk )                  !       temperature max 
     140         IF( ln_zad_Aimp ) THEN 
     141            zmax(7) = MAXVAL(   Cu_adv(:,:,:)   , mask = llmsk )                  ! partitioning coeff. max 
     142            llmsk(:,:,:) = wmask(:,:,:) == 1._wp 
     143            zmax(8) = MAXVAL(  ABS( wi(:,:,:) ) , mask = llmsk )                  ! implicit vertical vel. max 
     144         ELSE 
     145            zmax(7:8) = 0._wp 
     146         ENDIF 
     147      ELSE 
     148         zmax(5:8) = 0._wp 
     149      ENDIF 
     150      zmax(9) = REAL( nstop, wp )                                                 ! stop indicator 
     151      !                                   !==               get global extrema             ==! 
     152      !                                   !==  done by all processes if writting run.stat  ==! 
    128153      IF( ll_colruns ) THEN 
     154         zmaxlocal(:) = zmax(:) 
    129155         CALL mpp_max( "stpctl", zmax )          ! max over the global domain 
    130          nstop = NINT( zmax(7) )                 ! nstop indicator sheared among all local domains 
    131       ENDIF 
    132       !                                   !==  run statistics  ==!   ("run.stat" files) 
     156         nstop = NINT( zmax(9) )                 ! update nstop indicator (now sheared among all local domains) 
     157      ENDIF 
     158      !                                   !==              write "run.stat" files              ==! 
     159      !                                   !==  done only by 1st subdomain at writting timestep  ==! 
    133160      IF( ll_wrtruns ) THEN 
    134161         WRITE(numrun,9500) kt, zmax(1), zmax(2), -zmax(3), zmax(4) 
    135          istatus = NF90_PUT_VAR( idrun, idssh, (/ zmax(1)/), (/kt/), (/1/) ) 
    136          istatus = NF90_PUT_VAR( idrun,   idu, (/ zmax(2)/), (/kt/), (/1/) ) 
    137          istatus = NF90_PUT_VAR( idrun,  ids1, (/-zmax(3)/), (/kt/), (/1/) ) 
    138          istatus = NF90_PUT_VAR( idrun,  ids2, (/ zmax(4)/), (/kt/), (/1/) ) 
    139          istatus = NF90_PUT_VAR( idrun,  idt1, (/-zmax(5)/), (/kt/), (/1/) ) 
    140          istatus = NF90_PUT_VAR( idrun,  idt2, (/ zmax(6)/), (/kt/), (/1/) ) 
     162         istatus = NF90_PUT_VAR( nrunid, nvarid(1), (/ zmax(1)/), (/kt/), (/1/) ) 
     163         istatus = NF90_PUT_VAR( nrunid, nvarid(2), (/ zmax(2)/), (/kt/), (/1/) ) 
     164         istatus = NF90_PUT_VAR( nrunid, nvarid(3), (/-zmax(3)/), (/kt/), (/1/) ) 
     165         istatus = NF90_PUT_VAR( nrunid, nvarid(4), (/ zmax(4)/), (/kt/), (/1/) ) 
     166         istatus = NF90_PUT_VAR( nrunid, nvarid(5), (/-zmax(5)/), (/kt/), (/1/) ) 
     167         istatus = NF90_PUT_VAR( nrunid, nvarid(6), (/ zmax(6)/), (/kt/), (/1/) ) 
    141168         IF( ln_zad_Aimp ) THEN 
    142             istatus = NF90_PUT_VAR( idrun,  idw1, (/ zmax(8)/), (/kt/), (/1/) ) 
    143             istatus = NF90_PUT_VAR( idrun,  idc1, (/ zmax(9)/), (/kt/), (/1/) ) 
    144          ENDIF 
    145          IF( MOD( kt , 100 ) == 0 ) istatus = NF90_SYNC(idrun) 
    146          IF( kt == nitend         ) istatus = NF90_CLOSE(idrun) 
     169            istatus = NF90_PUT_VAR( nrunid, nvarid(7), (/ zmax(7)/), (/kt/), (/1/) ) 
     170            istatus = NF90_PUT_VAR( nrunid, nvarid(8), (/ zmax(8)/), (/kt/), (/1/) ) 
     171         ENDIF 
     172         IF( kt == nitend )   istatus = NF90_CLOSE(nrunid) 
    147173      END IF 
    148       !                                   !==  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) 
    152 !!$         &  zmax(3) >=   0._wp .OR.   &                    ! negative or zero sea surface salinity 
    153 !!$         &  zmax(4) >= 100._wp .OR.   &                    ! too large sea surface salinity ( > 100 ) 
    154 !!$         &  zmax(4) <    0._wp .OR.   &                    ! too large sea surface salinity (keep this line for sea-ice) 
    155          &  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 ) 
     174      !                                   !==               error handling               ==! 
     175      !                                   !==  done by all processes at every time step  ==! 
     176      ! 
     177      IF(   zmax(1) >   20._wp .OR.   &                   ! too large sea surface height ( > 20 m ) 
     178         &  zmax(2) >   10._wp .OR.   &                   ! too large velocity ( > 10 m/s) 
     179!!$         &  zmax(3) >=   0._wp .OR.   &                   ! negative or zero sea surface salinity 
     180!!$         &  zmax(4) >= 100._wp .OR.   &                   ! too large sea surface salinity ( > 100 ) 
     181!!$         &  zmax(4) <    0._wp .OR.   &                   ! too large sea surface salinity (keep this line for sea-ice) 
     182         &  ISNAN( zmax(1) + zmax(2) + zmax(3) ) .OR.   &               ! NaN encounter in the tests 
     183         &  ABS(   zmax(1) + zmax(2) + zmax(3) ) > HUGE(1._wp) ) THEN   ! Infinity encounter in the tests 
     184         ! 
     185         iloc(:,:) = 0 
     186         IF( ll_colruns ) THEN   ! zmax is global, so it is the same on all subdomains -> no dead lock with mpp_maxloc 
     187            ! first: close the netcdf file, so we can read it 
     188            IF( lwm .AND. kt /= nitend )   istatus = NF90_CLOSE(nrunid) 
     189            ! get global loc on the min/max 
     190            llmsk(Nis0:Nie0,Njs0:Nje0,1) = ssmask(Nis0:Nie0,Njs0:Nje0 ) == 1._wp         ! define only the inner domain 
     191            CALL mpp_maxloc( 'stpctl', ABS(ssh(:,:,         Kmm)), llmsk(:,:,1), zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F  
     192            llmsk(Nis0:Nie0,Njs0:Nje0,:) = umask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp        ! define only the inner domain 
     193            CALL mpp_maxloc( 'stpctl', ABS( uu(:,:,:,       Kmm)), llmsk(:,:,:), zzz, iloc(1:3,2) ) 
     194            llmsk(Nis0:Nie0,Njs0:Nje0,:) = tmask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp        ! define only the inner domain 
     195            CALL mpp_minloc( 'stpctl',      ts(:,:,:,jp_sal,Kmm) , llmsk(:,:,:), zzz, iloc(1:3,3) ) 
     196            CALL mpp_maxloc( 'stpctl',      ts(:,:,:,jp_sal,Kmm) , llmsk(:,:,:), zzz, iloc(1:3,4) ) 
     197            ! find which subdomain has the max. 
     198            iareamin(:) = jpnij+1   ;   iareamax(:) = 0   ;   iareasum(:) = 0 
     199            DO ji = 1, 9 
     200               IF( zmaxlocal(ji) == zmax(ji) ) THEN 
     201                  iareamin(ji) = narea   ;   iareamax(ji) = narea   ;   iareasum(ji) = 1 
     202               ENDIF 
     203            END DO 
     204            CALL mpp_min( "stpctl", iareamin )         ! min over the global domain 
     205            CALL mpp_max( "stpctl", iareamax )         ! max over the global domain 
     206            CALL mpp_sum( "stpctl", iareasum )         ! sum over the global domain 
     207         ELSE                    ! find local min and max locations: 
     208            ! if we are here, this means that the subdomain contains some oce points -> no need to test the mask used in maxloc 
     209            llmsk(Nis0:Nie0,Njs0:Nje0,1) = ssmask(Nis0:Nie0,Njs0:Nje0 ) == 1._wp         ! define only the inner domain 
     210            iloc(1:2,1) = MAXLOC( ABS( ssh(:,:,         Kmm)), mask = llmsk(:,:,1) ) 
     211            llmsk(Nis0:Nie0,Njs0:Nje0,:) = umask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp        ! define only the inner domain 
     212            iloc(1:3,2) = MAXLOC( ABS(  uu(:,:,:,       Kmm)), mask = llmsk(:,:,:) ) 
     213            llmsk(Nis0:Nie0,Njs0:Nje0,:) = tmask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp        ! define only the inner domain 
     214            iloc(1:3,3) = MINLOC(       ts(:,:,:,jp_sal,Kmm) , mask = llmsk(:,:,:) ) 
     215            iloc(1:3,4) = MAXLOC(       ts(:,:,:,jp_sal,Kmm) , mask = llmsk(:,:,:) ) 
     216            DO ji = 1, 4   ! local domain indices ==> global domain indices, excluding halos 
     217               iloc(1:2,ji) = (/ mig0(iloc(1,ji)), mjg0(iloc(2,ji)) /) 
     218            END DO 
     219            iareamin(:) = narea   ;   iareamax(:) = narea   ;   iareasum(:) = 1         ! this is local information 
     220         ENDIF 
     221         ! 
     222         WRITE(ctmp1,*) ' stp_ctl: |ssh| > 20 m  or  |U| > 10 m/s  or  S <= 0  or  S >= 100  or  NaN encounter in the tests' 
     223         CALL wrt_line( ctmp2, kt, '|ssh| max',  zmax(1), iloc(:,1), iareasum(1), iareamin(1), iareamax(1) ) 
     224         CALL wrt_line( ctmp3, kt, '|U|   max',  zmax(2), iloc(:,2), iareasum(2), iareamin(2), iareamax(2) ) 
     225         CALL wrt_line( ctmp4, kt, 'Sal   min', -zmax(3), iloc(:,3), iareasum(3), iareamin(3), iareamax(3) ) 
     226         CALL wrt_line( ctmp5, kt, 'Sal   max',  zmax(4), iloc(:,4), iareasum(4), iareamin(4), iareamax(4) ) 
     227         IF( Agrif_Root() ) THEN 
     228            WRITE(ctmp6,*) '      ===> output of last computed fields in output.abort* files' 
    161229         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 /) 
    166          ENDIF 
    167           
    168          WRITE(ctmp1,*) ' stp_ctl: |ssh| > 50 m  or  |U| > 20 m/s  or  NaN encounter in the tests' 
    169          WRITE(ctmp2,9100) kt,   zmax(1), ih(1) , ih(2) 
    170          WRITE(ctmp3,9200) kt,   zmax(2), iu(1) , iu(2) , iu(3) 
    171          WRITE(ctmp4,9300) kt, - zmax(3), is1(1), is1(2), is1(3) 
    172          WRITE(ctmp5,9400) kt,   zmax(4), is2(1), is2(2), is2(3) 
    173          WRITE(ctmp6,*) '      ===> output of last computed fields in output.abort.nc file' 
    174           
    175          CALL dia_wri_state( 'output.abort' )     ! create an output.abort file 
    176           
    177          IF( .NOT. ln_ctl ) THEN 
    178             WRITE(ctmp8,*) 'E R R O R message from sub-domain: ', narea 
    179             CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp8, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ctmp6 ) 
    180          ELSE 
    181             CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6, ' ' ) 
    182          ENDIF 
    183  
    184          kindic = -3 
    185          ! 
    186       ENDIF 
    187       ! 
    188 9100  FORMAT (' kt=',i8,'   |ssh| max: ',1pg11.4,', at  i j  : ',2i5) 
    189 9200  FORMAT (' kt=',i8,'   |U|   max: ',1pg11.4,', at  i j k: ',3i5) 
    190 9300  FORMAT (' kt=',i8,'   S     min: ',1pg11.4,', at  i j k: ',3i5) 
    191 9400  FORMAT (' kt=',i8,'   S     max: ',1pg11.4,', at  i j k: ',3i5) 
     230            WRITE(ctmp6,*) '      ===> output of last computed fields in '//TRIM(Agrif_CFixed())//'_output.abort* files' 
     231         ENDIF 
     232         ! 
     233         CALL dia_wri_state( Kmm, 'output.abort' )     ! create an output.abort file 
     234         ! 
     235         IF( ll_colruns .or. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files 
     236            IF(lwp) THEN   ;   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) 
     237            ELSE           ;   nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop) 
     238            ENDIF 
     239         ELSE                                    ! only mpi subdomains with errors are here -> STOP now 
     240            CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) 
     241         ENDIF 
     242         ! 
     243      ENDIF 
     244      ! 
     245      IF( nstop > 0 ) THEN                                                  ! an error was detected and we did not abort yet... 
     246         ngrdstop = Agrif_Fixed()                                           ! store which grid got this error 
     247         IF( .NOT. ll_colruns .AND. jpnij > 1 )   CALL ctl_stop( 'STOP' )   ! we must abort here to avoid MPI deadlock 
     248      ENDIF 
     249      ! 
    1922509500  FORMAT(' it :', i8, '    |ssh|_max: ', D23.16, ' |U|_max: ', D23.16,' S_min: ', D23.16,' S_max: ', D23.16) 
    193251      ! 
    194252   END SUBROUTINE stp_ctl 
     253 
     254 
     255   SUBROUTINE wrt_line( cdline, kt, cdprefix, pval, kloc, ksum, kmin, kmax ) 
     256      !!---------------------------------------------------------------------- 
     257      !!                     ***  ROUTINE wrt_line  *** 
     258      !! 
     259      !! ** Purpose :   write information line 
     260      !! 
     261      !!---------------------------------------------------------------------- 
     262      CHARACTER(len=*),      INTENT(  out) ::   cdline 
     263      CHARACTER(len=*),      INTENT(in   ) ::   cdprefix 
     264      REAL(wp),              INTENT(in   ) ::   pval 
     265      INTEGER, DIMENSION(3), INTENT(in   ) ::   kloc 
     266      INTEGER,               INTENT(in   ) ::   kt, ksum, kmin, kmax 
     267      ! 
     268      CHARACTER(len=80) ::   clsuff 
     269      CHARACTER(len=9 ) ::   clkt, clsum, clmin, clmax 
     270      CHARACTER(len=9 ) ::   cli, clj, clk 
     271      CHARACTER(len=1 ) ::   clfmt 
     272      CHARACTER(len=4 ) ::   cl4   ! needed to be able to compile with Agrif, I don't know why 
     273      INTEGER           ::   ifmtk 
     274      !!---------------------------------------------------------------------- 
     275      WRITE(clkt , '(i9)') kt 
     276       
     277      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij  ,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9) 
     278      !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF 
     279      cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum 
     280      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9) 
     281      cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1 
     282                                   WRITE(clmax, cl4) kmax-1 
     283      ! 
     284      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpiglo,wp))) + 1      ! how many digits to we need to write jpiglo? (we decide max = 9) 
     285      cl4 = '(i'//clfmt//')'   ;   WRITE(cli, cl4) kloc(1)      ! this is ok with AGRIF 
     286      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpjglo,wp))) + 1      ! how many digits to we need to write jpjglo? (we decide max = 9) 
     287      cl4 = '(i'//clfmt//')'   ;   WRITE(clj, cl4) kloc(2)      ! this is ok with AGRIF 
     288      ! 
     289      IF( ksum == 1 ) THEN   ;   WRITE(clsuff,9100) TRIM(clmin) 
     290      ELSE                   ;   WRITE(clsuff,9200) TRIM(clsum), TRIM(clmin), TRIM(clmax) 
     291      ENDIF 
     292      IF(kloc(3) == 0) THEN 
     293         ifmtk = INT(LOG10(REAL(jpk,wp))) + 1                   ! how many digits to we need to write jpk? (we decide max = 9) 
     294         clk = REPEAT(' ', ifmtk)                               ! create the equivalent in blank string 
     295         WRITE(cdline,9300) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj), clk(1:ifmtk), TRIM(clsuff) 
     296      ELSE 
     297         WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpk,wp))) + 1      ! how many digits to we need to write jpk? (we decide max = 9) 
     298         !!! WRITE(clk, '(i'//clfmt//')') kloc(3)               ! this is creating a compilation error with AGRIF 
     299         cl4 = '(i'//clfmt//')'   ;   WRITE(clk, cl4) kloc(3)   ! this is ok with AGRIF 
     300         WRITE(cdline,9400) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj),    TRIM(clk), TRIM(clsuff) 
     301      ENDIF 
     302      ! 
     3039100  FORMAT('MPI rank ', a) 
     3049200  FORMAT('found in ', a, ' MPI tasks, spread out among ranks ', a, ' to ', a) 
     3059300  FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j   ', a, ' ', a, ' ', a, ' ', a) 
     3069400  FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j k ', a, ' ', a, ' ', a, ' ', a) 
     307      ! 
     308   END SUBROUTINE wrt_line 
     309 
    195310 
    196311   !!====================================================================== 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/CANAL/MY_SRC/trazdf.F90

    r10572 r13463  
    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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0, 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( 0, 0, 0, 0 ) 
     206               zwt(ji,jj,1) = zwd(ji,jj,1) 
     207            END_2D 
     208            DO_3D( 0, 0, 0, 0, 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( 0, 0, 0, 0 ) 
     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( 0, 0, 0, 0, 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( 0, 0, 0, 0 ) 
     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( 0, 0, 0, 0, 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_r11351_fldread_with_XIOS/tests/CANAL/MY_SRC/usrdef_hgr.F90

    r10074 r13463  
    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) 
     
    6163      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2] 
    6264      ! 
    63       INTEGER  ::   ji, jj   ! dummy loop indices 
     65      INTEGER  ::   ji, jj     ! dummy loop indices 
    6466      REAL(wp) ::   zphi0, zlam0, zbeta, zf0 
    65       REAL(wp) ::   zti, zui, ztj, zvj   ! local scalars 
     67      REAL(wp) ::   zti, ztj   ! local scalars 
    6668      !!------------------------------------------------------------------------------- 
    6769      ! 
     
    7577      ! Position coordinates (in kilometers) 
    7678      !                          ========== 
    77       zlam0 = -REAL(NINT(jpiglo*rn_0xratio)-1, wp) * rn_dx 
    78       zphi0 = -REAL(NINT(jpjglo*rn_0yratio)-1, wp) * rn_dy  
     79      zlam0 = -REAL(NINT(Ni0glo*rn_0xratio)-1, wp) * rn_dx 
     80      zphi0 = -REAL(NINT(Nj0glo*rn_0yratio)-1, wp) * rn_dy  
    7981 
    8082#if defined key_agrif 
     
    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( 1, 1, 1, 1 )          
     93         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos 
     94         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos 
     95          
     96         plamt(ji,jj) = zlam0 + rn_dx *   zti 
     97         plamu(ji,jj) = zlam0 + rn_dx * ( zti + 0.5_wp )  
     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 * ( ztj + 0.5_wp )  
     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_r11351_fldread_with_XIOS/tests/CANAL/MY_SRC/usrdef_istate.F90

    r10425 r13463  
    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( 0, 0, 0, 0 ) 
     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( 1, 1, 1, 1 ) 
     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( 1, 1, 1, 1 ) 
     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( 0, 0, 0, 0 ) 
     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( 0, 0, 0, 0 ) 
     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_r11351_fldread_with_XIOS/tests/CANAL/MY_SRC/usrdef_nam.F90

    r10074 r13463  
    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 
    1717   USE par_oce        ! ocean space and time domain 
    1818   USE phycst         ! physical constants 
     
    5858CONTAINS 
    5959 
    60    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     60   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    6161      !!---------------------------------------------------------------------- 
    6262      !!                     ***  ROUTINE dom_nam  *** 
     
    7070      !! ** input   : - namusr_def namelist found in namelist_cfg 
    7171      !!---------------------------------------------------------------------- 
    72       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    7372      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    7473      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    7675      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    7776      ! 
    78       INTEGER ::   ios, ii      ! Local integer 
    79       REAL(wp)::   zh ! Local scalars 
     77      INTEGER ::   ios      ! Local integer 
     78      REAL(wp)::   zh       ! Local scalars 
    8079      !! 
    8180      NAMELIST/namusr_def/  rn_domszx, rn_domszy, rn_domszz, rn_dx, rn_dy, rn_dz, rn_0xratio, rn_0yratio   & 
     
    8584      !!---------------------------------------------------------------------- 
    8685      ! 
    87       ii = 1 
     86      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
     87902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    8888      ! 
    89       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    90       READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    91 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
     89      IF(lwm)   WRITE( numond, namusr_def ) 
    9290      ! 
    9391#if defined key_agrif  
     
    103101#endif 
    104102      ! 
    105       WRITE( ldnam(:), namusr_def ) 
     103      IF(lwm)   WRITE( numond, namusr_def ) 
    106104      ! 
    107105      cd_cfg = 'EW_CANAL'             ! name & resolution (not used) 
    108106      kk_cfg = INT( rn_dx ) 
    109107      ! 
    110       ! Global Domain size:  EW_CANAL global domain is  1800 km x 1800 Km x 5000 m 
    111       kpi = NINT( rn_domszx / rn_dx ) + 1 
    112       kpj = NINT( rn_domszy / rn_dy ) + 3 
    113       kpk = NINT( rn_domszz / rn_dz ) + 1 
    114 #if defined key_agrif 
    115       IF( .NOT. Agrif_Root() ) THEN 
    116          kpi  = nbcellsx + 2 + 2*nbghostcells 
    117          kpj  = nbcellsy + 2 + 2*nbghostcells 
     108      IF( Agrif_Root() ) THEN        ! Global Domain size:  EW_CANAL global domain is  1800 km x 1800 Km x 5000 m 
     109         kpi = NINT( rn_domszx / rn_dx ) + 1 
     110         kpj = NINT( rn_domszy / rn_dy ) + 3 
     111      ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side 
     112         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2 
     113         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2 
    118114      ENDIF 
    119 #endif 
     115      kpk = MAX( 2, NINT( rn_domszz / rn_dz ) + 1 ) 
    120116      ! 
    121117      zh  = (kpk-1)*rn_dz 
    122       !                             ! control print 
    123       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    124       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    125       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    126       WRITE(ldtxt(ii),*) '   Namelist namusr_def : EW_CANAL test case'                                  ;   ii = ii + 1 
    127       WRITE(ldtxt(ii),*) '      horizontal domain size-x          rn_domszx  = ', rn_domszx, ' km'      ;   ii = ii + 1 
    128       WRITE(ldtxt(ii),*) '      horizontal domain size-y          rn_domszy  = ', rn_domszy, ' km'      ;   ii = ii + 1 
    129       WRITE(ldtxt(ii),*) '      vertical   domain size-z          rn_domszz  = ', rn_domszz, '  m'      ;   ii = ii + 1 
    130       WRITE(ldtxt(ii),*) '      horizontal x-resolution           rn_dx      = ',     rn_dx, ' km'      ;   ii = ii + 1 
    131       WRITE(ldtxt(ii),*) '      horizontal y-resolution           rn_dy      = ',     rn_dy, ' km'      ;   ii = ii + 1 
    132       WRITE(ldtxt(ii),*) '      vertical resolution               rn_dz      = ',     rn_dz, '  m'      ;   ii = ii + 1 
    133       WRITE(ldtxt(ii),*) '      x-domain ratio of the 0           rn_0xratio = ', rn_0xratio            ;   ii = ii + 1 
    134       WRITE(ldtxt(ii),*) '      y-domain ratio of the 0           rn_0yratio = ', rn_0yratio            ;   ii = ii + 1 
    135       WRITE(ldtxt(ii),*) '          H [m] : ', zh                                                       ;   ii = ii + 1 
    136       WRITE(ldtxt(ii),*) '      F computation                     nn_fcase   = ',   nn_fcase            ;   ii = ii + 1 
    137       WRITE(ldtxt(ii),*) '      Reference latitude                rn_ppgphi0 = ', rn_ppgphi0            ;   ii = ii + 1 
    138       WRITE(ldtxt(ii),*) '      10m wind speed                    rn_u10     = ',     rn_u10, ' m/s'    ;   ii = ii + 1 
    139       WRITE(ldtxt(ii),*) '         wind latitudinal extension     rn_windszy = ', rn_windszy, ' km'     ;   ii = ii + 1 
    140       WRITE(ldtxt(ii),*) '         wind longitudinal extension    rn_windszx = ', rn_windszx, ' km'     ;   ii = ii + 1 
    141       WRITE(ldtxt(ii),*) '         Uoce multiplicative factor     rn_uofac   = ',   rn_uofac            ;   ii = ii + 1 
    142       WRITE(ldtxt(ii),*) '      initial Canal max current        rn_vtxmax  = ',  rn_vtxmax, ' m/s'    ;   ii = ii + 1 
    143       WRITE(ldtxt(ii),*) '      initial zonal current             rn_uzonal  = ',  rn_uzonal, ' m/s'    ;   ii = ii + 1 
    144       WRITE(ldtxt(ii),*) '         Jet latitudinal extension      rn_ujetszy = ', rn_ujetszy, ' km'     ;   ii = ii + 1 
    145       WRITE(ldtxt(ii),*) '         Jet longitudinal extension     rn_ujetszx = ', rn_ujetszx, ' km'     ;   ii = ii + 1 
    146       WRITE(ldtxt(ii),*) '      bottom definition (0:flat)        nn_botcase = ', nn_botcase            ;   ii = ii + 1 
    147       WRITE(ldtxt(ii),*) '      initial condition case            nn_initcase= ', nn_initcase           ;   ii = ii + 1 
    148       WRITE(ldtxt(ii),*) '                   (0:rest, 1:zonal current, 10:shear)'                       ;   ii = ii + 1 
    149       WRITE(ldtxt(ii),*) '      add random noise on initial ssh   ln_sshnoise= ', ln_sshnoise           ;   ii = ii + 1 
    150       WRITE(ldtxt(ii),*) '      Gaussian lambda parameter          rn_lambda = ', rn_lambda             ;   ii = ii + 1 
    151       ! 
    152118      !                             ! Set the lateral boundary condition of the global domain 
    153119      kperio = 1                    ! EW_CANAL configuration : closed basin 
    154       ! 
    155       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    156       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    157       WRITE(ldtxt(ii),*) '      EW_CANAL : closed basin            jperio = ', kperio                   ;   ii = ii + 1 
     120      !                             ! control print 
     121      IF(lwp) THEN 
     122         WRITE(numout,*) '   ' 
     123         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     124         WRITE(numout,*) '~~~~~~~~~~~ ' 
     125         WRITE(numout,*) '   Namelist namusr_def : EW_CANAL test case' 
     126         WRITE(numout,*) '      horizontal domain size-x          rn_domszx  = ', rn_domszx, ' km' 
     127         WRITE(numout,*) '      horizontal domain size-y          rn_domszy  = ', rn_domszy, ' km' 
     128         WRITE(numout,*) '      vertical   domain size-z          rn_domszz  = ', rn_domszz, '  m' 
     129         WRITE(numout,*) '      horizontal x-resolution           rn_dx      = ',     rn_dx, ' km' 
     130         WRITE(numout,*) '      horizontal y-resolution           rn_dy      = ',     rn_dy, ' km' 
     131         WRITE(numout,*) '      vertical resolution               rn_dz      = ',     rn_dz, '  m' 
     132         WRITE(numout,*) '      x-domain ratio of the 0           rn_0xratio = ', rn_0xratio 
     133         WRITE(numout,*) '      y-domain ratio of the 0           rn_0yratio = ', rn_0yratio 
     134         WRITE(numout,*) '          H [m] : ', zh 
     135         WRITE(numout,*) '      F computation                     nn_fcase   = ',   nn_fcase 
     136         WRITE(numout,*) '      Reference latitude                rn_ppgphi0 = ', rn_ppgphi0 
     137         WRITE(numout,*) '      10m wind speed                    rn_u10     = ',     rn_u10, ' m/s' 
     138         WRITE(numout,*) '         wind latitudinal extension     rn_windszy = ', rn_windszy, ' km' 
     139         WRITE(numout,*) '         wind longitudinal extension    rn_windszx = ', rn_windszx, ' km' 
     140         WRITE(numout,*) '         Uoce multiplicative factor     rn_uofac   = ',   rn_uofac 
     141         WRITE(numout,*) '      initial Canal max current         rn_vtxmax  = ',  rn_vtxmax, ' m/s' 
     142         WRITE(numout,*) '      initial zonal current             rn_uzonal  = ',  rn_uzonal, ' m/s' 
     143         WRITE(numout,*) '         Jet latitudinal extension      rn_ujetszy = ', rn_ujetszy, ' km' 
     144         WRITE(numout,*) '         Jet longitudinal extension     rn_ujetszx = ', rn_ujetszx, ' km' 
     145         WRITE(numout,*) '      bottom definition (0:flat)        nn_botcase = ', nn_botcase 
     146         WRITE(numout,*) '      initial condition case            nn_initcase= ', nn_initcase 
     147         WRITE(numout,*) '                   (0:rest, 1:zonal current, 10:shear)' 
     148         WRITE(numout,*) '      add random noise on initial ssh   ln_sshnoise= ', ln_sshnoise 
     149         WRITE(numout,*) '      Gaussian lambda parameter          rn_lambda = ', rn_lambda 
     150         WRITE(numout,*) '   ' 
     151         WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     152         WRITE(numout,*) '      EW_CANAL : closed basin               jperio = ', kperio 
     153      ENDIF 
    158154      ! 
    159155   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/CANAL/MY_SRC/usrdef_sbc.F90

    r10074 r13463  
    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_r11351_fldread_with_XIOS/tests/CANAL/MY_SRC/usrdef_zgr.F90

    r10425 r13463  
    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_r11351_fldread_with_XIOS/tests/ICE_ADV1D/EXPREF/context_nemo.xml

    r10413 r13463  
    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_r11351_fldread_with_XIOS/tests/ICE_ADV1D/EXPREF/namelist_cfg

    r10513 r13463  
    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 
     
    106106!!                                                                    !! 
    107107!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    108 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    109 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     108!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     109!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    110110!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    111111!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    115115&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    116116!----------------------------------------------------------------------- 
    117    ln_OFF     = .true.     !  free-slip       : Cd = 0                   
     117   ln_drg_OFF = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    118118/ 
    119119!!====================================================================== 
     
    201201!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203 !!   namflo       float parameters                                      ("key_float") 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    205 !!   namdct       transports through some sections                      ("key_diadct") 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     203!!   namflo       float parameters                                      (default: OFF) 
     204!!   nam_diadct   transports through some sections                      (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_ADV1D/EXPREF/namelist_cfg_120pts

    r10513 r13463  
    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 
     
    106106!!                                                                    !! 
    107107!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    108 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    109 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     108!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     109!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    110110!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    111111!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    115115&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    116116!----------------------------------------------------------------------- 
    117    ln_OFF     = .true.     !  free-slip       : Cd = 0                   
     117   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    118118/ 
    119119!!====================================================================== 
     
    201201!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203 !!   namflo       float parameters                                      ("key_float") 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    205 !!   namdct       transports through some sections                      ("key_diadct") 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     203!!   namflo       float parameters                                      (default: OFF) 
     204!!   nam_diadct   transports through some sections                      (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_ADV1D/EXPREF/namelist_cfg_240pts

    r10513 r13463  
    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 
     
    106106!!                                                                    !! 
    107107!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    108 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    109 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     108!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     109!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    110110!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    111111!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    115115&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    116116!----------------------------------------------------------------------- 
    117    ln_OFF     = .true.     !  free-slip       : Cd = 0                   
     117   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    118118/ 
    119119!!====================================================================== 
     
    201201!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203 !!   namflo       float parameters                                      ("key_float") 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    205 !!   namdct       transports through some sections                      ("key_diadct") 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     203!!   namflo       float parameters                                      (default: OFF) 
     204!!   nam_diadct   transports through some sections                      (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_ADV1D/EXPREF/namelist_cfg_60pts

    r10513 r13463  
    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 
     
    106106!!                                                                    !! 
    107107!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    108 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    109 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     108!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     109!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    110110!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    111111!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    115115&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    116116!----------------------------------------------------------------------- 
    117    ln_OFF     = .true.     !  free-slip       : Cd = 0                   
     117   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    118118/ 
    119119!!====================================================================== 
     
    201201!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203 !!   namflo       float parameters                                      ("key_float") 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    205 !!   namdct       transports through some sections                      ("key_diadct") 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     203!!   namflo       float parameters                                      (default: OFF) 
     204!!   nam_diadct   transports through some sections                      (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_ADV1D/MY_SRC/usrdef_hgr.F90

    r10513 r13463  
    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) 
     
    6264      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2] 
    6365      ! 
    64       INTEGER  ::   ji, jj   ! dummy loop indices 
     66      INTEGER  ::   ji, jj     ! dummy loop indices 
    6567      REAL(wp) ::   zphi0, zlam0, zbeta, zf0 
    66       REAL(wp) ::   zti, zui, ztj, zvj   ! local scalars 
     68      REAL(wp) ::   zti, ztj   ! local scalars 
    6769      !!------------------------------------------------------------------------------- 
    6870      ! 
     
    7375 
    7476      !                          ========== 
    75       zlam0 = -(jpiglo-1)/2 * 1.e-3 * rn_dx 
    76       zphi0 = -(jpjglo-1)/2 * 1.e-3 * rn_dy 
     77      zlam0 = -REAL( (Ni0glo-2)/2, wp) * 1.e-3 * rn_dx 
     78      zphi0 = -REAL( (Nj0glo-2)/2, wp) * 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( 1, 1, 1, 1 ) 
     81         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos 
     82         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos 
     83          
     84         plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti 
     85         plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * ( zti + 0.5_wp ) 
     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 * ( ztj + 0.5_wp ) 
     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_r11351_fldread_with_XIOS/tests/ICE_ADV1D/MY_SRC/usrdef_nam.F90

    r10513 r13463  
    1414   !!   usr_def_hgr   : initialize the horizontal mesh  
    1515   !!---------------------------------------------------------------------- 
    16    USE dom_oce  , ONLY: nimpp , njmpp            ! i- & j-indices of the local domain 
    1716   USE par_oce        ! ocean space and time domain 
    1817   USE phycst         ! physical constants 
     
    4039CONTAINS 
    4140 
    42    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     41   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4342      !!---------------------------------------------------------------------- 
    4443      !!                     ***  ROUTINE dom_nam  *** 
     
    5251      !! ** input   : - namusr_def namelist found in namelist_cfg 
    5352      !!---------------------------------------------------------------------- 
    54       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    5553      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    5654      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    5856      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    5957      ! 
    60       INTEGER ::   ios, ii   ! Local integer 
     58      INTEGER ::   ios       ! Local integer 
    6159      REAL(wp)::   zlx, zly  ! Local scalars 
    6260      !! 
     
    6462      !!---------------------------------------------------------------------- 
    6563      ! 
    66       ii = 1 
     64      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
     65902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    6766      ! 
    68       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    69       READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    70 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
    71       ! 
    72       WRITE( ldnam(:), namusr_def ) 
     67      IF(lwm)   WRITE( numond, namusr_def ) 
    7368      ! 
    7469      cd_cfg = 'ICE_ADV1D'           ! name & resolution (not used) 
     
    8277      zlx = kpi*rn_dx*1.e-3 
    8378      zly = kpj*rn_dy*1.e-3 
    84       !                             ! control print 
    85       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    86       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    87       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    88       WRITE(ldtxt(ii),*) '   Namelist namusr_def : ICE_ADV1D test case'                                 ;   ii = ii + 1 
    89       WRITE(ldtxt(ii),*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'   ;   ii = ii + 1 
    90       WRITE(ldtxt(ii),*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters'   ;   ii = ii + 1 
    91       WRITE(ldtxt(ii),*) '      ICE_ADV1D domain  '                                                     ;   ii = ii + 1 
    92       WRITE(ldtxt(ii),*) '         LX [km]: ', zlx                                                      ;   ii = ii + 1 
    93       WRITE(ldtxt(ii),*) '         LY [km]: ', zly                                                      ;   ii = ii + 1 
    94       WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo = ', kpi                ;   ii = ii + 1 
    95       WRITE(ldtxt(ii),*) '                                               jpjglo = ', kpj                ;   ii = ii + 1 
    96       WRITE(ldtxt(ii),*) '                                               jpkglo = ', kpk                ;   ii = ii + 1 
    97       WRITE(ldtxt(ii),*) '         Coriolis:', ln_corio                                                 ;   ii = ii + 1 
    98       ! 
    9979      !                             ! Set the lateral boundary condition of the global domain 
    10080      kperio = 0                    ! ICE_ADV1D configuration : bi-periodic basin 
    101       ! 
    102       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    103       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    104       WRITE(ldtxt(ii),*) '      ICE_ADV1D : closed basin                    jperio = ', kperio          ;   ii = ii + 1 
     81      !                             ! control print 
     82      IF(lwp) THEN 
     83         WRITE(numout,*) '   ' 
     84         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     85         WRITE(numout,*) '~~~~~~~~~~~ ' 
     86         WRITE(numout,*) '   Namelist namusr_def : ICE_ADV1D test case' 
     87         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters' 
     88         WRITE(numout,*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters' 
     89         WRITE(numout,*) '      ICE_ADV1D domain  ' 
     90         WRITE(numout,*) '         LX [km]: ', zlx 
     91         WRITE(numout,*) '         LY [km]: ', zly 
     92         WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     93         WRITE(numout,*) '                                               Nj0glo = ', kpj 
     94         WRITE(numout,*) '                                               jpkglo = ', kpk 
     95         WRITE(numout,*) '         Coriolis:', ln_corio 
     96         WRITE(numout,*) '   ' 
     97         WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     98         WRITE(numout,*) '      ICE_ADV1D : closed basin                 jperio = ', kperio 
     99      ENDIF 
    105100      ! 
    106101   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_ADV1D/MY_SRC/usrdef_sbc.F90

    r10513 r13463  
    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_r11351_fldread_with_XIOS/tests/ICE_ADV1D/MY_SRC/usrdef_zgr.F90

    r10513 r13463  
    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_r11351_fldread_with_XIOS/tests/ICE_ADV2D/EXPREF/context_nemo.xml

    r10515 r13463  
    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_r11351_fldread_with_XIOS/tests/ICE_ADV2D/EXPREF/namelist_cfg

    r10520 r13463  
    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 
     
    106106!!                                                                    !! 
    107107!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    108 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    109 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     108!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     109!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    110110!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    111111!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    115115&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    116116!----------------------------------------------------------------------- 
    117    ln_OFF     = .true.     !  free-slip       : Cd = 0                   
     117   ln_drg_OFF = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    118118/ 
    119119!!====================================================================== 
     
    201201!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203 !!   namflo       float parameters                                      ("key_float") 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    205 !!   namdct       transports through some sections                      ("key_diadct") 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     203!!   namflo       float parameters                                      (default: OFF) 
     204!!   nam_diadct   transports through some sections                      (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_ADV2D/MY_SRC/usrdef_hgr.F90

    r10515 r13463  
    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) 
     
    6264      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2] 
    6365      ! 
    64       INTEGER  ::   ji, jj   ! dummy loop indices 
     66      INTEGER  ::   ji, jj     ! dummy loop indices 
    6567      REAL(wp) ::   zphi0, zlam0, zbeta, zf0 
    66       REAL(wp) ::   zti, zui, ztj, zvj   ! local scalars 
     68      REAL(wp) ::   zti, ztj   ! local scalars 
    6769      !!------------------------------------------------------------------------------- 
    6870      ! 
     
    7476 
    7577      !                          ========== 
    76       zlam0 = -(jpiglo-1)/2 * 1.e-3 * rn_dx 
    77       zphi0 = -(jpjglo-1)/2 * 1.e-3 * rn_dy 
     78      zlam0 = -REAL( (Ni0glo-2)/2, wp) * 1.e-3 * rn_dx 
     79      zphi0 = -REAL( (Nj0glo-2)/2, wp) * 1.e-3 * rn_dy  
    7880 
    7981#if defined key_agrif  
     
    8183!clem         zlam0  = Agrif_Parent(zlam0) + (Agrif_ix())*Agrif_Parent(rn_dx) * 1.e-5 
    8284!clem         zphi0  = Agrif_Parent(zphi0) + (Agrif_iy())*Agrif_Parent(rn_dy) * 1.e-5 
    83          zlam0 = ( 0.5_wp - ( Agrif_parent(jpiglo) - 1 ) / 2 ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
     85         zlam0 = ( 0.5_wp - REAL( (Agrif_parent(Ni0glo) - 2 ) / 2, wp ) ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
    8486            &  + ( Agrif_Ix() + nbghostcells - 1 ) * Agrif_irhox() * rn_dx * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dx * 1.e-3 
    85          zphi0 = ( 0.5_wp - ( Agrif_parent(jpjglo) - 1 ) / 2 ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
     87         zphi0 = ( 0.5_wp - REAL( (Agrif_parent(Nj0glo) - 2 ) / 2, wp ) ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
    8688            &  + ( Agrif_Iy() + nbghostcells - 1 ) * Agrif_irhoy() * rn_dy * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dy * 1.e-3 
    8789      ENDIF 
    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( 1, 1, 1, 1 ) 
     93         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos 
     94         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos 
     95          
     96         plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti 
     97         plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * ( zti + 0.5_wp ) 
     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 * ( ztj + 0.5_wp ) 
     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_r11351_fldread_with_XIOS/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90

    r10515 r13463  
    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 
    1717   USE par_oce        ! ocean space and time domain 
    1818   USE phycst         ! physical constants 
     
    4040CONTAINS 
    4141 
    42    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     42   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4343      !!---------------------------------------------------------------------- 
    4444      !!                     ***  ROUTINE dom_nam  *** 
     
    5252      !! ** input   : - namusr_def namelist found in namelist_cfg 
    5353      !!---------------------------------------------------------------------- 
    54       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    5554      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    5655      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    5857      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    5958      ! 
    60       INTEGER ::   ios, ii   ! Local integer 
     59      INTEGER ::   ios       ! Local integer 
    6160      REAL(wp)::   zlx, zly  ! Local scalars 
    6261      !! 
     
    6463      !!---------------------------------------------------------------------- 
    6564      ! 
    66       ii = 1 
     65      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
     66902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    6767      ! 
    68       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    69       READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    70 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
     68      IF(lwm)   WRITE( numond, namusr_def ) 
    7169      ! 
    7270#if defined key_agrif  
     
    7977#endif 
    8078      ! 
    81       WRITE( ldnam(:), namusr_def ) 
     79      IF(lwm)   WRITE( numond, namusr_def ) 
    8280      ! 
    8381      cd_cfg = 'ICE_ADV2D'           ! name & resolution (not used) 
    84       kk_cfg = INT( rn_dx ) 
     82      kk_cfg = NINT( rn_dx ) 
    8583      ! 
    86       ! Global Domain size:  ICE_ADV2D domain is  300 km x 300 Km x 10 m 
    87       kpi = INT( 300.e3 / rn_dx ) -1 
    88       kpj = INT( 300.e3 / rn_dy ) -1 
    89 #if defined key_agrif 
    90       IF( .NOT. Agrif_Root() ) THEN 
    91          kpi = nbcellsx + 2 + 2*nbghostcells 
    92          kpj = nbcellsy + 2 + 2*nbghostcells 
     84      IF( Agrif_Root() ) THEN        ! Global Domain size: ICE_AGRIF domain is  300 km x 300 Km x 10 m 
     85         kpi = NINT( 300.e3 / rn_dx ) - 1 
     86         kpj = NINT( 300.e3 / rn_dy ) - 1 
     87      ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side 
     88         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2 
     89         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2 
    9390      ENDIF 
    94 #endif 
    95       kpk = 1 
     91      kpk = 2 
    9692      ! 
    9793!!      zlx = (kpi-2)*rn_dx*1.e-3 
     
    9995      zlx = kpi*rn_dx*1.e-3 
    10096      zly = kpj*rn_dy*1.e-3 
     97      ! 
     98      IF( Agrif_Root() ) THEN   ;   kperio = 7     ! ICE_AGRIF configuration : bi-periodic basin 
     99      ELSE                      ;   kperio = 0     ! closed periodicity for the zoom 
     100      ENDIF 
    101101      !                             ! control print 
    102       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    103       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    104       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    105       WRITE(ldtxt(ii),*) '   Namelist namusr_def : ICE_ADV2D test case'                                 ;   ii = ii + 1 
    106       WRITE(ldtxt(ii),*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'   ;   ii = ii + 1 
    107       WRITE(ldtxt(ii),*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters'   ;   ii = ii + 1 
    108       WRITE(ldtxt(ii),*) '      ICE_ADV2D domain = 300 km x 300Km x 1 grid-point '                      ;   ii = ii + 1 
    109       WRITE(ldtxt(ii),*) '         LX [km]: ', zlx                                                      ;   ii = ii + 1 
    110       WRITE(ldtxt(ii),*) '         LY [km]: ', zly                                                      ;   ii = ii + 1 
    111       WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo = ', kpi                ;   ii = ii + 1 
    112       WRITE(ldtxt(ii),*) '                                               jpjglo = ', kpj                ;   ii = ii + 1 
    113       WRITE(ldtxt(ii),*) '                                               jpkglo = ', kpk                ;   ii = ii + 1 
    114       WRITE(ldtxt(ii),*) '         Coriolis:', ln_corio                                                 ;   ii = ii + 1 
    115       ! 
    116       !                             ! Set the lateral boundary condition of the global domain 
    117       kperio = 7                    ! ICE_ADV2D configuration : bi-periodic basin 
    118 #if defined key_agrif 
    119       IF( .NOT. Agrif_Root() ) THEN 
    120       kperio = 0 
     102      IF(lwp) THEN 
     103         WRITE(numout,*) '   ' 
     104         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     105         WRITE(numout,*) '~~~~~~~~~~~ ' 
     106         WRITE(numout,*) '   Namelist namusr_def : ICE_ADV2D test case' 
     107         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters' 
     108         WRITE(numout,*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters' 
     109         WRITE(numout,*) '      ICE_ADV2D domain = 300 km x 300Km x 1 grid-point ' 
     110         WRITE(numout,*) '         LX [km]: ', zlx 
     111         WRITE(numout,*) '         LY [km]: ', zly 
     112         WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     113         WRITE(numout,*) '                                               Nj0glo = ', kpj 
     114         WRITE(numout,*) '                                               jpkglo = ', kpk 
     115         WRITE(numout,*) '         Coriolis:', ln_corio 
     116         WRITE(numout,*) '   ' 
     117         WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     118         WRITE(numout,*) '      ICE_ADV2D : bi-periodic basin            jperio = ', kperio 
    121119      ENDIF 
    122 #endif 
    123       ! 
    124       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    125       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    126       WRITE(ldtxt(ii),*) '      ICE_ADV2D : bi-periodic basin               jperio = ', kperio          ;   ii = ii + 1 
    127120      ! 
    128121   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_ADV2D/MY_SRC/usrdef_sbc.F90

    r10515 r13463  
    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_r11351_fldread_with_XIOS/tests/ICE_ADV2D/MY_SRC/usrdef_zgr.F90

    r10515 r13463  
    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_r11351_fldread_with_XIOS/tests/ICE_AGRIF/EXPREF/1_namelist_cfg

    r10516 r13463  
    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 
     
    106106!!                                                                    !! 
    107107!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    108 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    109 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     108!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     109!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    110110!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    111111!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    115115&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    116116!----------------------------------------------------------------------- 
    117    ln_OFF     = .true.     !  free-slip       : Cd = 0                   
     117   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    118118/ 
    119119!!====================================================================== 
     
    201201!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203 !!   namflo       float parameters                                      ("key_float") 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    205 !!   namdct       transports through some sections                      ("key_diadct") 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     203!!   namflo       float parameters                                      (default: OFF) 
     204!!   nam_diadct   transports through some sections                      (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_AGRIF/EXPREF/AGRIF_FixedGrids.in

    r9159 r13463  
    111 
    2 34 63 34 63 3 3 3 
     233 62 33 62 3 3 3 
    330 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_AGRIF/EXPREF/context_nemo.xml

    r9930 r13463  
    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_r11351_fldread_with_XIOS/tests/ICE_AGRIF/EXPREF/namelist_cfg

    r10516 r13463  
    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 
     
    106106!!                                                                    !! 
    107107!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    108 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    109 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     108!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     109!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    110110!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    111111!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    115115&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    116116!----------------------------------------------------------------------- 
    117    ln_OFF     = .true.     !  free-slip       : Cd = 0                   
     117   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    118118/ 
    119119!!====================================================================== 
     
    201201!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    202202!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    203 !!   namflo       float parameters                                      ("key_float") 
    204 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    205 !!   namdct       transports through some sections                      ("key_diadct") 
    206 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     203!!   namflo       float parameters                                      (default: OFF) 
     204!!   nam_diadct   transports through some sections                      (default: OFF) 
    207205!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    208206!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_AGRIF/MY_SRC/usrdef_hgr.F90

    r10516 r13463  
    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) 
     
    6264      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2] 
    6365      ! 
    64       INTEGER  ::   ji, jj   ! dummy loop indices 
     66      INTEGER  ::   ji, jj     ! dummy loop indices 
    6567      REAL(wp) ::   zphi0, zlam0, zbeta, zf0 
    66       REAL(wp) ::   zti, zui, ztj, zvj   ! local scalars 
     68      REAL(wp) ::   zti, ztj   ! local scalars 
    6769      !!------------------------------------------------------------------------------- 
    6870      ! 
     
    7476 
    7577      !                          ========== 
    76       zlam0 = -(jpiglo-1)/2 * 1.e-3 * rn_dx 
    77       zphi0 = -(jpjglo-1)/2 * 1.e-3 * rn_dy 
    78  
    7978#if defined key_agrif  
    80       IF( .NOT. Agrif_Root() ) THEN 
     79      IF( Agrif_Root() ) THEN 
     80#endif 
     81         ! Compatibility WITH old version:  
     82         ! jperio = 7 =>  Ni0glo = jpigo_old_version - 2 
     83         !            =>  jpiglo-1 replaced by Ni0glo+1 
     84         zlam0 = -REAL( (Ni0glo+1)/2, wp) * 1.e-3 * rn_dx 
     85         zphi0 = -REAL( (Nj0glo+1)/2, wp) * 1.e-3 * rn_dy   ! +1 for compatibility with old version --> to be replaced by -1 as before 
     86#if defined key_agrif  
     87      ELSE 
     88         ! ! let lower left longitude and latitude from parent 
    8189!clem         zlam0  = Agrif_Parent(zlam0) + (Agrif_ix())*Agrif_Parent(rn_dx) * 1.e-5 
    8290!clem         zphi0  = Agrif_Parent(zphi0) + (Agrif_iy())*Agrif_Parent(rn_dy) * 1.e-5 
    83          zlam0 = ( 0.5_wp - ( Agrif_parent(jpiglo) - 1 ) / 2 ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
     91         ! Compatibility WITH old version:  
     92         ! jperio = 0 =>  Ni0glo = jpigo_old_version 
     93         !            =>  Agrif_parent(jpiglo)-1 replaced by  Agrif_parent(Ni0glo)-1 
     94         zlam0 = ( 0.5_wp - REAL( ( Agrif_parent(Ni0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
    8495            &  + ( Agrif_Ix() + nbghostcells - 1 ) * Agrif_irhox() * rn_dx * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dx * 1.e-3 
    85          zphi0 = ( 0.5_wp - ( Agrif_parent(jpjglo) - 1 ) / 2 ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
     96         zphi0 = ( 0.5_wp - REAL( ( Agrif_parent(Nj0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
    8697            &  + ( Agrif_Iy() + nbghostcells - 1 ) * Agrif_irhoy() * rn_dy * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dy * 1.e-3 
    8798      ENDIF 
    8899#endif          
    89100 
    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 
     101      DO_2D( 1, 1, 1, 1 ) 
     102         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos 
     103         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos 
     104          
     105         plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti 
     106         plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * ( zti + 0.5_wp ) 
     107         plamv(ji,jj) = plamt(ji,jj)  
     108         plamf(ji,jj) = plamu(ji,jj)  
     109          
     110         pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 *   ztj 
     111         pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * ( ztj + 0.5_wp ) 
     112         pphiu(ji,jj) = pphit(ji,jj)  
     113         pphif(ji,jj) = pphiv(ji,jj)  
     114      END_2D 
    106115          
    107116         ! Horizontal scale factors (in meters) 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_AGRIF/MY_SRC/usrdef_nam.F90

    r10516 r13463  
    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 
    1717   USE par_oce        ! ocean space and time domain 
    1818   USE phycst         ! physical constants 
     
    4040CONTAINS 
    4141 
    42    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     42   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4343      !!---------------------------------------------------------------------- 
    4444      !!                     ***  ROUTINE dom_nam  *** 
     
    5252      !! ** input   : - namusr_def namelist found in namelist_cfg 
    5353      !!---------------------------------------------------------------------- 
    54       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    5554      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    5655      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    5857      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    5958      ! 
    60       INTEGER ::   ios, ii   ! Local integer 
     59      INTEGER ::   ios       ! Local integer 
    6160      REAL(wp)::   zlx, zly  ! Local scalars 
    6261      !! 
     
    6463      !!---------------------------------------------------------------------- 
    6564      ! 
    66       ii = 1 
     65      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
     66902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    6767      ! 
    68       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    69       READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    70 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
     68      IF(lwm)   WRITE( numond, namusr_def ) 
    7169      ! 
    7270#if defined key_agrif  
     
    7977#endif 
    8078      ! 
    81       WRITE( ldnam(:), namusr_def ) 
     79      IF(lwm)   WRITE( numond, namusr_def ) 
    8280      ! 
    8381      cd_cfg = 'ICE_AGRIF'           ! name & resolution (not used) 
    84       kk_cfg = INT( rn_dx ) 
     82      kk_cfg = NINT( rn_dx ) 
    8583      ! 
    86       ! Global Domain size:  ICE_AGRIF domain is  300 km x 300 Km x 10 m 
    87       kpi = INT( 300.e3 / rn_dx ) -1 
    88       kpj = INT( 300.e3 / rn_dy ) -1 
    89 #if defined key_agrif 
    90       IF( .NOT. Agrif_Root() ) THEN 
    91          kpi = nbcellsx + 2 + 2*nbghostcells 
    92          kpj = nbcellsy + 2 + 2*nbghostcells 
     84      IF( Agrif_Root() ) THEN        ! Global Domain size:  ICE_AGRIF domain is  300 km x 300 Km x 10 m 
     85         kpi = NINT( 300.e3 / rn_dx ) - 1 
     86         kpj = NINT( 300.e3 / rn_dy ) - 1 
     87         kpi = kpi - 2   ! for compatibility with old version (because kerio=7) --> to be removed 
     88         kpj = kpj - 2   ! for compatibility with old version (because kerio=7) --> to be removed 
     89      ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side 
     90         kpi  = nbcellsx + 2 * ( nbghostcells + 1 ) 
     91         kpj  = nbcellsy + 2 * ( nbghostcells + 1 ) 
     92!!$         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2 
     93!!$         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2 
    9394      ENDIF 
    94 #endif 
    95       kpk = 1 
     95      kpk = 2 
    9696      ! 
    9797!!      zlx = (kpi-2)*rn_dx*1.e-3 
     
    9999      zlx = kpi*rn_dx*1.e-3 
    100100      zly = kpj*rn_dy*1.e-3 
     101      ! 
     102      IF( Agrif_Root() ) THEN   ;   kperio = 7     ! ICE_AGRIF configuration : bi-periodic basin 
     103      ELSE                      ;   kperio = 0     ! closed periodicity for the zoom 
     104      ENDIF 
    101105      !                             ! control print 
    102       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    103       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    104       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    105       WRITE(ldtxt(ii),*) '   Namelist namusr_def : ICE_AGRIF test case'                                 ;   ii = ii + 1 
    106       WRITE(ldtxt(ii),*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'   ;   ii = ii + 1 
    107       WRITE(ldtxt(ii),*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters'   ;   ii = ii + 1 
    108       WRITE(ldtxt(ii),*) '      ICE_AGRIF domain = 300 km x 300Km x 1 grid-point '                      ;   ii = ii + 1 
    109       WRITE(ldtxt(ii),*) '         LX [km]: ', zlx                                                      ;   ii = ii + 1 
    110       WRITE(ldtxt(ii),*) '         LY [km]: ', zly                                                      ;   ii = ii + 1 
    111       WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo = ', kpi                ;   ii = ii + 1 
    112       WRITE(ldtxt(ii),*) '                                               jpjglo = ', kpj                ;   ii = ii + 1 
    113       WRITE(ldtxt(ii),*) '                                               jpkglo = ', kpk                ;   ii = ii + 1 
    114       WRITE(ldtxt(ii),*) '         Coriolis:', ln_corio                                                 ;   ii = ii + 1 
    115       ! 
    116       !                             ! Set the lateral boundary condition of the global domain 
    117       kperio = 7                    ! ICE_AGRIF configuration : bi-periodic basin 
    118 #if defined key_agrif 
    119       IF( .NOT. Agrif_Root() ) THEN 
    120       kperio = 0 
     106      IF(lwp) THEN 
     107         WRITE(numout,*) '   ' 
     108         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     109         WRITE(numout,*) '~~~~~~~~~~~ ' 
     110         WRITE(numout,*) '   Namelist namusr_def : ICE_AGRIF test case' 
     111         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters' 
     112         WRITE(numout,*) '      horizontal resolution                    rn_dy  = ', rn_dy, ' meters' 
     113         WRITE(numout,*) '      ICE_AGRIF domain = 300 km x 300Km x 1 grid-point ' 
     114         WRITE(numout,*) '         LX [km]: ', zlx 
     115         WRITE(numout,*) '         LY [km]: ', zly 
     116         WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     117         WRITE(numout,*) '                                               Nj0glo = ', kpj 
     118         WRITE(numout,*) '                                               jpkglo = ', kpk 
     119         WRITE(numout,*) '         Coriolis:', ln_corio 
     120         WRITE(numout,*) '   ' 
     121         WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     122         WRITE(numout,*) '      ICE_AGRIF : bi-periodic basin            jperio = ', kperio 
    121123      ENDIF 
    122 #endif 
    123       ! 
    124       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    125       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    126       WRITE(ldtxt(ii),*) '      ICE_AGRIF : bi-periodic basin               jperio = ', kperio          ;   ii = ii + 1 
    127124      ! 
    128125   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ICE_AGRIF/MY_SRC/usrdef_sbc.F90

    r10516 r13463  
    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_r11351_fldread_with_XIOS/tests/ICE_AGRIF/MY_SRC/usrdef_zgr.F90

    r10516 r13463  
    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_r11351_fldread_with_XIOS/tests/ISOMIP/EXPREF/context_nemo.xml

    r9930 r13463  
    55--> 
    66<context id="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"/> 
    3436 
    3537</context> 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ISOMIP/EXPREF/file_def_nemo-oce.xml

    r9572 r13463  
    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_r11351_fldread_with_XIOS/tests/ISOMIP/EXPREF/namelist_cfg

    r10075 r13463  
    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  ***             !! 
    128227!!                                                                    !! 
    129228!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    130 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    131 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     229!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     230!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    132231!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    133232!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    137236&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    138237!----------------------------------------------------------------------- 
    139    ln_OFF     = .false.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
     238   ln_drg_OFF = .false.   !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    140239   ln_lin     = .false.    !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top) 
    141240   ln_non_lin = .true.     !  non-linear  drag: Cd = Cd0 |U| 
     
    145244/ 
    146245!----------------------------------------------------------------------- 
    147 &namdrg_top    !   TOP friction                                         (ln_isfcav=T) 
     246&namdrg_top    !   TOP friction                                         (ln_drg_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_drg_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  ***                   !! 
     
    272427!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    273428!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    274 !!   namflo       float parameters                                      ("key_float") 
    275 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    276 !!   namdct       transports through some sections                      ("key_diadct") 
    277 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     429!!   namflo       float parameters                                      (default: OFF) 
     430!!   nam_diadct   transports through some sections                      (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_r11351_fldread_with_XIOS/tests/ISOMIP/MY_SRC/usrdef_hgr.F90

    r10074 r13463  
    1414   !!   usr_def_hgr    : initialize the horizontal mesh for ISOMIP configuration 
    1515   !!---------------------------------------------------------------------- 
    16    USE dom_oce  ,  ONLY: nimpp, njmpp       ! ocean space and time domain 
     16   USE dom_oce 
    1717   USE par_oce         ! ocean space and time domain 
    1818   USE phycst          ! physical constants 
     
    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( 1, 1, 1, 1 ) 
     80         !                       ! longitude   (west coast at lon=0°) 
     81         plamt(ji,jj) = rn_e1deg * (  - 0.5 + REAL( mig0_oldcmp(ji)-1 , wp )  )   
     82         plamu(ji,jj) = rn_e1deg * (          REAL( mig0_oldcmp(ji)-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( mjg0_oldcmp(jj)-1 , wp )  ) - 80._wp 
     87         pphiu(ji,jj) = pphit(ji,jj) 
     88         pphiv(ji,jj) = rn_e2deg * (          REAL( mjg0_oldcmp(jj)-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( 1, 1, 1, 1 ) 
     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_r11351_fldread_with_XIOS/tests/ISOMIP/MY_SRC/usrdef_nam.F90

    r10074 r13463  
    1515   !!   usr_def_hgr   : initialize the horizontal mesh  
    1616   !!---------------------------------------------------------------------- 
    17    USE dom_oce  , ONLY: nimpp , njmpp            ! i- & j-indices of the local domain 
    1817   USE dom_oce  , ONLY: ln_zco, ln_zps, ln_sco   ! flag of type of coordinate 
    1918   USE par_oce        ! ocean space and time domain 
     
    4241CONTAINS 
    4342 
    44    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     43   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4544      !!---------------------------------------------------------------------- 
    4645      !!                     ***  ROUTINE dom_nam  *** 
     
    5453      !! ** input   : - namusr_def namelist found in namelist_cfg 
    5554      !!---------------------------------------------------------------------- 
    56       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    5755      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    5856      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    6058      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    6159      ! 
    62       INTEGER ::   ios, ii   ! Local integer 
     60      INTEGER ::   ios   ! Local integer 
    6361      !! 
    6462      NAMELIST/namusr_def/ ln_zco, ln_zps, ln_sco, rn_e1deg, rn_e2deg, rn_e3 
    6563      !!---------------------------------------------------------------------- 
    6664      ! 
    67       ii = 1 
     65      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
     66902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    6867      ! 
    69       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    70       READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    71 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
    72       ! 
    73       WRITE( ldnam(:), namusr_def ) 
     68      IF(lwm)   WRITE( numond, namusr_def ) 
    7469      ! 
    7570      cd_cfg = 'ISOMIP'           ! name & resolution (not used) 
     
    8176      kpk = INT( rbathy / rn_e3    ) + 1     ! add 1 for t-point in the seafloor 
    8277      ! 
    83       !                             ! control print 
    84       WRITE(ldtxt(ii),*) '   '                                                                              ;   ii = ii + 1 
    85       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'       ;   ii = ii + 1 
    86       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                     ;   ii = ii + 1 
    87       WRITE(ldtxt(ii),*) '   Namelist namusr_def : ISOMIP test case'                                        ;   ii = ii + 1 
    88       WRITE(ldtxt(ii),*) '      type of vertical coordinate : '                                             ;   ii = ii + 1 
    89       WRITE(ldtxt(ii),*) '         z-coordinate flag                     ln_zco   = ', ln_zco               ;   ii = ii + 1 
    90       WRITE(ldtxt(ii),*) '         z-partial-step coordinate flag        ln_zps   = ', ln_zps               ;   ii = ii + 1 
    91       WRITE(ldtxt(ii),*) '         s-coordinate flag                     ln_sco   = ', ln_sco               ;   ii = ii + 1 
    92       WRITE(ldtxt(ii),*) '      resolution'                                                                 ;   ii = ii + 1 
    93       WRITE(ldtxt(ii),*) '         zonal      resolution                 rn_e1deg = ', rn_e1deg, ' degrees' ;   ii = ii + 1 
    94       WRITE(ldtxt(ii),*) '         meridional resolution                 rn_e1deg = ', rn_e1deg, ' degrees' ;   ii = ii + 1 
    95       WRITE(ldtxt(ii),*) '         vertical   resolution                 rn_e3    = ', rn_e3   , ' meters'  ;   ii = ii + 1 
    96       WRITE(ldtxt(ii),*) '      ISOMIP domain = 15° x 10° x 900 m'                                          ;   ii = ii + 1 
    97       WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo   = ', kpi                  ;   ii = ii + 1 
    98       WRITE(ldtxt(ii),*) '                                               jpjglo   = ', kpj                  ;   ii = ii + 1 
    99       WRITE(ldtxt(ii),*) '                                               jpkglo   = ', kpk                  ;   ii = ii + 1 
    100       ! 
    101       ! 
    10278      !                             ! Set the lateral boundary condition of the global domain 
    10379      kperio = 0                    ! ISOMIP configuration : close basin 
    10480      ! 
    105       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    106       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    107       WRITE(ldtxt(ii),*) '      ISOMIP : closed basin                    jperio   = ', kperio             ;   ii = ii + 1 
     81      !                             ! control print 
     82      IF(lwp) THEN 
     83         WRITE(numout,*) '   ' 
     84         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     85         WRITE(numout,*) '~~~~~~~~~~~ ' 
     86         WRITE(numout,*) '   Namelist namusr_def : ISOMIP test case' 
     87         WRITE(numout,*) '      type of vertical coordinate : ' 
     88         WRITE(numout,*) '         z-coordinate flag                     ln_zco   = ', ln_zco 
     89         WRITE(numout,*) '         z-partial-step coordinate flag        ln_zps   = ', ln_zps 
     90         WRITE(numout,*) '         s-coordinate flag                     ln_sco   = ', ln_sco 
     91         WRITE(numout,*) '      resolution' 
     92         WRITE(numout,*) '         zonal      resolution                 rn_e1deg = ', rn_e1deg, ' degrees' 
     93         WRITE(numout,*) '         meridional resolution                 rn_e1deg = ', rn_e1deg, ' degrees' 
     94         WRITE(numout,*) '         vertical   resolution                 rn_e3    = ', rn_e3   , ' meters' 
     95         WRITE(numout,*) '      ISOMIP domain = 15° x 10° x 900 m' 
     96         WRITE(numout,*) '         resulting global domain size :        Ni0glo   = ', kpi 
     97         WRITE(numout,*) '                                               Nj0glo   = ', kpj 
     98         WRITE(numout,*) '                                               jpkglo   = ', kpk 
     99         WRITE(numout,*) '   ' 
     100         WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     101         WRITE(numout,*) '      ISOMIP : closed basin                    jperio   = ', kperio 
     102      ENDIF 
    108103      ! 
    109104   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/ISOMIP/MY_SRC/usrdef_sbc.F90

    r10074 r13463  
    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_r11351_fldread_with_XIOS/tests/ISOMIP/MY_SRC/usrdef_zgr.F90

    r10491 r13463  
    1616   !!--------------------------------------------------------------------- 
    1717   USE oce            ! ocean variables 
    18    USE dom_oce ,  ONLY: mj0   , mj1   , nimpp , njmpp  ! ocean space and time domain 
    19    USE dom_oce ,  ONLY: glamt , gphit                   ! ocean space and time domain 
     18   USE dom_oce ,  ONLY: mj0   , mj1    ! ocean space and time domain 
     19   USE dom_oce ,  ONLY: glamt , gphit  ! ocean space and time domain 
    2020   USE usrdef_nam     ! User defined : namelist variables 
    2121   ! 
     
    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) 
     
    6767      REAL(wp), DIMENSION(jpi,jpj) ::   zht  , zhu         ! bottom depth 
    6868      REAL(wp), DIMENSION(jpi,jpj) ::   zhisf, zhisfu      ! top depth 
    69       REAL(wp), DIMENSION(jpi,jpj) ::   zmsk  
    70       REAL(wp), DIMENSION(jpi,jpj) ::   z2d                ! 2d workspace 
    7169      !!---------------------------------------------------------------------- 
    7270      ! 
     
    8785      !                       !==  isfdraft  ==! 
    8886      ! 
    89       ! the ocean basin surrounded by land (1 grid-point) set through lbc_lnk call as jperio=0  
    90       z2d(:,:) = 1._wp                    ! surface ocean is the 1st level 
    91       CALL lbc_lnk( 'usrdef_zgr', z2d, 'T', 1. )        ! closed basin since jperio = 0 (see userdef_nam.F90) 
    92       zmsk(:,:) = NINT( z2d(:,:) ) 
    93       ! 
    94       ! 
    9587      zht  (:,:) = rbathy  
    9688      zhisf(:,:) = 200._wp 
    97       ij0 = 1 ; ij1 = 40 
     89      ij0 = 1   ;   ij1 = 40+nn_hls 
    9890      DO jj = mj0(ij0), mj1(ij1) 
    9991         zhisf(:,jj)=700.0_wp-(gphit(:,jj)+80.0_wp)*125.0_wp 
    10092      END DO 
    101       zhisf(:,:) = zhisf(:,:) * zmsk(:,:) 
    10293      ! 
    10394      CALL zgr_z1d( pdept_1d, pdepw_1d, pe3t_1d , pe3w_1d )   ! Reference z-coordinate system 
     
    134125            pe3vw(:,:,jk) = pe3w_1d (jk) 
    135126         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) ) 
     127         ! top scale factors and depth at T- and W-points 
     128         DO_2D( 1, 1, 1, 1 ) 
     129            ik = k_top(ji,jj) 
     130            IF ( ik > 2 ) THEN 
     131               ! pdeptw at the interface 
     132               pdepw(ji,jj,ik  ) = MAX( zhisf(ji,jj) , pdepw(ji,jj,ik) ) 
     133               ! e3t in both side of the interface 
    160134               pe3t (ji,jj,ik  ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 
    161                pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik  )  
    162                ! 
     135               ! pdept in both side of the interface (from previous e3t) 
    163136               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          
     137               pdept(ji,jj,ik-1) = pdepw(ji,jj,ik  ) - pe3t (ji,jj,ik  ) * 0.5_wp 
     138               ! pe3w on both side of the interface 
     139               pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik  ) 
     140               pe3w (ji,jj,ik  ) = pdept(ji,jj,ik  ) - pdept(ji,jj,ik-1) 
     141               ! e3t into the ice shelf 
     142               pe3t (ji,jj,ik-1) = pdepw(ji,jj,ik  ) - pdepw(ji,jj,ik-1) 
     143               pe3w (ji,jj,ik-1) = pdept(ji,jj,ik-1) - pdept(ji,jj,ik-2) 
     144            END IF 
     145         END_2D 
     146         ! bottom scale factors and depth at T- and W-points 
     147         DO_2D( 1, 1, 1, 1 ) 
     148            ik = k_bot(ji,jj) 
     149            pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) ) 
     150            pe3t (ji,jj,ik  ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 
     151            pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik  )  
     152            ! 
     153            pdept(ji,jj,ik  ) = pdepw(ji,jj,ik  ) + pe3t (ji,jj,ik  ) * 0.5_wp 
     154            pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp 
     155            pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik) 
     156         END_2D        
    168157         !                                   ! bottom scale factors and depth at  U-, V-, UW and VW-points 
    169158         pe3u (:,:,:) = pe3t(:,:,:) 
    170159         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 
     160         DO_3D( 0, 0, 0, 0, 1, jpk ) 
     161         !                                   ! Computed as the minimum of neighbooring scale factors 
     162            pe3v (ji,jj,jk) = MIN( pe3t(ji,jj,jk), pe3t(ji,jj+1,jk) ) 
     163            pe3vw(ji,jj,jk) = MIN( pe3w(ji,jj,jk), pe3w(ji,jj+1,jk) ) 
     164            pe3f (ji,jj,jk) = pe3v(ji,jj,jk) 
     165         END_3D 
    180166         CALL lbc_lnk( 'usrdef_zgr', pe3v , 'V', 1._wp )   ;   CALL lbc_lnk( 'usrdef_zgr', pe3vw, 'V', 1._wp ) 
    181167         CALL lbc_lnk( 'usrdef_zgr', pe3f , 'F', 1._wp ) 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/context_nemo.xml

    r9930 r13463  
    55--> 
    66<context id="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"/> 
    3436 
    3537</context> 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_flux_cen2_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_flux_ubs_cfg

    r10075 r13463  
    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   ! 
     
    112110!!                                                                    !! 
    113111!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    114 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    115 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     112!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     113!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    116114!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    117115!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    121119&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    122120!----------------------------------------------------------------------- 
    123    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     121   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    124122/ 
    125123!!====================================================================== 
     
    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!----------------------------------------------------------------------- 
     
    277275!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    278276!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    279 !!   namflo       float parameters                                      ("key_float") 
    280 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    281 !!   namdct       transports through some sections                      ("key_diadct") 
    282 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     277!!   namflo       float parameters                                      (default: OFF) 
     278!!   nam_diadct   transports through some sections                      (default: OFF) 
    283279!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    284280!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_eenH_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_een_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_ene_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_ens_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_flux_cen2_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_flux_ubs_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_eenH_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_een_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_ene_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_ens_cfg

    r10075 r13463  
    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   ! 
     
    6765&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    6866!----------------------------------------------------------------------- 
    69    ln_OFF     = .true.    !  free-slip       : Cd = 0                   
     67   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7068/ 
    7169!----------------------------------------------------------------------- 
     
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/MY_SRC/usrdef_hgr.F90

    r10074 r13463  
    1313   !!   usr_def_hgr    : initialize the horizontal mesh for LOCK_EXCHANGE configuration 
    1414   !!---------------------------------------------------------------------- 
    15    USE dom_oce  ,  ONLY: nimpp, njmpp       ! ocean space and time domain 
     15   USE dom_oce 
    1616   USE par_oce         ! ocean space and time domain 
    1717   USE phycst          ! physical constants 
     
    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( 1, 1, 1, 1 ) 
     77         !                       ! longitude 
     78         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0_oldcmp(ji)-1 , wp )  )   
     79         plamu(ji,jj) = zfact * (          REAL( mig0_oldcmp(ji)-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( mjg0_oldcmp(jj)-1 , wp )  ) 
     84         pphiu(ji,jj) = pphit(ji,jj) 
     85         pphiv(ji,jj) = zfact * (          REAL( mjg0_oldcmp(jj)-1 , wp )  ) 
     86         pphif(ji,jj) = pphiv(ji,jj) 
     87      END_2D 
    8788      ! 
    8889      !                       !==  Horizontal scale factors  ==!   (in meters)  
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/MY_SRC/usrdef_istate.F90

    r10074 r13463  
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/MY_SRC/usrdef_nam.F90

    r10074 r13463  
    1414   !!   usr_def_hgr   : initialize the horizontal mesh  
    1515   !!---------------------------------------------------------------------- 
    16    USE dom_oce  , ONLY: nimpp , njmpp            ! i- & j-indices of the local domain 
    1716   USE par_oce        ! ocean space and time domain 
    1817   USE phycst         ! physical constants 
     
    3837CONTAINS 
    3938 
    40    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     39   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4140      !!---------------------------------------------------------------------- 
    4241      !!                     ***  ROUTINE dom_nam  *** 
     
    5049      !! ** input   : - namusr_def namelist found in namelist_cfg 
    5150      !!---------------------------------------------------------------------- 
    52       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    5351      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    5452      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    5654      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    5755      ! 
    58       INTEGER ::   ios, ii   ! Local integer 
     56      INTEGER ::   ios   ! Local integer 
    5957      !! 
    6058      NAMELIST/namusr_def/ rn_dx, rn_dz 
    6159      !!---------------------------------------------------------------------- 
    6260      ! 
    63       ii = 1 
     61      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
     62902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    6463      ! 
    65       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    66       READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    67 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
    68       ! 
    69       WRITE( ldnam(:), namusr_def ) 
     64      IF(lwm)   WRITE( numond, namusr_def ) 
    7065      ! 
    7166      ! 
     
    7772      kpj = 3 
    7873      kpk = INT(  20.  / rn_dz ) + 1 
    79       ! 
    80       !                             ! control print 
    81       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    82       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    83       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    84       WRITE(ldtxt(ii),*) '   Namelist namusr_def : LOCK_EXCHANGE test case'                             ;   ii = ii + 1 
    85       WRITE(ldtxt(ii),*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'   ;   ii = ii + 1 
    86       WRITE(ldtxt(ii),*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters'   ;   ii = ii + 1 
    87       WRITE(ldtxt(ii),*) '      LOCK_EXCHANGE domain = 64 km  x  3 grid-points  x  20 m'                ;   ii = ii + 1 
    88       WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo = ', kpi                ;   ii = ii + 1 
    89       WRITE(ldtxt(ii),*) '                                               jpjglo = ', kpj                ;   ii = ii + 1 
    90       WRITE(ldtxt(ii),*) '                                               jpkglo = ', kpk                ;   ii = ii + 1 
    91       ! 
    9274      !                             ! Set the lateral boundary condition of the global domain 
    9375      kperio = 0                    ! LOCK_EXCHANGE configuration : closed domain 
    9476      ! 
    95       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    96       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    97       WRITE(ldtxt(ii),*) '      closed                                   jperio = ', kperio             ;   ii = ii + 1 
     77      !                             ! control print 
     78      IF(lwp) THEN 
     79         WRITE(numout,*) '   ' 
     80         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     81         WRITE(numout,*) '~~~~~~~~~~~ ' 
     82         WRITE(numout,*) '   Namelist namusr_def : LOCK_EXCHANGE test case' 
     83         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters' 
     84         WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters' 
     85         WRITE(numout,*) '      LOCK_EXCHANGE domain = 64 km  x  3 grid-points  x  20 m' 
     86         WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     87         WRITE(numout,*) '                                               Nj0glo = ', kpj 
     88         WRITE(numout,*) '                                               jpkglo = ', kpk 
     89         WRITE(numout,*) '   ' 
     90         WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     91         WRITE(numout,*) '      closed                                   jperio = ', kperio 
     92      ENDIF 
    9893      ! 
    9994   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/MY_SRC/usrdef_sbc.F90

    r10074 r13463  
    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_r11351_fldread_with_XIOS/tests/LOCK_EXCHANGE/MY_SRC/usrdef_zgr.F90

    r10425 r13463  
    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_r11351_fldread_with_XIOS/tests/OVERFLOW/EXPREF/context_nemo.xml

    r9930 r13463  
    55--> 
    66<context id="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"/> 
    3436 
    3537</context> 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/OVERFLOW/EXPREF/namelist_sco_FCT2_flux_cen-ahm1000_cfg

    r10075 r13463  
    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/ 
     
    7171&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    7272!----------------------------------------------------------------------- 
    73    ln_OFF     = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
     73   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7474   ln_lin     = .false.    !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top) 
    7575   ln_non_lin = .false.    !  non-linear  drag: Cd = Cd0 |U| 
     
    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_r11351_fldread_with_XIOS/tests/OVERFLOW/EXPREF/namelist_sco_FCT2_flux_ubs_cfg

    r10075 r13463  
    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/ 
     
    7171&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    7272!----------------------------------------------------------------------- 
    73    ln_OFF    = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
     73   ln_drg_OFF = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7474   ln_lin     = .false.    !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top) 
    7575   ln_non_lin = .false.    !  non-linear  drag: Cd = Cd0 |U| 
     
    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_r11351_fldread_with_XIOS/tests/OVERFLOW/EXPREF/namelist_sco_FCT4_flux_cen-ahm1000_cfg

    r10075 r13463  
    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/ 
     
    7171&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    7272!----------------------------------------------------------------------- 
    73    ln_OFF     = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
     73   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7474   ln_lin     = .false.    !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top) 
    7575   ln_non_lin = .false.    !  non-linear  drag: Cd = Cd0 |U| 
     
    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_r11351_fldread_with_XIOS/tests/OVERFLOW/EXPREF/namelist_sco_FCT4_flux_ubs_cfg

    r10075 r13463  
    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/ 
     
    7171&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    7272!----------------------------------------------------------------------- 
    73    ln_OFF     = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
     73   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7474   ln_lin     = .false.    !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top) 
    7575   ln_non_lin = .false.    !  non-linear  drag: Cd = Cd0 |U| 
     
    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_r11351_fldread_with_XIOS/tests/OVERFLOW/EXPREF/namelist_zps_FCT2_flux_ubs_cfg

    r10075 r13463  
    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/ 
     
    7171&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    7272!----------------------------------------------------------------------- 
    73    ln_OFF     = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
     73   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7474   ln_lin     = .false.    !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top) 
    7575   ln_non_lin = .false.    !  non-linear  drag: Cd = Cd0 |U| 
     
    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_r11351_fldread_with_XIOS/tests/OVERFLOW/EXPREF/namelist_zps_FCT4_flux_ubs_cfg

    r10075 r13463  
    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/ 
     
    106105!!                                                                    !! 
    107106!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    108 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    109 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     107!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     108!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    110109!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    111110!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    115114&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    116115!----------------------------------------------------------------------- 
    117    ln_OFF    = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
     116   ln_drg_OFF = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    118117   ln_lin     = .false.    !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top) 
    119118   ln_non_lin = .false.    !  non-linear  drag: Cd = Cd0 |U| 
     
    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) 
     
    291293!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    292294!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    293 !!   namflo       float parameters                                      ("key_float") 
    294 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    295 !!   namdct       transports through some sections                      ("key_diadct") 
    296 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     295!!   namflo       float parameters                                      (default: OFF) 
     296!!   nam_diadct   transports through some sections                      (default: OFF) 
    297297!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    298298!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/OVERFLOW/EXPREF/namelist_zps_FCT4_vect_een_cfg

    r10075 r13463  
    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/ 
     
    7171&namdrg            !   top/bottom drag coefficient                      (default: NO selection) 
    7272!----------------------------------------------------------------------- 
    73    ln_OFF     = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
     73   ln_drg_OFF = .true.    !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    7474   ln_lin     = .false.    !      linear  drag: Cd = Cd0 Uc0                   &   namdrg_top) 
    7575   ln_non_lin = .false.    !  non-linear  drag: Cd = Cd0 |U| 
     
    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_r11351_fldread_with_XIOS/tests/OVERFLOW/MY_SRC/usrdef_hgr.F90

    r10074 r13463  
    1313   !!   usr_def_hgr    : initialize the horizontal mesh for OVERFLOW configuration 
    1414   !!---------------------------------------------------------------------- 
    15    USE dom_oce  ,  ONLY: nimpp, njmpp       ! ocean space and time domain 
     15   USE dom_oce 
    1616   USE par_oce         ! ocean space and time domain 
    1717   USE phycst          ! physical constants 
     
    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( 1, 1, 1, 1 ) 
     77         !                       ! longitude 
     78         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0_oldcmp(ji)-1 , wp )  )   
     79         plamu(ji,jj) = zfact * (          REAL( mig0_oldcmp(ji)-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( mjg0_oldcmp(jj)-1 , wp )  ) 
     84         pphiu(ji,jj) = pphit(ji,jj) 
     85         pphiv(ji,jj) = zfact * (          REAL( mjg0_oldcmp(jj)-1 , wp )  ) 
     86         pphif(ji,jj) = pphiv(ji,jj) 
     87      END_2D 
    8788      ! 
    8889      !                       !==  Horizontal scale factors  ==!   (in meters)  
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/OVERFLOW/MY_SRC/usrdef_istate.F90

    r10074 r13463  
    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_r11351_fldread_with_XIOS/tests/OVERFLOW/MY_SRC/usrdef_nam.F90

    r10074 r13463  
    1414   !!   usr_def_hgr   : initialize the horizontal mesh  
    1515   !!---------------------------------------------------------------------- 
    16    USE dom_oce  , ONLY: nimpp , njmpp            ! i- & j-indices of the local domain 
    1716   USE dom_oce  , ONLY: ln_zco, ln_zps, ln_sco   ! flag of type of coordinate 
    1817   USE par_oce        ! ocean space and time domain 
     
    3938CONTAINS 
    4039 
    41    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     40   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4241      !!---------------------------------------------------------------------- 
    4342      !!                     ***  ROUTINE dom_nam  *** 
     
    5150      !! ** input   : - namusr_def namelist found in namelist_cfg 
    5251      !!---------------------------------------------------------------------- 
    53       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    5452      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    5553      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    5755      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    5856      ! 
    59       INTEGER ::   ios, ii   ! Local integer 
     57      INTEGER ::   ios   ! Local integer 
    6058      !! 
    6159      NAMELIST/namusr_def/ ln_zco, ln_zps, ln_sco, rn_dx, rn_dz 
    6260      !!---------------------------------------------------------------------- 
    6361      ! 
    64       ii = 1 
     62      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
     63902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    6564      ! 
    66       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    67       READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    68 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
    69       ! 
    70       WRITE( ldnam(:), namusr_def ) 
     65      IF(lwm)   WRITE( numond, namusr_def ) 
    7166      ! 
    7267      cd_cfg = 'OVERFLOW'           ! name & resolution (not used) 
     
    7974      ! 
    8075      !                             ! control print 
    81       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    82       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    83       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    84       WRITE(ldtxt(ii),*) '   Namelist namusr_def : OVERFLOW test case'                                  ;   ii = ii + 1 
    85       WRITE(ldtxt(ii),*) '      type of vertical coordinate : '                                         ;   ii = ii + 1 
    86       WRITE(ldtxt(ii),*) '         z-coordinate flag                     ln_zco = ', ln_zco             ;   ii = ii + 1 
    87       WRITE(ldtxt(ii),*) '         z-partial-step coordinate flag        ln_zps = ', ln_zps             ;   ii = ii + 1 
    88       WRITE(ldtxt(ii),*) '         s-coordinate flag                     ln_sco = ', ln_sco             ;   ii = ii + 1 
    89       WRITE(ldtxt(ii),*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'   ;   ii = ii + 1 
    90       WRITE(ldtxt(ii),*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters'   ;   ii = ii + 1 
    91       WRITE(ldtxt(ii),*) '      OVERFLOW domain = 200 km x 3 grid-points x 2000 m'                      ;   ii = ii + 1 
    92       WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo = ', kpi                ;   ii = ii + 1 
    93       WRITE(ldtxt(ii),*) '                                               jpjglo = ', kpj                ;   ii = ii + 1 
    94       WRITE(ldtxt(ii),*) '                                               jpkglo = ', kpk                ;   ii = ii + 1 
     76      WRITE(numout,*) '   ' 
     77      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     78      WRITE(numout,*) '~~~~~~~~~~~ ' 
     79      WRITE(numout,*) '   Namelist namusr_def : OVERFLOW test case' 
     80      WRITE(numout,*) '      type of vertical coordinate : ' 
     81      WRITE(numout,*) '         z-coordinate flag                     ln_zco = ', ln_zco 
     82      WRITE(numout,*) '         z-partial-step coordinate flag        ln_zps = ', ln_zps 
     83      WRITE(numout,*) '         s-coordinate flag                     ln_sco = ', ln_sco 
     84      WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters' 
     85      WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters' 
     86      WRITE(numout,*) '      OVERFLOW domain = 200 km x 3 grid-points x 2000 m' 
     87      WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi 
     88      WRITE(numout,*) '                                               Nj0glo = ', kpj 
     89      WRITE(numout,*) '                                               jpkglo = ', kpk 
    9590      ! 
    9691      !                             ! Set the lateral boundary condition of the global domain 
    9792      kperio = 0                    ! OVERFLOW configuration : close basin 
    9893      ! 
    99       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    100       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    101       WRITE(ldtxt(ii),*) '      OVERFLOW : closed basin                  jperio = ', kperio             ;   ii = ii + 1 
     94      WRITE(numout,*) '   ' 
     95      WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     96      WRITE(numout,*) '      OVERFLOW : closed basin                  jperio = ', kperio 
    10297      ! 
    10398   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/OVERFLOW/MY_SRC/usrdef_sbc.F90

    r10074 r13463  
    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_r11351_fldread_with_XIOS/tests/OVERFLOW/MY_SRC/usrdef_zgr.F90

    r11077 r13463  
    1515   !!--------------------------------------------------------------------- 
    1616   USE oce            ! ocean variables 
    17    USE dom_oce ,  ONLY: mi0, mi1, nimpp, njmpp   ! ocean space and time domain 
    18    USE dom_oce ,  ONLY: glamt                    ! ocean space and time domain 
     17   USE dom_oce ,  ONLY: mi0, mi1   ! ocean space and time domain 
     18   USE dom_oce ,  ONLY: glamt      ! ocean space and time domain 
    1919   USE usrdef_nam     ! User defined : namelist variables 
    2020   ! 
     
    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( 1, 1, 1, 1 ) 
     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_r11351_fldread_with_XIOS/tests/README.rst

    r10605 r13463  
    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 
     207 
     208CPL_OASIS 
     209--------- 
     210| This test case checks the OASIS interface in OCE/SBC, allowing to set up  
     211a coupled configuration through OASIS. See CPL_OASIS/README.md for more information. 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/VORTEX/EXPREF/1_context_nemo.xml

    r9930 r13463  
    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_r11351_fldread_with_XIOS/tests/VORTEX/EXPREF/1_namelist_cfg

    r10075 r13463  
    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/ 
     
    9898&namagrif      !  AGRIF zoom                                            ("key_agrif") 
    9999!----------------------------------------------------------------------- 
    100    ln_spc_dyn    = .true.  !  use 0 as special value for dynamics 
    101    rn_sponge_tra =  800.   !  coefficient for tracer   sponge layer [m2/s] 
    102    rn_sponge_dyn =  800.   !  coefficient for dynamics sponge layer [m2/s] 
    103    ln_chk_bathy  = .FALSE. ! 
     100   rn_sponge_tra =  0.00768   !  coefficient for tracer   sponge layer [] 
     101   rn_sponge_dyn =  0.00768   !  coefficient for dynamics sponge layer [] 
    104102/ 
    105103!!====================================================================== 
     
    107105!!                                                                    !! 
    108106!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    109 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    110 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     107!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     108!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    111109!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    112110!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    116114&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    117115!----------------------------------------------------------------------- 
    118    ln_OFF     = .true.    !  free-slip       : Cd = 0 
     116   ln_drg_OFF = .true.     !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    119117/ 
    120118!!====================================================================== 
     
    213211      ln_bt_av      = .true.     ! Time filtering of barotropic variables 
    214212         nn_bt_flt     = 1          ! Time filter choice  = 0 None 
    215          !                          !                     = 1 Boxcar over   nn_baro sub-steps 
    216          !                          !                     = 2 Boxcar over 2*nn_baro  "    " 
     213         !                          !                     = 1 Boxcar over   nn_e sub-steps 
     214         !                          !                     = 2 Boxcar over 2*nn_e  "    " 
    217215      ln_bt_auto    = .false.    ! Number of sub-step defined from: 
    218          nn_baro      =  24         ! =F : the number of sub-step in rn_rdt seconds 
     216         nn_e      =  24         ! =F : the number of sub-step in rn_Dt seconds 
    219217/ 
    220218!----------------------------------------------------------------------- 
     
    272270!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    273271!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    274 !!   namflo       float parameters                                      ("key_float") 
    275 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    276 !!   namdct       transports through some sections                      ("key_diadct") 
    277 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     272!!   namflo       float parameters                                      (default: OFF) 
     273!!   nam_diadct   transports through some sections                      (default: OFF) 
    278274!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    279275!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/VORTEX/EXPREF/context_nemo.xml

    r9930 r13463  
    55--> 
    66<context id="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"/> 
    3436 
    3537</context> 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/VORTEX/EXPREF/namelist_cfg

    r10075 r13463  
    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/ 
     
    9999!!                                                                    !! 
    100100!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    101 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    102 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     101!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     102!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    103103!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    104104!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    108108&namdrg        !   top/bottom drag coefficient                          (default: NO selection) 
    109109!----------------------------------------------------------------------- 
    110    ln_OFF     = .true.    !  free-slip       : Cd = 0 
     110   ln_drg_OFF  = .true.   !  free-slip       : Cd = 0                  (F => fill namdrg_bot 
    111111/ 
    112112!!====================================================================== 
     
    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!----------------------------------------------------------------------- 
     
    263263!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    264264!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    265 !!   namflo       float parameters                                      ("key_float") 
    266 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    267 !!   namdct       transports through some sections                      ("key_diadct") 
    268 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     265!!   namflo       float parameters                                      (default: OFF) 
     266!!   nam_diadct   transports through some sections                      (default: OFF) 
    269267!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    270268!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/VORTEX/MY_SRC/domvvl.F90

    r10572 r13463  
    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 
     11   !!            4.x  ! 2020-02  (G. Madec, S. Techene) introduce ssh to h0 ratio 
    1012   !!---------------------------------------------------------------------- 
    1113 
    12    !!---------------------------------------------------------------------- 
    13    !!   dom_vvl_init     : define initial vertical scale factors, depths and column thickness 
    14    !!   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_interpol : Interpolate vertical scale factors from one grid point to another 
    17    !!   dom_vvl_rst      : read/write restart file 
    18    !!   dom_vvl_ctl      : Check the vvl options 
    19    !!---------------------------------------------------------------------- 
    2014   USE oce             ! ocean dynamics and tracers 
    2115   USE phycst          ! physical constant 
     
    3529   PRIVATE 
    3630 
    37    PUBLIC  dom_vvl_init       ! called by domain.F90 
    38    PUBLIC  dom_vvl_sf_nxt     ! called by step.F90 
    39    PUBLIC  dom_vvl_sf_swp     ! called by step.F90 
    40    PUBLIC  dom_vvl_interpol   ! called by dynnxt.F90 
    41  
    4231   !                                                      !!* Namelist nam_vvl 
    4332   LOGICAL , PUBLIC :: ln_vvl_zstar           = .FALSE.    ! zstar  vertical coordinate 
     
    6150   REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:)   :: frq_rst_hdv                 ! retoring period for low freq. divergence 
    6251 
     52#if defined key_qco 
     53   !!---------------------------------------------------------------------- 
     54   !!   'key_qco'      EMPTY MODULE      Quasi-Eulerian vertical coordonate 
     55   !!---------------------------------------------------------------------- 
     56#else 
     57   !!---------------------------------------------------------------------- 
     58   !!   Default key      Old management of time varying vertical coordinate 
     59   !!---------------------------------------------------------------------- 
     60    
     61   !!---------------------------------------------------------------------- 
     62   !!   dom_vvl_init     : define initial vertical scale factors, depths and column thickness 
     63   !!   dom_vvl_sf_nxt   : Compute next vertical scale factors 
     64   !!   dom_vvl_sf_update   : Swap vertical scale factors and update the vertical grid 
     65   !!   dom_vvl_interpol : Interpolate vertical scale factors from one grid point to another 
     66   !!   dom_vvl_rst      : read/write restart file 
     67   !!   dom_vvl_ctl      : Check the vvl options 
     68   !!---------------------------------------------------------------------- 
     69 
     70   PUBLIC  dom_vvl_init       ! called by domain.F90 
     71   PUBLIC  dom_vvl_zgr        ! called by isfcpl.F90 
     72   PUBLIC  dom_vvl_sf_nxt     ! called by step.F90 
     73   PUBLIC  dom_vvl_sf_update  ! called by step.F90 
     74   PUBLIC  dom_vvl_interpol   ! called by dynnxt.F90 
     75    
    6376   !! * Substitutions 
    64 #  include "vectopt_loop_substitute.h90" 
     77#  include "do_loop_substitute.h90" 
    6578   !!---------------------------------------------------------------------- 
    6679   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    93106 
    94107 
    95    SUBROUTINE dom_vvl_init 
     108   SUBROUTINE dom_vvl_init( Kbb, Kmm, Kaa ) 
    96109      !!---------------------------------------------------------------------- 
    97110      !!                ***  ROUTINE dom_vvl_init  *** 
     
    102115      !! ** Method  :  - use restart file and/or initialize 
    103116      !!               - interpolate scale factors 
     117      !! 
     118      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     119      !!              - Regrid: e3[u/v](:,:,:,Kmm) 
     120      !!                        e3[u/v](:,:,:,Kmm)        
     121      !!                        e3w(:,:,:,Kmm)            
     122      !!                        e3[u/v]w_b 
     123      !!                        e3[u/v]w_n       
     124      !!                        gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm) and gde3w 
     125      !!              - h(t/u/v)_0 
     126      !!              - frq_rst_e3t and frq_rst_hdv 
     127      !! 
     128      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
     129      !!---------------------------------------------------------------------- 
     130      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     131      ! 
     132      IF(lwp) WRITE(numout,*) 
     133      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
     134      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
     135      ! 
     136      CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
     137      ! 
     138      !                    ! Allocate module arrays 
     139      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
     140      ! 
     141      !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
     142      CALL dom_vvl_rst( nit000, Kbb, Kmm, 'READ' ) 
     143      e3t(:,:,jpk,Kaa) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
     144      ! 
     145      CALL dom_vvl_zgr(Kbb, Kmm, Kaa) ! interpolation scale factor, depth and water column 
     146      ! 
     147   END SUBROUTINE dom_vvl_init 
     148 
     149 
     150   SUBROUTINE dom_vvl_zgr(Kbb, Kmm, Kaa) 
     151      !!---------------------------------------------------------------------- 
     152      !!                ***  ROUTINE dom_vvl_init  *** 
     153      !!                    
     154      !! ** Purpose :  Interpolation of all scale factors,  
     155      !!               depths and water column heights 
     156      !! 
     157      !! ** Method  :  - interpolate scale factors 
    104158      !! 
    105159      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     
    115169      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
    116170      !!---------------------------------------------------------------------- 
     171      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     172      !!---------------------------------------------------------------------- 
    117173      INTEGER ::   ji, jj, jk 
    118174      INTEGER ::   ii0, ii1, ij0, ij1 
     
    120176      !!---------------------------------------------------------------------- 
    121177      ! 
    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       ! 
    135178      !                    !== Set of all other vertical scale factors  ==!  (now and before) 
    136179      !                                ! 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 
     180      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3u(:,:,:,Kbb), 'U' )    ! from T to U 
     181      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3u(:,:,:,Kmm), 'U' ) 
     182      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3v(:,:,:,Kbb), 'V' )    ! from T to V  
     183      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3v(:,:,:,Kmm), 'V' ) 
     184      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F' )    ! from U to F 
    142185      !                                ! 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' ) 
     186      CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3w (:,:,:,Kmm), 'W'  )  ! from T to W 
     187      CALL dom_vvl_interpol( e3t(:,:,:,Kbb), e3w (:,:,:,Kbb), 'W'  ) 
     188      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3uw(:,:,:,Kmm), 'UW' )  ! from U to UW 
     189      CALL dom_vvl_interpol( e3u(:,:,:,Kbb), e3uw(:,:,:,Kbb), 'UW' ) 
     190      CALL dom_vvl_interpol( e3v(:,:,:,Kmm), e3vw(:,:,:,Kmm), 'VW' )  ! from V to UW 
     191      CALL dom_vvl_interpol( e3v(:,:,:,Kbb), e3vw(:,:,:,Kbb), 'VW' ) 
    149192 
    150193      ! 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(:,:,:) 
     194      e3t(:,:,:,Kaa) = e3t(:,:,:,Kmm) 
     195      e3u(:,:,:,Kaa) = e3u(:,:,:,Kmm) 
     196      e3v(:,:,:,Kaa) = e3v(:,:,:,Kmm) 
    154197      ! 
    155198      !                    !==  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 
     199      gdept(:,:,1,Kmm) = 0.5_wp * e3w(:,:,1,Kmm)       ! reference to the ocean surface (used for MLD and light penetration) 
     200      gdepw(:,:,1,Kmm) = 0.0_wp 
     201      gde3w(:,:,1) = gdept(:,:,1,Kmm) - ssh(:,:,Kmm)  ! reference to a common level z=0 for hpg 
     202      gdept(:,:,1,Kbb) = 0.5_wp * e3w(:,:,1,Kbb) 
     203      gdepw(:,:,1,Kbb) = 0.0_wp 
     204      DO_3D( 1, 1, 1, 1, 2, jpk ) 
     205         !    zcoef = tmask - wmask    ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     206         !                             ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 
     207         !                             ! 0.5 where jk = mikt      
     208!!gm ???????   BUG ?  gdept(:,:,:,Kmm) as well as gde3w  does not include the thickness of ISF ?? 
     209         zcoef = ( tmask(ji,jj,jk) - wmask(ji,jj,jk) ) 
     210         gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 
     211         gdept(ji,jj,jk,Kmm) =      zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm))  & 
     212            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm))  
     213         gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 
     214         gdepw(ji,jj,jk,Kbb) = gdepw(ji,jj,jk-1,Kbb) + e3t(ji,jj,jk-1,Kbb) 
     215         gdept(ji,jj,jk,Kbb) =      zcoef  * ( gdepw(ji,jj,jk  ,Kbb) + 0.5 * e3w(ji,jj,jk,Kbb))  & 
     216            &                + (1-zcoef) * ( gdept(ji,jj,jk-1,Kbb) +       e3w(ji,jj,jk,Kbb))  
     217      END_3D 
     218      ! 
     219      !                    !==  thickness of the water column  !!   (ocean portion only) 
     220      ht(:,:) = e3t(:,:,1,Kmm) * tmask(:,:,1)   !!gm  BUG  :  this should be 1/2 * e3w(k=1) .... 
     221      hu(:,:,Kbb) = e3u(:,:,1,Kbb) * umask(:,:,1) 
     222      hu(:,:,Kmm) = e3u(:,:,1,Kmm) * umask(:,:,1) 
     223      hv(:,:,Kbb) = e3v(:,:,1,Kbb) * vmask(:,:,1) 
     224      hv(:,:,Kmm) = e3v(:,:,1,Kmm) * vmask(:,:,1) 
     225      DO jk = 2, jpkm1 
     226         ht(:,:) = ht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
     227         hu(:,:,Kbb) = hu(:,:,Kbb) + e3u(:,:,jk,Kbb) * umask(:,:,jk) 
     228         hu(:,:,Kmm) = hu(:,:,Kmm) + e3u(:,:,jk,Kmm) * umask(:,:,jk) 
     229         hv(:,:,Kbb) = hv(:,:,Kbb) + e3v(:,:,jk,Kbb) * vmask(:,:,jk) 
     230         hv(:,:,Kmm) = hv(:,:,Kmm) + e3v(:,:,jk,Kmm) * vmask(:,:,jk) 
    178231      END DO 
    179232      ! 
    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       ! 
    194233      !                    !==  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(:,:) ) 
     234      r1_hu(:,:,Kbb) = ssumask(:,:) / ( hu(:,:,Kbb) + 1._wp - ssumask(:,:) )    ! _i mask due to ISF 
     235      r1_hu(:,:,Kmm) = ssumask(:,:) / ( hu(:,:,Kmm) + 1._wp - ssumask(:,:) ) 
     236      r1_hv(:,:,Kbb) = ssvmask(:,:) / ( hv(:,:,Kbb) + 1._wp - ssvmask(:,:) ) 
     237      r1_hv(:,:,Kmm) = ssvmask(:,:) / ( hv(:,:,Kmm) + 1._wp - ssvmask(:,:) ) 
    199238 
    200239      !                    !==   z_tilde coordinate case  ==!   (Restoring frequencies) 
     
    208247         IF( ln_vvl_ztilde_as_zstar ) THEN   ! z-star emulation using z-tile 
    209248            frq_rst_e3t(:,:) = 0._wp               !Ignore namelist settings 
    210             frq_rst_hdv(:,:) = 1._wp / rdt 
     249            frq_rst_hdv(:,:) = 1._wp / rn_Dt 
    211250         ENDIF 
    212251         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 
     252            DO_2D( 1, 1, 1, 1 ) 
    215253!!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 
     254               IF( ABS(gphit(ji,jj)) >= 6.) THEN 
     255                  ! values outside the equatorial band and transition zone (ztilde) 
     256                  frq_rst_e3t(ji,jj) =  2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.e0_wp ) 
     257                  frq_rst_hdv(ji,jj) =  2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.e0_wp ) 
     258               ELSEIF( ABS(gphit(ji,jj)) <= 2.5) THEN    ! Equator strip ==> z-star 
     259                  ! values inside the equatorial band (ztilde as zstar) 
     260                  frq_rst_e3t(ji,jj) =  0.0_wp 
     261                  frq_rst_hdv(ji,jj) =  1.0_wp / rn_Dt 
     262               ELSE                                      ! transition band (2.5 to 6 degrees N/S) 
     263                  !                                      ! (linearly transition from z-tilde to z-star) 
     264                  frq_rst_e3t(ji,jj) = 0.0_wp + (frq_rst_e3t(ji,jj)-0.0_wp)*0.5_wp   & 
     265                     &            * (  1.0_wp - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     266                     &                                          * 180._wp / 3.5_wp ) ) 
     267                  frq_rst_hdv(ji,jj) = (1.0_wp / rn_Dt)                                & 
     268                     &            + (  frq_rst_hdv(ji,jj)-(1.e0_wp / rn_Dt) )*0.5_wp   & 
     269                     &            * (  1._wp  - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     270                     &                                          * 180._wp / 3.5_wp ) ) 
     271               ENDIF 
     272            END_2D 
    236273            IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN 
    237274               IF( nn_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2 
    238                   ii0 = 103   ;   ii1 = 111        
    239                   ij0 = 128   ;   ij1 = 135   ;    
     275                  ii0 = 103 + nn_hls - 1   ;   ii1 = 111 + nn_hls - 1       
     276                  ij0 = 128 + nn_hls       ;   ij1 = 135 + nn_hls 
    240277                  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 
     278                  frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rn_Dt 
    242279               ENDIF 
    243280            ENDIF 
     
    263300      ENDIF 
    264301      ! 
    265    END SUBROUTINE dom_vvl_init 
    266  
    267  
    268    SUBROUTINE dom_vvl_sf_nxt( kt, kcall )  
     302   END SUBROUTINE dom_vvl_zgr 
     303 
     304 
     305   SUBROUTINE dom_vvl_sf_nxt( kt, Kbb, Kmm, Kaa, kcall )  
    269306      !!---------------------------------------------------------------------- 
    270307      !!                ***  ROUTINE dom_vvl_sf_nxt  *** 
     
    288325      !! Reference  : Leclair, M., and Madec, G. 2011, Ocean Modelling. 
    289326      !!---------------------------------------------------------------------- 
    290       INTEGER, INTENT( in )           ::   kt      ! time step 
    291       INTEGER, INTENT( in ), OPTIONAL ::   kcall   ! optional argument indicating call sequence 
     327      INTEGER, INTENT( in )           ::   kt             ! time step 
     328      INTEGER, INTENT( in )           ::   Kbb, Kmm, Kaa  ! time step 
     329      INTEGER, INTENT( in ), OPTIONAL ::   kcall          ! optional argument indicating call sequence 
    292330      ! 
    293331      INTEGER                ::   ji, jj, jk            ! dummy loop indices 
    294332      INTEGER , DIMENSION(3) ::   ijk_max, ijk_min      ! temporary integers 
    295       REAL(wp)               ::   z2dt, z_tmin, z_tmax  ! local scalars 
     333      REAL(wp)               ::   z_tmin, z_tmax        ! local scalars 
    296334      LOGICAL                ::   ll_do_bclinic         ! local logical 
    297335      REAL(wp), DIMENSION(jpi,jpj)     ::   zht, z_scale, zwu, zwv, zhdiv 
    298       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ze3t 
     336      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ze3t 
     337      LOGICAL , DIMENSION(:,:,:), ALLOCATABLE ::   llmsk 
    299338      !!---------------------------------------------------------------------- 
    300339      ! 
     
    321360      !                                                ! --------------------------------------------- ! 
    322361      ! 
    323       z_scale(:,:) = ( ssha(:,:) - sshb(:,:) ) * ssmask(:,:) / ( ht_0(:,:) + sshn(:,:) + 1. - ssmask(:,:) ) 
     362      z_scale(:,:) = ( ssh(:,:,Kaa) - ssh(:,:,Kbb) ) * ssmask(:,:) / ( ht_0(:,:) + ssh(:,:,Kmm) + 1. - ssmask(:,:) ) 
    324363      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) 
     364         ! formally this is the same as e3t(:,:,:,Kaa) = e3t_0*(1+ssha/ht_0) 
     365         e3t(:,:,jk,Kaa) = e3t(:,:,jk,Kbb) + e3t(:,:,jk,Kmm) * z_scale(:,:) * tmask(:,:,jk) 
    327366      END DO 
    328367      ! 
    329       IF( ln_vvl_ztilde .OR. ln_vvl_layer .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
    330          !                                                            ! ------baroclinic part------ ! 
     368      IF( (ln_vvl_ztilde .OR. ln_vvl_layer) .AND. ll_do_bclinic ) THEN   ! z_tilde or layer coordinate ! 
     369         !                                                               ! ------baroclinic part------ ! 
    331370         ! I - initialization 
    332371         ! ================== 
     
    337376         zht(:,:)   = 0._wp 
    338377         DO jk = 1, jpkm1 
    339             zhdiv(:,:) = zhdiv(:,:) + e3t_n(:,:,jk) * hdivn(:,:,jk) 
    340             zht  (:,:) = zht  (:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     378            zhdiv(:,:) = zhdiv(:,:) + e3t(:,:,jk,Kmm) * hdiv(:,:,jk) 
     379            zht  (:,:) = zht  (:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    341380         END DO 
    342381         zhdiv(:,:) = zhdiv(:,:) / ( zht(:,:) + 1. - tmask_i(:,:) ) 
     
    347386            IF( kt > nit000 ) THEN 
    348387               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(:,:) ) ) 
     388                  hdiv_lf(:,:,jk) = hdiv_lf(:,:,jk) - rn_Dt * frq_rst_hdv(:,:)   & 
     389                     &          * ( hdiv_lf(:,:,jk) - e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) ) 
    351390               END DO 
    352391            ENDIF 
     
    361400         IF( ln_vvl_ztilde ) THEN     ! z_tilde case 
    362401            DO jk = 1, jpkm1 
    363                tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) - ( e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) - hdiv_lf(:,:,jk) ) 
     402               tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) - ( e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) - hdiv_lf(:,:,jk) ) 
    364403            END DO 
    365404         ELSE                         ! layer case 
    366405            DO jk = 1, jpkm1 
    367                tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) -   e3t_n(:,:,jk) * ( hdivn(:,:,jk) - zhdiv(:,:) ) * tmask(:,:,jk) 
     406               tilde_e3t_a(:,:,jk) = tilde_e3t_a(:,:,jk) -   e3t(:,:,jk,Kmm) * ( hdiv(:,:,jk) - zhdiv(:,:) ) * tmask(:,:,jk) 
    368407            END DO 
    369408         ENDIF 
     
    381420         zwu(:,:) = 0._wp 
    382421         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 
     422         DO_3D( 1, 0, 1, 0, 1, jpkm1 ) 
     423            un_td(ji,jj,jk) = rn_ahe3 * umask(ji,jj,jk) * e2_e1u(ji,jj)           & 
     424               &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji+1,jj  ,jk) ) 
     425            vn_td(ji,jj,jk) = rn_ahe3 * vmask(ji,jj,jk) * e1_e2v(ji,jj)           &  
     426               &            * ( tilde_e3t_b(ji,jj,jk) - tilde_e3t_b(ji  ,jj+1,jk) ) 
     427            zwu(ji,jj) = zwu(ji,jj) + un_td(ji,jj,jk) 
     428            zwv(ji,jj) = zwv(ji,jj) + vn_td(ji,jj,jk) 
     429         END_3D 
     430         DO_2D( 1, 1, 1, 1 ) 
     431            un_td(ji,jj,mbku(ji,jj)) = un_td(ji,jj,mbku(ji,jj)) - zwu(ji,jj) 
     432            vn_td(ji,jj,mbkv(ji,jj)) = vn_td(ji,jj,mbkv(ji,jj)) - zwv(ji,jj) 
     433         END_2D 
     434         DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     435            tilde_e3t_a(ji,jj,jk) = tilde_e3t_a(ji,jj,jk) + (   un_td(ji-1,jj  ,jk) - un_td(ji,jj,jk)    & 
     436               &                                          +     vn_td(ji  ,jj-1,jk) - vn_td(ji,jj,jk)    & 
     437               &                                            ) * r1_e1e2t(ji,jj) 
     438         END_3D 
    410439         !                       ! d - thickness diffusion transport: boundary conditions 
    411440         !                             (stored for tracer advction and continuity equation) 
     
    414443         ! 4 - Time stepping of baroclinic scale factors 
    415444         ! --------------------------------------------- 
    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 
    423445         CALL lbc_lnk( 'domvvl', tilde_e3t_a(:,:,:), 'T', 1._wp ) 
    424          tilde_e3t_a(:,:,:) = tilde_e3t_b(:,:,:) + z2dt * tmask(:,:,:) * tilde_e3t_a(:,:,:) 
     446         tilde_e3t_a(:,:,:) = tilde_e3t_b(:,:,:) + rDt * tmask(:,:,:) * tilde_e3t_a(:,:,:) 
    425447 
    426448         ! Maximum deformation control 
    427449         ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    428          ze3t(:,:,jpk) = 0._wp 
    429          DO jk = 1, jpkm1 
    430             ze3t(:,:,jk) = tilde_e3t_a(:,:,jk) / e3t_0(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:) 
    431          END DO 
    432          z_tmax = MAXVAL( ze3t(:,:,:) ) 
    433          CALL mpp_max( 'domvvl', z_tmax )                 ! max over the global domain 
    434          z_tmin = MINVAL( ze3t(:,:,:) ) 
    435          CALL mpp_min( 'domvvl', z_tmin )                 ! min over the global domain 
     450         ALLOCATE( ze3t(jpi,jpj,jpk), llmsk(jpi,jpj,jpk) ) 
     451         DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     452            ze3t(ji,jj,jk) = tilde_e3t_a(ji,jj,jk) / e3t_0(ji,jj,jk) * tmask(ji,jj,jk) * tmask_i(ji,jj) 
     453         END_3D 
     454         ! 
     455         llmsk(   1:Nis1,:,:) = .FALSE.   ! exclude halos from the checked region 
     456         llmsk(Nie1: jpi,:,:) = .FALSE. 
     457         llmsk(:,   1:Njs1,:) = .FALSE. 
     458         llmsk(:,Nje1: jpj,:) = .FALSE. 
     459         ! 
     460         llmsk(Nis0:Nie0,Njs0:Nje0,:) = tmask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp                  ! define only the inner domain 
     461         z_tmax = MAXVAL( ze3t(:,:,:), mask = llmsk )   ;   CALL mpp_max( 'domvvl', z_tmax )   ! max over the global domain 
     462         z_tmin = MINVAL( ze3t(:,:,:), mask = llmsk )   ;   CALL mpp_min( 'domvvl', z_tmin )   ! min over the global domain 
    436463         ! - ML - test: for the moment, stop simulation for too large e3_t variations 
    437464         IF( ( z_tmax >  rn_zdef_max ) .OR. ( z_tmin < - rn_zdef_max ) ) THEN 
    438             IF( lk_mpp ) THEN 
    439                CALL mpp_maxloc( 'domvvl', ze3t, tmask, z_tmax, ijk_max ) 
    440                CALL mpp_minloc( 'domvvl', ze3t, tmask, z_tmin, ijk_min ) 
    441             ELSE 
    442                ijk_max = MAXLOC( ze3t(:,:,:) ) 
    443                ijk_max(1) = ijk_max(1) + nimpp - 1 
    444                ijk_max(2) = ijk_max(2) + njmpp - 1 
    445                ijk_min = MINLOC( ze3t(:,:,:) ) 
    446                ijk_min(1) = ijk_min(1) + nimpp - 1 
    447                ijk_min(2) = ijk_min(2) + njmpp - 1 
    448             ENDIF 
     465            CALL mpp_maxloc( 'domvvl', ze3t, llmsk, z_tmax, ijk_max ) 
     466            CALL mpp_minloc( 'domvvl', ze3t, llmsk, z_tmin, ijk_min ) 
    449467            IF (lwp) THEN 
    450468               WRITE(numout, *) 'MAX( tilde_e3t_a(:,:,:) / e3t_0(:,:,:) ) =', z_tmax 
     
    455473            ENDIF 
    456474         ENDIF 
     475         DEALLOCATE( ze3t, llmsk ) 
    457476         ! - ML - end test 
    458477         ! - ML - Imposing these limits will cause a baroclinicity error which is corrected for below 
     
    476495            zht(:,:)  = zht(:,:) + tilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
    477496         END DO 
    478          z_scale(:,:) =  - zht(:,:) / ( ht_0(:,:) + sshn(:,:) + 1. - ssmask(:,:) ) 
     497         z_scale(:,:) =  - zht(:,:) / ( ht_0(:,:) + ssh(:,:,Kmm) + 1. - ssmask(:,:) ) 
    479498         DO jk = 1, jpkm1 
    480             dtilde_e3t_a(:,:,jk) = dtilde_e3t_a(:,:,jk) + e3t_n(:,:,jk) * z_scale(:,:) * tmask(:,:,jk) 
     499            dtilde_e3t_a(:,:,jk) = dtilde_e3t_a(:,:,jk) + e3t(:,:,jk,Kmm) * z_scale(:,:) * tmask(:,:,jk) 
    481500         END DO 
    482501 
     
    486505      !                                           ! ---baroclinic part--------- ! 
    487506         DO jk = 1, jpkm1 
    488             e3t_a(:,:,jk) = e3t_a(:,:,jk) + dtilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
     507            e3t(:,:,jk,Kaa) = e3t(:,:,jk,Kaa) + dtilde_e3t_a(:,:,jk) * tmask(:,:,jk) 
    489508         END DO 
    490509      ENDIF 
     
    501520         zht(:,:) = 0.0_wp 
    502521         DO jk = 1, jpkm1 
    503             zht(:,:) = zht(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     522            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    504523         END DO 
    505          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + sshn(:,:) - zht(:,:) ) ) 
     524         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kmm) - zht(:,:) ) ) 
    506525         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 
     526         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshn-SUM(e3t(:,:,:,Kmm)))) =', z_tmax 
    508527         ! 
    509528         zht(:,:) = 0.0_wp 
    510529         DO jk = 1, jpkm1 
    511             zht(:,:) = zht(:,:) + e3t_a(:,:,jk) * tmask(:,:,jk) 
     530            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kaa) * tmask(:,:,jk) 
    512531         END DO 
    513          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssha(:,:) - zht(:,:) ) ) 
     532         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kaa) - zht(:,:) ) ) 
    514533         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 
     534         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+ssha-SUM(e3t(:,:,:,Kaa)))) =', z_tmax 
    516535         ! 
    517536         zht(:,:) = 0.0_wp 
    518537         DO jk = 1, jpkm1 
    519             zht(:,:) = zht(:,:) + e3t_b(:,:,jk) * tmask(:,:,jk) 
     538            zht(:,:) = zht(:,:) + e3t(:,:,jk,Kbb) * tmask(:,:,jk) 
    520539         END DO 
    521          z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + sshb(:,:) - zht(:,:) ) ) 
     540         z_tmax = MAXVAL( tmask(:,:,1) * tmask_i(:,:) * ABS( ht_0(:,:) + ssh(:,:,Kbb) - zht(:,:) ) ) 
    522541         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(:,:) ) ) 
     542         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ht_0+sshb-SUM(e3t(:,:,:,Kbb)))) =', z_tmax 
     543         ! 
     544         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kbb) ) ) 
    526545         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(:,:) ) ) 
     546         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kbb)))) =', z_tmax 
     547         ! 
     548         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kmm) ) ) 
    530549         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(:,:) ) ) 
     550         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kmm)))) =', z_tmax 
     551         ! 
     552         z_tmax = MAXVAL( tmask(:,:,1) *  ABS( ssh(:,:,Kaa) ) ) 
    534553         CALL mpp_max( 'domvvl', z_tmax )                                ! max over the global domain 
    535          IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssha))) =', z_tmax 
     554         IF( lwp    ) WRITE(numout, *) kt,' MAXVAL(abs(ssh(:,:,Kaa)))) =', z_tmax 
    536555      END IF 
    537556 
     
    540559      ! *********************************** ! 
    541560 
    542       CALL dom_vvl_interpol( e3t_a(:,:,:), e3u_a(:,:,:), 'U' ) 
    543       CALL dom_vvl_interpol( e3t_a(:,:,:), e3v_a(:,:,:), 'V' ) 
     561      CALL dom_vvl_interpol( e3t(:,:,:,Kaa), e3u(:,:,:,Kaa), 'U' ) 
     562      CALL dom_vvl_interpol( e3t(:,:,:,Kaa), e3v(:,:,:,Kaa), 'V' ) 
    544563 
    545564      ! *********************************** ! 
     
    547566      ! *********************************** ! 
    548567 
    549       hu_a(:,:) = e3u_a(:,:,1) * umask(:,:,1) 
    550       hv_a(:,:) = e3v_a(:,:,1) * vmask(:,:,1) 
     568      hu(:,:,Kaa) = e3u(:,:,1,Kaa) * umask(:,:,1) 
     569      hv(:,:,Kaa) = e3v(:,:,1,Kaa) * vmask(:,:,1) 
    551570      DO jk = 2, jpkm1 
    552          hu_a(:,:) = hu_a(:,:) + e3u_a(:,:,jk) * umask(:,:,jk) 
    553          hv_a(:,:) = hv_a(:,:) + e3v_a(:,:,jk) * vmask(:,:,jk) 
     571         hu(:,:,Kaa) = hu(:,:,Kaa) + e3u(:,:,jk,Kaa) * umask(:,:,jk) 
     572         hv(:,:,Kaa) = hv(:,:,Kaa) + e3v(:,:,jk,Kaa) * vmask(:,:,jk) 
    554573      END DO 
    555574      !                                        ! Inverse of the local depth 
    556575!!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(:,:) ) 
     576      r1_hu(:,:,Kaa) = ssumask(:,:) / ( hu(:,:,Kaa) + 1._wp - ssumask(:,:) ) 
     577      r1_hv(:,:,Kaa) = ssvmask(:,:) / ( hv(:,:,Kaa) + 1._wp - ssvmask(:,:) ) 
    559578      ! 
    560579      IF( ln_timing )   CALL timing_stop('dom_vvl_sf_nxt') 
     
    563582 
    564583 
    565    SUBROUTINE dom_vvl_sf_swp( kt ) 
    566       !!---------------------------------------------------------------------- 
    567       !!                ***  ROUTINE dom_vvl_sf_swp  *** 
     584   SUBROUTINE dom_vvl_sf_update( kt, Kbb, Kmm, Kaa ) 
     585      !!---------------------------------------------------------------------- 
     586      !!                ***  ROUTINE dom_vvl_sf_update  *** 
    568587      !!                    
    569       !! ** Purpose :  compute time filter and swap of scale factors  
     588      !! ** Purpose :  for z tilde case: compute time filter and swap of scale factors  
    570589      !!               compute all depths and related variables for next time step 
    571590      !!               write outputs and restart file 
    572591      !! 
    573       !! ** Method  :  - swap of e3t with trick for volume/tracer conservation 
     592      !! ** Method  :  - swap of e3t with trick for volume/tracer conservation (ONLY FOR Z TILDE CASE) 
    574593      !!               - reconstruct scale factor at other grid points (interpolate) 
    575594      !!               - recompute depths and water height fields 
    576595      !! 
    577       !! ** Action  :  - e3t_(b/n), tilde_e3t_(b/n) and e3(u/v)_n ready for next time step 
     596      !! ** Action  :  - tilde_e3t_(b/n) ready for next time step 
    578597      !!               - Recompute: 
    579598      !!                    e3(u/v)_b        
    580       !!                    e3w_n            
     599      !!                    e3w(:,:,:,Kmm)            
    581600      !!                    e3(u/v)w_b       
    582601      !!                    e3(u/v)w_n       
    583       !!                    gdept_n, gdepw_n  and gde3w_n 
     602      !!                    gdept(:,:,:,Kmm), gdepw(:,:,:,Kmm)  and gde3w 
    584603      !!                    h(u/v) and h(u/v)r 
    585604      !! 
     
    587606      !!              Leclair, M., and G. Madec, 2011, Ocean Modelling. 
    588607      !!---------------------------------------------------------------------- 
    589       INTEGER, INTENT( in ) ::   kt   ! time step 
     608      INTEGER, INTENT( in ) ::   kt              ! time step 
     609      INTEGER, INTENT( in ) ::   Kbb, Kmm, Kaa   ! time level indices 
    590610      ! 
    591611      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     
    595615      IF( ln_linssh )   RETURN      ! No calculation in linear free surface 
    596616      ! 
    597       IF( ln_timing )   CALL timing_start('dom_vvl_sf_swp') 
     617      IF( ln_timing )   CALL timing_start('dom_vvl_sf_update') 
    598618      ! 
    599619      IF( kt == nit000 )   THEN 
    600620         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' 
     621         IF(lwp) WRITE(numout,*) 'dom_vvl_sf_update : - interpolate scale factors and compute depths for next time step' 
     622         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~' 
    603623      ENDIF 
    604624      ! 
     
    607627      ! - ML - e3(t/u/v)_b are allready computed in dynnxt. 
    608628      IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN 
    609          IF( neuler == 0 .AND. kt == nit000 ) THEN 
     629         IF( l_1st_euler ) THEN 
    610630            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) 
    611631         ELSE 
    612632            tilde_e3t_b(:,:,:) = tilde_e3t_n(:,:,:) &  
    613             &         + atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) ) 
     633            &         + rn_atfp * ( tilde_e3t_b(:,:,:) - 2.0_wp * tilde_e3t_n(:,:,:) + tilde_e3t_a(:,:,:) ) 
    614634         ENDIF 
    615635         tilde_e3t_n(:,:,:) = tilde_e3t_a(:,:,:) 
    616636      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(:,:,:) 
    623637 
    624638      ! Compute all missing vertical scale factor and depths 
     
    626640      ! Horizontal scale factor interpolations 
    627641      ! -------------------------------------- 
    628       ! - ML - e3u_b and e3v_b are allready computed in dynnxt 
    629       ! - JC - hu_b, hv_b, hur_b, hvr_b also 
     642      ! - ML - e3u(:,:,:,Kbb) and e3v(:,:,:,Kbb) are already computed in dynnxt 
     643      ! - JC - hu(:,:,:,Kbb), hv(:,:,:,:,Kbb), hur_b, hvr_b also 
    630644       
    631       CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F'  ) 
     645      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3f(:,:,:), 'F'  ) 
    632646       
    633647      ! 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' ) 
     648      CALL dom_vvl_interpol( e3t(:,:,:,Kmm),  e3w(:,:,:,Kmm), 'W'  ) 
     649      CALL dom_vvl_interpol( e3u(:,:,:,Kmm), e3uw(:,:,:,Kmm), 'UW' ) 
     650      CALL dom_vvl_interpol( e3v(:,:,:,Kmm), e3vw(:,:,:,Kmm), 'VW' ) 
     651      CALL dom_vvl_interpol( e3t(:,:,:,Kbb),  e3w(:,:,:,Kbb), 'W'  ) 
     652      CALL dom_vvl_interpol( e3u(:,:,:,Kbb), e3uw(:,:,:,Kbb), 'UW' ) 
     653      CALL dom_vvl_interpol( e3v(:,:,:,Kbb), e3vw(:,:,:,Kbb), 'VW' ) 
    640654 
    641655      ! 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 
     656      gdept(:,:,1,Kmm) = 0.5_wp * e3w(:,:,1,Kmm) 
     657      gdepw(:,:,1,Kmm) = 0.0_wp 
     658      gde3w(:,:,1) = gdept(:,:,1,Kmm) - ssh(:,:,Kmm) 
     659      DO_3D( 1, 1, 1, 1, 2, jpk ) 
     660        !    zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))   ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     661                                                           ! 1 for jk = mikt 
     662         zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
     663         gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 
     664         gdept(ji,jj,jk,Kmm) =    zcoef  * ( gdepw(ji,jj,jk  ,Kmm) + 0.5 * e3w(ji,jj,jk,Kmm) )  & 
     665             &             + (1-zcoef) * ( gdept(ji,jj,jk-1,Kmm) +       e3w(ji,jj,jk,Kmm) )  
     666         gde3w(ji,jj,jk) = gdept(ji,jj,jk,Kmm) - ssh(ji,jj,Kmm) 
     667      END_3D 
    658668 
    659669      ! Local depth and Inverse of the local depth of the water 
    660670      ! ------------------------------------------------------- 
    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) 
     671      ! 
     672      ht(:,:) = e3t(:,:,1,Kmm) * tmask(:,:,1) 
    665673      DO jk = 2, jpkm1 
    666          ht_n(:,:) = ht_n(:,:) + e3t_n(:,:,jk) * tmask(:,:,jk) 
     674         ht(:,:) = ht(:,:) + e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    667675      END DO 
    668676 
    669677      ! write restart file 
    670678      ! ================== 
    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 
     679      IF( lrst_oce  )   CALL dom_vvl_rst( kt, Kbb, Kmm, 'WRITE' ) 
     680      ! 
     681      IF( ln_timing )   CALL timing_stop('dom_vvl_sf_update') 
     682      ! 
     683   END SUBROUTINE dom_vvl_sf_update 
    676684 
    677685 
     
    704712         ! 
    705713      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 
     714         DO_3D( 1, 0, 1, 0, 1, jpk ) 
     715            pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2u(ji,jj)   & 
     716               &                       * (   e1e2t(ji  ,jj) * ( pe3_in(ji  ,jj,jk) - e3t_0(ji  ,jj,jk) )     & 
     717               &                           + e1e2t(ji+1,jj) * ( pe3_in(ji+1,jj,jk) - e3t_0(ji+1,jj,jk) ) ) 
     718         END_3D 
    715719         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'U', 1._wp ) 
    716720         pe3_out(:,:,:) = pe3_out(:,:,:) + e3u_0(:,:,:) 
    717721         ! 
    718722      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 
     723         DO_3D( 1, 0, 1, 0, 1, jpk ) 
     724            pe3_out(ji,jj,jk) = 0.5_wp * ( vmask(ji,jj,jk)  * (1.0_wp - zlnwd) + zlnwd ) * r1_e1e2v(ji,jj)   & 
     725               &                       * (   e1e2t(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3t_0(ji,jj  ,jk) )     & 
     726               &                           + e1e2t(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3t_0(ji,jj+1,jk) ) ) 
     727         END_3D 
    728728         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'V', 1._wp ) 
    729729         pe3_out(:,:,:) = pe3_out(:,:,:) + e3v_0(:,:,:) 
    730730         ! 
    731731      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 
     732         DO_3D( 1, 0, 1, 0, 1, jpk ) 
     733            pe3_out(ji,jj,jk) = 0.5_wp * (  umask(ji,jj,jk) * umask(ji,jj+1,jk) * (1.0_wp - zlnwd) + zlnwd ) & 
     734               &                       *    r1_e1e2f(ji,jj)                                                  & 
     735               &                       * (   e1e2u(ji,jj  ) * ( pe3_in(ji,jj  ,jk) - e3u_0(ji,jj  ,jk) )     & 
     736               &                           + e1e2u(ji,jj+1) * ( pe3_in(ji,jj+1,jk) - e3u_0(ji,jj+1,jk) ) ) 
     737         END_3D 
    742738         CALL lbc_lnk( 'domvvl', pe3_out(:,:,:), 'F', 1._wp ) 
    743739         pe3_out(:,:,:) = pe3_out(:,:,:) + e3f_0(:,:,:) 
     
    783779 
    784780 
    785    SUBROUTINE dom_vvl_rst( kt, cdrw ) 
     781   SUBROUTINE dom_vvl_rst( kt, Kbb, Kmm, cdrw ) 
    786782      !!--------------------------------------------------------------------- 
    787783      !!                   ***  ROUTINE dom_vvl_rst  *** 
     
    795791      !!                they are set to 0. 
    796792      !!---------------------------------------------------------------------- 
    797       INTEGER         , INTENT(in) ::   kt     ! ocean time-step 
    798       CHARACTER(len=*), INTENT(in) ::   cdrw   ! "READ"/"WRITE" flag 
     793      INTEGER         , INTENT(in) ::   kt        ! ocean time-step 
     794      INTEGER         , INTENT(in) ::   Kbb, Kmm  ! ocean time level indices 
     795      CHARACTER(len=*), INTENT(in) ::   cdrw      ! "READ"/"WRITE" flag 
    799796      ! 
    800797      INTEGER ::   ji, jj, jk 
     
    806803         IF( ln_rstart ) THEN                   !* Read the restart file 
    807804            CALL rst_read_open                  !  open the restart file if necessary 
    808             CALL iom_get( numror, jpdom_autoglo, 'sshn'   , sshn, ldxios = lrxios    ) 
     805            CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm), ldxios = lrxios    ) 
    809806            ! 
    810807            id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. ) 
     
    813810            id4 = iom_varid( numror, 'tilde_e3t_n', ldstop = .FALSE. ) 
    814811            id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. ) 
     812            ! 
    815813            !                             ! --------- ! 
    816814            !                             ! all cases ! 
    817815            !                             ! --------- ! 
     816            ! 
    818817            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 ) 
     818               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios ) 
     819               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios ) 
    821820               ! 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' 
     821               IF(lwp) write(numout,*) 'dom_vvl_rst : e3t(:,:,:,Kbb) and e3t(:,:,:,Kmm) found in restart files' 
    823822               WHERE ( tmask(:,:,:) == 0.0_wp )  
    824                   e3t_n(:,:,:) = e3t_0(:,:,:) 
    825                   e3t_b(:,:,:) = e3t_0(:,:,:) 
     823                  e3t(:,:,:,Kmm) = e3t_0(:,:,:) 
     824                  e3t(:,:,:,Kbb) = e3t_0(:,:,:) 
    826825               END WHERE 
    827                IF( neuler == 0 ) THEN 
    828                   e3t_b(:,:,:) = e3t_n(:,:,:) 
     826               IF( l_1st_euler ) THEN 
     827                  e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
    829828               ENDIF 
    830829            ELSE IF( id1 > 0 ) THEN 
    831                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart files' 
     830               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kmm) not found in restart files' 
    832831               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 
     832               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
     833               CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios ) 
     834               e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb) 
     835               l_1st_euler = .true. 
    837836            ELSE IF( id2 > 0 ) THEN 
    838                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_b not found in restart files' 
     837               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kbb) not found in restart files' 
    839838               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 
     839               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
     840               CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lrxios ) 
     841               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     842               l_1st_euler = .true. 
    844843            ELSE 
    845                IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t_n not found in restart file' 
     844               IF(lwp) write(numout,*) 'dom_vvl_rst WARNING : e3t(:,:,:,Kmm) not found in restart file' 
    846845               IF(lwp) write(numout,*) 'Compute scale factor from sshn' 
    847                IF(lwp) write(numout,*) 'neuler is forced to 0' 
     846               IF(lwp) write(numout,*) 'l_1st_euler is forced to true' 
    848847               DO jk = 1, jpk 
    849                   e3t_n(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:) ) & 
     848                  e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm) ) & 
    850849                      &                          / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    851850                      &          + e3t_0(:,:,jk)                               * (1._wp -tmask(:,:,jk)) 
    852851               END DO 
    853                e3t_b(:,:,:) = e3t_n(:,:,:) 
    854                neuler = 0 
     852               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     853               l_1st_euler = .true. 
    855854            ENDIF 
    856855            !                             ! ----------- ! 
     
    864863               !                          ! ----------------------- ! 
    865864               IF( MIN( id3, id4 ) > 0 ) THEN  ! all required arrays exist 
    866                   CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios ) 
    867                   CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios ) 
     865                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios ) 
     866                  CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios ) 
    868867               ELSE                            ! one at least array is missing 
    869868                  tilde_e3t_b(:,:,:) = 0.0_wp 
     
    874873                  !                       ! ------------ ! 
    875874                  IF( id5 > 0 ) THEN  ! required array exists 
    876                      CALL iom_get( numror, jpdom_autoglo, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios ) 
     875                     CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios ) 
    877876                  ELSE                ! array is missing 
    878877                     hdiv_lf(:,:,:) = 0.0_wp 
     
    888887               IF( cn_cfg == 'wad' ) THEN 
    889888                  ! 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  (:,:,:) 
     889                  CALL usr_def_istate( gdept(:,:,:,Kbb), tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  ) 
     890                  ts  (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb)       ! set now values from to before ones 
     891                  ssh (:,:,Kmm)     = ssh(:,:,Kbb) 
     892                  uu   (:,:,:,Kmm)   = uu  (:,:,:,Kbb) 
     893                  vv   (:,:,:,Kmm)   = vv  (:,:,:,Kbb) 
    895894               ELSE 
    896895                  ! 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 
     896                  ssh(:,:,Kmm) = -ssh_ref 
     897                  ssh(:,:,Kbb) = -ssh_ref 
     898 
     899                  DO_2D( 1, 1, 1, 1 ) 
     900                     IF( ht_0(ji,jj)-ssh_ref <  rn_wdmin1 ) THEN ! if total depth is less than min depth 
     901                        ssh(ji,jj,Kbb) = rn_wdmin1 - (ht_0(ji,jj) ) 
     902                        ssh(ji,jj,Kmm) = rn_wdmin1 - (ht_0(ji,jj) ) 
     903                     ENDIF 
     904                  END_2D 
    910905               ENDIF !If test case else 
    911906 
    912907               ! Adjust vertical metrics for all wad 
    913908               DO jk = 1, jpk 
    914                   e3t_n(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshn(:,:)  ) & 
     909                  e3t(:,:,jk,Kmm) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kmm)  ) & 
    915910                    &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    916911                    &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) ) 
    917912               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  
     913               e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 
     914 
     915               DO_2D( 1, 1, 1, 1 ) 
     916                  IF ( ht_0(ji,jj) .LE. 0.0 .AND. NINT( ssmask(ji,jj) ) .EQ. 1) THEN 
     917                     CALL ctl_stop( 'dom_vvl_rst: ht_0 must be positive at potentially wet points' ) 
     918                  ENDIF 
     919               END_2D 
    927920               ! 
    928921            ELSE 
    929922               ! 
    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) 
     923               ! usr_def_istate called here only to get ssh(Kbb) needed to initialize e3t(Kbb) and e3t(Kmm) 
     924               ! 
     925               CALL usr_def_istate( gdept_0, tmask, ts(:,:,:,:,Kbb), uu(:,:,:,Kbb), vv(:,:,:,Kbb), ssh(:,:,Kbb)  )   
     926               ! 
     927               ! usr_def_istate will be called again in istate_init to initialize ts, ssh, u and v 
    933928               ! 
    934929               DO jk=1,jpk 
    935                   e3t_b(:,:,jk) =  e3t_0(:,:,jk) * ( ht_0(:,:) + sshb(:,:) ) & 
     930                  e3t(:,:,jk,Kbb) =  e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb) ) & 
    936931                    &                            / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk)   & 
    937                     &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )   ! make sure e3t_b != 0 on land points 
     932                    &            + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) )   ! make sure e3t(:,:,:,Kbb) != 0 on land points 
    938933               END DO 
    939                e3t_n(:,:,:) = e3t_b(:,:,:) 
    940                sshn(:,:) = sshb(:,:)   ! needed later for gde3w 
    941 !!$                e3t_n(:,:,:)=e3t_0(:,:,:) 
    942 !!$                e3t_b(:,:,:)=e3t_0(:,:,:) 
     934               e3t(:,:,:,Kmm) = e3t(:,:,:,Kbb) 
     935               ssh(:,:,Kmm) = ssh(:,:,Kbb)                                     ! needed later for gde3w 
    943936               ! 
    944937            END IF           ! end of ll_wd edits 
     
    958951         !                                           ! all cases ! 
    959952         !                                           ! --------- ! 
    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 ) 
     953         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lwxios ) 
     954         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lwxios ) 
    962955         !                                           ! ----------------------- ! 
    963956         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases ! 
     
    992985      !!----------------------------------------------------------------------  
    993986      ! 
    994       REWIND( numnam_ref )              ! Namelist nam_vvl in reference namelist :  
    995987      READ  ( numnam_ref, nam_vvl, IOSTAT = ios, ERR = 901) 
    996 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nam_vvl in reference namelist', lwp ) 
    997       REWIND( numnam_cfg )              ! Namelist nam_vvl in configuration namelist : Parameters of the run 
     988901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nam_vvl in reference namelist' ) 
    998989      READ  ( numnam_cfg, nam_vvl, IOSTAT = ios, ERR = 902 ) 
    999 902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nam_vvl in configuration namelist', lwp ) 
     990902   IF( ios >  0 ) CALL ctl_nam ( ios , 'nam_vvl in configuration namelist' ) 
    1000991      IF(lwm) WRITE ( numond, nam_vvl ) 
    1001992      ! 
     
    10191010            WRITE(numout,*) '                         rn_rst_e3t     = 0.e0' 
    10201011            WRITE(numout,*) '            hard-wired : z-tilde cutoff frequency of low-pass filter (days)' 
    1021             WRITE(numout,*) '                         rn_lf_cutoff   = 1.0/rdt' 
     1012            WRITE(numout,*) '                         rn_lf_cutoff   = 1.0/rn_Dt' 
    10221013         ELSE 
    10231014            WRITE(numout,*) '      z-tilde to zstar restoration timescale (days)        rn_rst_e3t   = ', rn_rst_e3t 
     
    10341025      ! 
    10351026      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' ) 
    10371027      ! 
    10381028      IF(lwp) THEN                   ! Print the choice 
     
    10501040   END SUBROUTINE dom_vvl_ctl 
    10511041 
     1042#endif 
     1043 
    10521044   !!====================================================================== 
    10531045END MODULE domvvl 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/VORTEX/MY_SRC/usrdef_hgr.F90

    r10074 r13463  
    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) 
     
    6163      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2] 
    6264      ! 
    63       INTEGER  ::   ji, jj   ! dummy loop indices 
     65      INTEGER  ::   ji, jj     ! dummy loop indices 
    6466      REAL(wp) ::   zphi0, zlam0, zbeta, zf0 
    65       REAL(wp) ::   zti, zui, ztj, zvj   ! local scalars 
     67      REAL(wp) ::   zti, ztj   ! local scalars 
    6668      !!------------------------------------------------------------------------------- 
    6769      ! 
     
    7577      ! Position coordinates (in kilometers) 
    7678      !                          ========== 
    77       zlam0 = -(jpiglo-1)/2 * 1.e-3 * rn_dx 
    78       zphi0 = -(jpjglo-1)/2 * 1.e-3 * rn_dy  
    79  
     79#if defined key_agrif  
     80      IF( Agrif_Root() ) THEN 
     81#endif 
     82         ! Compatibility WITH old version:  
     83         ! jperio = 0 =>  Ni0glo = jpigo_old_version 
     84         !            =>  jpiglo-1 replaced by Ni0glo-1 
     85         zlam0 = -REAL( (Ni0glo-1)/2, wp) * 1.e-3 * rn_dx 
     86         zphi0 = -REAL( (Nj0glo-1)/2, wp) * 1.e-3 * rn_dy  
    8087#if defined key_agrif 
    81       ! ! let lower left longitude and latitude from parent 
    82       IF (.NOT.Agrif_root()) THEN 
    83           zlam0 = (0.5_wp-(Agrif_parent(jpiglo)-1)/2)*1.e-3*Agrif_irhox()*rn_dx & 
    84              &+(Agrif_Ix()+nbghostcells-1)*Agrif_irhox()*rn_dx*1.e-3-(0.5_wp+nbghostcells)*rn_dx*1.e-3 
    85           zphi0 = (0.5_wp-(Agrif_parent(jpjglo)-1)/2)*1.e-3*Agrif_irhoy()*rn_dy & 
    86              &+(Agrif_Iy()+nbghostcells-1)*Agrif_irhoy()*rn_dy*1.e-3-(0.5_wp+nbghostcells)*rn_dy*1.e-3 
     88      ELSE 
     89         ! ! let lower left longitude and latitude from parent 
     90         ! Compatibility WITH old version:  
     91         ! jperio = 0 =>  Ni0glo = jpigo_old_version 
     92         !            =>  Agrif_parent(jpiglo)-1 replaced by  Agrif_parent(Ni0glo)-1 
     93         zlam0 = ( 0.5_wp - REAL( ( Agrif_parent(Ni0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhox() * rn_dx  & 
     94            &  + ( Agrif_Ix() + nbghostcells - 1 ) * Agrif_irhox() * rn_dx * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dx * 1.e-3 
     95         zphi0 = ( 0.5_wp - REAL( ( Agrif_parent(Nj0glo)-1 ) / 2, wp) ) * 1.e-3 * Agrif_irhoy() * rn_dy  & 
     96            &  + ( Agrif_Iy() + nbghostcells - 1 ) * Agrif_irhoy() * rn_dy * 1.e-3 - ( 0.5_wp + nbghostcells ) * rn_dy * 1.e-3 
    8797      ENDIF  
    8898#endif 
    8999          
    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 
     100      DO_2D( 1, 1, 1, 1 ) 
     101         zti = REAL( mig0_oldcmp(ji) - 1, wp )   ! start at i=0 in the global grid without halos 
     102         ztj = REAL( mjg0_oldcmp(jj) - 1, wp )   ! start at j=0 in the global grid without halos 
     103          
     104         plamt(ji,jj) = zlam0 + rn_dx * 1.e-3 *   zti 
     105         plamu(ji,jj) = zlam0 + rn_dx * 1.e-3 * ( zti + 0.5_wp ) 
     106         plamv(ji,jj) = plamt(ji,jj)  
     107         plamf(ji,jj) = plamu(ji,jj)  
     108          
     109         pphit(ji,jj) = zphi0 + rn_dy * 1.e-3 *   ztj 
     110         pphiv(ji,jj) = zphi0 + rn_dy * 1.e-3 * ( ztj + 0.5_wp ) 
     111         pphiu(ji,jj) = pphit(ji,jj)  
     112         pphif(ji,jj) = pphiv(ji,jj)  
     113      END_2D 
    106114      !      
    107115      ! Horizontal scale factors (in meters) 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/VORTEX/MY_SRC/usrdef_istate.F90

    r10425 r13463  
    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( 1, 1, 1, 1 ) 
     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( 1, 1, 1, 1 ) 
     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( 0, 0, 0, 0 ) 
     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( 0, 0, 0, 0 ) 
     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_r11351_fldread_with_XIOS/tests/VORTEX/MY_SRC/usrdef_nam.F90

    r10074 r13463  
    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 
    1717   USE par_oce        ! ocean space and time domain 
    1818   USE phycst         ! physical constants 
     
    4040CONTAINS 
    4141 
    42    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     42   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4343      !!---------------------------------------------------------------------- 
    4444      !!                     ***  ROUTINE dom_nam  *** 
     
    5252      !! ** input   : - namusr_def namelist found in namelist_cfg 
    5353      !!---------------------------------------------------------------------- 
    54       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    5554      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    5655      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    5857      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    5958      ! 
    60       INTEGER ::   ios, ii      ! Local integer 
     59      INTEGER ::   ios          ! Local integer 
    6160      REAL(wp)::   zlx, zly, zh ! Local scalars 
    6261      !! 
     
    6463      !!---------------------------------------------------------------------- 
    6564      ! 
    66       ii = 1 
    67       ! 
    68       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6965      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    70 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
     66902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    7167      ! 
    7268#if defined key_agrif  
     
    8076#endif 
    8177      ! 
    82       WRITE( ldnam(:), namusr_def ) 
     78      IF(lwm)   WRITE( numond, namusr_def ) 
    8379      ! 
    8480      cd_cfg = 'VORTEX'             ! name & resolution (not used) 
    85       kk_cfg = INT( rn_dx ) 
     81      kk_cfg = nINT( rn_dx ) 
    8682      ! 
    87       ! Global Domain size:  VORTEX global domain is  1800 km x 1800 Km x 5000 m 
    88       kpi = INT( 1800.e3  / rn_dx ) + 3   
    89       kpj = INT( 1800.e3  / rn_dy ) + 3  
    90       kpk = INT( 5000._wp / rn_dz ) + 1 
    91 #if defined key_agrif 
    92       IF( .NOT. Agrif_Root() ) THEN 
    93          kpi  = nbcellsx + 2 + 2*nbghostcells 
    94          kpj  = nbcellsy + 2 + 2*nbghostcells 
     83      IF( Agrif_Root() ) THEN       ! Global Domain size:  VORTEX global domain is  1800 km x 1800 Km x 5000 m 
     84         kpi = NINT( 1800.e3  / rn_dx ) + 3   
     85         kpj = NINT( 1800.e3  / rn_dy ) + 3  
     86      ELSE                          ! Global Domain size: add nbghostcells + 1 "land" point on each side 
     87         kpi  = nbcellsx + 2 * ( nbghostcells + 1 ) 
     88         kpj  = nbcellsy + 2 * ( nbghostcells + 1 ) 
     89!!$         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2 
     90!!$         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2 
    9591      ENDIF 
    96 #endif 
     92      kpk = NINT( 5000._wp / rn_dz ) + 1 
    9793      ! 
    9894      zlx = (kpi-2)*rn_dx*1.e-3 
    9995      zly = (kpj-2)*rn_dy*1.e-3 
    10096      zh  = (kpk-1)*rn_dz 
    101       !                             ! control print 
    102       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    103       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    104       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    105       WRITE(ldtxt(ii),*) '   Namelist namusr_def : VORTEX test case'                                    ;   ii = ii + 1 
    106       WRITE(ldtxt(ii),*) '      horizontal resolution             rn_dx  = ', rn_dx, ' m'               ;   ii = ii + 1 
    107       WRITE(ldtxt(ii),*) '      horizontal resolution             rn_dy  = ', rn_dy, ' m'               ;   ii = ii + 1 
    108       WRITE(ldtxt(ii),*) '      vertical resolution               rn_dz  = ', rn_dz, ' m'               ;   ii = ii + 1 
    109       WRITE(ldtxt(ii),*) '      VORTEX domain: '                                                        ;   ii = ii + 1 
    110       WRITE(ldtxt(ii),*) '         LX [km]: ', zlx                                                      ;   ii = ii + 1 
    111       WRITE(ldtxt(ii),*) '         LY [km]: ', zly                                                      ;   ii = ii + 1 
    112       WRITE(ldtxt(ii),*) '          H [m] : ', zh                                                       ;   ii = ii + 1 
    113       WRITE(ldtxt(ii),*) '      Reference latitude            rn_ppgphi0 = ', rn_ppgphi0                ;   ii = ii + 1 
    114       ! 
    11597      !                             ! Set the lateral boundary condition of the global domain 
    11698      kperio = 0                    ! VORTEX configuration : closed basin 
    117       ! 
    118       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    119       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    120       WRITE(ldtxt(ii),*) '      VORTEX : closed basin            jperio = ', kperio                     ;   ii = ii + 1 
     99      !                             ! control print 
     100      IF(lwp) THEN 
     101         WRITE(numout,*) '   ' 
     102         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     103         WRITE(numout,*) '~~~~~~~~~~~ ' 
     104         WRITE(numout,*) '   Namelist namusr_def : VORTEX test case' 
     105         WRITE(numout,*) '      horizontal resolution             rn_dx  = ', rn_dx, ' m' 
     106         WRITE(numout,*) '      horizontal resolution             rn_dy  = ', rn_dy, ' m' 
     107         WRITE(numout,*) '      vertical resolution               rn_dz  = ', rn_dz, ' m' 
     108         WRITE(numout,*) '      resulting global domain size :    Ni0glo = ', kpi 
     109         WRITE(numout,*) '                                        Nj0glo = ', kpj 
     110         WRITE(numout,*) '                                        jpkglo = ', kpk 
     111         WRITE(numout,*) '      VORTEX domain: ' 
     112         WRITE(numout,*) '         LX [km]: ', zlx 
     113         WRITE(numout,*) '         LY [km]: ', zly 
     114         WRITE(numout,*) '          H [m] : ', zh 
     115         WRITE(numout,*) '      Reference latitude            rn_ppgphi0 = ', rn_ppgphi0 
     116         WRITE(numout,*) '   ' 
     117         WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     118         WRITE(numout,*) '      VORTEX : closed basin            jperio = ', kperio 
     119      ENDIF 
    121120      ! 
    122121   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/VORTEX/MY_SRC/usrdef_sbc.F90

    r10074 r13463  
    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_r11351_fldread_with_XIOS/tests/VORTEX/MY_SRC/usrdef_zgr.F90

    r10425 r13463  
    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_r11351_fldread_with_XIOS/tests/WAD/EXPREF/context_nemo.xml

    r9930 r13463  
    55--> 
    66<context id="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"/> 
    3436 
    3537</context> 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/WAD/EXPREF/makebdy_tc7.py

    r7609 r13463  
    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_r11351_fldread_with_XIOS/tests/WAD/EXPREF/namelist_cfg

    r10075 r13463  
    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 
     
    180180&nambdy_dta    !  open boundaries - external data                        
    181181!----------------------------------------------------------------------- 
     182   ln_zinterp  = .false.      !  T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file 
     183   !                          !  automatically defined to T if the number of vertical levels in bdy dta /= jpk 
     184   ln_full_vel = .false.      !  T if [uv]3d are "full" velocities and not only its baroclinic components 
     185   !                          !  in this case, baroclinic and barotropic velocities will be recomputed -> [uv]2d not needed 
     186   ! 
     187   cn_dir  =  './' 
    182188!              !  file name      ! frequency (hours) ! variable  ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    183189!              !                 !  (if <0  months)  !   name    !  (logical)   !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      ! 
    184    bn_ssh =     'bdyssh_tc7' ,         1        , 'sshbdy',     .true.     , .true.  ,  'daily'  ,    ''    ,   ''     , '' 
    185    bn_u2d =     'bdyuv_tc7'  ,         1        , 'ubdy'  ,     .true.     , .true.  ,  'daily'  ,    ''    ,   ''     , '' 
    186    bn_v2d =     'bdyuv_tc7'  ,         1        , 'vbdy'  ,     .true.     , .true.  ,  'daily'  ,    ''    ,   ''     , '' 
    187    cn_dir      =    './'   !  root directory for the location of the bulk files 
    188    ln_full_vel = .false.        ! 
     190   bn_ssh =     'bdyssh_tc7' ,         1.       , 'sshbdy',     .true.     , .true.  ,  'daily'  ,    ''    ,   ''     , '' 
     191   bn_u2d =     'bdyuv_tc7'  ,         1.       , 'ubdy'  ,     .true.     , .true.  ,  'daily'  ,    ''    ,   ''     , '' 
     192   bn_v2d =     'bdyuv_tc7'  ,         1.       , 'vbdy'  ,     .true.     , .true.  ,  'daily'  ,    ''    ,   ''     , '' 
    189193/ 
    190194!----------------------------------------------------------------------- 
     
    196200!!                                                                    !! 
    197201!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
    198 !!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T) 
    199 !!   namdrg_bot    bottom friction                                      (ln_OFF=F) 
     202!!   namdrg_top    top    friction                                      (ln_drg_OFF=F & ln_isfcav=T) 
     203!!   namdrg_bot    bottom friction                                      (ln_drg_OFF=F) 
    200204!!   nambbc        bottom temperature boundary condition                (default: OFF) 
    201205!!   nambbl        bottom boundary layer scheme                         (default: OFF) 
     
    340344   ln_dynspg_ts  = .true.  !  split-explicit free surface 
    341345   ln_bt_auto    = .false. ! Number of sub-step defined from: 
    342    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 
    343347/ 
    344348!----------------------------------------------------------------------- 
     
    417421!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    418422!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    419 !!   namflo       float parameters                                      ("key_float") 
    420 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    421 !!   namdct       transports through some sections                      ("key_diadct") 
    422 !!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
     423!!   namflo       float parameters                                      (default: OFF) 
     424!!   nam_diadct   transports through some sections                      (default: OFF) 
    423425!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
    424426!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4") 
     
    439441/ 
    440442!----------------------------------------------------------------------- 
    441 &namdct        ! transports through some sections                       ("key_diadct") 
    442 !----------------------------------------------------------------------- 
     443&nam_diadct    !   transports through some sections                     (default: OFF) 
     444!----------------------------------------------------------------------- 
     445    ln_diadct  = .false.   ! Calculate transport thru sections or not 
    443446    nn_dct      = 60       !  time step frequency for transports computing 
    444447    nn_dctwri   = 60       !  time step frequency for transports writing 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/WAD/MY_DOCS/Namelists/nam_wad_tc7

    r7609 r13463  
    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_r11351_fldread_with_XIOS/tests/WAD/MY_SRC/usrdef_hgr.F90

    r10074 r13463  
    1313   !!   usr_def_hgr    : initialize the horizontal mesh for WAD_TEST_CASES configuration 
    1414   !!---------------------------------------------------------------------- 
    15    USE dom_oce  ,  ONLY: nimpp, njmpp       ! ocean space and time domain 
     15   USE dom_oce 
    1616   USE par_oce         ! ocean space and time domain 
    1717   USE phycst          ! physical constants 
     
    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( 1, 1, 1, 1 ) 
     77         !                       ! longitude 
     78         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0_oldcmp(ji)-1 , wp )  )   
     79         plamu(ji,jj) = zfact * (          REAL( mig0_oldcmp(ji)-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( mjg0_oldcmp(jj)-1 , wp )  ) 
     84         pphiu(ji,jj) = pphit(ji,jj) 
     85         pphiv(ji,jj) = zfact * (          REAL( mjg0_oldcmp(jj)-1 , wp )  ) 
     86         pphif(ji,jj) = pphiv(ji,jj) 
     87      END_2D 
    8788      ! 
    8889      !                       !==  Horizontal scale factors  ==!   (in meters)  
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/WAD/MY_SRC/usrdef_istate.F90

    r10074 r13463  
    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( 1, 1, 1, 1 ) 
     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_r11351_fldread_with_XIOS/tests/WAD/MY_SRC/usrdef_nam.F90

    r10074 r13463  
    1414   !!   usr_def_hgr   : initialize the horizontal mesh  
    1515   !!---------------------------------------------------------------------- 
    16    USE dom_oce  , ONLY: nimpp , njmpp            ! i- & j-indices of the local domain 
    1716   USE par_oce        ! ocean space and time domain 
    1817   USE phycst         ! physical constants 
     
    3938CONTAINS 
    4039 
    41    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     40   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4241      !!---------------------------------------------------------------------- 
    4342      !!                     ***  ROUTINE dom_nam  *** 
     
    5150      !! ** input   : - namusr_def namelist found in namelist_cfg 
    5251      !!---------------------------------------------------------------------- 
    53       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    5452      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    5553      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    5755      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    5856      ! 
    59       INTEGER ::   ios, ii   ! Local integer 
     57      INTEGER ::   ios   ! Local integer 
    6058      !! 
    6159      NAMELIST/namusr_def/ rn_dx, rn_dz, nn_wad_test 
    6260      !!---------------------------------------------------------------------- 
    6361      ! 
    64       ii = 1 
     62      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
     63902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    6564      ! 
    66       REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    67       READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    68 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
    69       ! 
    70       WRITE( ldnam(:), namusr_def ) 
     65      IF(lwm)   WRITE( numond, namusr_def ) 
    7166      ! 
    7267      ! 
     
    7974      kpj = INT(  32.e3 / rn_dx ) + 2 
    8075      kpk = INT(  10.  / rn_dz ) + 1 
     76      !                             ! Set the lateral boundary condition of the global domain 
     77      kperio = 0                    ! WAD_TEST_CASES configuration : closed domain 
     78      IF( nn_wad_test == 8 ) THEN 
     79         kperio = 7         ! North-South cyclic test 
     80         kpi = kpi - 2      ! no closed boundary 
     81         kpj = kpj - 2      ! no closed boundary 
     82      ENDIF 
    8183      ! 
    8284      !                             ! control print 
    83       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    84       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    85       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    86       WRITE(ldtxt(ii),*) '   Namelist namusr_def : WAD_TEST_CASES test case'                             ;   ii = ii + 1 
    87       WRITE(ldtxt(ii),*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'   ;   ii = ii + 1 
    88       WRITE(ldtxt(ii),*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters'   ;   ii = ii + 1 
    89       WRITE(ldtxt(ii),*) '      WAD_TEST_CASES domain = 52 km  x  34 km x 10 m'                ;   ii = ii + 1 
    90       WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo = ', kpi                ;   ii = ii + 1 
    91       WRITE(ldtxt(ii),*) '                                               jpjglo = ', kpj                ;   ii = ii + 1 
    92       WRITE(ldtxt(ii),*) '                                               jpkglo = ', kpk                ;   ii = ii + 1 
    93       ! 
    94       !                             ! Set the lateral boundary condition of the global domain 
    95       kperio = 0                    ! WAD_TEST_CASES configuration : closed domain 
    96       IF( nn_wad_test == 8 ) kperio = 7 ! North-South cyclic test 
    97       ! 
    98       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    99       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    100       WRITE(ldtxt(ii),*) '      closed                                   jperio = ', kperio             ;   ii = ii + 1 
     85      IF(lwp) THEN 
     86         WRITE(numout,*) '   ' 
     87         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     88         WRITE(numout,*) '~~~~~~~~~~~ ' 
     89         WRITE(numout,*) '   Namelist namusr_def : WAD_TEST_CASES test case' 
     90         WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters' 
     91         WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters' 
     92         WRITE(numout,*) '      WAD_TEST_CASES domain = 52 km  x  34 km x 10 m' 
     93         WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi 
     94         WRITE(numout,*) '                                               jpjglo = ', kpj 
     95         WRITE(numout,*) '                                               jpkglo = ', kpk 
     96         WRITE(numout,*) '   ' 
     97         WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     98         WRITE(numout,*) '      closed                                   jperio = ', kperio 
     99      ENDIF 
    101100      ! 
    102101   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/WAD/MY_SRC/usrdef_sbc.F90

    r10074 r13463  
    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_r11351_fldread_with_XIOS/tests/WAD/MY_SRC/usrdef_zgr.F90

    r10425 r13463  
    1515   !!--------------------------------------------------------------------- 
    1616   USE oce            ! ocean variables 
    17    USE dom_oce ,  ONLY: ht_0, mi0, mi1, nimpp, njmpp,  & 
    18                       & mj0, mj1, glamt, gphit         ! ocean space and time domain 
     17   USE dom_oce ,  ONLY: ht_0, mi0, mi1, mj0, mj1, glamt, gphit         ! ocean space and time domain 
    1918   USE usrdef_nam     ! User defined : namelist variables 
    2019   USE wet_dry ,  ONLY: rn_wdmin1, rn_wdmin2, rn_wdld  ! Wetting and drying 
     
    3029 
    3130   !! * Substitutions 
    32 #  include "vectopt_loop_substitute.h90" 
     31#  include "do_loop_substitute.h90" 
    3332   !!---------------------------------------------------------------------- 
    3433   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    244243      ! at v-point: averaging zht 
    245244      zhv = 0._wp 
    246       DO jj = 1, jpjm1 
    247          zhv(:,jj) = 0.5_wp * ( zht(:,jj) + zht(:,jj+1) ) 
    248       END DO 
     245      DO_2D( 0, 0, 0, 0 ) 
     246         zhv(ji,jj) = 0.5_wp * ( zht(ji,jj) + zht(ji,jj+1) ) 
     247      END_2D 
    249248      CALL lbc_lnk( 'usrdef_zgr', zhv, 'V', 1. )     ! boundary condition: this mask the surrounding grid-points 
    250249      DO jj = mj0(1), mj1(1)   ! first  row of global domain only 
     
    281280         ht_0 = zht 
    282281         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 
     282         DO_2D( 1, 1, 1, 1 ) 
     283            IF( zht(ji,jj) <= -(rn_wdld - rn_wdmin2)) THEN 
     284               k_bot(ji,jj) = 0 
     285               k_top(ji,jj) = 0 
     286            ENDIF 
     287         END_2D 
    291288         ! 
    292289         !                                !* terrain-following coordinate with e3.(k)=cst) 
    293290         !                                !  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       
     291         DO_2D( 0, 0, 0, 0 ) 
     292            z1_jpkm1 = 1._wp / REAL( k_bot(ji,jj) - k_top(ji,jj) + 1 , wp) 
     293            DO jk = 1, jpk 
     294               zwet = MAX( zht(ji,jj), rn_wdmin1 ) 
     295               pdept(ji,jj,jk) = zwet * z1_jpkm1 * ( REAL( jk   , wp ) - 0.5_wp ) 
     296               pdepw(ji,jj,jk) = zwet * z1_jpkm1 * ( REAL( jk-1 , wp )          ) 
     297               pe3t (ji,jj,jk) = zwet * z1_jpkm1 
     298               pe3w (ji,jj,jk) = zwet * z1_jpkm1 
     299               zwet = MAX( zhu(ji,jj), rn_wdmin1 ) 
     300               pe3u (ji,jj,jk) = zwet * z1_jpkm1 
     301               pe3uw(ji,jj,jk) = zwet * z1_jpkm1 
     302               pe3f (ji,jj,jk) = zwet * z1_jpkm1 
     303               zwet = MAX( zhv(ji,jj), rn_wdmin1 ) 
     304               pe3v (ji,jj,jk) = zwet * z1_jpkm1 
     305               pe3vw(ji,jj,jk) = zwet * z1_jpkm1 
     306            END DO 
     307         END_2D      
    313308         CALL lbc_lnk( 'usrdef_zgr', pdept, 'T', 1. ) 
    314309         CALL lbc_lnk( 'usrdef_zgr', pdepw, 'T', 1. ) 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/tests/demo_cfgs.txt

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

    r10627 r13463  
    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.