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

Changeset 8738


Ignore:
Timestamp:
2017-11-17T15:40:12+01:00 (5 years ago)
Author:
dancopsey
Message:

Merged in main ICEMODEL branch (branches/2017/dev_r8183_ICEMODEL) up to revision 8588

Location:
branches/UKMO/dev_r8183_ICEMODEL_svn_removed
Files:
35 deleted
86 edited
38 copied

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/DOC/Namelists/nambdy_dta

    r8733 r8738  
    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/UKMO/dev_r8183_ICEMODEL_svn_removed/DOC/Namelists/namsbc

    r6997 r8738  
    2323                           !  = 2  Redistribute a single flux over categories (coupled mode only) 
    2424                     ! Sea-ice : 
    25    nn_ice      = 2         !  =0 no ice boundary condition   , 
     25   nn_ice      = 3         !  =0 no ice boundary condition   , 
    2626                           !  =1 use observed ice-cover      , 
    27                            !  =2 ice-model used                         ("key_lim3", "key_lim2", "key_cice") 
     27                           !  =3-4 ice-model used                         ("key_lim3", "key_cice") 
    2828   nn_ice_embd = 1         !  =0 levitating ice (no mass exchange, concentration/dilution effect) 
    2929                           !  =1 levitating ice with mass and salt exchange but no presure effect 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/DOC/TexFiles/Chapters/Chap_SBC.tex

    r7646 r8738  
    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/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/1_namelist_cfg

    r7942 r8738  
    2020/ 
    2121!----------------------------------------------------------------------- 
    22 &namzgr        !   vertical coordinate 
    23 !----------------------------------------------------------------------- 
    24    ln_zps      = .true.    !  z-coordinate - partial steps 
    25 / 
    26 !----------------------------------------------------------------------- 
    2722&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    2823!-----------------------------------------------------------------------   
    29    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 
    3025   nn_closea   =    0      !  remove (=0) or keep (=1) closed seas and lakes (ORCA) 
    3126   ! 
     
    4641!----------------------------------------------------------------------- 
    4742   ln_blk      = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    48    nn_ice      = 3         !  =0 no ice boundary condition   , 
     43   nn_ice      = 2         !  =0 no ice boundary condition   , 
    4944                           !  =1 use observed ice-cover      , 
    50                            !  =2 ice-model used                         ("key_lim3" or "key_lim2) 
     45                           !  =2 ice-model used                         ("key_lim3") 
    5146   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf) 
    5247   ln_ssr      = .false.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr) 
     
    176171&namdyn_hpg    !   Hydrostatic pressure gradient option 
    177172!----------------------------------------------------------------------- 
     173   ln_hpg_sco  = .true.   !  s-coordinate (standard jacobian formulation) 
    178174/ 
    179175!----------------------------------------------------------------------- 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/file_def_nemo.xml

    r7948 r8738  
    9595     <field field_ref="avt"          name="difvho"   /> 
    9696     <field field_ref="w_masstr"     name="vovematr" /> 
    97           <!-- variables available with key_zdftmx_new --> 
    98           <field field_ref="av_wave"      name="av_wave"    /> 
    99           <field field_ref="bn2"          name="bn2"        /> 
    100           <field field_ref="bflx_tmx"     name="bflx_tmx"   /> 
    101           <field field_ref="pcmap_tmx"    name="pcmap_tmx"  /> 
    102           <field field_ref="emix_tmx"     name="emix_tmx"   /> 
    103           <field field_ref="av_ratio"     name="av_ratio"   /> 
     97     <!-- variables available with key_zdftmx_new --> 
     98     <field field_ref="av_wave"      name="av_wave"    /> 
     99     <field field_ref="bn2"          name="bn2"        /> 
     100     <field field_ref="bflx_tmx"     name="bflx_tmx"   /> 
     101     <field field_ref="pcmap_tmx"    name="pcmap_tmx"  /> 
     102     <field field_ref="emix_tmx"     name="emix_tmx"   /> 
     103     <field field_ref="av_ratio"     name="av_ratio"   /> 
    104104   </file> 
    105105 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg

    r7933 r8738  
    1717      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    1818      cn_domcfg = "ORCA_R2_zps_domcfg"    ! domain configuration filename 
    19 / 
    20 !----------------------------------------------------------------------- 
    21 &namzgr        !   vertical coordinate 
    22 !----------------------------------------------------------------------- 
    23    ln_zps      = .true.    !  z-coordinate - partial steps 
    2419/ 
    2520!----------------------------------------------------------------------- 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_ice_cfg

    r7823 r8738  
    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/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/file_def_nemo.xml

    r7635 r8738  
    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/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_cfg

    r7404 r8738  
    1919/ 
    2020!----------------------------------------------------------------------- 
    21 &namzgr        !   vertical coordinate 
    22 !----------------------------------------------------------------------- 
    23    ln_zps      = .true.    !  z-coordinate - partial steps 
    24 / 
    25 !----------------------------------------------------------------------- 
    2621&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    2722!----------------------------------------------------------------------- 
     
    8176&nambbc        !   bottom temperature boundary condition                (default: NO) 
    8277!----------------------------------------------------------------------- 
    83    ln_trabbc   = .true.    !  Apply a geothermal heating at the ocean bottom 
    8478/ 
    8579!----------------------------------------------------------------------- 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_ice_cfg

    r7404 r8738  
    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/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/cpp_ORCA2_SAS_LIM3.fcm

    r7423 r8738  
    1  bld::tool::fppkeys key_trabbl key_lim3  key_zdftke key_zdfddm key_zdftmx key_iomput key_mpp_mpi 
     1 bld::tool::fppkeys key_lim3 key_iomput key_mpp_mpi 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/SHARED/field_def_nemo-lim.xml

    r7767 r8738  
    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/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/SHARED/namelist_ice_lim3_ref

    r7813 r8738  
    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_BL99      = .true.          !  Heat diffusion follows Bitz and Lipscomb 1999 
     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) 
     216                                      !                         and Grenfell & Perovich (JGR 2004), giving cloud-sky albedo 
     217                                      !     2: as 1 with melt ponds 
     218   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) 
     219   rn_alb_smlt      =   0.75          !  melting snow albedo     : 0.65 ( '' )          ; 0.75 ( '' )          ; obs 0.72-0.82 ( '' ) 
     220   rn_alb_idry      =   0.60          !  dry ice albedo          : 0.72 ( '' )          ; 0.60 ( '' )          ; obs 0.54-0.65 ( '' ) 
     221   rn_alb_imlt      =   0.50          !  bare puddled ice albedo : 0.53 ( '' )          ; 0.50 ( '' )          ; obs 0.49-0.58 ( '' ) 
     222   rn_alb_dpnd      =   0.27          !  ponded ice albedo       : 0.25 ( '' )          ; 0.27 ( '' )          ; obs 0.10-0.30 ( '' ) 
     223/ 
     224!------------------------------------------------------------------------------ 
     225&namdia     !   Diagnostics 
     226!------------------------------------------------------------------------------ 
     227   ln_icediachk     = .false.         !  check online the heat, mass & salt budgets (T) or not (F) 
     228   ln_icediahsb     = .false.         !  output the heat, mass & salt budgets (T) or not (F) 
     229   ln_icectl        = .false.         !  ice points output for debug (T or F) 
     230   iiceprt          =  10             !  i-index for debug 
     231   jiceprt          =  10             !  j-index for debug 
     232/ 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/SHARED/namelist_ref

    r8733 r8738  
    192192                           !  =1 opa-sas OASIS coupling: multi executable configuration, OPA component 
    193193                           !  =2 opa-sas OASIS coupling: multi executable configuration, SAS component  
    194    nn_limflx = -1          !  LIM3 Multi-category heat flux formulation (use -1 if LIM3 is not used) 
    195                            !  =-1  Use per-category fluxes, bypass redistributor, forced mode only, not yet implemented coupled 
    196                            !  = 0  Average per-category fluxes (forced and coupled mode) 
    197                            !  = 1  Average and redistribute per-category fluxes, forced mode only, not yet implemented coupled 
    198                            !  = 2  Redistribute a single flux over categories (coupled mode only) 
    199194                     ! Sea-ice : 
    200    nn_ice      = 3         !  =0 no ice boundary condition   , 
     195   nn_ice      = 2         !  =0 no ice boundary condition   , 
    201196                           !  =1 use observed ice-cover      , 
    202                            !  =2 to 4 :  ice-model used (LIM2, LIM3 or CICE)                         ("key_lim3", "key_lim2", or "key_cice") 
    203    nn_ice_embd = 1         !  =0 levitating ice (no mass exchange, concentration/dilution effect) 
    204                            !  =1 levitating ice with mass and salt exchange but no presure effect 
    205                            !  =2 embedded sea-ice (full salt and mass exchanges and pressure) 
     197                           !  =2 & 3 :  ice-model used (LIM3 or CICE)                         ("key_lim3" or "key_cice") 
     198   ln_ice_embd = .false.   !  =F levitating ice with mass and salt exchange but no presure effect 
     199                           !  =T embedded sea-ice (full salt and mass exchanges and pressure) 
    206200                     ! Misc. options of sbc :  
    207201   ln_traqsr   = .true.    !  Light penetration in the ocean            (T => fill namtra_qsr) 
     
    264258   rn_vfac     = 0.        !  multiplicative factor for ocean/ice velocity 
    265259                           !  in the calculation of the wind stress (0.=absolute winds or 1.=relative winds) 
    266    ln_Cd_L12   = .false.   !  Modify the drag ice-atm and oce-atm depending on ice concentration 
    267                            !  This parameterization is from Lupkes et al. (JGR 2012) 
     260   ln_Cd_L12   = .false.   !  Modify the drag ice-atm depending on ice concentration with Lupkes 2012 
     261   ln_Cd_L15   = .false.   !  Modify the drag ice-atm depending on ice concentration with Lupkes 2015 
    268262/ 
    269263!----------------------------------------------------------------------- 
     
    313307!              !             !  (if <0  months)  !   name    !  (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      ! 
    314308   l_sasread   = .TRUE.   ! Read fields in a file if .TRUE. , or initialize to 0. in sbcssm.F90 if .FALSE. 
    315    sn_usp      = 'sas_grid_U',     120           , 'vozocrtx',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    316    sn_vsp      = 'sas_grid_V',     120           , 'vomecrty',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     309   sn_usp      = 'sas_grid_U',     120           ,    'uos'  ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     310   sn_vsp      = 'sas_grid_V',     120           ,    'vos'  ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    317311   sn_tem      = 'sas_grid_T',     120           , 'sosstsst',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    318312   sn_sal      = 'sas_grid_T',     120           , 'sosaline',   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
     
    321315   sn_frq      = 'sas_grid_T',     120           , 'frq_m'   ,   .true.    , .true. , 'yearly'  ,    ''    ,    ''    ,    '' 
    322316 
    323    ln_3d_uve   = .true.    !  specify whether we are supplying a 3D u,v and e3 field 
     317   ln_3d_uve   = .false.   !  specify whether we are supplying a 3D u,v and e3 field 
    324318   ln_read_frq = .false.   !  specify whether we must read frq or not 
    325319   cn_dir      = './'      !  root directory for the location of the bulk files are 
     
    340334   rn_si0      =   0.35    !  RGB & 2 bands: shortess depth of extinction 
    341335   rn_si1      =   23.0    !  2 bands: longest depth of extinction 
    342    ln_qsr_ice  = .true.    !  light penetration for ice-model LIM3 
    343336/ 
    344337!----------------------------------------------------------------------- 
     
    434427   ln_sssr_bnd =  .true.   !  flag to bound erp term (associated with nn_sssr=2) 
    435428   rn_sssr_bnd =   4.e0    !  ABS(Max/Min) value of the damping erp term [mm/day] 
    436 / 
    437 !----------------------------------------------------------------------- 
    438 &namsbc_alb    !   albedo parameters 
    439 !----------------------------------------------------------------------- 
    440    nn_ice_alb   =    1   !  parameterization of ice/snow albedo 
    441                          !     0: Shine & Henderson-Sellers (JGR 1985), giving clear-sky albedo 
    442                          !     1: "home made" based on Brandt et al. (JClim 2005) and Grenfell & Perovich (JGR 2004), 
    443                          !        giving cloud-sky albedo 
    444    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) 
    445    rn_alb_smlt  =  0.75  !  melting snow albedo     : 0.65 ( '' )          ; 0.75 ( '' )          ; obs 0.72-0.82 ( '' ) 
    446    rn_alb_idry  =  0.60  !  dry ice albedo          : 0.72 ( '' )          ; 0.60 ( '' )          ; obs 0.54-0.65 ( '' ) 
    447    rn_alb_imlt  =  0.50  !  bare puddled ice albedo : 0.53 ( '' )          ; 0.50 ( '' )          ; obs 0.49-0.58 ( '' ) 
    448429/ 
    449430!----------------------------------------------------------------------- 
     
    581562   bn_tem      = 'amm12_bdyT_tra',         24        , 'votemper',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    582563   bn_sal      = 'amm12_bdyT_tra',         24        , 'vosaline',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    583 ! for lim2 
    584 !   bn_frld    = 'amm12_bdyT_ice',         24        , 'ileadfra',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    585 !   bn_hicif   = 'amm12_bdyT_ice',         24        , 'iicethic',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    586 !   bn_hsnif   = 'amm12_bdyT_ice',         24        , 'isnowthi',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    587564! for lim3 
    588565!   bn_a_i     = 'amm12_bdyT_ice',         24        , 'ileadfra',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    589 !   bn_ht_i    = 'amm12_bdyT_ice',         24        , 'iicethic',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    590 !   bn_ht_s    = 'amm12_bdyT_ice',         24        , 'isnowthi',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
     566!   bn_h_i    = 'amm12_bdyT_ice',         24        , 'iicethic',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
     567!   bn_h_s    = 'amm12_bdyT_ice',         24        , 'isnowthi',    .true.   , .false. ,  'daily'  ,    ''    ,   ''     ,     '' 
    591568 
    592569   cn_dir      = 'bdydta/' !  root directory for the location of the bulk files 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg

    r8018 r8738  
    6464                           !  =1 use observed ice-cover      ,  
    6565                           !  =2 ice-model used                 
    66    nn_ice_embd = 0         !  =0 levitating ice (no mass exchange, concentration/dilution effect) 
    67                            !  =1 levitating ice with mass and salt exchange but no presure effect 
    68                            !  =2 embedded sea-ice (full salt and mass exchanges and pressure) 
     66   ln_ice_embd = .false.   !  =F levitating ice with mass and salt exchange but no presure effect 
     67                           !  =T embedded sea-ice (full salt and mass exchanges and pressure) 
     68                     ! Misc. options of sbc : 
    6969   ln_traqsr   = .false.   !  Light penetration (T) or not (F) 
    7070   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf) 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_cfg

    r7822 r8738  
    2626&namdom        !   space and time domain (bathymetry, mesh, timestep) 
    2727!----------------------------------------------------------------------- 
    28    ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
     28   ln_linssh   = .true.   !  =T  linear free surface  ==>>  model level are fixed in time 
    2929   ! 
    3030   nn_msh      =    1      !  create (>0) a mesh file or not (=0) 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_ice_cfg

    r7820 r8738  
    66!!              4 - Ice discretization                 (namiceitd) 
    77!!              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) 
     8!!              6 - Ice thermodynamics                 (namicethd) 
     9!!              7 - Ice salinity                       (namicesal) 
     10!!              8 - Ice mechanical redistribution      (namiceitdme) 
     11!!              9 - Ice/snow albedos                   (namicealb) 
    1212!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    1313! 
     
    5656/ 
    5757!------------------------------------------------------------------------------ 
    58 &namicehdf     !   Ice horizontal diffusion 
    59 !------------------------------------------------------------------------------ 
    60 / 
    61 !------------------------------------------------------------------------------ 
    6258&namicethd     !   Ice thermodynamics 
    6359!------------------------------------------------------------------------------ 
     
    8581   ln_rafting     =   .true.        !  rafting activated (T) or not (F) => DO NOT TOUCH UNLESS U KNOW WHAT U DO 
    8682/ 
     83!----------------------------------------------------------------------- 
     84&namicealb     !   albedo parameters 
     85!----------------------------------------------------------------------- 
     86/ 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/CONFIG/TEST_CASES/WAD/MY_SRC/bdyini.F90

    r8733 r8738  
    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/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h

    r8733 r8738  
    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/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/NEMO/LIM_SRC_3/ice.F90

    r8733 r8738  
    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/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/NEMO/NST_SRC/agrif_ice.F90

    r8733 r8738  
    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 3.3.4 , NEMO Consortium (2012) 
    32    !! $Id$ 
    33    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    34    !!---------------------------------------------------------------------- 
    35  
    36 CONTAINS  
    37  
    38    INTEGER FUNCTION agrif_ice_alloc() 
    39       !!---------------------------------------------------------------------- 
    40       !!                ***  FUNCTION agrif_ice_alloc  *** 
    41       !!---------------------------------------------------------------------- 
    42 #if defined key_lim2_vp 
    43       ALLOCATE( u_ice_nst(jpi,jpj), v_ice_nst(jpi,jpj) ,   & 
    44 #else 
    45       ALLOCATE( u_ice_oe(4,jpj,2) , v_ice_oe(4,jpj,2) ,    & 
    46          &      u_ice_sn(jpi,4,2) , v_ice_sn(jpi,4,2) ,    & 
    47 #endif 
    48          &      adv_ice_oe (4,jpj,7,2) , adv_ice_sn (jpi,4,7,2) ,   & 
    49          &      STAT = agrif_ice_alloc) 
    50  
    51 #if ! defined key_lim2_vp 
    52       u_ice_oe(:,:,:) =  0.e0 
    53       v_ice_oe(:,:,:) =  0.e0 
    54       u_ice_sn(:,:,:) =  0.e0 
    55       v_ice_sn(:,:,:) =  0.e0 
    56 #endif 
    57       adv_ice_oe (:,:,:,:) = 0.e0  
    58       adv_ice_sn (:,:,:,:) = 0.e0  
    59       ! 
    60    END FUNCTION agrif_ice_alloc 
    61  
    62 #elif defined key_agrif && defined key_lim3 
     9#if defined key_agrif && defined key_lim3 
    6310   !!---------------------------------------------------------------------- 
    6411   !!   'key_agrif'                                              AGRIF zoom 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/NEMO/NST_SRC/agrif_lim3_interp.F90

    r8733 r8738  
    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) 
     
    9090      !! i1 i2 j1 j2 are the index of the boundaries parent(when before) and child (when after) 
    9191      !! To solve issues when parent grid is "land" masked but not all the corresponding child grid points, 
    92       !! put -9999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 
     92      !! put -999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 
    9393      !!----------------------------------------------------------------------- 
    9494      INTEGER , INTENT(in) :: i1, i2, j1, j2 
     
    101101      IF( before ) THEN  ! parent grid 
    102102         ptab(:,:) = e2u(i1:i2,j1:j2) * u_ice_b(i1:i2,j1:j2) 
    103          WHERE( umask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = -9999. 
     103         WHERE( umask(i1:i2,j1:j2,1) == 0. )   ptab(i1:i2,j1:j2) = Agrif_SpecialValue 
    104104      ELSE               ! child grid 
    105105         zrhoy = Agrif_Rhoy() 
    106          u_ice(i1:i2,j1:j2) = ptab(:,:) / ( e2u(i1:i2,j1:j2) * zrhoy ) * umask(i1:i2,j1:j2,1) 
     106         u_ice(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) / ( e2u(i1:i2,j1:j2) * zrhoy ) * umask(i1:i2,j1:j2,1) 
    107107      ENDIF 
    108108      ! 
     
    116116      !! i1 i2 j1 j2 are the index of the boundaries parent(when before) and child (when after) 
    117117      !! To solve issues when parent grid is "land" masked but not all the corresponding child grid points, 
    118       !! put -9999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 
     118      !! put -999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 
    119119      !!-----------------------------------------------------------------------       
    120120      INTEGER , INTENT(in) :: i1, i2, j1, j2 
     
    127127      IF( before ) THEN  ! parent grid 
    128128         ptab(:,:) = e1v(i1:i2,j1:j2) * v_ice_b(i1:i2,j1:j2) 
    129          WHERE( vmask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = -9999. 
     129         WHERE( vmask(i1:i2,j1:j2,1) == 0. )  ptab(i1:i2,j1:j2) = Agrif_SpecialValue 
    130130      ELSE               ! child grid 
    131131         zrhox = Agrif_Rhox() 
    132          v_ice(i1:i2,j1:j2) = ptab(:,:) / ( e1v(i1:i2,j1:j2) * zrhox ) * vmask(i1:i2,j1:j2,1) 
     132         v_ice(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) / ( e1v(i1:i2,j1:j2) * zrhox ) * vmask(i1:i2,j1:j2,1) 
    133133      ENDIF 
    134134      ! 
     
    142142      !! i1 i2 j1 j2 are the index of the boundaries parent(when before) and child (when after) 
    143143      !! To solve issues when parent grid is "land" masked but not all the corresponding child grid points, 
    144       !! put -9999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 
     144      !! put -999 WHERE the parent grid is masked. The child solution will be found in the 9(?) points around 
    145145      !!----------------------------------------------------------------------- 
    146146      REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab 
     
    158158      ! tracers are not multiplied by grid cell here => before: * e12t ; after: * r1_e12t / rhox / rhoy 
    159159      ! and it is ok since we conserve tracers (same as in the ocean). 
    160       ALLOCATE( ztab(SIZE(a_i_b,1),SIZE(a_i_b,2),SIZE(ptab,3)) ) 
     160      ALLOCATE( ztab(SIZE(a_i,1),SIZE(a_i,2),SIZE(ptab,3)) ) 
    161161      
    162162      IF( before ) THEN  ! parent grid 
    163163         jm = 1 
    164164         DO jl = 1, jpl 
    165             ptab(i1:i2,j1:j2,jm) = a_i_b  (i1:i2,j1:j2,jl) ; jm = jm + 1 
    166             ptab(i1:i2,j1:j2,jm) = v_i_b  (i1:i2,j1:j2,jl) ; jm = jm + 1 
    167             ptab(i1:i2,j1:j2,jm) = v_s_b  (i1:i2,j1:j2,jl) ; jm = jm + 1 
    168             ptab(i1:i2,j1:j2,jm) = smv_i_b(i1:i2,j1:j2,jl) ; jm = jm + 1 
    169             ptab(i1:i2,j1:j2,jm) = oa_i_b (i1:i2,j1:j2,jl) ; jm = jm + 1 
     165            ptab(i1:i2,j1:j2,jm  ) = a_i_b (i1:i2,j1:j2,jl) 
     166            ptab(i1:i2,j1:j2,jm+1) = v_i_b (i1:i2,j1:j2,jl) 
     167            ptab(i1:i2,j1:j2,jm+2) = v_s_b (i1:i2,j1:j2,jl) 
     168            ptab(i1:i2,j1:j2,jm+3) = sv_i_b(i1:i2,j1:j2,jl) 
     169            ptab(i1:i2,j1:j2,jm+4) = oa_i_b(i1:i2,j1:j2,jl) 
     170            jm = jm + 5 
    170171            DO jk = 1, nlay_s 
    171172               ptab(i1:i2,j1:j2,jm) = e_s_b(i1:i2,j1:j2,jk,jl) ; jm = jm + 1 
     
    177178          
    178179         DO jk = k1, k2 
    179             WHERE( tmask(i1:i2,j1:j2,1) == 0. )  ptab(i1:i2,j1:j2,jk) = -9999. 
     180            WHERE( tmask(i1:i2,j1:j2,1) == 0. )  ptab(i1:i2,j1:j2,jk) = Agrif_SpecialValue 
    180181         ENDDO 
    181182          
    182183      ELSE               ! child grid 
    183 !! ==> The easiest interpolation is the following commented lines 
    184          jm = 1 
    185          DO jl = 1, jpl 
    186             a_i  (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    187             v_i  (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    188             v_s  (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    189             smv_i(i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    190             oa_i (i1:i2,j1:j2,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    191             DO jk = 1, nlay_s 
    192                e_s(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    193             ENDDO 
    194             DO jk = 1, nlay_i 
    195                e_i(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    196             ENDDO 
    197          ENDDO 
    198  
    199 !! ==> this is a more complex interpolation since we mix solutions over a couple of grid points 
    200 !!     it is advised to use it for fields modified by high order schemes (e.g. advection UM5...) 
    201 !!        clem: for some reason (I don't know why), the following lines do not work  
    202 !!              with mpp (or in realistic configurations?). It makes the model crash 
    203 !         ! record ztab 
    204 !         jm = 1 
    205 !         DO jl = 1, jpl 
    206 !            ztab(:,:,jm) = a_i  (:,:,jl) ; jm = jm + 1 
    207 !            ztab(:,:,jm) = v_i  (:,:,jl) ; jm = jm + 1 
    208 !            ztab(:,:,jm) = v_s  (:,:,jl) ; jm = jm + 1 
    209 !            ztab(:,:,jm) = smv_i(:,:,jl) ; jm = jm + 1 
    210 !            ztab(:,:,jm) = oa_i (:,:,jl) ; jm = jm + 1 
    211 !            DO jk = 1, nlay_s 
    212 !               ztab(:,:,jm) = e_s(:,:,jk,jl) ; jm = jm + 1 
    213 !            ENDDO 
    214 !            DO jk = 1, nlay_i 
    215 !               ztab(:,:,jm) = e_i(:,:,jk,jl) ; jm = jm + 1 
    216 !            ENDDO 
    217 !         ENDDO 
    218 !         ! 
    219 !         ! borders of the domain 
    220 !         western_side  = (nb == 1).AND.(ndir == 1)  ;  eastern_side  = (nb == 1).AND.(ndir == 2) 
    221 !         southern_side = (nb == 2).AND.(ndir == 1)  ;  northern_side = (nb == 2).AND.(ndir == 2) 
    222 !         ! 
    223 !         ! spatial smoothing 
    224 !         zrhox = Agrif_Rhox() 
    225 !         z1 =      ( zrhox - 1. ) * 0.5  
    226 !         z3 =      ( zrhox - 1. ) / ( zrhox + 1. ) 
    227 !         z6 = 2. * ( zrhox - 1. ) / ( zrhox + 1. ) 
    228 !         z7 =    - ( zrhox - 1. ) / ( zrhox + 3. ) 
    229 !         z2 = 1. - z1 
    230 !         z4 = 1. - z3 
    231 !         z5 = 1. - z6 - z7 
    232 !         ! 
    233 !         ! Remove corners 
    234 !         imin = i1  ;  imax = i2  ;  jmin = j1  ;  jmax = j2 
    235 !         IF( (nbondj == -1) .OR. (nbondj == 2) )   jmin = 3 
    236 !         IF( (nbondj == +1) .OR. (nbondj == 2) )   jmax = nlcj-2 
    237 !         IF( (nbondi == -1) .OR. (nbondi == 2) )   imin = 3 
    238 !         IF( (nbondi == +1) .OR. (nbondi == 2) )   imax = nlci-2 
    239 ! 
    240 !         ! smoothed fields 
    241 !         IF( eastern_side ) THEN 
    242 !            ztab(nlci,j1:j2,:) = z1 * ptab(nlci,j1:j2,:) + z2 * ptab(nlci-1,j1:j2,:) 
    243 !            DO jj = jmin, jmax 
    244 !               rswitch = 0. 
    245 !               IF( u_ice(nlci-2,jj) > 0._wp ) rswitch = 1. 
    246 !               ztab(nlci-1,jj,:) = ( 1. - umask(nlci-2,jj,1) ) * ztab(nlci,jj,:)  & 
    247 !                  &                +      umask(nlci-2,jj,1)   *  & 
    248 !                  &                ( ( 1. - rswitch ) * ( z4 * ztab(nlci,jj,:)   + z3 * ztab(nlci-2,jj,:) )  & 
    249 !                  &                  +      rswitch   * ( z6 * ztab(nlci-2,jj,:) + z5 * ztab(nlci,jj,:) + z7 * ztab(nlci-3,jj,:) ) ) 
    250 !               ztab(nlci-1,jj,:) = ztab(nlci-1,jj,:) * tmask(nlci-1,jj,1) 
    251 !            END DO 
    252 !         ENDIF 
    253 !         !  
    254 !         IF( northern_side ) THEN 
    255 !            ztab(i1:i2,nlcj,:) = z1 * ptab(i1:i2,nlcj,:) + z2 * ptab(i1:i2,nlcj-1,:) 
    256 !            DO ji = imin, imax 
    257 !               rswitch = 0. 
    258 !               IF( v_ice(ji,nlcj-2) > 0._wp ) rswitch = 1. 
    259 !               ztab(ji,nlcj-1,:) = ( 1. - vmask(ji,nlcj-2,1) ) * ztab(ji,nlcj,:)  & 
    260 !                  &                +      vmask(ji,nlcj-2,1)   *  & 
    261 !                  &                ( ( 1. - rswitch ) * ( z4 * ztab(ji,nlcj,:)   + z3 * ztab(ji,nlcj-2,:) ) & 
    262 !                  &                  +      rswitch   * ( z6 * ztab(ji,nlcj-2,:) + z5 * ztab(ji,nlcj,:) + z7 * ztab(ji,nlcj-3,:) ) ) 
    263 !               ztab(ji,nlcj-1,:) = ztab(ji,nlcj-1,:) * tmask(ji,nlcj-1,1) 
    264 !            END DO 
    265 !         END IF 
    266 !         ! 
    267 !         IF( western_side) THEN 
    268 !            ztab(1,j1:j2,:) = z1 * ptab(1,j1:j2,:) + z2 * ptab(2,j1:j2,:) 
    269 !            DO jj = jmin, jmax 
    270 !               rswitch = 0. 
    271 !               IF( u_ice(2,jj) < 0._wp ) rswitch = 1. 
    272 !               ztab(2,jj,:) = ( 1. - umask(2,jj,1) ) * ztab(1,jj,:)  & 
    273 !                  &           +      umask(2,jj,1)   *   & 
    274 !                  &           ( ( 1. - rswitch ) * ( z4 * ztab(1,jj,:) + z3 * ztab(3,jj,:) ) & 
    275 !                  &             +      rswitch   * ( z6 * ztab(3,jj,:) + z5 * ztab(1,jj,:) + z7 * ztab(4,jj,:) ) ) 
    276 !               ztab(2,jj,:) = ztab(2,jj,:) * tmask(2,jj,1) 
    277 !            END DO 
    278 !         ENDIF 
    279 !         ! 
    280 !         IF( southern_side ) THEN 
    281 !            ztab(i1:i2,1,:) = z1 * ptab(i1:i2,1,:) + z2 * ptab(i1:i2,2,:) 
    282 !            DO ji = imin, imax 
    283 !               rswitch = 0. 
    284 !               IF( v_ice(ji,2) < 0._wp ) rswitch = 1. 
    285 !               ztab(ji,2,:) = ( 1. - vmask(ji,2,1) ) * ztab(ji,1,:)  & 
    286 !                  &           +      vmask(ji,2,1)   *  & 
    287 !                  &           ( ( 1. - rswitch ) * ( z4 * ztab(ji,1,:) + z3 * ztab(ji,3,:) ) & 
    288 !                  &             +      rswitch   * ( z6 * ztab(ji,3,:) + z5 * ztab(ji,1,:) + z7 * ztab(ji,4,:) ) ) 
    289 !               ztab(ji,2,:) = ztab(ji,2,:) * tmask(ji,2,1) 
    290 !            END DO 
    291 !         END IF 
    292 !         ! 
    293 !         ! Treatment of corners 
    294 !         IF( (eastern_side) .AND. ((nbondj == -1).OR.(nbondj == 2)) )  ztab(nlci-1,2,:)      = ptab(nlci-1,2,:)      ! East south 
    295 !         IF( (eastern_side) .AND. ((nbondj ==  1).OR.(nbondj == 2)) )  ztab(nlci-1,nlcj-1,:) = ptab(nlci-1,nlcj-1,:) ! East north 
    296 !         IF( (western_side) .AND. ((nbondj == -1).OR.(nbondj == 2)) )  ztab(2,2,:)           = ptab(2,2,:)           ! West south 
    297 !         IF( (western_side) .AND. ((nbondj ==  1).OR.(nbondj == 2)) )  ztab(2,nlcj-1,:)      = ptab(2,nlcj-1,:)      ! West north 
    298 ! 
    299 !         ! retrieve ice tracers 
    300 !         jm = 1 
    301 !         DO jl = 1, jpl 
    302 !            a_i  (i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    303 !            v_i  (i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    304 !            v_s  (i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    305 !            smv_i(i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    306 !            oa_i (i1:i2,j1:j2,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    307 !            DO jk = 1, nlay_s 
    308 !               e_s(i1:i2,j1:j2,jk,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    309 !            ENDDO 
    310 !            DO jk = 1, nlay_i 
    311 !               e_i(i1:i2,j1:j2,jk,jl) = ztab(i1:i2,j1:j2,jm) ; jm = jm + 1 
    312 !            ENDDO 
    313 !         ENDDO 
    314         
     184 
     185         IF( nbghostcells > 1 ) THEN 
     186            !! ==> The easiest interpolation is the following lines 
     187 
     188            jm = 1 
     189            DO jl = 1, jpl 
     190               ! 
     191               DO jj = j1, j2 
     192                  DO ji = i1, i2 
     193                     a_i (ji,jj,jl) = ptab(ji,jj,jm  ) * tmask(ji,jj,1) 
     194                     v_i (ji,jj,jl) = ptab(ji,jj,jm+1) * tmask(ji,jj,1) 
     195                     v_s (ji,jj,jl) = ptab(ji,jj,jm+2) * tmask(ji,jj,1) 
     196                     sv_i(ji,jj,jl) = ptab(ji,jj,jm+3) * tmask(ji,jj,1) 
     197                     oa_i(ji,jj,jl) = ptab(ji,jj,jm+4) * tmask(ji,jj,1) 
     198                  ENDDO 
     199               ENDDO 
     200               jm = jm + 5 
     201               ! 
     202               DO jk = 1, nlay_s 
     203                  e_s(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) 
     204                  jm = jm + 1 
     205               ENDDO 
     206               ! 
     207               DO jk = 1, nlay_i 
     208                  e_i(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) 
     209                  jm = jm + 1 
     210               ENDDO 
     211               ! 
     212            ENDDO 
     213             
     214         ELSE 
     215            !! ==> this is a more complex interpolation since we mix solutions over a couple of grid points 
     216            !!     it is advised to use it for fields modified by high order schemes (e.g. advection UM5...) 
     217            !!        clem: for some reason (I don't know why), the following lines do not work  
     218            !!              with mpp (or in realistic configurations?). It makes the model crash 
     219            !      I think there is an issue with Agrif_SpecialValue here (not taken into account properly) 
     220            ! record ztab 
     221            jm = 1 
     222            DO jl = 1, jpl 
     223               ztab(:,:,jm  ) = a_i  (:,:,jl) 
     224               ztab(:,:,jm+1) = v_i  (:,:,jl) 
     225               ztab(:,:,jm+2) = v_s  (:,:,jl) 
     226               ztab(:,:,jm+3) = sv_i(:,:,jl) 
     227               ztab(:,:,jm+4) = oa_i(:,:,jl) 
     228               jm = jm + 5 
     229               DO jk = 1, nlay_s 
     230                  ztab(:,:,jm) = e_s(:,:,jk,jl) 
     231                  jm = jm + 1 
     232               ENDDO 
     233               DO jk = 1, nlay_i 
     234                  ztab(:,:,jm) = e_i(:,:,jk,jl) 
     235                  jm = jm + 1 
     236               ENDDO 
     237               ! 
     238            ENDDO 
     239            ! 
     240            ! borders of the domain 
     241            western_side  = (nb == 1).AND.(ndir == 1)  ;  eastern_side  = (nb == 1).AND.(ndir == 2) 
     242            southern_side = (nb == 2).AND.(ndir == 1)  ;  northern_side = (nb == 2).AND.(ndir == 2) 
     243            ! 
     244            ! spatial smoothing 
     245            zrhox = Agrif_Rhox() 
     246            z1 =      ( zrhox - 1. ) * 0.5  
     247            z3 =      ( zrhox - 1. ) / ( zrhox + 1. ) 
     248            z6 = 2. * ( zrhox - 1. ) / ( zrhox + 1. ) 
     249            z7 =    - ( zrhox - 1. ) / ( zrhox + 3. ) 
     250            z2 = 1. - z1 
     251            z4 = 1. - z3 
     252            z5 = 1. - z6 - z7 
     253            ! 
     254            ! Remove corners 
     255            imin = i1  ;  imax = i2  ;  jmin = j1  ;  jmax = j2 
     256            IF( (nbondj == -1) .OR. (nbondj == 2) )   jmin = 3 
     257            IF( (nbondj == +1) .OR. (nbondj == 2) )   jmax = nlcj-2 
     258            IF( (nbondi == -1) .OR. (nbondi == 2) )   imin = 3 
     259            IF( (nbondi == +1) .OR. (nbondi == 2) )   imax = nlci-2 
     260 
     261            ! smoothed fields 
     262            IF( eastern_side ) THEN 
     263               ztab(nlci,j1:j2,:) = z1 * ptab(nlci,j1:j2,:) + z2 * ptab(nlci-1,j1:j2,:) 
     264               DO jj = jmin, jmax 
     265                  rswitch = 0. 
     266                  IF( u_ice(nlci-2,jj) > 0._wp ) rswitch = 1. 
     267                  ztab(nlci-1,jj,:) = ( 1. - umask(nlci-2,jj,1) ) * ztab(nlci,jj,:)  & 
     268                     &                +      umask(nlci-2,jj,1)   *  & 
     269                     &                ( ( 1. - rswitch ) * ( z4 * ztab(nlci,jj,:)   + z3 * ztab(nlci-2,jj,:) )  & 
     270                     &                  +      rswitch   * ( z6 * ztab(nlci-2,jj,:) + z5 * ztab(nlci,jj,:) + z7 * ztab(nlci-3,jj,:) ) ) 
     271                  ztab(nlci-1,jj,:) = ztab(nlci-1,jj,:) * tmask(nlci-1,jj,1) 
     272               END DO 
     273            ENDIF 
     274            !  
     275            IF( northern_side ) THEN 
     276               ztab(i1:i2,nlcj,:) = z1 * ptab(i1:i2,nlcj,:) + z2 * ptab(i1:i2,nlcj-1,:) 
     277               DO ji = imin, imax 
     278                  rswitch = 0. 
     279                  IF( v_ice(ji,nlcj-2) > 0._wp ) rswitch = 1. 
     280                  ztab(ji,nlcj-1,:) = ( 1. - vmask(ji,nlcj-2,1) ) * ztab(ji,nlcj,:)  & 
     281                     &                +      vmask(ji,nlcj-2,1)   *  & 
     282                     &                ( ( 1. - rswitch ) * ( z4 * ztab(ji,nlcj,:)   + z3 * ztab(ji,nlcj-2,:) ) & 
     283                     &                  +      rswitch   * ( z6 * ztab(ji,nlcj-2,:) + z5 * ztab(ji,nlcj,:) + z7 * ztab(ji,nlcj-3,:) ) ) 
     284                  ztab(ji,nlcj-1,:) = ztab(ji,nlcj-1,:) * tmask(ji,nlcj-1,1) 
     285               END DO 
     286            END IF 
     287            ! 
     288            IF( western_side) THEN 
     289               ztab(1,j1:j2,:) = z1 * ptab(1,j1:j2,:) + z2 * ptab(2,j1:j2,:) 
     290               DO jj = jmin, jmax 
     291                  rswitch = 0. 
     292                  IF( u_ice(2,jj) < 0._wp ) rswitch = 1. 
     293                  ztab(2,jj,:) = ( 1. - umask(2,jj,1) ) * ztab(1,jj,:)  & 
     294                     &           +      umask(2,jj,1)   *   & 
     295                     &           ( ( 1. - rswitch ) * ( z4 * ztab(1,jj,:) + z3 * ztab(3,jj,:) ) & 
     296                     &             +      rswitch   * ( z6 * ztab(3,jj,:) + z5 * ztab(1,jj,:) + z7 * ztab(4,jj,:) ) ) 
     297                  ztab(2,jj,:) = ztab(2,jj,:) * tmask(2,jj,1) 
     298               END DO 
     299            ENDIF 
     300            ! 
     301            IF( southern_side ) THEN 
     302               ztab(i1:i2,1,:) = z1 * ptab(i1:i2,1,:) + z2 * ptab(i1:i2,2,:) 
     303               DO ji = imin, imax 
     304                  rswitch = 0. 
     305                  IF( v_ice(ji,2) < 0._wp ) rswitch = 1. 
     306                  ztab(ji,2,:) = ( 1. - vmask(ji,2,1) ) * ztab(ji,1,:)  & 
     307                     &           +      vmask(ji,2,1)   *  & 
     308                     &           ( ( 1. - rswitch ) * ( z4 * ztab(ji,1,:) + z3 * ztab(ji,3,:) ) & 
     309                     &             +      rswitch   * ( z6 * ztab(ji,3,:) + z5 * ztab(ji,1,:) + z7 * ztab(ji,4,:) ) ) 
     310                  ztab(ji,2,:) = ztab(ji,2,:) * tmask(ji,2,1) 
     311               END DO 
     312            END IF 
     313            ! 
     314            ! Treatment of corners 
     315            IF( (eastern_side) .AND. ((nbondj == -1).OR.(nbondj == 2)) )  ztab(nlci-1,2,:)      = ptab(nlci-1,2,:)      ! East south 
     316            IF( (eastern_side) .AND. ((nbondj ==  1).OR.(nbondj == 2)) )  ztab(nlci-1,nlcj-1,:) = ptab(nlci-1,nlcj-1,:) ! East north 
     317            IF( (western_side) .AND. ((nbondj == -1).OR.(nbondj == 2)) )  ztab(2,2,:)           = ptab(2,2,:)           ! West south 
     318            IF( (western_side) .AND. ((nbondj ==  1).OR.(nbondj == 2)) )  ztab(2,nlcj-1,:)      = ptab(2,nlcj-1,:)      ! West north 
     319             
     320            ! retrieve ice tracers 
     321            jm = 1 
     322            DO jl = 1, jpl 
     323               ! 
     324               DO jj = j1, j2 
     325                  DO ji = i1, i2 
     326                     a_i (ji,jj,jl) = ztab(ji,jj,jm  ) * tmask(ji,jj,1) 
     327                     v_i (ji,jj,jl) = ztab(ji,jj,jm+1) * tmask(ji,jj,1) 
     328                     v_s (ji,jj,jl) = ztab(ji,jj,jm+2) * tmask(ji,jj,1) 
     329                     sv_i(ji,jj,jl) = ztab(ji,jj,jm+3) * tmask(ji,jj,1) 
     330                     oa_i (ji,jj,jl) = ztab(ji,jj,jm+4) * tmask(ji,jj,1) 
     331                  ENDDO 
     332               ENDDO 
     333               jm = jm + 5 
     334               ! 
     335               DO jk = 1, nlay_s 
     336                  e_s(i1:i2,j1:j2,jk,jl) = ztab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
     337                  jm = jm + 1 
     338               ENDDO 
     339               ! 
     340               DO jk = 1, nlay_i 
     341                  e_i(i1:i2,j1:j2,jk,jl) = ztab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
     342                  jm = jm + 1 
     343               ENDDO 
     344               ! 
     345            ENDDO 
     346           
     347         ENDIF  ! nbghostcells=1 
     348          
    315349         ! integrated values 
    316350         vt_i (i1:i2,j1:j2) = SUM( v_i(i1:i2,j1:j2,:), dim=3 ) 
     
    319353         et_s(i1:i2,j1:j2)  = SUM( SUM( e_s(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 
    320354         et_i(i1:i2,j1:j2)  = SUM( SUM( e_i(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 
    321  
     355          
    322356      ENDIF 
     357 
     358      DEALLOCATE( ztab ) 
    323359       
    324       DEALLOCATE( ztab ) 
    325360      ! 
    326361   END SUBROUTINE interp_tra_ice 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/NEMO/NST_SRC/agrif_lim3_update.F90

    r8733 r8738  
    5656      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 
    5757                                                                                                                           ! i.e. update only at the parent time step 
     58      IF( nn_ice == 0 ) RETURN   ! clem2017: do not update if child domain does not have ice 
     59      ! 
     60      Agrif_SpecialValueFineGrid = -9999. 
    5861      Agrif_UseSpecialValueInUpdate = .TRUE. 
    59       Agrif_SpecialValueFineGrid = -9999. 
    6062# if defined TWO_WAY 
    6163      IF( MOD(nbcline,nbclineupdate) == 0) THEN ! update the whole basin at each nbclineupdate (=nn_cln_update) baroclinic parent time steps 
     
    7072      ENDIF 
    7173# endif 
     74      Agrif_SpecialValueFineGrid = 0. 
    7275      Agrif_UseSpecialValueInUpdate = .FALSE. 
    7376      ! 
     
    8891      LOGICAL , INTENT(in) :: before 
    8992      !! 
    90       INTEGER  :: jk, jl, jm 
     93      INTEGER  :: ji, jj, jk, jl, jm 
    9194      !!----------------------------------------------------------------------- 
    9295      ! it is ok not to multiply by e1*e2 since we conserve tracers here (same as in the ocean). 
     
    9497         jm = 1 
    9598         DO jl = 1, jpl 
    96             ptab(:,:,jm) = a_i  (i1:i2,j1:j2,jl) ; jm = jm + 1 
    97             ptab(:,:,jm) = v_i  (i1:i2,j1:j2,jl) ; jm = jm + 1 
    98             ptab(:,:,jm) = v_s  (i1:i2,j1:j2,jl) ; jm = jm + 1 
    99             ptab(:,:,jm) = smv_i(i1:i2,j1:j2,jl) ; jm = jm + 1 
    100             ptab(:,:,jm) = oa_i (i1:i2,j1:j2,jl) ; jm = jm + 1 
     99            ptab(i1:i2,j1:j2,jm  ) = a_i (i1:i2,j1:j2,jl) 
     100            ptab(i1:i2,j1:j2,jm+1) = v_i (i1:i2,j1:j2,jl) 
     101            ptab(i1:i2,j1:j2,jm+2) = v_s (i1:i2,j1:j2,jl) 
     102            ptab(i1:i2,j1:j2,jm+3) = sv_i(i1:i2,j1:j2,jl) 
     103            ptab(i1:i2,j1:j2,jm+4) = oa_i (i1:i2,j1:j2,jl) 
     104            jm = jm + 5 
    101105            DO jk = 1, nlay_s 
    102                ptab(:,:,jm) = e_s(i1:i2,j1:j2,jk,jl) ; jm = jm + 1 
     106               ptab(i1:i2,j1:j2,jm) = e_s(i1:i2,j1:j2,jk,jl) ; jm = jm + 1 
    103107            ENDDO 
    104108            DO jk = 1, nlay_i 
    105                ptab(:,:,jm) = e_i(i1:i2,j1:j2,jk,jl) ; jm = jm + 1 
     109               ptab(i1:i2,j1:j2,jm) = e_i(i1:i2,j1:j2,jk,jl) ; jm = jm + 1 
    106110            ENDDO 
    107111         ENDDO 
    108  
     112         ! 
    109113         DO jk = k1, k2 
    110             WHERE( tmask(i1:i2,j1:j2,1) == 0. )  ptab(:,:,jk) = -9999. 
     114            WHERE( tmask(i1:i2,j1:j2,1) == 0. )  ptab(i1:i2,j1:j2,jk) = Agrif_SpecialValueFineGrid  
    111115         ENDDO 
    112                    
     116         ! 
    113117      ELSE 
     118         ! 
    114119         jm = 1 
    115120         DO jl = 1, jpl 
    116             a_i  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    117             v_i  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    118             v_s  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    119             smv_i(i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    120             oa_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
     121            ! 
     122            DO jj = j1, j2 
     123               DO ji = i1, i2 
     124                  IF( ptab(ji,jj,jm) /= Agrif_SpecialValueFineGrid ) THEN 
     125                     a_i (ji,jj,jl) = ptab(ji,jj,jm  ) * tmask(ji,jj,1) 
     126                     v_i (ji,jj,jl) = ptab(ji,jj,jm+1) * tmask(ji,jj,1) 
     127                     v_s (ji,jj,jl) = ptab(ji,jj,jm+2) * tmask(ji,jj,1) 
     128                     sv_i(ji,jj,jl) = ptab(ji,jj,jm+3) * tmask(ji,jj,1) 
     129                     oa_i(ji,jj,jl) = ptab(ji,jj,jm+4) * tmask(ji,jj,1) 
     130                  ENDIF 
     131               ENDDO 
     132            ENDDO 
     133            jm = jm + 5 
     134            ! 
    121135            DO jk = 1, nlay_s 
    122                e_s(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    123             ENDDO 
     136               WHERE( ptab(i1:i2,j1:j2,jm) /= Agrif_SpecialValueFineGrid ) 
     137                  e_s(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
     138               ENDWHERE 
     139               jm = jm + 1 
     140            ENDDO 
     141            ! 
    124142            DO jk = 1, nlay_i 
    125                e_i(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1 
    126             ENDDO 
     143               WHERE( ptab(i1:i2,j1:j2,jm) /= Agrif_SpecialValueFineGrid ) 
     144                  e_i(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
     145               ENDWHERE 
     146               jm = jm + 1 
     147            ENDDO 
     148            ! 
    127149         ENDDO 
    128  
     150         ! 
    129151         ! integrated values 
    130152         vt_i (i1:i2,j1:j2) = SUM( v_i(i1:i2,j1:j2,:), dim=3 ) 
     
    154176         zrhoy = Agrif_Rhoy() 
    155177         ptab(:,:) = e2u(i1:i2,j1:j2) * u_ice(i1:i2,j1:j2) * zrhoy 
    156          WHERE( umask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = -9999. 
     178         WHERE( umask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = Agrif_SpecialValueFineGrid 
    157179      ELSE 
    158          u_ice(i1:i2,j1:j2) = ptab(:,:) / e2u(i1:i2,j1:j2) * umask(i1:i2,j1:j2,1) 
     180         WHERE( ptab(i1:i2,j1:j2) /= Agrif_SpecialValueFineGrid ) 
     181            u_ice(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) / e2u(i1:i2,j1:j2) * umask(i1:i2,j1:j2,1) 
     182         ENDWHERE 
    159183      ENDIF 
    160184      !  
     
    177201         zrhox = Agrif_Rhox() 
    178202         ptab(:,:) = e1v(i1:i2,j1:j2) * v_ice(i1:i2,j1:j2) * zrhox 
    179          WHERE( vmask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = -9999. 
     203         WHERE( vmask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = Agrif_SpecialValueFineGrid 
    180204      ELSE 
    181          v_ice(i1:i2,j1:j2) = ptab(:,:) / e1v(i1:i2,j1:j2) * vmask(i1:i2,j1:j2,1) 
     205         WHERE( ptab(i1:i2,j1:j2) /= Agrif_SpecialValueFineGrid ) 
     206            v_ice(i1:i2,j1:j2) = ptab(i1:i2,j1:j2) / e1v(i1:i2,j1:j2) * vmask(i1:i2,j1:j2,1) 
     207         ENDWHERE 
    182208      ENDIF 
    183209      ! 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/NEMO/NST_SRC/agrif_opa_interp.F90

    r8733 r8738  
    3535   PUBLIC   Agrif_tra, Agrif_dyn, Agrif_ssh, Agrif_dyn_ts, Agrif_ssh_ts, Agrif_dta_ts 
    3636   PUBLIC   interpun, interpvn 
    37    PUBLIC   interptsn,  interpsshn 
     37   PUBLIC   interptsn, interpsshn 
    3838   PUBLIC   interpunb, interpvnb, interpub2b, interpvb2b 
    3939   PUBLIC   interpe3t, interpumsk, interpvmsk 
     
    100100      IF( nbondi == +1 .OR. nbondi == 2 )   i2 = nlci-2 
    101101 
     102      ! --- West --- ! 
    102103      IF( nbondi == -1 .OR. nbondi == 2 ) THEN 
    103104         ! 
    104          ! Smoothing 
    105          ! --------- 
    106105         IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
    107             ua_b(2,:) = 0._wp 
     106            ua_b(2:1+nbghostcells,:) = 0._wp 
    108107            DO jk = 1, jpkm1 
    109108               DO jj = 1, jpj 
    110                   ua_b(2,jj) = ua_b(2,jj) + e3u_a(2,jj,jk) * ua(2,jj,jk) 
     109                  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) 
    111110               END DO 
    112111            END DO 
    113112            DO jj = 1, jpj 
    114                ua_b(2,jj) = ua_b(2,jj) * r1_hu_a(2,jj)             
    115             END DO 
    116          ENDIF 
    117          ! 
    118          DO jk=1,jpkm1                 ! Smooth 
    119             DO jj=j1,j2 
    120                ua(2,jj,jk) = 0.25_wp*(ua(1,jj,jk)+2._wp*ua(2,jj,jk)+ua(3,jj,jk)) 
    121                ua(2,jj,jk) = ua(2,jj,jk) * umask(2,jj,jk) 
    122             END DO 
    123          END DO 
    124          ! 
    125          zub(2,:) = 0._wp              ! Correct transport 
    126          DO jk = 1, jpkm1 
    127             DO jj = 1, jpj 
    128                zub(2,jj) = zub(2,jj) + e3u_a(2,jj,jk) * ua(2,jj,jk) 
    129             END DO 
    130          END DO 
    131          DO jj=1,jpj 
    132             zub(2,jj) = zub(2,jj) * r1_hu_a(2,jj) 
    133          END DO 
    134  
    135          DO jk=1,jpkm1 
    136             DO jj=1,jpj 
    137                ua(2,jj,jk) = (ua(2,jj,jk)+ua_b(2,jj)-zub(2,jj))*umask(2,jj,jk) 
    138             END DO 
    139          END DO 
    140  
    141          ! Set tangential velocities to time splitting estimate 
    142          !----------------------------------------------------- 
    143          IF( ln_dynspg_ts ) THEN 
    144             zvb(2,:) = 0._wp 
     113               ua_b(2:1+nbghostcells,jj) = ua_b(2:1+nbghostcells,jj) * r1_hu_a(2:1+nbghostcells,jj) 
     114            END DO 
     115         ENDIF 
     116         ! 
     117         ! Smoothing if only 1 ghostcell 
     118         ! ----------------------------- 
     119         IF( nbghostcells == 1 ) THEN 
     120            DO jk=1,jpkm1                 ! Smooth 
     121               DO jj=j1,j2 
     122                  ua(2,jj,jk) = 0.25_wp*(ua(1,jj,jk)+2._wp*ua(2,jj,jk)+ua(3,jj,jk)) 
     123                  ua(2,jj,jk) = ua(2,jj,jk) * umask(2,jj,jk) 
     124               END DO 
     125            END DO 
     126            ! 
     127            zub(2,:) = 0._wp              ! Correct transport 
    145128            DO jk = 1, jpkm1 
    146129               DO jj = 1, jpj 
    147                   zvb(2,jj) = zvb(2,jj) + e3v_a(2,jj,jk) * va(2,jj,jk) 
    148                END DO 
    149             END DO 
    150             DO jj = 1, jpj 
    151                zvb(2,jj) = zvb(2,jj) * r1_hv_a(2,jj) 
    152             END DO 
     130                  zub(2,jj) = zub(2,jj) + e3u_a(2,jj,jk) * ua(2,jj,jk) 
     131               END DO 
     132            END DO 
     133            DO jj=1,jpj 
     134               zub(2,jj) = zub(2,jj) * r1_hu_a(2,jj) 
     135            END DO 
     136             
     137            DO jk=1,jpkm1 
     138               DO jj=1,jpj 
     139                  ua(2,jj,jk) = (ua(2,jj,jk)+ua_b(2,jj)-zub(2,jj))*umask(2,jj,jk) 
     140               END DO 
     141            END DO 
     142             
     143            IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
     144               zvb(2,:) = 0._wp 
     145               DO jk = 1, jpkm1 
     146                  DO jj = 1, jpj 
     147                     zvb(2,jj) = zvb(2,jj) + e3v_a(2,jj,jk) * va(2,jj,jk) 
     148                  END DO 
     149               END DO 
     150               DO jj = 1, jpj 
     151                  zvb(2,jj) = zvb(2,jj) * r1_hv_a(2,jj) 
     152               END DO 
     153               DO jk = 1, jpkm1 
     154                  DO jj = 1, jpj 
     155                     va(2,jj,jk) = (va(2,jj,jk)+va_b(2,jj)-zvb(2,jj)) * vmask(2,jj,jk) 
     156                  END DO 
     157               END DO 
     158            ENDIF 
     159            ! 
     160         ENDIF 
     161         ! 
     162         ! Mask domain edges: 
     163         !------------------- 
     164!         DO jk = 1, jpkm1 
     165!            DO jj = 1, jpj 
     166!               ua(1,jj,jk) = 0._wp 
     167!               va(1,jj,jk) = 0._wp 
     168!            END DO 
     169!         END DO 
     170         ! 
     171      ENDIF 
     172 
     173      ! --- East --- ! 
     174      IF( nbondi == 1 .OR. nbondi == 2 ) THEN 
     175 
     176         IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
     177            ua_b(nlci-nbghostcells-1:nlci-2,:) = 0._wp 
     178            DO jk=1,jpkm1 
     179               DO jj=1,jpj 
     180                  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)  & 
     181                     &                                                                         * ua(nlci-nbghostcells-1:nlci-2,jj,jk) 
     182               END DO 
     183            END DO 
     184            DO jj=1,jpj 
     185               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)  
     186            END DO 
     187         ENDIF 
     188         ! 
     189         ! Smoothing if only 1 ghostcell 
     190         ! ----------------------------- 
     191         IF( nbghostcells == 1 ) THEN 
     192            DO jk = 1, jpkm1              ! Smooth 
     193               DO jj = j1, j2 
     194                  ua(nlci-2,jj,jk) = 0.25_wp * umask(nlci-2,jj,jk)      & 
     195                     &             * ( ua(nlci-3,jj,jk) + 2._wp*ua(nlci-2,jj,jk) + ua(nlci-1,jj,jk) ) 
     196               END DO 
     197            END DO 
     198             
     199            zub(nlci-2,:) = 0._wp        ! Correct transport 
    153200            DO jk = 1, jpkm1 
    154201               DO jj = 1, jpj 
    155                   va(2,jj,jk) = (va(2,jj,jk)+va_b(2,jj)-zvb(2,jj)) * vmask(2,jj,jk) 
    156                END DO 
    157             END DO 
     202                  zub(nlci-2,jj) = zub(nlci-2,jj) + e3u_a(nlci-2,jj,jk) * ua(nlci-2,jj,jk) 
     203               END DO 
     204            END DO 
     205            DO jj = 1, jpj 
     206               zub(nlci-2,jj) = zub(nlci-2,jj) * r1_hu_a(nlci-2,jj) 
     207            END DO 
     208             
     209            DO jk = 1, jpkm1 
     210               DO jj = 1, jpj 
     211                  ua(nlci-2,jj,jk) = ( ua(nlci-2,jj,jk) + ua_b(nlci-2,jj) - zub(nlci-2,jj) ) * umask(nlci-2,jj,jk) 
     212               END DO 
     213            END DO 
     214            ! 
     215            IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
     216               zvb(nlci-1,:) = 0._wp 
     217               DO jk = 1, jpkm1 
     218                  DO jj = 1, jpj 
     219                     zvb(nlci-1,jj) = zvb(nlci-1,jj) + e3v_a(nlci-1,jj,jk) * va(nlci-1,jj,jk) 
     220                  END DO 
     221               END DO 
     222               DO jj=1,jpj 
     223                  zvb(nlci-1,jj) = zvb(nlci-1,jj) * r1_hv_a(nlci-1,jj) 
     224               END DO 
     225               DO jk = 1, jpkm1 
     226                  DO jj = 1, jpj 
     227                     va(nlci-1,jj,jk) = ( va(nlci-1,jj,jk) + va_b(nlci-1,jj) - zvb(nlci-1,jj) ) * vmask(nlci-1,jj,jk) 
     228                  END DO 
     229               END DO 
     230            ENDIF 
     231            ! 
    158232         ENDIF 
    159233         ! 
    160234         ! Mask domain edges: 
    161235         !------------------- 
    162          DO jk = 1, jpkm1 
    163             DO jj = 1, jpj 
    164                ua(1,jj,jk) = 0._wp 
    165                va(1,jj,jk) = 0._wp 
    166             END DO 
    167          END DO          
    168          ! 
    169       ENDIF 
    170  
    171       IF( nbondi == 1 .OR. nbondi == 2 ) THEN 
    172  
    173          ! Smoothing 
    174          ! --------- 
     236!         DO jk = 1, jpkm1 
     237!            DO jj = 1, jpj 
     238!               ua(nlci-1,jj,jk) = 0._wp 
     239!               va(nlci  ,jj,jk) = 0._wp 
     240!            END DO 
     241!         END DO 
     242         ! 
     243      ENDIF 
     244 
     245      ! --- South --- ! 
     246      IF( nbondj == -1 .OR. nbondj == 2 ) THEN 
     247 
    175248         IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
    176             ua_b(nlci-2,:) = 0._wp 
     249            va_b(:,2:nbghostcells+1) = 0._wp 
     250            DO jk = 1, jpkm1 
     251               DO ji = 1, jpi 
     252                  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) 
     253               END DO 
     254            END DO 
     255            DO ji=1,jpi 
     256               va_b(ji,2:nbghostcells+1) = va_b(ji,2:nbghostcells+1) * r1_hv_a(ji,2:nbghostcells+1) 
     257            END DO 
     258         ENDIF 
     259         ! 
     260         ! Smoothing if only 1 ghostcell 
     261         ! ----------------------------- 
     262         IF( nbghostcells == 1 ) THEN 
     263            DO jk = 1, jpkm1              ! Smooth 
     264               DO ji = i1, i2 
     265                  va(ji,2,jk) = 0.25_wp * vmask(ji,2,jk)    & 
     266                     &        * ( va(ji,1,jk) + 2._wp*va(ji,2,jk) + va(ji,3,jk) ) 
     267               END DO 
     268            END DO 
     269            ! 
     270            zvb(:,2) = 0._wp              ! Correct transport 
    177271            DO jk=1,jpkm1 
    178                DO jj=1,jpj 
    179                   ua_b(nlci-2,jj) = ua_b(nlci-2,jj) + e3u_a(nlci-2,jj,jk) * ua(nlci-2,jj,jk) 
    180                END DO 
    181             END DO 
    182             DO jj=1,jpj 
    183                ua_b(nlci-2,jj) = ua_b(nlci-2,jj) * r1_hu_a(nlci-2,jj)             
    184             END DO 
    185          ENDIF 
    186  
    187          DO jk = 1, jpkm1              ! Smooth 
    188             DO jj = j1, j2 
    189                ua(nlci-2,jj,jk) = 0.25_wp * umask(nlci-2,jj,jk)      & 
    190                   &             * ( ua(nlci-3,jj,jk) + 2._wp*ua(nlci-2,jj,jk) + ua(nlci-1,jj,jk) ) 
    191             END DO 
    192          END DO 
    193  
    194          zub(nlci-2,:) = 0._wp        ! Correct transport 
    195          DO jk = 1, jpkm1 
    196             DO jj = 1, jpj 
    197                zub(nlci-2,jj) = zub(nlci-2,jj) + e3u_a(nlci-2,jj,jk) * ua(nlci-2,jj,jk) 
    198             END DO 
    199          END DO 
    200          DO jj = 1, jpj 
    201             zub(nlci-2,jj) = zub(nlci-2,jj) * r1_hu_a(nlci-2,jj) 
    202          END DO 
    203  
    204          DO jk = 1, jpkm1 
    205             DO jj = 1, jpj 
    206                ua(nlci-2,jj,jk) = ( ua(nlci-2,jj,jk) + ua_b(nlci-2,jj) - zub(nlci-2,jj) ) * umask(nlci-2,jj,jk) 
    207             END DO 
    208          END DO 
    209          ! 
    210          ! Set tangential velocities to time splitting estimate 
    211          !----------------------------------------------------- 
    212          IF( ln_dynspg_ts ) THEN 
    213             zvb(nlci-1,:) = 0._wp 
     272               DO ji=1,jpi 
     273                  zvb(ji,2) = zvb(ji,2) + e3v_a(ji,2,jk) * va(ji,2,jk) * vmask(ji,2,jk) 
     274               END DO 
     275            END DO 
     276            DO ji = 1, jpi 
     277               zvb(ji,2) = zvb(ji,2) * r1_hv_a(ji,2) 
     278            END DO 
    214279            DO jk = 1, jpkm1 
    215                DO jj = 1, jpj 
    216                   zvb(nlci-1,jj) = zvb(nlci-1,jj) + e3v_a(nlci-1,jj,jk) * va(nlci-1,jj,jk) 
    217                END DO 
    218             END DO 
    219             DO jj=1,jpj 
    220                zvb(nlci-1,jj) = zvb(nlci-1,jj) * r1_hv_a(nlci-1,jj) 
    221             END DO 
    222             DO jk = 1, jpkm1 
    223                DO jj = 1, jpj 
    224                   va(nlci-1,jj,jk) = ( va(nlci-1,jj,jk) + va_b(nlci-1,jj) - zvb(nlci-1,jj) ) * vmask(nlci-1,jj,jk) 
    225                END DO 
    226             END DO 
     280               DO ji = 1, jpi 
     281                  va(ji,2,jk) = ( va(ji,2,jk) + va_b(ji,2) - zvb(ji,2) ) * vmask(ji,2,jk) 
     282               END DO 
     283            END DO 
     284             
     285            IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
     286               zub(:,2) = 0._wp 
     287               DO jk = 1, jpkm1 
     288                  DO ji = 1, jpi 
     289                     zub(ji,2) = zub(ji,2) + e3u_a(ji,2,jk) * ua(ji,2,jk) * umask(ji,2,jk) 
     290                  END DO 
     291               END DO 
     292               DO ji = 1, jpi 
     293                  zub(ji,2) = zub(ji,2) * r1_hu_a(ji,2) 
     294               END DO 
     295                
     296               DO jk = 1, jpkm1 
     297                  DO ji = 1, jpi 
     298                     ua(ji,2,jk) = ( ua(ji,2,jk) + ua_b(ji,2) - zub(ji,2) ) * umask(ji,2,jk) 
     299                  END DO 
     300               END DO 
     301            ENDIF 
     302            ! 
    227303         ENDIF 
    228304         ! 
    229305         ! Mask domain edges: 
    230306         !------------------- 
    231          DO jk = 1, jpkm1 
    232             DO jj = 1, jpj 
    233                ua(nlci-1,jj,jk) = 0._wp 
    234                va(nlci  ,jj,jk) = 0._wp 
    235             END DO 
    236          END DO  
    237          ! 
    238       ENDIF 
    239  
    240       IF( nbondj == -1 .OR. nbondj == 2 ) THEN 
    241  
    242          ! Smoothing 
    243          ! --------- 
     307!         DO jk = 1, jpkm1 
     308!            DO ji = 1, jpi 
     309!               ua(ji,1,jk) = 0._wp 
     310!               va(ji,1,jk) = 0._wp 
     311!            END DO 
     312!         END DO 
     313         ! 
     314      ENDIF 
     315 
     316      ! --- North --- ! 
     317      IF( nbondj == 1 .OR. nbondj == 2 ) THEN 
     318         ! 
    244319         IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
    245             va_b(:,2) = 0._wp 
     320            va_b(:,nlcj-nbghostcells-1:nlcj-2) = 0._wp 
    246321            DO jk = 1, jpkm1 
    247322               DO ji = 1, jpi 
    248                   va_b(ji,2) = va_b(ji,2) + e3v_a(ji,2,jk) * va(ji,2,jk) 
    249                END DO 
    250             END DO 
    251             DO ji=1,jpi 
    252                va_b(ji,2) = va_b(ji,2) * r1_hv_a(ji,2)             
    253             END DO 
    254          ENDIF 
    255          ! 
    256          DO jk = 1, jpkm1              ! Smooth 
    257             DO ji = i1, i2 
    258                va(ji,2,jk) = 0.25_wp * vmask(ji,2,jk)    & 
    259                   &        * ( va(ji,1,jk) + 2._wp*va(ji,2,jk) + va(ji,3,jk) ) 
    260             END DO 
    261          END DO 
    262          ! 
    263          zvb(:,2) = 0._wp              ! Correct transport 
    264          DO jk=1,jpkm1 
    265             DO ji=1,jpi 
    266                zvb(ji,2) = zvb(ji,2) + e3v_a(ji,2,jk) * va(ji,2,jk) * vmask(ji,2,jk) 
    267             END DO 
    268          END DO 
    269          DO ji = 1, jpi 
    270             zvb(ji,2) = zvb(ji,2) * r1_hv_a(ji,2) 
    271          END DO 
    272          DO jk = 1, jpkm1 
     323                  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)  & 
     324                     &                                                                         * va(ji,nlcj-nbghostcells-1:nlcj-2,jk) 
     325               END DO 
     326            END DO 
    273327            DO ji = 1, jpi 
    274                va(ji,2,jk) = ( va(ji,2,jk) + va_b(ji,2) - zvb(ji,2) ) * vmask(ji,2,jk) 
    275             END DO 
    276          END DO 
    277  
    278          ! Set tangential velocities to time splitting estimate 
    279          !----------------------------------------------------- 
    280          IF( ln_dynspg_ts ) THEN 
    281             zub(:,2) = 0._wp 
     328               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) 
     329            END DO 
     330         ENDIF 
     331         ! 
     332         ! Smoothing if only 1 ghostcell 
     333         ! ----------------------------- 
     334         IF( nbghostcells == 1 ) THEN 
     335            DO jk = 1, jpkm1              ! Smooth 
     336               DO ji = i1, i2 
     337                  va(ji,nlcj-2,jk) = 0.25_wp * vmask(ji,nlcj-2,jk)   & 
     338                     &             * ( va(ji,nlcj-3,jk) + 2._wp * va(ji,nlcj-2,jk) + va(ji,nlcj-1,jk) ) 
     339               END DO 
     340            END DO 
     341            ! 
     342            zvb(:,nlcj-2) = 0._wp         ! Correct transport 
    282343            DO jk = 1, jpkm1 
    283344               DO ji = 1, jpi 
    284                   zub(ji,2) = zub(ji,2) + e3u_a(ji,2,jk) * ua(ji,2,jk) * umask(ji,2,jk) 
     345                  zvb(ji,nlcj-2) = zvb(ji,nlcj-2) + e3v_a(ji,nlcj-2,jk) * va(ji,nlcj-2,jk) * vmask(ji,nlcj-2,jk) 
    285346               END DO 
    286347            END DO 
    287348            DO ji = 1, jpi 
    288                zub(ji,2) = zub(ji,2) * r1_hu_a(ji,2) 
    289             END DO 
    290  
     349               zvb(ji,nlcj-2) = zvb(ji,nlcj-2) * r1_hv_a(ji,nlcj-2) 
     350            END DO 
    291351            DO jk = 1, jpkm1 
    292352               DO ji = 1, jpi 
    293                   ua(ji,2,jk) = ( ua(ji,2,jk) + ua_b(ji,2) - zub(ji,2) ) * umask(ji,2,jk) 
    294                END DO 
    295             END DO 
    296          ENDIF 
    297  
     353                  va(ji,nlcj-2,jk) = ( va(ji,nlcj-2,jk) + va_b(ji,nlcj-2) - zvb(ji,nlcj-2) ) * vmask(ji,nlcj-2,jk) 
     354               END DO 
     355            END DO 
     356            ! 
     357            IF( ln_dynspg_ts ) THEN       ! Set tangential velocities to time splitting estimate 
     358               zub(:,nlcj-1) = 0._wp 
     359               DO jk = 1, jpkm1 
     360                  DO ji = 1, jpi 
     361                     zub(ji,nlcj-1) = zub(ji,nlcj-1) + e3u_a(ji,nlcj-1,jk) * ua(ji,nlcj-1,jk) * umask(ji,nlcj-1,jk) 
     362                  END DO 
     363               END DO 
     364               DO ji = 1, jpi 
     365                  zub(ji,nlcj-1) = zub(ji,nlcj-1) * r1_hu_a(ji,nlcj-1) 
     366               END DO 
     367               ! 
     368               DO jk = 1, jpkm1 
     369                  DO ji = 1, jpi 
     370                     ua(ji,nlcj-1,jk) = ( ua(ji,nlcj-1,jk) + ua_b(ji,nlcj-1) - zub(ji,nlcj-1) ) * umask(ji,nlcj-1,jk) 
     371                  END DO 
     372               END DO 
     373            ENDIF 
     374            ! 
     375         ENDIF 
     376         ! 
    298377         ! Mask domain edges: 
    299378         !------------------- 
    300          DO jk = 1, jpkm1 
    301             DO ji = 1, jpi 
    302                ua(ji,1,jk) = 0._wp 
    303                va(ji,1,jk) = 0._wp 
    304             END DO 
    305          END DO  
    306  
    307       ENDIF 
    308  
    309       IF( nbondj == 1 .OR. nbondj == 2 ) THEN 
    310          ! 
    311          ! Smoothing 
    312          ! --------- 
    313          IF( .NOT.ln_dynspg_ts ) THEN  ! Store transport 
    314             va_b(:,nlcj-2) = 0._wp 
    315             DO jk = 1, jpkm1 
    316                DO ji = 1, jpi 
    317                   va_b(ji,nlcj-2) = va_b(ji,nlcj-2) + e3v_a(ji,nlcj-2,jk) * va(ji,nlcj-2,jk) 
    318                END DO 
    319             END DO 
    320             DO ji = 1, jpi 
    321                va_b(ji,nlcj-2) = va_b(ji,nlcj-2) * r1_hv_a(ji,nlcj-2)             
    322             END DO 
    323          ENDIF 
    324          ! 
    325          DO jk = 1, jpkm1              ! Smooth 
    326             DO ji = i1, i2 
    327                va(ji,nlcj-2,jk) = 0.25_wp * vmask(ji,nlcj-2,jk)   & 
    328                   &             * ( va(ji,nlcj-3,jk) + 2._wp * va(ji,nlcj-2,jk) + va(ji,nlcj-1,jk) ) 
    329             END DO 
    330          END DO 
    331          ! 
    332          zvb(:,nlcj-2) = 0._wp         ! Correct transport 
    333          DO jk = 1, jpkm1 
    334             DO ji = 1, jpi 
    335                zvb(ji,nlcj-2) = zvb(ji,nlcj-2) + e3v_a(ji,nlcj-2,jk) * va(ji,nlcj-2,jk) * vmask(ji,nlcj-2,jk) 
    336             END DO 
    337          END DO 
    338          DO ji = 1, jpi 
    339             zvb(ji,nlcj-2) = zvb(ji,nlcj-2) * r1_hv_a(ji,nlcj-2) 
    340          END DO 
    341          DO jk = 1, jpkm1 
    342             DO ji = 1, jpi 
    343                va(ji,nlcj-2,jk) = ( va(ji,nlcj-2,jk) + va_b(ji,nlcj-2) - zvb(ji,nlcj-2) ) * vmask(ji,nlcj-2,jk) 
    344             END DO 
    345          END DO 
    346          ! 
    347          ! Set tangential velocities to time splitting estimate 
    348          !----------------------------------------------------- 
    349          IF( ln_dynspg_ts ) THEN 
    350             zub(:,nlcj-1) = 0._wp 
    351             DO jk = 1, jpkm1 
    352                DO ji = 1, jpi 
    353                   zub(ji,nlcj-1) = zub(ji,nlcj-1) + e3u_a(ji,nlcj-1,jk) * ua(ji,nlcj-1,jk) * umask(ji,nlcj-1,jk) 
    354                END DO 
    355             END DO 
    356             DO ji = 1, jpi 
    357                zub(ji,nlcj-1) = zub(ji,nlcj-1) * r1_hu_a(ji,nlcj-1) 
    358             END DO 
    359             ! 
    360             DO jk = 1, jpkm1 
    361                DO ji = 1, jpi 
    362                   ua(ji,nlcj-1,jk) = ( ua(ji,nlcj-1,jk) + ua_b(ji,nlcj-1) - zub(ji,nlcj-1) ) * umask(ji,nlcj-1,jk) 
    363                END DO 
    364             END DO 
    365          ENDIF 
    366          ! 
    367          ! Mask domain edges: 
    368          !------------------- 
    369          DO jk = 1, jpkm1 
    370             DO ji = 1, jpi 
    371                ua(ji,nlcj  ,jk) = 0._wp 
    372                va(ji,nlcj-1,jk) = 0._wp 
    373             END DO 
    374          END DO  
     379!         DO jk = 1, jpkm1 
     380!            DO ji = 1, jpi 
     381!               ua(ji,nlcj  ,jk) = 0._wp 
     382!               va(ji,nlcj-1,jk) = 0._wp 
     383!            END DO 
     384!         END DO 
    375385         ! 
    376386      ENDIF 
     
    392402      ! 
    393403      IF( Agrif_Root() )   RETURN 
    394       ! 
     404      !! clem ghost 
    395405      IF((nbondi == -1).OR.(nbondi == 2)) THEN 
    396406         DO jj=1,jpj 
    397             va_e(2,jj) = vbdy_w(jj) * hvr_e(2,jj) 
     407            va_e(2:nbghostcells+1,jj) = vbdy_w(jj) * hvr_e(2:nbghostcells+1,jj) 
    398408            ! Specified fluxes: 
    399             ua_e(2,jj) = ubdy_w(jj) * hur_e(2,jj) 
    400             ! Characteristics method: 
     409            ua_e(2:nbghostcells+1,jj) = ubdy_w(jj) * hur_e(2:nbghostcells+1,jj) 
     410            ! Characteristics method (only if ghostcells=1): 
    401411            !alt            ua_e(2,jj) = 0.5_wp * ( ubdy_w(jj) * hur_e(2,jj) + ua_e(3,jj) & 
    402412            !alt                       &           - sqrt(grav * hur_e(2,jj)) * (sshn_e(3,jj) - hbdy_w(jj)) ) 
     
    406416      IF((nbondi == 1).OR.(nbondi == 2)) THEN 
    407417         DO jj=1,jpj 
    408             va_e(nlci-1,jj) = vbdy_e(jj) * hvr_e(nlci-1,jj) 
     418            va_e(nlci-nbghostcells:nlci-1,jj)   = vbdy_e(jj) * hvr_e(nlci-nbghostcells:nlci-1,jj) 
    409419            ! Specified fluxes: 
    410             ua_e(nlci-2,jj) = ubdy_e(jj) * hur_e(nlci-2,jj) 
    411             ! Characteristics method: 
     420            ua_e(nlci-nbghostcells-1:nlci-2,jj) = ubdy_e(jj) * hur_e(nlci-nbghostcells-1:nlci-2,jj) 
     421            ! Characteristics method (only if ghostcells=1): 
    412422            !alt            ua_e(nlci-2,jj) = 0.5_wp * ( ubdy_e(jj) * hur_e(nlci-2,jj) + ua_e(nlci-3,jj) & 
    413423            !alt                            &           + sqrt(grav * hur_e(nlci-2,jj)) * (sshn_e(nlci-2,jj) - hbdy_e(jj)) ) 
     
    417427      IF((nbondj == -1).OR.(nbondj == 2)) THEN 
    418428         DO ji=1,jpi 
    419             ua_e(ji,2) = ubdy_s(ji) * hur_e(ji,2) 
     429            ua_e(ji,2:nbghostcells+1) = ubdy_s(ji) * hur_e(ji,2:nbghostcells+1) 
    420430            ! Specified fluxes: 
    421             va_e(ji,2) = vbdy_s(ji) * hvr_e(ji,2) 
    422             ! Characteristics method: 
     431            va_e(ji,2:nbghostcells+1) = vbdy_s(ji) * hvr_e(ji,2:nbghostcells+1) 
     432            ! Characteristics method (only if ghostcells=1): 
    423433            !alt            va_e(ji,2) = 0.5_wp * ( vbdy_s(ji) * hvr_e(ji,2) + va_e(ji,3) & 
    424434            !alt                       &           - sqrt(grav * hvr_e(ji,2)) * (sshn_e(ji,3) - hbdy_s(ji)) ) 
     
    428438      IF((nbondj == 1).OR.(nbondj == 2)) THEN 
    429439         DO ji=1,jpi 
    430             ua_e(ji,nlcj-1) = ubdy_n(ji) * hur_e(ji,nlcj-1) 
     440            ua_e(ji,nlcj-nbghostcells:nlcj-1)   = ubdy_n(ji) * hur_e(ji,nlcj-nbghostcells:nlcj-1) 
    431441            ! Specified fluxes: 
    432             va_e(ji,nlcj-2) = vbdy_n(ji) * hvr_e(ji,nlcj-2) 
    433             ! Characteristics method: 
     442            va_e(ji,nlcj-nbghostcells-1:nlcj-2) = vbdy_n(ji) * hvr_e(ji,nlcj-nbghostcells-1:nlcj-2) 
     443            ! Characteristics method (only if ghostcells=1): 
    434444            !alt            va_e(ji,nlcj-2) = 0.5_wp * ( vbdy_n(ji) * hvr_e(ji,nlcj-2)  + va_e(ji,nlcj-3) & 
    435445            !alt                            &           + sqrt(grav * hvr_e(ji,nlcj-2)) * (sshn_e(ji,nlcj-2) - hbdy_n(ji)) ) 
     
    476486      ! 
    477487      IF( ll_int_cons ) THEN  ! Conservative interpolation 
    478          ! orders matters here !!!!!! 
     488         ! order matters here !!!!!! 
    479489         CALL Agrif_Bc_variable( ub2b_interp_id, calledweight=1._wp, procname=interpub2b ) ! Time integrated 
    480490         CALL Agrif_Bc_variable( vb2b_interp_id, calledweight=1._wp, procname=interpvb2b ) 
     
    504514      !!----------------------------------------------------------------------   
    505515      INTEGER, INTENT(in) ::   kt 
    506       !! 
     516      ! 
     517      INTEGER  :: ji, jj, indx 
    507518      !!----------------------------------------------------------------------   
    508519      ! 
    509520      IF( Agrif_Root() )   RETURN 
    510       ! 
     521      !! clem ghost 
     522      ! --- West --- ! 
    511523      IF((nbondi == -1).OR.(nbondi == 2)) THEN 
    512          ssha(2,:)=ssha(3,:) 
    513          sshn(2,:)=sshn(3,:) 
    514       ENDIF 
    515       ! 
     524         indx = 1+nbghostcells 
     525         DO jj = 1, jpj 
     526            DO ji = 2, indx 
     527               ssha(ji,jj)=ssha(indx+1,jj) 
     528               sshn(ji,jj)=sshn(indx+1,jj) 
     529            ENDDO 
     530         ENDDO 
     531      ENDIF 
     532      ! 
     533      ! --- East --- ! 
    516534      IF((nbondi == 1).OR.(nbondi == 2)) THEN 
    517          ssha(nlci-1,:)=ssha(nlci-2,:) 
    518          sshn(nlci-1,:)=sshn(nlci-2,:) 
    519       ENDIF 
    520       ! 
     535         indx = nlci-nbghostcells 
     536         DO jj = 1, jpj 
     537            DO ji = indx, nlci-1 
     538               ssha(ji,jj)=ssha(indx-1,jj) 
     539               sshn(ji,jj)=sshn(indx-1,jj) 
     540            ENDDO 
     541         ENDDO 
     542      ENDIF 
     543      ! 
     544      ! --- South --- ! 
    521545      IF((nbondj == -1).OR.(nbondj == 2)) THEN 
    522          ssha(:,2)=ssha(:,3) 
    523          sshn(:,2)=sshn(:,3) 
    524       ENDIF 
    525       ! 
     546         indx = 1+nbghostcells 
     547         DO jj = 2, indx 
     548            DO ji = 1, jpi 
     549               ssha(ji,jj)=ssha(ji,indx+1) 
     550               sshn(ji,jj)=sshn(ji,indx+1) 
     551            ENDDO 
     552         ENDDO 
     553      ENDIF 
     554      ! 
     555      ! --- North --- ! 
    526556      IF((nbondj == 1).OR.(nbondj == 2)) THEN 
    527          ssha(:,nlcj-1)=ssha(:,nlcj-2) 
    528          sshn(:,nlcj-1)=sshn(:,nlcj-2) 
     557         indx = nlcj-nbghostcells 
     558         DO jj = indx, nlcj-1 
     559            DO ji = 1, jpi 
     560               ssha(ji,jj)=ssha(ji,indx-1) 
     561               sshn(ji,jj)=sshn(ji,indx-1) 
     562            ENDDO 
     563         ENDDO 
    529564      ENDIF 
    530565      ! 
     
    538573      INTEGER, INTENT(in) ::   jn 
    539574      !! 
    540       INTEGER :: ji,jj 
    541       !!----------------------------------------------------------------------   
    542       ! 
     575      INTEGER :: ji, jj 
     576      !!----------------------------------------------------------------------   
     577      !! clem ghost (starting at i,j=1 is important I think otherwise you introduce a grad(ssh)/=0 at point 2) 
    543578      IF((nbondi == -1).OR.(nbondi == 2)) THEN 
    544579         DO jj = 1, jpj 
    545             ssha_e(2,jj) = hbdy_w(jj) 
     580            ssha_e(2:nbghostcells+1,jj) = hbdy_w(jj) 
    546581         END DO 
    547582      ENDIF 
     
    549584      IF((nbondi == 1).OR.(nbondi == 2)) THEN 
    550585         DO jj = 1, jpj 
    551             ssha_e(nlci-1,jj) = hbdy_e(jj) 
     586            ssha_e(nlci-nbghostcells:nlci-1,jj) = hbdy_e(jj) 
    552587         END DO 
    553588      ENDIF 
     
    555590      IF((nbondj == -1).OR.(nbondj == 2)) THEN 
    556591         DO ji = 1, jpi 
    557             ssha_e(ji,2) = hbdy_s(ji) 
     592            ssha_e(ji,2:nbghostcells+1) = hbdy_s(ji) 
    558593         END DO 
    559594      ENDIF 
     
    561596      IF((nbondj == 1).OR.(nbondj == 2)) THEN 
    562597         DO ji = 1, jpi 
    563             ssha_e(ji,nlcj-1) = hbdy_n(ji) 
     598            ssha_e(ji,nlcj-nbghostcells:nlcj-1) = hbdy_n(ji) 
    564599         END DO 
    565600      ENDIF 
     
    601636      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices 
    602637      INTEGER  ::   imin, imax, jmin, jmax 
    603       REAL(wp) ::   zrhox , zalpha1, zalpha2, zalpha3 
    604       REAL(wp) ::   zalpha4, zalpha5, zalpha6, zalpha7 
     638      REAL(wp) ::   zrhox, z1, z2, z3, z4, z5, z6, z7 
    605639      LOGICAL  ::   western_side, eastern_side,northern_side,southern_side 
    606640      !!---------------------------------------------------------------------- 
     
    610644      ELSE 
    611645         ! 
    612          western_side  = (nb == 1).AND.(ndir == 1) 
    613          eastern_side  = (nb == 1).AND.(ndir == 2) 
    614          southern_side = (nb == 2).AND.(ndir == 1) 
    615          northern_side = (nb == 2).AND.(ndir == 2) 
    616          ! 
    617          zrhox = Agrif_Rhox() 
    618          !  
    619          zalpha1 = ( zrhox - 1. ) * 0.5 
    620          zalpha2 = 1. - zalpha1 
    621          !  
    622          zalpha3 = ( zrhox - 1. ) / ( zrhox + 1. ) 
    623          zalpha4 = 1. - zalpha3 
    624          !  
    625          zalpha6 = 2. * ( zrhox - 1. ) / ( zrhox + 1. ) 
    626          zalpha7 =    - ( zrhox - 1. ) / ( zrhox + 3. ) 
    627          zalpha5 = 1. - zalpha6 - zalpha7 
    628          ! 
    629          imin = i1 
    630          imax = i2 
    631          jmin = j1 
    632          jmax = j2 
    633          !  
    634          ! Remove CORNERS 
    635          IF((nbondj == -1).OR.(nbondj == 2)) jmin = 3 
    636          IF((nbondj == +1).OR.(nbondj == 2)) jmax = nlcj-2 
    637          IF((nbondi == -1).OR.(nbondi == 2)) imin = 3 
    638          IF((nbondi == +1).OR.(nbondi == 2)) imax = nlci-2         
    639          ! 
    640          IF( eastern_side ) THEN 
    641             DO jn = 1, jpts 
    642                tsa(nlci,j1:j2,k1:k2,jn) = zalpha1 * ptab(nlci,j1:j2,k1:k2,jn) + zalpha2 * ptab(nlci-1,j1:j2,k1:k2,jn) 
    643                DO jk = 1, jpkm1 
    644                   DO jj = jmin,jmax 
    645                      IF( umask(nlci-2,jj,jk) == 0._wp ) THEN 
    646                         tsa(nlci-1,jj,jk,jn) = tsa(nlci,jj,jk,jn) * tmask(nlci-1,jj,jk) 
    647                      ELSE 
    648                         tsa(nlci-1,jj,jk,jn)=(zalpha4*tsa(nlci,jj,jk,jn)+zalpha3*tsa(nlci-2,jj,jk,jn))*tmask(nlci-1,jj,jk) 
    649                         IF( un(nlci-2,jj,jk) > 0._wp ) THEN 
    650                            tsa(nlci-1,jj,jk,jn)=( zalpha6*tsa(nlci-2,jj,jk,jn)+zalpha5*tsa(nlci,jj,jk,jn) &  
    651                                  + zalpha7*tsa(nlci-3,jj,jk,jn) ) * tmask(nlci-1,jj,jk) 
     646         western_side  = (nb == 1).AND.(ndir == 1)  ;  eastern_side  = (nb == 1).AND.(ndir == 2) 
     647         southern_side = (nb == 2).AND.(ndir == 1)  ;  northern_side = (nb == 2).AND.(ndir == 2) 
     648         ! 
     649         IF( nbghostcells > 1 ) THEN  ! no smoothing 
     650            tsa(i1:i2,j1:j2,k1:k2,n1:n2) = ptab(i1:i2,j1:j2,k1:k2,n1:n2) 
     651         ELSE                         ! smoothing 
     652            ! 
     653            zrhox = Agrif_Rhox() 
     654            z1 = ( zrhox - 1. ) * 0.5 
     655            z3 = ( zrhox - 1. ) / ( zrhox + 1. ) 
     656            z6 = 2. * ( zrhox - 1. ) / ( zrhox + 1. ) 
     657            z7 =    - ( zrhox - 1. ) / ( zrhox + 3. ) 
     658            ! 
     659            z2 = 1. - z1 
     660            z4 = 1. - z3 
     661            z5 = 1. - z6 - z7 
     662            ! 
     663            imin = i1 ; imax = i2 
     664            jmin = j1 ; jmax = j2 
     665            !  
     666            ! Remove CORNERS 
     667            IF((nbondj == -1).OR.(nbondj == 2)) jmin = 3 
     668            IF((nbondj == +1).OR.(nbondj == 2)) jmax = nlcj-2 
     669            IF((nbondi == -1).OR.(nbondi == 2)) imin = 3 
     670            IF((nbondi == +1).OR.(nbondi == 2)) imax = nlci-2         
     671            ! 
     672            IF( eastern_side ) THEN 
     673               DO jn = 1, jpts 
     674                  tsa(nlci,j1:j2,k1:k2,jn) = z1 * ptab(nlci,j1:j2,k1:k2,jn) + z2 * ptab(nlci-1,j1:j2,k1:k2,jn) 
     675                  DO jk = 1, jpkm1 
     676                     DO jj = jmin,jmax 
     677                        IF( umask(nlci-2,jj,jk) == 0._wp ) THEN 
     678                           tsa(nlci-1,jj,jk,jn) = tsa(nlci,jj,jk,jn) * tmask(nlci-1,jj,jk) 
     679                        ELSE 
     680                           tsa(nlci-1,jj,jk,jn)=(z4*tsa(nlci,jj,jk,jn)+z3*tsa(nlci-2,jj,jk,jn))*tmask(nlci-1,jj,jk) 
     681                           IF( un(nlci-2,jj,jk) > 0._wp ) THEN 
     682                              tsa(nlci-1,jj,jk,jn)=( z6*tsa(nlci-2,jj,jk,jn)+z5*tsa(nlci,jj,jk,jn) &  
     683                                                   + z7*tsa(nlci-3,jj,jk,jn) ) * tmask(nlci-1,jj,jk) 
     684                           ENDIF 
    652685                        ENDIF 
    653                      ENDIF 
     686                     END DO 
    654687                  END DO 
    655                END DO 
    656                tsa(nlci,j1:j2,k1:k2,jn) = 0._wp 
    657             END DO 
    658          ENDIF 
    659          !  
    660          IF( northern_side ) THEN             
    661             DO jn = 1, jpts 
    662                tsa(i1:i2,nlcj,k1:k2,jn) = zalpha1 * ptab(i1:i2,nlcj,k1:k2,jn) + zalpha2 * ptab(i1:i2,nlcj-1,k1:k2,jn) 
    663                DO jk = 1, jpkm1 
    664                   DO ji = imin,imax 
    665                      IF( vmask(ji,nlcj-2,jk) == 0._wp ) THEN 
    666                         tsa(ji,nlcj-1,jk,jn) = tsa(ji,nlcj,jk,jn) * tmask(ji,nlcj-1,jk) 
    667                      ELSE 
    668                         tsa(ji,nlcj-1,jk,jn)=(zalpha4*tsa(ji,nlcj,jk,jn)+zalpha3*tsa(ji,nlcj-2,jk,jn))*tmask(ji,nlcj-1,jk)         
    669                         IF (vn(ji,nlcj-2,jk) > 0._wp ) THEN 
    670                            tsa(ji,nlcj-1,jk,jn)=( zalpha6*tsa(ji,nlcj-2,jk,jn)+zalpha5*tsa(ji,nlcj,jk,jn)  & 
    671                                  + zalpha7*tsa(ji,nlcj-3,jk,jn) ) * tmask(ji,nlcj-1,jk) 
     688                  tsa(nlci,j1:j2,k1:k2,jn) = 0._wp 
     689               END DO 
     690            ENDIF 
     691            !  
     692            IF( northern_side ) THEN             
     693               DO jn = 1, jpts 
     694                  tsa(i1:i2,nlcj,k1:k2,jn) = z1 * ptab(i1:i2,nlcj,k1:k2,jn) + z2 * ptab(i1:i2,nlcj-1,k1:k2,jn) 
     695                  DO jk = 1, jpkm1 
     696                     DO ji = imin,imax 
     697                        IF( vmask(ji,nlcj-2,jk) == 0._wp ) THEN 
     698                           tsa(ji,nlcj-1,jk,jn) = tsa(ji,nlcj,jk,jn) * tmask(ji,nlcj-1,jk) 
     699                        ELSE 
     700                           tsa(ji,nlcj-1,jk,jn)=(z4*tsa(ji,nlcj,jk,jn)+z3*tsa(ji,nlcj-2,jk,jn))*tmask(ji,nlcj-1,jk)         
     701                           IF (vn(ji,nlcj-2,jk) > 0._wp ) THEN 
     702                              tsa(ji,nlcj-1,jk,jn)=( z6*tsa(ji,nlcj-2,jk,jn)+z5*tsa(ji,nlcj,jk,jn)  & 
     703                                                   + z7*tsa(ji,nlcj-3,jk,jn) ) * tmask(ji,nlcj-1,jk) 
     704                           ENDIF 
    672705                        ENDIF 
    673                      ENDIF 
     706                     END DO 
    674707                  END DO 
    675                END DO 
    676                tsa(i1:i2,nlcj,k1:k2,jn) = 0._wp 
    677             END DO 
    678          ENDIF 
    679          ! 
    680          IF( western_side ) THEN             
    681             DO jn = 1, jpts 
    682                tsa(1,j1:j2,k1:k2,jn) = zalpha1 * ptab(1,j1:j2,k1:k2,jn) + zalpha2 * ptab(2,j1:j2,k1:k2,jn) 
    683                DO jk = 1, jpkm1 
    684                   DO jj = jmin,jmax 
    685                      IF( umask(2,jj,jk) == 0._wp ) THEN 
    686                         tsa(2,jj,jk,jn) = tsa(1,jj,jk,jn) * tmask(2,jj,jk) 
    687                      ELSE 
    688                         tsa(2,jj,jk,jn)=(zalpha4*tsa(1,jj,jk,jn)+zalpha3*tsa(3,jj,jk,jn))*tmask(2,jj,jk)         
    689                         IF( un(2,jj,jk) < 0._wp ) THEN 
    690                            tsa(2,jj,jk,jn)=(zalpha6*tsa(3,jj,jk,jn)+zalpha5*tsa(1,jj,jk,jn)+zalpha7*tsa(4,jj,jk,jn))*tmask(2,jj,jk) 
     708                  tsa(i1:i2,nlcj,k1:k2,jn) = 0._wp 
     709               END DO 
     710            ENDIF 
     711            ! 
     712            IF( western_side ) THEN             
     713               DO jn = 1, jpts 
     714                  tsa(1,j1:j2,k1:k2,jn) = z1 * ptab(1,j1:j2,k1:k2,jn) + z2 * ptab(2,j1:j2,k1:k2,jn) 
     715                  DO jk = 1, jpkm1 
     716                     DO jj = jmin,jmax 
     717                        IF( umask(2,jj,jk) == 0._wp ) THEN 
     718                           tsa(2,jj,jk,jn) = tsa(1,jj,jk,jn) * tmask(2,jj,jk) 
     719                        ELSE 
     720                           tsa(2,jj,jk,jn)=(z4*tsa(1,jj,jk,jn)+z3*tsa(3,jj,jk,jn))*tmask(2,jj,jk)         
     721                           IF( un(2,jj,jk) < 0._wp ) THEN 
     722                              tsa(2,jj,jk,jn)=(z6*tsa(3,jj,jk,jn)+z5*tsa(1,jj,jk,jn)+z7*tsa(4,jj,jk,jn))*tmask(2,jj,jk) 
     723                           ENDIF 
    691724                        ENDIF 
    692                      ENDIF 
     725                     END DO 
    693726                  END DO 
    694                END DO 
    695                tsa(1,j1:j2,k1:k2,jn) = 0._wp 
    696             END DO 
    697          ENDIF 
    698          ! 
    699          IF( southern_side ) THEN            
    700             DO jn = 1, jpts 
    701                tsa(i1:i2,1,k1:k2,jn) = zalpha1 * ptab(i1:i2,1,k1:k2,jn) + zalpha2 * ptab(i1:i2,2,k1:k2,jn) 
    702                DO jk = 1, jpk       
    703                   DO ji=imin,imax 
    704                      IF( vmask(ji,2,jk) == 0._wp ) THEN 
    705                         tsa(ji,2,jk,jn)=tsa(ji,1,jk,jn) * tmask(ji,2,jk) 
    706                      ELSE 
    707                         tsa(ji,2,jk,jn)=(zalpha4*tsa(ji,1,jk,jn)+zalpha3*tsa(ji,3,jk,jn))*tmask(ji,2,jk) 
    708                         IF( vn(ji,2,jk) < 0._wp ) THEN 
    709                            tsa(ji,2,jk,jn)=(zalpha6*tsa(ji,3,jk,jn)+zalpha5*tsa(ji,1,jk,jn)+zalpha7*tsa(ji,4,jk,jn))*tmask(ji,2,jk) 
     727                  tsa(1,j1:j2,k1:k2,jn) = 0._wp 
     728               END DO 
     729            ENDIF 
     730            ! 
     731            IF( southern_side ) THEN            
     732               DO jn = 1, jpts 
     733                  tsa(i1:i2,1,k1:k2,jn) = z1 * ptab(i1:i2,1,k1:k2,jn) + z2 * ptab(i1:i2,2,k1:k2,jn) 
     734                  DO jk = 1, jpk       
     735                     DO ji=imin,imax 
     736                        IF( vmask(ji,2,jk) == 0._wp ) THEN 
     737                           tsa(ji,2,jk,jn)=tsa(ji,1,jk,jn) * tmask(ji,2,jk) 
     738                        ELSE 
     739                           tsa(ji,2,jk,jn)=(z4*tsa(ji,1,jk,jn)+z3*tsa(ji,3,jk,jn))*tmask(ji,2,jk) 
     740                           IF( vn(ji,2,jk) < 0._wp ) THEN 
     741                              tsa(ji,2,jk,jn)=(z6*tsa(ji,3,jk,jn)+z5*tsa(ji,1,jk,jn)+z7*tsa(ji,4,jk,jn))*tmask(ji,2,jk) 
     742                           ENDIF 
    710743                        ENDIF 
    711                      ENDIF 
     744                     END DO 
    712745                  END DO 
    713                END DO 
    714                tsa(i1:i2,1,k1:k2,jn) = 0._wp 
    715             END DO 
    716          ENDIF 
    717          ! 
    718          ! Treatment of corners 
    719          !  
    720          ! East south 
    721          IF ((eastern_side).AND.((nbondj == -1).OR.(nbondj == 2))) THEN 
    722             tsa(nlci-1,2,:,:) = ptab(nlci-1,2,:,:) 
    723          ENDIF 
    724          ! East north 
    725          IF ((eastern_side).AND.((nbondj == 1).OR.(nbondj == 2))) THEN 
    726             tsa(nlci-1,nlcj-1,:,:) = ptab(nlci-1,nlcj-1,:,:) 
    727          ENDIF 
    728          ! West south 
    729          IF ((western_side).AND.((nbondj == -1).OR.(nbondj == 2))) THEN 
    730             tsa(2,2,:,:) = ptab(2,2,:,:) 
    731          ENDIF 
    732          ! West north 
    733          IF ((western_side).AND.((nbondj == 1).OR.(nbondj == 2))) THEN 
    734             tsa(2,nlcj-1,:,:) = ptab(2,nlcj-1,:,:) 
    735          ENDIF 
    736          ! 
     746                  tsa(i1:i2,1,k1:k2,jn) = 0._wp 
     747               END DO 
     748            ENDIF 
     749            ! 
     750            ! Treatment of corners 
     751            IF ((eastern_side).AND.((nbondj == -1).OR.(nbondj == 2)))   tsa(nlci-1,2,:,:) = ptab(nlci-1,2,:,:)            ! East south 
     752            IF ((eastern_side).AND.((nbondj ==  1).OR.(nbondj == 2)))   tsa(nlci-1,nlcj-1,:,:) = ptab(nlci-1,nlcj-1,:,:)  ! East north 
     753            IF ((western_side).AND.((nbondj == -1).OR.(nbondj == 2)))   tsa(2,2,:,:) = ptab(2,2,:,:)                      ! West south 
     754            IF ((western_side).AND.((nbondj ==  1).OR.(nbondj == 2)))   tsa(2,nlcj-1,:,:) = ptab(2,nlcj-1,:,:)            ! West north 
     755            ! 
     756         ENDIF 
    737757      ENDIF 
    738758      ! 
     
    759779         southern_side = (nb == 2).AND.(ndir == 1) 
    760780         northern_side = (nb == 2).AND.(ndir == 2) 
    761          IF(western_side)  hbdy_w(j1:j2) = ptab(i1,j1:j2) * tmask(i1,j1:j2,1) 
    762          IF(eastern_side)  hbdy_e(j1:j2) = ptab(i1,j1:j2) * tmask(i1,j1:j2,1) 
    763          IF(southern_side) hbdy_s(i1:i2) = ptab(i1:i2,j1) * tmask(i1:i2,j1,1) 
     781         !! clem ghost 
     782         IF(western_side)  hbdy_w(j1:j2) = ptab(i2,j1:j2) * tmask(i2,j1:j2,1) 
     783         IF(eastern_side)  hbdy_e(j1:j2) = ptab(i1,j1:j2) * tmask(i1,j1:j2,1) !clem previously i1 
     784         IF(southern_side) hbdy_s(i1:i2) = ptab(i1:i2,j2) * tmask(i1:i2,j2,1) !clem previously j1 
    764785         IF(northern_side) hbdy_n(i1:i2) = ptab(i1:i2,j1) * tmask(i1:i2,j1,1) 
    765786      ENDIF 
     
    854875         ELSEIF( bdy_tinterp == 2 ) THEN 
    855876            ztcoeff = zrhot * (  zt1        * (       zt1 - 1._wp)**2._wp & 
    856                &               - zt0        * (       zt0 - 1._wp)**2._wp )  
    857  
     877               &               - zt0        * (       zt0 - 1._wp)**2._wp ) 
    858878         ELSE 
    859879            ztcoeff = 1 
    860880         ENDIF 
    861          !    
    862          IF(western_side) THEN 
    863             ubdy_w(j1:j2) = ubdy_w(j1:j2) + ztcoeff * ptab(i1,j1:j2)   
    864          ENDIF 
    865          IF(eastern_side) THEN 
    866             ubdy_e(j1:j2) = ubdy_e(j1:j2) + ztcoeff * ptab(i1,j1:j2)   
    867          ENDIF 
    868          IF(southern_side) THEN 
    869             ubdy_s(i1:i2) = ubdy_s(i1:i2) + ztcoeff * ptab(i1:i2,j1)  
    870          ENDIF 
    871          IF(northern_side) THEN 
    872             ubdy_n(i1:i2) = ubdy_n(i1:i2) + ztcoeff * ptab(i1:i2,j1)  
    873          ENDIF 
     881         !! clem ghost    
     882         IF(western_side)   ubdy_w(j1:j2) = ubdy_w(j1:j2) + ztcoeff * ptab(i2,j1:j2)   
     883         IF(eastern_side)   ubdy_e(j1:j2) = ubdy_e(j1:j2) + ztcoeff * ptab(i1,j1:j2) !clem previously i1   
     884         IF(southern_side)  ubdy_s(i1:i2) = ubdy_s(i1:i2) + ztcoeff * ptab(i1:i2,j2) !clem previously j1 
     885         IF(northern_side)  ubdy_n(i1:i2) = ubdy_n(i1:i2) + ztcoeff * ptab(i1:i2,j1)  
    874886         !             
    875887         IF( bdy_tinterp == 0 .OR. bdy_tinterp == 2) THEN 
    876             IF(western_side) THEN 
    877                ubdy_w(j1:j2) = ubdy_w(j1:j2) / (zrhoy*e2u(i1,j1:j2)) * umask(i1,j1:j2,1) 
    878             ENDIF 
    879             IF(eastern_side) THEN 
    880                ubdy_e(j1:j2) = ubdy_e(j1:j2) / (zrhoy*e2u(i1,j1:j2)) * umask(i1,j1:j2,1) 
    881             ENDIF 
    882             IF(southern_side) THEN 
    883                ubdy_s(i1:i2) = ubdy_s(i1:i2) / (zrhoy*e2u(i1:i2,j1)) * umask(i1:i2,j1,1) 
    884             ENDIF 
    885             IF(northern_side) THEN 
    886                ubdy_n(i1:i2) = ubdy_n(i1:i2) / (zrhoy*e2u(i1:i2,j1)) * umask(i1:i2,j1,1) 
    887             ENDIF 
     888            IF(western_side)   ubdy_w(j1:j2) = ubdy_w(j1:j2) / (zrhoy*e2u(i2,j1:j2)) * umask(i2,j1:j2,1) 
     889            IF(eastern_side)   ubdy_e(j1:j2) = ubdy_e(j1:j2) / (zrhoy*e2u(i1,j1:j2)) * umask(i1,j1:j2,1) 
     890            IF(southern_side)  ubdy_s(i1:i2) = ubdy_s(i1:i2) / (zrhoy*e2u(i1:i2,j2)) * umask(i1:i2,j2,1) 
     891            IF(northern_side)  ubdy_n(i1:i2) = ubdy_n(i1:i2) / (zrhoy*e2u(i1:i2,j1)) * umask(i1:i2,j1,1) 
    888892         ENDIF 
    889893      ENDIF 
     
    927931            ztcoeff = 1 
    928932         ENDIF 
    929          ! 
    930          IF(western_side) THEN 
    931             vbdy_w(j1:j2) = vbdy_w(j1:j2) + ztcoeff * ptab(i1,j1:j2)   
    932          ENDIF 
    933          IF(eastern_side) THEN 
    934             vbdy_e(j1:j2) = vbdy_e(j1:j2) + ztcoeff * ptab(i1,j1:j2)   
    935          ENDIF 
    936          IF(southern_side) THEN 
    937             vbdy_s(i1:i2) = vbdy_s(i1:i2) + ztcoeff * ptab(i1:i2,j1) 
    938          ENDIF 
    939          IF(northern_side) THEN 
    940             vbdy_n(i1:i2) = vbdy_n(i1:i2) + ztcoeff * ptab(i1:i2,j1)  
    941          ENDIF 
     933         !! clem ghost 
     934         IF(western_side)   vbdy_w(j1:j2) = vbdy_w(j1:j2) + ztcoeff * ptab(i2,j1:j2)   
     935         IF(eastern_side)   vbdy_e(j1:j2) = vbdy_e(j1:j2) + ztcoeff * ptab(i1,j1:j2) !clem previously i1   
     936         IF(southern_side)  vbdy_s(i1:i2) = vbdy_s(i1:i2) + ztcoeff * ptab(i1:i2,j2) !clem previously j1 
     937         IF(northern_side)  vbdy_n(i1:i2) = vbdy_n(i1:i2) + ztcoeff * ptab(i1:i2,j1)  
    942938         !             
    943939         IF( bdy_tinterp == 0 .OR. bdy_tinterp == 2) THEN 
    944             IF(western_side) THEN 
    945                vbdy_w(j1:j2) = vbdy_w(j1:j2) / (zrhox*e1v(i1,j1:j2))   & 
    946                      &                                  * vmask(i1,j1:j2,1) 
    947             ENDIF 
    948             IF(eastern_side) THEN 
    949                vbdy_e(j1:j2) = vbdy_e(j1:j2) / (zrhox*e1v(i1,j1:j2))   & 
    950                      &                                  * vmask(i1,j1:j2,1) 
    951             ENDIF 
    952             IF(southern_side) THEN 
    953                vbdy_s(i1:i2) = vbdy_s(i1:i2) / (zrhox*e1v(i1:i2,j1))   & 
    954                      &                                  * vmask(i1:i2,j1,1) 
    955             ENDIF 
    956             IF(northern_side) THEN 
    957                vbdy_n(i1:i2) = vbdy_n(i1:i2) / (zrhox*e1v(i1:i2,j1))   & 
    958                      &                                  * vmask(i1:i2,j1,1) 
    959             ENDIF 
     940            IF(western_side)   vbdy_w(j1:j2) = vbdy_w(j1:j2) / (zrhox*e1v(i2,j1:j2)) * vmask(i2,j1:j2,1) 
     941            IF(eastern_side)   vbdy_e(j1:j2) = vbdy_e(j1:j2) / (zrhox*e1v(i1,j1:j2)) * vmask(i1,j1:j2,1) 
     942            IF(southern_side)  vbdy_s(i1:i2) = vbdy_s(i1:i2) / (zrhox*e1v(i1:i2,j2)) * vmask(i1:i2,j2,1) 
     943            IF(northern_side)  vbdy_n(i1:i2) = vbdy_n(i1:i2) / (zrhox*e1v(i1:i2,j1)) * vmask(i1:i2,j1,1) 
    960944         ENDIF 
    961945      ENDIF 
     
    991975         zat = zrhot * (  zt1**2._wp * (-2._wp*zt1 + 3._wp)    & 
    992976            &           - zt0**2._wp * (-2._wp*zt0 + 3._wp)    )  
    993          !  
    994          IF(western_side ) ubdy_w(j1:j2) = zat * ptab(i1,j1:j2)   
    995          IF(eastern_side ) ubdy_e(j1:j2) = zat * ptab(i1,j1:j2)  
    996          IF(southern_side) ubdy_s(i1:i2) = zat * ptab(i1:i2,j1)  
     977         !! clem ghost 
     978         IF(western_side ) ubdy_w(j1:j2) = zat * ptab(i2,j1:j2)   
     979         IF(eastern_side ) ubdy_e(j1:j2) = zat * ptab(i1,j1:j2) !clem previously i1  
     980         IF(southern_side) ubdy_s(i1:i2) = zat * ptab(i1:i2,j2) !clem previously j1 
    997981         IF(northern_side) ubdy_n(i1:i2) = zat * ptab(i1:i2,j1)  
    998982      ENDIF 
     
    10301014            &           - zt0**2._wp * (-2._wp*zt0 + 3._wp)    )  
    10311015         ! 
    1032          IF(western_side )   vbdy_w(j1:j2) = zat * ptab(i1,j1:j2)   
    1033          IF(eastern_side )   vbdy_e(j1:j2) = zat * ptab(i1,j1:j2)  
    1034          IF(southern_side)   vbdy_s(i1:i2) = zat * ptab(i1:i2,j1)  
     1016         IF(western_side )   vbdy_w(j1:j2) = zat * ptab(i2,j1:j2)   
     1017         IF(eastern_side )   vbdy_e(j1:j2) = zat * ptab(i1,j1:j2) !clem previously i1  
     1018         IF(southern_side)   vbdy_s(i1:i2) = zat * ptab(i1:i2,j2) !clem previously j1  
    10351019         IF(northern_side)   vbdy_n(i1:i2) = zat * ptab(i1:i2,j1)  
    10361020      ENDIF 
     
    10501034      INTEGER :: ji, jj, jk 
    10511035      LOGICAL :: western_side, eastern_side, northern_side, southern_side 
    1052       REAL(wp) :: ztmpmsk       
    10531036      !!----------------------------------------------------------------------   
    10541037      !     
     
    10601043         southern_side = (nb == 2).AND.(ndir == 1) 
    10611044         northern_side = (nb == 2).AND.(ndir == 2) 
    1062  
     1045         ! 
    10631046         DO jk = k1, k2 
    10641047            DO jj = j1, j2 
    10651048               DO ji = i1, i2 
    1066                   ! Get velocity mask at boundary edge points: 
    1067                   IF( western_side )   ztmpmsk = umask(ji    ,jj    ,1) 
    1068                   IF( eastern_side )   ztmpmsk = umask(nlci-2,jj    ,1) 
    1069                   IF( northern_side)   ztmpmsk = vmask(ji    ,nlcj-2,1) 
    1070                   IF( southern_side)   ztmpmsk = vmask(ji    ,2     ,1) 
    10711049                  ! 
    1072                   IF( ABS( ptab(ji,jj,jk) - tmask(ji,jj,jk) * e3t_0(ji,jj,jk) )*ztmpmsk > 1.D-2) THEN 
     1050                  IF( ABS( ptab(ji,jj,jk) - tmask(ji,jj,jk) * e3t_0(ji,jj,jk) ) > 1.D-2) THEN 
    10731051                     IF (western_side) THEN 
    10741052                        WRITE(numout,*) 'ERROR bathymetry merge at the western border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk 
  • branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90

    r8733 r8738  
    3434      !!   *** ROUTINE Agrif_Sponge_Tra *** 
    3535      !!--------------------------------------------- 
    36       REAL(wp) :: timecoeff 
     36      REAL(wp) :: zcoef 
    3737      !!--------------------------------------------- 
    3838      ! 
    3939#if defined SPONGE 
    40       timecoeff = REAL(Agrif_NbStepint(),wp)/Agrif_rhot() 
     40      zcoef = REAL(Agrif_NbStepint(),wp)/Agrif_rhot() 
    4141 
    4242      CALL Agrif_Sponge 
     
    4545      tabspongedone_tsn = .FALSE. 
    4646 
    47       CALL Agrif_Bc_Variable(tsn_sponge_id,calledweight=timecoeff,procname=interptsn_sponge) 
     47      CALL Agrif_Bc_Variable(tsn_sponge_id,calledweight=zcoef,procname=interptsn_sponge) 
    4848 
    4949      Agrif_UseSpecialValue = .FALSE. 
     
    5757      !!   *** ROUTINE Agrif_Sponge_dyn *** 
    5858      !!--------------------------------------------- 
    59       REAL(wp) :: timecoeff 
     59      REAL(wp) :: zcoef 
    6060      !!--------------------------------------------- 
    6161 
    6262#if defined SPONGE 
    63       timecoeff = REAL(Agrif_NbStepint(),wp)/Agrif_rhot() 
     63      zcoef = REAL(Agrif_NbStepint(),wp)/Agrif_rhot() 
    6464 
    6565      Agrif_SpecialValue=0. 
     
    6868      tabspongedone_u = .FALSE. 
    6969      tabspongedone_v = .FALSE.          
    70       CALL Agrif_Bc_Variable(un_sponge_id,calledweight=timecoeff,procname=interpun_sponge) 
     70      CALL Agrif_Bc_Variable(un_sponge_id,calledweight=zcoef,procname=interpun_sponge) 
    7171 
    7272      tabspongedone_u = .FALSE.