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 8586 – NEMO

Changeset 8586


Ignore:
Timestamp:
2017-10-04T09:19:23+02:00 (7 years ago)
Author:
gm
Message:

#1911 (ENHANCE-09): PART I.3 - phasing with branch dev_r8183_ICEMODEL revision 8575

Location:
branches/2017/dev_r7881_ENHANCE09_RK3
Files:
48 added
38 deleted
148 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r7881_ENHANCE09_RK3/DOC/Namelists/nambdy_dta

    r7646 r8586  
    1111   bn_tem      = 'amm12_bdyT_tra',         24        , 'votemper',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    1212   bn_sal      = 'amm12_bdyT_tra',         24        , 'vosaline',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    13 ! for lim2 
    14 !   bn_frld    = 'amm12_bdyT_ice',         24        , 'ileadfra',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    15 !   bn_hicif   = 'amm12_bdyT_ice',         24        , 'iicethic',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    16 !   bn_hsnif   = 'amm12_bdyT_ice',         24        , 'isnowthi',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    1713! for lim3 
    1814!   bn_a_i     = 'amm12_bdyT_ice',         24        , 'ileadfra',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
  • branches/2017/dev_r7881_ENHANCE09_RK3/DOC/Namelists/namsbc

    r6997 r8586  
    1717                           !  =1 opa-sas OASIS coupling: multi executable configuration, OPA component 
    1818                           !  =2 opa-sas OASIS coupling: multi executable configuration, SAS component  
    19    nn_limflx = -1          !  LIM3 Multi-category heat flux formulation (use -1 if LIM3 is not used) 
    20                            !  =-1  Use per-category fluxes, bypass redistributor, forced mode only, not yet implemented coupled 
    21                            !  = 0  Average per-category fluxes (forced and coupled mode) 
    22                            !  = 1  Average and redistribute per-category fluxes, forced mode only, not yet implemented coupled 
    23                            !  = 2  Redistribute a single flux over categories (coupled mode only) 
    2419                     ! Sea-ice : 
    25    nn_ice      = 2         !  =0 no ice boundary condition   , 
     20   nn_ice      = 3         !  =0 no ice boundary condition   , 
    2621                           !  =1 use observed ice-cover      , 
    27                            !  =2 ice-model used                         ("key_lim3", "key_lim2", "key_cice") 
     22                           !  =2-3 ice-model used                       ("key_lim3", "key_lim2", "key_cice") 
    2823   nn_ice_embd = 1         !  =0 levitating ice (no mass exchange, concentration/dilution effect) 
    2924                           !  =1 levitating ice with mass and salt exchange but no presure effect 
  • branches/2017/dev_r7881_ENHANCE09_RK3/DOC/TexFiles/Chapters/Chap_SBC.tex

    r7646 r8586  
    12661266ice-ocean fluxes, that are combined with the air-sea fluxes using the ice fraction of  
    12671267each model cell to provide the surface ocean fluxes. Note that the activation of a  
    1268 sea-ice model is is done by defining a CPP key (\key{lim2}, \key{lim3} or \key{cice}).  
     1268sea-ice model is is done by defining a CPP key (\key{lim3} or \key{cice}).  
    12691269The activation automatically overwrites the read value of nn{\_}ice to its appropriate  
    12701270value ($i.e.$ $2$ for LIM-2, $3$ for LIM-3 or $4$ for CICE). 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/ARCH/arch-macport_osx_debug.fcm

    r7646 r8586  
    4242%NCDF_HOME           /opt/local 
    4343%HDF5_HOME           /opt/local 
    44 %XIOS_HOME           /Users/sflod/XIOS 
     44%XIOS_HOME           /Users/$( whoami )/xios-2.0 
    4545%OASIS_HOME          /not/defined 
    4646 
     
    5252%OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip 
    5353 
    54 %CPP               cpp-mp-4.9 
     54%CPP               cpp-mp-4.8 
    5555%FC                mpif90  
    5656#%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer -ffree-line-length-none -fbounds-check 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg

    r8568 r8586  
    270270!----------------------------------------------------------------------- 
    271271/ 
    272 !----------------------------------------------------------------------- 
    273 &namsbc_wave   ! External fields from wave model 
    274 !----------------------------------------------------------------------- 
    275 / 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/C1D_PAPA/cpp_C1D_PAPA.fcm

    r8215 r8586  
    1  bld::tool::fppkeys   key_c1d 
     1 bld::tool::fppkeys   key_c1d key_zdfgls 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/GYRE_PISCES/cpp_GYRE_PISCES.fcm

    r8215 r8586  
    1 bld::tool::fppkeys   key_top key_mpp_mpi key_nosignedzero 
     1bld::tool::fppkeys   key_top key_mpp_mpi 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/1_namelist_cfg

    r8568 r8586  
    2222&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    2323!-----------------------------------------------------------------------   
    24    ln_linssh   = .true.   !  =T  linear free surface  ==>>  model level are fixed in time 
     24   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    2525   nn_closea   =    0      !  remove (=0) or keep (=1) closed seas and lakes (ORCA) 
    2626   ! 
     
    4242   nn_ice      = 0         !  =0 no ice boundary condition   , 
    4343                           !  =1 use observed ice-cover      , 
    44                            !  =2 ice-model used                         ("key_lim3" or "key_lim2) 
     44                           !  =2 or 3 automatically for LIM3 or CICE    ("key_lim3" or "key_cice") 
    4545   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf) 
    4646   ln_ssr      = .false.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr) 
     
    8484&namagrif      !  AGRIF zoom                                            ("key_agrif") 
    8585!----------------------------------------------------------------------- 
     86   nn_cln_update =    1    !  baroclinic update frequency 
    8687/ 
    8788!----------------------------------------------------------------------- 
     
    103104   rn_ahtbbl   =  1000.    !  lateral mixing coefficient in the bbl  [m2/s] 
    104105   rn_gambbl   =  10.      !  advective bbl coefficient                 [s] 
    105 / 
    106106/ 
    107107!----------------------------------------------------------------------- 
     
    179179&namdyn_hpg    !   Hydrostatic pressure gradient option 
    180180!----------------------------------------------------------------------- 
     181   ln_hpg_sco  = .true.   !  s-coordinate (standard jacobian formulation) 
    181182/ 
    182183!----------------------------------------------------------------------- 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg

    r8568 r8586  
    104104/ 
    105105!----------------------------------------------------------------------- 
     106&namagrif      !  AGRIF zoom                                            ("key_agrif") 
     107!----------------------------------------------------------------------- 
     108   nn_cln_update =    3    !  baroclinic update frequency 
     109/ 
     110!----------------------------------------------------------------------- 
    106111&nambbc        !   bottom temperature boundary condition                (default: NO) 
    107112!----------------------------------------------------------------------- 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_ice_cfg

    r7823 r8586  
    11!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    2 !! LIM3 configuration namelist: Overwrites SHARED/namelist_ice_lim3_ref 
    3 !!              1 - Generic parameters                 (namicerun) 
    4 !!              2 - Diagnostics                        (namicediag) 
    5 !!              3 - Ice initialization                 (namiceini) 
    6 !!              4 - Ice discretization                 (namiceitd) 
    7 !!              5 - Ice dynamics and transport         (namicedyn) 
    8 !!              6 - Ice diffusion                      (namicehdf) 
    9 !!              7 - Ice thermodynamics                 (namicethd) 
    10 !!              8 - Ice salinity                       (namicesal) 
    11 !!              9 - Ice mechanical redistribution      (namiceitdme) 
    12 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     2!! ESIM configuration namelist: Overwrites SHARED/namelist_ice_lim3_ref 
     3!!              1 - Generic parameters                 (nampar) 
     4!!              2 - Ice thickness discretization       (namitd) 
     5!!              3 - Ice dynamics                       (namdyn) 
     6!!              4 - Ice ridging/rafting                (namdyn_rdgrft) 
     7!!              5 - Ice rheology                       (namdyn_rhg) 
     8!!              6 - Ice advection                      (namdyn_adv) 
     9!!              7 - Ice surface forcing                (namforcing) 
     10!!              8 - Ice thermodynamics                 (namthd) 
     11!!              9 - Ice heat diffusion                 (namthd_zdf) 
     12!!             10 - Ice lateral melting                (namthd_da) 
     13!!             11 - Ice growth in open water           (namthd_do) 
     14!!             12 - Ice salinity                       (namthd_sal) 
     15!!             13 - Ice melt ponds                     (nammp) 
     16!!             14 - Ice initialization                 (namini) 
     17!!             15 - Ice/snow albedos                   (namalb) 
     18!!             16 - Ice diagnostics                    (namdia) 
     19!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     20! 
    1321!------------------------------------------------------------------------------ 
    14 &namicerun     !   Generic parameters 
     22&nampar     !   Generic parameters 
    1523!------------------------------------------------------------------------------ 
    1624/ 
    1725!------------------------------------------------------------------------------ 
    18 &namicediag    !   Diagnostics 
     26&namitd     !   Ice discretization 
    1927!------------------------------------------------------------------------------ 
    2028/ 
    2129!------------------------------------------------------------------------------ 
    22 &namiceini     !   Ice initialization 
     30&namdyn     !   Ice dynamics 
    2331!------------------------------------------------------------------------------ 
    2432/ 
    2533!------------------------------------------------------------------------------ 
    26 &namiceitd     !   Ice discretization 
     34&namdyn_rdgrft  !   Ice ridging/rafting 
    2735!------------------------------------------------------------------------------ 
    2836/ 
    2937!------------------------------------------------------------------------------ 
    30 &namicedyn     !   Ice dynamics and transport 
     38&namdyn_rhg     !   Ice rheology 
    3139!------------------------------------------------------------------------------ 
    3240/ 
    3341!------------------------------------------------------------------------------ 
    34 &namicehdf     !   Ice horizontal diffusion 
     42&namdyn_adv     !   Ice advection 
    3543!------------------------------------------------------------------------------ 
    3644/ 
    3745!------------------------------------------------------------------------------ 
    38 &namicethd     !   Ice thermodynamics 
     46&namforcing     !   Ice surface forcing 
    3947!------------------------------------------------------------------------------ 
    4048/ 
    4149!------------------------------------------------------------------------------ 
    42 &namicesal     !   Ice salinity 
     50&namthd     !   Ice thermodynamics 
    4351!------------------------------------------------------------------------------ 
    4452/ 
    4553!------------------------------------------------------------------------------ 
    46 &namiceitdme   !   Ice mechanical redistribution (ridging and rafting) 
     54&namthd_zdf     !   Ice heat diffusion 
    4755!------------------------------------------------------------------------------ 
    4856/ 
     57!------------------------------------------------------------------------------ 
     58&namthd_da     !   Ice lateral melting 
     59!------------------------------------------------------------------------------ 
     60/ 
     61!------------------------------------------------------------------------------ 
     62&namthd_do     !   Ice growth in open water 
     63!------------------------------------------------------------------------------ 
     64/ 
     65!------------------------------------------------------------------------------ 
     66&namthd_sal     !   Ice salinity 
     67!------------------------------------------------------------------------------ 
     68/ 
     69!------------------------------------------------------------------------------ 
     70&nammp      !   Melt ponds 
     71!------------------------------------------------------------------------------ 
     72/ 
     73!------------------------------------------------------------------------------ 
     74&namini     !   Ice initialization 
     75!------------------------------------------------------------------------------ 
     76/ 
     77!------------------------------------------------------------------------------ 
     78&namalb     !   albedo parameters 
     79!------------------------------------------------------------------------------ 
     80/ 
     81!------------------------------------------------------------------------------ 
     82&namdia     !   Diagnostics 
     83!------------------------------------------------------------------------------ 
     84/ 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg

    r8568 r8586  
    1616      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    1717      cn_domcfg = "ORCA_R2_zps_domcfg"    ! domain configuration filename 
     18/ 
     19!----------------------------------------------------------------------- 
     20&namzgr        !   vertical coordinate 
     21!----------------------------------------------------------------------- 
     22   ln_zps      = .true.    !  z-coordinate - partial steps 
    1823/ 
    1924!----------------------------------------------------------------------- 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/ORCA2_OFF_TRC/EXP00/namelist_cfg

    r8568 r8586  
    1818      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    1919      cn_domcfg = "ORCA_R2_zps_domcfg"    ! domain configuration filename 
     20/ 
     21!----------------------------------------------------------------------- 
     22&namzgr        !   vertical coordinate 
     23!----------------------------------------------------------------------- 
     24   ln_zps      = .true.    !  z-coordinate - partial steps 
    2025/ 
    2126!----------------------------------------------------------------------- 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/file_def_nemo.xml

    r7635 r8586  
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
     23    <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4"> 
    2424     
    25       <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
     25      <file_group id="2ts" output_freq="2ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
    2626 
    2727      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files --> 
     
    3939      <file_group id="3d" output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files --> 
    4040       
    41       <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->    
     41      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->    
    4242    
    4343   <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > 
     
    110110 
    111111   <file id="file6" name_suffix="_icemod" description="ice variables" enabled=".true." > 
    112           <field field_ref="snowthic_cea"    name="snthic" /> 
    113           <field field_ref="icethic_cea"     name="sithic" /> 
    114112          <field field_ref="icevolu"         name="sivolu" /> 
    115           <field field_ref="snowvol"         name="snvolu" /> 
    116           <field field_ref="iceconc"         name="siconc" /> 
    117  
    118           <field field_ref="vfxbog"          name="vfxbog" /> 
    119           <field field_ref="vfxdyn"          name="vfxdyn" /> 
    120           <field field_ref="vfxopw"          name="vfxopw" /> 
    121           <field field_ref="vfxsni"          name="vfxsni" /> 
    122           <field field_ref="vfxsum"          name="vfxsum" /> 
    123           <field field_ref="vfxbom"          name="vfxbom" /> 
    124           <field field_ref="vfxres"          name="vfxres" /> 
    125           <field field_ref="vfxice"          name="vfxice" /> 
    126           <field field_ref="vfxsnw"          name="vfxsnw" /> 
    127           <field field_ref="vfxsub"          name="vfxsub" /> 
    128           <field field_ref="vfxspr"          name="vfxspr" /> 
    129  
    130           <field field_ref="icetrp"          name="sivtrp" /> 
    131           <field field_ref="snwtrp"          name="snvtrp" /> 
    132           <field field_ref="saltrp"          name="saltrp" /> 
    133           <field field_ref="deitrp"          name="deitrp" /> 
    134           <field field_ref="destrp"          name="destrp" /> 
    135  
    136           <field field_ref="sfxbri"          name="sfxbri" /> 
    137           <field field_ref="sfxdyn"          name="sfxdyn" /> 
    138           <field field_ref="sfxres"          name="sfxres" /> 
    139           <field field_ref="sfxbog"          name="sfxbog" /> 
    140           <field field_ref="sfxbom"          name="sfxbom" /> 
    141           <field field_ref="sfxsum"          name="sfxsum" /> 
    142           <field field_ref="sfxsni"          name="sfxsni" /> 
    143           <field field_ref="sfxopw"          name="sfxopw" /> 
    144           <field field_ref="sfx"             name="sfx"    /> 
    145  
    146           <field field_ref="hfxsum"          name="hfxsum"     /> 
    147           <field field_ref="hfxbom"          name="hfxbom"     /> 
    148           <field field_ref="hfxbog"          name="hfxbog"     /> 
    149           <field field_ref="hfxdif"          name="hfxdif"     /> 
    150           <field field_ref="hfxopw"          name="hfxopw"     /> 
    151           <field field_ref="hfxout"          name="hfxout"     /> 
    152           <field field_ref="hfxin"           name="hfxin"      /> 
    153           <field field_ref="hfxsnw"          name="hfxsnw"     /> 
    154           <field field_ref="hfxerr"          name="hfxerr"     /> 
    155           <field field_ref="hfxerr_rem"      name="hfxerr_rem" /> 
    156  
    157      <!-- ice-ocean heat flux from mass exchange --> 
    158           <field field_ref="hfxdyn"          name="hfxdyn" /> 
    159           <field field_ref="hfxres"          name="hfxres" /> 
    160           <field field_ref="hfxthd"          name="hfxthd" /> 
    161      <!-- ice-atm. heat flux from mass exchange --> 
    162           <field field_ref="hfxsub"          name="hfxsub" /> 
    163           <field field_ref="hfxspr"          name="hfxspr" /> 
    164  
    165      <!-- diags --> 
    166           <field field_ref="hfxdhc"          name="hfxdhc" /> 
    167           <field field_ref="hfxtur"          name="hfxtur" /> 
    168  
    169           <field field_ref="isst"            name="sst"    /> 
    170           <field field_ref="isss"            name="sss"    /> 
    171           <field field_ref="micesalt"        name="sisali" /> 
    172           <field field_ref="micet"           name="sitemp" /> 
    173           <field field_ref="icest"           name="sistem" /> 
    174           <field field_ref="icehc"           name="siheco" /> 
    175           <field field_ref="isnowhc"         name="snheco" /> 
    176           <field field_ref="miceage"         name="siages" /> 
    177  
    178           <field field_ref="uice_ipa"        name="sivelu" /> 
    179           <field field_ref="vice_ipa"        name="sivelv" /> 
    180           <field field_ref="icevel"          name="sivelo" /> 
    181           <field field_ref="idive"           name="sidive" /> 
    182           <field field_ref="ishear"          name="sishea" /> 
    183           <field field_ref="icestr"          name="sistre" /> 
    184  
    185           <field field_ref="ibrinv"          name="sibrin" /> 
    186           <field field_ref="icecolf"         name="sicolf" /> 
    187  
    188           <field field_ref="iceage_cat"      name="siagecat" /> 
    189           <field field_ref="iceconc_cat"     name="siconcat" /> 
    190           <field field_ref="icethic_cat"     name="sithicat" /> 
    191           <field field_ref="snowthic_cat"    name="snthicat" /> 
    192           <field field_ref="salinity_cat"    name="salincat" /> 
    193           <field field_ref="brinevol_cat"    name="sibricat" /> 
    194      <field field_ref="icetemp_cat"     name="sitemcat" /> 
    195      <field field_ref="snwtemp_cat"     name="sntemcat" /> 
    196113 
    197114   </file> 
    198  
    199         <file id="file7" name_suffix="_scalar" description="scalar variables" enabled=".true." > 
    200           <field field_ref="voltot"       name="scvoltot"   /> 
    201           <field field_ref="sshtot"       name="scsshtot"   /> 
    202           <field field_ref="sshsteric"    name="scsshste"   /> 
    203           <field field_ref="sshthster"    name="scsshtst"   /> 
    204           <field field_ref="masstot"      name="scmastot"   /> 
    205           <field field_ref="temptot"      name="sctemtot"   /> 
    206           <field field_ref="saltot"       name="scsaltot"   /> 
    207  
    208           <field field_ref="bgtemper"     name="bgtemper"   /> 
    209           <field field_ref="bgsaline"     name="bgsaline"   /> 
    210           <field field_ref="bgheatco"     name="bgheatco"   /> 
    211           <field field_ref="bgsaltco"     name="bgsaltco"   /> 
    212           <field field_ref="bgvolssh"     name="bgvolssh"   />  
    213           <field field_ref="bgvole3t"     name="bgvole3t"   /> 
    214           <field field_ref="bgfrcvol"     name="bgfrcvol"   /> 
    215           <field field_ref="bgfrctem"     name="bgfrctem"   /> 
    216           <field field_ref="bgfrcsal"     name="bgfrcsal"   /> 
    217  
    218           <field field_ref="ibgvoltot"    name="ibgvoltot"  /> 
    219           <field field_ref="sbgvoltot"    name="sbgvoltot"  /> 
    220           <field field_ref="ibgarea"      name="ibgarea"    /> 
    221           <field field_ref="ibgsaline"    name="ibgsaline"  /> 
    222           <field field_ref="ibgtemper"    name="ibgtemper"  /> 
    223           <field field_ref="ibgheatco"    name="ibgheatco"  /> 
    224           <field field_ref="sbgheatco"    name="sbgheatco"  /> 
    225           <field field_ref="ibgsaltco"    name="ibgsaltco"  /> 
    226  
    227           <field field_ref="ibgvfx"       name="ibgvfx"     /> 
    228           <field field_ref="ibgvfxbog"    name="ibgvfxbog"  /> 
    229           <field field_ref="ibgvfxopw"    name="ibgvfxopw"  /> 
    230           <field field_ref="ibgvfxsni"    name="ibgvfxsni"  /> 
    231           <field field_ref="ibgvfxdyn"    name="ibgvfxdyn"  /> 
    232           <field field_ref="ibgvfxbom"    name="ibgvfxbom"  /> 
    233           <field field_ref="ibgvfxsum"    name="ibgvfxsum"  /> 
    234           <field field_ref="ibgvfxres"    name="ibgvfxres"  /> 
    235           <field field_ref="ibgvfxspr"    name="ibgvfxspr"  /> 
    236           <field field_ref="ibgvfxsnw"    name="ibgvfxsnw"  /> 
    237           <field field_ref="ibgvfxsub"    name="ibgvfxsub"  /> 
    238  
    239           <field field_ref="ibgsfx"       name="ibgsfx"     /> 
    240           <field field_ref="ibgsfxbri"    name="ibgsfxbri"  /> 
    241           <field field_ref="ibgsfxdyn"    name="ibgsfxdyn"  /> 
    242           <field field_ref="ibgsfxres"    name="ibgsfxres"  /> 
    243           <field field_ref="ibgsfxbog"    name="ibgsfxbog"  /> 
    244           <field field_ref="ibgsfxopw"    name="ibgsfxopw"  /> 
    245           <field field_ref="ibgsfxsni"    name="ibgsfxsni"  /> 
    246           <field field_ref="ibgsfxbom"    name="ibgsfxbom"  /> 
    247           <field field_ref="ibgsfxsum"    name="ibgsfxsum"  /> 
    248  
    249           <field field_ref="ibghfxdhc"    name="ibghfxdhc"  /> 
    250           <field field_ref="ibghfxspr"    name="ibghfxspr"  /> 
    251  
    252           <field field_ref="ibghfxres"    name="ibghfxres"  /> 
    253           <field field_ref="ibghfxsub"    name="ibghfxsub"  /> 
    254           <field field_ref="ibghfxdyn"    name="ibghfxdyn"  /> 
    255           <field field_ref="ibghfxthd"    name="ibghfxthd"  /> 
    256           <field field_ref="ibghfxsum"    name="ibghfxsum"  /> 
    257           <field field_ref="ibghfxbom"    name="ibghfxbom"  /> 
    258           <field field_ref="ibghfxbog"    name="ibghfxbog"  /> 
    259           <field field_ref="ibghfxdif"    name="ibghfxdif"  /> 
    260           <field field_ref="ibghfxopw"    name="ibghfxopw"  /> 
    261           <field field_ref="ibghfxout"    name="ibghfxout"  /> 
    262           <field field_ref="ibghfxin"     name="ibghfxin"   /> 
    263           <field field_ref="ibghfxsnw"    name="ibghfxsnw"  /> 
    264  
    265           <field field_ref="ibgfrcvol"    name="ibgfrcvol"  /> 
    266           <field field_ref="ibgfrcsfx"    name="ibgfrcsfx"  /> 
    267           <field field_ref="ibgvolgrm"    name="ibgvolgrm"  /> 
    268  
    269         </file> 
    270115 
    271116   <!-- 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_ice_cfg

    r7404 r8586  
    11!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    2 !! LIM3 configuration namelist: Overwrites SHARED/namelist_ice_lim3_ref 
    3 !!              1 - Generic parameters                 (namicerun) 
    4 !!              2 - Diagnostics                        (namicediag) 
    5 !!              3 - Ice initialization                 (namiceini) 
    6 !!              4 - Ice discretization                 (namiceitd) 
    7 !!              5 - Ice dynamics and transport         (namicedyn) 
    8 !!              6 - Ice diffusion                      (namicehdf) 
    9 !!              7 - Ice thermodynamics                 (namicethd) 
    10 !!              8 - Ice salinity                       (namicesal) 
    11 !!              9 - Ice mechanical redistribution      (namiceitdme) 
    12 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     2!! ESIM configuration namelist: Overwrites SHARED/namelist_ice_lim3_ref 
     3!!              1 - Generic parameters                 (namice_run) 
     4!!              2 - Ice thickness discretization       (namice_itd) 
     5!!              3 - Ice dynamics                       (namice_dyn) 
     6!!              4 - Ice ridging/rafting                (namice_rdgrft) 
     7!!              5 - Ice rheology                       (namice_rhg) 
     8!!              6 - Ice advection                      (namice_adv) 
     9!!              7 - Ice thermodynamics                 (namice_thd) 
     10!!              8 - Ice salinity                       (namice_sal) 
     11!!              9 - Ice melt ponds                     (namice_mp) 
     12!!             10 - Ice initialization                 (namice_ini) 
     13!!             11 - Ice/snow albedos                   (namice_alb) 
     14!!             12 - Ice diagnostics                    (namice_dia) 
     15!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     16! 
    1317!------------------------------------------------------------------------------ 
    14 &namicerun     !   Generic parameters 
     18&namice_run     !   Generic parameters 
    1519!------------------------------------------------------------------------------ 
    1620/ 
    1721!------------------------------------------------------------------------------ 
    18 &namicediag    !   Diagnostics 
     22&namice_itd     !   Ice discretization 
    1923!------------------------------------------------------------------------------ 
    2024/ 
    2125!------------------------------------------------------------------------------ 
    22 &namiceini     !   Ice initialization 
     26&namice_dyn     !   Ice dynamics 
    2327!------------------------------------------------------------------------------ 
    2428/ 
    2529!------------------------------------------------------------------------------ 
    26 &namiceitd     !   Ice discretization 
     30&namice_rdgrft  !   Ice ridging/rafting 
    2731!------------------------------------------------------------------------------ 
    2832/ 
    2933!------------------------------------------------------------------------------ 
    30 &namicedyn     !   Ice dynamics and transport 
     34&namice_rhg     !   Ice rheology 
    3135!------------------------------------------------------------------------------ 
    3236/ 
    3337!------------------------------------------------------------------------------ 
    34 &namicehdf     !   Ice horizontal diffusion 
     38&namice_adv     !   Ice advection 
    3539!------------------------------------------------------------------------------ 
    3640/ 
    3741!------------------------------------------------------------------------------ 
    38 &namicethd     !   Ice thermodynamics 
     42&namice_thd     !   Ice thermodynamics 
    3943!------------------------------------------------------------------------------ 
    4044/ 
    4145!------------------------------------------------------------------------------ 
    42 &namicesal     !   Ice salinity 
     46&namice_sal     !   Ice salinity 
    4347!------------------------------------------------------------------------------ 
    4448/ 
    4549!------------------------------------------------------------------------------ 
    46 &namiceitdme   !   Ice mechanical redistribution (ridging and rafting) 
     50&namicemp      !   Melt ponds 
    4751!------------------------------------------------------------------------------ 
    4852/ 
     53!------------------------------------------------------------------------------ 
     54&namice_ini     !   Ice initialization 
     55!------------------------------------------------------------------------------ 
     56/ 
     57!------------------------------------------------------------------------------ 
     58&namice_alb     !   albedo parameters 
     59!------------------------------------------------------------------------------ 
     60/ 
     61!------------------------------------------------------------------------------ 
     62&namice_dia     !   Diagnostics 
     63!------------------------------------------------------------------------------ 
     64/ 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/SHARED/field_def_nemo-lim.xml

    r7767 r8586  
    1212      <field_group id="SBC" grid_ref="grid_T_2D" > <!-- time step automaticaly defined based on nn_fsbc --> 
    1313 
    14          <!-- LIM2(only) fields --> 
    15          <field id="qsr_ai_cea"   long_name="Air-Ice downward solar heat flux (cell average)"              standard_name="surface_downwelling_shortwave_flux_in_air"          unit="W/m2"         /> 
    16          <field id="qns_ai_cea"   long_name="Air-Ice downward non-solar heat flux (cell average)"                                                                             unit="W/m2"         /> 
    17          <field id="qla_ai_cea"   long_name="Air-Ice downward Latent heat flux (cell average)"             standard_name="surface_downward_latent_heat_flux"                  unit="W/m2"         />          
    18          <field id="qsr_io_cea"   long_name="Ice-Oce downward solar heat flux (cell average)"              standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"         /> 
    19          <field id="qns_io_cea"   long_name="Ice-Oce downward non-solar heat flux (cell average)"                                                                             unit="W/m2"         /> 
    20          <field id="iceprod_cea"  long_name="Ice production (cell average)"                                                                                                   unit="m/s"          /> 
    21          <field id="iiceconc"     long_name="Ice concentration"                                            standard_name="sea_ice_area_fraction"                              unit="1"            /> 
    22          <field id="ice_pres"     long_name="Ice presence"                                                                                                                    unit=""             /> 
    23          <field id="ist_cea"      long_name="Ice surface temperature (cell average)"                       standard_name="surface_temperature"                                unit="degC"         /> 
    24          <field id="ist_ipa"      long_name="Ice surface temperature (ice presence average)"               standard_name="surface_temperature"                                unit="degC"         /> 
    25          <field id="u_imasstr"    long_name="Sea-ice mass transport along i-axis"                          standard_name="sea_ice_x_transport"                                unit="kg/s"         /> 
    26          <field id="v_imasstr"    long_name="Sea-ice mass transport along j-axis"                          standard_name="sea_ice_y_transport"                                unit="kg/s"         /> 
     14         <!-- SIMIP LIM fields --> 
     15         <field id="icethick"     long_name="Sea-ice thickness per area"                           standard_name="sea_ice_thickness"                          unit="m"   /> 
     16         <field id="icethic"      long_name="Sea-ice thickness"                                    standard_name="sea_ice_thickness"                          unit="m"   /> 
     17         <field id="uice_mv"      long_name="X-component of sea ice velocity"                      standard_name="sea_ice_x_velocity"                         unit="m/s" />  
     18         <field id="vice_mv"      long_name="Y-component of sea ice velocity"                      standard_name="sea_ice_y_velocity"                         unit="m/s" />       
     19         <field id="icevel_mv"    long_name="Sea-ice speed"                                        standard_name="sea_ice_speed"                              unit="m/s" /> 
     20         <field id="icepres"      long_name="Fraction of time steps with sea ice"                  standard_name="sea_ice_time_fraction"                      unit=""             /> 
     21         <field id="iceconc"      long_name="Sea-ice area fraction"                                standard_name="sea_ice_area_fraction"                      unit=""             /> 
     22         <field id="iceconc_pct"  long_name="Sea-ice area fraction in percent"                     standard_name="sea_ice_area_fraction_in_percent"           unit="%"             > iceconc * 100. </field > 
     23         <field id="icemass"      long_name="Sea-ice mass per area"                                standard_name="sea_ice_amount"                             unit="kg/m2"        /> 
     24         <field id="icevolu"      long_name="Sea-ice volume per area"                              standard_name="sea_ice_thickness"                          unit="m"            /> 
     25         <field id="snomass"      long_name="Snow mass per area"                                   standard_name="liquid_water_content_of_surface_snow"       unit="kg/m2"        /> 
     26         <field id="snothic"      long_name="Snow thickness"                                       standard_name="surface_snow_thickness"                     unit="m"            /> 
     27 
     28         <field id="iceconc_cat_mv"     long_name="Sea-ice area fractions in thickness categories" standard_name="sea_ice_area_fraction_over_categories"      unit=""   grid_ref="grid_T_3D_ncatice" /> 
     29         <field id="iceconc_cat_pct_mv" long_name="Sea-ice area fractions in thickness categories" standard_name="sea_ice_area_fraction_over_categories"      unit="%"  grid_ref="grid_T_3D_ncatice"  > iceconc_cat_mv * 100. </field > 
     30         <field id="icethic_cat_mv"     long_name="Sea-ice thickness in thickness categories"      standard_name="sea_ice_thickness_over_categories"          unit="m"  grid_ref="grid_T_3D_ncatice" /> 
     31         <field id="snowthic_cat_mv"    long_name="Snow thickness in thickness categories"         standard_name="snow_thickness_over_categories"             unit="m"  grid_ref="grid_T_3D_ncatice" /> 
     32 
     33         <field id="icestK"       long_name="Surface temperature of sea ice"                       standard_name="sea_ice_surface_temperature"                unit="K"            />  
     34         <field id="icesntK"      long_name="Temperature at snow-ice interface"                    standard_name="sea_ice_snow_interface_temperature"         unit="K"            /> 
     35         <field id="icebotK"      long_name="Temperature at ice-ocean interface"                   standard_name="sea_ice_bottom_temperature"                 unit="K"            /> 
     36 
     37         <field id="iceage"       long_name="Age of sea ice"                                       standard_name="age_of_sea_ice"                             unit="s"            /> 
     38         <field id="icealb"       long_name="Sea-ice or snow albedo"                               standard_name="sea_ice_albedo"                             unit=""             /> 
     39         <field id="icesmass"     long_name="Mass of salt in sea ice per area"                     standard_name="sea_ice_salt_mass"                          unit="kg/m2"        /> 
     40         <field id="icesal"       long_name="Sea ice salinity"                                     standard_name="sea_ice_salinity"                           unit="g/kg"         /> 
     41         <field id="icefb"        long_name="Sea-ice freeboard"                                    standard_name="sea_ice_freeboard"                          unit="m"            /> 
     42 
     43         <field id="icehcneg"     long_name="Sea-ice heat content per unit area"  standard_name="integral_of_sea_ice_temperature_wrt_depth_expressed_as_heat_content" unit="J/m2" > (-1.0)*icehc </field> 
     44         <field id="isnhcneg"     long_name="Snow-heat content per unit area"     standard_name="thermal_energy_content_of_surface_snow"                              unit="J/m2" > </field> 
     45 
     46         <field id="wfxsum"       long_name="Freshwater flux from sea-ice surface"               standard_name="freshwater_flux_from_ice_surface"                   unit="kg/m2/s"      /> 
     47 
     48         <field id="afxthd"       long_name="sea-ice area fraction change from thermodynamics"   standard_name="tendency_of_sea_ice_area_fraction_due_to_dynamics"  unit="s-1"   /> 
     49         <field id="afxdyn"       long_name="sea-ice area fraction change from dynamics"         standard_name="tendency_of_sea_ice_area_fraction_due_to_dynamics"  unit="s-1"   /> 
     50 
     51         <field id="dmithd"       long_name="sea-ice mass change from thermodynamics"            standard_name="tendency_of_sea_ice_amount_due_to_thermodynamics"   unit="kg/m2/s" /> 
     52         <field id="dmidyn"       long_name="sea-ice mass change from dynamics"                  standard_name="tendency_of_sea_ice_amount_due_to_dynamics"         unit="kg/m2/s" /> 
     53         <field id="dmiopw"       long_name="sea-ice mass change through growth in supercooled open water (aka frazil)"   standard_name="tendency_of_sea_ice_amount_due_to_freezing_in_open_water"   unit="kg/m2/s" /> 
     54         <field id="dmibog"       long_name="sea-ice mass change through basal growth"           standard_name="tendency_of_sea_ice_amount_due_to_congelation_ice_accumulation"  unit="kg/m2/s" /> 
     55         <field id="dmisni"       long_name="sea-ice mass change through snow-to-ice conversion" standard_name="tendency_of_sea_ice_amount_due_to_snow_conversion"               unit="kg/m2/s" /> 
     56         <field id="dmtsub"       long_name="snow and sea ice mass change through sublimation"   standard_name="tendency_of_snow_and_ice_amount_due_to_sublimation"              unit="kg/m2/s" /> 
     57         <field id="dmssub"       long_name="sea-ice mass change through evaporation and sublimation" standard_name="water_evaporation_flux"                                     unit="kg/m2/s" /> 
     58         <field id="dmisub"       long_name="snow mass change through evaporation or sublimation"     standard_name="surface_snow_sublimation_flux"           unit="kg/m2/s" /> 
     59         <field id="dmisum"       long_name="sea-ice mass change through surface melting"        standard_name="tendency_of_sea_ice_amount_due_to_surface_melting"               unit="kg/m2/s" /> 
     60         <field id="dmibom"       long_name="sea-ice mass change through bottom melting"         standard_name="tendency_of_sea_ice_amount_due_to_basal_melting"                 unit="kg/m2/s" /> 
     61 
     62         <field id="dmsspr"       long_name="snow mass change through snow fall"                 standard_name="snowfall_flux"                                                   unit="kg/m2/s" /> 
     63         <field id="dmsmel"       long_name="snow mass change through melt"                      standard_name="surface_snow_melt_flux"                                          unit="kg/m2/s" /> 
     64         <field id="dmsdyn"       long_name="snow mass change through advection by sea-ice dynamics" standard_name="tendency_of_snow_mass_due_to_sea_ice_dynamics"               unit="kg/m2/s" /> 
     65         <field id="dmsssi"       long_name="snow mass change through snow-to-ice conversion"    standard_name="tendency_of_snow_mass_due_to_snow_to_ice_conversion"             unit="kg/m2/s" /> 
     66 
     67         <field id="hfxsenso"     long_name="Net sensible heat flux under sea ice"               standard_name="ice_ocean_heat_flux"                          unit="W/m2" /> 
     68         <field id="hfxconsu"     long_name="Net conductive heat flux in ice at the surface"     standard_name="conductive_heat_flux_at_sea_ice_surface"      unit="W/m2" />  
     69         <field id="hfxconbo"     long_name="Net conductive heat fluxes in ice at the bottom"    standard_name="conductive_heat_flux_at_sea_ice_bottom"       unit="W/m2" /> 
     70 
     71         <field id="sfx_mv"       long_name="Salt flux from sea ice"                             standard_name="salt_flux_from_ice"                           unit="kg/m2/s" /> 
     72         <field id="wfxtot"       long_name="Freshwater flux from sea ice"                       standard_name="freshwater_flux_from_ice"                     unit="kg/m2/s" />  
     73 
     74         <field id="utau_ice"     long_name="X-component of atmospheric stress on sea ice"       standard_name="surface_downward_x_stress"                    unit="N/m2"    /> 
     75         <field id="vtau_ice"     long_name="Y-component of atmospheric stress on sea ice"       standard_name="surface_downward_y_stress"                    unit="N/m2"    /> 
     76 
     77         <field id="utau_oi"      long_name="X-component of ocean stress on sea ice"             standard_name="sea_ice_base_upward_x_stress"                 unit="N/m2"    /> 
     78         <field id="vtau_oi"      long_name="Y-component of ocean stress on sea ice"             standard_name="sea_ice_base_upward_y_stress"                 unit="N/m2"    /> 
     79 
     80         <field id="icestr"       long_name="Compressive sea ice strength"                       standard_name="compressive_strength_of_sea_ice"              unit="N/m"     /> 
     81 
     82         <field id="dssh_dx"      long_name="Sea-surface tilt term in force balance (x-component)"  standard_name="sea_surface_tilt_force_on_sea_ice_x"       unit="N/m2"    /> 
     83         <field id="dssh_dy"      long_name="Sea-surface tilt term in force balance (y-component)"  standard_name="sea_surface_tilt_force_on_sea_ice_y"       unit="N/m2"    /> 
     84 
     85         <field id="corstrx"      long_name="Coriolis force term in force balance (x-component)"    standard_name="coriolis_force_on_sea_ice_x"               unit="N/m2"    /> 
     86         <field id="corstry"      long_name="Coriolis force term in force balance (y-component)"    standard_name="coriolis_force_on_sea_ice_y"               unit="N/m2"    /> 
     87 
     88         <field id="intstrx"      long_name="Internal stress term in force balance (x-component)"   standard_name="internal_stress_in_sea_ice_x"              unit="N/m2"    /> 
     89         <field id="intstry"      long_name="Internal stress term in force balance (y-component)"   standard_name="internal_stress_in_sea_ice_y"              unit="N/m2"    /> 
     90 
     91         <field id="xmtrpice"     long_name="X-component of ice mass transport"                  standard_name="ice_x_transport"                              unit="kg/s" /> 
     92         <field id="ymtrpice"     long_name="Y-component of ice mass transport"                  standard_name="ice_y_transport"                              unit="kg/s" /> 
     93 
     94         <field id="xmtrpsnw"     long_name="X-component of snw mass transport"                  standard_name="snw_x_transport"                              unit="kg/s" /> 
     95         <field id="ymtrpsnw"     long_name="Y-component of snw mass transport"                  standard_name="snw_y_transport"                              unit="kg/s" /> 
     96 
     97         <field id="xatrp"        long_name="X-component of ice area transport"                  standard_name="area_x_transport"                             unit="m2/s" /> 
     98         <field id="yatrp"        long_name="Y-component of ice area transport"                  standard_name="area_y_transport"                             unit="m2/s" /> 
     99 
     100         <field id="xmtrptot"     long_name="X-component of sea-ice mass transport"              standard_name="sea_ice_x_transport"                          unit="kg/s" > xmtrpice + xmtrpsnw </field> 
     101         <field id="ymtrptot"     long_name="Y-component of sea-ice mass transport"              standard_name="sea_ice_y_transport"                          unit="kg/s" > ymtrpice + ymtrpsnw </field> 
     102 
     103         <field id="normstr"      long_name="Average normal stress in sea ice"                   standard_name="average_normal_stress"                        unit="N/m"     /> 
     104         <field id="sheastr"      long_name="Maximum shear stress in sea ice"                    standard_name="maximum_shear_stress"                         unit="N/m"     /> 
     105 
     106         <field id="idive"        long_name="Divergence of the sea-ice velocity field"           standard_name="divergence_of_sea_ice_velocity"               unit="s-1"     /> 
     107         <field id="ishear"       long_name="Maximum shear of sea-ice velocity field"            standard_name="maximum_shear_of_sea_ice_velocity"            unit="s-1"     /> 
     108 
     109 
    27110 
    28111         <!-- LIM3 fields -->   
     112 
    29113         <field id="ice_cover"    long_name="Ice fraction"                                                 standard_name="sea_ice_area_fraction"                              unit="1"            /> 
    30   
    31          <field id="snowthic_cea" long_name="Snow thickness (cell average)"                                standard_name="surface_snow_thickness"                             unit="m"            /> 
    32          <field id="icethic_cea"  long_name="Ice thickness (cell average)"                                 standard_name="sea_ice_thickness"                                  unit="m"            /> 
    33  
    34          <field id="uice_ipa"     long_name="Ice velocity along i-axis at I-point (ice presence average)"  standard_name="sea_ice_x_velocity"                                 unit="m/s"          />       
    35          <field id="vice_ipa"     long_name="Ice velocity along j-axis at I-point (ice presence average)"  standard_name="sea_ice_y_velocity"                                 unit="m/s"          />                
    36          <field id="utau_ice"     long_name="Wind stress along i-axis over the ice at i-point"             standard_name="surface_downward_x_stress"                          unit="N/m2"         /> 
    37          <field id="vtau_ice"     long_name="Wind stress along j-axis over the ice at i-point"             standard_name="surface_downward_y_stress"                          unit="N/m2"         /> 
    38           
    39          <field id="iceconc"      long_name="ice concentration"                                            standard_name="sea_ice_area_fraction"                              unit="%"            /> 
     114         <field id="icepres"      long_name="Ice presence"                                                                                                                    unit=""             /> 
     115 
     116         <field id="uice_ipa"     long_name="X-component of sea ice velocity"                              standard_name="sea_ice_x_velocity"                                 unit="m/s"          />  
     117         <field id="vice_ipa"     long_name="Y-component of sea ice velocity"                              standard_name="sea_ice_y_velocity"                                 unit="m/s"          />       
     118         <field id="icevel"       long_name="Sea-ice speed"                                                standard_name="sea_ice_speed"                                      unit="m/s"          /> 
    40119          <field id="isst"         long_name="sea surface temperature"                                      standard_name="sea_surface_temperature"                            unit="degC"         /> 
    41120         <field id="isss"         long_name="sea surface salinity"                                         standard_name="sea_surface_salinity"                               unit="1e-3"         />  
     
    48127         <field id="qtr_ice"      long_name="solar heat flux transmitted through ice: sum over categories"                                                                    unit="W/m2"         /> 
    49128         <field id="qemp_ice"     long_name="Downward Heat Flux from E-P over ice"                                                                                            unit="W/m2"         /> 
    50          <field id="micesalt"     long_name="Mean ice salinity"                                                                                                               unit="1e-3"         /> 
    51          <field id="miceage"      long_name="Mean ice age"                                                                                                                    unit="years"        /> 
    52          <field id="alb_ice"      long_name="Mean albedo over sea ice"                                                                                                        unit=""             /> 
    53129         <field id="albedo"       long_name="Mean albedo over sea ice and ocean"                                                                                              unit=""             /> 
    54130 
     131    <field id="iceamp"       long_name="melt pond fraction"                                           standard_name="sea_ice_meltpond_fraction"                          unit="%"            />  
     132         <field id="icevmp"       long_name="melt pond volume"                                             standard_name="sea_ice_meltpond_volume"                            unit="m"            />  
     133 
     134         <field id="iceconc_cat"  long_name="Sea-ice area fractions in thickness categories"               unit=""   grid_ref="grid_T_3D_ncatice" /> 
     135         <field id="icethic_cat"  long_name="Sea-ice thickness in thickness categories"                    unit="m"  grid_ref="grid_T_3D_ncatice" /> 
     136         <field id="snowthic_cat" long_name="Snow thickness in thickness categories"                       unit="m"  grid_ref="grid_T_3D_ncatice" /> 
    55137         <field id="iceage_cat"   long_name="Ice age for categories"                                       unit="days"   grid_ref="grid_T_3D_ncatice" /> 
    56          <field id="iceconc_cat"  long_name="Ice concentration for categories"                             unit="%"      grid_ref="grid_T_3D_ncatice" /> 
    57          <field id="icethic_cat"  long_name="Ice thickness for categories"                                 unit="m"      grid_ref="grid_T_3D_ncatice" /> 
    58          <field id="snowthic_cat" long_name="Snow thicknessi for categories"                               unit="m"      grid_ref="grid_T_3D_ncatice" /> 
    59138         <field id="salinity_cat" long_name="Sea-Ice Bulk salinity for categories"                         unit="g/kg"   grid_ref="grid_T_3D_ncatice" /> 
    60139         <field id="brinevol_cat" long_name="Brine volume for categories"                                  unit="%"      grid_ref="grid_T_3D_ncatice" /> 
    61140         <field id="icetemp_cat"  long_name="Ice temperature for categories"                               unit="degC"   grid_ref="grid_T_3D_ncatice" /> 
    62141         <field id="snwtemp_cat"  long_name="Snow temperature for categories"                              unit="degC"   grid_ref="grid_T_3D_ncatice" /> 
     142         <field id="iceamp_cat"   long_name="Ice melt pond fraction for categories"                        unit="%"      grid_ref="grid_T_3D_ncatice" />  
     143         <field id="icevmp_cat"   long_name="Ice melt pond volume for categories"                          unit="m"      grid_ref="grid_T_3D_ncatice" />  
    63144 
    64145         <field id="micet"        long_name="Mean ice temperature"                                         unit="degC"     /> 
    65          <field id="icehc"        long_name="ice total heat content"                                       unit="10^9J"    />  
    66          <field id="isnowhc"      long_name="snow total heat content"                                      unit="10^9J"    /> 
     146         <field id="miceage"      long_name="Age of sea ice"                                               unit="s"        /> 
     147         <field id="micesalt"     long_name="Sea ice salinity"                                             unit="g/kg"     /> 
     148         <field id="icehc"        long_name="ice total heat content"                                       unit="J/m2"     />  
     149         <field id="isnowhc"      long_name="snow total heat content"                                      unit="J/m2"     /> 
    67150         <field id="icest"        long_name="ice surface temperature"                                      unit="degC"     /> 
    68151         <field id="ibrinv"       long_name="brine volume"                                                 unit="%"        /> 
    69152         <field id="icecolf"      long_name="frazil ice collection thickness"                              unit="m"        /> 
    70          <field id="icestr"       long_name="ice strength"                                                 unit="N/m"      /> 
    71          <field id="icevel"       long_name="ice velocity"                                                 unit="m/s"      /> 
    72          <field id="idive"        long_name="divergence"                                                   unit="1e-8s-1"  /> 
    73          <field id="ishear"       long_name="shear"                                                        unit="1e-8s-1"  /> 
    74          <field id="icevolu"      long_name="ice volume"                                                   unit="m"        /> 
    75153         <field id="snowvol"      long_name="snow volume"                                                  unit="m"        /> 
    76154         <field id="tau_icebfr"   long_name="ice friction on ocean bottom for landfast ice"                unit="N/2"      /> 
    77155 
    78          <field id="icetrp"       long_name="ice volume transport"                                         unit="m/day"          /> 
    79          <field id="snwtrp"       long_name="snw volume transport"                                         unit="m/day"          /> 
    80          <field id="saltrp"       long_name="salt content transport"                                       unit="1e-3*kg/m2/day" /> 
     156         <field id="icetrp"       long_name="ice mass transport"                                           unit="kg/m2/s"          /> 
     157         <field id="snwtrp"       long_name="snw mass transport"                                           unit="kg/m2/s"          /> 
     158         <field id="saltrp"       long_name="salt     transport"                                           unit="1e-3*kg/m2/s" /> 
    81159         <field id="deitrp"       long_name="advected ice enthalpy"                                        unit="W/m2"           /> 
    82160         <field id="destrp"       long_name="advected snw enthalpy"                                        unit="W/m2"           /> 
    83161 
    84          <field id="sfxbri"       long_name="brine salt flux"                                              unit="1e-3*kg/m2/day" /> 
    85          <field id="sfxdyn"       long_name="salt flux from ridging rafting"                               unit="1e-3*kg/m2/day" /> 
    86          <field id="sfxres"       long_name="salt flux from lipupdate (resultant)"                         unit="1e-3*kg/m2/day" /> 
    87          <field id="sfxbog"       long_name="salt flux from bot growth"                                    unit="1e-3*kg/m2/day" /> 
    88          <field id="sfxbom"       long_name="salt flux from bot melt"                                      unit="1e-3*kg/m2/day" /> 
    89          <field id="sfxsum"       long_name="salt flux from surf melt"                                     unit="1e-3*kg/m2/day" /> 
    90          <field id="sfxlam"       long_name="salt flux from lateral melt"                                  unit="1e-3*kg/m2/day" /> 
    91          <field id="sfxsni"       long_name="salt flux from snow-ice formation"                            unit="1e-3*kg/m2/day" /> 
    92          <field id="sfxopw"       long_name="salt flux from open water ice formation"                      unit="1e-3*kg/m2/day" /> 
    93          <field id="sfxsub"       long_name="salt flux from sublimation"                                   unit="1e-3*kg/m2/day" /> 
    94          <field id="sfx"          long_name="salt flux total"                                              unit="1e-3*kg/m2/day" /> 
    95  
    96          <field id="vfxbog"       long_name="daily bottom thermo ice prod."                                unit="m/day"   /> 
    97          <field id="vfxdyn"       long_name="daily  dynamic ice prod."                                     unit="m/day"   /> 
    98          <field id="vfxopw"       long_name="daily lateral thermo ice prod."                               unit="m/day"   /> 
    99          <field id="vfxsni"       long_name="daily snowice ice prod."                                      unit="m/day"   /> 
    100          <field id="vfxsum"       long_name="surface melt"                                                 unit="m/day"   /> 
    101          <field id="vfxlam"       long_name="lateral melt"                                                 unit="m/day"   /> 
    102          <field id="vfxbom"       long_name="bottom melt"                                                  unit="m/day"   /> 
    103          <field id="vfxres"       long_name="daily resultant ice prod./melting from limupdate"             unit="m/day"   /> 
    104          <field id="vfxice"       long_name="ice melt/growth"                                              unit="m/day"   /> 
    105          <field id="vfxsnw"       long_name="snw melt/growth"                                              unit="m/day"   /> 
    106          <field id="vfxsub"       long_name="snw sublimation"                                              unit="m/day"   /> 
    107          <field id="vfxsub_err"   long_name="excess of snw sublimation sent to ocean"                      unit="m/day"   /> 
    108          <field id="vfxspr"       long_name="snw precipitation on ice"                                     unit="m/day"   /> 
    109          <field id="vfxthin"      long_name="daily thermo ice prod. for thin ice(20cm) + open water"      unit="m/day"   /> 
    110  
    111          <field id="afxtot"       long_name="area tendency (total)"                                        unit="day-1"   /> 
    112          <field id="afxdyn"       long_name="area tendency (dynamics)"                                     unit="day-1"   /> 
    113          <field id="afxthd"       long_name="area tendency (thermo)"                                       unit="day-1"   /> 
     162         <field id="sfxbri"       long_name="salt flux from brines"                                        unit="1e-3*kg/m2/s" /> 
     163         <field id="sfxdyn"       long_name="salt flux from ridging rafting"                               unit="1e-3*kg/m2/s" /> 
     164         <field id="sfxres"       long_name="salt flux from lipupdate (resultant)"                         unit="1e-3*kg/m2/s" /> 
     165         <field id="sfxbog"       long_name="salt flux from bot growth"                                    unit="1e-3*kg/m2/s" /> 
     166         <field id="sfxbom"       long_name="salt flux from bot melt"                                      unit="1e-3*kg/m2/s" /> 
     167         <field id="sfxsum"       long_name="salt flux from surf melt"                                     unit="1e-3*kg/m2/s" /> 
     168         <field id="sfxlam"       long_name="salt flux from lateral melt"                                  unit="1e-3*kg/m2/s" /> 
     169         <field id="sfxsni"       long_name="salt flux from snow-ice formation"                            unit="1e-3*kg/m2/s" /> 
     170         <field id="sfxopw"       long_name="salt flux from open water ice formation"                      unit="1e-3*kg/m2/s" /> 
     171         <field id="sfxsub"       long_name="salt flux from sublimation"                                   unit="1e-3*kg/m2/s" /> 
     172         <field id="sfx"          long_name="Salt flux from sea ice"                                       unit="1e-3*kg/m2/s" /> 
     173 
     174         <field id="vfxbog"       long_name="bottom thermo ice prod."                                      unit="kg/m2/s"   /> 
     175         <field id="vfxdyn"       long_name="dynamic ice prod."                                            unit="kg/m2/s"   /> 
     176         <field id="vfxopw"       long_name="lateral thermo ice prod."                                     unit="kg/m2/s"   /> 
     177         <field id="vfxsni"       long_name="snowice ice prod."                                            unit="kg/m2/s"   /> 
     178         <field id="vfxsum"       long_name="surface melt"                                                 unit="kg/m2/s"   /> 
     179         <field id="vfxlam"       long_name="lateral melt"                                                 unit="kg/m2/s"   /> 
     180         <field id="vfxbom"       long_name="bottom melt"                                                  unit="kg/m2/s"   /> 
     181         <field id="vfxres"       long_name="resultant ice prod./melting"                                  unit="kg/m2/s"   /> 
     182         <field id="vfxice"       long_name="ice melt/growth"                                              unit="kg/m2/s"   /> 
     183         <field id="vfxsnw"       long_name="snw melt/growth"                                              unit="kg/m2/s"   /> 
     184         <field id="vfxsub"       long_name="snw sublimation"                                              unit="kg/m2/s"   /> 
     185         <field id="vfxsub_err"   long_name="excess of snw sublimation sent to ocean"                      unit="kg/m2/s"   /> 
     186         <field id="vfxspr"       long_name="snw precipitation on ice"                                     unit="kg/m2/s"   /> 
     187         <field id="vfxthin"      long_name="thermo ice prod. for thin ice(20cm) + open water"             unit="kg/m2/s"   /> 
     188 
     189         <field id="afxtot"       long_name="area tendency (total)"                                        unit="s-1"   /> 
    114190 
    115191         <field id="hfxsum"       long_name="heat fluxes causing surface ice melt"                         unit="W/m2"  /> 
     
    135211         <field id="hfxtur"       long_name="turbulent heat flux at the ice base"                          unit="W/m2" /> 
    136212 
    137     <!-- sbcssm variables --> 
     213        <!-- sbcssm variables --> 
    138214         <field id="sst_m"    unit="degC" /> 
    139215         <field id="sss_m"    unit="psu"  /> 
     
    144220         <field id="frq_m"    unit="-"    /> 
    145221 
     222         <!-- specific for rheology --> 
     223         <field id="isig1"        long_name="1st principal stress component for EVP rhg"                   unit="unitless" /> 
     224         <field id="isig2"        long_name="2nd principal stress component for EVP rhg"                   unit="unitless" /> 
     225         <field id="isig3"        long_name="convergence measure for EVP rheology (must be =1)"            unit="unitless" /> 
     226 
    146227      </field_group> 
    147228 
     
    149230      <field_group id="SBC_scalar"  grid_ref="grid_T_2D" > 
    150231         <!-- available with ln_limdiaout --> 
    151          <field id="ibgfrcvoltop"    long_name="global mean ice/snow forcing at interface ice/snow-atm (volume equivalent ocean volume)"   unit="km3"       /> 
    152          <field id="ibgfrcvolbot"    long_name="global mean ice/snow forcing at interface ice/snow-ocean (volume equivalent ocean volume)" unit="km3"       /> 
    153          <field id="ibgfrctemtop"    long_name="global mean heat on top of ice/snw/ocean-atm "                                             unit="1e20J"     /> 
    154          <field id="ibgfrctembot"    long_name="global mean heat below ice (on top of ocean) "                                             unit="1e20J"     /> 
    155          <field id="ibgfrcsal"       long_name="global mean ice/snow forcing (salt equivalent ocean volume)"                               unit="pss*km3"   /> 
    156          <field id="ibgfrchfxtop"    long_name="global mean heat flux on top of ice/snw/ocean-atm "                                        unit="W/m2"      /> 
    157          <field id="ibgfrchfxbot"    long_name="global mean heat flux below ice (on top of ocean) "                                        unit="W/m2"      /> 
     232         <field id="ibgfrcvoltop"    long_name="global mean ice/snow forcing at interface ice/snow-atm (volume equivalent ocean volume)"   unit="km3"        /> 
     233         <field id="ibgfrcvolbot"    long_name="global mean ice/snow forcing at interface ice/snow-ocean (volume equivalent ocean volume)" unit="km3"        /> 
     234         <field id="ibgfrctemtop"    long_name="global mean heat on top of ice/snw/ocean-atm "                                             unit="1e20J"      /> 
     235         <field id="ibgfrctembot"    long_name="global mean heat below ice (on top of ocean) "                                             unit="1e20J"      /> 
     236         <field id="ibgfrcsal"       long_name="global mean ice/snow forcing (salt equivalent ocean volume)"                               unit="pss*km3"    /> 
     237         <field id="ibgfrchfxtop"    long_name="global mean heat flux on top of ice/snw/ocean-atm "                                        unit="W/m2"       /> 
     238         <field id="ibgfrchfxbot"    long_name="global mean heat flux below ice (on top of ocean) "                                        unit="W/m2"       /> 
    158239  
    159          <field id="ibgvolume"       long_name="drift in ice/snow volume (equivalent ocean volume)"            unit="km3"        /> 
    160          <field id="ibgsaltco"       long_name="drift in ice salt content (equivalent ocean volume)"           unit="pss*km3"    /> 
    161          <field id="ibgheatco"       long_name="drift in ice/snow heat content"                                unit="1e20J"      /> 
    162          <field id="ibgheatfx"       long_name="drift in ice/snow heat flux"                                   unit="W/m2"       /> 
    163  
    164          <field id="ibgvol_tot"      long_name="global mean ice volume"                                        unit="km3"        /> 
    165          <field id="sbgvol_tot"      long_name="global mean snow volume"                                       unit="km3"        /> 
    166          <field id="ibgarea_tot"     long_name="global mean ice area"                                          unit="km2"        /> 
    167          <field id="ibgsalt_tot"     long_name="global mean ice salt content"                                  unit="1e-3*km3"   /> 
    168          <field id="ibgheat_tot"     long_name="global mean ice heat content"                                  unit="1e20J"      /> 
    169          <field id="sbgheat_tot"     long_name="global mean snow heat content"                                 unit="1e20J"      /> 
     240         <field id="ibgvolume"       long_name="drift in ice/snow volume (equivalent ocean volume)"                                        unit="km3"        /> 
     241         <field id="ibgsaltco"       long_name="drift in ice salt content (equivalent ocean volume)"                                       unit="pss*km3"    /> 
     242         <field id="ibgheatco"       long_name="drift in ice/snow heat content"                                                            unit="1e20J"      /> 
     243         <field id="ibgheatfx"       long_name="drift in ice/snow heat flux"                                                               unit="W/m2"       /> 
     244 
     245         <field id="ibgvol_tot"      long_name="global mean ice volume"                                                                    unit="km3"        /> 
     246         <field id="sbgvol_tot"      long_name="global mean snow volume"                                                                   unit="km3"        /> 
     247         <field id="ibgarea_tot"     long_name="global mean ice area"                                                                      unit="km2"        /> 
     248         <field id="ibgsalt_tot"     long_name="global mean ice salt content"                                                              unit="1e-3*km3"   /> 
     249         <field id="ibgheat_tot"     long_name="global mean ice heat content"                                                              unit="1e20J"      /> 
     250         <field id="sbgheat_tot"     long_name="global mean snow heat content"                                                             unit="1e20J"      /> 
     251 
     252         <field id="NH_iceextt"      long_name="Sea ice extent North"                            standard_name="sea_ice_extent_n"          unit="1e6_km2"    /> 
     253         <field id="SH_iceextt"      long_name="Sea ice extent South"                            standard_name="sea_ice_extent_s"          unit="1e6_km2"    /> 
     254         <field id="NH_icevolu"      long_name="Sea ice volume North"                            standard_name="sea_ice_volume_n"          unit="1e3_km3"    /> 
     255         <field id="SH_icevolu"      long_name="Sea ice volume South"                            standard_name="sea_ice_volume_s"          unit="1e3_km3"    /> 
     256         <field id="NH_icearea"      long_name="Sea ice area North"                              standard_name="sea_ice_area_n"            unit="1e6_km2"    /> 
     257         <field id="SH_icearea"      long_name="Sea ice area South"                              standard_name="sea_ice_area_s"            unit="1e6_km2"    /> 
     258 
     259         <field id="strait_mifl"     long_name="Sea ice mass flux through straits"      standard_name="sea_ice_mass_transport_across_line" unit="kg/s"  grid_ref="grid_4strait"   /> 
     260         <field id="strait_arfl"     long_name="Sea ice area flux through straits"      standard_name="sea_ice_area_transport_across_line" unit="m2/s"  grid_ref="grid_4strait"   />   
     261         <field id="strait_msfl"     long_name="Sea ice snow flux through straits"      standard_name="snow_mass_transport_across_line"    unit="kg/s"  grid_ref="grid_4strait"   /> 
     262 
    170263      </field_group> 
    171264   
     
    176269       
    177270      <field_group id="myvarICE" > 
    178          <field field_ref="icethic_cea"      name="sithic"     long_name="sea_ice_thickness"        /> 
     271         <field field_ref="icethick"          name="sithic"     long_name="sea_ice_thickness"        /> 
    179272         <field field_ref="icevolu"          name="sivolu"  /> 
    180273         <field field_ref="iceconc"          name="siconc"  /> 
    181274      </field_group>     
    182        
     275 
     276      <field_group id="ICE_globalbudget"> 
     277 
     278      <field field_ref="ibgvol_tot"     grid_ref="grid_1point"  name="ibgvol_tot"   /> 
     279       <field field_ref="sbgvol_tot"     grid_ref="grid_1point"  name="sbgvol_tot"   /> 
     280      <field field_ref="ibgarea_tot"    grid_ref="grid_1point"  name="ibgarea_tot"  /> 
     281      <field field_ref="ibgsalt_tot"    grid_ref="grid_1point"  name="ibgsalt_tot"  /> 
     282      <field field_ref="ibgheat_tot"    grid_ref="grid_1point"  name="ibgheat_tot"  /> 
     283      <field field_ref="sbgheat_tot"    grid_ref="grid_1point"  name="sbgheat_tot"  /> 
     284 
     285      <field field_ref="ibgvolume"      grid_ref="grid_1point"  name="ibgvolume"    /> 
     286      <field field_ref="ibgsaltco"      grid_ref="grid_1point"  name="ibgsaltco"    /> 
     287      <field field_ref="ibgheatco"      grid_ref="grid_1point"  name="ibgheatco"    /> 
     288        <field field_ref="ibgheatfx"      grid_ref="grid_1point"  name="ibgheatfx"    /> 
     289 
     290      <field field_ref="ibgfrcvoltop"   grid_ref="grid_1point"  name="ibgfrcvoltop" /> 
     291      <field field_ref="ibgfrcvolbot"   grid_ref="grid_1point"  name="ibgfrcvolbot" /> 
     292      <field field_ref="ibgfrctemtop"   grid_ref="grid_1point"  name="ibgfrctemtop" /> 
     293      <field field_ref="ibgfrctembot"   grid_ref="grid_1point"  name="ibgfrctembot" /> 
     294      <field field_ref="ibgfrcsal"      grid_ref="grid_1point"  name="ibgfrcsal"    /> 
     295        <field field_ref="ibgfrchfxtop"   grid_ref="grid_1point"  name="ibgfrchfxtop" /> 
     296        <field field_ref="ibgfrchfxbot"   grid_ref="grid_1point"  name="ibgfrchfxbot" /> 
     297 
     298      </field_group> 
     299 
     300 
     301      <!--============================--> 
     302      <!-- SIMIP sea ice field groups --> 
     303      <!-- Notz et al 2016            --> 
     304      <!--============================--> 
     305 
     306      <!-- SIMIP monthly scalar variables --> 
     307      <field_group id="SImon_scalars"> 
     308        <!-- Integrated quantities --> 
     309        <field field_ref="NH_iceextt"     grid_ref="grid_1point"  name="siextentn"    /> 
     310        <field field_ref="SH_iceextt"     grid_ref="grid_1point"  name="siextents"    /> 
     311        <field field_ref="NH_icevolu"     grid_ref="grid_1point"  name="sivoln"       /> 
     312        <field field_ref="SH_icevolu"     grid_ref="grid_1point"  name="sivols"       /> 
     313        <field field_ref="NH_icearea"     grid_ref="grid_1point"  name="siarean"      /> 
     314        <field field_ref="SH_icearea"     grid_ref="grid_1point"  name="siareas"      /> 
     315      </field_group> 
     316 
     317      <!-- SIMIP daily fields --> <field_group id="SIday_fields">  
     318          <field field_ref="icepres"          name="sitimefrac"   />  
     319          <field field_ref="iceconc_pct"      name="siconc"       />  
     320          <field field_ref="icethic"          name="sithick"      default_value="1.0e20" detect_missing_value="true" operation="average" />  
     321          <field field_ref="snothic"          name="sisnthick"    default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     322          <field field_ref="icestK"           name="sitemptop"    default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     323          <field field_ref="uice_mv"          name="siu"          default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     324          <field field_ref="vice_mv"          name="siv"          default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     325          <field field_ref="icevel_mv"        name="sispeed"      default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     326      </field_group> 
     327 
     328      <!-- SIMIP monthly fields --> 
     329      <field_group id="SImon_fields"> 
     330          <!-- Sea-ice state variables --> 
     331          <field field_ref="icepres"          name="sitimefrac"   /> 
     332          <field field_ref="iceconc_pct"      name="siconc"       /> 
     333          <field field_ref="icemass"          name="simass"       /> 
     334          <field field_ref="icethic"          name="sithick"      default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     335          <field field_ref="icevolu"          name="sivol"        /> 
     336          <field field_ref="snomass"          name="sisnmass"     default_value="1.0e20" detect_missing_value="true" operation="average" />  
     337          <field field_ref="snothic"          name="sisnthick"    default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     338    
     339          <!-- category-dependent fields --> 
     340          <field field_ref="iceconc_cat_pct_mv"  name="siitdconc"    default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     341          <field field_ref="icethic_cat_mv"      name="siitdthick"   default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     342          <field field_ref="snowthic_cat_mv"     name="siitdsnthick" default_value="1.0e20" detect_missing_value="true" operation="average"/> 
     343 
     344          <!-- additional state variables--> 
     345          <field field_ref="icestK"           name="sitemptop"    default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     346          <field field_ref="icesntK"          name="sitempsnic"   default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     347          <field field_ref="icebotK"          name="sitempbot"    default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     348          <field field_ref="iceage"           name="siage"        default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     349          <field field_ref="icesmass"         name="sisaltmass"   /> 
     350          <field field_ref="icesal"           name="sisali"       default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     351          <field field_ref="icefb"            name="sifb"         default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     352          <field field_ref="icehcneg"         name="sihc"         /> 
     353          <field field_ref="isnhcneg"         name="sisnhc"       default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     354 
     355          <!-- freshwater fluxes --> 
     356          <field field_ref="wfxtot"           name="siflfwbot"    default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     357          <field field_ref="wfxsum"           name="siflfwdrain"  default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     358 
     359          <!-- area balance --> 
     360          <field field_ref="afxthd"           name="sidconcth"    /> 
     361          <field field_ref="afxdyn"           name="sidconcdyn"   /> 
     362 
     363          <!-- mass balance --> 
     364          <field field_ref="dmithd"           name="sidmassth"    /> 
     365          <field field_ref="dmidyn"           name="sidmassdyn"   /> 
     366          <field field_ref="dmiopw"           name="sidmassgrowthwat" /> 
     367          <field field_ref="dmibog"           name="sidmassgrowthbot" /> 
     368          <field field_ref="dmisni"           name="sidmasssi"        /> 
     369          <field field_ref="dmisub"           name="sidmassevapsubl"  /> 
     370          <field field_ref="dmisum"           name="sidmassmelttop"   /> 
     371          <field field_ref="dmibom"           name="sidmassmeltbot"   /> 
     372          <field field_ref="dmsspr"           name="sndmasssnf"       /> 
     373          <field field_ref="dmsmel"           name="sndmassmelt"      /> 
     374          <field field_ref="dmssub"           name="sndmasssubl"      /> 
     375          <field field_ref="dmsdyn"           name="sndmassdyn"       /> 
     376          <field field_ref="dmsssi"           name="sndmasssi"        /> 
     377 
     378          <!-- heat balance --> 
     379          <field field_ref="hfxsenso"         name="siflsensupbot"    default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     380          <field field_ref="hfxconsu"         name="siflcondtop"      default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     381          <field field_ref="hfxconbo"         name="siflcondbot"      default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     382 
     383          <!-- salt balance --> 
     384          <field field_ref="sfx_mv"           name="siflsaltbot"      default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     385 
     386          <!-- sea-ice dynamics --> 
     387          <field field_ref="uice_mv"          name="siu"              default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     388          <field field_ref="vice_mv"          name="siv"              default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     389          <field field_ref="icevel_mv"        name="sispeed"          default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     390 
     391          <field field_ref="utau_ice"         name="sistrxdtop"       default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     392          <field field_ref="vtau_ice"         name="sistrydtop"       default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     393 
     394          <field field_ref="utau_oi"          name="sistrxubot"       default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     395          <field field_ref="vtau_oi"          name="sistryubot"       default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     396 
     397          <field field_ref="icestr"           name="sicompstren"      default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     398 
     399          <field field_ref="dssh_dx"          name="siforcetiltx"     default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     400          <field field_ref="dssh_dy"          name="siforcetilty"     default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     401 
     402          <field field_ref="corstrx"          name="siforcecoriolx"   default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     403          <field field_ref="corstry"          name="siforcecorioly"   default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     404 
     405          <field field_ref="intstrx"          name="siforceintstrx"   default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     406          <field field_ref="intstry"          name="siforceintstry"   default_value="1.0e20" detect_missing_value="true" operation="average" /> 
     407 
     408          <field field_ref="xmtrptot"         name="sidmasstranx"     /> 
     409          <field field_ref="ymtrptot"         name="sidmasstrany"     /> 
     410 
     411          <field field_ref="normstr"          name="sistresave"       default_value="1.0e20" detect_missing_value="true" operation="instant" /> 
     412          <field field_ref="sheastr"          name="sistremax"        default_value="1.0e20" detect_missing_value="true" operation="instant" /> 
     413 
     414          <field field_ref="idive"            name="sidivvel"         default_value="1.0e20" detect_missing_value="true" operation="instant" /> 
     415          <field field_ref="ishear"           name="sishevel"         default_value="1.0e20" detect_missing_value="true" operation="instant" /> 
     416 
     417          <!-- sea ice fluxes across straits: 2D arrays to be post-processed  --> 
     418          <field field_ref="xmtrpice"         name="simassacrossline_x" /> 
     419          <field field_ref="ymtrpice"         name="simassacrossline_y" /> 
     420          <field field_ref="xmtrpsnw"         name="snmassacrossline_x" /> 
     421          <field field_ref="ymtrpsnw"         name="snmassacrossline_y" /> 
     422          <field field_ref="xatrp"            name="siareaacrossline_x" /> 
     423          <field field_ref="yatrp"            name="siareaacrossline_y" /> 
     424 
     425      </field_group> 
     426 
    183427   </field_definition> 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/SHARED/field_def_nemo-opa.xml

    r8215 r8586  
    207207 
    208208         <!-- * variable related to ice shelf forcing * --> 
    209          <field id="fwfisf"       long_name="Ice shelf melting"                                            unit="Kg/m2/s"  /> 
     209         <field id="fwfisf"       long_name="Ice shelf melting"                             unit="kg/m2/s"  /> 
    210210         <field id="fwfisf3d"     long_name="Ice shelf melting"                             unit="kg/m2/s"  grid_ref="grid_T_3D" /> 
    211211         <field id="qlatisf"      long_name="Ice shelf latent heat flux"                    unit="W/m2"     /> 
     
    215215         <field id="isfgammat"    long_name="transfert coefficient for isf (temperature) "  unit="m/s"      /> 
    216216         <field id="isfgammas"    long_name="transfert coefficient for isf (salinity)    "  unit="m/s"      /> 
    217    <field id="stbl"         long_name="salinity in the Losh tbl                    "  unit="PSU"      /> 
     217         <field id="stbl"         long_name="salinity in the Losh tbl                    "  unit="PSU"      /> 
    218218         <field id="ttbl"         long_name="temperature in the Losh tbl                 "  unit="C"        /> 
    219219         <field id="utbl"         long_name="zonal current in the Losh tbl at T point    "  unit="m/s"      /> 
     
    238238         <field id="calving_cea"  long_name="Calving"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
    239239         <field id="iceberg_cea"  long_name="Iceberg"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  /> 
    240          <field id="iceshelf_cea"  long_name="Iceshelf"                                   standard_name="water_flux_into_sea_water_from_iceshelf"   unit="kg/m2/s"  /> 
     240         <field id="iceshelf_cea" long_name="Iceshelf"                                  standard_name="water_flux_into_sea_water_from_iceshelf"   unit="kg/m2/s"  /> 
     241 
    241242 
    242243         <!-- available if key_oasis3 + conservative method --> 
     
    253254         <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"     /> 
    254255         <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"     /> 
    255          <field id="hflx_cal_cea"  long_name="heat flux due to calving"                                 standard_name="heat_flux_into_sea_water_due_to_iceberg_thermodynamics"                        unit="W/m2"     /> 
     256         <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"     /> 
     257         <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"     /> 
     258         <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"     /> 
    256259         <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"  /> 
    257260         <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"  /> 
     
    307310         <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" /> 
    308311 
    309          <!-- variables available when ln_trabbl = T --> 
     312         <!-- uoce_eiv: available with key_trabbl --> 
    310313         <field id="uoce_bbl"     long_name="BBL ocean current along i-axis"    unit="m/s"  /> 
    311314         <field id="ahu_bbl"      long_name="BBL diffusive flux along i-axis"   unit="m3/s" /> 
     
    355358         <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" /> 
    356359 
    357          <!-- variables available when ln_trabbl = T --> 
     360         <!-- voce_eiv: available with key_trabbl --> 
    358361         <field id="voce_bbl"     long_name="BBL ocean current along j-axis"    unit="m/s"  /> 
    359362         <field id="ahv_bbl"      long_name="BBL diffusive flux along j-axis"   unit="m3/s" /> 
     
    390393         <field id="avm"          long_name="vertical eddy viscosity"     standard_name="ocean_vertical_momentum_diffusivity"   unit="m2/s" /> 
    391394 
    392          <!-- avs: if ln_zdfddm=F avs=avt --> 
     395         <!-- avs: available with key_zdfddm --> 
    393396         <field id="avs"          long_name="salt vertical eddy diffusivity"   standard_name="ocean_vertical_salt_diffusivity"   unit="m2/s" /> 
    394397         <field id="logavs"       long_name="logarithm of salt vertical eddy diffusivity"   standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" /> 
     
    398401         <field id="avm_evd"      long_name="convective enhancement of vertical viscosity"     standard_name="ocean_vertical_momentum_diffusivity_due_to_convection"   unit="m2/s" /> 
    399402 
    400          <!-- variables available with ln_zdfiwm =T --> 
     403         <!-- avt_tide: available with key_zdftmx --> 
     404         <field id="av_tide"      long_name="tidal vertical diffusivity"   standard_name="ocean_vertical_tracer_diffusivity_due_to_tides"   unit="m2/s" /> 
     405 
     406         <!-- variables available with key_zdftmx_new --> 
    401407         <field id="av_ratio"     long_name="S over T diffusivity ratio"            standard_name="salinity_over_temperature_diffusivity_ratio"                     unit="1"    /> 
    402408         <field id="av_wave"      long_name="wave-induced vertical diffusivity"     standard_name="ocean_vertical_tracer_diffusivity_due_to_internal_waves"         unit="m2/s" /> 
    403          <field id="bflx_iwm"     long_name="wave-induced buoyancy flux"            standard_name="buoyancy_flux_due_to_internal_waves"                             unit="W/kg" /> 
    404          <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" /> 
    405          <field id="emix_iwm"     long_name="power density available for mixing"    standard_name="power_available_for_mixing_from_breaking_internal_waves"         unit="W/kg" /> 
     409         <field id="bflx_tmx"     long_name="wave-induced buoyancy flux"            standard_name="buoyancy_flux_due_to_internal_waves"                             unit="W/kg" /> 
     410         <field id="pcmap_tmx"    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" /> 
     411         <field id="emix_tmx"     long_name="power density available for mixing"    standard_name="power_available_for_mixing_from_breaking_internal_waves"         unit="W/kg" /> 
    406412 
    407413         <!-- variables available with diaar5 -->    
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/SHARED/namelist_ice_lim3_ref

    r7813 r8586  
    11!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    2 !! LIM3 namelist:   
    3 !!              1 - Generic parameters                 (namicerun) 
    4 !!              2 - Diagnostics                        (namicediag) 
    5 !!              3 - Ice initialization                 (namiceini) 
    6 !!              4 - Ice discretization                 (namiceitd) 
    7 !!              5 - Ice dynamics and transport         (namicedyn) 
    8 !!              6 - Ice diffusion                      (namicehdf) 
    9 !!              7 - Ice thermodynamics                 (namicethd) 
    10 !!              8 - Ice salinity                       (namicesal) 
    11 !!              9 - Ice mechanical redistribution      (namiceitdme) 
     2!! ESIM namelist:   
     3!!              1 - Generic parameters                 (nampar) 
     4!!              2 - Ice thickness discretization       (namitd) 
     5!!              3 - Ice dynamics                       (namdyn) 
     6!!              4 - Ice ridging/rafting                (namdyn_rdgrft) 
     7!!              5 - Ice rheology                       (namdyn_rhg) 
     8!!              6 - Ice advection                      (namdyn_adv) 
     9!!              7 - Ice surface forcing                (namforcing) 
     10!!              8 - Ice thermodynamics                 (namthd) 
     11!!              9 - Ice heat diffusion                 (namthd_zdf) 
     12!!             10 - Ice lateral melting                (namthd_da) 
     13!!             11 - Ice growth in open water           (namthd_do) 
     14!!             12 - Ice salinity                       (namthd_sal) 
     15!!             13 - Ice melt ponds                     (nammp) 
     16!!             14 - Ice initialization                 (namini) 
     17!!             15 - Ice/snow albedos                   (namalb) 
     18!!             16 - Ice diagnostics                    (namdia) 
    1219!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    1320! 
    1421!------------------------------------------------------------------------------ 
    15 &namicerun     !   Generic parameters 
    16 !------------------------------------------------------------------------------ 
    17    jpl              =    5          !  number of ice  categories 
    18    nlay_i           =    2          !  number of ice  layers 
    19    nlay_s           =    1          !  number of snow layers (only 1 is working) 
    20    rn_amax_n        =   0.997       !  maximum tolerated ice concentration NH 
    21    rn_amax_s        =   0.997       !  maximum tolerated ice concentration SH 
    22    cn_icerst_in     = "restart_ice" !  suffix of ice restart name (input) 
    23    cn_icerst_out    = "restart_ice" !  suffix of ice restart name (output) 
    24    cn_icerst_indir  = "."           !  directory to read   input ice restarts 
    25    cn_icerst_outdir = "."           !  directory to write output ice restarts 
    26    ln_limthd        =  .true.       !  ice thermo   (T) or not (F) => DO NOT TOUCH UNLESS U KNOW WHAT U DO 
    27    ln_limdyn        =  .true.       !  ice dynamics (T) or not (F) => DO NOT TOUCH UNLESS U KNOW WHAT U DO 
    28    nn_limdyn        =   2           !     (ln_limdyn=T) switch for ice dynamics    
    29                                     !      2: total 
    30                                     !      1: advection only (no diffusion, no ridging/rafting) 
    31                                     !      0: advection only (as 1 but with prescribed velocity, bypass rheology) 
    32    rn_uice          =   0.00001     !     (nn_limdyn=0) ice u-velocity 
    33    rn_vice          =  -0.00001     !     (nn_limdyn=0) ice v-velocity 
    34 / 
    35 !------------------------------------------------------------------------------ 
    36 &namicediag    !   Diagnostics 
    37 !------------------------------------------------------------------------------ 
    38    ln_limdiachk   =  .false.        !  check online the heat, mass & salt budgets (T) or not (F) 
    39    ln_limdiahsb   =  .false.        !  output the heat, mass & salt budgets (T) or not (F) 
    40    ln_limctl      =  .false.        !  ice points output for debug (T or F) 
    41    iiceprt        =    10           !  i-index for debug 
    42    jiceprt        =    10           !  j-index for debug 
    43 / 
    44 !------------------------------------------------------------------------------ 
    45 &namiceini     !   Ice initialization 
    46 !------------------------------------------------------------------------------ 
    47                   ! -- limistate -- ! 
    48    ln_limini      = .true.          !  activate ice initialization (T) or not (F) 
    49    ln_limini_file = .false.         !  netcdf file provided for initialization (T) or not (F) 
    50    rn_thres_sst   =  2.0            !  maximum water temperature with initial ice (degC) 
    51    rn_hts_ini_n   =  0.3            !  initial real snow thickness (m), North 
    52    rn_hts_ini_s   =  0.3            !        "            "             South 
    53    rn_hti_ini_n   =  3.0            !  initial real ice thickness  (m), North 
    54    rn_hti_ini_s   =  1.0            !        "            "             South 
    55    rn_ati_ini_n   =  0.9            !  initial ice concentration   (-), North 
    56    rn_ati_ini_s   =  0.9            !        "            "             South 
    57    rn_smi_ini_n   =  6.3            !  initial ice salinity     (g/kg), North 
    58    rn_smi_ini_s   =  6.3            !        "            "             South 
    59    rn_tmi_ini_n   =  270.           !  initial ice/snw temperature (K), North 
    60    rn_tmi_ini_s   =  270.           !        "            "             South 
    61 / 
    62 !------------------------------------------------------------------------------ 
    63 &namiceitd     !   Ice discretization 
    64 !------------------------------------------------------------------------------ 
    65    nn_catbnd      =    2           !  computation of ice category boundaries based on 
    66                                    !      1: tanh function 
    67                                    !      2: h^(-alpha), function of rn_himean 
    68    rn_himean      =    2.0         !  expected domain-average ice thickness (m), nn_catbnd = 2 only 
    69 / 
    70 !------------------------------------------------------------------------------ 
    71 &namicedyn     !   Ice dynamics and transport 
    72 !------------------------------------------------------------------------------ 
    73                   ! -- limtrp & limadv -- ! 
    74    nn_limadv      =    0            !  choose the advection scheme (-1=Prather ; 0=Ultimate-Macho) 
    75    nn_limadv_ord  =    5            !  choose the order of the advection scheme (if nn_limadv=0) 
    76                   ! -- limitd_me -- ! 
    77    nn_icestr      =    0            !  ice strength parameteriztaion                       
    78                                     !     0: Hibler_79     P = pstar*<h>*exp(-c_rhg*A) 
    79                                     !     1: Rothrock_75   P = Cf*coeff*integral(wr.h^2)     
    80    rn_pe_rdg      =   17.0          !     (nn_icestr=1) ridging work divided by pot. energy change in ridging 
    81    rn_pstar       =    2.0e+04      !     (nn_icestr=0) ice strength thickness parameter (N/m2)  
    82    rn_crhg        =   20.0          !     (nn_icestr=0) ice strength conc. parameter (-) 
    83    ln_icestr_bvf  =    .false.      !     ice strength function brine volume (T) or not (F) 
    84                                     ! 
    85             ! -- limdyn & limrhg -- ! 
    86    rn_cio         =    5.0e-03      !  ice-ocean drag coefficient (-) 
    87    rn_creepl      =    1.0e-12      !  creep limit (s-1) 
    88    rn_ecc         =    2.0          !  eccentricity of the elliptical yield curve           
    89    nn_nevp        =  120            !  number of EVP subcycles                              
    90    rn_relast      =    0.333        !  ratio of elastic timescale to ice time step: Telast = dt_ice * rn_relast  
    91                                     !     advised value: 1/3 (rn_nevp=120) or 1/9 (rn_nevp=300) 
    92    ln_landfast    =  .false.        !  landfast ice parameterization (T or F)                            
    93    rn_gamma       =    0.15         !     (ln_landfast=T)  fraction of ocean depth that ice must reach to initiate landfast 
    94                                     !                      recommended range: [0.1 ; 0.25] 
    95    rn_icebfr      =    10.          !     (ln_landfast=T)  maximum bottom stress per unit area of contact (N/m2)                  
    96                                     !                      a very large value ensures ice velocity=0 even with a small contact area 
    97                                     !                      recommended range: ?? (should be greater than atm-ice stress => >0.1 N/m2) 
    98    rn_lfrelax     =    1.e-5        !     (ln_landfast=T)  relaxation time scale to reach static friction (s-1)                  
    99 / 
    100 !------------------------------------------------------------------------------ 
    101 &namicehdf     !   Ice horizontal diffusion 
    102 !------------------------------------------------------------------------------ 
    103                      ! -- limhdf -- ! 
    104    nn_ahi0        =    -1           !  horizontal diffusivity computation 
    105                                     !    -1: no diffusion (bypass limhdf) 
    106                                     !     0: use rn_ahi0_ref 
    107                                     !     1: use rn_ahi0_ref x mean grid cell length / ( 2deg mean grid cell length ) 
    108                                     !     2: use rn_ahi0_ref x grid cell length      / ( 2deg mean grid cell length ) 
    109    rn_ahi0_ref    = 350.0           !  horizontal sea ice diffusivity (m2/s)  
    110                                     !     if nn_ahi0 > 0, rn_ahi0_ref is the reference value at a nominal 2 deg resolution 
    111 / 
    112 !------------------------------------------------------------------------------ 
    113 &namicethd     !   Ice thermodynamics 
    114 !------------------------------------------------------------------------------ 
    115                  ! -- limthd_dif -- ! 
    116    rn_kappa_i     = 1.0             !  radiation attenuation coefficient in sea ice (m-1) 
    117    nn_conv_dif    = 50              !  maximal number of iterations for heat diffusion computation 
    118    rn_terr_dif    = 1.0e-04         !  maximum temperature after heat diffusion (degC) 
    119    nn_ice_thcon   = 1               !  sea ice thermal conductivity 
    120                                     !     0: k = k0 + beta.S/T            (Untersteiner, 1964) 
    121                                     !     1: k = k0 + beta1.S/T - beta2.T (Pringle et al., 2007) 
    122    ln_it_qnsice   = .true.          !  iterate the surface non-solar flux with surface temperature (T) or not (F) 
    123    nn_monocat     = 0               !  virtual ITD mono-category parameterizations (1, jpl = 1 only) or not (0) 
    124                                     !     2: simple piling instead of ridging    --- temporary option 
    125                                     !     3: activate G(he) only                 --- temporary option 
    126                                     !     4: activate extra lateral melting only --- temporary option 
    127    rn_cdsn     = 0.31              !  thermal conductivity of the snow (0.31 W/m/K, Maykut and Untersteiner, 1971) 
    128                                    !  Obs: 0.1-0.5 (Lecomte et al, JAMES 2013) 
    129                   ! -- limthd_dh -- ! 
    130    ln_limdH       = .true.          !  activate ice thickness change from growing/melting (T) or not (F) => DO NOT TOUCH UNLESS U KNOW WHAT U DO 
    131    rn_betas       = 0.66            !  exponent in lead-ice repratition of snow precipitation 
    132                                     !     betas = 1 -> equipartition, betas < 1 -> more on leads 
    133                   ! -- limthd_da -- ! 
    134    ln_limdA       = .true.          !  activate lateral melting param. (T) or not (F) => DO NOT TOUCH UNLESS U KNOW WHAT U DO 
    135    rn_beta        = 1.0             !     (ln_latmelt=T) coef. beta for lateral melting param. Recommended range=[0.8-1.2] 
    136                                     !      => decrease = more melt and melt peaks toward higher concentration (A~0.5 for beta=1 ; A~0.8 for beta=0.2) 
    137                                     !         0.3 = best fit for western Fram Strait and Antarctica 
    138                                     !         1.4 = best fit for eastern Fram Strait       
    139    rn_dmin        = 8.              !     (ln_latmelt=T) minimum floe diameter for lateral melting param. Recommended range=[6-10] 
    140                                     !      => 6  vs 8m = +40% melting at the peak (A~0.5) 
    141                                     !         10 vs 8m = -20% melting 
    142                  ! -- limthd_lac -- ! 
    143    ln_limdO       = .true.          !  activate ice growth in open-water (T) or not (F) => DO NOT TOUCH UNLESS U KNOW WHAT U DO 
    144    rn_hnewice     = 0.1             !  thickness for new ice formation in open water (m) 
    145    ln_frazil      = .false.         !  Frazil ice parameterization (ice collection as a function of wind) 
    146    rn_maxfrazb    = 1.0             !     (ln_frazil=T) maximum fraction of frazil ice collecting at the ice base 
    147    rn_vfrazb      = 0.417           !     (ln_frazil=T) thresold drift speed for frazil ice collecting at the ice bottom (m/s) 
    148    rn_Cfrazb      = 5.0             !     (ln_frazil=T) squeezing coefficient for frazil ice collecting at the ice bottom 
    149                   ! -- limitd_th -- ! 
    150    rn_himin       = 0.1             !  minimum ice thickness (m) used in remapping, must be smaller than rn_hnewice 
    151 / 
    152 !------------------------------------------------------------------------------ 
    153 &namicesal     !   Ice salinity 
    154 !------------------------------------------------------------------------------ 
    155                  ! -- limthd_sal -- ! 
    156    ln_limdS       = .true.          !  activate gravity drainage and flushing (T) or not (F) => DO NOT TOUCH UNLESS U KNOW WHAT U DO 
    157    nn_icesal      =  2              !  ice salinity option 
    158                                     !     1: constant ice salinity (S=rn_icesal) 
    159                                     !     2: varying salinity parameterization S(z,t) 
    160                                     !     3: prescribed salinity profile S(z), Schwarzacher, 1959 
    161    rn_icesal      =  4.             !    (nn_icesal=1) ice salinity (g/kg) 
    162    rn_sal_gd      =  5.             !  restoring ice salinity, gravity drainage (g/kg) 
    163    rn_time_gd     =  1.73e+6        !  restoring time scale, gravity drainage  (s) 
    164    rn_sal_fl      =  2.             !  restoring ice salinity, flushing (g/kg) 
    165    rn_time_fl     =  8.64e+5        !  restoring time scale, flushing (s) 
    166    rn_simax       = 20.             !  maximum tolerated ice salinity (g/kg) 
    167    rn_simin       =  0.1            !  minimum tolerated ice salinity (g/kg) 
    168 / 
    169 !------------------------------------------------------------------------------ 
    170 &namiceitdme   !   Ice mechanical redistribution (ridging and rafting) 
    171 !------------------------------------------------------------------------------ 
    172                   ! -- limitd_me -- ! 
    173    rn_cs          =   0.5           !  fraction of shearing energy contributing to ridging 
    174    nn_partfun     =   1             !  type of ridging participation function 
    175                                     !     0: linear      (Thorndike et al, 1975) 
    176                                     !     1: exponential (Lipscomb, 2007) 
    177    rn_gstar       =   0.15          !     (nn_partfun = 0) fractional area of thin ice being ridged  
    178    rn_astar       =   0.03          !     (nn_partfun = 1) exponential measure of ridging ice fraction [set to 0.05 if hstar=100] 
    179    ln_ridging     =   .true.        !  ridging activated (T) or not (F) => DO NOT TOUCH UNLESS U KNOW WHAT U DO 
    180    rn_hstar       =  25.0           !     (ln_ridging = T) determines the maximum thickness of ridged ice (m) (Hibler, 1980) 
    181    rn_por_rdg     =   0.3           !     (ln_ridging = T) porosity of newly ridged ice (Lepparanta et al., 1995) 
    182    rn_fsnowrdg    =   0.5           !     (ln_ridging = T) snow volume fraction that survives in ridging 
    183    ln_rafting     =   .true.        !  rafting activated (T) or not (F) => DO NOT TOUCH UNLESS U KNOW WHAT U DO 
    184    rn_hraft       =   0.75          !     (ln_rafting = T) threshold thickness for rafting (m) 
    185    rn_craft       =   5.0           !     (ln_rafting = T) squeezing coefficient used in the rafting function 
    186    rn_fsnowrft    =   0.5           !     (ln_rafting = T) snow volume fraction that survives in rafting 
    187 / 
     22&nampar     !   Generic parameters 
     23!------------------------------------------------------------------------------ 
     24   jpl              =   5             !  number of ice  categories 
     25   nlay_i           =   2             !  number of ice  layers 
     26   nlay_s           =   1             !  number of snow layers (only 1 is working) 
     27   nn_monocat       =   0             !  virtual ITD mono-category parameterizations (1-4 => jpl = 1 only) or not (0) 
     28                                      !     2: simple piling instead of ridging    --- temporary option 
     29                                      !     3: activate G(he) only                 --- temporary option 
     30                                      !     4: activate extra lateral melting only --- temporary option 
     31   ln_icedyn        = .true.          !  ice dynamics (T) or not (F) 
     32   ln_icethd        = .true.          !  ice thermo   (T) or not (F) 
     33   rn_amax_n        =   0.997         !  maximum tolerated ice concentration NH 
     34   rn_amax_s        =   0.997         !  maximum tolerated ice concentration SH 
     35   cn_icerst_in     = "restart_ice"   !  suffix of ice restart name (input) 
     36   cn_icerst_out    = "restart_ice"   !  suffix of ice restart name (output) 
     37   cn_icerst_indir  = "."             !  directory to read   input ice restarts 
     38   cn_icerst_outdir = "."             !  directory to write output ice restarts 
     39/ 
     40!------------------------------------------------------------------------------ 
     41&namitd     !   Ice discretization 
     42!------------------------------------------------------------------------------ 
     43   rn_himean        =   2.0           !  expected domain-average ice thickness (m) 
     44   rn_himin         =   0.1           !  minimum ice thickness (m) used in remapping 
     45/ 
     46!------------------------------------------------------------------------------ 
     47&namdyn     !   Ice dynamics 
     48!------------------------------------------------------------------------------ 
     49   ln_dynFULL       = .true.          !  dyn.: full ice dynamics               (rheology + advection + ridging/rafting + correction) 
     50   ln_dynRHGADV     = .false.         !  dyn.: no ridge/raft & no corrections  (rheology + advection) 
     51   ln_dynADV        = .false.         !  dyn.: only advection w prescribed vel.(rn_uvice + advection) 
     52      rn_uice       =   0.00001       !        prescribed ice u-velocity 
     53      rn_vice       =   0.            !        prescribed ice v-velocity 
     54   rn_ishlat        =   2.            !  free slip (0) ; partial slip (0-2) ; no slip (2) ; strong slip (>2) 
     55   ln_landfast      = .false.         !  landfast ice parameterization (T or F)                            
     56      rn_gamma      =   0.15          !     fraction of ocean depth that ice must reach to initiate landfast 
     57                                      !        recommended range: [0.1 ; 0.25] 
     58      rn_icebfr     =  10.            !     maximum bottom stress per unit area of contact [N/m2]                  
     59                                      !        a very large value ensures ice velocity=0 even with a small contact area 
     60                                      !        recommended range: ?? (should be greater than atm-ice stress => >0.1 N/m2) 
     61      rn_lfrelax    =   1.e-5         !     relaxation time scale to reach static friction [s-1] 
     62/ 
     63!------------------------------------------------------------------------------ 
     64&namdyn_rdgrft  !   Ice ridging/rafting 
     65!------------------------------------------------------------------------------ 
     66          ! -- ice_rdgrft_strength -- ! 
     67   ln_str_H79       = .true.          !  ice strength param.: Hibler_79   => P = pstar*<h>*exp(-c_rhg*A)                       
     68      rn_pstar      =   2.0e+04       !     ice strength thickness parameter [N/m2] 
     69      rn_crhg       =   20.0          !     ice strength conc. parameter (-) 
     70                   ! -- ice_rdgrft -- ! 
     71   rn_csrdg         =   0.5           !  fraction of shearing energy contributing to ridging 
     72              ! -- ice_rdgrft_prep -- ! 
     73   ln_partf_lin     = .false.         !  Linear ridging participation function (Thorndike et al, 1975) 
     74      rn_gstar      =   0.15          !     fractional area of thin ice being ridged  
     75   ln_partf_exp     = .true.          !  Exponential ridging participation function (Lipscomb, 2007) 
     76      rn_astar      =   0.03          !     exponential measure of ridging ice fraction [set to 0.05 if hstar=100] 
     77   ln_ridging       = .true.          !  ridging activated (T) or not (F) 
     78      rn_hstar      =  25.0           !     determines the maximum thickness of ridged ice [m] (Hibler, 1980) 
     79      rn_porordg    =   0.3           !     porosity of newly ridged ice (Lepparanta et al., 1995) 
     80      rn_fsnwrdg    =   0.5           !     snow volume fraction that survives in ridging 
     81      rn_fpndrdg    =   1.0           !     pond fraction that survives in ridging (small a priori) 
     82   ln_rafting       = .true.          !  rafting activated (T) or not (F) 
     83      rn_hraft      =   0.75          !     threshold thickness for rafting [m] 
     84      rn_craft      =   5.0           !     squeezing coefficient used in the rafting function 
     85      rn_fsnwrft    =   0.5           !     snow volume fraction that survives in rafting 
     86      rn_fpndrft    =   1.0           !     pond fraction that survives in rafting (0.5 a priori) 
     87/ 
     88!------------------------------------------------------------------------------ 
     89&namdyn_rhg     !   Ice rheology 
     90!------------------------------------------------------------------------------ 
     91   ln_rhg_EVP       = .true.          !  EVP rheology 
     92      rn_creepl     =   1.0e-12       !     creep limit [1/s] 
     93      rn_ecc        =   2.0           !     eccentricity of the elliptical yield curve           
     94      nn_nevp       = 120             !     number of EVP subcycles                              
     95      rn_relast     =   0.333         !     ratio of elastic timescale to ice time step: Telast = dt_ice * rn_relast  
     96                                      !        advised value: 1/3 (rn_nevp=120) or 1/9 (rn_nevp=300) 
     97/ 
     98!------------------------------------------------------------------------------ 
     99&namdyn_adv     !   Ice advection 
     100!------------------------------------------------------------------------------ 
     101   ln_adv_Pra       = .false.         !  Advection scheme (Prather) 
     102   ln_adv_UMx       = .true.          !  Advection scheme (Ultimate-Macho) 
     103      nn_UMx        =   5             !     order of the scheme for UMx (1-5 ; 20=centered 2nd order) 
     104/ 
     105!------------------------------------------------------------------------------ 
     106&namforcing     !   Ice surface forcing 
     107!------------------------------------------------------------------------------ 
     108   rn_cio           =   5.0e-03       !  ice-ocean drag coefficient (-) 
     109   rn_blow_s        =   0.66          !  mesure of snow blowing into the leads 
     110                                      !     = 1 => no snow blowing, < 1 => some snow blowing 
     111   nn_iceflx        =  -1             !  Redistribute heat flux over ice categories 
     112                                      !     =-1  Do nothing (needs N(cat) fluxes) 
     113                                      !          ==> forced mode only 
     114                                      !     = 0  Average N(cat) fluxes then apply the average over the N(cat) ice 
     115                                      !          ==> forced and coupled modes 
     116                                      !     = 1  Average N(cat) fluxes then redistribute over the N(cat) ice using T-ice and albedo sensitivity 
     117                                      !          ==> forced mode only 
     118                                      !     = 2  Redistribute a single flux over categories 
     119                                      !          ==> coupled mode only 
     120/ 
     121!------------------------------------------------------------------------------ 
     122&namthd     !   Ice thermodynamics 
     123!------------------------------------------------------------------------------ 
     124   ln_icedH         = .true.          !  activate ice thickness change from growing/melting (T) or not (F) 
     125   ln_icedA         = .true.          !  activate lateral melting param. (T) or not (F) 
     126   ln_icedO         = .true.          !  activate ice growth in open-water (T) or not (F) 
     127   ln_icedS         = .true.          !  activate gravity drainage and flushing (T) or not (F) 
     128/ 
     129!------------------------------------------------------------------------------ 
     130&namthd_zdf     !   Ice heat diffusion 
     131!------------------------------------------------------------------------------ 
     132   ln_zdf_Beer      = .true.          !  Heat diffusion follows a Beer law 
     133   ln_cndi_U64      = .false.         !  sea ice thermal conductivity: k = k0 + beta.S/T            (Untersteiner, 1964) 
     134   ln_cndi_P07      = .true.          !  sea ice thermal conductivity: k = k0 + beta1.S/T - beta2.T (Pringle et al., 2007) 
     135   rn_cnd_s         =   0.31          !  thermal conductivity of the snow (0.31 W/m/K, Maykut and Untersteiner, 1971) 
     136                                      !     Obs: 0.1-0.5 (Lecomte et al, JAMES 2013) 
     137   rn_kappa_i       =   1.0           !  radiation attenuation coefficient in sea ice [1/m] 
     138   ln_dqns_i        = .true.          !  change the surface non-solar flux with surface temperature (T) or not (F) 
     139/ 
     140!------------------------------------------------------------------------------ 
     141&namthd_da     !   Ice lateral melting 
     142!------------------------------------------------------------------------------ 
     143   rn_beta          =   1.0           !  coef. beta for lateral melting param. Recommended range=[0.8-1.2] 
     144                                      !   => decrease = more melt and melt peaks toward higher concentration (A~0.5 for beta=1 ; A~0.8 for beta=0.2) 
     145                                      !      0.3 = best fit for western Fram Strait and Antarctica 
     146                                      !      1.4 = best fit for eastern Fram Strait       
     147   rn_dmin          =   8.            !  minimum floe diameter for lateral melting param. Recommended range=[6-10] 
     148                                      !   => 6  vs 8m = +40% melting at the peak (A~0.5) 
     149                                      !      10 vs 8m = -20% melting 
     150/ 
     151!------------------------------------------------------------------------------ 
     152&namthd_do     !   Ice growth in open water 
     153!------------------------------------------------------------------------------ 
     154   rn_hinew         =   0.1           !  thickness for new ice formation in open water (m), must be larger than rn_hnewice 
     155   ln_frazil        = .false.         !  Frazil ice parameterization (ice collection as a function of wind) 
     156      rn_maxfraz    =   1.0           !     maximum fraction of frazil ice collecting at the ice base 
     157      rn_vfraz      =   0.417         !     thresold drift speed for frazil ice collecting at the ice bottom (m/s) 
     158      rn_Cfraz      =   5.0           !     squeezing coefficient for frazil ice collecting at the ice bottom 
     159/ 
     160!------------------------------------------------------------------------------ 
     161&namthd_sal     !   Ice salinity 
     162!------------------------------------------------------------------------------ 
     163   nn_icesal        =   2             !  ice salinity option 
     164                                      !     1: constant ice salinity (S=rn_icesal) 
     165                                      !     2: varying salinity parameterization S(z,t) 
     166                                      !     3: prescribed salinity profile S(z), Schwarzacher, 1959 
     167   rn_icesal        =   4.            !    (nn_icesal=1) ice salinity (g/kg) 
     168   rn_sal_gd        =   5.            !  restoring ice salinity, gravity drainage (g/kg) 
     169   rn_time_gd       =   1.73e+6       !  restoring time scale, gravity drainage  (s) 
     170   rn_sal_fl        =   2.            !  restoring ice salinity, flushing (g/kg) 
     171   rn_time_fl       =   8.64e+5       !  restoring time scale, flushing (s) 
     172   rn_simax         =  20.            !  maximum tolerated ice salinity (g/kg) 
     173   rn_simin         =   0.1           !  minimum tolerated ice salinity (g/kg) 
     174/ 
     175!------------------------------------------------------------------------------ 
     176&nammp      !   Melt ponds 
     177!------------------------------------------------------------------------------ 
     178   ln_pnd           = .false.         !  active melt ponds 
     179   ln_pnd_rad       = .false.         !  active melt ponds radiative coupling 
     180   ln_pnd_fw        = .false.         !  active melt ponds freshwater coupling 
     181   nn_pnd_scheme    =   0             !  type of melt pond scheme  : =0 prescribed ( Tsu=0 ), =1 empirical, =2 topographic 
     182   rn_apnd          =   0.2           !  prescribed pond fraction, at Tsu=0  : (0<rn_apnd<1, nn_pnd_scheme = 0) 
     183   rn_hpnd          =   0.05          !  prescribed pond depth, at Tsu=0     : (0<rn_apnd<1, nn_pnd_scheme = 0) 
     184/ 
     185!------------------------------------------------------------------------------ 
     186&namini     !   Ice initialization 
     187!------------------------------------------------------------------------------ 
     188   ln_iceini        = .true.          !  activate ice initialization (T) or not (F) 
     189   ln_iceini_file   = .false.         !  netcdf file provided for initialization (T) or not (F) 
     190   rn_thres_sst     =   2.0           !  max delta temp. above Tfreeze with initial ice = (sst - tfreeze) 
     191   rn_hts_ini_n     =   0.3           !  initial real snow thickness (m), North 
     192   rn_hts_ini_s     =   0.3           !        "            "             South 
     193   rn_hti_ini_n     =   3.0           !  initial real ice thickness  (m), North 
     194   rn_hti_ini_s     =   1.0           !        "            "             South 
     195   rn_ati_ini_n     =   0.9           !  initial ice concentration   (-), North 
     196   rn_ati_ini_s     =   0.9           !        "            "             South 
     197   rn_smi_ini_n     =   6.3           !  initial ice salinity     (g/kg), North 
     198   rn_smi_ini_s     =   6.3           !        "            "             South 
     199   rn_tmi_ini_n     = 270.            !  initial ice/snw temperature (K), North 
     200   rn_tmi_ini_s     = 270.            !        "            "             South 
     201 
     202   sn_hti = 'Ice_initialization'    , -12 ,'hti'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     203   sn_hts = 'Ice_initialization'    , -12 ,'hts'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     204   sn_ati = 'Ice_initialization'    , -12 ,'ati'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     205   sn_tsu = 'Ice_initialization'    , -12 ,'tsu'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     206   sn_tmi = 'Ice_initialization'    , -12 ,'tmi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     207   sn_smi = 'Ice_initialization'    , -12 ,'smi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     208   cn_dir='./' 
     209/ 
     210!------------------------------------------------------------------------------ 
     211&namalb     !   albedo parameters 
     212!------------------------------------------------------------------------------ 
     213   nn_ice_alb       =    1            !  parameterization of ice/snow albedo 
     214      !                               !  =0 : Shine & Henderson-Sellers (JGR 1985), giving clear-sky albedo 
     215      !                               !  =1 : "home made" based on Brandt et al. (JClim 2005) and 
     216      !                               !        Grenfell & Perovich (JGR 2004), giving cloud-sky albedo 
     217      !                               !  =2 : as 1 with melt ponds 
     218      !                               ! 
     219      !                               !  recommanded values depending on the param chosen: 
     220      !                               !             nn_ice_alb   !   =0   ! = 1 or 2 !  obs range (cloud-sky) ! 
     221      rn_alb_sdry      =   0.85       !  dry snow albedo         :  0.80  !   0.85   !  0.85 -- 0.87  
     222      rn_alb_smlt      =   0.75       !  melting snow albedo     :  0.65  !   0.75   !  0.72 -- 0.82  
     223      rn_alb_idry      =   0.60       !  dry ice albedo          :  0.72  !   0.60   !  0.54 -- 0.65  
     224      rn_alb_imlt      =   0.50       !  bare puddled ice albedo :  0.53  !   0.50   !  0.49 -- 0.58  
     225      rn_alb_dpnd      =   0.27       !  ponded ice albedo       :  0.25  !   0.27   !  0.10 -- 0.30  
     226/ 
     227!------------------------------------------------------------------------------ 
     228&namdia     !   Diagnostics 
     229!------------------------------------------------------------------------------ 
     230   ln_icediachk     = .false.         !  check online the heat, mass & salt budgets (T) or not (F) 
     231   ln_icediahsb     = .false.         !  output the heat, mass & salt budgets (T) or not (F) 
     232   ln_icectl        = .false.         !  ice points output for debug (T or F) 
     233   iiceprt          =  10             !  i-index for debug 
     234   jiceprt          =  10             !  j-index for debug 
     235/ 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/SHARED/namelist_ref

    r8568 r8586  
    44!! NEMO/OPA  :  1 - run manager      (namrun) 
    55!! namelists    2 - Domain           (namcfg, namdom, namtsd, namcrs, namc1d, namc1d_uvd) 
    6 !!              3 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_sas) 
    7 !!                                    namsbc_cpl, namtra_qsr, namsbc_rnf, 
    8 !!                                    namsbc_apr, namsbc_ssr, namsbc_alb, namsbc_wave) 
     6!!              3 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_cpl, 
     7!!                                    namsbc_sas, namtra_qsr, namsbc_rnf, 
     8!!                                    namberg, namsbc_isf, namsbc_iscpl,  
     9!!                                    namsbc_apr, namsbc_ssr, namsbc_wave) 
    910!!              4 - lateral boundary (namlbc, namagrif, nambdy, nambdy_tide) 
    1011!!              5 - bottom  boundary (namdrg, namdrg_top, namdrg_bot, nambbc, nambbl) 
     
    170171!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T) 
    171172!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T) 
    172 !!   namsbc_alb      albedo parameters 
    173173!!   namsbc_wave     external fields from wave model                    (ln_wave    =T) 
    174174!!   namberg         iceberg floats                                     (ln_icebergs=T) 
     
    188188   ln_mixcpl   = .false.   !  forced-coupled mixed formulation          ( requires key_oasis3 ) 
    189189   nn_components = 0       !  configuration of the opa-sas OASIS coupling 
    190                            !  =0 no opa-sas OASIS coupling: default single executable configuration 
    191                            !  =1 opa-sas OASIS coupling: multi executable configuration, OPA component 
    192                            !  =2 opa-sas OASIS coupling: multi executable configuration, SAS component  
    193    nn_limflx = -1          !  LIM3 Multi-category heat flux formulation (use -1 if LIM3 is not used) 
    194                            !  =-1  Use per-category fluxes, bypass redistributor, forced mode only, not yet implemented coupled 
    195                            !  = 0  Average per-category fluxes (forced and coupled mode) 
    196                            !  = 1  Average and redistribute per-category fluxes, forced mode only, not yet implemented coupled 
    197                            !  = 2  Redistribute a single flux over categories (coupled mode only) 
     190                           !  =0 no opa-sas OASIS coupling: default single executable config. 
     191                           !  =1 opa-sas OASIS coupling: multi executable config., OPA component 
     192                           !  =2 opa-sas OASIS coupling: multi executable config., SAS component  
    198193                     ! Sea-ice : 
    199    nn_ice      = 3         !  =0 no ice boundary condition   , 
     194   nn_ice      = 0         !  =0 no ice boundary condition   , 
    200195                           !  =1 use observed ice-cover      , 
    201                            !  =2 to 4 :  ice-model used (LIM2, LIM3 or CICE)                         ("key_lim3", "key_lim2", or "key_cice") 
    202    nn_ice_embd = 1         !  =0 levitating ice (no mass exchange, concentration/dilution effect) 
    203                            !  =1 levitating ice with mass and salt exchange but no presure effect 
    204                            !  =2 embedded sea-ice (full salt and mass exchanges and pressure) 
     196                           !  =2 or 3 automatically for LIM3 or CICE    ("key_lim3" or "key_cice") 
     197   ln_ice_embd = .false.   !  =T embedded sea-ice (pressure + mass and salt exchanges) 
     198                           !  =F levitating ice (no pressure, mass and salt exchanges) 
    205199                     ! Misc. options of sbc :  
    206200   ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr) 
     
    261255   rn_pfac     = 1.        !  multiplicative factor for precipitation (total & snow) 
    262256   rn_efac     = 1.        !  multiplicative factor for evaporation (0. or 1.) 
    263    rn_vfac     = 0.        !  multiplicative factor for ocean/ice velocity 
    264    !                       !  in the calculation of the wind stress (0.=absolute winds or 1.=relative winds) 
    265    ln_Cd_L12   = .false.   !  air-ice and ocean-ice function of ice concentration (Lupkes et al. JGR 2012) 
     257   rn_vfac     = 0.        !  multiplicative factor for ocean & ice velocity used to 
     258   !                       !  calculate the wind stress (0.=absolute or 1.=relative winds) 
     259   ln_Cd_L12   = .false.   !  air-ice and ocean-ice drags = F(ice concentration) (Lupkes et al. JGR 2012) 
    266260/ 
    267261!----------------------------------------------------------------------- 
     
    310304!              !  file name  ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    311305!              !             !  (if <0  months)  !   name    !  (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    312    l_sasread   = .TRUE.   ! Read fields in a file if .TRUE. , or initialize to 0. in sbcssm.F90 if .FALSE. 
    313    sn_usp      = 'sas_grid_U',     120           , 'vozocrtx',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    314    sn_vsp      = 'sas_grid_V',     120           , 'vomecrty',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     306   sn_usp      = 'sas_grid_U',     120           , 'uos'     ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     307   sn_vsp      = 'sas_grid_V',     120           , 'vos'     ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    315308   sn_tem      = 'sas_grid_T',     120           , 'sosstsst',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    316309   sn_sal      = 'sas_grid_T',     120           , 'sosaline',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     
    319312   sn_frq      = 'sas_grid_T',     120           , 'frq_m'   ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    320313 
     314   l_sasread   = .true.    !  =T Read the above fields in a file, =F initialize to 0. in sbcssm.F90 if .FALSE. 
    321315   ln_3d_uve   = .true.    !  specify whether we are supplying a 3D u,v and e3 field 
    322316   ln_read_frq = .false.   !  specify whether we must read frq or not 
     
    338332   rn_si0      =   0.35    !  RGB & 2 bands: shortess depth of extinction 
    339333   rn_si1      =   23.0    !  2 bands: longest depth of extinction 
    340    ln_qsr_ice  = .true.    !  light penetration for ice-model LIM3 
    341334/ 
    342335!----------------------------------------------------------------------- 
     
    434427/ 
    435428!----------------------------------------------------------------------- 
    436 &namsbc_alb    !   albedo parameters 
    437 !----------------------------------------------------------------------- 
    438    nn_ice_alb   =    1   !  parameterization of ice/snow albedo 
    439    !                     !     0: Shine & Henderson-Sellers (JGR 1985), giving clear-sky albedo 
    440    !                     !     1: "home made" based on Brandt et al. (JClim 2005) and Grenfell & Perovich (JGR 2004), 
    441    !                     !        giving cloud-sky albedo 
    442    rn_alb_sdry  =  0.85  !  dry snow albedo         : 0.80 (nn_ice_alb = 0); 0.85 (nn_ice_alb = 1); obs 0.85-0.87 (cloud-sky) 
    443    rn_alb_smlt  =  0.75  !  melting snow albedo     : 0.65 ( '' )          ; 0.75 ( '' )          ; obs 0.72-0.82 ( '' ) 
    444    rn_alb_idry  =  0.60  !  dry ice albedo          : 0.72 ( '' )          ; 0.60 ( '' )          ; obs 0.54-0.65 ( '' ) 
    445    rn_alb_imlt  =  0.50  !  bare puddled ice albedo : 0.53 ( '' )          ; 0.50 ( '' )          ; obs 0.49-0.58 ( '' ) 
    446 / 
    447 !----------------------------------------------------------------------- 
    448 &namsbc_wave   ! External fields from wave model                        (ln_wave =T) 
     429&namsbc_wave   ! External fields from wave model                        (ln_wave=T) 
    449430!----------------------------------------------------------------------- 
    450431!              !  file name  ! frequency (hours) ! variable     ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     
    579560   bn_tem      = 'amm12_bdyT_tra',         24        , 'votemper',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    580561   bn_sal      = 'amm12_bdyT_tra',         24        , 'vosaline',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    581 ! for lim2 
    582 !   bn_frld    = 'amm12_bdyT_ice',         24        , 'ileadfra',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    583 !   bn_hicif   = 'amm12_bdyT_ice',         24        , 'iicethic',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    584 !   bn_hsnif   = 'amm12_bdyT_ice',         24        , 'isnowthi',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    585562! for lim3 
    586563!   bn_a_i     = 'amm12_bdyT_ice',         24        , 'ileadfra',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    587 !   bn_ht_i    = 'amm12_bdyT_ice',         24        , 'iicethic',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    588 !   bn_ht_s    = 'amm12_bdyT_ice',         24        , 'isnowthi',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
     564!   bn_h_i     = 'amm12_bdyT_ice',         24        , 'iicethic',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
     565!   bn_h_s     = 'amm12_bdyT_ice',         24        , 'isnowthi',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    589566 
    590567   cn_dir      = 'bdydta/' !  root directory for the location of the bulk files 
     
    600577 
    601578!!====================================================================== 
    602 !!                ***  top/Bottom boundary condition  ***             !! 
     579!!                ***  Top/Bottom boundary condition  ***             !! 
    603580!!====================================================================== 
    604581!!   namdrg        top/bottom drag coefficient                          (default: NO selection) 
     
    782759!!                      ***  Dynamics namelists  ***                  !! 
    783760!!====================================================================== 
     761!!   nam_vvl       vertical coordinate options 
    784762!!   namdyn_adv    formulation of the momentum advection 
    785763!!   namdyn_vor    advection scheme 
     
    790768! 
    791769!----------------------------------------------------------------------- 
    792 &nam_vvl    !   vertical coordinate options                             (default: zstar) 
    793 !----------------------------------------------------------------------- 
    794    ln_vvl_zstar  = .true.           !  zstar vertical coordinate 
    795    ln_vvl_ztilde = .false.          !  ztilde vertical coordinate: only high frequency variations 
     770&nam_vvl    !   vertical coordinate options                             (default: z-star) 
     771!----------------------------------------------------------------------- 
     772   ln_vvl_zstar  = .true.           !  z-star vertical coordinate 
     773   ln_vvl_ztilde = .false.          !  z-tilde vertical coordinate: only high frequency variations 
    796774   ln_vvl_layer  = .false.          !  full layer vertical coordinate 
    797775   ln_vvl_ztilde_as_zstar = .false. !  ztilde vertical coordinate emulating zstar 
    798776   ln_vvl_zstar_at_eqtor  = .false. !  ztilde near the equator 
    799    rn_ahe3       = 0.0e0            !  thickness diffusion coefficient 
    800    rn_rst_e3t    = 30.e0            !  ztilde to zstar restoration timescale [days] 
    801    rn_lf_cutoff  = 5.0e0            !  cutoff frequency for low-pass filter  [days] 
    802    rn_zdef_max   = 0.9e0            !  maximum fractional e3t deformation 
     777   rn_ahe3       =  0.0e0           !  thickness diffusion coefficient 
     778   rn_rst_e3t    = 30.0e0           !  ztilde to zstar restoration timescale [days] 
     779   rn_lf_cutoff  =  5.0e0           !  cutoff frequency for low-pass filter  [days] 
     780   rn_zdef_max   =  0.9e0           !  maximum fractional e3t deformation 
    803781   ln_vvl_dbg    = .true.           !  debug prints    (T/F) 
    804782/ 
     
    942920   nn_pdl      =   1       !  Prandtl number function of richarson number (=1, avt=pdl(Ri)*avm) or not (=0, avt=avm) 
    943921   nn_mxl      =   2       !  mixing length: = 0 bounded by the distance to surface and bottom 
    944                            !                 = 1 bounded by the local vertical scale factor 
    945                            !                 = 2 first vertical derivative of mixing length bounded by 1 
    946                            !                 = 3 as =2 with distinct disspipative an mixing length scale 
     922   !                       !                 = 1 bounded by the local vertical scale factor 
     923   !                       !                 = 2 first vertical derivative of mixing length bounded by 1 
     924   !                       !                 = 3 as =2 with distinct disspipative an mixing length scale 
    947925   ln_mxl0     = .true.    !  surface mixing length scale = F(wind stress) (T) or not (F) 
    948926   rn_mxl0     =   0.04    !  surface  buoyancy lenght scale minimum value 
     
    997975!----------------------------------------------------------------------- 
    998976   cn_mpi_send =  'I'      !  mpi send/recieve type   ='S', 'B', or 'I' for standard send, 
    999                            !  buffer blocking send or immediate non-blocking sends, resp. 
     977   !                       !  buffer blocking send or immediate non-blocking sends, resp. 
    1000978   nn_buffer   =   0       !  size in bytes of exported buffer ('B' case), 0 no exportation 
    1001979   ln_nnogather=  .false.  !  activate code to avoid mpi_allgather use at the northfold 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/MY_SRC/usrdef_hgr.F90

    r7715 r8586  
    6868      IF( nn_timing == 1 )  CALL timing_start('usr_def_hgr') 
    6969      ! 
    70       IF(lwp) WRITE(numout,*) 
    71       IF(lwp) WRITE(numout,*) 'usr_def_hgr : ISOMIP configuration' 
    72       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
     70      IF(lwp) THEN 
     71         WRITE(numout,*) 
     72         WRITE(numout,*) 'usr_def_hgr : ISOMIP configuration' 
     73         WRITE(numout,*) '~~~~~~~~~~~' 
     74         WRITE(numout,*) 
     75         WRITE(numout,*) '   ===>>  geographical mesh on the sphere with regular grid-spacing' 
     76         WRITE(numout,*) '          given by rn_e1deg and rn_e2deg' 
     77      ENDIF 
    7378      ! 
    74       !                       !==  grid point position  ==!   (in kilometers) 
    75  
    76       IF(lwp) WRITE(numout,*) 
    77       IF(lwp) WRITE(numout,*) '          geographical mesh on the sphere with regular grid-spacing' 
    78       IF(lwp) WRITE(numout,*) '          given by rn_e1deg and rn_e2deg' 
    79  
     79      !                       !==  grid point position  ==!   (in degrees) 
    8080      DO jj = 1, jpj 
    8181         DO ji = 1, jpi 
     
    9494            pphiv(ji,jj) = rn_phi0 + rn_e2deg * zvj 
    9595            pphif(ji,jj) = rn_phi0 + rn_e2deg * zfj 
     96             
     97     !                       !==  Horizontal scale factors  ==!   (in meters) 
    9698     ! e1 
    9799            pe1t(ji,jj) = ra * rad * COS( rad * pphit(ji,jj) ) * rn_e1deg 
     
    106108         END DO 
    107109      END DO 
     110      !                             ! NO reduction of grid size in some straits  
     111      ke1e2u_v = 0                  !    ==>> u_ & v_surfaces will be computed in dom_ghr routine 
     112      pe1e2u(:,:) = 0._wp           !    CAUTION: set to zero to avoid error with some compilers that 
     113      pe1e2v(:,:) = 0._wp           !             require an initialization of INTENT(out) arguments 
    108114      ! 
    109       kff = 0 ! Coriolis parameter calculated on the sphere 
     115      ! 
     116      !                       !==  Coriolis parameter  ==! 
     117      kff = 0                       ! Coriolis parameter calculated on the sphere 
     118      ! 
     119      ! 
     120      pff_f(:,:) = 0._wp            ! CAUTION: set to zero to avoid error with some compilers that 
     121      pff_t(:,:) = 0._wp            !             require an initialization of INTENT(out) arguments 
    110122      ! 
    111123      IF( nn_timing == 1 )  CALL timing_stop('usr_def_hgr') 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/bdyini.F90

    r7610 r8586  
    351351        IF(lwp) WRITE(numout,*) 
    352352 
    353 #if defined key_lim2 
    354         IF(lwp) WRITE(numout,*) 'Boundary conditions for sea ice:  ' 
    355         SELECT CASE( cn_ice_lim(ib_bdy) )                   
    356           CASE('none') 
    357              IF(lwp) WRITE(numout,*) '      no open boundary condition'         
    358              dta_bdy(ib_bdy)%ll_frld  = .false. 
    359              dta_bdy(ib_bdy)%ll_hicif = .false. 
    360              dta_bdy(ib_bdy)%ll_hsnif = .false. 
    361           CASE('frs') 
    362              IF(lwp) WRITE(numout,*) '      Flow Relaxation Scheme' 
    363              dta_bdy(ib_bdy)%ll_frld  = .true. 
    364              dta_bdy(ib_bdy)%ll_hicif = .true. 
    365              dta_bdy(ib_bdy)%ll_hsnif = .true. 
    366           CASE DEFAULT   ;   CALL ctl_stop( 'unrecognised value for cn_ice_lim' ) 
    367         END SELECT 
    368         IF( cn_ice_lim(ib_bdy) /= 'none' ) THEN  
    369            SELECT CASE( nn_ice_lim_dta(ib_bdy) )                   !  
    370               CASE( 0 )      ;   IF(lwp) WRITE(numout,*) '      initial state used for bdy data'         
    371               CASE( 1 )      ;   IF(lwp) WRITE(numout,*) '      boundary data taken from file' 
    372               CASE DEFAULT   ;   CALL ctl_stop( 'nn_ice_lim_dta must be 0 or 1' ) 
    373            END SELECT 
    374         ENDIF 
    375         IF(lwp) WRITE(numout,*) 
    376 #elif defined key_lim3 
     353#if defined key_lim3 
    377354        IF(lwp) WRITE(numout,*) 'Boundary conditions for sea ice:  ' 
    378355        SELECT CASE( cn_ice_lim(ib_bdy) )                   
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h

    r5656 r8586  
    3636#define LONG_FNAME 1000    // Max length for a file name 
    3737#define LONG_C     200 
    38 #define LONG_M     1500 
     38#define LONG_M     2000 
    3939 
    4040#define NB_CAT_VARIABLES 5 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/LIM_SRC_3/ice.F90

    r7813 r8586  
    11MODULE ice 
    22   !!====================================================================== 
    3    !!                        ***  MODULE ice  *** 
    4    !! LIM-3 Sea Ice physics:  diagnostics variables of ice defined in memory 
    5    !!===================================================================== 
     3   !!                        ***  MODULE  ice  *** 
     4   !!   sea-ice:  ice variables defined in memory 
     5   !!====================================================================== 
    66   !! History :  3.0  ! 2008-03  (M. Vancoppenolle) original code LIM-3 
    77   !!            4.0  ! 2011-02  (G. Madec) dynamical allocation 
     
    99#if defined key_lim3 
    1010   !!---------------------------------------------------------------------- 
    11    !!   'key_lim3'                                      LIM-3 sea-ice model 
     11   !!   'key_lim3'                                       ESIM sea-ice model 
    1212   !!---------------------------------------------------------------------- 
    1313   USE in_out_manager ! I/O manager 
     
    1717   PRIVATE 
    1818 
    19    PUBLIC    ice_alloc  !  Called in sbc_lim_init 
     19   PUBLIC   ice_alloc   ! called by icestp.F90 
    2020 
    2121   !!====================================================================== 
     
    6363   !!   meaningful and/or used in ice thermodynamics                      | 
    6464   !!                                                                     | 
    65    !! Routines in limvar.F90 perform conversions                          | 
    66    !!  - lim_var_glo2eqv  : from global to equivalent variables           | 
    67    !!  - lim_var_eqv2glo  : from equivalent to global variables           | 
     65   !! Routines in icevar.F90 perform conversions                          | 
     66   !!  - ice_var_glo2eqv  : from global to equivalent variables           | 
     67   !!  - ice_var_eqv2glo  : from equivalent to global variables           | 
    6868   !!                                                                     | 
    6969   !! For various purposes, the sea ice state variables have sometimes    | 
    7070   !! to be aggregated over all ice thickness categories. This operation  | 
    7171   !! is done in :                                                        | 
    72    !!  - lim_var_agg                                                      | 
     72   !!  - ice_var_agg                                                      | 
    7373   !!                                                                     | 
    7474   !! in icestp.F90, the routines that compute the changes in the ice     | 
    7575   !! state variables are called                                          | 
    76    !! - lim_dyn : ice dynamics                                            | 
    77    !! - lim_trp : ice transport                                           | 
    78    !! - lim_itd_me : mechanical redistribution (ridging and rafting)      | 
    79    !! - lim_thd : ice halo-thermodynamics                                 | 
    80    !! - lim_itd_th : thermodynamic changes in ice thickness distribution  | 
    81    !!                and creation of new ice                              | 
     76   !! - ice_rhg : ice dynamics                                            | 
     77   !! - ice_adv : ice advection                                           | 
     78   !! - ice_rdgrft : ice ridging and rafting                              | 
     79   !! - ice_thd : ice halo-thermodynamics and creation of new ice         | 
     80   !! - ice_itd : thermodynamic changes in ice thickness distribution     | 
    8281   !!                                                                     | 
    8382   !! See the associated routines for more information                    | 
     
    107106   !! v_i         |      -      |    Ice volume per unit area     | m     | 
    108107   !! v_s         |      -      |    Snow volume per unit area    | m     | 
    109    !! smv_i       |      -      |    Sea ice salt content         | ppt.m | 
    110    !! oa_i        !      -      !    Sea ice areal age content    | day   | 
     108   !! sv_i        |      -      |    Sea ice salt content         | ppt.m | 
     109   !! oa_i        !      -      !    Sea ice areal age content    |    | 
    111110   !! e_i         !      -      !    Ice enthalpy                 | J/m2  |  
    112    !!      -      ! q_i_1d      !    Ice enthalpy per unit vol.   | J/m3  |  
     111   !!      -      ! e_i_1d      !    Ice enthalpy per unit vol.   | J/m3  |  
    113112   !! e_s         !      -      !    Snow enthalpy                | J/m2  |  
    114    !!      -      ! q_s_1d      !    Snow enthalpy per unit vol.  | J/m3  |  
     113   !!      -      ! e_s_1d      !    Snow enthalpy per unit vol.  | J/m3  |  
    115114   !!                                                                     | 
    116115   !!-------------|-------------|---------------------------------|-------| 
     
    119118   !!-------------|-------------|---------------------------------|-------| 
    120119   !!                                                                     | 
    121    !! ht_i        | ht_i_1d     |    Ice thickness                | m     | 
    122    !! ht_s        ! ht_s_1d     |    Snow depth                   | m     | 
    123    !! sm_i        ! sm_i_1d     |    Sea ice bulk salinity        ! ppt   | 
    124    !! s_i         ! s_i_1d      |    Sea ice salinity profile     ! ppt   | 
    125    !! o_i         !      -      |    Sea ice Age                  ! days  | 
     120   !! h_i         | h_i_1d      |    Ice thickness                | m     | 
     121   !! h_s         ! h_s_1d      |    Snow depth                   | m     | 
     122   !! s_i         ! s_i_1d      |    Sea ice bulk salinity        ! ppt   | 
     123   !! sz_i        ! sz_i_1d     |    Sea ice salinity profile     ! ppt   | 
     124   !! o_i         !      -      |    Sea ice Age                  ! s     | 
    126125   !! t_i         ! t_i_1d      |    Sea ice temperature          ! K     | 
    127126   !! t_s         ! t_s_1d      |    Snow temperature             ! K     | 
     
    144143   !! vt_i        |      -      |    Total ice vol. per unit area | m     | 
    145144   !! vt_s        |      -      |    Total snow vol. per unit ar. | m     | 
    146    !! smt_i       |      -      |    Mean sea ice salinity        | ppt   | 
     145   !! sm_i        |      -      |    Mean sea ice salinity        | ppt   | 
    147146   !! tm_i        |      -      |    Mean sea ice temperature     | K     | 
    148147   !! et_i        !      -      !    Total ice enthalpy           | J/m2  |  
     
    151150   !!===================================================================== 
    152151 
    153    LOGICAL, PUBLIC ::   con_i = .false.   ! switch for conservation test 
    154  
    155    !!-------------------------------------------------------------------------- 
     152   !!---------------------------------------------------------------------- 
    156153   !! * Share Module variables 
    157    !!-------------------------------------------------------------------------- 
    158    !                                     !!** ice-generic parameters namelist (namicerun) ** 
     154   !!---------------------------------------------------------------------- 
     155   !                                     !!** ice-generic parameters namelist (nampar) ** 
    159156   INTEGER           , PUBLIC ::   jpl             !: number of ice  categories  
    160157   INTEGER           , PUBLIC ::   nlay_i          !: number of ice  layers  
    161158   INTEGER           , PUBLIC ::   nlay_s          !: number of snow layers  
     159   INTEGER           , PUBLIC ::   nn_monocat      !: virtual ITD mono-category parameterizations (1-4) or not (0) 
     160   LOGICAL           , PUBLIC ::   ln_icedyn       !: flag for ice dynamics (T) or not (F) 
     161   LOGICAL           , PUBLIC ::   ln_icethd       !: flag for ice thermo   (T) or not (F) 
    162162   REAL(wp)          , PUBLIC ::   rn_amax_n       !: maximum ice concentration Northern hemisphere 
    163163   REAL(wp)          , PUBLIC ::   rn_amax_s       !: maximum ice concentration Southern hemisphere 
     
    166166   CHARACTER(len=256), PUBLIC ::   cn_icerst_indir !: ice restart input directory 
    167167   CHARACTER(len=256), PUBLIC ::   cn_icerst_outdir!: ice restart output directory 
    168    LOGICAL           , PUBLIC ::   ln_limthd       !: flag for ice thermo (T) or not (F) 
    169    LOGICAL           , PUBLIC ::   ln_limdyn       !: flag for ice dynamics (T) or not (F) 
    170    INTEGER           , PUBLIC ::   nn_limdyn       !: flag for ice dynamics 
    171    REAL(wp)          , PUBLIC ::   rn_uice         !: prescribed u-vel (case nn_limdyn=0) 
    172    REAL(wp)          , PUBLIC ::   rn_vice         !: prescribed v-vel (case nn_limdyn=0) 
     168 
     169   !                                     !!** ice-itd namelist (namitd) ** 
     170   REAL(wp), PUBLIC ::   rn_himin         !: minimum ice thickness 
    173171    
    174    !                                     !!** ice-diagnostics namelist (namicediag) ** 
    175    LOGICAL , PUBLIC ::   ln_limdiachk     !: flag for ice diag (T) or not (F) 
    176    LOGICAL , PUBLIC ::   ln_limdiahsb     !: flag for ice diag (T) or not (F) 
    177    LOGICAL , PUBLIC ::   ln_limctl        !: flag for sea-ice points output (T) or not (F) 
    178    INTEGER , PUBLIC ::   iiceprt          !: debug i-point 
    179    INTEGER , PUBLIC ::   jiceprt          !: debug j-point 
    180  
    181    !                                     !!** ice-init namelist (namiceini) ** 
    182                                           ! -- limistate -- ! 
    183    LOGICAL , PUBLIC ::   ln_limini        ! initialization or not 
    184    LOGICAL , PUBLIC ::   ln_limini_file   ! Ice initialization state from 2D netcdf file 
    185    REAL(wp), PUBLIC ::   rn_thres_sst     ! threshold water temperature for initial sea ice 
    186    REAL(wp), PUBLIC ::   rn_hts_ini_n     ! initial snow thickness in the north 
    187    REAL(wp), PUBLIC ::   rn_hts_ini_s     ! initial snow thickness in the south 
    188    REAL(wp), PUBLIC ::   rn_hti_ini_n     ! initial ice thickness in the north 
    189    REAL(wp), PUBLIC ::   rn_hti_ini_s     ! initial ice thickness in the south 
    190    REAL(wp), PUBLIC ::   rn_ati_ini_n     ! initial leads area in the north 
    191    REAL(wp), PUBLIC ::   rn_ati_ini_s     ! initial leads area in the south 
    192    REAL(wp), PUBLIC ::   rn_smi_ini_n     ! initial salinity  
    193    REAL(wp), PUBLIC ::   rn_smi_ini_s     ! initial salinity 
    194    REAL(wp), PUBLIC ::   rn_tmi_ini_n     ! initial temperature 
    195    REAL(wp), PUBLIC ::   rn_tmi_ini_s     ! initial temperature 
    196     
    197    !                                     !!** ice-thickness distribution namelist (namiceitd) ** 
    198    INTEGER , PUBLIC ::   nn_catbnd        !: categories distribution following: tanh function (1), or h^(-alpha) function (2) 
    199    REAL(wp), PUBLIC ::   rn_himean        !: mean thickness of the domain (used to compute the distribution, nn_itdshp = 2 only) 
    200  
    201    !                                     !!** ice-dynamics namelist (namicedyn) ** 
    202                                           ! -- limtrp & limadv -- ! 
    203    INTEGER , PUBLIC ::   nn_limadv        !: choose the advection scheme (-1=Prather ; 0=Ultimate-Macho) 
    204    INTEGER , PUBLIC ::   nn_limadv_ord    !: choose the order of the advection scheme (if Ultimate-Macho)    
    205                                           ! -- limitd_me -- ! 
    206    INTEGER , PUBLIC ::   nn_icestr        !: ice strength parameterization (0=Hibler79 1=Rothrock75) 
    207    REAL(wp), PUBLIC ::   rn_pe_rdg        !: ridging work divided by pot. energy change in ridging, nn_icestr = 1 
    208    REAL(wp), PUBLIC ::   rn_pstar         !: determines ice strength, Hibler JPO79 
    209    REAL(wp), PUBLIC ::   rn_crhg          !: determines changes in ice strength 
    210    LOGICAL , PUBLIC ::   ln_icestr_bvf    !: use brine volume to diminish ice strength 
    211                                           ! -- limdyn & limrhg -- ! 
    212    REAL(wp), PUBLIC ::   rn_cio           !: drag coefficient for oceanic stress 
     172   !                                     !!** ice-dynamics namelist (namdyn) ** 
     173   REAL(wp), PUBLIC ::   rn_ishlat        !: lateral boundary condition for sea-ice 
     174   LOGICAL , PUBLIC ::   ln_landfast      !: landfast ice parameterization (T or F)  
     175   REAL(wp), PUBLIC ::   rn_gamma         !:    fraction of ocean depth that ice must reach to initiate landfast ice 
     176   REAL(wp), PUBLIC ::   rn_icebfr        !:    maximum bottom stress per unit area of contact (landfast ice)  
     177   REAL(wp), PUBLIC ::   rn_lfrelax       !:    relaxation time scale (s-1) to reach static friction (landfast ice)  
     178   ! 
     179   !                                     !!** ice-rheology namelist (namrhg) ** 
    213180   REAL(wp), PUBLIC ::   rn_creepl        !: creep limit : has to be under 1.0e-9 
    214181   REAL(wp), PUBLIC ::   rn_ecc           !: eccentricity of the elliptical yield curve 
    215182   INTEGER , PUBLIC ::   nn_nevp          !: number of iterations for subcycling 
    216183   REAL(wp), PUBLIC ::   rn_relast        !: ratio => telast/rdt_ice (1/3 or 1/9 depending on nb of subcycling nevp)  
    217    LOGICAL , PUBLIC ::   ln_landfast      !: landfast ice parameterization (T or F)  
    218    REAL(wp), PUBLIC ::   rn_gamma         !: fraction of ocean depth that ice must reach to initiate landfast ice 
    219    REAL(wp), PUBLIC ::   rn_icebfr        !: maximum bottom stress per unit area of contact (landfast ice)  
    220    REAL(wp), PUBLIC ::   rn_lfrelax       !: relaxation time scale (s-1) to reach static friction (landfast ice)  
    221  
    222    !                                     !!** ice-diffusion namelist (namicehdf) ** 
    223    INTEGER , PUBLIC ::   nn_ahi0          !: sea-ice hor. eddy diffusivity coeff. (3 ways of calculation) 
    224    REAL(wp), PUBLIC ::   rn_ahi0_ref      !: sea-ice hor. eddy diffusivity coeff. (m2/s) 
    225  
    226    !                                     !!** ice-thermodynamics namelist (namicethd) ** 
    227                                           ! -- limthd_dif -- ! 
    228    REAL(wp), PUBLIC ::   rn_kappa_i       !: coef. for the extinction of radiation Grenfell et al. (2006) [1/m] 
    229    REAL(wp), PUBLIC ::   nn_conv_dif      !: maximal number of iterations for heat diffusion 
    230    REAL(wp), PUBLIC ::   rn_terr_dif      !: maximal tolerated error (C) for heat diffusion 
    231    INTEGER , PUBLIC ::   nn_ice_thcon     !: thermal conductivity: =0 Untersteiner (1964) ; =1 Pringle et al (2007) 
    232    LOGICAL , PUBLIC ::   ln_it_qnsice     !: iterate surface flux with changing surface temperature or not (F) 
    233    INTEGER , PUBLIC ::   nn_monocat       !: virtual ITD mono-category parameterizations (1) or not (0) 
    234    REAL(wp), PUBLIC ::   rn_cdsn          !: thermal conductivity of the snow [W/m/K] 
    235                                           ! -- limthd_dh -- ! 
    236    LOGICAL , PUBLIC ::   ln_limdH         !: activate ice thickness change from growing/melting (T) or not (F) 
    237    REAL(wp), PUBLIC ::   rn_betas         !: coef. for partitioning of snowfall between leads and sea ice 
    238                                           ! -- limthd_da -- ! 
    239    LOGICAL , PUBLIC ::   ln_limdA         !: activate lateral melting param. (T) or not (F) 
    240    REAL(wp), PUBLIC ::   rn_beta          !: coef. beta for lateral melting param. 
    241    REAL(wp), PUBLIC ::   rn_dmin          !: minimum floe diameter for lateral melting param. 
    242                                           ! -- limthd_lac -- ! 
    243    LOGICAL , PUBLIC ::   ln_limdO         !: activate ice growth in open-water (T) or not (F) 
    244    REAL(wp), PUBLIC ::   rn_hnewice       !: thickness for new ice formation (m) 
    245    LOGICAL , PUBLIC ::   ln_frazil        !: use of frazil ice collection as function of wind (T) or not (F) 
    246    REAL(wp), PUBLIC ::   rn_maxfrazb      !: maximum portion of frazil ice collecting at the ice bottom 
    247    REAL(wp), PUBLIC ::   rn_vfrazb        !: threshold drift speed for collection of bottom frazil ice 
    248    REAL(wp), PUBLIC ::   rn_Cfrazb        !: squeezing coefficient for collection of bottom frazil ice 
    249                                           ! -- limitd_th -- ! 
    250    REAL(wp), PUBLIC ::   rn_himin         !: minimum ice thickness 
    251  
    252    !                                     !!** ice-salinity namelist (namicesal) ** 
    253    LOGICAL , PUBLIC ::   ln_limdS         !: activate gravity drainage and flushing (T) or not (F) 
     184   ! 
     185   !                                     !!** ice-surface forcing namelist (namforcing) ** 
     186                                          ! -- icethd_dh -- ! 
     187   REAL(wp), PUBLIC ::   rn_blow_s        !: coef. for partitioning of snowfall between leads and sea ice 
     188                                          ! -- icethd -- ! 
     189   REAL(wp), PUBLIC ::   rn_cio           !: drag coefficient for oceanic stress 
     190   INTEGER , PUBLIC ::   nn_iceflx        !: Redistribute heat flux over ice categories 
     191   !                                      !   =-1  Do nothing (needs N(cat) fluxes) 
     192   !                                      !   = 0  Average N(cat) fluxes then apply the average over the N(cat) ice  
     193   !                                      !   = 1  Average N(cat) fluxes then redistribute over the N(cat) ice 
     194   !                                      !                                   using T-ice and albedo sensitivity 
     195   !                                      !   = 2  Redistribute a single flux over categories 
     196 
     197   !                                     !!** ice-salinity namelist (namthd_sal) ** 
    254198   INTEGER , PUBLIC ::   nn_icesal        !: salinity configuration used in the model 
    255199   !                                      ! 1 - constant salinity in both space and time 
     
    257201   !                                      ! 3 - salinity profile, constant in time 
    258202   REAL(wp), PUBLIC ::   rn_icesal        !: bulk salinity (ppt) in case of constant salinity 
    259    REAL(wp), PUBLIC ::   rn_sal_gd        !: restoring salinity for gravity drainage [PSU] 
    260    REAL(wp), PUBLIC ::   rn_time_gd       !: restoring time constant for gravity drainage (= 20 days) [s] 
    261    REAL(wp), PUBLIC ::   rn_sal_fl        !: restoring salinity for flushing [PSU] 
    262    REAL(wp), PUBLIC ::   rn_time_fl       !: restoring time constant for gravity drainage (= 10 days) [s] 
    263203   REAL(wp), PUBLIC ::   rn_simax         !: maximum ice salinity [PSU] 
    264204   REAL(wp), PUBLIC ::   rn_simin         !: minimum ice salinity [PSU] 
    265205 
    266    !                                     !!** ice-mechanical redistribution namelist (namiceitdme) 
    267    REAL(wp), PUBLIC ::   rn_cs            !: fraction of shearing energy contributing to ridging             
    268    INTEGER , PUBLIC ::   nn_partfun       !: participation function: =0 Thorndike et al. (1975), =1 Lipscomb et al. (2007) 
    269    REAL(wp), PUBLIC ::   rn_gstar         !: fractional area of young ice contributing to ridging 
    270    REAL(wp), PUBLIC ::   rn_astar         !: equivalent of G* for an exponential participation function 
    271    LOGICAL , PUBLIC ::   ln_ridging       !: ridging of ice or not                         
    272    REAL(wp), PUBLIC ::   rn_hstar         !: thickness that determines the maximal thickness of ridged ice 
    273    REAL(wp), PUBLIC ::   rn_por_rdg       !: initial porosity of ridges (0.3 regular value) 
    274    REAL(wp), PUBLIC ::   rn_fsnowrdg      !: fractional snow loss to the ocean during ridging 
    275    LOGICAL , PUBLIC ::   ln_rafting       !: rafting of ice or not                         
    276    REAL(wp), PUBLIC ::   rn_hraft         !: threshold thickness (m) for rafting / ridging  
    277    REAL(wp), PUBLIC ::   rn_craft         !: coefficient for smoothness of the hyperbolic tangent in rafting 
    278    REAL(wp), PUBLIC ::   rn_fsnowrft      !: fractional snow loss to the ocean during ridging 
     206   ! MV MP 2016 
     207   !                                     !!** melt pond namelist (nammp) 
     208   LOGICAL , PUBLIC ::   ln_pnd           !: activate ponds or not 
     209   LOGICAL , PUBLIC ::   ln_pnd_rad       !: ponds radiatively active or not 
     210   LOGICAL , PUBLIC ::   ln_pnd_fw        !: ponds active wrt meltwater or not 
     211   INTEGER , PUBLIC ::   nn_pnd_scheme    !: type of melt pond scheme:   =0 prescribed, =1 empirical, =2 topographic 
     212   REAL(wp), PUBLIC ::   rn_apnd          !: prescribed pond fraction (0<rn_apnd<1), only if nn_pnd_scheme = 0 
     213   REAL(wp), PUBLIC ::   rn_hpnd          !: prescribed pond depth    (0<rn_hpnd<1), only if nn_pnd_scheme = 0 
     214   ! END MV MP 2016 
     215   !                                     !!** ice-diagnostics namelist (namdia) ** 
     216   LOGICAL , PUBLIC ::   ln_icediachk     !: flag for ice diag (T) or not (F) 
     217   LOGICAL , PUBLIC ::   ln_icediahsb     !: flag for ice diag (T) or not (F) 
     218   LOGICAL , PUBLIC ::   ln_icectl        !: flag for sea-ice points output (T) or not (F) 
     219   INTEGER , PUBLIC ::   iiceprt          !: debug i-point 
     220   INTEGER , PUBLIC ::   jiceprt          !: debug j-point 
    279221 
    280222   !                                     !!** some other parameters  
    281    INTEGER , PUBLIC ::   nstart           !: iteration number of the begining of the run  
    282    INTEGER , PUBLIC ::   nlast            !: iteration number of the end of the run  
    283    INTEGER , PUBLIC ::   nitrun           !: number of iteration 
    284    INTEGER , PUBLIC ::   numit            !: iteration number 
     223   INTEGER , PUBLIC ::   kt_ice           !: iteration number 
    285224   REAL(wp), PUBLIC ::   rdt_ice          !: ice time step 
    286225   REAL(wp), PUBLIC ::   r1_rdtice        !: = 1. / rdt_ice 
     
    288227   REAL(wp), PUBLIC ::   r1_nlay_s        !: 1 / nlay_s  
    289228   REAL(wp), PUBLIC ::   rswitch          !: switch for the presence of ice (1) or not (0) 
    290    REAL(wp), PUBLIC, PARAMETER ::   epsi06   = 1.e-06_wp  !: small number  
    291    REAL(wp), PUBLIC, PARAMETER ::   epsi10   = 1.e-10_wp  !: small number  
    292    REAL(wp), PUBLIC, PARAMETER ::   epsi20   = 1.e-20_wp  !: small number  
     229   REAL(wp), PUBLIC ::   rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft   !: conservation diagnostics 
     230   REAL(wp), PUBLIC, PARAMETER ::   epsi06 = 1.e-06_wp  !: small number  
     231   REAL(wp), PUBLIC, PARAMETER ::   epsi10 = 1.e-10_wp  !: small number  
     232   REAL(wp), PUBLIC, PARAMETER ::   epsi20 = 1.e-20_wp  !: small number  
     233 
    293234 
    294235   !                                     !!** define arrays 
    295    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_oce, v_oce !: surface ocean velocity used in ice dynamics 
    296    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ahiu , ahiv !: hor. diffusivity coeff. at U- and V-points [m2/s] 
    297    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hicol       !: ice collection thickness accreted in leads 
     236   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_oce,v_oce !: surface ocean velocity used in ice dynamics 
     237   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ht_i_new    !: ice collection thickness accreted in leads 
    298238   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   strength    !: ice strength 
    299239   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   stress1_i, stress2_i, stress12_i   !: 1st, 2nd & diagonal stress tensor element 
     
    303243   ! 
    304244   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   t_bo        !: Sea-Ice bottom temperature [Kelvin]      
    305    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   frld        !: Leads fraction = 1 - ice fraction 
    306    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   pfrld       !: Leads fraction at previous time   
    307    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   phicif      !: Old ice thickness 
    308245   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qlead       !: heat balance of the lead (or of the open ocean) 
    309246   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fhtur       !: net downward heat flux from the ice to the ocean 
     
    311248 
    312249   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_snw     !: snow-ocean mass exchange   [kg.m-2.s-1] 
     250   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_snw_sni !: snow ice growth component of wfx_snw [kg.m-2.s-1] 
     251   ! MV MP 2016 
     252   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_snw_sum !: surface melt component of wfx_snw [kg.m-2.s-1] 
     253   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_pnd     !: melt pond-ocean mass exchange   [kg.m-2.s-1] 
     254   ! END MV MP 2016 
    313255   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_spr     !: snow precipitation on ice  [kg.m-2.s-1] 
    314    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_sub     !: snow/ice sublimation       [kg.m-2.s-1] 
     256   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_sub     !: sublimation of snow/ice    [kg.m-2.s-1] 
     257   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_snw_sub !: snow sublimation           [kg.m-2.s-1] 
     258   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_ice_sub !: ice sublimation            [kg.m-2.s-1] 
     259 
     260   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_snw_dyn !: dynamical component of wfx_snw    [kg.m-2.s-1] 
    315261 
    316262   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_ice     !: ice-ocean mass exchange                   [kg.m-2.s-1] 
     
    325271 
    326272   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   afx_tot     !: ice concentration tendency (total)          [s-1] 
    327    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   afx_thd     !: ice concentration tendency (thermodynamics) [s-1] 
    328    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   afx_dyn     !: ice concentration tendency (dynamics)       [s-1] 
    329273 
    330274   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sfx_bog     !: salt flux due to ice growth/melt                      [PSU/m2/s] 
     
    346290   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_dif     !: total heat flux causing Temp change in the ice   [W.m-2] 
    347291   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_snw     !: heat flux for snow melt                          [W.m-2] 
    348    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_err     !: heat flux error after heat diffusion             [W.m-2] 
    349292   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_err_dif !: heat flux remaining due to change in non-solar flux [W.m-2] 
    350293   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_err_rem !: heat flux error after heat remapping             [W.m-2] 
     
    358301 
    359302   ! heat flux associated with ice-ocean mass exchange 
    360    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_thd     !: ice-ocean heat flux from thermo processes (limthd_dh) [W.m-2] 
    361    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_dyn     !: ice-ocean heat flux from mecanical processes (limitd_me)  [W.m-2] 
     303   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_thd     !: ice-ocean heat flux from thermo processes (icethd_dh) [W.m-2] 
     304   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_dyn     !: ice-ocean heat flux from ridging                      [W.m-2] 
    362305   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hfx_res     !: residual heat flux due to correction of ice thickness [W.m-2] 
    363306 
    364307   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   rn_amax_2d     !: maximum ice concentration 2d array 
    365308   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ftr_ice        !: transmitted solar radiation under ice 
    366    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   pahu3D, pahv3D !: ice hor. eddy diffusivity coef. at U- and V-points 
    367  
    368    !!-------------------------------------------------------------------------- 
     309 
     310   !!---------------------------------------------------------------------- 
    369311   !! * Ice global state variables 
    370    !!-------------------------------------------------------------------------- 
     312   !!---------------------------------------------------------------------- 
    371313   !! Variables defined for each ice category 
    372    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ht_i      !: Ice thickness (m) 
     314   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   h_i       !: Ice thickness (m) 
    373315   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   a_i       !: Ice fractional areas (concentration) 
    374316   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   v_i       !: Ice volume per unit area (m) 
    375317   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   v_s       !: Snow volume per unit area(m) 
    376    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ht_s      !: Snow thickness (m) 
     318   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   h_s       !: Snow thickness (m) 
    377319   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   t_su      !: Sea-Ice Surface Temperature (K) 
    378    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sm_i      !: Sea-Ice Bulk salinity (ppt) 
    379    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   smv_i     !: Sea-Ice Bulk salinity times volume per area (ppt.m) 
    380    !                                                                    !  this is an extensive variable that has to be transported 
    381    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   o_i       !: Sea-Ice Age (days) 
    382    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   oa_i      !: Sea-Ice Age times ice area (days) 
     320   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   s_i       !: Sea-Ice Bulk salinity (ppt) 
     321   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sv_i     !: Sea-Ice Bulk salinity times volume per area (ppt.m) 
     322   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   o_i       !: Sea-Ice Age (s) 
     323   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   oa_i      !: Sea-Ice Age times ice area (s) 
    383324   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   bv_i      !: brine volume 
    384325 
     
    391332   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tm_i         !: mean ice temperature over all categories 
    392333   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bvm_i        !: brine volume averaged over all categories 
    393    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   smt_i        !: mean sea ice salinity averaged over all categories [PSU] 
     334   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sm_i         !: mean sea ice salinity averaged over all categories [PSU] 
    394335   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tm_su        !: mean surface temperature over all categories 
    395    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   htm_i        !: mean ice  thickness over all categories 
    396    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   htm_s        !: mean snow thickness over all categories 
     336   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hm_i         !: mean ice  thickness over all categories 
     337   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hm_s         !: mean snow thickness over all categories 
    397338   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   om_i         !: mean ice age over all categories 
    398339   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tau_icebfr   !: ice friction with bathy (landfast param activated) 
    399340 
    400    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   t_s      !: Snow temperatures [K] 
    401    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_s      !: Snow ...       
    402        
    403    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   t_i      !: ice temperatures          [K] 
    404    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_i      !: ice thermal contents    [J/m2] 
    405    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   s_i      !: ice salinities          [PSU] 
    406  
    407    !!-------------------------------------------------------------------------- 
    408    !! * Moments for advection 
    409    !!-------------------------------------------------------------------------- 
    410    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   sxopw, syopw, sxxopw, syyopw, sxyopw   !: open water in sea ice 
    411    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxice, syice, sxxice, syyice, sxyice   !: ice thickness  
    412    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxsn , sysn , sxxsn , syysn , sxysn    !: snow thickness 
    413    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxa  , sya  , sxxa  , syya  , sxya     !: lead fraction 
    414    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxc0 , syc0 , sxxc0 , syyc0 , sxyc0    !: snow thermal content 
    415    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxsal, sysal, sxxsal, syysal, sxysal   !: ice salinity 
    416    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxage, syage, sxxage, syyage, sxyage   !: ice age 
    417    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   sxe  , sye  , sxxe  , syye  , sxye     !: ice layers heat content 
    418  
    419    !!-------------------------------------------------------------------------- 
     341   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   t_s      !: Snow temperatures     [K] 
     342   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_s      !: Snow enthalpy         [J/m2] 
     343   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   t_i      !: ice temperatures      [K] 
     344   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_i      !: ice enthalpy          [J/m2] 
     345   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   sz_i     !: ice salinity          [PSU] 
     346 
     347   ! MV MP 2016 
     348   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   a_ip       !: melt pond fraction per grid cell area 
     349   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   v_ip       !: melt pond volume per grid cell area [m] 
     350   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   a_ip_frac  !: melt pond volume per ice area 
     351   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   h_ip       !: melt pond thickness [m] 
     352 
     353   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   at_ip      !: total melt pond fraction 
     354   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   vt_ip      !: total melt pond volume per unit area [m] 
     355   ! END MV MP 2016 
     356 
     357   !!---------------------------------------------------------------------- 
    420358   !! * Old values of global variables 
    421    !!-------------------------------------------------------------------------- 
    422    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   v_s_b, v_i_b               !: snow and ice volumes 
    423    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   a_i_b, smv_i_b, oa_i_b     !: 
    424    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_s_b                      !: snow heat content 
    425    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_i_b                      !: ice temperatures 
    426    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   u_ice_b, v_ice_b           !: ice velocity 
    427    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   at_i_b                     !: ice concentration (total) 
     359   !!---------------------------------------------------------------------- 
     360   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   v_s_b, v_i_b, h_s_b, h_i_b  !: snow and ice volumes/thickness 
     361   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   a_i_b, sv_i_b, oa_i_b        !: 
     362   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_s_b                         !: snow heat content 
     363   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_i_b                         !: ice temperatures 
     364   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   u_ice_b, v_ice_b              !: ice velocity 
     365   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   at_i_b                        !: ice concentration (total) 
    428366             
    429    !!-------------------------------------------------------------------------- 
     367   !!---------------------------------------------------------------------- 
    430368   !! * Ice thickness distribution variables 
    431    !!-------------------------------------------------------------------------- 
     369   !!---------------------------------------------------------------------- 
    432370   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_max         !: Boundary of ice thickness categories in thickness space 
    433371   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_mean        !: Mean ice thickness in catgories  
    434372   ! 
    435    !!-------------------------------------------------------------------------- 
     373   !!---------------------------------------------------------------------- 
    436374   !! * Ice diagnostics 
    437    !!-------------------------------------------------------------------------- 
     375   !!---------------------------------------------------------------------- 
    438376   ! thd refers to changes induced by thermodynamics 
    439377   ! trp   ''         ''     ''       advection (transport of ice) 
     
    443381   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_trp_ei   !: transport of ice enthalpy (W/m2) 
    444382   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_trp_es   !: transport of snw enthalpy (W/m2) 
    445    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_trp_smv  !: transport of salt content 
     383   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_trp_sv   !: transport of salt content 
    446384   ! 
    447385   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_heat     !: snw/ice heat content variation   [W/m2]  
    448    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_smvi     !: ice salt content variation   []  
     386   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_sice     !: ice salt content variation   []  
    449387   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_vice     !: ice volume variation   [m/s]  
    450388   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_vsnw     !: snw volume variation   [m/s]  
    451    ! 
    452    !!---------------------------------------------------------------------- 
    453    !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2010) 
     389 
     390   ! 
     391   !!---------------------------------------------------------------------- 
     392   !! * SIMIP extra diagnostics 
     393   !!---------------------------------------------------------------------- 
     394   ! Extra sea ice diagnostics to address the data request 
     395   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   t_si          !: Temperature at Snow-ice interface (K)  
     396   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   tm_si         !: mean temperature at the snow-ice interface (K)  
     397   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_fc_bo    !: Bottom conduction flux (W/m2) 
     398   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   diag_fc_su    !: Surface conduction flux (W/m2) 
     399 
     400   ! 
     401   !!---------------------------------------------------------------------- 
     402   !! NEMO/ICE 4.0 , NEMO Consortium (2017) 
    454403   !! $Id$ 
    455404   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    463412      INTEGER :: ice_alloc 
    464413      ! 
    465       INTEGER :: ierr(15), ii 
     414      INTEGER :: ierr(18), ii 
    466415      !!----------------------------------------------------------------- 
    467416 
     
    471420      ! stay within Fortran's max-line length limit. 
    472421      ii = 1 
    473       ALLOCATE( u_oce   (jpi,jpj) , v_oce    (jpi,jpj) ,                                             & 
    474          &      ahiu    (jpi,jpj) , ahiv     (jpi,jpj) , hicol    (jpi,jpj) ,                        & 
     422      ALLOCATE( u_oce   (jpi,jpj) , v_oce    (jpi,jpj) , ht_i_new (jpi,jpj) ,                        & 
    475423         &      strength(jpi,jpj) , stress1_i(jpi,jpj) , stress2_i(jpi,jpj) , stress12_i(jpi,jpj) ,  & 
    476424         &      delta_i (jpi,jpj) , divu_i   (jpi,jpj) , shear_i  (jpi,jpj) , STAT=ierr(ii) ) 
    477425 
    478426      ii = ii + 1 
    479       ALLOCATE( t_bo   (jpi,jpj) , frld   (jpi,jpj) , pfrld  (jpi,jpj) , phicif (jpi,jpj) ,     & 
    480          &      wfx_snw(jpi,jpj) , wfx_ice(jpi,jpj) , wfx_sub(jpi,jpj) , wfx_lam(jpi,jpj) ,     & 
     427      ALLOCATE( t_bo   (jpi,jpj) , wfx_snw_sni(jpi,jpj) ,                                                & 
     428         &      wfx_snw(jpi,jpj) , wfx_snw_dyn(jpi,jpj) , wfx_snw_sum(jpi,jpj) , wfx_snw_sub(jpi,jpj) ,  & 
     429         &      wfx_ice(jpi,jpj) , wfx_sub    (jpi,jpj) , wfx_ice_sub(jpi,jpj) , wfx_lam    (jpi,jpj) ,  & 
     430         &      wfx_pnd(jpi,jpj) ,                                                              & 
    481431         &      wfx_bog(jpi,jpj) , wfx_dyn(jpi,jpj) , wfx_bom(jpi,jpj) , wfx_sum(jpi,jpj) ,     & 
    482432         &      wfx_res(jpi,jpj) , wfx_sni(jpi,jpj) , wfx_opw(jpi,jpj) , wfx_spr(jpi,jpj) ,     & 
    483          &      afx_tot(jpi,jpj) , afx_thd(jpi,jpj),  afx_dyn(jpi,jpj) , rn_amax_2d(jpi,jpj),   & 
     433         &      afx_tot(jpi,jpj) , rn_amax_2d(jpi,jpj),                                         & 
    484434         &      fhtur  (jpi,jpj) , qlead  (jpi,jpj) ,                                           & 
    485435         &      sfx_res(jpi,jpj) , sfx_bri(jpi,jpj) , sfx_dyn(jpi,jpj) , sfx_sub(jpi,jpj) , sfx_lam(jpi,jpj) ,  & 
    486436         &      sfx_bog(jpi,jpj) , sfx_bom(jpi,jpj) , sfx_sum(jpi,jpj) , sfx_sni(jpi,jpj) , sfx_opw(jpi,jpj) ,  & 
    487          &      hfx_res(jpi,jpj) , hfx_snw(jpi,jpj) , hfx_sub(jpi,jpj) , hfx_err(jpi,jpj) ,     &  
     437         &      hfx_res(jpi,jpj) , hfx_snw(jpi,jpj) , hfx_sub(jpi,jpj) ,     &  
    488438         &      hfx_in (jpi,jpj) , hfx_out(jpi,jpj) , fhld   (jpi,jpj) ,                        & 
    489439         &      hfx_sum(jpi,jpj) , hfx_bom(jpi,jpj) , hfx_bog(jpi,jpj) , hfx_dif(jpi,jpj) ,     & 
     
    493443      ! * Ice global state variables 
    494444      ii = ii + 1 
    495       ALLOCATE( ftr_ice(jpi,jpj,jpl) , pahu3D(jpi,jpj,jpl+1) , pahv3D(jpi,jpj,jpl+1) , & 
    496          &      ht_i   (jpi,jpj,jpl) , a_i   (jpi,jpj,jpl) , v_i   (jpi,jpj,jpl) ,     & 
    497          &      v_s    (jpi,jpj,jpl) , ht_s  (jpi,jpj,jpl) , t_su  (jpi,jpj,jpl) ,     & 
    498          &      sm_i   (jpi,jpj,jpl) , smv_i (jpi,jpj,jpl) , o_i   (jpi,jpj,jpl) ,     & 
     445      ALLOCATE( ftr_ice(jpi,jpj,jpl) ,                                                 & 
     446         &      h_i   (jpi,jpj,jpl) , a_i   (jpi,jpj,jpl) , v_i   (jpi,jpj,jpl) ,     & 
     447         &      v_s    (jpi,jpj,jpl) , h_s  (jpi,jpj,jpl) , t_su  (jpi,jpj,jpl) ,     & 
     448         &      s_i   (jpi,jpj,jpl) , sv_i (jpi,jpj,jpl) , o_i   (jpi,jpj,jpl) ,     & 
    499449         &      oa_i   (jpi,jpj,jpl) , bv_i  (jpi,jpj,jpl) ,  STAT=ierr(ii) ) 
    500450      ii = ii + 1 
     
    502452         &      vt_i (jpi,jpj) , vt_s (jpi,jpj) , at_i (jpi,jpj) , ato_i(jpi,jpj) ,     & 
    503453         &      et_i (jpi,jpj) , et_s (jpi,jpj) , tm_i (jpi,jpj) , bvm_i(jpi,jpj) ,     & 
    504          &      smt_i(jpi,jpj) , tm_su(jpi,jpj) , htm_i(jpi,jpj) , htm_s(jpi,jpj) ,     & 
     454         &      sm_i (jpi,jpj) , tm_su(jpi,jpj) , hm_i(jpi,jpj) , hm_s(jpi,jpj) ,     & 
    505455         &      om_i (jpi,jpj) , tau_icebfr(jpi,jpj)                              , STAT=ierr(ii) ) 
    506456      ii = ii + 1 
    507457      ALLOCATE( t_s(jpi,jpj,nlay_s,jpl) , e_s(jpi,jpj,nlay_s,jpl) , STAT=ierr(ii) ) 
    508458      ii = ii + 1 
    509       ALLOCATE( t_i(jpi,jpj,nlay_i,jpl) , e_i(jpi,jpj,nlay_i,jpl) , s_i(jpi,jpj,nlay_i,jpl) , STAT=ierr(ii) ) 
    510  
    511       ! * Moments for advection 
    512       ii = ii + 1 
    513       ALLOCATE( sxopw(jpi,jpj) , syopw(jpi,jpj) , sxxopw(jpi,jpj) , syyopw(jpi,jpj) , sxyopw(jpi,jpj) , STAT=ierr(ii) ) 
    514       ii = ii + 1 
    515       ALLOCATE( sxice(jpi,jpj,jpl) , syice(jpi,jpj,jpl) , sxxice(jpi,jpj,jpl) , syyice(jpi,jpj,jpl) , sxyice(jpi,jpj,jpl) ,   & 
    516          &      sxsn (jpi,jpj,jpl) , sysn (jpi,jpj,jpl) , sxxsn (jpi,jpj,jpl) , syysn (jpi,jpj,jpl) , sxysn (jpi,jpj,jpl) ,   & 
    517          &      STAT=ierr(ii) ) 
    518       ii = ii + 1 
    519       ALLOCATE( sxa  (jpi,jpj,jpl) , sya  (jpi,jpj,jpl) , sxxa  (jpi,jpj,jpl) , syya  (jpi,jpj,jpl) , sxya  (jpi,jpj,jpl) ,   & 
    520          &      sxc0 (jpi,jpj,jpl) , syc0 (jpi,jpj,jpl) , sxxc0 (jpi,jpj,jpl) , syyc0 (jpi,jpj,jpl) , sxyc0 (jpi,jpj,jpl) ,   & 
    521          &      sxsal(jpi,jpj,jpl) , sysal(jpi,jpj,jpl) , sxxsal(jpi,jpj,jpl) , syysal(jpi,jpj,jpl) , sxysal(jpi,jpj,jpl) ,   & 
    522          &      sxage(jpi,jpj,jpl) , syage(jpi,jpj,jpl) , sxxage(jpi,jpj,jpl) , syyage(jpi,jpj,jpl) , sxyage(jpi,jpj,jpl) ,   & 
    523          &      STAT=ierr(ii) ) 
    524       ii = ii + 1 
    525       ALLOCATE( sxe (jpi,jpj,nlay_i,jpl) , sye (jpi,jpj,nlay_i,jpl) , sxxe(jpi,jpj,nlay_i,jpl) ,     & 
    526          &      syye(jpi,jpj,nlay_i,jpl) , sxye(jpi,jpj,nlay_i,jpl)                            , STAT=ierr(ii) ) 
     459      ALLOCATE( t_i(jpi,jpj,nlay_i,jpl) , e_i(jpi,jpj,nlay_i,jpl) , sz_i(jpi,jpj,nlay_i,jpl) , STAT=ierr(ii) ) 
     460 
     461      ii = ii + 1 
     462      ALLOCATE( a_ip(jpi,jpj,jpl) , v_ip(jpi,jpj,jpl) , a_ip_frac(jpi,jpj,jpl) , & 
     463         &      h_ip(jpi,jpj,jpl) , STAT = ierr(ii) ) 
     464      ii = ii + 1 
     465      ALLOCATE( at_ip(jpi,jpj) , vt_ip(jpi,jpj) , STAT = ierr(ii) ) 
    527466 
    528467      ! * Old values of global variables 
    529468      ii = ii + 1 
    530       ALLOCATE( v_s_b  (jpi,jpj,jpl) , v_i_b  (jpi,jpj,jpl) , e_s_b(jpi,jpj,nlay_s,jpl) ,     & 
    531          &      a_i_b  (jpi,jpj,jpl) , smv_i_b(jpi,jpj,jpl) , e_i_b(jpi,jpj,nlay_i,jpl) ,     & 
    532          &      oa_i_b (jpi,jpj,jpl)                                                    , STAT=ierr(ii) ) 
     469      ALLOCATE( v_s_b  (jpi,jpj,jpl) , v_i_b  (jpi,jpj,jpl) , h_s_b(jpi,jpj,jpl)        , h_i_b(jpi,jpj,jpl)        ,   & 
     470         &      a_i_b  (jpi,jpj,jpl) , sv_i_b(jpi,jpj,jpl) , e_i_b (jpi,jpj,nlay_i,jpl) , e_s_b (jpi,jpj,nlay_s,jpl) ,   & 
     471         &      oa_i_b (jpi,jpj,jpl)                                                     , STAT=ierr(ii) ) 
    533472      ii = ii + 1 
    534473      ALLOCATE( u_ice_b(jpi,jpj) , v_ice_b(jpi,jpj) , at_i_b(jpi,jpj) , STAT=ierr(ii) ) 
     
    541480      ii = ii + 1 
    542481      ALLOCATE( diag_trp_vi(jpi,jpj) , diag_trp_vs (jpi,jpj) , diag_trp_ei(jpi,jpj),   &  
    543          &      diag_trp_es(jpi,jpj) , diag_trp_smv(jpi,jpj) , diag_heat  (jpi,jpj),   & 
    544          &      diag_smvi  (jpi,jpj) , diag_vice   (jpi,jpj) , diag_vsnw  (jpi,jpj), STAT=ierr(ii) ) 
     482         &      diag_trp_es(jpi,jpj) , diag_trp_sv (jpi,jpj) , diag_heat  (jpi,jpj),   & 
     483         &      diag_sice  (jpi,jpj) , diag_vice   (jpi,jpj) , diag_vsnw  (jpi,jpj), STAT=ierr(ii) ) 
     484 
     485      ! * SIMIP diagnostics 
     486      ii = ii + 1 
     487      ALLOCATE( t_si (jpi,jpj,jpl)    , tm_si(jpi,jpj)        ,    &  
     488                diag_fc_bo(jpi,jpj)   , diag_fc_su(jpi,jpj)   ,    & 
     489                STAT = ierr(ii) ) 
    545490 
    546491      ice_alloc = MAXVAL( ierr(:) ) 
     
    551496#else 
    552497   !!---------------------------------------------------------------------- 
    553    !!   Default option         Empty module            NO LIM sea-ice model 
     498   !!   Default option         Empty module           NO ESIM sea-ice model 
    554499   !!---------------------------------------------------------------------- 
    555500#endif 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/NST_SRC/agrif_ice.F90

    r8215 r8586  
    77   !!            3.6  ! 2016-05  (C. Rousset)   Add LIM3 compatibility 
    88   !!---------------------------------------------------------------------- 
    9 #if defined key_agrif && defined key_lim2 
    10    !!---------------------------------------------------------------------- 
    11    !!   'key_agrif'                                              AGRIF zoom 
    12    !!---------------------------------------------------------------------- 
    13    USE par_oce      ! ocean parameters 
    14     
    15    IMPLICIT NONE 
    16    PRIVATE  
    17  
    18    PUBLIC agrif_ice_alloc ! routine called by nemo_init in nemogcm.F90 
    19  
    20    INTEGER , PUBLIC ::   u_ice_id, v_ice_id, adv_ice_id 
    21    REAL(wp), PUBLIC ::   lim_nbstep = 0.    ! child time position in sea-ice model 
    22 #if defined key_lim2_vp 
    23    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)     :: u_ice_nst, v_ice_nst    
    24 #else 
    25    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:)   :: u_ice_oe, u_ice_sn     !: boundaries arrays 
    26    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:)   :: v_ice_oe, v_ice_sn     !:     -        -  
    27 #endif 
    28    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:,:) :: adv_ice_oe, adv_ice_sn !:     -        - 
    29  
    30    !!---------------------------------------------------------------------- 
    31    !! NEMO/NST 4.0 , NEMO Consortium (2017) 
    32    !! $Id$ 
    33    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    34    !!---------------------------------------------------------------------- 
    35 CONTAINS  
    36  
    37    INTEGER FUNCTION agrif_ice_alloc() 
    38       !!---------------------------------------------------------------------- 
    39       !!                ***  FUNCTION agrif_ice_alloc  *** 
    40       !!---------------------------------------------------------------------- 
    41 #if defined key_lim2_vp 
    42       ALLOCATE( u_ice_nst(jpi,jpj), v_ice_nst(jpi,jpj) ,   & 
    43 #else 
    44       ALLOCATE( u_ice_oe(4,jpj,2) , v_ice_oe(4,jpj,2) ,    & 
    45          &      u_ice_sn(jpi,4,2) , v_ice_sn(jpi,4,2) ,    & 
    46 #endif 
    47          &      adv_ice_oe (4,jpj,7,2) , adv_ice_sn (jpi,4,7,2) ,   & 
    48          &      STAT = agrif_ice_alloc) 
    49  
    50 #if ! defined key_lim2_vp 
    51       u_ice_oe(:,:,:) =  0._wp 
    52       v_ice_oe(:,:,:) =  0._wp 
    53       u_ice_sn(:,:,:) =  0._wp 
    54       v_ice_sn(:,:,:) =  0._wp 
    55 #endif 
    56       adv_ice_oe (:,:,:,:) = 0._wp  
    57       adv_ice_sn (:,:,:,:) = 0._wp 
    58       ! 
    59    END FUNCTION agrif_ice_alloc 
    60  
    61 #elif defined key_agrif && defined key_lim3 
     9#if defined key_agrif && defined key_lim3 
    6210   !!---------------------------------------------------------------------- 
    6311   !!   'key_agrif'                                              AGRIF zoom 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/NST_SRC/agrif_lim3_interp.F90

    r8215 r8586  
    2828   PRIVATE 
    2929 
    30    PUBLIC   agrif_interp_lim3   ! called by ??? 
     30   PUBLIC   agrif_interp_lim3   ! called by agrif_user.F90 
    3131 
    3232   !!---------------------------------------------------------------------- 
     
    5252      !!----------------------------------------------------------------------- 
    5353      ! 
    54       IF( Agrif_Root() )  RETURN 
     54      IF( Agrif_Root() .OR. nn_ice==0 )  RETURN   ! clem2017: do not interpolate if inside Parent domain or if child domain does not have ice 
    5555      ! 
    5656      SELECT CASE( cd_type ) 
     
    8484      !! 
    8585      !! i1 i2 j1 j2 are the index of the boundaries parent(when before) and child (when after) 
    86       !! To solve issues when parent grid is "land" masked but not all the corresponding child grid points, 
    87       !! put -9999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 
     86      !! To solve issues when parent grid is "land" masked but not all the corresponding child  
     87      !! grid points, put Agrif_SpecialValue WHERE the parent grid is masked.  
     88      !! The child solution will be found in the 9(?) points around 
    8889      !!----------------------------------------------------------------------- 
    8990      INTEGER                         , INTENT(in   ) ::   i1, i2, j1, j2 
     
    9697      IF( before ) THEN  ! parent grid 
    9798         ptab(:,:) = e2u(i1:i2,j1:j2) * u_ice_b(i1:i2,j1:j2) 
    98          WHERE( umask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = -9999. 
     99         WHERE( umask(i1:i2,j1:j2,1) == 0. )   ptab(i1:i2,j1:j2) = Agrif_SpecialValue 
    99100      ELSE               ! child grid 
    100101         zrhoy = Agrif_Rhoy() 
    101          u_ice(i1:i2,j1:j2) = ptab(:,:) / ( e2u(i1:i2,j1:j2) * zrhoy ) * umask(i1:i2,j1:j2,1) 
     102         u_ice(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) / ( e2u(i1:i2,j1:j2) * zrhoy ) * umask(i1:i2,j1:j2,1) 
    102103      ENDIF 
    103104      ! 
     
    110111      !! 
    111112      !! i1 i2 j1 j2 are the index of the boundaries parent(when before) and child (when after) 
    112       !! To solve issues when parent grid is "land" masked but not all the corresponding child grid points, 
    113       !! put -9999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 
     113      !! To solve issues when parent grid is "land" masked but not all the corresponding child  
     114      !! grid points, put Agrif_SpecialValue WHERE the parent grid is masked.  
     115      !! The child solution will be found in the 9(?) points around 
    114116      !!-----------------------------------------------------------------------       
    115117      INTEGER                         , INTENT(in   ) ::   i1, i2, j1, j2 
     
    122124      IF( before ) THEN  ! parent grid 
    123125         ptab(:,:) = e1v(i1:i2,j1:j2) * v_ice_b(i1:i2,j1:j2) 
    124          WHERE( vmask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = -9999. 
     126         WHERE( vmask(i1:i2,j1:j2,1) == 0. )   ptab(i1:i2,j1:j2) = Agrif_SpecialValue 
    125127      ELSE               ! child grid 
    126128         zrhox = Agrif_Rhox() 
    127          v_ice(i1:i2,j1:j2) = ptab(:,:) / ( e1v(i1:i2,j1:j2) * zrhox ) * vmask(i1:i2,j1:j2,1) 
     129         v_ice(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) / ( e1v(i1:i2,j1:j2) * zrhox ) * vmask(i1:i2,j1:j2,1) 
    128130      ENDIF 
    129131      ! 
     
    136138      !! 
    137139      !! i1 i2 j1 j2 are the index of the boundaries parent(when before) and child (when after) 
    138       !! To solve issues when parent grid is "land" masked but not all the corresponding child grid points, 
    139       !! put -9999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 
     140      !! To solve issues when parent grid is "land" masked but not all the corresponding child  
     141      !! grid points, put Agrif_SpecialValue WHERE the parent grid is masked.  
     142      !! The child solution will be found in the 9(?) points around 
    140143      !!----------------------------------------------------------------------- 
    141144      REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) ::   ptab 
     
    152155      ! tracers are not multiplied by grid cell here => before: * e1e2t ; after: * r1_e1e2t / rhox / rhoy 
    153156      ! and it is ok since we conserve tracers (same as in the ocean). 
    154       ALLOCATE( ztab(SIZE(a_i_b,1),SIZE(a_i_b,2),SIZE(ptab,3)) ) 
     157      ALLOCATE( ztab(SIZE(a_i,1),SIZE(a_i,2),SIZE(ptab,3)) ) 
    155158      
    156159      IF( before ) THEN  ! parent grid 
    157160         jm = 1 
    158161         DO jl = 1, jpl 
    159             ptab(i1:i2,j1:j2,jm) = a_i_b  (i1:i2,j1:j2,jl)   ;   jm = jm + 1 
    160             ptab(i1:i2,j1:j2,jm) = v_i_b  (i1:i2,j1:j2,jl)   ;   jm = jm + 1 
    161             ptab(i1:i2,j1:j2,jm) = v_s_b  (i1:i2,j1:j2,jl)   ;   jm = jm + 1 
    162             ptab(i1:i2,j1:j2,jm) = smv_i_b(i1:i2,j1:j2,jl)   ;   jm = jm + 1 
    163             ptab(i1:i2,j1:j2,jm) = oa_i_b (i1:i2,j1:j2,jl)   ;   jm = jm + 1 
     162            ptab(i1:i2,j1:j2,jm  ) = a_i_b (i1:i2,j1:j2,jl) 
     163            ptab(i1:i2,j1:j2,jm+1) = v_i_b (i1:i2,j1:j2,jl) 
     164            ptab(i1:i2,j1:j2,jm+2) = v_s_b (i1:i2,j1:j2,jl) 
     165            ptab(i1:i2,j1:j2,jm+3) = sv_i_b(i1:i2,j1:j2,jl) 
     166            ptab(i1:i2,j1:j2,jm+4) = oa_i_b(i1:i2,j1:j2,jl) 
     167            jm = jm + 5 
    164168            DO jk = 1, nlay_s 
    165169               ptab(i1:i2,j1:j2,jm) = e_s_b(i1:i2,j1:j2,jk,jl)   ;   jm = jm + 1 
     
    171175          
    172176         DO jk = k1, k2 
    173             WHERE( tmask(i1:i2,j1:j2,1) == 0._wp )   ptab(i1:i2,j1:j2,jk) = -9999. 
     177            WHERE( tmask(i1:i2,j1:j2,1) == 0._wp )   ptab(i1:i2,j1:j2,jk) = Agrif_SpecialValue 
    174178         END DO 
     179         ! 
     180      ELSE               ! child grid 
     181         ! 
     182         IF( nbghostcells > 1 ) THEN   ! ==> The easiest interpolation is used 
     183            ! 
     184            jm = 1 
     185            DO jl = 1, jpl 
     186               ! 
     187               DO jj = j1, j2 
     188                  DO ji = i1, i2 
     189                     a_i (ji,jj,jl) = ptab(ji,jj,jm  ) * tmask(ji,jj,1) 
     190                     v_i (ji,jj,jl) = ptab(ji,jj,jm+1) * tmask(ji,jj,1) 
     191                     v_s (ji,jj,jl) = ptab(ji,jj,jm+2) * tmask(ji,jj,1) 
     192                     sv_i(ji,jj,jl) = ptab(ji,jj,jm+3) * tmask(ji,jj,1) 
     193                     oa_i(ji,jj,jl) = ptab(ji,jj,jm+4) * tmask(ji,jj,1) 
     194                  END DO 
     195               END DO 
     196               jm = jm + 5 
     197               ! 
     198               DO jk = 1, nlay_s 
     199                  e_s(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) 
     200                  jm = jm + 1 
     201               END DO 
     202               ! 
     203               DO jk = 1, nlay_i 
     204                  e_i(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) 
     205                  jm = jm + 1 
     206               END DO 
     207               ! 
     208            END DO 
     209            ! 
     210         ELSE                          ! ==> complex interpolation (only one ghost cell available) 
     211            !! Use a more complex interpolation since we mix solutions over a couple of grid points 
     212            !! it is advised to use it for fields modified by high order schemes (e.g. advection UM5...) 
     213            !! clem: for some reason (I don't know why), the following lines do not work  
     214            !!       with mpp (or in realistic configurations?). It makes the model crash 
     215            !        I think there is an issue with Agrif_SpecialValue here (not taken into account properly) 
     216            ! record ztab 
     217            jm = 1 
     218            DO jl = 1, jpl 
     219               ztab(:,:,jm  ) = a_i  (:,:,jl) 
     220               ztab(:,:,jm+1) = v_i  (:,:,jl) 
     221               ztab(:,:,jm+2) = v_s  (:,:,jl) 
     222               ztab(:,:,jm+3) = sv_i(:,:,jl) 
     223               ztab(:,:,jm+4) = oa_i(:,:,jl) 
     224               jm = jm + 5 
     225               DO jk = 1, nlay_s 
     226                  ztab(:,:,jm) = e_s(:,:,jk,jl) 
     227                  jm = jm + 1 
     228               END DO 
     229               DO jk = 1, nlay_i 
     230                  ztab(:,:,jm) = e_i(:,:,jk,jl) 
     231                  jm = jm + 1 
     232               END DO 
     233               ! 
     234            END DO 
     235            ! 
     236            ! borders of the domain 
     237            western_side  = (nb == 1).AND.(ndir == 1)  ;  eastern_side  = (nb == 1).AND.(ndir == 2) 
     238            southern_side = (nb == 2).AND.(ndir == 1)  ;  northern_side = (nb == 2).AND.(ndir == 2) 
     239            ! 
     240            ! spatial smoothing 
     241            zrhox = Agrif_Rhox() 
     242            z1 =      ( zrhox - 1. ) * 0.5  
     243            z3 =      ( zrhox - 1. ) / ( zrhox + 1. ) 
     244            z6 = 2. * ( zrhox - 1. ) / ( zrhox + 1. ) 
     245            z7 =    - ( zrhox - 1. ) / ( zrhox + 3. ) 
     246            z2 = 1. - z1 
     247            z4 = 1. - z3 
     248            z5 = 1. - z6 - z7 
     249            ! 
     250            ! Remove corners 
     251            imin = i1  ;  imax = i2  ;  jmin = j1  ;  jmax = j2 
     252            IF( (nbondj == -1) .OR. (nbondj == 2) )   jmin = 3 
     253            IF( (nbondj == +1) .OR. (nbondj == 2) )   jmax = nlcj-2 
     254            IF( (nbondi == -1) .OR. (nbondi == 2) )   imin = 3 
     255            IF( (nbondi == +1) .OR. (nbondi == 2) )   imax = nlci-2 
     256 
     257            ! smoothed fields 
     258            IF( eastern_side ) THEN 
     259               ztab(nlci,j1:j2,:) = z1 * ptab(nlci,j1:j2,:) + z2 * ptab(nlci-1,j1:j2,:) 
     260               DO jj = jmin, jmax 
     261                  rswitch = 0. 
     262                  IF( u_ice(nlci-2,jj) > 0._wp ) rswitch = 1. 
     263                  ztab(nlci-1,jj,:) = ( 1. - umask(nlci-2,jj,1) ) * ztab(nlci,jj,:)  & 
     264                     &                +      umask(nlci-2,jj,1)   *  & 
     265                     &                ( ( 1. - rswitch ) * ( z4 * ztab(nlci,jj,:)   + z3 * ztab(nlci-2,jj,:) )  & 
     266                     &                  +      rswitch   * ( z6 * ztab(nlci-2,jj,:) + z5 * ztab(nlci,jj,:) + z7 * ztab(nlci-3,jj,:) ) ) 
     267                  ztab(nlci-1,jj,:) = ztab(nlci-1,jj,:) * tmask(nlci-1,jj,1) 
     268               END DO 
     269            ENDIF 
     270            !  
     271            IF( northern_side ) THEN 
     272               ztab(i1:i2,nlcj,:) = z1 * ptab(i1:i2,nlcj,:) + z2 * ptab(i1:i2,nlcj-1,:) 
     273               DO ji = imin, imax 
     274                  rswitch = 0. 
     275                  IF( v_ice(ji,nlcj-2) > 0._wp ) rswitch = 1. 
     276                  ztab(ji,nlcj-1,:) = ( 1. - vmask(ji,nlcj-2,1) ) * ztab(ji,nlcj,:)  & 
     277                     &                +      vmask(ji,nlcj-2,1)   *  & 
     278                     &                ( ( 1. - rswitch ) * ( z4 * ztab(ji,nlcj,:)   + z3 * ztab(ji,nlcj-2,:) ) & 
     279                     &                  +      rswitch   * ( z6 * ztab(ji,nlcj-2,:) + z5 * ztab(ji,nlcj,:) + z7 * ztab(ji,nlcj-3,:) ) ) 
     280                  ztab(ji,nlcj-1,:) = ztab(ji,nlcj-1,:) * tmask(ji,nlcj-1,1) 
     281               END DO 
     282            END IF 
     283            ! 
     284            IF( western_side) THEN 
     285               ztab(1,j1:j2,:) = z1 * ptab(1,j1:j2,:) + z2 * ptab(2,j1:j2,:) 
     286               DO jj = jmin, jmax 
     287                  rswitch = 0. 
     288                  IF( u_ice(2,jj) < 0._wp ) rswitch = 1. 
     289                  ztab(2,jj,:) = ( 1. - umask(2,jj,1) ) * ztab(1,jj,:)  & 
     290                     &           +      umask(2,jj,1)   *   & 
     291                     &           ( ( 1. - rswitch ) * ( z4 * ztab(1,jj,:) + z3 * ztab(3,jj,:) ) & 
     292                     &             +      rswitch   * ( z6 * ztab(3,jj,:) + z5 * ztab(1,jj,:) + z7 * ztab(4,jj,:) ) ) 
     293                  ztab(2,jj,:) = ztab(2,jj,:) * tmask(2,jj,1) 
     294               END DO 
     295            ENDIF 
     296            ! 
     297            IF( southern_side ) THEN 
     298               ztab(i1:i2,1,:) = z1 * ptab(i1:i2,1,:) + z2 * ptab(i1:i2,2,:) 
     299               DO ji = imin, imax 
     300                  rswitch = 0. 
     301                  IF( v_ice(ji,2) < 0._wp ) rswitch = 1. 
     302                  ztab(ji,2,:) = ( 1. - vmask(ji,2,1) ) * ztab(ji,1,:)  & 
     303                     &           +      vmask(ji,2,1)   *  & 
     304                     &           ( ( 1. - rswitch ) * ( z4 * ztab(ji,1,:) + z3 * ztab(ji,3,:) ) & 
     305                     &             +      rswitch   * ( z6 * ztab(ji,3,:) + z5 * ztab(ji,1,:) + z7 * ztab(ji,4,:) ) ) 
     306                  ztab(ji,2,:) = ztab(ji,2,:) * tmask(ji,2,1) 
     307               END DO 
     308            END IF 
     309            ! 
     310            ! Treatment of corners 
     311            IF( (eastern_side) .AND. ((nbondj == -1).OR.(nbondj == 2)) )  ztab(nlci-1,2,:)      = ptab(nlci-1,2,:)      ! East south 
     312            IF( (eastern_side) .AND. ((nbondj ==  1).OR.(nbondj == 2)) )  ztab(nlci-1,nlcj-1,:) = ptab(nlci-1,nlcj-1,:) ! East north 
     313            IF( (western_side) .AND. ((nbondj == -1).OR.(nbondj == 2)) )  ztab(2,2,:)           = ptab(2,2,:)           ! West south 
     314            IF( (western_side) .AND. ((nbondj ==  1).OR.(nbondj == 2)) )  ztab(2,nlcj-1,:)      = ptab(2,nlcj-1,:)      ! West north 
     315             
     316            ! retrieve ice tracers 
     317            jm = 1 
     318            DO jl = 1, jpl 
     319               ! 
     320               DO jj = j1, j2 
     321                  DO ji = i1, i2 
     322                     a_i (ji,jj,jl) = ztab(ji,jj,jm  ) * tmask(ji,jj,1) 
     323                     v_i (ji,jj,jl) = ztab(ji,jj,jm+1) * tmask(ji,jj,1) 
     324                     v_s (ji,jj,jl) = ztab(ji,jj,jm+2) * tmask(ji,jj,1) 
     325                     sv_i(ji,jj,jl) = ztab(ji,jj,jm+3) * tmask(ji,jj,1) 
     326                     oa_i (ji,jj,jl) = ztab(ji,jj,jm+4) * tmask(ji,jj,1) 
     327                  END DO 
     328               END DO 
     329               jm = jm + 5 
     330               ! 
     331               DO jk = 1, nlay_s 
     332                  e_s(i1:i2,j1:j2,jk,jl) = ztab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
     333                  jm = jm + 1 
     334               END DO 
     335               ! 
     336               DO jk = 1, nlay_i 
     337                  e_i(i1:i2,j1:j2,jk,jl) = ztab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
     338                  jm = jm + 1 
     339               END DO 
     340               ! 
     341            END DO 
     342           
     343         ENDIF  ! nbghostcells=1 
    175344          
    176       ELSE               ! child grid 
    177 !! ==> The easiest interpolation is the following commented lines 
    178          jm = 1 
    179          DO jl = 1, jpl 
    180             a_i  (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    181             v_i  (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    182             v_s  (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    183             smv_i(i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    184             oa_i (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    185             DO jk = 1, nlay_s 
    186                e_s(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    187             END DO 
    188             DO jk = 1, nlay_i 
    189                e_i(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    190             END DO 
    191          END DO 
    192  
    193 !! ==> this is a more complex interpolation since we mix solutions over a couple of grid points 
    194 !!     it is advised to use it for fields modified by high order schemes (e.g. advection UM5...) 
    195 !!        clem: for some reason (I don't know why), the following lines do not work  
    196 !!              with mpp (or in realistic configurations?). It makes the model crash 
    197 !         ! record ztab 
    198 !         jm = 1 
    199 !         DO jl = 1, jpl 
    200 !            ztab(:,:,jm) = a_i  (:,:,jl) ; jm = jm + 1 
    201 !            ztab(:,:,jm) = v_i  (:,:,jl) ; jm = jm + 1 
    202 !            ztab(:,:,jm) = v_s  (:,:,jl) ; jm = jm + 1 
    203 !            ztab(:,:,jm) = smv_i(:,:,jl) ; jm = jm + 1 
    204 !            ztab(:,:,jm) = oa_i (:,:,jl) ; jm = jm + 1 
    205 !            DO jk = 1, nlay_s 
    206 !               ztab(:,:,jm) = e_s(:,:,jk,jl) ; jm = jm + 1 
    207 !            ENDDO 
    208 !            DO jk = 1, nlay_i 
    209 !               ztab(:,:,jm) = e_i(:,:,jk,jl) ; jm = jm + 1 
    210 !            ENDDO 
    211 !         ENDDO 
    212 !         ! 
    213 !         ! borders of the domain 
    214 !         western_side  = (nb == 1).AND.(ndir == 1)  ;  eastern_side  = (nb == 1).AND.(ndir == 2) 
    215 !         southern_side = (nb == 2).AND.(ndir == 1)  ;  northern_side = (nb == 2).AND.(ndir == 2) 
    216 !         ! 
    217 !         ! spatial smoothing 
    218 !         zrhox = Agrif_Rhox() 
    219 !         z1 =      ( zrhox - 1. ) * 0.5  
    220 !         z3 =      ( zrhox - 1. ) / ( zrhox + 1. ) 
    221 !         z6 = 2. * ( zrhox - 1. ) / ( zrhox + 1. ) 
    222 !         z7 =    - ( zrhox - 1. ) / ( zrhox + 3. ) 
    223 !         z2 = 1. - z1 
    224 !         z4 = 1. - z3 
    225 !         z5 = 1. - z6 - z7 
    226 !         ! 
    227 !         ! Remove corners 
    228 !         imin = i1  ;  imax = i2  ;  jmin = j1  ;  jmax = j2 
    229 !         IF( (nbondj == -1) .OR. (nbondj == 2) )   jmin = 3 
    230 !         IF( (nbondj == +1) .OR. (nbondj == 2) )   jmax = nlcj-2 
    231 !         IF( (nbondi == -1) .OR. (nbondi == 2) )   imin = 3 
    232 !         IF( (nbondi == +1) .OR. (nbondi == 2) )   imax = nlci-2 
    233 ! 
    234 !         ! smoothed fields 
    235 !         IF( eastern_side ) THEN 
    236 !            ztab(nlci,j1:j2,:) = z1 * ptab(nlci,j1:j2,:) + z2 * ptab(nlci-1,j1:j2,:) 
    237 !            DO jj = jmin, jmax 
    238 !               rswitch = 0. 
    239 !               IF( u_ice(nlci-2,jj) > 0._wp ) rswitch = 1. 
    240 !               ztab(nlci-1,jj,:) = ( 1. - umask(nlci-2,jj,1) ) * ztab(nlci,jj,:)  & 
    241 !                  &                +      umask(nlci-2,jj,1)   *  & 
    242 !                  &                ( ( 1. - rswitch ) * ( z4 * ztab(nlci,jj,:)   + z3 * ztab(nlci-2,jj,:) )  & 
    243 !                  &                  +      rswitch   * ( z6 * ztab(nlci-2,jj,:) + z5 * ztab(nlci,jj,:) + z7 * ztab(nlci-3,jj,:) ) ) 
    244 !               ztab(nlci-1,jj,:) = ztab(nlci-1,jj,:) * tmask(nlci-1,jj,1) 
    245 !            END DO 
    246 !         ENDIF 
    247 !         !  
    248 !         IF( northern_side ) THEN 
    249 !            ztab(i1:i2,nlcj,:) = z1 * ptab(i1:i2,nlcj,:) + z2 * ptab(i1:i2,nlcj-1,:) 
    250 !            DO ji = imin, imax 
    251 !               rswitch = 0. 
    252 !               IF( v_ice(ji,nlcj-2) > 0._wp ) rswitch = 1. 
    253 !               ztab(ji,nlcj-1,:) = ( 1. - vmask(ji,nlcj-2,1) ) * ztab(ji,nlcj,:)  & 
    254 !                  &                +      vmask(ji,nlcj-2,1)   *  & 
    255 !                  &                ( ( 1. - rswitch ) * ( z4 * ztab(ji,nlcj,:)   + z3 * ztab(ji,nlcj-2,:) ) & 
    256 !                  &                  +      rswitch   * ( z6 * ztab(ji,nlcj-2,:) + z5 * ztab(ji,nlcj,:) + z7 * ztab(ji,nlcj-3,:) ) ) 
    257 !               ztab(ji,nlcj-1,:) = ztab(ji,nlcj-1,:) * tmask(ji,nlcj-1,1) 
    258 !            END DO 
    259 !         END IF 
    260 !         ! 
    261 !         IF( western_side) THEN 
    262 !            ztab(1,j1:j2,:) = z1 * ptab(1,j1:j2,:) + z2 * ptab(2,j1:j2,:) 
    263 !            DO jj = jmin, jmax 
    264 !               rswitch = 0. 
    265 !               IF( u_ice(2,jj) < 0._wp ) rswitch = 1. 
    266 !               ztab(2,jj,:) = ( 1. - umask(2,jj,1) ) * ztab(1,jj,:)  & 
    267 !                  &           +      umask(2,jj,1)   *   & 
    268 !                  &           ( ( 1. - rswitch ) * ( z4 * ztab(1,jj,:) + z3 * ztab(3,jj,:) ) & 
    269 !                  &             +      rswitch   * ( z6 * ztab(3,jj,:) + z5 * ztab(1,jj,:) + z7 * ztab(4,jj,:) ) ) 
    270 !               ztab(2,jj,:) = ztab(2,jj,:) * tmask(2,jj,1) 
    271 !            END DO 
    272 !         ENDIF 
    273 !         ! 
    274 !         IF( southern_side ) THEN 
    275 !            ztab(i1:i2,1,:) = z1 * ptab(i1:i2,1,:) + z2 * ptab(i1:i2,2,:) 
    276 !            DO ji = imin, imax 
    277 !               rswitch = 0. 
    278 !               IF( v_ice(ji,2) < 0._wp ) rswitch = 1. 
    279 !               ztab(ji,2,:) = ( 1. - vmask(ji,2,1) ) * ztab(ji,1,:)  & 
    280 !                  &           +      vmask(ji,2,1)   *  & 
    281 !                  &           ( ( 1. - rswitch ) * ( z4 * ztab(ji,1,:) + z3 * ztab(ji,3,:) ) & 
    282 !                  &             +      rswitch   * ( z6 * ztab(ji,3,:) + z5 * ztab(ji,1,:) + z7 * ztab(ji,4,:) ) ) 
    283 !               ztab(ji,2,:) = ztab(ji,2,:) * tmask(ji,2,1) 
    284 !            END DO 
    285 !         END IF 
    286 !         ! 
    287 !         ! Treatment of corners 
    288 !         IF( (eastern_side) .AND. ((nbondj == -1).OR.(nbondj == 2)) )  ztab(nlci-1,2,:)      = ptab(nlci-1,2,:)      ! East south 
    289 !         IF( (eastern_side) .AND. ((nbondj ==  1).OR.(nbondj == 2)) )  ztab(nlci-1,nlcj-1,:) = ptab(nlci-1,nlcj-1,:) ! East north 
    290 !         IF( (western_side) .AND. ((nbondj == -1).OR.(nbondj == 2)) )  ztab(2,2,:)           = ptab(2,2,:)           ! West south 
    291 !         IF( (western_side) .AND. ((nbondj ==  1).OR.(nbondj == 2)) )  ztab(2,nlcj-1,:)      = ptab(2,nlcj-1,:)      ! West north 
    292 ! 
    293 !         ! retrieve ice tracers 
    294 !         jm = 1 
    295 !         DO jl = 1, jpl 
    296 !            a_i  (i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    297 !            v_i  (i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    298 !            v_s  (i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    299 !            smv_i(i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    300 !            oa_i (i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    301 !            DO jk = 1, nlay_s 
    302 !               e_s(i1:i2,j1:j2,jk,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    303 !            ENDDO 
    304 !            DO jk = 1, nlay_i 
    305 !               e_i(i1:i2,j1:j2,jk,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    306 !            ENDDO 
    307 !         ENDDO 
    308         
    309345         ! integrated values 
    310346         vt_i (i1:i2,j1:j2) = SUM( v_i(i1:i2,j1:j2,:), dim=3 ) 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/NST_SRC/agrif_lim3_update.F90

    r8215 r8586  
    3131   PRIVATE 
    3232 
    33    PUBLIC   agrif_update_lim3   ! called by ???? 
     33   PUBLIC   agrif_update_lim3   ! called by agrif_user.F90 
    3434 
    3535   !!---------------------------------------------------------------------- 
     
    5454      IF( ( MOD( (kt-nit000)/nn_fsbc + 1, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) /=0 ) .AND. (kt /= 0) ) RETURN ! do not update if nb of child time steps differ from time refinement 
    5555                                                                                                                           ! i.e. update only at the parent time step 
     56      IF( nn_ice == 0 ) RETURN   ! clem2017: do not update if child domain does not have ice 
     57      ! 
     58      Agrif_SpecialValueFineGrid    = -9999. 
    5659      Agrif_UseSpecialValueInUpdate = .TRUE. 
    57       Agrif_SpecialValueFineGrid    = -9999. 
    5860# if defined TWO_WAY 
    5961      IF( MOD(nbcline,nbclineupdate) == 0) THEN ! update the whole basin at each nbclineupdate (=nn_cln_update) baroclinic parent time steps 
     
    6870      ENDIF 
    6971# endif 
     72      Agrif_SpecialValueFineGrid    = 0. 
    7073      Agrif_UseSpecialValueInUpdate = .FALSE. 
    7174      ! 
     
    8386      LOGICAL                               , INTENT(in   ) ::   before 
    8487      !! 
    85       INTEGER  :: jk, jl, jm 
     88      INTEGER  :: ji, jj, jk, jl, jm 
    8689      !!----------------------------------------------------------------------- 
    8790      ! it is ok not to multiply by e1*e2 since we conserve tracers here (same as in the ocean). 
     
    8992         jm = 1 
    9093         DO jl = 1, jpl 
    91             ptab(:,:,jm) = a_i  (i1:i2,j1:j2,jl)   ;   jm = jm + 1 
    92             ptab(:,:,jm) = v_i  (i1:i2,j1:j2,jl)   ;   jm = jm + 1 
    93             ptab(:,:,jm) = v_s  (i1:i2,j1:j2,jl)   ;   jm = jm + 1 
    94             ptab(:,:,jm) = smv_i(i1:i2,j1:j2,jl)   ;   jm = jm + 1 
    95             ptab(:,:,jm) = oa_i (i1:i2,j1:j2,jl)   ;   jm = jm + 1 
     94            ptab(i1:i2,j1:j2,jm  ) = a_i (i1:i2,j1:j2,jl) 
     95            ptab(i1:i2,j1:j2,jm+1) = v_i (i1:i2,j1:j2,jl) 
     96            ptab(i1:i2,j1:j2,jm+2) = v_s (i1:i2,j1:j2,jl) 
     97            ptab(i1:i2,j1:j2,jm+3) = sv_i(i1:i2,j1:j2,jl) 
     98            ptab(i1:i2,j1:j2,jm+4) = oa_i (i1:i2,j1:j2,jl) 
     99            jm = jm + 5 
    96100            DO jk = 1, nlay_s 
    97                ptab(:,:,jm) = e_s(i1:i2,j1:j2,jk,jl)   ;   jm = jm + 1 
     101               ptab(i1:i2,j1:j2,jm) = e_s(i1:i2,j1:j2,jk,jl)   ;   jm = jm + 1 
    98102            END DO 
    99103            DO jk = 1, nlay_i 
    100                ptab(:,:,jm) = e_i(i1:i2,j1:j2,jk,jl)   ;   jm = jm + 1 
     104               ptab(i1:i2,j1:j2,jm) = e_i(i1:i2,j1:j2,jk,jl)   ;   jm = jm + 1 
    101105            END DO 
    102106         END DO 
    103  
     107         ! 
    104108         DO jk = k1, k2 
    105             WHERE( tmask(i1:i2,j1:j2,1) == 0. )  ptab(:,:,jk) = -9999. 
     109            WHERE( tmask(i1:i2,j1:j2,1) == 0. )   ptab(i1:i2,j1:j2,jk) = Agrif_SpecialValueFineGrid  
    106110         END DO 
    107          !        
     111         ! 
    108112      ELSE 
     113         ! 
    109114         jm = 1 
    110115         DO jl = 1, jpl 
    111             a_i  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    112             v_i  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    113             v_s  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    114             smv_i(i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    115             oa_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
     116            ! 
     117            DO jj = j1, j2 
     118               DO ji = i1, i2 
     119                  IF( ptab(ji,jj,jm) /= Agrif_SpecialValueFineGrid ) THEN 
     120                     a_i (ji,jj,jl) = ptab(ji,jj,jm  ) * tmask(ji,jj,1) 
     121                     v_i (ji,jj,jl) = ptab(ji,jj,jm+1) * tmask(ji,jj,1) 
     122                     v_s (ji,jj,jl) = ptab(ji,jj,jm+2) * tmask(ji,jj,1) 
     123                     sv_i(ji,jj,jl) = ptab(ji,jj,jm+3) * tmask(ji,jj,1) 
     124                     oa_i(ji,jj,jl) = ptab(ji,jj,jm+4) * tmask(ji,jj,1) 
     125                  ENDIF 
     126               END DO 
     127            END DO 
     128            jm = jm + 5 
     129            ! 
    116130            DO jk = 1, nlay_s 
    117                e_s(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    118             ENDDO 
     131               WHERE( ptab(i1:i2,j1:j2,jm) /= Agrif_SpecialValueFineGrid ) 
     132                  e_s(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
     133               ENDWHERE 
     134               jm = jm + 1 
     135            END DO 
     136            ! 
    119137            DO jk = 1, nlay_i 
    120                e_i(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1 
    121             END DO 
     138               WHERE( ptab(i1:i2,j1:j2,jm) /= Agrif_SpecialValueFineGrid ) 
     139                  e_i(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
     140               ENDWHERE 
     141               jm = jm + 1 
     142            END DO 
     143            ! 
    122144         END DO 
    123  
     145         ! 
    124146         ! integrated values 
    125          vt_i (i1:i2,j1:j2) = SUM( v_i(i1:i2,j1:j2,:), dim=3 ) 
    126          vt_s (i1:i2,j1:j2) = SUM( v_s(i1:i2,j1:j2,:), dim=3 ) 
    127          at_i (i1:i2,j1:j2) = SUM( a_i(i1:i2,j1:j2,:), dim=3 ) 
     147         vt_i (i1:i2,j1:j2) = SUM(      v_i(i1:i2,j1:j2,:)           , dim=3 ) 
     148         vt_s (i1:i2,j1:j2) = SUM(      v_s(i1:i2,j1:j2,:)           , dim=3 ) 
     149         at_i (i1:i2,j1:j2) = SUM(      a_i(i1:i2,j1:j2,:)           , dim=3 ) 
    128150         et_s(i1:i2,j1:j2)  = SUM( SUM( e_s(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 
    129151         et_i(i1:i2,j1:j2)  = SUM( SUM( e_i(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 
     
    149171         zrhoy = Agrif_Rhoy() 
    150172         ptab(:,:) = e2u(i1:i2,j1:j2) * u_ice(i1:i2,j1:j2) * zrhoy 
    151          WHERE( umask(i1:i2,j1:j2,1) == 0. )   ptab(:,:) = -9999. 
     173         WHERE( umask(i1:i2,j1:j2,1) == 0._wp )   ptab(:,:) = Agrif_SpecialValueFineGrid 
    152174      ELSE 
    153          u_ice(i1:i2,j1:j2) = ptab(:,:) / e2u(i1:i2,j1:j2) * umask(i1:i2,j1:j2,1) 
     175         WHERE( ptab(i1:i2,j1:j2) /= Agrif_SpecialValueFineGrid ) 
     176            u_ice(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) / e2u(i1:i2,j1:j2) * umask(i1:i2,j1:j2,1) 
     177         ENDWHERE 
    154178      ENDIF 
    155179      !  
     
    172196         zrhox = Agrif_Rhox() 
    173197         ptab(:,:) = e1v(i1:i2,j1:j2) * v_ice(i1:i2,j1:j2) * zrhox 
    174          WHERE( vmask(i1:i2,j1:j2,1) == 0. )   ptab(:,:) = -9999. 
     198         WHERE( vmask(i1:i2,j1:j2,1) == 0._wp )   ptab(:,:) = Agrif_SpecialValueFineGrid 
    175199      ELSE 
    176          v_ice(i1:i2,j1:j2) = ptab(:,:) / e1v(i1:i2,j1:j2) * vmask(i1:i2,j1:j2,1) 
     200         WHERE( ptab(i1:i2,j1:j2) /= Agrif_SpecialValueFineGrid ) 
     201            v_ice(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) / e1v(i1:i2,j1:j2) * vmask(i1:i2,j1:j2,1) 
     202         ENDWHERE 
    177203      ENDIF 
    178204      ! 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/NST_SRC/agrif_oce.F90

    r8215 r8586  
    4747   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fsahm_spt, fsahm_spf !: sponge viscosities 
    4848 
    49 !!gm   add PUBLIC in all variable below:  should we need to add it 
    50  
    5149   ! Barotropic arrays used to store open boundary data during time-splitting loop: 
    5250   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::  ubdy_w, vbdy_w, hbdy_w 
     
    7169   INTEGER :: umsk_id, vmsk_id 
    7270   INTEGER :: kindic_agr 
    73  
    74 !!gm end possible public addition 
    7571 
    7672   !!---------------------------------------------------------------------- 
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/NST_SRC/agrif_opa_interp.F90

    r8215 r8586  
    22   !!====================================================================== 
    33   !!                   ***  MODULE  agrif_opa_interp  *** 
    4    !! AGRIF: interpolation package 
     4   !! AGRIF: interpolation package for the ocean dynamics (OPA) 
    55   !!====================================================================== 
    66   !! History :  2.0  !  2002-06  (XXX)  Original cade 
     
    2121   USE oce 
    2222   USE dom_oce       
    23    USE zdf_oce          ! vertical physics 
     23   USE zdf_oce 
    2424   USE agrif_oce 
    2525   USE phycst 
     
    2828   USE agrif_opa_sponge 
    2929   USE lib_mpp 
    30    USE wrk_nemo 
    3130  
    3231   IMPLICIT NONE 
     
    7574      INTEGER ::   ji, jj, jk       ! dummy loop indices 
    7675      INTEGER ::   j1, j2, i1, i2 
    77       REAL(wp), POINTER, DIMENSION(:,:) ::   zub, zvb 
     76      REAL(wp), DIMENSION(jpi,jpj) ::   zub, zvb 
    7877      !!----------------------------------------------------------------------   
    7978      ! 
    8079      IF( Agrif_Root() )   RETURN 
    81       ! 
    82       CALL wrk_alloc( jpi,jpj,   zub, zvb ) 
    8380      ! 
    8481      Agrif_SpecialValue    = 0._wp 
     
    103100         ! --------- 
    104101         IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
    105             ua_b(2,:) = 0._wp 
     102            ua_b(2:1+nbghostcells,:) = 0._wp 
    106103            DO jk = 1, jpkm1 
    107104               DO jj = 1, jpj 
    108                   ua_b(2,jj) = ua_b(2,jj) + e3u_a(2,jj,jk) * ua(2,jj,jk) 
     105                  ua_b(2:1+nbghostcells,jj) = ua_b(2:1+nbghostcells,jj) + e3u_a(2:1+nbghostcells,jj,jk) * ua(2:1+nbghostcells,jj,jk) 
    109106               END DO 
    110107            END DO 
    111108            DO jj = 1, jpj 
    112                ua_b(2,jj) = ua_b(2,jj) * r1_hu_a(2,jj)             
    113             END DO 
    114          ENDIF 
    115          ! 
    116          DO jk=1,jpkm1                 ! Smooth 
    117             DO jj=j1,j2 
    118                ua(2,jj,jk) = 0.25_wp*(ua(1,jj,jk)+2._wp*ua(2,jj,jk)+ua(3,jj,jk)) 
    119                ua(2,jj,jk) = ua(2,jj,jk) * umask(2,jj,jk) 
    120             END DO 
    121          END DO 
    122          ! 
    123          zub(2,:) = 0._wp              ! Correct transport 
    124          DO jk = 1, jpkm1 
    125             DO jj = 1, jpj 
    126                zub(2,jj) = zub(2,jj) + e3u_a(2,jj,jk) * ua(2,jj,jk) 
    127             END DO 
    128          END DO 
    129          DO jj=1,jpj 
    130             zub(2,jj) = zub(2,jj) * r1_hu_a(2,jj) 
    131          END DO 
    132  
    133          DO jk=1,jpkm1 
    134             DO jj=1,jpj 
    135                ua(2,jj,jk) = (ua(2,jj,jk)+ua_b(2,jj)-zub(2,jj))*umask(2,jj,jk) 
    136             END DO 
    137          END DO 
    138  
    139          ! Set tangential velocities to time splitting estimate 
    140          !----------------------------------------------------- 
    141          IF( ln_dynspg_ts ) THEN 
    142             zvb(2,:) = 0._wp 
     109               ua_b(2:1+nbghostcells,jj) = ua_b(2:1+nbghostcells,jj) * r1_hu_a(2:1+nbghostcells,jj) 
     110            END DO 
     111         ENDIF 
     112         ! 
     113         ! Smoothing if only 1 ghostcell 
     114         ! ----------------------------- 
     115         IF( nbghostcells == 1 ) THEN 
     116            DO jk=1,jpkm1                 ! Smooth 
     117               DO jj=j1,j2 
     118                  ua(2,jj,jk) = 0.25_wp*(ua(1,jj,jk)+2._wp*ua(2,jj,jk)+ua(3,jj,jk)) 
     119                  ua(2,jj,jk) = ua(2,jj,jk) * umask(2,jj,jk) 
     120               END DO 
     121            END DO 
     122            ! 
     123            zub(2,:) = 0._wp              ! Correct transport 
    143124            DO jk = 1, jpkm1 
    144125               DO jj = 1, jpj 
    145                   zvb(2,jj) = zvb(2,jj) + e3v_a(2,jj,jk) * va(2,jj,jk) 
    146                END DO 
    147             END DO 
    148             DO jj = 1, jpj 
    149                zvb(2,jj) = zvb(2,jj) * r1_hv_a(2,jj) 
    150             END DO 
     126                  zub(2,jj) = zub(2,jj) + e3u_a(2,jj,jk) * ua(2,jj,jk) 
     127               END DO 
     128            END DO 
     129            DO jj=1,jpj 
     130               zub(2,jj) = zub(2,jj) * r1_hu_a(2,jj) 
     131            END DO 
     132             
    151133            DO jk = 1, jpkm1 
    152134               DO jj = 1, jpj 
    153                   va(2,jj,jk) = (va(2,jj,jk)+va_b(2,jj)-zvb(2,jj)) * vmask(2,jj,jk) 
    154                END DO 
    155             END DO 
     135                  ua(2,jj,jk) = (ua(2,jj,jk)+ua_b(2,jj)-zub(2,jj))*umask(2,jj,jk) 
     136               END DO 
     137            END DO 
     138             
     139            IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
     140               zvb(2,:) = 0._wp 
     141               DO jk = 1, jpkm1 
     142                  DO jj = 1, jpj 
     143                     zvb(2,jj) = zvb(2,jj) + e3v_a(2,jj,jk) * va(2,jj,jk) 
     144                  END DO 
     145               END DO 
     146               DO jj = 1, jpj 
     147                  zvb(2,jj) = zvb(2,jj) * r1_hv_a(2,jj) 
     148               END DO 
     149               DO jk = 1, jpkm1 
     150                  DO jj = 1, jpj 
     151                     va(2,jj,jk) = (va(2,jj,jk)+va_b(2,jj)-zvb(2,jj)) * vmask(2,jj,jk) 
     152                  END DO 
     153               END DO 
     154            ENDIF 
     155            ! 
    156156         ENDIF 
    157157         ! 
    158158         ! Mask domain edges: 
    159159         !------------------- 
    160          DO jk = 1, jpkm1 
    161             DO jj = 1, jpj 
    162                ua(1,jj,jk) = 0._wp 
    163                va(1,jj,jk) = 0._wp 
    164             END DO 
    165          END DO          
    166          ! 
    167       ENDIF 
    168  
     160!         DO jk = 1, jpkm1 
     161!            DO jj = 1, jpj 
     162!               ua(1,jj,jk) = 0._wp 
     163!               va(1,jj,jk) = 0._wp 
     164!            END DO 
     165!         END DO 
     166         ! 
     167      ENDIF 
     168 
     169      ! --- East --- ! 
    169170      IF( nbondi == 1 .OR. nbondi == 2 ) THEN 
    170171 
    171          ! Smoothing 
    172          ! --------- 
    173172         IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
    174             ua_b(nlci-2,:) = 0._wp 
     173            ua_b(nlci-nbghostcells-1:nlci-2,:) = 0._wp 
    175174            DO jk=1,jpkm1 
    176175               DO jj=1,jpj 
    177                   ua_b(nlci-2,jj) = ua_b(nlci-2,jj) + e3u_a(nlci-2,jj,jk) * ua(nlci-2,jj,jk) 
     176                  ua_b(nlci-nbghostcells-1:nlci-2,jj) = ua_b(nlci-nbghostcells-1:nlci-2,jj) + e3u_a(nlci-nbghostcells-1:nlci-2,jj,jk)  & 
     177                     &                                                                         * ua(nlci-nbghostcells-1:nlci-2,jj,jk) 
    178178               END DO 
    179179            END DO 
    180180            DO jj=1,jpj 
    181                ua_b(nlci-2,jj) = ua_b(nlci-2,jj) * r1_hu_a(nlci-2,jj)             
    182             END DO 
    183          ENDIF 
    184  
    185          DO jk = 1, jpkm1              ! Smooth 
    186             DO jj = j1, j2 
    187                ua(nlci-2,jj,jk) = 0.25_wp * umask(nlci-2,jj,jk)      & 
    188                   &             * ( ua(nlci-3,jj,jk) + 2._wp*ua(nlci-2,jj,jk) + ua(nlci-1,jj,jk) ) 
    189             END DO 
    190          END DO 
    191  
    192          zub(nlci-2,:) = 0._wp        ! Correct transport 
    193          DO jk = 1, jpkm1 
    194             DO jj = 1, jpj 
    195                zub(nlci-2,jj) = zub(nlci-2,jj) + e3u_a(nlci-2,jj,jk) * ua(nlci-2,jj,jk) 
    196             END DO 
    197          END DO 
    198          DO jj = 1, jpj 
    199             zub(nlci-2,jj) = zub(nlci-2,jj) * r1_hu_a(nlci-2,jj) 
    200          END DO 
    201  
    202          DO jk = 1, jpkm1 
    203             DO jj = 1, jpj 
    204                ua(nlci-2,jj,jk) = ( ua(nlci-2,jj,jk) + ua_b(nlci-2,jj) - zub(nlci-2,jj) ) * umask(nlci-2,jj,jk) 
    205             END DO 
    206          END DO 
    207          ! 
    208          ! Set tangential velocities to time splitting estimate 
    209          !----------------------------------------------------- 
    210          IF( ln_dynspg_ts ) THEN 
    211             zvb(nlci-1,:) = 0._wp 
     181               ua_b(nlci-nbghostcells-1:nlci-2,jj) = ua_b(nlci-nbghostcells-1:nlci-2,jj) * r1_hu_a(nlci-nbghostcells-1:nlci-2,jj)  
     182            END DO 
     183         ENDIF 
     184         ! 
     185         ! Smoothing if only 1 ghostcell 
     186         ! ----------------------------- 
     187         IF( nbghostcells == 1 ) THEN 
     188            DO jk = 1, jpkm1              ! Smooth 
     189               DO jj = j1, j2 
     190                  ua(nlci-2,jj,jk) = 0.25_wp * umask(nlci-2,jj,jk)      & 
     191                     &             * ( ua(nlci-3,jj,jk) + 2._wp*ua(nlci-2,jj,jk) + ua(nlci-1,jj,jk) ) 
     192               END DO 
     193            END DO 
     194             
     195            zub(nlci-2,:) = 0._wp        ! Correct transport 
    212196            DO jk = 1, jpkm1 
    213197               DO jj = 1, jpj 
    214                   zvb(nlci-1,jj) = zvb(nlci-1,jj) + e3v_a(nlci-1,jj,jk) * va(nlci-1,jj,jk) 
    215                END DO 
    216             END DO 
    217             DO jj=1,jpj 
    218                zvb(nlci-1,jj) = zvb(nlci-1,jj) * r1_hv_a(nlci-1,jj) 
    219             END DO 
     198                  zub(nlci-2,jj) = zub(nlci-2,jj) + e3u_a(nlci-2,jj,jk) * ua(nlci-2,jj,jk) 
     199               END DO 
     200            END DO 
     201            DO jj = 1, jpj 
     202               zub(nlci-2,jj) = zub(nlci-2,jj) * r1_hu_a(nlci-2,jj) 
     203            END DO 
     204             
    220205            DO jk = 1, jpkm1 
    221206               DO jj = 1, jpj 
    222                   va(nlci-1,jj,jk) = ( va(nlci-1,jj,jk) + va_b(nlci-1,jj) - zvb(nlci-1,jj) ) * vmask(nlci-1,jj,jk) 
    223                END DO 
    224             END DO 
     207                  ua(nlci-2,jj,jk) = ( ua(nlci-2,jj,jk) + ua_b(nlci-2,jj) - zub(nlci-2,jj) ) * umask(nlci-2,jj,jk) 
     208               END DO 
     209            END DO 
     210            ! 
     211            IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
     212               zvb(nlci-1,:) = 0._wp 
     213               DO jk = 1, jpkm1 
     214                  DO jj = 1, jpj 
     215                     zvb(nlci-1,jj) = zvb(nlci-1,jj) + e3v_a(nlci-1,jj,jk) * va(nlci-1,jj,jk) 
     216                  END DO 
     217               END DO 
     218               DO jj=1,jpj 
     219                  zvb(nlci-1,jj) = zvb(nlci-1,jj) * r1_hv_a(nlci-1,jj) 
     220               END DO 
     221               DO jk = 1, jpkm1 
     222                  DO jj = 1, jpj 
     223                     va(nlci-1,jj,jk) = ( va(nlci-1,jj,jk) + va_b(nlci-1,jj) - zvb(nlci-1,jj) ) * vmask(nlci-1,jj,jk) 
     224                  END DO 
     225               END DO 
     226            ENDIF 
     227            ! 
    225228         ENDIF 
    226229         ! 
    227230         ! Mask domain edges: 
    228231         !------------------- 
    229          DO jk = 1, jpkm1 
    230             DO jj = 1, jpj 
    231                ua(nlci-1,jj,jk) = 0._wp 
    232                va(nlci  ,jj,jk) = 0._wp 
    233             END DO 
    234          END DO  
    235          ! 
    236       ENDIF 
    237  
     232!         DO jk = 1, jpkm1 
     233!            DO jj = 1, jpj 
     234!               ua(nlci-1,jj,jk) = 0._wp 
     235!               va(nlci  ,jj,jk) = 0._wp 
     236!            END DO 
     237!         END DO 
     238         ! 
     239      ENDIF 
     240 
     241      ! --- South --- ! 
    238242      IF( nbondj == -1 .OR. nbondj == 2 ) THEN 
    239243 
    240          ! Smoothing 
    241          ! --------- 
    242244         IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
    243             va_b(:,2) = 0._wp 
     245            va_b(:,2:nbghostcells+1) = 0._wp 
    244246            DO jk = 1, jpkm1 
    245247               DO ji = 1, jpi 
    246                   va_b(ji,2) = va_b(ji,2) + e3v_a(ji,2,jk) * va(ji,2,jk) 
     248                  va_b(ji,2:nbghostcells+1) = va_b(ji,2:nbghostcells+1) + e3v_a(ji,2:nbghostcells+1,jk) * va(ji,2:nbghostcells+1,jk) 
    247249               END DO 
    248250            END DO 
    249251            DO ji=1,jpi 
    250                va_b(ji,2) = va_b(ji,2) * r1_hv_a(ji,2)             
    251             END DO 
    252          ENDIF 
    253          ! 
    254          DO jk = 1, jpkm1              ! Smooth 
    255             DO ji = i1, i2 
    256                va(ji,2,jk) = 0.25_wp * vmask(ji,2,jk)    & 
    257                   &        * ( va(ji,1,jk) + 2._wp*va(ji,2,jk) + va(ji,3,jk) ) 
    258             END DO 
    259          END DO 
    260          ! 
    261          zvb(:,2) = 0._wp              ! Correct transport 
    262          DO jk=1,jpkm1 
    263             DO ji=1,jpi 
    264                zvb(ji,2) = zvb(ji,2) + e3v_a(ji,2,jk) * va(ji,2,jk) * vmask(ji,2,jk) 
    265             END DO 
    266          END DO 
    267          DO ji = 1, jpi 
    268             zvb(ji,2) = zvb(ji,2) * r1_hv_a(ji,2) 
    269          END DO 
    270          DO jk = 1, jpkm1 
     252               va_b(ji,2:nbghostcells+1) = va_b(ji,2:nbghostcells+1) * r1_hv_a(ji,2:nbghostcells+1) 
     253            END DO 
     254         ENDIF 
     255         ! 
     256         ! Smoothing if only 1 ghostcell 
     257         ! ----------------------------- 
     258         IF( nbghostcells == 1 ) THEN 
     259            DO jk = 1, jpkm1              ! Smooth 
     260               DO ji = i1, i2 
     261                  va(ji,2,jk) = 0.25_wp * vmask(ji,2,jk)    & 
     262                     &        * ( va(ji,1,jk) + 2._wp*va(ji,2,jk) + va(ji,3,jk) ) 
     263               END DO 
     264            END DO 
     265            ! 
     266            zvb(:,2) = 0._wp              ! Correct transport 
     267            DO jk=1,jpkm1 
     268               DO ji=1,jpi 
     269                  zvb(ji,2) = zvb(ji,2) + e3v_a(ji,2,jk) * va(ji,2,jk) * vmask(ji,2,jk) 
     270               END DO 
     271            END DO 
    271272            DO ji = 1, jpi 
    272                va(ji,2,jk) = ( va(ji,2,jk) + va_b(ji,2) - zvb(ji,2) ) * vmask(ji,2,jk) 
    273             END DO 
    274          END DO 
    275  
    276          ! Set tangential velocities to time splitting estimate 
    277          !----------------------------------------------------- 
    278          IF( ln_dynspg_ts ) THEN 
    279             zub(:,2) = 0._wp 
     273               zvb(ji,2) = zvb(ji,2) * r1_hv_a(ji,2) 
     274            END DO 
    280275            DO jk = 1, jpkm1 
    281276               DO ji = 1, jpi 
    282                   zub(ji,2) = zub(ji,2) + e3u_a(ji,2,jk) * ua(ji,2,jk) * umask(ji,2,jk) 
    283                END DO 
    284             END DO 
    285             DO ji = 1, jpi 
    286                zub(ji,2) = zub(ji,2) * r1_hu_a(ji,2) 
    287             END DO 
    288  
     277                  va(ji,2,jk) = ( va(ji,2,jk) + va_b(ji,2) - zvb(ji,2) ) * vmask(ji,2,jk) 
     278               END DO 
     279            END DO 
     280             
     281            IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
     282               zub(:,2) = 0._wp 
     283               DO jk = 1, jpkm1 
     284                  DO ji = 1, jpi 
     285                     zub(ji,2) = zub(ji,2) + e3u_a(ji,2,jk) * ua(ji,2,jk) * umask(ji,2,jk) 
     286                  END DO 
     287               END DO 
     288               DO ji = 1, jpi 
     289                  zub(ji,2) = zub(ji,2) * r1_hu_a(ji,2) 
     290               END DO 
     291                
     292               DO jk = 1, jpkm1 
     293                  DO ji = 1, jpi 
     294                     ua(ji,2,jk) = ( ua(ji,2,jk) + ua_b(ji,2) - zub(ji,2) ) * umask(ji,2,jk) 
     295                  END DO 
     296               END DO 
     297            ENDIF 
     298            ! 
     299         ENDIF 
     300         ! 
     301         ! Mask domain edges: 
     302         !------------------- 
     303!         DO jk = 1, jpkm1 
     304!            DO ji = 1, jpi 
     305!               ua(ji,1,jk) = 0._wp 
     306!               va(ji,1,jk) = 0._wp 
     307!            END DO 
     308!         END DO 
     309         ! 
     310      ENDIF 
     311 
     312      ! --- North --- ! 
     313      IF( nbondj == 1 .OR. nbondj == 2 ) THEN 
     314         ! 
     315         IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
     316            va_b(:,nlcj-nbghostcells-1:nlcj-2) = 0._wp 
    289317            DO jk = 1, jpkm1 
    290318               DO ji = 1, jpi 
    291                   ua(ji,2,jk) = ( ua(ji,2,jk) + ua_b(ji,2) - zub(ji,2) ) * umask(ji,2,jk) 
    292                END DO 
    293             END DO 
    294          ENDIF 
    295  
     319                  va_b(ji,nlcj-nbghostcells-1:nlcj-2) = va_b(ji,nlcj-nbghostcells-1:nlcj-2) + e3v_a(ji,nlcj-nbghostcells-1:nlcj-2,jk)  & 
     320                     &                                                                         * va(ji,nlcj-nbghostcells-1:nlcj-2,jk) 
     321               END DO 
     322            END DO 
     323            DO ji = 1, jpi 
     324               va_b(ji,nlcj-nbghostcells-1:nlcj-2) = va_b(ji,nlcj-nbghostcells-1:nlcj-2) * r1_hv_a(ji,nlcj-nbghostcells-1:nlcj-2) 
     325            END DO 
     326         ENDIF 
     327         ! 
     328         ! Smoothing if only 1 ghostcell 
     329         ! ----------------------------- 
     330         IF( nbghostcells == 1 ) THEN 
     331            DO jk = 1, jpkm1              ! Smooth 
     332               DO ji = i1, i2 
     333                  va(ji,nlcj-2,jk) = 0.25_wp * vmask(ji,nlcj-2,jk)   & 
     334                     &             * ( va(ji,nlcj-3,jk) + 2._wp * va(ji,nlcj-2,jk) + va(ji,nlcj-1,jk) ) 
     335               END DO 
     336            END DO 
     337            ! 
     338            zvb(:,nlcj-2) = 0._wp         ! Correct transport 
     339            DO jk = 1, jpkm1 
     340               DO ji = 1, jpi 
     341                  zvb(ji,nlcj-2) = zvb(ji,nlcj-2) + e3v_a(ji,nlcj-2,jk) * va(ji,nlcj-2,jk) * vmask(ji,nlcj-2,jk) 
     342               END DO 
     343            END DO 
     344            DO ji = 1, jpi 
     345               zvb(ji,nlcj-2) = zvb(ji,nlcj-2) * r1_hv_a(ji,nlcj-2) 
     346            END DO 
     347            DO jk = 1, jpkm1 
     348               DO ji = 1, jpi 
     349                  va(ji,nlcj-2,jk) = ( va(ji,nlcj-2,jk) + va_b(ji,nlcj-2) - zvb(ji,nlcj-2) ) * vmask(ji,nlcj-2,jk) 
     350               END DO 
     351            END DO 
     352            ! 
     353            IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
     354               zub(:,nlcj-1) = 0._wp 
     355               DO jk = 1, jpkm1 
     356                  DO ji = 1, jpi 
     357                     zub(ji,nlcj-1) = zub(ji,nlcj-1) + e3u_a(ji,nlcj-1,jk) * ua(ji,nlcj-1,jk) * umask(ji,nlcj-1,jk) 
     358                  END DO 
     359               END DO 
     360               DO ji = 1, jpi 
     361                  zub(ji,nlcj-1) = zub(ji,nlcj-1) * r1_hu_a(ji,nlcj-1) 
     362               END DO 
     363               ! 
     364               DO jk = 1, jpkm1 
     365                  DO ji = 1, jpi 
     366                     ua(ji,nlcj-1,jk) = ( ua(ji,nlcj-1,jk) + ua_b(ji,nlcj-1) - zub(ji,nlcj-1) ) * umask(ji,nlcj-1,jk) 
     367                  END DO 
     368               END DO 
     369            ENDIF 
     370            ! 
     371         ENDIF 
     372         ! 
    296373         ! Mask domain edges: 
    297374         !------------------- 
    298          DO jk = 1, jpkm1 
    299             DO ji = 1, jpi 
    300                ua(ji,1,jk) = 0._wp 
    301                va(ji,1,jk) = 0._wp 
    302             END DO 
    303          END DO  
    304  
    305       ENDIF 
    306  
    307       IF( nbondj == 1 .OR. nbondj == 2 ) THEN 
    308          ! 
    309          ! Smoothing 
    310          ! --------- 
    311          IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
    312             va_b(:,nlcj-2) = 0._wp 
    313             DO jk = 1, jpkm1 
    314                DO ji = 1, jpi 
    315                   va_b(ji,nlcj-2) = va_b(ji,nlcj-2) + e3v_a(ji,nlcj-2,jk) * va(ji,nlcj-2,jk) 
    316                END DO 
    317             END DO 
    318             DO ji = 1, jpi 
    319                va_b(ji,nlcj-2) = va_b(ji,nlcj-2) * r1_hv_a(ji,nlcj-2)             
    320             END DO 
    321          ENDIF 
    322          ! 
    323          DO jk = 1, jpkm1              ! Smooth 
    324             DO ji = i1, i2 
    325                va(ji,nlcj-2,jk) = 0.25_wp * vmask(ji,nlcj-2,jk)   & 
    326                   &             * ( va(ji,nlcj-3,jk) + 2._wp * va(ji,nlcj-2,jk) + va(ji,nlcj-1,jk) ) 
    327             END DO 
    328          END DO 
    329          ! 
    330          zvb(:,nlcj-2) = 0._wp         ! Correct transport 
    331          DO jk = 1, jpkm1 
    332             DO ji = 1, jpi 
    333                zvb(ji,nlcj-2) = zvb(ji,nlcj-2) + e3v_a(ji,nlcj-2,jk) * va(ji,nlcj-2,jk) * vmask(ji,nlcj-2,jk) 
    334             END DO 
    335          END DO 
    336          DO ji = 1, jpi 
    337             zvb(ji,nlcj-2) = zvb(ji,nlcj-2) * r1_hv_a(ji,nlcj-2) 
    338          END DO 
    339          DO jk = 1, jpkm1 
    340             DO ji = 1, jpi 
    341                va(ji,nlcj-2,jk) = ( va(ji,nlcj-2,jk) + va_b(ji,nlcj-2) - zvb(ji,nlcj-2) ) * vmask(ji,nlcj-2,jk) 
    342             END DO 
    343          END DO 
    344          ! 
    345          ! Set tangential velocities to time splitting estimate 
    346          !----------------------------------------------------- 
    347          IF( ln_dynspg_ts ) THEN 
    348             zub(:,nlcj-1) = 0._wp 
    349             DO jk = 1, jpkm1 
    350                DO ji = 1, jpi 
    351                   zub(ji,nlcj-1) = zub(ji,nlcj-1) + e3u_a(ji,nlcj-1,jk) * ua(ji,nlcj-1,jk) * umask(ji,nlcj-1,jk) 
    352                END DO 
    353             END DO 
    354             DO ji = 1, jpi 
    355                zub(ji,nlcj-1) = zub(ji,nlcj-1) * r1_hu_a(ji,nlcj-1) 
    356             END DO 
    357             ! 
    358             DO jk = 1, jpkm1 
    359                DO ji = 1, jpi 
    360                   ua(ji,nlcj-1,jk) = ( ua(ji,nlcj-1,jk) + ua_b(ji,nlcj-1) - zub(ji,nlcj-1) ) * umask(ji,nlcj-1,jk) 
    361                END DO 
    362             END DO 
    363          ENDIF 
    364          ! 
    365          ! Mask domain edges: 
    366          !------------------- 
    367          DO jk = 1, jpkm1 
    368             DO ji = 1, jpi 
    369                ua(ji,nlcj  ,jk) = 0._wp 
    370                va(ji,nlcj-1,jk) = 0._wp 
    371             END DO 
    372          END DO  
    373          ! 
    374       ENDIF 
    375       ! 
    376       CALL wrk_dealloc( jpi,jpj,   zub, zvb ) 
     375!         DO jk = 1, jpkm1 
     376!            DO ji = 1, jpi 
     377!               ua(ji,nlcj  ,jk) = 0._wp 
     378!               va(ji,nlcj-1,jk) = 0._wp 
     379!            END DO 
     380!         END DO 
     381         ! 
     382      ENDIF 
    377383      ! 
    378384   END SUBROUTINE Agrif_dyn 
     
    389395      ! 
    390396      IF( Agrif_Root() )   RETURN 
    391       ! 
     397      !! clem ghost 
    392398      IF((nbondi == -1).OR.(nbondi == 2)) THEN 
    393399         DO jj=1,jpj 
    394             va_e(2,jj) = vbdy_w(jj) * hvr_e(2,jj) 
     400            va_e(2:nbghostcells+1,jj) = vbdy_w(jj) * hvr_e(2:nbghostcells+1,jj) 
    395401            ! Specified fluxes: 
    396             ua_e(2,jj) = ubdy_w(jj) * hur_e(2,jj) 
    397             ! Characteristics method: 
     402            ua_e(2:nbghostcells+1,jj) = ubdy_w(jj) * hur_e(2:nbghostcells+1,jj) 
     403            ! Characteristics method (only if ghostcells=1): 
    398404            !alt            ua_e(2,jj) = 0.5_wp * ( ubdy_w(jj) * hur_e(2,jj) + ua_e(3,jj) & 
    399405            !alt                       &           - sqrt(grav * hur_e(2,jj)) * (sshn_e(3,jj) - hbdy_w(jj)) ) 
     
    403409      IF((nbondi == 1).OR.(nbondi == 2)) THEN 
    404410         DO jj=1,jpj 
    405             va_e(nlci-1,jj) = vbdy_e(jj) * hvr_e(nlci-1,jj) 
     411            va_e(nlci-nbghostcells:nlci-1,jj)   = vbdy_e(jj) * hvr_e(nlci-nbghostcells:nlci-1,jj) 
    406412            ! Specified fluxes: 
    407             ua_e(nlci-2,jj) = ubdy_e(jj) * hur_e(nlci-2,jj) 
    408             ! Characteristics method: 
     413            ua_e(nlci-nbghostcells-1:nlci-2,jj) = ubdy_e(jj) * hur_e(nlci-nbghostcells-1:nlci-2,jj) 
     414            ! Characteristics method (only if ghostcells=1): 
    409415            !alt            ua_e(nlci-2,jj) = 0.5_wp * ( ubdy_e(jj) * hur_e(nlci-2,jj) + ua_e(nlci-3,jj) & 
    410416            !alt                            &           + sqrt(grav * hur_e(nlci-2,jj)) * (sshn_e(nlci-2,jj) - hbdy_e(jj)) ) 
     
    414420      IF((nbondj == -1).OR.(nbondj == 2)) THEN 
    415421         DO ji=1,jpi 
    416             ua_e(ji,2) = ubdy_s(ji) * hur_e(ji,2) 
     422            ua_e(ji,2:nbghostcells+1) = ubdy_s(ji) * hur_e(ji,2:nbghostcells+1) 
    417423            ! Specified fluxes: 
    418             va_e(ji,2) = vbdy_s(ji) * hvr_e(ji,2) 
    419             ! Characteristics method: 
     424            va_e(ji,2:nbghostcells+1) = vbdy_s(ji) * hvr_e(ji,2:nbghostcells+1) 
     425            ! Characteristics method (only if ghostcells=1): 
    420426            !alt            va_e(ji,2) = 0.5_wp * ( vbdy_s(ji) * hvr_e(ji,2) + va_e(ji,3) & 
    421427            !alt                       &           - sqrt(grav * hvr_e(ji,2)) * (sshn_e(ji,3) - hbdy_s(ji)) ) 
     
    425431      IF((nbondj == 1).OR.(nbondj == 2)) THEN 
    426432         DO ji=1,jpi 
    427             ua_e(ji,nlcj-1) = ubdy_n(ji) * hur_e(ji,nlcj-1) 
     433            ua_e(ji,nlcj-nbghostcells:nlcj-1)   = ubdy_n(ji) * hur_e(ji,nlcj-nbghostcells:nlcj-1) 
    428434            ! Specified fluxes: 
    429             va_e(ji,nlcj-2) = vbdy_n(ji) * hvr_e(ji,nlcj-2) 
    430             ! Characteristics method: 
     435            va_e(ji,nlcj-nbghostcells-1:nlcj-2) = vbdy_n(ji) * hvr_e(ji,nlcj-nbghostcells-1:nlcj-2) 
     436            ! Characteristics method (only if ghostcells=1): 
    431437            !alt            va_e(ji,nlcj-2) = 0.5_wp * ( vbdy_n(ji) * hvr_e(ji,nlcj-2)  + va_e(ji,nlcj-3) & 
    432438            !alt                            &           + sqrt(grav * hvr_e(ji,nlcj-2)) * (sshn_e(ji,nlcj-2) - hbdy_n(ji)) ) 
     
    472478      ! 
    473479      IF( ll_int_cons ) THEN  ! Conservative interpolation 
    474          ! orders matters here !!!!!! 
     480         ! order matters here !!!!!! 
    475481         CALL Agrif_Bc_variable( ub2b_interp_id, calledweight=1._wp, procname=interpub2b ) ! Time integrated 
    476482         CALL Agrif_Bc_variable( vb2b_interp_id, calledweight=1._wp, procname=interpvb2b ) 
     
    500506      !!----------------------------------------------------------------------   
    501507      INTEGER, INTENT(in) ::   kt 
     508      ! 
     509      INTEGER  :: ji, jj, indx 
    502510      !!----------------------------------------------------------------------   
    503511      ! 
    504512      IF( Agrif_Root() )   RETURN 
    505       ! 
     513      !! clem ghost 
     514      ! --- West --- ! 
    506515      IF((nbondi == -1).OR.(nbondi == 2)) THEN 
    507          ssha(2,:)=ssha(3,:) 
    508          sshn(2,:)=sshn(3,:) 
    509       ENDIF 
    510       ! 
     516         indx = 1+nbghostcells 
     517         DO jj = 1, jpj 
     518            DO ji = 2, indx 
     519               ssha(ji,jj)=ssha(indx+1,jj) 
     520               sshn(ji,jj)=sshn(indx+1,jj) 
     521            ENDDO 
     522         ENDDO 
     523      ENDIF 
     524      ! 
     525      ! --- East --- ! 
    511526      IF((nbondi == 1).OR.(nbondi == 2)) THEN 
    512          ssha(nlci-1,:)=ssha(nlci-2,:) 
    513          sshn(nlci-1,:)=sshn(nlci-2,:) 
    514       ENDIF 
    515       ! 
     527         indx = nlci-nbghostcells 
     528         DO jj = 1, jpj 
     529            DO ji = indx, nlci-1 
     530               ssha(ji,jj)=ssha(indx-1,jj) 
     531               sshn(ji,jj)=sshn(indx-1,jj) 
     532            ENDDO 
     533         ENDDO 
     534      ENDIF 
     535      ! 
     536      ! --- South --- ! 
    516537      IF((nbondj == -1).OR.(nbondj == 2)) THEN 
    517          ssha(:,2)=ssha(:,3) 
    518          sshn(:,2)=sshn(:,3) 
    519       ENDIF 
    520       ! 
     538         indx = 1+nbghostcells 
     539         DO jj = 2, indx 
     540            DO ji = 1, jpi 
     541               ssha(ji,jj)=ssha(ji,indx+1) 
     542               sshn(ji,jj)=sshn(ji,indx+1) 
     543            ENDDO 
     544         ENDDO 
     545      ENDIF 
     546      ! 
     547      ! --- North --- ! 
    521548      IF((nbondj == 1).OR.(nbondj == 2)) THEN 
    522          ssha(:,nlcj-1)=ssha(:,nlcj-2) 
    523          sshn(:,nlcj-1)=sshn(:,nlcj-2) 
     549         indx = nlcj-nbghostcells 
     550         DO jj = indx, nlcj-1 
     551            DO ji = 1, jpi 
     552               ssha(ji,jj)=ssha(ji,indx-1) 
     553               sshn(ji,jj)=sshn(ji,indx-1) 
     554            ENDDO 
     555         ENDDO 
    524556      ENDIF 
    525557      ! 
     
    533565      INTEGER, INTENT(in) ::   jn 
    534566      !! 
    535       INTEGER :: ji,jj 
    536       !!----------------------------------------------------------------------   
    537       ! 
    538       IF( nbondi == -1 .OR. nbondi == 2 ) THEN 
     567      INTEGER :: ji, jj 
     568      !!----------------------------------------------------------------------   
     569      !! clem ghost (starting at i,j=1 is important I think otherwise you introduce a grad(ssh)/=0 at point 2) 
     570      IF((nbondi == -1).OR.(nbondi == 2)) THEN 
    539571         DO jj = 1, jpj 
    540             ssha_e(2,jj) = hbdy_w(jj) 
    541          END DO 
    542       ENDIF 
    543       ! 
    544       IF( nbondi == 1 .OR. nbondi == 2 ) THEN 
     572            ssha_e(2:nbghostcells+1,jj) = hbdy_w(jj) 
     573         END DO 
     574      ENDIF 
     575      ! 
     576      IF((nbondi == 1).OR.(nbondi == 2)) THEN 
    545577         DO jj = 1, jpj 
    546             ssha_e(nlci-1,jj) = hbdy_e(jj) 
    547          END DO 
    548       ENDIF 
    549       ! 
    550       IF( nbondj == -1 .OR. nbondj == 2 ) THEN 
     578            ssha_e(nlci-nbghostcells:nlci-1,jj) = hbdy_e(jj) 
     579         END DO 
     580      ENDIF 
     581      ! 
     582      IF((nbondj == -1).OR.(nbondj == 2)) THEN 
    551583         DO ji = 1, jpi 
    552             ssha_e(ji,2) = hbdy_s(ji) 
     584            ssha_e(ji,2:nbghostcells+1) = hbdy_s(ji) 
    553585         END DO 
    554586      ENDIF 
     
    556588      IF((nbondj == 1).OR.(nbondj == 2)) THEN 
    557589         DO ji = 1, jpi 
    558             ssha_e(ji,nlcj-1) = hbdy_n(ji) 
     590            ssha_e(ji,nlcj-nbghostcells:nlcj-1) = hbdy_n(ji) 
    559591         END DO 
    560592      ENDIF 
     
    562594   END SUBROUTINE Agrif_ssh_ts 
    563595 
     596# if defined key_zdftke 
    564597 
    565598   SUBROUTINE Agrif_tke 
     
    573606      IF( zalpha > 1. )   zalpha = 1. 
    574607      ! 
    575       Agrif_SpecialValue    = 0._wp 
     608      Agrif_SpecialValue    = 0.e0 
    576609      Agrif_UseSpecialValue = .TRUE. 
    577610      ! 
    578       CALL Agrif_Bc_variable( avm_id , calledweight=zalpha, procname=interpavm )        
     611      CALL Agrif_Bc_variable(avm_id ,calledweight=zalpha, procname=interpavm)        
    579612      ! 
    580613      Agrif_UseSpecialValue = .FALSE. 
    581614      ! 
    582615   END SUBROUTINE Agrif_tke 
    583  
     616    
     617# endif 
    584618 
    585619   SUBROUTINE interptsn( ptab, i1, i2, j1, j2, k1, k2, n1, n2, before, nb, ndir ) 
     
    592626      INTEGER                                     , INTENT(in   ) ::   nb , ndir 
    593627      ! 
    594       INTEGER ::   ji, jj, jk, jn   ! dummy loop indices 
    595       INTEGER ::   imin, imax, jmin, jmax 
    596       REAL(wp)::   zrhox , zalpha1, zalpha2, zalpha3 
    597       REAL(wp)::   zalpha4, zalpha5, zalpha6, zalpha7 
    598       LOGICAL ::   western_side, eastern_side,northern_side,southern_side 
     628      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices 
     629      INTEGER  ::   imin, imax, jmin, jmax 
     630      REAL(wp) ::   zrhox, z1, z2, z3, z4, z5, z6, z7 
     631      LOGICAL  ::   western_side, eastern_side,northern_side,southern_side 
    599632      !!---------------------------------------------------------------------- 
    600633      ! 
     
    603636      ELSE 
    604637         ! 
    605          western_side  = (nb == 1).AND.(ndir == 1) 
    606          eastern_side  = (nb == 1).AND.(ndir == 2) 
    607          southern_side = (nb == 2).AND.(ndir == 1) 
    608          northern_side = (nb == 2).AND.(ndir == 2) 
    609          ! 
    610          zrhox = Agrif_Rhox() 
    611          !  
    612          zalpha1 = ( zrhox - 1. ) * 0.5 
    613          zalpha2 = 1. - zalpha1 
    614          !  
    615          zalpha3 = ( zrhox - 1. ) / ( zrhox + 1. ) 
    616          zalpha4 = 1. - zalpha3 
    617          !  
    618          zalpha6 = 2. * ( zrhox - 1. ) / ( zrhox + 1. ) 
    619          zalpha7 =    - ( zrhox - 1. ) / ( zrhox + 3. ) 
    620          zalpha5 = 1. - zalpha6 - zalpha7 
    621          ! 
    622          imin = i1 
    623          imax = i2 
    624          jmin = j1 
    625          jmax = j2 
    626          !  
    627          ! Remove CORNERS 
    628          IF((nbondj == -1).OR.(nbondj == 2)) jmin = 3 
    629          IF((nbondj == +1).OR.(nbondj == 2)) jmax = nlcj-2 
    630          IF((nbondi == -1).OR.(nbondi == 2)) imin = 3 
    631          IF((nbondi == +1).OR.(nbondi == 2)) imax = nlci-2         
    632          ! 
    633          IF( eastern_side ) THEN 
    634             DO jn = 1, jpts 
    635                tsa(nlci,j1:j2,k1:k2,jn) = zalpha1 * ptab(nlci,j1:j2,k1:k2,jn) + zalpha2 * ptab(nlci-1,j1:j2,k1:k2,jn) 
    636                DO jk = 1, jpkm1 
    637                   DO jj = jmin,jmax 
    638                      IF( umask(nlci-2,jj,jk) == 0._wp ) THEN 
    639                         tsa(nlci-1,jj,jk,jn) = tsa(nlci,jj,jk,jn) * tmask(nlci-1,jj,jk) 
    640                      ELSE 
    641                         tsa(nlci-1,jj,jk,jn)=(zalpha4*tsa(nlci,jj,jk,jn)+zalpha3*tsa(nlci-2,jj,jk,jn))*tmask(nlci-1,jj,jk) 
    642                         IF( un(nlci-2,jj,jk) > 0._wp ) THEN 
    643                            tsa(nlci-1,jj,jk,jn)=( zalpha6*tsa(nlci-2,jj,jk,jn)+zalpha5*tsa(nlci,jj,jk,jn) &  
    644                     &nb