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 11413 for NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D – NEMO

Ignore:
Timestamp:
2019-08-06T17:59:22+02:00 (5 years ago)
Author:
gsamson
Message:

dev_r11265_ABL : see #2131

  • merge src and cfgs from HPC-13_IRRMANN_BDY_optimization branch @ r11402 with dev_r11265_ABL branch @ r11363
  • change ORCA2 results due to ice rheology "cleaning" (see commit r11377)
Location:
NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D
Files:
87 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/AGRIF_DEMO/EXPREF/1_namelist_cfg

    r11267 r11413  
    363363!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    364364!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    365 !!   namflo       float parameters                                      ("key_float") 
    366 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    367 !!   namdct       transports through some sections                      ("key_diadct") 
     365!!   namflo       float parameters                                      (default: OFF) 
     366!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     367!!   nam_diadct   transports through some sections                      (default: OFF) 
    368368!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    369369!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/AGRIF_DEMO/EXPREF/2_namelist_cfg

    r11267 r11413  
    312312!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    313313!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    314 !!   namflo       float parameters                                      ("key_float") 
    315 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    316 !!   namdct       transports through some sections                      ("key_diadct") 
     314!!   namflo       float parameters                                      (default: OFF) 
     315!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     316!!   nam_diadct   transports through some sections                      (default: OFF) 
    317317!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    318318!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/AGRIF_DEMO/EXPREF/3_namelist_cfg

    r11267 r11413  
    312312!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    313313!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    314 !!   namflo       float parameters                                      ("key_float") 
    315 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    316 !!   namdct       transports through some sections                      ("key_diadct") 
     314!!   namflo       float parameters                                      (default: OFF) 
     315!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     316!!   nam_diadct   transports through some sections                      (default: OFF) 
    317317!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    318318!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/AGRIF_DEMO/EXPREF/namelist_cfg

    r11275 r11413  
    362362!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    363363!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    364 !!   namflo       float parameters                                      ("key_float") 
    365 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    366 !!   namdct       transports through some sections                      ("key_diadct") 
     364!!   namflo       float parameters                                      (default: OFF) 
     365!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     366!!   nam_diadct   transports through some sections                      (default: OFF) 
    367367!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    368368!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/AMM12/EXPREF/context_nemo.xml

    r9930 r11413  
    66<context id="nemo"> 
    77<!-- $id$ --> 
     8    <variable_definition> 
     9    <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
     10       <variable id="ref_year" type="int"   > 1800 </variable> 
     11       <variable id="rau0"     type="float" > 1026.0 </variable> 
     12       <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
     13       <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
     14       <variable id="rhoic"    type="float" > 917.0 </variable> 
     15       <variable id="rhosn"    type="float" > 330.0 </variable> 
     16       <variable id="missval"  type="float" > 1.e20 </variable> 
     17    </variable_definition> 
    818<!-- Fields definition --> 
    919    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    1828     
    1929    <axis_definition> 
    20       <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" /> 
    21       <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" /> 
    22       <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" /> 
    23       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    24       <axis id="nfloat" long_name="Float number"      unit="-"                 /> 
    25       <axis id="icbcla"  long_name="Iceberg class"      unit="1"               /> 
    26       <axis id="ncatice" long_name="Ice category"       unit="1"               /> 
    27       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            /> 
    28       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            /> 
     30      <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
     31      <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
     32      <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
     33      <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
     34      <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
     35      <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
     36      <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
     37      <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
     38      <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    2939    </axis_definition> 
    3040  
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/AMM12/EXPREF/namelist_cfg

    r11268 r11413  
    350350!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    351351!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    352 !!   namflo       float parameters                                      ("key_float") 
    353 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    354 !!   namdct       transports through some sections                      ("key_diadct") 
     352!!   namflo       float parameters                                      (default: OFF) 
     353!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     354!!   nam_diadct   transports through some sections                      (default: OFF) 
    355355!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    356356!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/C1D_PAPA/EXPREF/namelist_cfg

    r11275 r11413  
    418418!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    419419!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    420 !!   namflo       float parameters                                      ("key_float") 
    421 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    422 !!   namdct       transports through some sections                      ("key_diadct") 
     420!!   namflo       float parameters                                      (default: OFF) 
     421!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     422!!   nam_diadct   transports through some sections                      (default: OFF) 
    423423!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    424424!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
     
    443443/ 
    444444!----------------------------------------------------------------------- 
    445 &namflo        !   float parameters                                     ("key_float") 
    446 !----------------------------------------------------------------------- 
    447 / 
    448 !----------------------------------------------------------------------- 
    449 &nam_diaharm   !   Harmonic analysis of tidal constituents              ("key_diaharm") 
    450 !----------------------------------------------------------------------- 
    451 / 
    452 !----------------------------------------------------------------------- 
    453 &namdct        ! transports through some sections                       ("key_diadct") 
     445&namflo        !   float parameters                                     (default: OFF) 
     446!----------------------------------------------------------------------- 
     447/ 
     448!----------------------------------------------------------------------- 
     449&nam_diaharm   !   Harmonic analysis of tidal constituents              (default: OFF) 
     450!----------------------------------------------------------------------- 
     451/ 
     452!----------------------------------------------------------------------- 
     453&nam_diadct    ! transports through some sections                       (default: OFF) 
    454454!----------------------------------------------------------------------- 
    455455/ 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/C1D_PAPA/MY_SRC/usrdef_nam.F90

    r10072 r11413  
    3939CONTAINS 
    4040 
    41    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     41   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4242      !!---------------------------------------------------------------------- 
    4343      !!                     ***  ROUTINE dom_nam  *** 
     
    5151      !! ** input   : - namusr_def namelist found in namelist_cfg 
    5252      !!---------------------------------------------------------------------- 
    53       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    5453      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    5554      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    5756      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
    5857      ! 
    59       INTEGER ::   ios, ii   ! Local integer 
     58      INTEGER ::   ios   ! Local integer 
    6059      !! 
    6160      NAMELIST/namusr_def/ rn_bathy 
    6261      !!---------------------------------------------------------------------- 
    6362      ! 
    64       ii = 1 
    65       ! 
    6663      REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6764      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
    68 902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
     65902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    6966      ! 
    70       WRITE( ldnam(:), namusr_def ) 
     67      IF(lwm)   WRITE( numond, namusr_def ) 
    7168      ! 
    7269      cd_cfg = 'C1D'               ! name & resolution (not used) 
     
    7774      kpj = 3 
    7875      kpk = 75  
    79       ! 
    80       !                             ! control print 
    81       WRITE(ldtxt(ii),*) '   '                                                                            ;   ii = ii + 1 
    82       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'     ;   ii = ii + 1 
    83       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                   ;   ii = ii + 1 
    84       WRITE(ldtxt(ii),*) '   Namelist namusr_def : C1 case'                                               ;   ii = ii + 1 
    85       WRITE(ldtxt(ii),*) '      type of vertical coordinate : '                                           ;   ii = ii + 1 
    86       WRITE(ldtxt(ii),*) '         z-coordinate flag                     ln_zco = ', ln_zco               ;   ii = ii + 1 
    87       WRITE(ldtxt(ii),*) '         z-partial-step coordinate flag        ln_zps = ', ln_zps               ;   ii = ii + 1 
    88       WRITE(ldtxt(ii),*) '         s-coordinate flag                     ln_sco = ', ln_sco               ;   ii = ii + 1 
    89       WRITE(ldtxt(ii),*) '      C1D domain = 3 x 3 x75 grid-points                '                       ;   ii = ii + 1 
    90       WRITE(ldtxt(ii),*) '         resulting global domain size :        jpiglo = ', kpi                  ;   ii = ii + 1 
    91       WRITE(ldtxt(ii),*) '                                               jpjglo = ', kpj                  ;   ii = ii + 1 
    92       WRITE(ldtxt(ii),*) '                                               jpkglo = ', kpk                  ;   ii = ii + 1 
    93  
    94       ! 
    9576      !                             ! Set the lateral boundary condition of the global domain 
    9677      kperio =  7                   ! C1D configuration : 3x3 basin with cyclic Est-West and Norht-South condition 
    9778      ! 
    98       WRITE(ldtxt(ii),*) '   Lateral boundary condition of the global domain'                           ;   ii = ii + 1 
    99       WRITE(ldtxt(ii),*) '      C1D : closed basin                 jperio = ', kperio                   ;   ii = ii + 1 
     79      !                             ! control print 
     80      IF(lwp) THEN 
     81         WRITE(numout,*) '   ' 
     82         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     83         WRITE(numout,*) '~~~~~~~~~~~ ' 
     84         WRITE(numout,*) '   Namelist namusr_def : C1 case' 
     85         WRITE(numout,*) '      type of vertical coordinate : ' 
     86         WRITE(numout,*) '         z-coordinate flag                     ln_zco = ', ln_zco 
     87         WRITE(numout,*) '         z-partial-step coordinate flag        ln_zps = ', ln_zps 
     88         WRITE(numout,*) '         s-coordinate flag                     ln_sco = ', ln_sco 
     89         WRITE(numout,*) '      C1D domain = 3 x 3 x75 grid-points                ' 
     90         WRITE(numout,*) '         resulting global domain size :        jpiglo = ', kpi 
     91         WRITE(numout,*) '                                               jpjglo = ', kpj 
     92         WRITE(numout,*) '                                               jpkglo = ', kpk 
     93         WRITE(numout,*) '   Lateral boundary condition of the global domain' 
     94         WRITE(numout,*) '      C1D : closed basin                       jperio = ', kperio 
     95      ENDIF 
    10096      ! 
    10197   END SUBROUTINE usr_def_nam 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/GYRE_BFM/EXPREF/context_nemo.xml

    r9930 r11413  
    66<context id="nemo"> 
    77<!-- $id$ --> 
     8    <variable_definition> 
     9    <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
     10       <variable id="ref_year" type="int"   > 1800 </variable> 
     11       <variable id="rau0"     type="float" > 1026.0 </variable> 
     12       <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
     13       <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
     14       <variable id="rhoic"    type="float" > 917.0 </variable> 
     15       <variable id="rhosn"    type="float" > 330.0 </variable> 
     16       <variable id="missval"  type="float" > 1.e20 </variable> 
     17    </variable_definition> 
    818<!-- Fields definition --> 
    919    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    1929     
    2030    <axis_definition> 
    21       <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" /> 
    22       <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" /> 
    23       <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" /> 
    24       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    25       <axis id="nfloat" long_name="Float number"      unit="-"                 /> 
    26       <axis id="icbcla"  long_name="Iceberg class"      unit="1"               /> 
    27       <axis id="ncatice" long_name="Ice category"       unit="1"               /> 
    28       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            /> 
    29       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            /> 
     31      <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
     32      <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
     33      <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
     34      <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
     35      <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
     36      <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
     37      <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
     38      <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
     39      <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    3040    </axis_definition> 
    3141  
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/GYRE_BFM/EXPREF/namelist_cfg

    r10072 r11413  
    227227!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    228228!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    229 !!   namflo       float parameters                                      ("key_float") 
    230 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    231 !!   namdct       transports through some sections                      ("key_diadct") 
     229!!   namflo       float parameters                                      (default: OFF) 
     230!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     231!!   nam_diadct   transports through some sections                      (default: OFF) 
    232232!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    233233!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/GYRE_PISCES/EXPREF/context_nemo.xml

    r9930 r11413  
    66<context id="nemo"> 
    77<!-- $id$ --> 
     8    <variable_definition> 
     9    <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
     10       <variable id="ref_year" type="int"   > 1800 </variable> 
     11       <variable id="rau0"     type="float" > 1026.0 </variable> 
     12       <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
     13       <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
     14       <variable id="rhoic"    type="float" > 917.0 </variable> 
     15       <variable id="rhosn"    type="float" > 330.0 </variable> 
     16       <variable id="missval"  type="float" > 1.e20 </variable> 
     17    </variable_definition> 
    818<!-- Fields definition --> 
    919    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  NEMO ocean dynamics                     --> 
     
    1929     
    2030    <axis_definition> 
    21       <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" /> 
    22       <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" /> 
    23       <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" /> 
    24       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    25       <axis id="nfloat" long_name="Float number"      unit="-"                 /> 
    26       <axis id="icbcla"  long_name="Iceberg class"      unit="1"               /> 
    27       <axis id="ncatice" long_name="Ice category"       unit="1"               /> 
    28       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            /> 
    29       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            /> 
     31      <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
     32      <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
     33      <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
     34      <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
     35      <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
     36      <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
     37      <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
     38      <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
     39      <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    3040    </axis_definition> 
    3141  
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/GYRE_PISCES/EXPREF/namelist_cfg

    r10072 r11413  
    221221!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    222222!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    223 !!   namflo       float parameters                                      ("key_float") 
    224 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    225 !!   namdct       transports through some sections                      ("key_diadct") 
     223!!   namflo       float parameters                                      (default: OFF) 
     224!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     225!!   nam_diadct   transports through some sections                      (default: OFF) 
    226226!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    227227!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_ICE_ABL/cpp_ORCA2_ICE_ABL.fcm

    r11306 r11413  
    1 bld::tool::fppkeys   key_mpp_mpi key_iomput key_si3 
     1bld::tool::fppkeys   key_mpp_mpi key_si3 key_iomput 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_ICE_PISCES/EXPREF/context_nemo.xml

    r11275 r11413  
    66<context id="nemo"> 
    77<!-- $id$ --> 
     8    <variable_definition> 
     9    <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
     10       <variable id="ref_year" type="int"   > 1800 </variable> 
     11       <variable id="rau0"     type="float" > 1026.0 </variable> 
     12       <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
     13       <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
     14       <variable id="rhoic"    type="float" > 917.0 </variable> 
     15       <variable id="rhosn"    type="float" > 330.0 </variable> 
     16       <variable id="missval"  type="float" > 1.e20 </variable> 
     17    </variable_definition> 
    818<!-- Fields definition --> 
    919    <field_definition src="./field_def_nemo-oce.xml"/>    <!--  NEMO ocean dynamics     -->  
     
    2232     
    2333    <axis_definition> 
    24       <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" /> 
    25       <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" /> 
    26       <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" /> 
    27       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    28       <axis id="profsed" long_name="Vertical S levels" unit="cm" positive="down" /> 
    29       <axis id="nfloat" long_name="Float number"      unit="-"                 /> 
    30       <axis id="icbcla"  long_name="Iceberg class"      unit="1"               /> 
    31       <axis id="ncatice" long_name="Ice category"       unit="1"               /> 
    32       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            /> 
    33       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            /> 
     34      <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
     35      <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
     36      <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
     37      <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
     38      <axis id="profsed" long_name="Vertical S levels" unit="cm" positive="down"/> 
     39      <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
     40      <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
     41      <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
     42      <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
     43      <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    3444      <!-- ABL vertical axis definition --> 
    3545      <axis id="ght_abl" long_name="ABL Vertical T levels" unit="m" positive="up"   /> 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_ICE_PISCES/EXPREF/file_def_nemo-ice.xml

    r10911 r11413  
    7878       <field field_ref="vfxice"           name="vfxice" /> 
    7979       <field field_ref="vfxsnw"           name="vfxsnw" /> 
    80         
     80 
    8181       <!-- categories --> 
    8282       <field field_ref="icemask_cat"      name="simskcat"/> 
     
    9393     <file id="file22" name_suffix="_SBC_scalar" description="scalar variables" enabled=".true." > 
    9494       <!-- global contents --> 
    95        <field field_ref="ibgvol_tot"     grid_ref="grid_1point"   name="ibgvol_tot"   /> 
    96        <field field_ref="sbgvol_tot"     grid_ref="grid_1point"   name="sbgvol_tot"   /> 
    97        <field field_ref="ibgarea_tot"    grid_ref="grid_1point"   name="ibgarea_tot"  /> 
    98        <field field_ref="ibgsalt_tot"    grid_ref="grid_1point"   name="ibgsalt_tot"  /> 
    99        <field field_ref="ibgheat_tot"    grid_ref="grid_1point"   name="ibgheat_tot"  /> 
    100        <field field_ref="sbgheat_tot"    grid_ref="grid_1point"   name="sbgheat_tot"  /> 
     95       <field field_ref="ibgvol_tot"     name="ibgvol_tot"   /> 
     96       <field field_ref="sbgvol_tot"     name="sbgvol_tot"   /> 
     97       <field field_ref="ibgarea_tot"    name="ibgarea_tot"  /> 
     98       <field field_ref="ibgsalt_tot"    name="ibgsalt_tot"  /> 
     99       <field field_ref="ibgheat_tot"    name="ibgheat_tot"  /> 
     100       <field field_ref="sbgheat_tot"    name="sbgheat_tot"  /> 
    101101        
    102102       <!-- global drifts (conservation checks) --> 
    103        <field field_ref="ibgvolume"      grid_ref="grid_1point"   name="ibgvolume"    /> 
    104        <field field_ref="ibgsaltco"      grid_ref="grid_1point"   name="ibgsaltco"    /> 
    105        <field field_ref="ibgheatco"      grid_ref="grid_1point"   name="ibgheatco"    /> 
    106        <field field_ref="ibgheatfx"      grid_ref="grid_1point"   name="ibgheatfx"    /> 
     103       <field field_ref="ibgvolume"      name="ibgvolume"    /> 
     104       <field field_ref="ibgsaltco"      name="ibgsaltco"    /> 
     105       <field field_ref="ibgheatco"      name="ibgheatco"    /> 
     106       <field field_ref="ibgheatfx"      name="ibgheatfx"    /> 
    107107        
    108108       <!-- global forcings  --> 
    109        <field field_ref="ibgfrcvoltop"   grid_ref="grid_1point"   name="ibgfrcvoltop" /> 
    110        <field field_ref="ibgfrcvolbot"   grid_ref="grid_1point"   name="ibgfrcvolbot" /> 
    111        <field field_ref="ibgfrctemtop"   grid_ref="grid_1point"   name="ibgfrctemtop" /> 
    112        <field field_ref="ibgfrctembot"   grid_ref="grid_1point"   name="ibgfrctembot" /> 
    113        <field field_ref="ibgfrcsal"      grid_ref="grid_1point"   name="ibgfrcsal"    /> 
    114        <field field_ref="ibgfrchfxtop"   grid_ref="grid_1point"   name="ibgfrchfxtop" /> 
    115        <field field_ref="ibgfrchfxbot"   grid_ref="grid_1point"   name="ibgfrchfxbot" /> 
     109       <field field_ref="ibgfrcvoltop"   name="ibgfrcvoltop" /> 
     110       <field field_ref="ibgfrcvolbot"   name="ibgfrcvolbot" /> 
     111       <field field_ref="ibgfrctemtop"   name="ibgfrctemtop" /> 
     112       <field field_ref="ibgfrctembot"   name="ibgfrctembot" /> 
     113       <field field_ref="ibgfrcsal"      name="ibgfrcsal"    /> 
     114       <field field_ref="ibgfrchfxtop"   name="ibgfrchfxtop" /> 
     115       <field field_ref="ibgfrchfxbot"   name="ibgfrchfxbot" /> 
    116116     </file> 
    117117      
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_ICE_PISCES/EXPREF/file_def_nemo-oce.xml

    r9990 r11413  
    3737     <field field_ref="wspd"         name="windsp"   /> 
    3838     <field field_ref="precip"       name="precip"   /> 
    39      <field field_ref="berg_melt_qlat"  name="berg_melt_qlat" /> 
    4039     <!-- ice and snow --> 
    4140     <field field_ref="snowpre" /> 
     
    8281        <file id="file15" name_suffix="_scalar" description="scalar variables" > 
    8382          <!-- global drifts (conservation checks) --> 
    84           <field field_ref="bgtemper"     grid_ref="grid_1point"   name="bgtemper"    /> 
    85           <field field_ref="bgsaline"     grid_ref="grid_1point"   name="bgsaline"    /> 
    86           <field field_ref="bgheatco"     grid_ref="grid_1point"   name="bgheatco"    /> 
    87           <field field_ref="bgheatfx"     grid_ref="grid_1point"   name="bgheatfx"    /> 
    88           <field field_ref="bgsaltco"     grid_ref="grid_1point"   name="bgsaltco"    /> 
    89           <field field_ref="bgvolssh"     grid_ref="grid_1point"   name="bgvolssh"    /> 
    90           <field field_ref="bgvole3t"     grid_ref="grid_1point"   name="bgvole3t"    /> 
     83          <field field_ref="bgtemper"     name="bgtemper"    /> 
     84          <field field_ref="bgsaline"     name="bgsaline"    /> 
     85          <field field_ref="bgheatco"     name="bgheatco"    /> 
     86          <field field_ref="bgheatfx"     name="bgheatfx"    /> 
     87          <field field_ref="bgsaltco"     name="bgsaltco"    /> 
     88          <field field_ref="bgvolssh"     name="bgvolssh"    /> 
     89          <field field_ref="bgvole3t"     name="bgvole3t"    /> 
    9190 
    9291          <!-- global surface forcings  --> 
    93           <field field_ref="bgfrcvol"     grid_ref="grid_1point"   name="bgfrcvol"    /> 
    94           <field field_ref="bgfrctem"     grid_ref="grid_1point"   name="bgfrctem"    /> 
    95           <field field_ref="bgfrchfx"     grid_ref="grid_1point"   name="bgfrchfx"    /> 
    96           <field field_ref="bgfrcsal"     grid_ref="grid_1point"   name="bgfrcsal"    /> 
     92          <field field_ref="bgfrcvol"     name="bgfrcvol"    /> 
     93          <field field_ref="bgfrctem"     name="bgfrctem"    /> 
     94          <field field_ref="bgfrchfx"     name="bgfrchfx"    /> 
     95          <field field_ref="bgfrcsal"     name="bgfrcsal"    /> 
    9796        </file> 
    9897 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_ICE_PISCES/EXPREF/file_def_nemo-pisces.xml

    r9909 r11413  
    1414 
    1515        <file id="file31" name_suffix="_bioscalar" description="pisces sms variables" > 
    16           <field field_ref="tdenit"   name="tdenit"   grid_ref="grid_1point" unit="TgN/yr" operation="instant" > tdenit * 14. * 86400. * 365. / 1e12 </field> 
    17           <field field_ref="tnfix"    name="tnfix"    grid_ref="grid_1point" unit="TgN/yr" operation="instant" > tnfix * 14. * 86400. * 365. / 1e12 </field> 
    18           <field field_ref="tcflx"    name="tcflx"    grid_ref="grid_1point" unit="PgC/yr" operation="instant" > tcflx * -1. * 12. * 86400. * 365. / 1e15 </field> 
    19           <field field_ref="tcflxcum" name="tcflxcum" grid_ref="grid_1point" unit="PgC"    operation="instant" > tcflxcum * -1. * 12. / 1e15 </field> 
    20           <field field_ref="tcexp"    name="tcexp"    grid_ref="grid_1point" unit="PgC/yr" operation="instant" > tcexp * 12. * 86400. * 365. / 1e15 </field> 
    21           <field field_ref="tintpp"   name="tintpp"   grid_ref="grid_1point" unit="PgC/yr" operation="instant" > tintpp * 12. * 86400. * 365. / 1e15 </field> 
    22           <field field_ref="pno3tot"  name="pno3tot"  grid_ref="grid_1point" unit="umolN"  > pno3tot * 16. / 122. * 1e6 </field> 
    23           <field field_ref="ppo4tot"  name="ppo4tot"  grid_ref="grid_1point" unit="umolP"  > ppo4tot * 1. / 122. * 1e6 </field> 
    24           <field field_ref="psiltot"  name="psiltot"  grid_ref="grid_1point" unit="umolC"  > psiltot * 1e6  </field> 
    25           <field field_ref="palktot"  name="palktot"  grid_ref="grid_1point" unit="umolC"  > palktot * 1e6  </field> 
    26           <field field_ref="pfertot"  name="pfertot"  grid_ref="grid_1point" unit="nmolFe" > pfertot * 1e9  </field> 
     16          <field field_ref="tdenit"   name="tdenit"    unit="TgN/yr" operation="instant" > tdenit * 14. * 86400. * 365. / 1e12 </field> 
     17          <field field_ref="tnfix"    name="tnfix"    unit="TgN/yr" operation="instant" > tnfix * 14. * 86400. * 365. / 1e12 </field> 
     18          <field field_ref="tcflx"    name="tcflx"    unit="PgC/yr" operation="instant" > tcflx * -1. * 12. * 86400. * 365. / 1e15 </field> 
     19          <field field_ref="tcflxcum" name="tcflxcum" unit="PgC"    operation="instant" > tcflxcum * -1. * 12. / 1e15 </field> 
     20          <field field_ref="tcexp"    name="tcexp"    unit="PgC/yr" operation="instant" > tcexp * 12. * 86400. * 365. / 1e15 </field> 
     21          <field field_ref="tintpp"   name="tintpp"    unit="PgC/yr" operation="instant" > tintpp * 12. * 86400. * 365. / 1e15 </field> 
     22          <field field_ref="pno3tot"  name="pno3tot"  unit="umolN"  > pno3tot * 16. / 122. * 1e6 </field> 
     23          <field field_ref="ppo4tot"  name="ppo4tot"  unit="umolP"  > ppo4tot * 1. / 122. * 1e6 </field> 
     24          <field field_ref="psiltot"  name="psiltot"  unit="umolC"  > psiltot * 1e6  </field> 
     25          <field field_ref="palktot"  name="palktot"  unit="umolC"  > palktot * 1e6  </field> 
     26          <field field_ref="pfertot"  name="pfertot"  unit="nmolFe" > pfertot * 1e9  </field> 
    2727        </file> 
    2828 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg

    r11275 r11413  
    390390!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    391391!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    392 !!   namflo       float parameters                                      ("key_float") 
    393 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    394 !!   namdct       transports through some sections                      ("key_diadct") 
     392!!   namflo       float parameters                                      (default: OFF) 
     393!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     394!!   nam_diadct   transports through some sections                      (default: OFF) 
    395395!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    396396!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_OFF_PISCES/EXPREF/context_nemo.xml

    r10226 r11413  
    66<context id="nemo"> 
    77<!-- $id$ --> 
     8    <variable_definition> 
     9    <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
     10       <variable id="ref_year" type="int"   > 1800 </variable> 
     11       <variable id="rau0"     type="float" > 1026.0 </variable> 
     12       <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
     13       <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
     14       <variable id="rhoic"    type="float" > 917.0 </variable> 
     15       <variable id="rhosn"    type="float" > 330.0 </variable> 
     16       <variable id="missval"  type="float" > 1.e20 </variable> 
     17    </variable_definition> 
    818<!-- Fields definition --> 
    919    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  Ocean biology                     --> 
     
    1929     
    2030    <axis_definition> 
    21       <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" /> 
    22       <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" /> 
    23       <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" /> 
    24       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    25       <axis id="profsed" long_name="Vertical S levels" unit="cm" positive="down" /> 
    26       <axis id="nfloat" long_name="Float number"      unit="-"                 /> 
    27       <axis id="icbcla"  long_name="Iceberg class"      unit="1"               /> 
    28       <axis id="ncatice" long_name="Ice category"       unit="1"               /> 
    29       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            /> 
    30       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            /> 
     31      <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
     32      <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
     33      <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
     34      <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
     35      <axis id="profsed" long_name="Vertical S levels" unit="cm" positive="down"/> 
     36      <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
     37      <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
     38      <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
     39      <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
     40      <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    3141    </axis_definition> 
    3242  
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_OFF_PISCES/EXPREF/file_def_nemo.xml

    r10458 r11413  
    1919      <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."> <!-- 1d files --> 
    2020        <file id="file1" name_suffix="_bioscalar" description="pisces sms variables" > 
    21            <field field_ref="tdenit"   name="tdenit"   grid_ref="grid_1point" unit="TgN/yr" operation="instant" > tdenit * 14. * 86400. * 365. / 1e12 </field> 
    22            <field field_ref="tnfix"    name="tnfix"    grid_ref="grid_1point" unit="TgN/yr" operation="instant" > tnfix * 14. * 86400. * 365. / 1e12 </field> 
    23            <field field_ref="tcflx"    name="tcflx"    grid_ref="grid_1point" unit="PgC/yr" operation="instant" > tcflx * -1. * 12. * 86400. * 365. / 1e15 </field> 
    24            <field field_ref="tcflxcum" name="tcflxcum" grid_ref="grid_1point" unit="PgC"    operation="instant" > tcflxcum * -1. * 12. / 1e15 </field> 
    25            <field field_ref="tcexp"    name="tcexp"    grid_ref="grid_1point" unit="PgC/yr" operation="instant" > tcexp * 12. * 86400. * 365. / 1e15 </field> 
    26            <field field_ref="tintpp"   name="tintpp"   grid_ref="grid_1point" unit="PgC/yr" operation="instant" > tintpp * 12. * 86400. * 365. / 1e15 </field> 
    27            <field field_ref="pno3tot"  name="pno3tot"  grid_ref="grid_1point" unit="umolN"  > pno3tot * 16. / 122. * 1e6 </field> 
    28            <field field_ref="ppo4tot"  name="ppo4tot"  grid_ref="grid_1point" unit="umolP"  > ppo4tot * 1. / 122. * 1e6 </field> 
    29            <field field_ref="psiltot"  name="psiltot"  grid_ref="grid_1point" unit="umolC"  > psiltot * 1e6  </field> 
    30            <field field_ref="palktot"  name="palktot"  grid_ref="grid_1point" unit="umolC"  > palktot * 1e6  </field> 
    31            <field field_ref="pfertot"  name="pfertot"  grid_ref="grid_1point" unit="nmolFe" > pfertot * 1e9  </field> 
     21           <field field_ref="tdenit"   name="tdenit"    unit="TgN/yr" operation="instant" > tdenit * 14. * 86400. * 365. / 1e12 </field> 
     22           <field field_ref="tnfix"    name="tnfix"    unit="TgN/yr" operation="instant" > tnfix * 14. * 86400. * 365. / 1e12 </field> 
     23           <field field_ref="tcflx"    name="tcflx"    unit="PgC/yr" operation="instant" > tcflx * -1. * 12. * 86400. * 365. / 1e15 </field> 
     24           <field field_ref="tcflxcum" name="tcflxcum" unit="PgC"    operation="instant" > tcflxcum * -1. * 12. / 1e15 </field> 
     25           <field field_ref="tcexp"    name="tcexp"    unit="PgC/yr" operation="instant" > tcexp * 12. * 86400. * 365. / 1e15 </field> 
     26           <field field_ref="tintpp"   name="tintpp"    unit="PgC/yr" operation="instant" > tintpp * 12. * 86400. * 365. / 1e15 </field> 
     27           <field field_ref="pno3tot"  name="pno3tot"  unit="umolN"  > pno3tot * 16. / 122. * 1e6 </field> 
     28           <field field_ref="ppo4tot"  name="ppo4tot"  unit="umolP"  > ppo4tot * 1. / 122. * 1e6 </field> 
     29           <field field_ref="psiltot"  name="psiltot"  unit="umolC"  > psiltot * 1e6  </field> 
     30           <field field_ref="palktot"  name="palktot"  unit="umolC"  > palktot * 1e6  </field> 
     31           <field field_ref="pfertot"  name="pfertot"  unit="nmolFe" > pfertot * 1e9  </field> 
    3232        </file> 
    3333      </file_group> 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_OFF_PISCES/EXPREF/namelist_cfg

    r11267 r11413  
    376376!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    377377!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    378 !!   namflo       float parameters                                      ("key_float") 
    379 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    380 !!   namdct       transports through some sections                      ("key_diadct") 
     378!!   namflo       float parameters                                      (default: OFF) 
     379!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     380!!   nam_diadct   transports through some sections                      (default: OFF) 
    381381!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    382382!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
     
    401401/ 
    402402!----------------------------------------------------------------------- 
    403 &namflo        !   float parameters                                     ("key_float") 
    404 !----------------------------------------------------------------------- 
    405 / 
    406 !----------------------------------------------------------------------- 
    407 &nam_diaharm   !   Harmonic analysis of tidal constituents              ("key_diaharm") 
    408 !----------------------------------------------------------------------- 
    409 / 
    410 !----------------------------------------------------------------------- 
    411 &namdct        ! transports through some sections                       ("key_diadct") 
     403&namflo        !   float parameters                                     (default: OFF) 
     404!----------------------------------------------------------------------- 
     405/ 
     406!----------------------------------------------------------------------- 
     407&nam_diaharm   !   Harmonic analysis of tidal constituents              (default: OFF) 
     408!----------------------------------------------------------------------- 
     409/ 
     410!----------------------------------------------------------------------- 
     411&nam_diadct    !   transports through some sections                     (default: OFF) 
    412412!----------------------------------------------------------------------- 
    413413/ 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_OFF_TRC/EXPREF/context_nemo.xml

    r9930 r11413  
    66<context id="nemo"> 
    77<!-- $id$ --> 
     8    <variable_definition> 
     9    <!-- Year of time origin for NetCDF files; defaults to 1800 --> 
     10       <variable id="ref_year" type="int"   > 1800 </variable> 
     11       <variable id="rau0"     type="float" > 1026.0 </variable> 
     12       <variable id="cpocean"  type="float" > 3991.86795711963 </variable> 
     13       <variable id="convSpsu" type="float" > 0.99530670233846  </variable> 
     14       <variable id="rhoic"    type="float" > 917.0 </variable> 
     15       <variable id="rhosn"    type="float" > 330.0 </variable> 
     16       <variable id="missval"  type="float" > 1.e20 </variable> 
     17    </variable_definition> 
    818<!-- Fields definition --> 
    919    <field_definition src="./field_def_nemo-oce.xml"/>   <!--  Ocean biology                     --> 
     
    1929     
    2030    <axis_definition> 
    21       <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" /> 
    22       <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" /> 
    23       <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" /> 
    24       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" /> 
    25       <axis id="nfloat" long_name="Float number"      unit="-"                 /> 
    26       <axis id="icbcla"  long_name="Iceberg class"      unit="1"               /> 
    27       <axis id="ncatice" long_name="Ice category"       unit="1"               /> 
    28       <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            /> 
    29       <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            /> 
     31      <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" /> 
     32      <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" /> 
     33      <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" /> 
     34      <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" /> 
     35      <axis id="nfloat"  long_name="Float number"      unit="-"                 /> 
     36      <axis id="icbcla"  long_name="Iceberg class"     unit="1"                 /> 
     37      <axis id="ncatice" long_name="Ice category"      unit="1"                 /> 
     38      <axis id="iax_20C" long_name="20 degC isotherm"  unit="degC"              /> 
     39      <axis id="iax_28C" long_name="28 degC isotherm"  unit="degC"              /> 
    3040    </axis_definition> 
    3141  
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_OFF_TRC/EXPREF/namelist_cfg

    r11267 r11413  
    374374!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    375375!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    376 !!   namflo       float parameters                                      ("key_float") 
     376!!   namflo       float parameters                                      (default: OFF) 
    377377!!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    378378!!   namdct       transports through some sections                      ("key_diadct") 
     
    399399/ 
    400400!----------------------------------------------------------------------- 
    401 &namflo        !   float parameters                                     ("key_float") 
     401&namflo        !   float parameters                                     (default: OFF) 
    402402!----------------------------------------------------------------------- 
    403403/ 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ORCA2_SAS_ICE/EXPREF/namelist_cfg

    r11275 r11413  
    5858!----------------------------------------------------------------------- 
    5959   nn_fsbc     = 1         !  frequency of SBC module call 
     60                           !     (also = the frequency of sea-ice & iceberg model call) 
     61                     ! Type of air-sea fluxes  
    6062   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk ) 
    61    nn_ice      = 2         !  =2  sea-ice model                         ("key_SI3" or "key_cice") 
     63   ln_abl      = .false.   !  ABL  formulation                          (T => fill namsbc_abl ) 
     64                     ! Sea-ice : 
     65   nn_ice      = 2         !  =2 or 3 automatically for SI3 or CICE    ("key_si3" or "key_cice") 
     66                           !          except in AGRIF zoom where it has to be specified 
    6267/ 
    6368!----------------------------------------------------------------------- 
     
    176181!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    177182!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    178 !!   namflo       float parameters                                      ("key_float") 
    179 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    180 !!   namdct       transports through some sections                      ("key_diadct") 
     183!!   namflo       float parameters                                      (default: OFF) 
     184!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     185!!   nam_diadct   transports through some sections                      (default: OFF) 
    181186!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    182187!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SHARED/domain_def_nemo.xml

    r9930 r11413  
    1010     </domain> 
    1111 
    12      <domain id="1point" domain_ref="grid_T" > 
    13        <zoom_domain ibegin="1" jbegin="1" ni="1" nj="1"/> 
    14      </domain> 
    1512     <!--   Eq section --> 
    1613     <domain id="EqT" domain_ref="grid_T" > <zoom_domain id="EqT"/> </domain> 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SHARED/field_def_nemo-ice.xml

    r11363 r11413  
    3232  
    3333     <!-- general fields --> 
    34           <field id="icemass"      long_name="Sea-ice mass per area"                                   standard_name="sea_ice_amount"                            unit="kg/m2"/> 
     34          <field id="icemass"      long_name="Sea-ice mass per gridcell area"                          standard_name="sea_ice_amount"                            unit="kg/m2"/> 
    3535          <field id="snwmass"      long_name="Snow mass per area"                                      standard_name="liquid_water_content_of_surface_snow"      unit="kg/m2"/> 
    36           <field id="iceconc"      long_name="Sea-ice area fraction"                                   standard_name="sea_ice_area_fraction"                     unit=""    /> 
    37           <field id="icevolu"      long_name="Sea-ice volume per area"                                 standard_name="sea_ice_thickness"                         unit="m"   /> 
    38           <field id="icethic"      long_name="Sea-ice thickness per area"                              standard_name="sea_ice_thickness"                         unit="m"   /> 
    39           <field id="snwthic"      long_name="Snow thickness per area"                                 standard_name="snow_thickness"                            unit="m"   /> 
    40           <field id="icebrv"       long_name="brine volume"                                                                                                      unit="%"   /> 
    41           <field id="iceage"       long_name="ice age"                                                                                                           unit="days"/> 
    42           <field id="icehnew"      long_name="frazil ice collection thickness"                                                                                   unit="m"   /> 
    43           <field id="snwvolu"      long_name="snow volume"                                                                                                       unit="m"   /> 
    44           <field id="icefrb"       long_name="Sea-ice freeboard"                                       standard_name="sea_ice_freeboard"                         unit="m"   /> 
    45           <field id="icealb"       long_name="Sea-ice or snow albedo"                                  standard_name="sea_ice_albedo"                            unit=""    /> 
    46           <field id="tau_icebfr"   long_name="ice friction on ocean bottom for landfast ice"                                                                     unit="N/2" /> 
     36          <field id="iceconc"      long_name="Sea-ice area fraction"                                   standard_name="sea_ice_area_fraction"                     unit=""     /> 
     37          <field id="icevolu"      long_name="Sea-ice volume per area"                                 standard_name="sea_ice_thickness"                         unit="m"    /> 
     38          <field id="icethic"      long_name="Sea-ice thickness"                                       standard_name="sea_ice_thickness"                         unit="m"    /> 
     39          <field id="snwthic"      long_name="Snow thickness"                                          standard_name="snow_thickness"                            unit="m"    /> 
     40          <field id="icebrv"       long_name="brine volume"                                                                                                      unit="%"    /> 
     41          <field id="iceage"       long_name="ice age"                                                                                                           unit="days" detect_missing_value="true"/> 
     42          <field id="icehnew"      long_name="frazil ice collection thickness"                                                                                   unit="m"    /> 
     43          <field id="snwvolu"      long_name="snow volume"                                                                                                       unit="m"    /> 
     44          <field id="icefrb"       long_name="Sea-ice freeboard"                                       standard_name="sea_ice_freeboard"                         unit="m"    /> 
     45          <field id="icealb"       long_name="Sea-ice or snow albedo"                                  standard_name="sea_ice_albedo"                            unit=""    detect_missing_value="true" /> 
    4746      
    4847     <!-- melt ponds --> 
     
    5150      
    5251     <!-- heat --> 
    53           <field id="icetemp"      long_name="Mean ice temperature"                                                                                              unit="degC" /> 
    54           <field id="snwtemp"      long_name="Mean snow temperature"                                                                                             unit="degC" /> 
    55           <field id="icettop"      long_name="temperature at the ice surface"                                                                                    unit="degC" /> 
    56           <field id="icetbot"      long_name="temperature at the ice bottom"                                                                                     unit="degC" /> 
    57           <field id="icetsni"      long_name="temperature at the snow-ice interface"                                                                             unit="degC" /> 
     52          <field id="icetemp"      long_name="Mean ice temperature"                                                                                              unit="degC" detect_missing_value="true" /> 
     53          <field id="snwtemp"      long_name="Mean snow temperature"                                                                                             unit="degC" detect_missing_value="true" /> 
     54          <field id="icettop"      long_name="temperature at the ice surface"                                                                                    unit="degC" detect_missing_value="true" /> 
     55          <field id="icetbot"      long_name="temperature at the ice bottom"                                                                                     unit="degC" detect_missing_value="true" /> 
     56          <field id="icetsni"      long_name="temperature at the snow-ice interface"                                                                             unit="degC" detect_missing_value="true" /> 
    5857          <field id="icehc"        long_name="ice heat content"                                                                                                  unit="J/m2" />  
    5958          <field id="snwhc"        long_name="snow heat content"                                                                                                 unit="J/m2" /> 
    6059      
    6160     <!-- salt --> 
    62           <field id="icesalt"      long_name="Sea ice salinity"                                                                                                  unit="g/kg"  /> 
     61          <field id="icesalt"      long_name="Sea ice salinity"                                                                                                  unit="g/kg"  detect_missing_value="true" /> 
    6362          <field id="icesalm"      long_name="Mass of salt in sea ice per area"                        standard_name="sea_ice_salt_mass"                         unit="kg/m2" /> 
    6463      
     
    7170          <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" /> 
    7271          <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" /> 
     72          <field id="utau_bi"      long_name="X-component of ocean bottom stress on sea ice -landfast" standard_name="ocean_bottom_upward_x_stress"              unit="N/m2" /> 
     73          <field id="vtau_bi"      long_name="Y-component of ocean bottom stress on sea ice -landfast" standard_name="ocean_bottom_upward_y_stress"              unit="N/m2" /> 
    7374          <field id="isig1"        long_name="1st principal stress component for EVP rhg"                                                                        unit=""     /> 
    7475          <field id="isig2"        long_name="2nd principal stress component for EVP rhg"                                                                        unit=""     /> 
     
    9495      
    9596     <!-- trends --> 
    96           <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" /> 
    97           <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" /> 
    98      <field id="afxtot"       long_name="area tendency (total)"                                                                                               unit="s-1" /> 
     97          <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" /> 
     98          <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" /> 
     99     <field id="afxtot"       long_name="area tendency (total)"                                                                                              unit="s-1" /> 
    99100      
    100101     <!-- momentum (advection) --> 
     
    170171          <field id="e3t_m"    unit="m"    /> 
    171172          <field id="frq_m"    unit="-"    /> 
    172  
    173      <!-- categories --> 
    174      <field id="iceconc_cat"  long_name="Sea-ice concentration per category"                unit=""       grid_ref="grid_T_3D_ncatice" /> 
    175           <field id="icethic_cat"  long_name="Sea-ice thickness per category"                    unit="m"      grid_ref="grid_T_3D_ncatice" /> 
    176           <field id="snwthic_cat"  long_name="Snow thickness per category"                       unit="m"      grid_ref="grid_T_3D_ncatice" /> 
    177           <field id="icesalt_cat"  long_name="Sea-Ice Bulk salinity per category"                unit="g/kg"   grid_ref="grid_T_3D_ncatice" /> 
    178           <field id="icetemp_cat"  long_name="Ice temperature per category"                      unit="degC"   grid_ref="grid_T_3D_ncatice" /> 
    179           <field id="snwtemp_cat"  long_name="Snow temperature per category"                     unit="degC"   grid_ref="grid_T_3D_ncatice" /> 
    180           <field id="icettop_cat"  long_name="Ice/snow surface temperature per category"         unit="degC"   grid_ref="grid_T_3D_ncatice" /> 
    181           <field id="iceapnd_cat"  long_name="Ice melt pond concentration per category"          unit="%"      grid_ref="grid_T_3D_ncatice" />  
    182           <field id="icehpnd_cat"  long_name="Ice melt pond thickness per category"              unit="m"      grid_ref="grid_T_3D_ncatice" />  
    183           <field id="iceafpnd_cat" long_name="Ice melt pond fraction per category"               unit="m"      grid_ref="grid_T_3D_ncatice" />  
    184           <field id="icemask_cat"  long_name="Fraction of time step with sea ice (per category)" unit=""       grid_ref="grid_T_3D_ncatice" /> 
    185           <field id="iceage_cat"   long_name="Ice age per category"                              unit="days"   grid_ref="grid_T_3D_ncatice" /> 
    186           <field id="icebrv_cat"   long_name="Brine volume per category"                         unit="%"      grid_ref="grid_T_3D_ncatice" /> 
    187173 
    188174     <!-- ================= --> 
     
    251237          <field id="xmtrptot"     long_name="X-component of sea-ice mass transport"                   standard_name="sea_ice_x_transport"                   unit="kg/s" > xmtrpice + xmtrpsnw </field> 
    252238          <field id="ymtrptot"     long_name="Y-component of sea-ice mass transport"                   standard_name="sea_ice_y_transport"                   unit="kg/s" > ymtrpice + ymtrpsnw </field> 
    253  
    254      <!-- categories --> 
    255           <field id="iceconc_cat_cmip"     long_name="Sea-ice area fractions in thickness categories"  standard_name="sea_ice_area_fraction_over_categories" detect_missing_value="true" unit=""  grid_ref="grid_T_3D_ncatice" > iceconc_cat      * icemask_cat + $missval * (1.-icemask_cat) </field> 
    256           <field id="icethic_cat_cmip"     long_name="Sea-ice thickness in thickness categories"       standard_name="sea_ice_thickness_over_categories"     detect_missing_value="true" unit="m" grid_ref="grid_T_3D_ncatice" > icethic_cat      * icemask_cat + $missval * (1.-icemask_cat) </field> 
    257           <field id="snwthic_cat_cmip"     long_name="Snow thickness in thickness categories"          standard_name="snow_thickness_over_categories"        detect_missing_value="true" unit="m" grid_ref="grid_T_3D_ncatice" > snwthic_cat      * icemask_cat + $missval * (1.-icemask_cat) </field> 
    258           <field id="iceconc_cat_pct_cmip" long_name="Sea-ice area fractions in thickness categories"  standard_name="sea_ice_area_fraction_over_categories" detect_missing_value="true" unit="%" grid_ref="grid_T_3D_ncatice" > iceconc_cat*100. * icemask_cat + $missval * (1.-icemask_cat) </field> 
    259239     
    260240   </field_group> <!-- SBC_2D --> 
    261241 
     242   <!-- categories --> 
     243        <field_group id="SBC_3D" grid_ref="grid_T_ncatice" > 
     244 
     245          <!-- standard ice fields -->   
     246     <field id="iceconc_cat"  long_name="Sea-ice concentration per category"                unit=""        /> 
     247          <field id="icethic_cat"  long_name="Sea-ice thickness per category"                    unit="m"       detect_missing_value="true" /> 
     248          <field id="snwthic_cat"  long_name="Snow thickness per category"                       unit="m"       detect_missing_value="true" /> 
     249          <field id="icesalt_cat"  long_name="Sea-Ice Bulk salinity per category"                unit="g/kg"    detect_missing_value="true" /> 
     250          <field id="icetemp_cat"  long_name="Ice temperature per category"                      unit="degC"    detect_missing_value="true" /> 
     251          <field id="snwtemp_cat"  long_name="Snow temperature per category"                     unit="degC"    detect_missing_value="true" /> 
     252          <field id="icettop_cat"  long_name="Ice/snow surface temperature per category"         unit="degC"    detect_missing_value="true" /> 
     253          <field id="iceapnd_cat"  long_name="Ice melt pond concentration per category"          unit=""        />  
     254          <field id="icehpnd_cat"  long_name="Ice melt pond thickness per category"              unit="m"       detect_missing_value="true" />  
     255          <field id="iceafpnd_cat" long_name="Ice melt pond fraction per category"               unit=""        />  
     256          <field id="icemask_cat"  long_name="Fraction of time step with sea ice (per category)" unit=""        /> 
     257          <field id="iceage_cat"   long_name="Ice age per category"                              unit="days"    detect_missing_value="true" /> 
     258          <field id="icebrv_cat"   long_name="Brine volume per category"                         unit="%"       detect_missing_value="true" /> 
     259 
     260          <!-- Add-ons for SIMIP --> 
     261          <field id="iceconc_cat_cmip"     long_name="Sea-ice area fractions in thickness categories"  standard_name="sea_ice_area_fraction_over_categories" detect_missing_value="true" unit=""   > iceconc_cat      * icemask_cat + $missval * (1.-icemask_cat) </field> 
     262          <field id="icethic_cat_cmip"     long_name="Sea-ice thickness in thickness categories"       standard_name="sea_ice_thickness_over_categories"     detect_missing_value="true" unit="m"  > icethic_cat      * icemask_cat + $missval * (1.-icemask_cat) </field> 
     263          <field id="snwthic_cat_cmip"     long_name="Snow thickness in thickness categories"          standard_name="snow_thickness_over_categories"        detect_missing_value="true" unit="m"  > snwthic_cat      * icemask_cat + $missval * (1.-icemask_cat) </field> 
     264          <field id="iceconc_cat_pct_cmip" long_name="Sea-ice area fractions in thickness categories"  standard_name="sea_ice_area_fraction_over_categories" detect_missing_value="true" unit="%"  > iceconc_cat*100. * icemask_cat + $missval * (1.-icemask_cat) </field> 
     265 
     266   </field_group> <!-- SBC_3D --> 
     267    
    262268   <!-- scalar variables --> 
    263    <field_group id="SBC_0D"  grid_ref="grid_1point" > 
     269   <field_group id="SBC_scalar"  grid_ref="grid_scalar" > 
     270          <field id="NH_iceextt"      long_name="Sea ice extent North"                   standard_name="sea_ice_extent_n"                   unit="1e6_km2"  /> 
     271          <field id="SH_iceextt"      long_name="Sea ice extent South"                   standard_name="sea_ice_extent_s"                   unit="1e6_km2"  /> 
     272          <field id="NH_icevolu"      long_name="Sea ice volume North"                   standard_name="sea_ice_volume_n"                   unit="1e3_km3"  /> 
     273          <field id="SH_icevolu"      long_name="Sea ice volume South"                   standard_name="sea_ice_volume_s"                   unit="1e3_km3"  /> 
     274          <field id="NH_icearea"      long_name="Sea ice area North"                     standard_name="sea_ice_area_n"                     unit="1e6_km2"  /> 
     275          <field id="SH_icearea"      long_name="Sea ice area South"                     standard_name="sea_ice_area_s"                     unit="1e6_km2"  /> 
     276 
    264277          <!-- available with ln_icediaout --> 
    265278          <field id="ibgfrcvoltop"    long_name="global mean ice/snow forcing at interface ice/snow-atm (volume equivalent ocean volume)"   unit="km3"      /> 
     
    283296          <field id="sbgheat_tot"     long_name="global mean snow heat content"                                                             unit="1e20J"    /> 
    284297 
    285           <field id="NH_iceextt"      long_name="Sea ice extent North"                   standard_name="sea_ice_extent_n"                   unit="1e6_km2"  /> 
    286           <field id="SH_iceextt"      long_name="Sea ice extent South"                   standard_name="sea_ice_extent_s"                   unit="1e6_km2"  /> 
    287           <field id="NH_icevolu"      long_name="Sea ice volume North"                   standard_name="sea_ice_volume_n"                   unit="1e3_km3"  /> 
    288           <field id="SH_icevolu"      long_name="Sea ice volume South"                   standard_name="sea_ice_volume_s"                   unit="1e3_km3"  /> 
    289           <field id="NH_icearea"      long_name="Sea ice area North"                     standard_name="sea_ice_area_n"                     unit="1e6_km2"  /> 
    290           <field id="SH_icearea"      long_name="Sea ice area South"                     standard_name="sea_ice_area_s"                     unit="1e6_km2"  /> 
    291  
     298     <!-- available later --> 
     299     <!-- 
    292300          <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" /> 
    293301          <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" />   
    294302          <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" /> 
    295    </field_group> <!-- SBC_0D --> 
     303          --> 
     304   </field_group> 
    296305   
    297306   <!--  
     
    301310       
    302311   <field_group id="myvarICE"        grid_ref="grid_T_2D" > 
    303           <field field_ref="icethic"          name="sithic"  /> 
    304           <field field_ref="icevolu"          name="sivolu"  /> 
    305           <field field_ref="iceconc"          name="siconc"  /> 
     312     <!-- ice mask --> 
     313     <field field_ref="icemask"          name="simsk"   /> 
     314     <field field_ref="icemask05"        name="simsk05" /> 
     315     <field field_ref="icemask15"        name="simsk15" /> 
     316      
     317     <!-- general --> 
     318     <field field_ref="snwvolu"          name="snvolu" /> 
     319     <field field_ref="snwthic"          name="snthic" /> 
     320     <field field_ref="icethic"          name="sithic" /> 
     321<!-- 
     322     <field field_ref="icethic"          name="sithic_max" operation="maximum" /> 
     323     <field field_ref="icethic"          name="sithic_min" operation="minimum" /> 
     324--> 
     325     <field field_ref="fasticepres"      name="fasticepres" /> 
     326     <field field_ref="icevolu"          name="sivolu" /> 
     327     <field field_ref="iceconc"          name="siconc" /> 
     328     <field field_ref="icesalt"          name="sisali" /> 
     329     <field field_ref="iceapnd"          name="siapnd" /> 
     330     <field field_ref="icevpnd"          name="sivpnd" /> 
     331          <field field_ref="iceage"           name="siage"  /> 
     332     <field field_ref="sst_m"            name="sst_m"  /> 
     333     <field field_ref="sss_m"            name="sss_m"  /> 
     334      
     335     <!-- heat --> 
     336     <field field_ref="icetemp"          name="sitemp" /> 
     337     <field field_ref="snwtemp"          name="sntemp" /> 
     338     <field field_ref="icettop"          name="sittop" /> 
     339     <field field_ref="icetbot"          name="sitbot" /> 
     340     <field field_ref="icetsni"          name="sitsni" /> 
     341      
     342     <!-- momentum --> 
     343     <field field_ref="uice"             name="sivelu"  /> 
     344     <field field_ref="vice"             name="sivelv"  /> 
     345     <field field_ref="icevel"           name="sivelo"  /> 
     346     <field field_ref="utau_ai"          name="utau_ai" /> 
     347     <field field_ref="vtau_ai"          name="vtau_ai" /> 
     348     <field field_ref="utau_oi"          name="utau_oi" /> 
     349     <field field_ref="vtau_oi"          name="vtau_oi" /> 
     350      
     351     <!-- rheology --> 
     352     <field field_ref="icediv"           name="sidive"  /> 
     353     <field field_ref="iceshe"           name="sishea"  /> 
     354     <field field_ref="icestr"           name="sistre"  /> 
     355     <field field_ref="normstr"          name="normstr" /> 
     356     <field field_ref="sheastr"          name="sheastr" /> 
     357     <field field_ref="isig1"            name="isig1"   /> 
     358     <field field_ref="isig2"            name="isig2"   /> 
     359     <field field_ref="isig3"            name="isig3"   /> 
     360      
     361     <!-- heat fluxes --> 
     362     <field field_ref="qt_oce_ai"        name="qt_oce_ai"  /> 
     363     <field field_ref="qt_atm_oi"        name="qt_atm_oi"  /> 
     364     <field field_ref="qtr_ice_top"      name="qtr_ice_top"/> 
     365     <field field_ref="qtr_ice_bot"      name="qtr_ice_bot"/> 
     366     <field field_ref="qt_ice"           name="qt_ice"     /> 
     367     <field field_ref="qsr_ice"          name="qsr_ice"    /> 
     368     <field field_ref="qns_ice"          name="qns_ice"    /> 
     369     <field field_ref="qemp_ice"         name="qemp_ice"   /> 
     370     <field field_ref="albedo"           name="albedo"     /> 
     371          <field field_ref="icealb"           name="icealb"     /> 
     372      
     373     <field field_ref="hfxcndtop"        name="hfxcndtop"  /> 
     374     <field field_ref="hfxcndbot"        name="hfxcndbot"  /> 
     375     <field field_ref="hfxsensib"        name="hfxsensib"  /> 
     376 
     377     <field field_ref="icehc"         name="icehc"  /> 
     378     <field field_ref="snwhc"         name="snwhc"  /> 
     379     <field field_ref="hfxbog"        name="hfxbog"  /> 
     380     <field field_ref="hfxbom"        name="hfxbom"  /> 
     381     <field field_ref="hfxsum"        name="hfxsum"  /> 
     382     <field field_ref="hfxopw"        name="hfxopw"  /> 
     383     <field field_ref="hfxdif"        name="hfxdif"  /> 
     384     <field field_ref="hfxsnw"        name="hfxsnw"  /> 
     385     <field field_ref="hfxerr"        name="hfxerr"  /> 
     386     <field field_ref="hfxthd"        name="hfxthd"  /> 
     387     <field field_ref="hfxdyn"        name="hfxdyn"  /> 
     388     <field field_ref="hfxres"        name="hfxres"  /> 
     389     <field field_ref="hfxsub"        name="hfxsub"  /> 
     390     <field field_ref="hfxspr"        name="hfxspr"  /> 
     391 
     392<!-- 
     393     <field field_ref="hfxdhc"        name="hfxbudget"  operation="average" freq_op="1d" > @qt_atm_oi - @qt_oce_ai -@hfxdhc </field> 
     394--> 
     395      
     396     <!-- salt fluxes --> 
     397     <field field_ref="sfxice"           name="sfxice" /> 
     398      
     399     <!-- mass fluxes --> 
     400     <field field_ref="vfxice"           name="vfxice" /> 
     401     <field field_ref="vfxsnw"           name="vfxsnw" /> 
     402 
     403     <field field_ref="vfxbom"           name="vfxbom" /> 
     404     <field field_ref="vfxbog"           name="vfxbog" /> 
     405     <field field_ref="vfxsum"           name="vfxsum" /> 
     406     <field field_ref="vfxopw"           name="vfxopw" /> 
     407     <field field_ref="vfxlam"           name="vfxlam" /> 
     408     <field field_ref="vfxsni"           name="vfxsni" /> 
     409     <field field_ref="vfxdyn"           name="vfxdyn" /> 
     410     <field field_ref="vfxres"           name="vfxres" /> 
     411     <field field_ref="vfxpnd"           name="vfxpnd" /> 
     412     <field field_ref="vfxsub"           name="vfxsub" /> 
     413     <field field_ref="vfxsub_err"       name="vfxsub_err" /> 
     414          <field field_ref="vfxthin"          name="vfxthin" /> 
     415    
     416     <!-- diag error for negative ice volume after advection --> 
     417     <field field_ref="iceneg_pres"      name="sineg_pres" /> 
     418     <field field_ref="iceneg_volu"      name="sineg_volu" /> 
     419     <field field_ref="iceneg_hfx"       name="sineg_hfx"  /> 
     420        </field_group> 
     421 
     422 
     423        <field_group id="myvarICE_cat"        grid_ref="grid_T_ncatice" > 
     424 
     425     <!-- categories --> 
     426     <field field_ref="icemask_cat"      name="simskcat"/> 
     427     <field field_ref="snwthic_cat"      name="snthicat"/> 
     428     <field field_ref="iceconc_cat"      name="siconcat"/> 
     429     <field field_ref="icethic_cat"      name="sithicat"/> 
     430     <field field_ref="icesalt_cat"      name="sisalcat"/> 
     431     <field field_ref="icetemp_cat"      name="sitemcat"/> 
     432     <field field_ref="snwtemp_cat"      name="sntemcat"/> 
     433     <field field_ref="icettop_cat"      name="sitopcat"/> 
     434 
    306435   </field_group>     
    307436 
    308    <field_group id="ICE_globalbudget"  grid_ref="grid_1point" > 
     437   <field_group id="ICE_globalbudget"  grid_ref="grid_scalar" > 
     438     <!-- global contents --> 
    309439        <field field_ref="ibgvol_tot"       name="ibgvol_tot"   /> 
    310440     <field field_ref="sbgvol_tot"       name="sbgvol_tot"   /> 
     
    314444        <field field_ref="sbgheat_tot"      name="sbgheat_tot"  /> 
    315445 
    316         <field field_ref="ibgvolume"        name="ibgvolume"    /> 
     446     <!-- global drifts (conservation checks) --> 
     447     <field field_ref="ibgvolume"        name="ibgvolume"    /> 
    317448        <field field_ref="ibgsaltco"        name="ibgsaltco"    /> 
    318449        <field field_ref="ibgheatco"        name="ibgheatco"    /> 
    319450          <field field_ref="ibgheatfx"        name="ibgheatfx"    /> 
    320451 
     452     <!-- global forcings  --> 
    321453        <field field_ref="ibgfrcvoltop"     name="ibgfrcvoltop" /> 
    322454        <field field_ref="ibgfrcvolbot"     name="ibgfrcvolbot" /> 
     
    335467 
    336468   <!-- SIMIP monthly scalar variables --> 
    337    <field_group id="SImon_scalars"   grid_ref="grid_1point" > 
     469   <field_group id="SImon_scalars"   grid_ref="grid_scalar" > 
    338470          <!-- Integrated quantities --> 
    339471          <field field_ref="NH_iceextt"       name="siextentn"    /> 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SHARED/field_def_nemo-oce.xml

    r11363 r11413  
    343343   </field_group> 
    344344    
    345    <!-- scalar variables --> 
    346    <field_group id="SBC_0D"  grid_ref="grid_1point" > 
    347    </field_group> 
    348345 
    349346      </field_group> <!-- SBC --> 
     
    515512      <field id="ahmf_3d"      long_name=" 3D      f-eddy viscosity coefficient"   unit="m2/s or m4/s"  grid_ref="grid_T_3D"/> 
    516513 
    517       <field_group id="scalar"  grid_ref="grid_T_2D"  > 
     514      <field_group id="scalar"  grid_ref="grid_scalar"  > 
    518515         <!-- Need to have a salinity reference climatological file : sali_ref_clim_monthly --> 
    519516        <field id="voltot"     long_name="global total volume"                          standard_name="sea_water_volume"                               unit="m3"   /> 
     
    542539      </field_group> 
    543540       
    544       <!-- variables available with key_float --> 
     541      <!-- variables available with ln_floats --> 
    545542 
    546543      <field_group id="floatvar" grid_ref="grid_T_nfloat"  operation="instant" > 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SHARED/field_def_nemo-pisces.xml

    r10416 r11413  
    290290     </field_group> 
    291291 
    292      <field_group id="tracer_scalar"  grid_ref="grid_T_2D"  > 
     292     <field_group id="tracer_scalar"  grid_ref="grid_scalar"  > 
    293293     <!-- PISCES scalar  --> 
    294294       <field id="pno3tot"         long_name="Global mean nitrate concentration"                  unit="mol/m3"   /> 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SHARED/grid_def_nemo.xml

    r11363 r11413  
    77       </grid> 
    88        <!--  --> 
    9        <grid id="grid_T_3D_ncatice" > 
     9       <grid id="grid_T_ncatice" > 
    1010         <domain id="grid_T" /> 
    1111         <axis id="ncatice" /> 
     
    4949       </grid> 
    5050        <!--  --> 
    51        <grid id="grid_1point" > 
    52          <domain domain_ref="1point"/> 
    53        </grid> 
    54         <!--  --> 
    5551       <grid id="grid_T_nfloat" > 
    5652         <domain id="grid_T" /> 
    5753         <axis id="nfloat" /> 
    5854       </grid> 
     55      <!-- scalars --> 
     56      <grid id="grid_scalar" > 
     57        <scalar/> 
     58      </grid> 
    5959 
    6060       <!-- ABL grid definition --> 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SHARED/namelist_ice_ref

    r10911 r11413  
    11!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    2 !! SI3 namelist:   
     2!! SI3 Reference namelist: 
    33!!              1 - Generic parameters                 (nampar) 
    44!!              2 - Ice thickness discretization       (namitd) 
     
    5656   rn_ishlat        =   2.            !  lbc : free slip (0) ; partial slip (0-2) ; no slip (2) ; strong slip (>2) 
    5757   ln_landfast_L16  = .false.         !  landfast: parameterization from Lemieux 2016 
    58    ln_landfast_home = .false.         !  landfast: parameterization from "home made" 
    5958      rn_depfra     =   0.125         !        fraction of ocean depth that ice must reach to initiate landfast 
    6059                                      !          recommended range: [0.1 ; 0.25] - L16=0.125 - home=0.15 
     
    189188   ln_iceini        = .true.          !  activate ice initialization (T) or not (F) 
    190189   ln_iceini_file   = .false.         !  netcdf file provided for initialization (T) or not (F) 
    191    rn_thres_sst     =   2.0           !  max delta temp. above Tfreeze with initial ice = (sst - tfreeze) 
    192    rn_hts_ini_n     =   0.3           !  initial real snow thickness (m), North 
     190   rn_thres_sst     =   2.0           !  max temp. above Tfreeze with initial ice = (sst - tfreeze) 
     191   rn_hti_ini_n     =   3.0           !  initial ice thickness       (m), North 
     192   rn_hti_ini_s     =   1.0           !        "            "             South 
     193   rn_hts_ini_n     =   0.3           !  initial snow thickness      (m), North 
    193194   rn_hts_ini_s     =   0.3           !        "            "             South 
    194    rn_hti_ini_n     =   3.0           !  initial real ice thickness  (m), North 
    195    rn_hti_ini_s     =   1.0           !        "            "             South 
    196195   rn_ati_ini_n     =   0.9           !  initial ice concentration   (-), North 
    197196   rn_ati_ini_s     =   0.9           !        "            "             South 
    198197   rn_smi_ini_n     =   6.3           !  initial ice salinity     (g/kg), North 
    199198   rn_smi_ini_s     =   6.3           !        "            "             South 
    200    rn_tmi_ini_n     = 270.            !  initial ice/snw temperature (K), North 
     199   rn_tmi_ini_n     = 270.            !  initial ice temperature    (K), North 
    201200   rn_tmi_ini_s     = 270.            !        "            "             South 
    202  
     201   rn_tsu_ini_n     = 270.            !  initial surface temperature (K), North 
     202   rn_tsu_ini_s     = 270.            !        "            "             South 
     203   rn_tms_ini_n     = 270.            !  initial snw temperature     (K), North 
     204   rn_tms_ini_s     = 270.            !        "            "             South 
     205   rn_apd_ini_n     =   0.2           !  initial pond fraction       (-), North 
     206   rn_apd_ini_s     =   0.2           !        "            "             South 
     207   rn_hpd_ini_n     =   0.05          !  initial pond depth          (m), North 
     208   rn_hpd_ini_s     =   0.05          !        "            "             South 
     209   !        ! if ln_iceini_file=T 
    203210   sn_hti = 'Ice_initialization'    , -12 ,'hti'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    204211   sn_hts = 'Ice_initialization'    , -12 ,'hts'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    205212   sn_ati = 'Ice_initialization'    , -12 ,'ati'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     213   sn_smi = 'Ice_initialization'    , -12 ,'smi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     214   sn_tmi = 'Ice_initialization'    , -12 ,'tmi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    206215   sn_tsu = 'Ice_initialization'    , -12 ,'tsu'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    207    sn_tmi = 'Ice_initialization'    , -12 ,'tmi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    208    sn_smi = 'Ice_initialization'    , -12 ,'smi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     216   sn_tms = 'NOT USED'              , -12 ,'tms'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     217   sn_apd = 'NOT USED'              , -12 ,'apd'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     218   sn_hpd = 'NOT USED'              , -12 ,'hpd'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    209219   cn_dir='./' 
    210220/ 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SHARED/namelist_ref

    r11363 r11413  
    5050      cn_ocerst_indir = "."         !  directory from which to read input ocean restarts 
    5151      cn_ocerst_out   = "restart"   !  suffix of ocean restart name (output) 
    52       cn_ocerst_outdir = "."         !  directory in which to write output ocean restarts 
     52      cn_ocerst_outdir = "."        !  directory in which to write output ocean restarts 
    5353   ln_iscpl    = .false.   !  cavity evolution forcing or coupling to ice sheet model 
    5454   nn_istate   =       0   !  output the initial state (1) or not (0) 
    5555   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F) 
    56    nn_stock    =    5840   !  frequency of creation of a restart file (modulo referenced to 1) 
     56   nn_stock    =       0   !  used only if ln_rst_list = F: output restart freqeuncy (modulo referenced to 1) 
     57      !                          !    =  0 force to write restart files only at the end of the run 
     58      !                          !    = -1 do not do any restart 
    5759   nn_stocklist = 0,0,0,0,0,0,0,0,0,0 ! List of timesteps when a restart file is to be written 
    58    nn_write    =    5840   !  frequency of write in the output file   (modulo referenced to nn_it000) 
     60   nn_write    =       0   !  used only if key_iomput is not defined: output frequency (modulo referenced to nn_it000) 
     61      !                          !    =  0 force to write output files only at the end of the run 
     62      !                          !    = -1 do not do any output file 
    5963   ln_mskland  = .false.   !  mask land points in NetCDF outputs 
    6064   ln_cfmeta   = .false.   !  output additional data to netCDF files required for compliance with the CF metadata standard 
     
    195199   ln_flx      = .false.   !  flux formulation                          (T => fill namsbc_flx ) 
    196200   ln_blk      = .false.   !  Bulk formulation                          (T => fill namsbc_blk ) 
    197    ln_abl      = .false.   !  ABL  formulation                          (T => fill namsbc_abl ) 
    198201      !              ! Type of coupling (Ocean/Ice/Atmosphere) : 
    199202   ln_cpl      = .false.   !  atmosphere coupled   formulation          ( requires key_oasis3 ) 
     
    277280   sn_snow     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'SNOW'    ,   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    278281   sn_slp      = 'slp.15JUNE2009_fill'        ,    6.        , 'SLP'     ,   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    279    sn_hpgi     = 'NOT USED'                   ,   24.        , 'xxx'  ,   .false.   , .true. , 'yearly'  , '' , ''       , '' 
    280    sn_hpgj     = 'NOT USED'                   ,   24.        , 'xxx'  ,   .false.   , .true. , 'yearly'  , '' , ''       , '' 
    281 / 
    282 !----------------------------------------------------------------------- 
    283 &namsbc_abl    !   Atmospheric Boundary Layer formulation           (ln_abl = T) 
    284 !----------------------------------------------------------------------- 
    285    cn_dir         = './'      !  root directory for the location of the ABL grid file 
    286    cn_dom         = 'dom_cfg_abl.nc' 
    287    ln_hpgls_frc   = .false. 
    288    ln_geos_winds  = .false. 
    289    nn_dyn_restore = 1 
    290    rn_ldyn_min   =  16.       !  magnitude of the nudging on ABL dynamics at the bottom of the ABL   [hour] 
    291    rn_ldyn_max   =  1.6       !  magnitude of the nudging on ABL dynamics at the top of the ABL   [hour] 
    292    rn_ltra_min   =  16.       !  magnitude of the nudging on ABL tracers  at the bottom of the ABL   [hour] 
    293    rn_ltra_max   =  1.6       !  magnitude of the nudging on ABL tracers  at the top of the ABL   [hour] 
    294    nn_amxl        = 0         ! mixing length: = 0 Deardorff 80 length-scale 
    295                               !                = 1 length-scale based on the distance to the PBL height 
    296                               !                = 2 Bougeault & Lacarrere 89 length-scale 
    297    rn_Cm         = 0.0667     ! 0.126 in MesoNH 
    298    rn_Ct         = 0.1667     ! 0.143 in MesoNH 
    299    rn_Ce         = 0.4        ! 0.4   in MesoNH 
    300    rn_Ceps       = 0.7        ! 0.85  in MesoNH 
    301    rn_Rod        = 0.15       ! c0 in RMCA17 mixing length formulation (not yet implemented) 
    302    rn_Ric        = 0.139      !  Critical Richardson number (to compute PBL height and diffusivities) 
    303    ln_smth_pblh  = .false.   !  Smoothing of PBL height with a 2d Hanning filter 
    304282/ 
    305283!----------------------------------------------------------------------- 
     
    589567!----------------------------------------------------------------------- 
    590568   ln_tide     = .false.      ! Activate tides 
    591    ln_tide_pot   = .true.                !  use tidal potential forcing 
    592    ln_scal_load  = .false.               ! Use scalar approximation for  
    593    ln_read_load  = .false.               ! Or read load potential from file 
    594    cn_tide_load  = 'tide_LOAD_grid_T.nc'  ! filename for load potential      
    595    ln_tide_ramp  = .false.               !  Use linear ramp for tides at startup 
    596    rn_scal_load  = 0.094               !     load potential  
    597    rdttideramp   =    0.                 !  ramp duration in days 
    598    clname        = 'FOUR'               !  name of constituent - all tidal components must be set in namelist_cfg 
     569      ln_tide_pot   = .false.               !  use tidal potential forcing 
     570         ln_scal_load  = .false.               ! Use scalar approximation for 
     571            rn_scal_load = 0.094               !     load potential 
     572         ln_read_load  = .false.               ! Or read load potential from file 
     573            cn_tide_load = 'tide_LOAD_grid_T.nc'  ! filename for load potential 
     574            !       
     575      ln_tide_ramp  = .false.               !  Use linear ramp for tides at startup 
     576         rdttideramp   =    0.                 !  ramp duration in days 
     577      clname(1)     = 'DUMMY'               !  name of constituent - all tidal components must be set in namelist_cfg 
    599578/ 
    600579!----------------------------------------------------------------------- 
     
    876855   rn_lf_cutoff  =  5.0             !  cutoff frequency for low-pass filter  [days] 
    877856   rn_zdef_max   =  0.9             !  maximum fractional e3t deformation 
    878    ln_vvl_dbg    = .true.           !  debug prints    (T/F) 
     857   ln_vvl_dbg    = .false.          !  debug prints    (T/F) 
    879858/ 
    880859!----------------------------------------------------------------------- 
     
    11271106!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    11281107!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    1129 !!   namflo       float parameters                                      ("key_float") 
    1130 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    1131 !!   namdct       transports through some sections                      ("key_diadct") 
     1108!!   namflo       float parameters                                      (default: OFF) 
     1109!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     1110!!   nam_diadct   transports through some sections                      (default: OFF) 
    11321111!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    11331112!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
     
    11641143&namhsb        !  Heat and salt budgets                                 (default: OFF) 
    11651144!----------------------------------------------------------------------- 
    1166    ln_diahsb   = .false.   !  check the heat and salt budgets (T) or not (F) 
     1145   ln_diahsb   = .false.   !  output the heat and salt budgets (T) or not (F) 
    11671146/ 
    11681147!----------------------------------------------------------------------- 
     
    11731152/ 
    11741153!----------------------------------------------------------------------- 
    1175 &namflo        !   float parameters                                     ("key_float") 
    1176 !----------------------------------------------------------------------- 
    1177    jpnfl       = 1         !  total number of floats during the run 
    1178    jpnnewflo   = 0         !  number of floats for the restart 
    1179    ln_rstflo   = .false.   !  float restart (T) or not (F) 
    1180    nn_writefl  =      75   !  frequency of writing in float output file 
    1181    nn_stockfl  =    5475   !  frequency of creation of the float restart file 
    1182    ln_argo     = .false.   !  Argo type floats (stay at the surface each 10 days) 
    1183    ln_flork4   = .false.   !  trajectories computed with a 4th order Runge-Kutta (T) 
    1184    !                       !  or computed with Blanke' scheme (F) 
    1185    ln_ariane   = .true.    !  Input with Ariane tool convention(T) 
    1186    ln_flo_ascii = .true.    !  Output with Ariane tool netcdf convention(F) or ascii file (T) 
    1187 / 
    1188 !----------------------------------------------------------------------- 
    1189 &nam_diaharm   !   Harmonic analysis of tidal constituents              ("key_diaharm") 
    1190 !----------------------------------------------------------------------- 
    1191     nit000_han = 1         ! First time step used for harmonic analysis 
    1192     nitend_han = 75        ! Last time step used for harmonic analysis 
    1193     nstep_han  = 15        ! Time step frequency for harmonic analysis 
    1194     tname(1)   = 'M2'      ! Name of tidal constituents 
    1195     tname(2)   = 'K1' 
    1196 / 
    1197 !----------------------------------------------------------------------- 
    1198 &namdct        ! transports through some sections                       ("key_diadct") 
    1199 !----------------------------------------------------------------------- 
    1200     nn_dct     = 15        !  time step frequency for transports computing 
    1201     nn_dctwri  = 15        !  time step frequency for transports writing 
    1202     nn_secdebug = 112       !      0 : no section to debug 
    1203     !                      !     -1 : debug all section 
    1204     !                      !  0 < n : debug section number n 
     1154&namflo        !   float parameters                                     (default: OFF) 
     1155!----------------------------------------------------------------------- 
     1156   ln_floats   = .false.      ! activate floats or not 
     1157      jpnfl       = 1         !    total number of floats during the run 
     1158      jpnnewflo   = 0         !    number of floats for the restart 
     1159      ln_rstflo   = .false.   !    float restart (T) or not (F) 
     1160      nn_writefl  =      75   !    frequency of writing in float output file 
     1161      nn_stockfl  =    5475   !    frequency of creation of the float restart file 
     1162      ln_argo     = .false.   !    Argo type floats (stay at the surface each 10 days) 
     1163      ln_flork4   = .false.   !    trajectories computed with a 4th order Runge-Kutta (T) 
     1164      !                       !    or computed with Blanke' scheme (F) 
     1165      ln_ariane   = .true.    !    Input with Ariane tool convention(T) 
     1166      ln_flo_ascii= .true.    !    Output with Ariane tool netcdf convention(F) or ascii file (T) 
     1167/ 
     1168!----------------------------------------------------------------------- 
     1169&nam_diaharm   !   Harmonic analysis of tidal constituents              (default: OFF) 
     1170!----------------------------------------------------------------------- 
     1171    ln_diaharm = .false.   ! Choose tidal harmonic output or not 
     1172       nit000_han = 1      !    First time step used for harmonic analysis 
     1173       nitend_han = 75     !    Last time step used for harmonic analysis 
     1174       nstep_han  = 15     !    Time step frequency for harmonic analysis 
     1175       tname(1)   = 'M2'   !    Name of tidal constituents 
     1176       tname(2)   = 'K1'   !              --- 
     1177/ 
     1178!----------------------------------------------------------------------- 
     1179&nam_diadct    !   transports through some sections                     (default: OFF) 
     1180!----------------------------------------------------------------------- 
     1181    ln_diadct  = .false.   ! Calculate transport thru sections or not 
     1182       nn_dct     = 15     !  time step frequency for transports computing 
     1183       nn_dctwri  = 15     !  time step frequency for transports writing 
     1184       nn_secdebug = 112   !      0 : no section to debug 
     1185       !                   !     -1 : debug all section 
     1186       !                   !  0 < n : debug section number n 
    12051187/ 
    12061188!----------------------------------------------------------------------- 
     
    13201302&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi") 
    13211303!----------------------------------------------------------------------- 
    1322    cn_mpi_send =  'I'      !  mpi send/recieve type   ='S', 'B', or 'I' for standard send, 
    1323    !                       !  buffer blocking send or immediate non-blocking sends, resp. 
    1324    nn_buffer   =   0       !  size in bytes of exported buffer ('B' case), 0 no exportation 
     1304   ln_listonly =  .false.  !  do nothing else than listing the best domain decompositions (with land domains suppression) 
     1305   !                       !  if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj) 
    13251306   ln_nnogather =  .true.  !  activate code to avoid mpi_allgather use at the northfold 
    1326    jpni        =   0       !  jpni   number of processors following i (set automatically if < 1) 
    1327    jpnj        =   0       !  jpnj   number of processors following j (set automatically if < 1) 
     1307   jpni        =   0       !  number of processors following i (set automatically if < 1), see also ln_listonly = T 
     1308   jpnj        =   0       !  number of processors following j (set automatically if < 1), see also ln_listonly = T 
    13281309/ 
    13291310!----------------------------------------------------------------------- 
     
    13321313   ln_ctl = .FALSE.                 ! Toggle all report printing on/off (T/F); Ignored if sn_cfctl%l_config is T 
    13331314     sn_cfctl%l_config = .TRUE.     ! IF .true. then control which reports are written with the following 
    1334        sn_cfctl%l_runstat = .FALSE. ! switches and which areas produce reports with the proc integer settings. 
     1315       sn_cfctl%l_runstat = .TRUE. ! switches and which areas produce reports with the proc integer settings. 
    13351316       sn_cfctl%l_trcstat = .FALSE. ! The default settings for the proc integers should ensure 
    13361317       sn_cfctl%l_oceout  = .FALSE. ! that  all areas report. 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SPITZ12/EXPREF/file_def_nemo-ice.xml

    r10911 r11413  
    9393     <file id="file22" name_suffix="_SBC_scalar" description="scalar variables" enabled=".true." > 
    9494       <!-- global contents --> 
    95        <field field_ref="ibgvol_tot"     grid_ref="grid_1point"   name="ibgvol_tot"   /> 
    96        <field field_ref="sbgvol_tot"     grid_ref="grid_1point"   name="sbgvol_tot"   /> 
    97        <field field_ref="ibgarea_tot"    grid_ref="grid_1point"   name="ibgarea_tot"  /> 
    98        <field field_ref="ibgsalt_tot"    grid_ref="grid_1point"   name="ibgsalt_tot"  /> 
    99        <field field_ref="ibgheat_tot"    grid_ref="grid_1point"   name="ibgheat_tot"  /> 
    100        <field field_ref="sbgheat_tot"    grid_ref="grid_1point"   name="sbgheat_tot"  /> 
     95       <field field_ref="ibgvol_tot"     name="ibgvol_tot"   /> 
     96       <field field_ref="sbgvol_tot"     name="sbgvol_tot"   /> 
     97       <field field_ref="ibgarea_tot"    name="ibgarea_tot"  /> 
     98       <field field_ref="ibgsalt_tot"    name="ibgsalt_tot"  /> 
     99       <field field_ref="ibgheat_tot"    name="ibgheat_tot"  /> 
     100       <field field_ref="sbgheat_tot"    name="sbgheat_tot"  /> 
    101101        
    102102       <!-- global drifts (conservation checks) --> 
    103        <field field_ref="ibgvolume"      grid_ref="grid_1point"   name="ibgvolume"    /> 
    104        <field field_ref="ibgsaltco"      grid_ref="grid_1point"   name="ibgsaltco"    /> 
    105        <field field_ref="ibgheatco"      grid_ref="grid_1point"   name="ibgheatco"    /> 
    106        <field field_ref="ibgheatfx"      grid_ref="grid_1point"   name="ibgheatfx"    /> 
     103       <field field_ref="ibgvolume"      name="ibgvolume"    /> 
     104       <field field_ref="ibgsaltco"      name="ibgsaltco"    /> 
     105       <field field_ref="ibgheatco"      name="ibgheatco"    /> 
     106       <field field_ref="ibgheatfx"      name="ibgheatfx"    /> 
    107107        
    108108       <!-- global forcings  --> 
    109        <field field_ref="ibgfrcvoltop"   grid_ref="grid_1point"   name="ibgfrcvoltop" /> 
    110        <field field_ref="ibgfrcvolbot"   grid_ref="grid_1point"   name="ibgfrcvolbot" /> 
    111        <field field_ref="ibgfrctemtop"   grid_ref="grid_1point"   name="ibgfrctemtop" /> 
    112        <field field_ref="ibgfrctembot"   grid_ref="grid_1point"   name="ibgfrctembot" /> 
    113        <field field_ref="ibgfrcsal"      grid_ref="grid_1point"   name="ibgfrcsal"    /> 
    114        <field field_ref="ibgfrchfxtop"   grid_ref="grid_1point"   name="ibgfrchfxtop" /> 
    115        <field field_ref="ibgfrchfxbot"   grid_ref="grid_1point"   name="ibgfrchfxbot" /> 
     109       <field field_ref="ibgfrcvoltop"   name="ibgfrcvoltop" /> 
     110       <field field_ref="ibgfrcvolbot"   name="ibgfrcvolbot" /> 
     111       <field field_ref="ibgfrctemtop"   name="ibgfrctemtop" /> 
     112       <field field_ref="ibgfrctembot"   name="ibgfrctembot" /> 
     113       <field field_ref="ibgfrcsal"      name="ibgfrcsal"    /> 
     114       <field field_ref="ibgfrchfxtop"   name="ibgfrchfxtop" /> 
     115       <field field_ref="ibgfrchfxbot"   name="ibgfrchfxbot" /> 
    116116     </file> 
    117117      
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SPITZ12/EXPREF/file_def_nemo-oce.xml

    r9572 r11413  
    8181        <file id="file15" name_suffix="_scalar" description="scalar variables" > 
    8282          <!-- global drifts (conservation checks) --> 
    83           <field field_ref="bgtemper"     grid_ref="grid_1point"   name="bgtemper"    /> 
    84           <field field_ref="bgsaline"     grid_ref="grid_1point"   name="bgsaline"    /> 
    85           <field field_ref="bgheatco"     grid_ref="grid_1point"   name="bgheatco"    /> 
    86           <field field_ref="bgheatfx"     grid_ref="grid_1point"   name="bgheatfx"    /> 
    87           <field field_ref="bgsaltco"     grid_ref="grid_1point"   name="bgsaltco"    /> 
    88           <field field_ref="bgvolssh"     grid_ref="grid_1point"   name="bgvolssh"    /> 
    89           <field field_ref="bgvole3t"     grid_ref="grid_1point"   name="bgvole3t"    /> 
     83          <field field_ref="bgtemper"     name="bgtemper"    /> 
     84          <field field_ref="bgsaline"     name="bgsaline"    /> 
     85          <field field_ref="bgheatco"     name="bgheatco"    /> 
     86          <field field_ref="bgheatfx"     name="bgheatfx"    /> 
     87          <field field_ref="bgsaltco"     name="bgsaltco"    /> 
     88          <field field_ref="bgvolssh"     name="bgvolssh"    /> 
     89          <field field_ref="bgvole3t"     name="bgvole3t"    /> 
    9090 
    9191          <!-- global surface forcings  --> 
    92           <field field_ref="bgfrcvol"     grid_ref="grid_1point"   name="bgfrcvol"    /> 
    93           <field field_ref="bgfrctem"     grid_ref="grid_1point"   name="bgfrctem"    /> 
    94           <field field_ref="bgfrchfx"     grid_ref="grid_1point"   name="bgfrchfx"    /> 
    95           <field field_ref="bgfrcsal"     grid_ref="grid_1point"   name="bgfrcsal"    /> 
     92          <field field_ref="bgfrcvol"     name="bgfrcvol"    /> 
     93          <field field_ref="bgfrctem"     name="bgfrctem"    /> 
     94          <field field_ref="bgfrchfx"     name="bgfrchfx"    /> 
     95          <field field_ref="bgfrcsal"     name="bgfrcsal"    /> 
    9696        </file> 
    9797 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/SPITZ12/EXPREF/namelist_cfg

    r11275 r11413  
    351351!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    352352!!   namdiu       Cool skin and warm layer models                       (default: OFF) 
    353 !!   namflo       float parameters                                      ("key_float") 
    354 !!   nam_diaharm  Harmonic analysis of tidal constituents               ("key_diaharm") 
    355 !!   namdct       transports through some sections                      ("key_diadct") 
     353!!   namflo       float parameters                                      (default: OFF) 
     354!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF) 
     355!!   nam_diadct   transports through some sections                      (default: OFF) 
    356356!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF) 
    357357!!   nam_dia25h   25h Mean Output                                       (default: OFF) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/cfgs/ref_cfgs.txt

    r11306 r11413  
    99ORCA2_ICE_PISCES OCE TOP ICE NST 
    1010ORCA2_ICE_ABL OCE ICE ABL 
     11ORCA2_SAS_ICE_ABL OCE SAS ICE ABL 
     12ORCA2_ICE OCE ICE 
    1113SPITZ12 OCE ICE 
     14eORCA025_ICE OCE ICE 
     15eORCA025_ICE_ABL OCE ICE ABL 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/ice.F90

    r10882 r11413  
    102102   !! vt_i        |      -      |    Total ice vol. per unit area | m     | 
    103103   !! vt_s        |      -      |    Total snow vol. per unit ar. | m     | 
     104   !! st_i        |      -      |    Total Sea ice salt content   | pss.m | 
    104105   !! sm_i        |      -      |    Mean sea ice salinity        | pss   | 
    105106   !! tm_i        |      -      |    Mean sea ice temperature     | K     | 
     
    135136   REAL(wp), PUBLIC ::   rn_ishlat        !: lateral boundary condition for sea-ice 
    136137   LOGICAL , PUBLIC ::   ln_landfast_L16  !: landfast ice parameterizationfrom lemieux2016  
    137    LOGICAL , PUBLIC ::   ln_landfast_home !: landfast ice parameterizationfrom home made  
    138138   REAL(wp), PUBLIC ::   rn_depfra        !:    fraction of ocean depth that ice must reach to initiate landfast ice 
    139139   REAL(wp), PUBLIC ::   rn_icebfr        !:    maximum bottom stress per unit area of contact (lemieux2016) or per unit volume (home)  
     
    213213   REAL(wp), PUBLIC, PARAMETER ::   epsi20 = 1.e-20_wp  !: small number  
    214214 
    215    !                                     !!** some other parameters for advection using the ULTIMATE-MACHO scheme 
    216    LOGICAL, PUBLIC, DIMENSION(2) :: l_split_advumx = .FALSE.    ! force one iteration at the first time-step 
    217  
    218215   !                                     !!** define arrays 
    219216   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_oce,v_oce !: surface ocean velocity used in ice dynamics 
     
    251248   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_res     !: mass flux from residual component of wfx_ice             [kg.m-2.s-1] 
    252249   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wfx_err_sub !: mass flux error after sublimation                        [kg.m-2.s-1] 
    253  
    254    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   afx_tot     !: ice concentration tendency (total)        [s-1] 
    255250 
    256251   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sfx_bog     !: salt flux due to ice bottom growth                   [pss.kg.m-2.s-1 => g.m-2.s-1] 
     
    309304   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_ice, v_ice !: components of the ice velocity                          (m/s) 
    310305   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vt_i , vt_s  !: ice and snow total volume per unit area                 (m) 
     306   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   st_i         !: Total ice salinity content                              (pss.m) 
    311307   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   at_i         !: ice total fractional area (ice concentration) 
    312308   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ato_i        !: =1-at_i ; total open water fractional area 
     
    409405         &      wfx_bog    (jpi,jpj) , wfx_dyn   (jpi,jpj) , wfx_bom(jpi,jpj) , wfx_sum(jpi,jpj) ,           & 
    410406         &      wfx_res    (jpi,jpj) , wfx_sni   (jpi,jpj) , wfx_opw(jpi,jpj) , wfx_spr(jpi,jpj) ,           & 
    411          &      afx_tot    (jpi,jpj) , rn_amax_2d(jpi,jpj),                                                  & 
     407         &      rn_amax_2d (jpi,jpj) ,                                                                       & 
    412408         &      qsb_ice_bot(jpi,jpj) , qlead     (jpi,jpj) ,                                                 & 
    413409         &      sfx_res    (jpi,jpj) , sfx_bri   (jpi,jpj) , sfx_dyn(jpi,jpj) , sfx_sub(jpi,jpj) , sfx_lam(jpi,jpj) ,  & 
     
    429425      ii = ii + 1 
    430426      ALLOCATE( u_ice(jpi,jpj) , v_ice(jpi,jpj) ,                                   & 
    431          &      vt_i (jpi,jpj) , vt_s (jpi,jpj) , at_i(jpi,jpj) , ato_i(jpi,jpj) ,  & 
    432          &      et_i (jpi,jpj) , et_s (jpi,jpj) , tm_i(jpi,jpj) , tm_s (jpi,jpj) ,  & 
    433          &      sm_i (jpi,jpj) , tm_su(jpi,jpj) , hm_i(jpi,jpj) , hm_s (jpi,jpj) ,  & 
     427         &      vt_i (jpi,jpj) , vt_s (jpi,jpj) , st_i(jpi,jpj) , at_i(jpi,jpj) , ato_i(jpi,jpj) ,  & 
     428         &      et_i (jpi,jpj) , et_s (jpi,jpj) , tm_i(jpi,jpj) , tm_s(jpi,jpj) ,  & 
     429         &      sm_i (jpi,jpj) , tm_su(jpi,jpj) , hm_i(jpi,jpj) , hm_s(jpi,jpj) ,  & 
    434430         &      om_i (jpi,jpj) , bvm_i(jpi,jpj) , tau_icebfr(jpi,jpj)            , STAT=ierr(ii) ) 
    435431 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icecor.F90

    r10994 r11413  
    1717   USE phycst         ! physical constants 
    1818   USE ice            ! sea-ice: variable 
    19    USE ice1D          ! sea-ice: thermodynamic sea-ice variables 
     19   USE ice1D          ! sea-ice: thermodynamic variables 
    2020   USE iceitd         ! sea-ice: rebining 
    2121   USE icevar         ! sea-ice: operations 
     
    7878      !                             !----------------------------------------------------- 
    7979      at_i(:,:) = SUM( a_i(:,:,:), dim=3 ) 
    80       DO jl  = 1, jpl 
     80      DO jl = 1, jpl 
    8181         WHERE( at_i(:,:) > rn_amax_2d(:,:) )   a_i(:,:,jl) = a_i(:,:,jl) * rn_amax_2d(:,:) / at_i(:,:) 
    8282      END DO 
     
    8484      !                             !----------------------------------------------------- 
    8585      IF ( nn_icesal == 2 ) THEN    !  salinity must stay in bounds [Simin,Simax]        ! 
    86       !                             !----------------------------------------------------- 
     86         !                          !----------------------------------------------------- 
    8787         zzc = rhoi * r1_rdtice 
    8888         DO jl = 1, jpl 
     
    117117            END DO 
    118118         END DO 
    119          CALL lbc_lnk_multi( 'icecor', u_ice, 'U', -1., v_ice, 'V', -1. )            ! lateral boundary conditions 
     119         CALL lbc_lnk_multi( 'icecor', u_ice, 'U', -1., v_ice, 'V', -1. ) 
    120120      ENDIF 
    121121 
    122 !!gm I guess the trends are only out on demand  
    123 !!   So please, only do this is it exite an iom_use of on a these variables 
    124 !!   furthermore, only allocate the diag_ arrays in this case  
    125 !!   and do the iom_put here so that it is only a local allocation 
    126 !!gm  
    127122      !                             !----------------------------------------------------- 
    128123      SELECT CASE( kn )             !  Diagnostics                                       ! 
     
    130125      CASE( 1 )                        !--- dyn trend diagnostics 
    131126         ! 
    132 !!gm   here I think the number of ice cat is too small to use a SUM instruction... 
    133          DO jj = 1, jpj 
    134             DO ji = 1, jpi             
    135                !                 ! heat content variation (W.m-2) 
    136                diag_heat(ji,jj) = - (  SUM( e_i(ji,jj,1:nlay_i,:) - e_i_b(ji,jj,1:nlay_i,:) )    &  
    137                   &                  + SUM( e_s(ji,jj,1:nlay_s,:) - e_s_b(ji,jj,1:nlay_s,:) )  ) * r1_rdtice 
    138                !                 ! salt, volume 
    139                diag_sice(ji,jj) = SUM( sv_i(ji,jj,:) - sv_i_b(ji,jj,:) ) * rhoi * r1_rdtice 
    140                diag_vice(ji,jj) = SUM( v_i (ji,jj,:) - v_i_b (ji,jj,:) ) * rhoi * r1_rdtice 
    141                diag_vsnw(ji,jj) = SUM( v_s (ji,jj,:) - v_s_b (ji,jj,:) ) * rhos * r1_rdtice 
    142             END DO 
    143          END DO 
     127         IF( ln_icediachk .OR. iom_use('hfxdhc') ) THEN 
     128            diag_heat(:,:) = - SUM(SUM( e_i (:,:,1:nlay_i,:) - e_i_b (:,:,1:nlay_i,:), dim=4 ), dim=3 ) * r1_rdtice &      ! W.m-2 
     129               &             - SUM(SUM( e_s (:,:,1:nlay_s,:) - e_s_b (:,:,1:nlay_s,:), dim=4 ), dim=3 ) * r1_rdtice 
     130            diag_sice(:,:) =   SUM(     sv_i(:,:,:)          - sv_i_b(:,:,:)                  , dim=3 ) * r1_rdtice * rhoi 
     131            diag_vice(:,:) =   SUM(     v_i (:,:,:)          - v_i_b (:,:,:)                  , dim=3 ) * r1_rdtice * rhoi 
     132            diag_vsnw(:,:) =   SUM(     v_s (:,:,:)          - v_s_b (:,:,:)                  , dim=3 ) * r1_rdtice * rhos 
     133         ENDIF 
    144134         !                       ! concentration tendency (dynamics) 
    145          zafx   (:,:) = SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice  
    146          afx_tot(:,:) = zafx(:,:) 
    147          IF( iom_use('afxdyn') )   CALL iom_put( 'afxdyn' , zafx(:,:) ) 
     135         IF( iom_use('afxdyn') .OR. iom_use('afxthd') .OR. iom_use('afxtot') ) THEN  
     136            zafx(:,:) = SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice  
     137            CALL iom_put( 'afxdyn' , zafx ) 
     138         ENDIF 
    148139         ! 
    149140      CASE( 2 )                        !--- thermo trend diagnostics & ice aging 
     
    151142         oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * rdt_ice   ! ice natural aging incrementation 
    152143         ! 
    153 !!gm   here I think the number of ice cat is too small to use a SUM instruction... 
    154          DO jj = 1, jpj 
    155             DO ji = 1, jpi             
    156                !                 ! heat content variation (W.m-2) 
    157                diag_heat(ji,jj) = diag_heat(ji,jj) - (  SUM( e_i(ji,jj,1:nlay_i,:) - e_i_b(ji,jj,1:nlay_i,:) )    &  
    158                   &                                   + SUM( e_s(ji,jj,1:nlay_s,:) - e_s_b(ji,jj,1:nlay_s,:) )  ) * r1_rdtice 
    159                !                 ! salt, volume 
    160                diag_sice(ji,jj) = diag_sice(ji,jj) + SUM( sv_i(ji,jj,:) - sv_i_b(ji,jj,:) ) * rhoi * r1_rdtice 
    161                diag_vice(ji,jj) = diag_vice(ji,jj) + SUM( v_i (ji,jj,:) - v_i_b (ji,jj,:) ) * rhoi * r1_rdtice 
    162                diag_vsnw(ji,jj) = diag_vsnw(ji,jj) + SUM( v_s (ji,jj,:) - v_s_b (ji,jj,:) ) * rhos * r1_rdtice 
    163             END DO 
    164          END DO 
     144         IF( ln_icediachk .OR. iom_use('hfxdhc') ) THEN 
     145            diag_heat(:,:) = diag_heat(:,:) & 
     146               &             - SUM(SUM( e_i (:,:,1:nlay_i,:) - e_i_b (:,:,1:nlay_i,:), dim=4 ), dim=3 ) * r1_rdtice & 
     147               &             - SUM(SUM( e_s (:,:,1:nlay_s,:) - e_s_b (:,:,1:nlay_s,:), dim=4 ), dim=3 ) * r1_rdtice 
     148            diag_sice(:,:) = diag_sice(:,:) & 
     149               &             + SUM(     sv_i(:,:,:)          - sv_i_b(:,:,:)                  , dim=3 ) * r1_rdtice * rhoi 
     150            diag_vice(:,:) = diag_vice(:,:) & 
     151               &             + SUM(     v_i (:,:,:)          - v_i_b (:,:,:)                  , dim=3 ) * r1_rdtice * rhoi 
     152            diag_vsnw(:,:) = diag_vsnw(:,:) & 
     153               &             + SUM(     v_s (:,:,:)          - v_s_b (:,:,:)                  , dim=3 ) * r1_rdtice * rhos 
     154            CALL iom_put ( 'hfxdhc' , diag_heat )  
     155         ENDIF 
    165156         !                       ! concentration tendency (total + thermo) 
    166          zafx   (:,:) = SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice 
    167          afx_tot(:,:) = afx_tot(:,:) + zafx(:,:) 
    168          IF( iom_use('afxthd') )   CALL iom_put( 'afxthd' , zafx(:,:) ) 
    169          IF( iom_use('afxtot') )   CALL iom_put( 'afxtot' , afx_tot(:,:) ) 
     157         IF( iom_use('afxdyn') .OR. iom_use('afxthd') .OR. iom_use('afxtot') ) THEN  
     158            zafx(:,:) = zafx(:,:) + SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice 
     159            CALL iom_put( 'afxthd' , SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_rdtice ) 
     160            CALL iom_put( 'afxtot' , zafx ) 
     161         ENDIF 
    170162         ! 
    171163      END SELECT 
     
    174166      IF( ln_icediachk   )   CALL ice_cons_hsm(1, 'icecor', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation 
    175167      IF( ln_ctl         )   CALL ice_prt3D   ('icecor')                                                             ! prints 
    176       IF( ln_icectl .AND. kn == 2 )   CALL ice_prt( kt, iiceprt, jiceprt, 2, ' - Final state - ' )                   ! prints 
     168      IF( ln_icectl .AND. kn == 2 ) & 
     169         &                   CALL ice_prt     ( kt, iiceprt, jiceprt, 2, ' - Final state - ' )                       ! prints 
    177170      IF( ln_timing      )   CALL timing_stop ('icecor')                                                             ! timing 
    178171      ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icectl.F90

    r10994 r11413  
    157157            ! check conservation issues 
    158158            IF ( ABS( zv ) > zv_sill )   WRITE(numout,*) 'violation volume [Mt/day]     (',cd_routine,') = ',zv 
    159             IF ( ABS( zs ) > zs_sill )   WRITE(numout,*) 'violation saline [psu*Mt/day] (',cd_routine,') = ',zs 
     159            IF ( ABS( zs ) > zs_sill )   WRITE(numout,*) 'violation saline [Mkg/day]    (',cd_routine,') = ',zs 
    160160            IF ( ABS( zt ) > zt_sill )   WRITE(numout,*) 'violation enthalpy [GW]       (',cd_routine,') = ',zt 
    161161            ! check maximum ice concentration 
     
    218218      IF(lwp) THEN 
    219219         IF( ABS( zvfx ) > zv_sill )   WRITE(numout,*) 'violation vfx  [Mt/day]       (',cd_routine,') = ',zvfx 
    220          IF( ABS( zsfx ) > zs_sill )   WRITE(numout,*) 'violation sfx  [psu*Mt/day]   (',cd_routine,') = ',zsfx 
     220         IF( ABS( zsfx ) > zs_sill )   WRITE(numout,*) 'violation sfx  [Mkg/day]      (',cd_routine,') = ',zsfx 
    221221         !!IF( ABS( zhfx ) > zt_sill )   WRITE(numout,*) 'violation hfx  [GW]           (',cd_routine,') = ',zhfx 
    222222      ENDIF 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icedia.F90

    r11348 r11413  
    3434   PUBLIC   ice_dia_init   ! called in icestp.F90 
    3535 
    36    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   vol_loc_ini, sal_loc_ini, tem_loc_ini ! initial volume, salt and heat contents 
     36   REAL(wp), SAVE ::   z1_e1e2  ! inverse of the ocean area 
     37   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   vol_loc_ini, sal_loc_ini, tem_loc_ini                    ! initial volume, salt and heat contents 
    3738   REAL(wp)                              ::   frc_sal, frc_voltop, frc_volbot, frc_temtop, frc_tembot  ! global forcing trends 
    3839    
     
    8081      ENDIF 
    8182 
    82 !!gm glob_sum includes a " * tmask_i ", so remove  " * tmask(:,:,1) " 
    83  
     83      IF( kt == nit000 ) THEN 
     84         z1_e1e2 = 1._wp / glob_sum( 'icedia', e1e2t(:,:) ) 
     85      ENDIF 
     86       
    8487      ! ----------------------- ! 
    85       ! 1 -  Contents ! 
     88      ! 1 -  Contents           ! 
    8689      ! ----------------------- ! 
    87       zbg_ivol = glob_sum( 'icedia', vt_i(:,:) * e1e2t(:,:) ) * 1.e-9                  ! ice volume (km3) 
    88       zbg_svol = glob_sum( 'icedia', vt_s(:,:) * e1e2t(:,:) ) * 1.e-9                  ! snow volume (km3) 
    89       zbg_area = glob_sum( 'icedia', at_i(:,:) * e1e2t(:,:) ) * 1.e-6                  ! area (km2) 
    90       zbg_isal = glob_sum( 'icedia', SUM( sv_i(:,:,:), dim=3 ) * e1e2t(:,:) ) * 1.e-9  ! salt content (pss*km3) 
    91       zbg_item = glob_sum( 'icedia', et_i * e1e2t(:,:) ) * 1.e-20                      ! heat content (1.e20 J) 
    92       zbg_stem = glob_sum( 'icedia', et_s * e1e2t(:,:) ) * 1.e-20                      ! heat content (1.e20 J) 
    93        
     90      IF(  iom_use('ibgvol_tot' ) .OR. iom_use('sbgvol_tot' ) .OR. iom_use('ibgarea_tot') .OR. & 
     91         & iom_use('ibgsalt_tot') .OR. iom_use('ibgheat_tot') .OR. iom_use('sbgheat_tot') ) THEN 
     92 
     93         zbg_ivol = glob_sum( 'icedia', vt_i(:,:) * e1e2t(:,:) ) * 1.e-9  ! ice volume (km3) 
     94         zbg_svol = glob_sum( 'icedia', vt_s(:,:) * e1e2t(:,:) ) * 1.e-9  ! snow volume (km3) 
     95         zbg_area = glob_sum( 'icedia', at_i(:,:) * e1e2t(:,:) ) * 1.e-6  ! area (km2) 
     96         zbg_isal = glob_sum( 'icedia', st_i(:,:) * e1e2t(:,:) ) * 1.e-9  ! salt content (pss*km3) 
     97         zbg_item = glob_sum( 'icedia', et_i(:,:) * e1e2t(:,:) ) * 1.e-20 ! heat content (1.e20 J) 
     98         zbg_stem = glob_sum( 'icedia', et_s(:,:) * e1e2t(:,:) ) * 1.e-20 ! heat content (1.e20 J) 
     99 
     100         CALL iom_put( 'ibgvol_tot'  , zbg_ivol )  
     101         CALL iom_put( 'sbgvol_tot'  , zbg_svol )  
     102         CALL iom_put( 'ibgarea_tot' , zbg_area )  
     103         CALL iom_put( 'ibgsalt_tot' , zbg_isal )  
     104         CALL iom_put( 'ibgheat_tot' , zbg_item )  
     105         CALL iom_put( 'sbgheat_tot' , zbg_stem )  
     106  
     107      ENDIF 
     108 
    94109      ! ---------------------------! 
    95110      ! 2 - Trends due to forcing  ! 
    96111      ! ---------------------------! 
     112      ! they must be kept outside an IF(iom_use) because of the call to dia_rst below 
    97113      z_frc_volbot = r1_rau0 * glob_sum( 'icedia', -( wfx_ice(:,:) + wfx_snw(:,:) + wfx_err_sub(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater flux ice/snow-ocean  
    98114      z_frc_voltop = r1_rau0 * glob_sum( 'icedia', -( wfx_sub(:,:) + wfx_spr(:,:) )                    * e1e2t(:,:) ) * 1.e-9   ! freshwater flux ice/snow-atm 
     
    106122      frc_temtop  = frc_temtop  + z_frc_temtop  * rdt_ice ! 1.e20 J 
    107123      frc_tembot  = frc_tembot  + z_frc_tembot  * rdt_ice ! 1.e20 J 
     124 
     125      CALL iom_put( 'ibgfrcvoltop' , frc_voltop )   ! vol  forcing ice/snw-atm          (km3 equivalent ocean water)  
     126      CALL iom_put( 'ibgfrcvolbot' , frc_volbot )   ! vol  forcing ice/snw-ocean        (km3 equivalent ocean water)  
     127      CALL iom_put( 'ibgfrcsal'    , frc_sal    )   ! sal - forcing                     (psu*km3 equivalent ocean water)    
     128      CALL iom_put( 'ibgfrctemtop' , frc_temtop )   ! heat on top of ice/snw/ocean      (1.e20 J)    
     129      CALL iom_put( 'ibgfrctembot' , frc_tembot )   ! heat on top of ocean(below ice)   (1.e20 J)    
     130 
     131      IF(  iom_use('ibgfrchfxtop') .OR. iom_use('ibgfrchfxbot') ) THEN 
     132         CALL iom_put( 'ibgfrchfxtop' , frc_temtop * z1_e1e2 * 1.e-20 * kt*rdt ) ! heat on top of ice/snw/ocean      (W/m2) 
     133         CALL iom_put( 'ibgfrchfxbot' , frc_tembot * z1_e1e2 * 1.e-20 * kt*rdt ) ! heat on top of ocean(below ice)   (W/m2)  
     134      ENDIF 
     135       
     136      ! ---------------------------------- ! 
     137      ! 3 -  Content variations and drifts ! 
     138      ! ---------------------------------- ! 
     139      IF(  iom_use('ibgvolume') .OR. iom_use('ibgsaltco') .OR. iom_use('ibgheatco') .OR. iom_use('ibgheatfx') ) THEN 
    108140             
    109       ! ----------------------- ! 
    110       ! 3 -  Content variations ! 
    111       ! ----------------------- ! 
    112       zdiff_vol = r1_rau0 * glob_sum( 'icedia', ( rhoi*vt_i(:,:) + rhos*vt_s(:,:) - vol_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater trend (km3)  
    113       zdiff_sal = r1_rau0 * glob_sum( 'icedia', ( rhoi* SUM( sv_i(:,:,:), dim=3 ) - sal_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! salt content trend (km3*pss) 
    114       zdiff_tem =           glob_sum( 'icedia', ( et_i(:,:) + et_s(:,:)           - tem_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-20  ! heat content trend (1.e20 J) 
    115       !                               + SUM( qevap_ice * a_i_b, dim=3 )       !! clem: I think this term should not be there (but needs a check) 
    116  
    117       ! ----------------------- ! 
    118       ! 4 -  Drifts             ! 
    119       ! ----------------------- ! 
    120       zdiff_vol = zdiff_vol - ( frc_voltop + frc_volbot ) 
    121       zdiff_sal = zdiff_sal - frc_sal 
    122       zdiff_tem = zdiff_tem - ( frc_tembot - frc_temtop ) 
    123  
    124       ! ----------------------- ! 
    125       ! 5 - Diagnostics writing ! 
    126       ! ----------------------- ! 
    127 !!gm I don't understand the division by the ocean surface (i.e. glob_sum( 'icedia', e1e2t(:,:) ) * 1.e-20 * kt*rdt ) 
    128 !!   and its multiplication bu kt ! is it really what we want ? what is this quantity ? 
    129 !!   IF it is really what we want, compute it at kt=nit000, not 3 time by time-step ! 
    130 !!   kt*rdt  : you mean rdtice ? 
    131 !!gm 
    132       ! 
    133       IF( iom_use('ibgvolume')    )   CALL iom_put( 'ibgvolume' , zdiff_vol     )   ! ice/snow volume  drift            (km3 equivalent ocean water)          
    134       IF( iom_use('ibgsaltco')    )   CALL iom_put( 'ibgsaltco' , zdiff_sal     )   ! ice salt content drift            (psu*km3 equivalent ocean water) 
    135       IF( iom_use('ibgheatco')    )   CALL iom_put( 'ibgheatco' , zdiff_tem     )   ! ice/snow heat content drift       (1.e20 J) 
    136       IF( iom_use('ibgheatfx')    )   CALL iom_put( 'ibgheatfx' ,               &   ! ice/snow heat flux drift          (W/m2) 
    137          &                                                     zdiff_tem /glob_sum( 'icedia', e1e2t(:,:) * 1.e-20 * kt*rdt ) ) 
    138  
    139       IF( iom_use('ibgfrcvoltop') )   CALL iom_put( 'ibgfrcvoltop' , frc_voltop )   ! vol  forcing ice/snw-atm          (km3 equivalent ocean water)  
    140       IF( iom_use('ibgfrcvolbot') )   CALL iom_put( 'ibgfrcvolbot' , frc_volbot )   ! vol  forcing ice/snw-ocean        (km3 equivalent ocean water)  
    141       IF( iom_use('ibgfrcsal')    )   CALL iom_put( 'ibgfrcsal'    , frc_sal    )   ! sal - forcing                     (psu*km3 equivalent ocean water)    
    142       IF( iom_use('ibgfrctemtop') )   CALL iom_put( 'ibgfrctemtop' , frc_temtop )   ! heat on top of ice/snw/ocean      (1.e20 J)    
    143       IF( iom_use('ibgfrctembot') )   CALL iom_put( 'ibgfrctembot' , frc_tembot )   ! heat on top of ocean(below ice)   (1.e20 J)    
    144       IF( iom_use('ibgfrchfxtop') )   CALL iom_put( 'ibgfrchfxtop' ,            &   ! heat on top of ice/snw/ocean      (W/m2)  
    145          &                                                          frc_temtop / glob_sum( 'icedia', e1e2t(:,:) ) * 1.e-20 * kt*rdt  ) 
    146       IF( iom_use('ibgfrchfxbot') )   CALL iom_put( 'ibgfrchfxbot' ,            &   ! heat on top of ocean(below ice)   (W/m2)  
    147          &                                                          frc_tembot / glob_sum( 'icedia', e1e2t(:,:) ) * 1.e-20 * kt*rdt  ) 
    148  
    149       IF( iom_use('ibgvol_tot' )  )   CALL iom_put( 'ibgvol_tot'  , zbg_ivol     )   ! ice volume                       (km3) 
    150       IF( iom_use('sbgvol_tot' )  )   CALL iom_put( 'sbgvol_tot'  , zbg_svol     )   ! snow volume                      (km3) 
    151       IF( iom_use('ibgarea_tot')  )   CALL iom_put( 'ibgarea_tot' , zbg_area     )   ! ice area                         (km2) 
    152       IF( iom_use('ibgsalt_tot')  )   CALL iom_put( 'ibgsalt_tot' , zbg_isal     )   ! ice salinity content             (pss*km3) 
    153       IF( iom_use('ibgheat_tot')  )   CALL iom_put( 'ibgheat_tot' , zbg_item     )   ! ice heat content                 (1.e20 J) 
    154       IF( iom_use('sbgheat_tot')  )   CALL iom_put( 'sbgheat_tot' , zbg_stem     )   ! snow heat content                (1.e20 J) 
    155       ! 
     141         zdiff_vol = r1_rau0 * glob_sum( 'icedia', ( rhoi*vt_i(:,:) + rhos*vt_s(:,:) - vol_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater trend (km3)  
     142         zdiff_sal = r1_rau0 * glob_sum( 'icedia', ( rhoi*st_i(:,:)                  - sal_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! salt content trend (km3*pss) 
     143         zdiff_tem =           glob_sum( 'icedia', ( et_i(:,:) + et_s(:,:)           - tem_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-20  ! heat content trend (1.e20 J) 
     144         !                               + SUM( qevap_ice * a_i_b, dim=3 )       !! clem: I think this term should not be there (but needs a check) 
     145          
     146         zdiff_vol = zdiff_vol - ( frc_voltop + frc_volbot ) 
     147         zdiff_sal = zdiff_sal - frc_sal 
     148         zdiff_tem = zdiff_tem - ( frc_tembot - frc_temtop ) 
     149          
     150         CALL iom_put( 'ibgvolume' , zdiff_vol )   ! ice/snow volume  drift            (km3 equivalent ocean water)          
     151         CALL iom_put( 'ibgsaltco' , zdiff_sal )   ! ice salt content drift            (psu*km3 equivalent ocean water) 
     152         CALL iom_put( 'ibgheatco' , zdiff_tem )   ! ice/snow heat content drift       (1.e20 J) 
     153         ! 
     154      ENDIF 
     155       
    156156      IF( lrst_ice )   CALL ice_dia_rst( 'WRITE', kt_ice ) 
    157157      ! 
     
    248248            vol_loc_ini(:,:) = rhoi * vt_i(:,:) + rhos * vt_s(:,:)  ! ice/snow volume (kg/m2) 
    249249            tem_loc_ini(:,:) = et_i(:,:) + et_s(:,:)                ! ice/snow heat content (J) 
    250             sal_loc_ini(:,:) = rhoi * SUM( sv_i(:,:,:), dim=3 )     ! ice salt content (pss*kg/m2) 
     250            sal_loc_ini(:,:) = rhoi * st_i(:,:)                     ! ice salt content (pss*kg/m2) 
    251251         ENDIF 
    252252         ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icedyn.F90

    r11348 r11413  
    163163            END DO 
    164164            CALL lbc_lnk( 'icedyn', zdivu_i, 'T', 1. ) 
    165             CALL iom_put( "icediv" , zdivu_i(:,:) ) 
     165            ! output 
     166            CALL iom_put( 'icediv' , zdivu_i ) 
     167 
    166168            DEALLOCATE( zdivu_i ) 
    167169 
     
    219221      NAMELIST/namdyn/ ln_dynALL, ln_dynRHGADV, ln_dynADV1D, ln_dynADV2D, rn_uice, rn_vice,  & 
    220222         &             rn_ishlat ,                                                           & 
    221          &             ln_landfast_L16, ln_landfast_home, rn_depfra, rn_icebfr, rn_lfrelax, rn_tensile 
     223         &             ln_landfast_L16, rn_depfra, rn_icebfr, rn_lfrelax, rn_tensile 
    222224      !!------------------------------------------------------------------- 
    223225      ! 
     
    242244         WRITE(numout,*) '      lateral boundary condition for sea ice dynamics        rn_ishlat       = ', rn_ishlat 
    243245         WRITE(numout,*) '      Landfast: param from Lemieux 2016                      ln_landfast_L16 = ', ln_landfast_L16 
    244          WRITE(numout,*) '      Landfast: param from home made                         ln_landfast_home= ', ln_landfast_home 
    245246         WRITE(numout,*) '         fraction of ocean depth that ice must reach         rn_depfra       = ', rn_depfra 
    246247         WRITE(numout,*) '         maximum bottom stress per unit area of contact      rn_icebfr       = ', rn_icebfr 
     
    269270      ENDIF 
    270271      !                                      !--- Landfast ice 
    271       IF( .NOT.ln_landfast_L16 .AND. .NOT.ln_landfast_home )   tau_icebfr(:,:) = 0._wp 
    272       ! 
    273       IF ( ln_landfast_L16 .AND. ln_landfast_home ) THEN 
    274          CALL ctl_stop( 'ice_dyn_init: choose one and only one landfast parameterization (ln_landfast_L16 or ln_landfast_home)' ) 
    275       ENDIF 
     272      IF( .NOT.ln_landfast_L16 )   tau_icebfr(:,:) = 0._wp 
    276273      ! 
    277274      CALL ice_dyn_rdgrft_init          ! set ice ridging/rafting parameters 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icedyn_adv.F90

    r11348 r11413  
    100100      diag_trp_vi(:,:) = SUM(     v_i (:,:,:)          - v_i_b (:,:,:)                  , dim=3 ) * r1_rdtice 
    101101      diag_trp_vs(:,:) = SUM(     v_s (:,:,:)          - v_s_b (:,:,:)                  , dim=3 ) * r1_rdtice 
    102       IF( iom_use('icemtrp') )   CALL iom_put( "icemtrp" , diag_trp_vi * rhoi          )   ! ice mass transport 
    103       IF( iom_use('snwmtrp') )   CALL iom_put( "snwmtrp" , diag_trp_vs * rhos          )   ! snw mass transport 
    104       IF( iom_use('salmtrp') )   CALL iom_put( "salmtrp" , diag_trp_sv * rhoi * 1.e-03 )   ! salt mass transport (kg/m2/s) 
    105       IF( iom_use('dihctrp') )   CALL iom_put( "dihctrp" , -diag_trp_ei                )   ! advected ice heat content (W/m2) 
    106       IF( iom_use('dshctrp') )   CALL iom_put( "dshctrp" , -diag_trp_es                )   ! advected snw heat content (W/m2) 
     102      IF( iom_use('icemtrp') )   CALL iom_put( 'icemtrp' , diag_trp_vi * rhoi          )   ! ice mass transport 
     103      IF( iom_use('snwmtrp') )   CALL iom_put( 'snwmtrp' , diag_trp_vs * rhos          )   ! snw mass transport 
     104      IF( iom_use('salmtrp') )   CALL iom_put( 'salmtrp' , diag_trp_sv * rhoi * 1.e-03 )   ! salt mass transport (kg/m2/s) 
     105      IF( iom_use('dihctrp') )   CALL iom_put( 'dihctrp' , -diag_trp_ei                 )   ! advected ice heat content (W/m2) 
     106      IF( iom_use('dshctrp') )   CALL iom_put( 'dshctrp' , -diag_trp_es                 )   ! advected snw heat content (W/m2) 
    107107 
    108108      ! controls 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icedyn_rhg.F90

    r11348 r11413  
    6969         WRITE(numout,*)'ice_dyn_rhg: sea-ice rheology' 
    7070         WRITE(numout,*)'~~~~~~~~~~~' 
    71       ENDIF 
    72       ! 
    73       IF( ln_landfast_home ) THEN      !-- Landfast ice parameterization 
    74          tau_icebfr(:,:) = 0._wp 
    75          DO jl = 1, jpl 
    76             WHERE( h_i(:,:,jl) > ht_n(:,:) * rn_depfra )   tau_icebfr(:,:) = tau_icebfr(:,:) + a_i(:,:,jl) * rn_icebfr 
    77          END DO 
    7871      ENDIF 
    7972      ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icedyn_rhg_evp.F90

    r10891 r11413  
    112112      REAL(wp), DIMENSION(:,:), INTENT(  out) ::   pshear_i  , pdivu_i   , pdelta_i      ! 
    113113      !! 
    114       LOGICAL, PARAMETER ::   ll_bdy_substep = .TRUE. ! temporary option to call bdy at each sub-time step (T) 
    115       !                                                                              or only at the main time step (F) 
    116114      INTEGER ::   ji, jj       ! dummy loop indices 
    117115      INTEGER ::   jter         ! local integers 
     
    137135      ! 
    138136      REAL(wp), DIMENSION(jpi,jpj) ::   zdt_m                           ! (dt / ice-snow_mass) on T points 
    139       REAL(wp), DIMENSION(jpi,jpj) ::   zaU   , zaV                     ! ice fraction on U/V points 
     137      REAL(wp), DIMENSION(jpi,jpj) ::   zaU  , zaV                      ! ice fraction on U/V points 
    140138      REAL(wp), DIMENSION(jpi,jpj) ::   zmU_t, zmV_t                    ! (ice-snow_mass / dt) on U/V points 
    141139      REAL(wp), DIMENSION(jpi,jpj) ::   zmf                             ! coriolis parameter at T points 
    142       REAL(wp), DIMENSION(jpi,jpj) ::   zTauU_ia , ztauV_ia             ! ice-atm. stress at U-V points 
    143       REAL(wp), DIMENSION(jpi,jpj) ::   zTauU_ib , ztauV_ib             ! ice-bottom stress at U-V points (landfast param) 
    144       REAL(wp), DIMENSION(jpi,jpj) ::   zspgU , zspgV                   ! surface pressure gradient at U/V points 
    145140      REAL(wp), DIMENSION(jpi,jpj) ::   v_oceU, u_oceV, v_iceU, u_iceV  ! ocean/ice u/v component on V/U points                            
    146       REAL(wp), DIMENSION(jpi,jpj) ::   zfU   , zfV                     ! internal stresses 
    147141      ! 
    148142      REAL(wp), DIMENSION(jpi,jpj) ::   zds                             ! shear 
     
    152146      !                                                                 !    ocean surface (ssh_m) if ice is not embedded 
    153147      !                                                                 !    ice bottom surface if ice is embedded    
    154       REAL(wp), DIMENSION(jpi,jpj) ::   zCorx, zCory                    ! Coriolis stress array 
    155       REAL(wp), DIMENSION(jpi,jpj) ::   ztaux_oi, ztauy_oi              ! Ocean-to-ice stress array 
    156       ! 
    157       REAL(wp), DIMENSION(jpi,jpj) ::   zswitchU, zswitchV              ! dummy arrays 
    158       REAL(wp), DIMENSION(jpi,jpj) ::   zmaskU, zmaskV                  ! mask for ice presence 
     148      REAL(wp), DIMENSION(jpi,jpj) ::   zfU  , zfV                      ! internal stresses 
     149      REAL(wp), DIMENSION(jpi,jpj) ::   zspgU, zspgV                    ! surface pressure gradient at U/V points 
     150      REAL(wp), DIMENSION(jpi,jpj) ::   zCorU, zCorV                    ! Coriolis stress array 
     151      REAL(wp), DIMENSION(jpi,jpj) ::   ztaux_ai, ztauy_ai              ! ice-atm. stress at U-V points 
     152      REAL(wp), DIMENSION(jpi,jpj) ::   ztaux_oi, ztauy_oi              ! ice-ocean stress at U-V points 
     153      REAL(wp), DIMENSION(jpi,jpj) ::   ztaux_bi, ztauy_bi              ! ice-OceanBottom stress at U-V points (landfast) 
     154      REAL(wp), DIMENSION(jpi,jpj) ::   ztaux_base, ztauy_base          ! ice-bottom stress at U-V points (landfast) 
     155      ! 
     156      REAL(wp), DIMENSION(jpi,jpj) ::   zmsk01x, zmsk01y                ! dummy arrays 
     157      REAL(wp), DIMENSION(jpi,jpj) ::   zmsk00x, zmsk00y                ! mask for ice presence 
    159158      REAL(wp), DIMENSION(jpi,jpj) ::   zfmask, zwf                     ! mask at F points for the ice 
    160159 
     
    163162      REAL(wp), PARAMETER          ::   zamin  = 0.001_wp               ! ice concentration below which ice velocity becomes very small 
    164163      !! --- diags 
    165       REAL(wp), DIMENSION(jpi,jpj) ::   zswi 
     164      REAL(wp), DIMENSION(jpi,jpj) ::   zmsk00 
    166165      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zsig1, zsig2, zsig3 
    167166      !! --- SIMIP diags 
    168       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_sig1      ! Average normal stress in sea ice    
    169       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_sig2      ! Maximum shear stress in sea ice 
    170       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_dssh_dx   ! X-direction sea-surface tilt term (N/m2) 
    171       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_dssh_dy   ! X-direction sea-surface tilt term (N/m2) 
    172       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_corstrx   ! X-direction coriolis stress (N/m2) 
    173       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_corstry   ! Y-direction coriolis stress (N/m2) 
    174       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_intstrx   ! X-direction internal stress (N/m2) 
    175       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_intstry   ! Y-direction internal stress (N/m2) 
    176       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_utau_oi   ! X-direction ocean-ice stress 
    177       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_vtau_oi   ! Y-direction ocean-ice stress   
    178167      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_xmtrp_ice ! X-component of ice mass transport (kg/s) 
    179168      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_ymtrp_ice ! Y-component of ice mass transport (kg/s) 
     
    264253 
    265254      ! landfast param from Lemieux(2016): add isotropic tensile strength (following Konig Beatty and Holland, 2010) 
    266       IF( ln_landfast_L16 .OR. ln_landfast_home ) THEN   ;   zkt = rn_tensile 
    267       ELSE                                               ;   zkt = 0._wp 
     255      IF( ln_landfast_L16 ) THEN   ;   zkt = rn_tensile 
     256      ELSE                         ;   zkt = 0._wp 
    268257      ENDIF 
    269258      ! 
     
    308297             
    309298            ! Drag ice-atm. 
    310             zTauU_ia(ji,jj) = zaU(ji,jj) * utau_ice(ji,jj) 
    311             zTauV_ia(ji,jj) = zaV(ji,jj) * vtau_ice(ji,jj) 
     299            ztaux_ai(ji,jj) = zaU(ji,jj) * utau_ice(ji,jj) 
     300            ztauy_ai(ji,jj) = zaV(ji,jj) * vtau_ice(ji,jj) 
    312301 
    313302            ! Surface pressure gradient (- m*g*GRAD(ssh)) at U-V points 
     
    316305 
    317306            ! masks 
    318             zmaskU(ji,jj) = 1._wp - MAX( 0._wp, SIGN( 1._wp, -zmassU ) )  ! 0 if no ice 
    319             zmaskV(ji,jj) = 1._wp - MAX( 0._wp, SIGN( 1._wp, -zmassV ) )  ! 0 if no ice 
     307            zmsk00x(ji,jj) = 1._wp - MAX( 0._wp, SIGN( 1._wp, -zmassU ) )  ! 0 if no ice 
     308            zmsk00y(ji,jj) = 1._wp - MAX( 0._wp, SIGN( 1._wp, -zmassV ) )  ! 0 if no ice 
    320309 
    321310            ! switches 
    322             IF( zmassU <= zmmin .AND. zaU(ji,jj) <= zamin ) THEN   ;   zswitchU(ji,jj) = 0._wp 
    323             ELSE                                                   ;   zswitchU(ji,jj) = 1._wp   ;   ENDIF 
    324             IF( zmassV <= zmmin .AND. zaV(ji,jj) <= zamin ) THEN   ;   zswitchV(ji,jj) = 0._wp 
    325             ELSE                                                   ;   zswitchV(ji,jj) = 1._wp   ;   ENDIF 
     311            IF( zmassU <= zmmin .AND. zaU(ji,jj) <= zamin ) THEN   ;   zmsk01x(ji,jj) = 0._wp 
     312            ELSE                                                   ;   zmsk01x(ji,jj) = 1._wp   ;   ENDIF 
     313            IF( zmassV <= zmmin .AND. zaV(ji,jj) <= zamin ) THEN   ;   zmsk01y(ji,jj) = 0._wp 
     314            ELSE                                                   ;   zmsk01y(ji,jj) = 1._wp   ;   ENDIF 
    326315 
    327316         END DO 
     
    339328               ! ice-bottom stress at U points 
    340329               zvCr = zaU(ji,jj) * rn_depfra * hu_n(ji,jj) 
    341                zTauU_ib(ji,jj)   = rn_icebfr * MAX( 0._wp, zvU - zvCr ) * EXP( -rn_crhg * ( 1._wp - zaU(ji,jj) ) ) 
     330               ztaux_base(ji,jj) = - rn_icebfr * MAX( 0._wp, zvU - zvCr ) * EXP( -rn_crhg * ( 1._wp - zaU(ji,jj) ) ) 
    342331               ! ice-bottom stress at V points 
    343332               zvCr = zaV(ji,jj) * rn_depfra * hv_n(ji,jj) 
    344                zTauV_ib(ji,jj)   = rn_icebfr * MAX( 0._wp, zvV - zvCr ) * EXP( -rn_crhg * ( 1._wp - zaV(ji,jj) ) ) 
     333               ztauy_base(ji,jj) = - rn_icebfr * MAX( 0._wp, zvV - zvCr ) * EXP( -rn_crhg * ( 1._wp - zaV(ji,jj) ) ) 
    345334               ! ice_bottom stress at T points 
    346335               zvCr = at_i(ji,jj) * rn_depfra * ht_n(ji,jj) 
    347                tau_icebfr(ji,jj) = rn_icebfr * MAX( 0._wp, vt_i(ji,jj) - zvCr ) * EXP( -rn_crhg * ( 1._wp - at_i(ji,jj) ) ) 
     336               tau_icebfr(ji,jj) = - rn_icebfr * MAX( 0._wp, vt_i(ji,jj) - zvCr ) * EXP( -rn_crhg * ( 1._wp - at_i(ji,jj) ) ) 
    348337            END DO 
    349338         END DO 
    350339         CALL lbc_lnk( 'icedyn_rhg_evp', tau_icebfr(:,:), 'T', 1. ) 
    351340         ! 
    352       ELSEIF( ln_landfast_home ) THEN          !-- Home made 
     341      ELSE                               !-- no landfast 
    353342         DO jj = 2, jpjm1 
    354343            DO ji = fs_2, fs_jpim1 
    355                zTauU_ib(ji,jj) = tau_icebfr(ji,jj) 
    356                zTauV_ib(ji,jj) = tau_icebfr(ji,jj) 
    357             END DO 
    358          END DO 
    359          ! 
    360       ELSE                                     !-- no landfast 
    361          DO jj = 2, jpjm1 
    362             DO ji = fs_2, fs_jpim1 
    363                zTauU_ib(ji,jj) = 0._wp 
    364                zTauV_ib(ji,jj) = 0._wp 
     344               ztaux_base(ji,jj) = 0._wp 
     345               ztauy_base(ji,jj) = 0._wp 
    365346            END DO 
    366347         END DO 
    367348      ENDIF 
    368       IF( iom_use('tau_icebfr') )   CALL iom_put( 'tau_icebfr', tau_icebfr(:,:) ) 
    369349 
    370350      !------------------------------------------------------------------------------! 
     
    372352      !------------------------------------------------------------------------------! 
    373353      ! 
    374       !                                               !----------------------! 
     354      !                                               ! ==================== ! 
    375355      DO jter = 1 , nn_nevp                           !    loop over jter    ! 
    376          !                                            !----------------------!         
     356         !                                            ! ==================== !         
    377357         l_full_nf_update = jter == nn_nevp   ! false: disable full North fold update (performances) for iter = 1 to nn_nevp-1 
    378358         ! 
     
    504484                  !                 !--- tau_bottom/v_ice 
    505485                  zvel  = 5.e-05_wp + SQRT( v_ice(ji,jj) * v_ice(ji,jj) + u_iceV(ji,jj) * u_iceV(ji,jj) ) 
    506                   zTauB = - zTauV_ib(ji,jj) / zvel 
     486                  zTauB = ztauy_base(ji,jj) / zvel 
     487                  !                 !--- OceanBottom-to-Ice stress 
     488                  ztauy_bi(ji,jj) = zTauB * v_ice(ji,jj) 
    507489                  ! 
    508490                  !                 !--- Coriolis at V-points (energy conserving formulation) 
    509                   zCory(ji,jj)  = - 0.25_wp * r1_e2v(ji,jj) *  & 
     491                  zCorV(ji,jj)  = - 0.25_wp * r1_e2v(ji,jj) *  & 
    510492                     &    ( zmf(ji,jj  ) * ( e2u(ji,jj  ) * u_ice(ji,jj  ) + e2u(ji-1,jj  ) * u_ice(ji-1,jj  ) )  & 
    511493                     &    + zmf(ji,jj+1) * ( e2u(ji,jj+1) * u_ice(ji,jj+1) + e2u(ji-1,jj+1) * u_ice(ji-1,jj+1) ) ) 
    512494                  ! 
    513495                  !                 !--- Sum of external forces (explicit solution) = F + tau_ia + Coriolis + spg + tau_io 
    514                   zTauE = zfV(ji,jj) + zTauV_ia(ji,jj) + zCory(ji,jj) + zspgV(ji,jj) + ztauy_oi(ji,jj) 
     496                  zTauE = zfV(ji,jj) + ztauy_ai(ji,jj) + zCorV(ji,jj) + zspgV(ji,jj) + ztauy_oi(ji,jj) 
    515497                  ! 
    516498                  !                 !--- landfast switch => 0 = static friction ; 1 = sliding friction 
    517                   rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, ztauE - zTauV_ib(ji,jj) ) - SIGN( 1._wp, zTauE ) ) ) 
     499                  rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, ztauE + ztauy_base(ji,jj) ) - SIGN( 1._wp, zTauE ) ) ) 
    518500                  ! 
    519501                  IF( ln_aEVP ) THEN !--- ice velocity using aEVP (Kimmritz et al 2016 & 2017) 
    520                   v_ice(ji,jj) = ( (          rswitch * ( zmV_t(ji,jj) * ( zbeta(ji,jj) * v_ice(ji,jj) + v_ice_b(ji,jj) )         & ! previous velocity 
    521                      &                                  + zTauE + zTauO * v_ice(ji,jj)                                            & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    522                      &                                  ) / MAX( zepsi, zmV_t(ji,jj) * ( zbeta(ji,jj) + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
    523                                     + ( 1._wp - rswitch ) * v_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )           & ! static friction => slow decrease to v=0 
    524                      &             ) * zswitchV(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zswitchV(ji,jj) )                     & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
    525                      &           ) * zmaskV(ji,jj) 
     502                     v_ice(ji,jj) = ( (          rswitch * ( zmV_t(ji,jj) * ( zbeta(ji,jj) * v_ice(ji,jj) + v_ice_b(ji,jj) )       & ! previous velocity 
     503                        &                                  + zTauE + zTauO * v_ice(ji,jj) )                                        & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     504                        &                                  / MAX( zepsi, zmV_t(ji,jj) * ( zbeta(ji,jj) + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
     505                        &               + ( 1._wp - rswitch ) * v_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )           & ! static friction => slow decrease to v=0 
     506                        &             ) * zmsk01y(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01y(ji,jj) )                     & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
     507                        &           )   * zmsk00y(ji,jj) 
    526508                  ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009) 
    527                   v_ice(ji,jj) = ( (           rswitch   * ( zmV_t(ji,jj)  * v_ice(ji,jj)                             & ! previous velocity 
    528                      &                                     + zTauE + zTauO * v_ice(ji,jj)                             & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    529                      &                                     ) / MAX( zepsi, zmV_t(ji,jj) + zTauO - zTauB )             & ! m/dt + tau_io(only ice part) + landfast 
    530                      &              + ( 1._wp - rswitch ) * v_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )  & ! static friction => slow decrease to v=0 
    531                      &              ) * zswitchV(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zswitchV(ji,jj) )        & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
    532                      &            ) * zmaskV(ji,jj) 
     509                     v_ice(ji,jj) = ( (           rswitch   * ( zmV_t(ji,jj)  * v_ice(ji,jj)                                       & ! previous velocity 
     510                        &                                     + zTauE + zTauO * v_ice(ji,jj) )                                     & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     511                        &                                     / MAX( zepsi, zmV_t(ji,jj) + zTauO - zTauB )                         & ! m/dt + tau_io(only ice part) + landfast 
     512                        &                + ( 1._wp - rswitch ) * v_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )          & ! static friction => slow decrease to v=0 
     513                        &              ) * zmsk01y(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01y(ji,jj) )                    & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
     514                        &            )   * zmsk00y(ji,jj) 
    533515                  ENDIF 
    534516               END DO 
     
    540522            CALL agrif_interp_ice( 'V' ) 
    541523#endif 
    542             IF( ln_bdy .AND. ll_bdy_substep ) CALL bdy_ice_dyn( 'V' ) 
     524            IF( ln_bdy CALL bdy_ice_dyn( 'V' ) 
    543525            ! 
    544526            DO jj = 2, jpjm1 
     
    552534                  !                 !--- tau_bottom/u_ice 
    553535                  zvel  = 5.e-05_wp + SQRT( v_iceU(ji,jj) * v_iceU(ji,jj) + u_ice(ji,jj) * u_ice(ji,jj) ) 
    554                   zTauB = - zTauU_ib(ji,jj) / zvel 
     536                  zTauB = ztaux_base(ji,jj) / zvel 
     537                  !                 !--- OceanBottom-to-Ice stress 
     538                  ztaux_bi(ji,jj) = zTauB * u_ice(ji,jj) 
    555539                  ! 
    556540                  !                 !--- Coriolis at U-points (energy conserving formulation) 
    557                   zCorx(ji,jj)  =   0.25_wp * r1_e1u(ji,jj) *  & 
     541                  zCorU(ji,jj)  =   0.25_wp * r1_e1u(ji,jj) *  & 
    558542                     &    ( zmf(ji  ,jj) * ( e1v(ji  ,jj) * v_ice(ji  ,jj) + e1v(ji  ,jj-1) * v_ice(ji  ,jj-1) )  & 
    559543                     &    + zmf(ji+1,jj) * ( e1v(ji+1,jj) * v_ice(ji+1,jj) + e1v(ji+1,jj-1) * v_ice(ji+1,jj-1) ) ) 
    560544                  ! 
    561545                  !                 !--- Sum of external forces (explicit solution) = F + tau_ia + Coriolis + spg + tau_io 
    562                   zTauE = zfU(ji,jj) + zTauU_ia(ji,jj) + zCorx(ji,jj) + zspgU(ji,jj) + ztaux_oi(ji,jj) 
     546                  zTauE = zfU(ji,jj) + ztaux_ai(ji,jj) + zCorU(ji,jj) + zspgU(ji,jj) + ztaux_oi(ji,jj) 
    563547                  ! 
    564548                  !                 !--- landfast switch => 0 = static friction ; 1 = sliding friction 
    565                   rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, ztauE - zTauU_ib(ji,jj) ) - SIGN( 1._wp, zTauE ) ) ) 
     549                  rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, ztauE + ztaux_base(ji,jj) ) - SIGN( 1._wp, zTauE ) ) ) 
    566550                  ! 
    567551                  IF( ln_aEVP ) THEN !--- ice velocity using aEVP (Kimmritz et al 2016 & 2017) 
    568                   u_ice(ji,jj) = ( (          rswitch * ( zmU_t(ji,jj) * ( zbeta(ji,jj) * u_ice(ji,jj) + u_ice_b(ji,jj) )         & ! previous velocity 
    569                      &                                     + zTauE + zTauO * u_ice(ji,jj)                                         & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    570                      &                                  ) / MAX( zepsi, zmU_t(ji,jj) * ( zbeta(ji,jj) + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
    571                      &              + ( 1._wp - rswitch ) * u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )              & ! static friction => slow decrease to v=0 
    572                      &              ) * zswitchU(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zswitchU(ji,jj) )                    & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin  
    573                      &            ) * zmaskU(ji,jj) 
     552                     u_ice(ji,jj) = ( (          rswitch * ( zmU_t(ji,jj) * ( zbeta(ji,jj) * u_ice(ji,jj) + u_ice_b(ji,jj) )       & ! previous velocity 
     553                        &                                  + zTauE + zTauO * u_ice(ji,jj) )                                        & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     554                        &                                  / MAX( zepsi, zmU_t(ji,jj) * ( zbeta(ji,jj) + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
     555                        &                + ( 1._wp - rswitch ) * u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )          & ! static friction => slow decrease to v=0 
     556                        &              ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                    & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin  
     557                        &            )   * zmsk00x(ji,jj) 
    574558                  ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009) 
    575                   u_ice(ji,jj) = ( (           rswitch   * ( zmU_t(ji,jj)  * u_ice(ji,jj)                             & ! previous velocity 
    576                      &                                     + zTauE + zTauO * u_ice(ji,jj)                             & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    577                      &                                     ) / MAX( zepsi, zmU_t(ji,jj) + zTauO - zTauB )             & ! m/dt + tau_io(only ice part) + landfast 
    578                      &              + ( 1._wp - rswitch ) * u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )  & ! static friction => slow decrease to v=0 
    579                      &              ) * zswitchU(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zswitchU(ji,jj) )        & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin  
    580                      &            ) * zmaskU(ji,jj) 
     559                     u_ice(ji,jj) = ( (           rswitch   * ( zmU_t(ji,jj)  * u_ice(ji,jj)                                       & ! previous velocity 
     560                        &                                     + zTauE + zTauO * u_ice(ji,jj) )                                     & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     561                        &                                     / MAX( zepsi, zmU_t(ji,jj) + zTauO - zTauB )                         & ! m/dt + tau_io(only ice part) + landfast 
     562                        &                + ( 1._wp - rswitch ) * u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )          & ! static friction => slow decrease to v=0 
     563                        &              ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                    & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin  
     564                        &            )   * zmsk00x(ji,jj) 
    581565                  ENDIF 
    582566               END DO 
     
    588572            CALL agrif_interp_ice( 'U' ) 
    589573#endif 
    590             IF( ln_bdy .AND. ll_bdy_substep ) CALL bdy_ice_dyn( 'U' ) 
     574            IF( ln_bdy CALL bdy_ice_dyn( 'U' ) 
    591575            ! 
    592576         ELSE ! odd iterations 
     
    602586                  !                 !--- tau_bottom/u_ice 
    603587                  zvel  = 5.e-05_wp + SQRT( v_iceU(ji,jj) * v_iceU(ji,jj) + u_ice(ji,jj) * u_ice(ji,jj) ) 
    604                   zTauB = - zTauU_ib(ji,jj) / zvel 
     588                  zTauB = ztaux_base(ji,jj) / zvel 
     589                  !                 !--- OceanBottom-to-Ice stress 
     590                  ztaux_bi(ji,jj) = zTauB * u_ice(ji,jj) 
    605591                  ! 
    606592                  !                 !--- Coriolis at U-points (energy conserving formulation) 
    607                   zCorx(ji,jj)  =   0.25_wp * r1_e1u(ji,jj) *  & 
     593                  zCorU(ji,jj)  =   0.25_wp * r1_e1u(ji,jj) *  & 
    608594                     &    ( zmf(ji  ,jj) * ( e1v(ji  ,jj) * v_ice(ji  ,jj) + e1v(ji  ,jj-1) * v_ice(ji  ,jj-1) )  & 
    609595                     &    + zmf(ji+1,jj) * ( e1v(ji+1,jj) * v_ice(ji+1,jj) + e1v(ji+1,jj-1) * v_ice(ji+1,jj-1) ) ) 
    610596                  ! 
    611597                  !                 !--- Sum of external forces (explicit solution) = F + tau_ia + Coriolis + spg + tau_io 
    612                   zTauE = zfU(ji,jj) + zTauU_ia(ji,jj) + zCorx(ji,jj) + zspgU(ji,jj) + ztaux_oi(ji,jj) 
     598                  zTauE = zfU(ji,jj) + ztaux_ai(ji,jj) + zCorU(ji,jj) + zspgU(ji,jj) + ztaux_oi(ji,jj) 
    613599                  ! 
    614600                  !                 !--- landfast switch => 0 = static friction ; 1 = sliding friction 
    615                   rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, ztauE - zTauU_ib(ji,jj) ) - SIGN( 1._wp, zTauE ) ) ) 
     601                  rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, ztauE + ztaux_base(ji,jj) ) - SIGN( 1._wp, zTauE ) ) ) 
    616602                  ! 
    617603                  IF( ln_aEVP ) THEN !--- ice velocity using aEVP (Kimmritz et al 2016 & 2017) 
    618                   u_ice(ji,jj) = ( (          rswitch * ( zmU_t(ji,jj) * ( zbeta(ji,jj) * u_ice(ji,jj) + u_ice_b(ji,jj) )         & ! previous velocity 
    619                      &                                     + zTauE + zTauO * u_ice(ji,jj)                                         & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    620                      &                                  ) / MAX( zepsi, zmU_t(ji,jj) * ( zbeta(ji,jj) + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
    621                      &              + ( 1._wp - rswitch ) * u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )              & ! static friction => slow decrease to v=0 
    622                      &              ) * zswitchU(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zswitchU(ji,jj) )                    & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin  
    623                      &            ) * zmaskU(ji,jj) 
     604                     u_ice(ji,jj) = ( (          rswitch * ( zmU_t(ji,jj) * ( zbeta(ji,jj) * u_ice(ji,jj) + u_ice_b(ji,jj) )       & ! previous velocity 
     605                        &                                  + zTauE + zTauO * u_ice(ji,jj) )                                        & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     606                        &                                  / MAX( zepsi, zmU_t(ji,jj) * ( zbeta(ji,jj) + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
     607                        &                + ( 1._wp - rswitch ) * u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )          & ! static friction => slow decrease to v=0 
     608                        &              ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                    & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin  
     609                        &            )   * zmsk00x(ji,jj) 
    624610                  ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009) 
    625                   u_ice(ji,jj) = ( (           rswitch   * ( zmU_t(ji,jj)  * u_ice(ji,jj)                             & ! previous velocity 
    626                      &                                     + zTauE + zTauO * u_ice(ji,jj)                             & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    627                      &                                     ) / MAX( zepsi, zmU_t(ji,jj) + zTauO - zTauB )             & ! m/dt + tau_io(only ice part) + landfast 
    628                      &              + ( 1._wp - rswitch ) * u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )  & ! static friction => slow decrease to v=0 
    629                      &              ) * zswitchU(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zswitchU(ji,jj) )        & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
    630                      &            ) * zmaskU(ji,jj) 
     611                     u_ice(ji,jj) = ( (           rswitch   * ( zmU_t(ji,jj)  * u_ice(ji,jj)                                       & ! previous velocity 
     612                        &                                     + zTauE + zTauO * u_ice(ji,jj) )                                     & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     613                        &                                     / MAX( zepsi, zmU_t(ji,jj) + zTauO - zTauB )                         & ! m/dt + tau_io(only ice part) + landfast 
     614                        &                + ( 1._wp - rswitch ) * u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )          & ! static friction => slow decrease to v=0 
     615                        &              ) * zmsk01x(ji,jj) + u_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01x(ji,jj) )                    & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
     616                        &            )   * zmsk00x(ji,jj) 
    631617                  ENDIF 
    632618               END DO 
     
    638624            CALL agrif_interp_ice( 'U' ) 
    639625#endif 
    640             IF( ln_bdy .AND. ll_bdy_substep ) CALL bdy_ice_dyn( 'U' ) 
     626            IF( ln_bdy CALL bdy_ice_dyn( 'U' ) 
    641627            ! 
    642628            DO jj = 2, jpjm1 
     
    650636                  !                 !--- tau_bottom/v_ice 
    651637                  zvel  = 5.e-05_wp + SQRT( v_ice(ji,jj) * v_ice(ji,jj) + u_iceV(ji,jj) * u_iceV(ji,jj) ) 
    652                   zTauB = - zTauV_ib(ji,jj) / zvel 
     638                  zTauB = ztauy_base(ji,jj) / zvel 
     639                  !                 !--- OceanBottom-to-Ice stress 
     640                  ztauy_bi(ji,jj) = zTauB * v_ice(ji,jj) 
    653641                  ! 
    654642                  !                 !--- Coriolis at v-points (energy conserving formulation) 
    655                   zCory(ji,jj)  = - 0.25_wp * r1_e2v(ji,jj) *  & 
     643                  zCorV(ji,jj)  = - 0.25_wp * r1_e2v(ji,jj) *  & 
    656644                     &    ( zmf(ji,jj  ) * ( e2u(ji,jj  ) * u_ice(ji,jj  ) + e2u(ji-1,jj  ) * u_ice(ji-1,jj  ) )  & 
    657645                     &    + zmf(ji,jj+1) * ( e2u(ji,jj+1) * u_ice(ji,jj+1) + e2u(ji-1,jj+1) * u_ice(ji-1,jj+1) ) ) 
    658646                  ! 
    659647                  !                 !--- Sum of external forces (explicit solution) = F + tau_ia + Coriolis + spg + tau_io 
    660                   zTauE = zfV(ji,jj) + zTauV_ia(ji,jj) + zCory(ji,jj) + zspgV(ji,jj) + ztauy_oi(ji,jj) 
     648                  zTauE = zfV(ji,jj) + ztauy_ai(ji,jj) + zCorV(ji,jj) + zspgV(ji,jj) + ztauy_oi(ji,jj) 
    661649                  ! 
    662650                  !                 !--- landfast switch => 0 = static friction ; 1 = sliding friction 
    663                   rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, zTauE - zTauV_ib(ji,jj) ) - SIGN( 1._wp, zTauE ) ) ) 
     651                  rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, zTauE + ztauy_base(ji,jj) ) - SIGN( 1._wp, zTauE ) ) ) 
    664652                  ! 
    665653                  IF( ln_aEVP ) THEN !--- ice velocity using aEVP (Kimmritz et al 2016 & 2017) 
    666                   v_ice(ji,jj) = ( (          rswitch * ( zmV_t(ji,jj) * ( zbeta(ji,jj) * v_ice(ji,jj) + v_ice_b(ji,jj) )         & ! previous velocity 
    667                      &                                  + zTauE + zTauO * v_ice(ji,jj)                                            & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    668                      &                                  ) / MAX( zepsi, zmV_t(ji,jj) * ( zbeta(ji,jj) + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
    669                                     + ( 1._wp - rswitch ) * v_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )           & ! static friction => slow decrease to v=0 
    670                      &             ) * zswitchV(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zswitchV(ji,jj) )                     & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
    671                      &           ) * zmaskV(ji,jj) 
     654                     v_ice(ji,jj) = ( (          rswitch * ( zmV_t(ji,jj) * ( zbeta(ji,jj) * v_ice(ji,jj) + v_ice_b(ji,jj) )       & ! previous velocity 
     655                        &                                  + zTauE + zTauO * v_ice(ji,jj) )                                        & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     656                        &                                  / MAX( zepsi, zmV_t(ji,jj) * ( zbeta(ji,jj) + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
     657                        &               + ( 1._wp - rswitch ) * v_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )           & ! static friction => slow decrease to v=0 
     658                        &             ) * zmsk01y(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01y(ji,jj) )                     & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
     659                        &           )   * zmsk00y(ji,jj) 
    672660                  ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009) 
    673                   v_ice(ji,jj) = ( (           rswitch   * ( zmV_t(ji,jj)  * v_ice(ji,jj)                             & ! previous velocity 
    674                      &                                     + zTauE + zTauO * v_ice(ji,jj)                             & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    675                      &                                     ) / MAX( zepsi, zmV_t(ji,jj) + zTauO - zTauB )             & ! m/dt + tau_io(only ice part) + landfast 
    676                      &              + ( 1._wp - rswitch ) * v_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )  & ! static friction => slow decrease to v=0 
    677                      &              ) * zswitchV(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zswitchV(ji,jj) )        & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
    678                      &            ) * zmaskV(ji,jj) 
     661                     v_ice(ji,jj) = ( (           rswitch   * ( zmV_t(ji,jj)  * v_ice(ji,jj)                                       & ! previous velocity 
     662                        &                                     + zTauE + zTauO * v_ice(ji,jj) )                                     & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     663                        &                                     / MAX( zepsi, zmV_t(ji,jj) + zTauO - zTauB )                         & ! m/dt + tau_io(only ice part) + landfast 
     664                        &                + ( 1._wp - rswitch ) * v_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lfrelax )          & ! static friction => slow decrease to v=0 
     665                        &              ) * zmsk01y(ji,jj) + v_oce(ji,jj) * 0.01_wp * ( 1._wp - zmsk01y(ji,jj) )                    & ! v_ice = v_oce/100 if mass < zmmin & conc < zamin 
     666                        &            )   * zmsk00y(ji,jj) 
    679667                  ENDIF 
    680668               END DO 
     
    686674            CALL agrif_interp_ice( 'V' ) 
    687675#endif 
    688             IF( ln_bdy .AND. ll_bdy_substep ) CALL bdy_ice_dyn( 'V' ) 
     676            IF( ln_bdy CALL bdy_ice_dyn( 'V' ) 
    689677            ! 
    690678         ENDIF 
     
    701689      END DO                                              !  end loop over jter  ! 
    702690      !                                                   ! ==================== ! 
    703       ! 
    704       IF( ln_bdy .AND. .NOT.ll_bdy_substep ) THEN 
    705          CALL bdy_ice_dyn( 'U' ) 
    706          CALL bdy_ice_dyn( 'V' ) 
    707       ENDIF 
    708691      ! 
    709692      !------------------------------------------------------------------------------! 
     
    764747      DO jj = 1, jpj 
    765748         DO ji = 1, jpi 
    766             zswi(ji,jj) = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi06 ) ) ! 1 if ice, 0 if no ice 
     749            zmsk00(ji,jj) = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi06 ) ) ! 1 if ice, 0 if no ice 
    767750         END DO 
    768751      END DO 
    769752 
     753      ! --- ice-ocean, ice-atm. & ice-oceanbottom(landfast) stresses --- ! 
     754      IF(  iom_use('utau_oi') .OR. iom_use('vtau_oi') .OR. iom_use('utau_ai') .OR. iom_use('vtau_ai') .OR. & 
     755         & iom_use('utau_bi') .OR. iom_use('vtau_bi') ) THEN 
     756         ! 
     757         CALL lbc_lnk_multi( 'icedyn_rhg_evp', ztaux_oi, 'U', -1., ztauy_oi, 'V', -1., ztaux_ai, 'U', -1., ztauy_ai, 'V', -1., & 
     758            &                                  ztaux_bi, 'U', -1., ztauy_bi, 'V', -1. ) 
     759         ! 
     760         CALL iom_put( 'utau_oi' , ztaux_oi * zmsk00 ) 
     761         CALL iom_put( 'vtau_oi' , ztauy_oi * zmsk00 ) 
     762         CALL iom_put( 'utau_ai' , ztaux_ai * zmsk00 ) 
     763         CALL iom_put( 'vtau_ai' , ztauy_ai * zmsk00 ) 
     764         CALL iom_put( 'utau_bi' , ztaux_bi * zmsk00 ) 
     765         CALL iom_put( 'vtau_bi' , ztauy_bi * zmsk00 ) 
     766      ENDIF 
     767        
    770768      ! --- divergence, shear and strength --- ! 
    771       IF( iom_use('icediv') )   CALL iom_put( "icediv" , pdivu_i (:,:) * zswi(:,:) )   ! divergence 
    772       IF( iom_use('iceshe') )   CALL iom_put( "iceshe" , pshear_i(:,:) * zswi(:,:) )   ! shear 
    773       IF( iom_use('icestr') )   CALL iom_put( "icestr" , strength(:,:) * zswi(:,:) )   ! Ice strength 
    774  
    775       ! --- charge ellipse --- ! 
    776       IF( iom_use('isig1') .OR. iom_use('isig2') .OR. iom_use('isig3') ) THEN 
     769      IF( iom_use('icediv') )   CALL iom_put( 'icediv' , pdivu_i  * zmsk00 )   ! divergence 
     770      IF( iom_use('iceshe') )   CALL iom_put( 'iceshe' , pshear_i * zmsk00 )   ! shear 
     771      IF( iom_use('icestr') )   CALL iom_put( 'icestr' , strength * zmsk00 )   ! strength 
     772 
     773      ! --- stress tensor --- ! 
     774      IF( iom_use('isig1') .OR. iom_use('isig2') .OR. iom_use('isig3') .OR. iom_use('normstr') .OR. iom_use('sheastr') ) THEN 
    777775         ! 
    778776         ALLOCATE( zsig1(jpi,jpj) , zsig2(jpi,jpj) , zsig3(jpi,jpj) ) 
     
    780778         DO jj = 2, jpjm1 
    781779            DO ji = 2, jpim1 
    782                zdum1 = ( zswi(ji-1,jj) * pstress12_i(ji-1,jj) + zswi(ji  ,jj-1) * pstress12_i(ji  ,jj-1) +  &  ! stress12_i at T-point 
    783                   &      zswi(ji  ,jj) * pstress12_i(ji  ,jj) + zswi(ji-1,jj-1) * pstress12_i(ji-1,jj-1) )  & 
    784                   &    / MAX( 1._wp, zswi(ji-1,jj) + zswi(ji,jj-1) + zswi(ji,jj) + zswi(ji-1,jj-1) ) 
     780               zdum1 = ( zmsk00(ji-1,jj) * pstress12_i(ji-1,jj) + zmsk00(ji  ,jj-1) * pstress12_i(ji  ,jj-1) +  &  ! stress12_i at T-point 
     781                  &      zmsk00(ji  ,jj) * pstress12_i(ji  ,jj) + zmsk00(ji-1,jj-1) * pstress12_i(ji-1,jj-1) )  & 
     782                  &    / MAX( 1._wp, zmsk00(ji-1,jj) + zmsk00(ji,jj-1) + zmsk00(ji,jj) + zmsk00(ji-1,jj-1) ) 
    785783 
    786784               zshear = SQRT( pstress2_i(ji,jj) * pstress2_i(ji,jj) + 4._wp * zdum1 * zdum1 ) ! shear stress   
    787785 
    788                zdum2 = zswi(ji,jj) / MAX( 1._wp, strength(ji,jj) ) 
     786               zdum2 = zmsk00(ji,jj) / MAX( 1._wp, strength(ji,jj) ) 
    789787 
    790788!!               zsig1(ji,jj) = 0.5_wp * zdum2 * ( pstress1_i(ji,jj) + zshear ) ! principal stress (y-direction, see Hunke & Dukowicz 2002) 
     
    799797         CALL lbc_lnk_multi( 'icedyn_rhg_evp', zsig1, 'T', 1., zsig2, 'T', 1., zsig3, 'T', 1. ) 
    800798         ! 
    801          IF( iom_use('isig1') )   CALL iom_put( "isig1" , zsig1 ) 
    802          IF( iom_use('isig2') )   CALL iom_put( "isig2" , zsig2 ) 
    803          IF( iom_use('isig3') )   CALL iom_put( "isig3" , zsig3 ) 
    804          ! 
     799         CALL iom_put( 'isig1' , zsig1 ) 
     800         CALL iom_put( 'isig2' , zsig2 ) 
     801         CALL iom_put( 'isig3' , zsig3 ) 
     802         ! 
     803         ! Stress tensor invariants (normal and shear stress N/m) 
     804         IF( iom_use('normstr') )   CALL iom_put( 'normstr' ,       ( zs1(:,:) + zs2(:,:) )                       * zmsk00(:,:) ) ! Normal stress 
     805         IF( iom_use('sheastr') )   CALL iom_put( 'sheastr' , SQRT( ( zs1(:,:) - zs2(:,:) )**2 + 4*zs12(:,:)**2 ) * zmsk00(:,:) ) ! Shear stress 
     806 
    805807         DEALLOCATE( zsig1 , zsig2 , zsig3 ) 
    806808      ENDIF 
    807809       
    808810      ! --- SIMIP --- ! 
    809       IF ( iom_use( 'normstr'  ) .OR. iom_use( 'sheastr'  ) .OR. iom_use( 'dssh_dx'  ) .OR. iom_use( 'dssh_dy'  ) .OR. & 
    810          & iom_use( 'corstrx'  ) .OR. iom_use( 'corstry'  ) .OR. iom_use( 'intstrx'  ) .OR. iom_use( 'intstry'  ) .OR. & 
    811          & iom_use( 'utau_oi'  ) .OR. iom_use( 'vtau_oi'  ) .OR. iom_use( 'xmtrpice' ) .OR. iom_use( 'ymtrpice' ) .OR. & 
    812          & iom_use( 'xmtrpsnw' ) .OR. iom_use( 'ymtrpsnw' ) .OR. iom_use( 'xatrp'    ) .OR. iom_use( 'yatrp'    ) ) THEN 
    813  
    814          ALLOCATE( zdiag_sig1     (jpi,jpj) , zdiag_sig2     (jpi,jpj) , zdiag_dssh_dx  (jpi,jpj) , zdiag_dssh_dy  (jpi,jpj) ,  & 
    815             &      zdiag_corstrx  (jpi,jpj) , zdiag_corstry  (jpi,jpj) , zdiag_intstrx  (jpi,jpj) , zdiag_intstry  (jpi,jpj) ,  & 
    816             &      zdiag_utau_oi  (jpi,jpj) , zdiag_vtau_oi  (jpi,jpj) , zdiag_xmtrp_ice(jpi,jpj) , zdiag_ymtrp_ice(jpi,jpj) ,  & 
    817             &      zdiag_xmtrp_snw(jpi,jpj) , zdiag_ymtrp_snw(jpi,jpj) , zdiag_xatrp    (jpi,jpj) , zdiag_yatrp    (jpi,jpj) ) 
    818           
     811      IF(  iom_use('dssh_dx') .OR. iom_use('dssh_dy') .OR. & 
     812         & iom_use('corstrx') .OR. iom_use('corstry') .OR. iom_use('intstrx') .OR. iom_use('intstry') ) THEN 
     813         ! 
     814         CALL lbc_lnk_multi( 'icedyn_rhg_evp', zspgU, 'U', -1., zspgV, 'V', -1., & 
     815            &                                  zCorU, 'U', -1., zCorV, 'V', -1., zfU, 'U', -1., zfV, 'V', -1. ) 
     816 
     817         CALL iom_put( 'dssh_dx' , zspgU * zmsk00 )   ! Sea-surface tilt term in force balance (x) 
     818         CALL iom_put( 'dssh_dy' , zspgV * zmsk00 )   ! Sea-surface tilt term in force balance (y) 
     819         CALL iom_put( 'corstrx' , zCorU * zmsk00 )   ! Coriolis force term in force balance (x) 
     820         CALL iom_put( 'corstry' , zCorV * zmsk00 )   ! Coriolis force term in force balance (y) 
     821         CALL iom_put( 'intstrx' , zfU   * zmsk00 )   ! Internal force term in force balance (x) 
     822         CALL iom_put( 'intstry' , zfV   * zmsk00 )   ! Internal force term in force balance (y) 
     823      ENDIF 
     824 
     825      IF(  iom_use('xmtrpice') .OR. iom_use('ymtrpice') .OR. & 
     826         & iom_use('xmtrpsnw') .OR. iom_use('ymtrpsnw') .OR. iom_use('xatrp') .OR. iom_use('yatrp') ) THEN 
     827         ! 
     828         ALLOCATE( zdiag_xmtrp_ice(jpi,jpj) , zdiag_ymtrp_ice(jpi,jpj) , & 
     829            &      zdiag_xmtrp_snw(jpi,jpj) , zdiag_ymtrp_snw(jpi,jpj) , zdiag_xatrp(jpi,jpj) , zdiag_yatrp(jpi,jpj) ) 
     830         ! 
    819831         DO jj = 2, jpjm1 
    820832            DO ji = 2, jpim1 
    821                rswitch  = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi06 ) ) ! 1 if ice, 0 if no ice 
    822                 
    823                ! Stress tensor invariants (normal and shear stress N/m) 
    824                zdiag_sig1(ji,jj) = ( zs1(ji,jj) + zs2(ji,jj) ) * rswitch                                 ! normal stress 
    825                zdiag_sig2(ji,jj) = SQRT( ( zs1(ji,jj) - zs2(ji,jj) )**2 + 4*zs12(ji,jj)**2 ) * rswitch   ! shear stress 
    826                 
    827                ! Stress terms of the momentum equation (N/m2) 
    828                zdiag_dssh_dx(ji,jj) = zspgU(ji,jj) * rswitch     ! sea surface slope stress term 
    829                zdiag_dssh_dy(ji,jj) = zspgV(ji,jj) * rswitch 
    830                 
    831                zdiag_corstrx(ji,jj) = zCorx(ji,jj) * rswitch     ! Coriolis stress term 
    832                zdiag_corstry(ji,jj) = zCory(ji,jj) * rswitch 
    833                 
    834                zdiag_intstrx(ji,jj) = zfU(ji,jj)   * rswitch     ! internal stress term 
    835                zdiag_intstry(ji,jj) = zfV(ji,jj)   * rswitch 
    836                 
    837                zdiag_utau_oi(ji,jj) = ztaux_oi(ji,jj) * rswitch  ! oceanic stress 
    838                zdiag_vtau_oi(ji,jj) = ztauy_oi(ji,jj) * rswitch 
    839                 
    840833               ! 2D ice mass, snow mass, area transport arrays (X, Y) 
    841                zfac_x = 0.5 * u_ice(ji,jj) * e2u(ji,jj) * rswitch 
    842                zfac_y = 0.5 * v_ice(ji,jj) * e1v(ji,jj) * rswitch 
    843                 
     834               zfac_x = 0.5 * u_ice(ji,jj) * e2u(ji,jj) * zmsk00(ji,jj) 
     835               zfac_y = 0.5 * v_ice(ji,jj) * e1v(ji,jj) * zmsk00(ji,jj) 
     836 
    844837               zdiag_xmtrp_ice(ji,jj) = rhoi * zfac_x * ( vt_i(ji+1,jj) + vt_i(ji,jj) ) ! ice mass transport, X-component 
    845838               zdiag_ymtrp_ice(ji,jj) = rhoi * zfac_y * ( vt_i(ji,jj+1) + vt_i(ji,jj) ) !        ''           Y-   '' 
    846                 
     839 
    847840               zdiag_xmtrp_snw(ji,jj) = rhos * zfac_x * ( vt_s(ji+1,jj) + vt_s(ji,jj) ) ! snow mass transport, X-component 
    848841               zdiag_ymtrp_snw(ji,jj) = rhos * zfac_y * ( vt_s(ji,jj+1) + vt_s(ji,jj) ) !          ''          Y-   '' 
    849                 
     842 
    850843               zdiag_xatrp(ji,jj)     = zfac_x * ( at_i(ji+1,jj) + at_i(ji,jj) )        ! area transport,      X-component 
    851844               zdiag_yatrp(ji,jj)     = zfac_y * ( at_i(ji,jj+1) + at_i(ji,jj) )        !        ''            Y-   '' 
    852                 
    853             END DO 
    854          END DO 
    855           
    856          CALL lbc_lnk_multi( 'icedyn_rhg_evp', zdiag_sig1   , 'T',  1., zdiag_sig2   , 'T',  1.,   & 
    857             &                zdiag_dssh_dx, 'U', -1., zdiag_dssh_dy, 'V', -1.,   & 
    858             &                zdiag_corstrx, 'U', -1., zdiag_corstry, 'V', -1.,   &  
    859             &                zdiag_intstrx, 'U', -1., zdiag_intstry, 'V', -1.    ) 
    860                    
    861          CALL lbc_lnk_multi( 'icedyn_rhg_evp', zdiag_utau_oi  , 'U', -1., zdiag_vtau_oi  , 'V', -1.,   & 
    862             &                zdiag_xmtrp_ice, 'U', -1., zdiag_xmtrp_snw, 'U', -1.,   & 
    863             &                zdiag_xatrp    , 'U', -1., zdiag_ymtrp_ice, 'V', -1.,   & 
    864             &                zdiag_ymtrp_snw, 'V', -1., zdiag_yatrp    , 'V', -1.    ) 
    865           
    866          IF( iom_use('normstr' ) )   CALL iom_put( 'normstr'  ,  zdiag_sig1(:,:)      )   ! Normal stress 
    867          IF( iom_use('sheastr' ) )   CALL iom_put( 'sheastr'  ,  zdiag_sig2(:,:)      )   ! Shear stress 
    868          IF( iom_use('dssh_dx' ) )   CALL iom_put( 'dssh_dx'  ,  zdiag_dssh_dx(:,:)   )   ! Sea-surface tilt term in force balance (x) 
    869          IF( iom_use('dssh_dy' ) )   CALL iom_put( 'dssh_dy'  ,  zdiag_dssh_dy(:,:)   )   ! Sea-surface tilt term in force balance (y) 
    870          IF( iom_use('corstrx' ) )   CALL iom_put( 'corstrx'  ,  zdiag_corstrx(:,:)   )   ! Coriolis force term in force balance (x) 
    871          IF( iom_use('corstry' ) )   CALL iom_put( 'corstry'  ,  zdiag_corstry(:,:)   )   ! Coriolis force term in force balance (y) 
    872          IF( iom_use('intstrx' ) )   CALL iom_put( 'intstrx'  ,  zdiag_intstrx(:,:)   )   ! Internal force term in force balance (x) 
    873          IF( iom_use('intstry' ) )   CALL iom_put( 'intstry'  ,  zdiag_intstry(:,:)   )   ! Internal force term in force balance (y) 
    874          IF( iom_use('utau_oi' ) )   CALL iom_put( 'utau_oi'  ,  zdiag_utau_oi(:,:)   )   ! Ocean stress term in force balance (x) 
    875          IF( iom_use('vtau_oi' ) )   CALL iom_put( 'vtau_oi'  ,  zdiag_vtau_oi(:,:)   )   ! Ocean stress term in force balance (y) 
    876          IF( iom_use('xmtrpice') )   CALL iom_put( 'xmtrpice' ,  zdiag_xmtrp_ice(:,:) )   ! X-component of sea-ice mass transport (kg/s) 
    877          IF( iom_use('ymtrpice') )   CALL iom_put( 'ymtrpice' ,  zdiag_ymtrp_ice(:,:) )   ! Y-component of sea-ice mass transport  
    878          IF( iom_use('xmtrpsnw') )   CALL iom_put( 'xmtrpsnw' ,  zdiag_xmtrp_snw(:,:) )   ! X-component of snow mass transport (kg/s) 
    879          IF( iom_use('ymtrpsnw') )   CALL iom_put( 'ymtrpsnw' ,  zdiag_ymtrp_snw(:,:) )   ! Y-component of snow mass transport 
    880          IF( iom_use('xatrp'   ) )   CALL iom_put( 'xatrp'    ,  zdiag_xatrp(:,:)     )   ! X-component of ice area transport 
    881          IF( iom_use('yatrp'   ) )   CALL iom_put( 'yatrp'    ,  zdiag_yatrp(:,:)     )   ! Y-component of ice area transport 
    882  
    883          DEALLOCATE( zdiag_sig1      , zdiag_sig2      , zdiag_dssh_dx   , zdiag_dssh_dy   ,  & 
    884             &        zdiag_corstrx   , zdiag_corstry   , zdiag_intstrx   , zdiag_intstry   ,  & 
    885             &        zdiag_utau_oi   , zdiag_vtau_oi   , zdiag_xmtrp_ice , zdiag_ymtrp_ice ,  & 
    886             &        zdiag_xmtrp_snw , zdiag_ymtrp_snw , zdiag_xatrp     , zdiag_yatrp     ) 
     845 
     846            END DO 
     847         END DO 
     848 
     849         CALL lbc_lnk_multi( 'icedyn_rhg_evp', zdiag_xmtrp_ice, 'U', -1., zdiag_ymtrp_ice, 'V', -1., & 
     850            &                                  zdiag_xmtrp_snw, 'U', -1., zdiag_ymtrp_snw, 'V', -1., & 
     851            &                                  zdiag_xatrp    , 'U', -1., zdiag_yatrp    , 'V', -1. ) 
     852 
     853         CALL iom_put( 'xmtrpice' , zdiag_xmtrp_ice )   ! X-component of sea-ice mass transport (kg/s) 
     854         CALL iom_put( 'ymtrpice' , zdiag_ymtrp_ice )   ! Y-component of sea-ice mass transport  
     855         CALL iom_put( 'xmtrpsnw' , zdiag_xmtrp_snw )   ! X-component of snow mass transport (kg/s) 
     856         CALL iom_put( 'ymtrpsnw' , zdiag_ymtrp_snw )   ! Y-component of snow mass transport 
     857         CALL iom_put( 'xatrp'    , zdiag_xatrp     )   ! X-component of ice area transport 
     858         CALL iom_put( 'yatrp'    , zdiag_yatrp     )   ! Y-component of ice area transport 
     859 
     860         DEALLOCATE( zdiag_xmtrp_ice , zdiag_ymtrp_ice , & 
     861            &        zdiag_xmtrp_snw , zdiag_ymtrp_snw , zdiag_xatrp , zdiag_yatrp ) 
    887862 
    888863      ENDIF 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/iceistate.F90

    r11348 r11413  
    2222   USE eosbn2         ! equation of state 
    2323   USE domvvl         ! Variable volume 
    24    USE ice            ! sea-ice variables 
    25    USE icevar         ! ice_var_salprof 
     24   USE ice            ! sea-ice: variables 
     25   USE ice1D          ! sea-ice: thermodynamics variables 
     26   USE icetab         ! sea-ice: 1D <==> 2D transformation 
     27   USE icevar         ! sea-ice: operations 
    2628   ! 
    2729   USE in_out_manager ! I/O manager 
     
    3638   PUBLIC   ice_istate        ! called by icestp.F90 
    3739   PUBLIC   ice_istate_init   ! called by icestp.F90 
    38  
    39    INTEGER , PARAMETER ::   jpfldi = 6           ! maximum number of files to read 
    40    INTEGER , PARAMETER ::   jp_hti = 1           ! index of ice thickness (m)    at T-point 
    41    INTEGER , PARAMETER ::   jp_hts = 2           ! index of snow thicknes (m)    at T-point 
    42    INTEGER , PARAMETER ::   jp_ati = 3           ! index of ice fraction (%) at T-point 
    43    INTEGER , PARAMETER ::   jp_tsu = 4           ! index of ice surface temp (K)    at T-point 
    44    INTEGER , PARAMETER ::   jp_tmi = 5           ! index of ice temp at T-point 
    45    INTEGER , PARAMETER ::   jp_smi = 6           ! index of ice sali at T-point 
    46    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   si  ! structure of input fields (file informations, fields read) 
    4740   ! 
    4841   !                             !! ** namelist (namini) ** 
    49    LOGICAL  ::   ln_iceini        ! initialization or not 
    50    LOGICAL  ::   ln_iceini_file   ! Ice initialization state from 2D netcdf file 
    51    REAL(wp) ::   rn_thres_sst     ! threshold water temperature for initial sea ice 
    52    REAL(wp) ::   rn_hts_ini_n     ! initial snow thickness in the north 
    53    REAL(wp) ::   rn_hts_ini_s     ! initial snow thickness in the south 
    54    REAL(wp) ::   rn_hti_ini_n     ! initial ice thickness in the north 
    55    REAL(wp) ::   rn_hti_ini_s     ! initial ice thickness in the south 
    56    REAL(wp) ::   rn_ati_ini_n     ! initial leads area in the north 
    57    REAL(wp) ::   rn_ati_ini_s     ! initial leads area in the south 
    58    REAL(wp) ::   rn_smi_ini_n     ! initial salinity  
    59    REAL(wp) ::   rn_smi_ini_s     ! initial salinity 
    60    REAL(wp) ::   rn_tmi_ini_n     ! initial temperature 
    61    REAL(wp) ::   rn_tmi_ini_s     ! initial temperature 
    62     
     42   LOGICAL, PUBLIC  ::   ln_iceini        !: Ice initialization or not 
     43   LOGICAL, PUBLIC  ::   ln_iceini_file   !: Ice initialization from 2D netcdf file 
     44   REAL(wp) ::   rn_thres_sst 
     45   REAL(wp) ::   rn_hti_ini_n, rn_hts_ini_n, rn_ati_ini_n, rn_smi_ini_n, rn_tmi_ini_n, rn_tsu_ini_n, rn_tms_ini_n 
     46   REAL(wp) ::   rn_hti_ini_s, rn_hts_ini_s, rn_ati_ini_s, rn_smi_ini_s, rn_tmi_ini_s, rn_tsu_ini_s, rn_tms_ini_s 
     47   REAL(wp) ::   rn_apd_ini_n, rn_hpd_ini_n 
     48   REAL(wp) ::   rn_apd_ini_s, rn_hpd_ini_s 
     49   ! 
     50   !                              ! if ln_iceini_file = T 
     51   INTEGER , PARAMETER ::   jpfldi = 9           ! maximum number of files to read 
     52   INTEGER , PARAMETER ::   jp_hti = 1           ! index of ice thickness    (m) 
     53   INTEGER , PARAMETER ::   jp_hts = 2           ! index of snw thickness    (m) 
     54   INTEGER , PARAMETER ::   jp_ati = 3           ! index of ice fraction     (-) 
     55   INTEGER , PARAMETER ::   jp_smi = 4           ! index of ice salinity     (g/kg) 
     56   INTEGER , PARAMETER ::   jp_tmi = 5           ! index of ice temperature  (K) 
     57   INTEGER , PARAMETER ::   jp_tsu = 6           ! index of ice surface temp (K) 
     58   INTEGER , PARAMETER ::   jp_tms = 7           ! index of snw temperature  (K) 
     59   INTEGER , PARAMETER ::   jp_apd = 8           ! index of pnd fraction     (-) 
     60   INTEGER , PARAMETER ::   jp_hpd = 9           ! index of pnd depth        (m) 
     61   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   si  ! structure of input fields (file informations, fields read) 
     62   !    
    6363   !!---------------------------------------------------------------------- 
    6464   !! NEMO/ICE 4.0 , NEMO Consortium (2018) 
     
    6868CONTAINS 
    6969 
    70    SUBROUTINE ice_istate 
     70   SUBROUTINE ice_istate( kt ) 
    7171      !!------------------------------------------------------------------- 
    7272      !!                    ***  ROUTINE ice_istate  *** 
     
    8787      !! 
    8888      !! ** Notes   : o_i, t_su, t_s, t_i, sz_i must be filled everywhere, even 
    89       !!              where there is no ice (clem: I do not know why, is it mandatory?)  
     89      !!              where there is no ice 
    9090      !!-------------------------------------------------------------------- 
     91      INTEGER, INTENT(in) ::   kt   ! time step  
     92      !! 
    9193      INTEGER  ::   ji, jj, jk, jl         ! dummy loop indices 
    92       INTEGER  ::   i_hemis, i_fill, jl0   ! local integers 
    93       REAL(wp) ::   ztmelts, zdh 
    94       REAL(wp) ::   zarg, zV, zconv, zdv, zfac 
     94      REAL(wp) ::   ztmelts 
    9595      INTEGER , DIMENSION(4)           ::   itest 
    9696      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d 
    9797      REAL(wp), DIMENSION(jpi,jpj)     ::   zswitch    ! ice indicator 
    98       REAL(wp), DIMENSION(jpi,jpj)     ::   zht_i_ini, zat_i_ini, zvt_i_ini            !data from namelist or nc file 
    99       REAL(wp), DIMENSION(jpi,jpj)     ::   zts_u_ini, zht_s_ini, zsm_i_ini, ztm_i_ini !data from namelist or nc file 
    100       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zh_i_ini , za_i_ini                        !data by cattegories to fill 
     98      REAL(wp), DIMENSION(jpi,jpj)     ::   zht_i_ini, zat_i_ini, ztm_s_ini            !data from namelist or nc file 
     99      REAL(wp), DIMENSION(jpi,jpj)     ::   zt_su_ini, zht_s_ini, zsm_i_ini, ztm_i_ini !data from namelist or nc file 
     100      REAL(wp), DIMENSION(jpi,jpj)     ::   zapnd_ini, zhpnd_ini                       !data from namelist or nc file 
     101      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zti_3d , zts_3d                            !temporary arrays 
     102      !! 
     103      REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   zhi_2d, zhs_2d, zai_2d, zti_2d, zts_2d, ztsu_2d, zsi_2d 
    101104      !-------------------------------------------------------------------- 
    102105 
     
    105108      IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 
    106109 
    107       !-------------------------------------------------------------------- 
    108       ! 1) Set surface and bottom temperatures to initial values 
    109       !-------------------------------------------------------------------- 
    110       ! 
    111       ! init surface temperature 
     110      !--------------------------- 
     111      ! 1) 1st init. of the fields 
     112      !--------------------------- 
     113      ! 
     114      ! basal temperature (considered at freezing point)   [Kelvin] 
     115      CALL eos_fzp( sss_m(:,:), t_bo(:,:) ) 
     116      t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1)  
     117      ! 
     118      ! surface temperature and conductivity 
    112119      DO jl = 1, jpl 
    113120         t_su   (:,:,jl) = rt0 * tmask(:,:,1)  ! temp at the surface 
     
    115122      END DO 
    116123      ! 
    117       ! init basal temperature (considered at freezing point)   [Kelvin] 
    118       CALL eos_fzp( sss_m(:,:), t_bo(:,:) ) 
    119       t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1)  
    120  
     124      ! ice and snw temperatures 
     125      DO jl = 1, jpl 
     126         DO jk = 1, nlay_i 
     127            t_i(:,:,jk,jl) = rt0 * tmask(:,:,1) 
     128         END DO 
     129         DO jk = 1, nlay_s 
     130            t_s(:,:,jk,jl) = rt0 * tmask(:,:,1) 
     131         END DO 
     132      END DO 
     133      ! 
     134      ! specific temperatures for coupled runs 
     135      tn_ice (:,:,:) = t_i (:,:,1,:) 
     136      t1_ice (:,:,:) = t_i (:,:,1,:) 
     137 
     138      ! heat contents 
     139      e_i (:,:,:,:) = 0._wp 
     140      e_s (:,:,:,:) = 0._wp 
     141       
     142      ! general fields 
     143      a_i (:,:,:) = 0._wp 
     144      v_i (:,:,:) = 0._wp 
     145      v_s (:,:,:) = 0._wp 
     146      sv_i(:,:,:) = 0._wp 
     147      oa_i(:,:,:) = 0._wp 
     148      ! 
     149      h_i (:,:,:) = 0._wp 
     150      h_s (:,:,:) = 0._wp 
     151      s_i (:,:,:) = 0._wp 
     152      o_i (:,:,:) = 0._wp 
     153      ! 
     154      ! melt ponds 
     155      a_ip     (:,:,:) = 0._wp 
     156      v_ip     (:,:,:) = 0._wp 
     157      a_ip_frac(:,:,:) = 0._wp 
     158      h_ip     (:,:,:) = 0._wp 
     159      ! 
     160      ! ice velocities 
     161      u_ice (:,:) = 0._wp 
     162      v_ice (:,:) = 0._wp 
     163      ! 
     164      !------------------------------------------------------------------------ 
     165      ! 2) overwrite some of the fields with namelist parameters or netcdf file 
     166      !------------------------------------------------------------------------ 
    121167      IF( ln_iceini ) THEN 
    122          !----------------------------------------------------------- 
    123          ! 2) Compute or read sea ice variables ===> single category 
    124          !----------------------------------------------------------- 
    125          ! 
    126168         !                             !---------------! 
    127169         IF( ln_iceini_file )THEN      ! Read a file   ! 
    128170            !                          !---------------! 
    129             ! 
    130             zht_i_ini(:,:)  = si(jp_hti)%fnow(:,:,1) 
    131             zht_s_ini(:,:)  = si(jp_hts)%fnow(:,:,1) 
    132             zat_i_ini(:,:)  = si(jp_ati)%fnow(:,:,1) 
    133             zts_u_ini(:,:)  = si(jp_tsu)%fnow(:,:,1) 
    134             ztm_i_ini(:,:)  = si(jp_tmi)%fnow(:,:,1) 
    135             zsm_i_ini(:,:)  = si(jp_smi)%fnow(:,:,1) 
    136             ! 
    137             WHERE( zat_i_ini(:,:) > 0._wp ) ; zswitch(:,:) = tmask(:,:,1)  
    138             ELSEWHERE                       ; zswitch(:,:) = 0._wp 
     171            WHERE( ff_t(:,:) >= 0._wp )   ;   zswitch(:,:) = 1._wp 
     172            ELSEWHERE                     ;   zswitch(:,:) = 0._wp 
    139173            END WHERE 
    140             zvt_i_ini(:,:) = zht_i_ini(:,:) * zat_i_ini(:,:) 
    141             ! 
     174            ! 
     175            CALL fld_read( kt, 1, si ) ! input fields provided at the current time-step 
     176            ! 
     177            ! -- mandatory fields -- ! 
     178            zht_i_ini(:,:) = si(jp_hti)%fnow(:,:,1) 
     179            zht_s_ini(:,:) = si(jp_hts)%fnow(:,:,1) 
     180            zat_i_ini(:,:) = si(jp_ati)%fnow(:,:,1) 
     181 
     182            ! -- optional fields -- ! 
     183            !    if fields do not exist then set them to the values present in the namelist (except for snow and surface temperature) 
     184            ! 
     185            ! ice salinity 
     186            IF( TRIM(si(jp_smi)%clrootname) == 'NOT USED' ) & 
     187               &     si(jp_smi)%fnow(:,:,1) = ( rn_smi_ini_n * zswitch + rn_smi_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     188            zsm_i_ini(:,:) = si(jp_smi)%fnow(:,:,1) 
     189            ! 
     190            ! ice temperature 
     191            IF( TRIM(si(jp_tmi)%clrootname) == 'NOT USED' ) & 
     192               &     si(jp_tmi)%fnow(:,:,1) = ( rn_tmi_ini_n * zswitch + rn_tmi_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     193            ztm_i_ini(:,:) = si(jp_tmi)%fnow(:,:,1) 
     194            ! 
     195            ! surface temperature => set to ice temperature if it exists 
     196            IF    ( TRIM(si(jp_tsu)%clrootname) == 'NOT USED' .AND. TRIM(si(jp_tmi)%clrootname) == 'NOT USED' ) THEN 
     197                     si(jp_tsu)%fnow(:,:,1) = ( rn_tsu_ini_n * zswitch + rn_tsu_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     198            ELSEIF( TRIM(si(jp_tsu)%clrootname) == 'NOT USED' .AND. TRIM(si(jp_tmi)%clrootname) /= 'NOT USED' ) THEN 
     199                     si(jp_tsu)%fnow(:,:,1) = si(jp_tmi)%fnow(:,:,1) 
     200            ENDIF 
     201            zt_su_ini(:,:) = si(jp_tsu)%fnow(:,:,1) 
     202            ! 
     203            ! snow temperature => set to ice temperature if it exists 
     204            IF    ( TRIM(si(jp_tms)%clrootname) == 'NOT USED' .AND. TRIM(si(jp_tmi)%clrootname) == 'NOT USED' ) THEN 
     205                     si(jp_tms)%fnow(:,:,1) = ( rn_tms_ini_n * zswitch + rn_tms_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     206            ELSEIF( TRIM(si(jp_tms)%clrootname) == 'NOT USED' .AND. TRIM(si(jp_tmi)%clrootname) /= 'NOT USED' ) THEN 
     207                     si(jp_tms)%fnow(:,:,1) = si(jp_tmi)%fnow(:,:,1) 
     208            ENDIF 
     209            ztm_s_ini(:,:) = si(jp_tms)%fnow(:,:,1) 
     210            ! 
     211            ! ponds 
     212            IF( TRIM(si(jp_apd)%clrootname) == 'NOT USED' ) & 
     213               &     si(jp_apd)%fnow(:,:,1) = ( rn_apd_ini_n * zswitch + rn_apd_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     214            zapnd_ini(:,:) = si(jp_apd)%fnow(:,:,1) 
     215            IF( TRIM(si(jp_hpd)%clrootname) == 'NOT USED' ) & 
     216               &     si(jp_hpd)%fnow(:,:,1) = ( rn_hpd_ini_n * zswitch + rn_hpd_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     217            zhpnd_ini(:,:) = si(jp_hpd)%fnow(:,:,1) 
     218            ! 
     219            ! change the switch for the following 
     220            WHERE( zat_i_ini(:,:) > 0._wp )   ;   zswitch(:,:) = tmask(:,:,1)  
     221            ELSEWHERE                         ;   zswitch(:,:) = 0._wp 
     222            END WHERE 
    142223            !                          !---------------! 
    143224         ELSE                          ! Read namelist ! 
    144225            !                          !---------------! 
    145             ! no ice if sst <= t-freez + ttest 
     226            ! no ice if (sst - Tfreez) >= thresold 
    146227            WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst )   ;   zswitch(:,:) = 0._wp  
    147228            ELSEWHERE                                                                    ;   zswitch(:,:) = tmask(:,:,1) 
     
    153234               zht_s_ini(:,:) = rn_hts_ini_n * zswitch(:,:) 
    154235               zat_i_ini(:,:) = rn_ati_ini_n * zswitch(:,:) 
    155                zts_u_ini(:,:) = rn_tmi_ini_n * zswitch(:,:) 
    156236               zsm_i_ini(:,:) = rn_smi_ini_n * zswitch(:,:) 
    157237               ztm_i_ini(:,:) = rn_tmi_ini_n * zswitch(:,:) 
     238               zt_su_ini(:,:) = rn_tsu_ini_n * zswitch(:,:) 
     239               ztm_s_ini(:,:) = rn_tms_ini_n * zswitch(:,:) 
     240               zapnd_ini(:,:) = rn_apd_ini_n * zswitch(:,:) 
     241               zhpnd_ini(:,:) = rn_hpd_ini_n * zswitch(:,:) 
    158242            ELSEWHERE 
    159243               zht_i_ini(:,:) = rn_hti_ini_s * zswitch(:,:) 
    160244               zht_s_ini(:,:) = rn_hts_ini_s * zswitch(:,:) 
    161245               zat_i_ini(:,:) = rn_ati_ini_s * zswitch(:,:) 
    162                zts_u_ini(:,:) = rn_tmi_ini_s * zswitch(:,:) 
    163246               zsm_i_ini(:,:) = rn_smi_ini_s * zswitch(:,:) 
    164247               ztm_i_ini(:,:) = rn_tmi_ini_s * zswitch(:,:) 
     248               zt_su_ini(:,:) = rn_tsu_ini_s * zswitch(:,:) 
     249               ztm_s_ini(:,:) = rn_tms_ini_s * zswitch(:,:) 
     250               zapnd_ini(:,:) = rn_apd_ini_s * zswitch(:,:) 
     251               zhpnd_ini(:,:) = rn_hpd_ini_s * zswitch(:,:) 
    165252            END WHERE 
    166             zvt_i_ini(:,:) = zht_i_ini(:,:) * zat_i_ini(:,:) 
    167253            ! 
    168254         ENDIF 
     255         !-------------! 
     256         ! fill fields ! 
     257         !-------------! 
     258         ! select ice covered grid points 
     259         npti = 0 ; nptidx(:) = 0 
     260         DO jj = 1, jpj 
     261            DO ji = 1, jpi 
     262               IF ( zht_i_ini(ji,jj) > 0._wp ) THEN 
     263                  npti         = npti  + 1 
     264                  nptidx(npti) = (jj - 1) * jpi + ji 
     265               ENDIF 
     266            END DO 
     267         END DO 
     268 
     269         ! move to 1D arrays: (jpi,jpj) -> (jpi*jpj) 
     270         CALL tab_2d_1d( npti, nptidx(1:npti), h_i_1d (1:npti)  , zht_i_ini ) 
     271         CALL tab_2d_1d( npti, nptidx(1:npti), h_s_1d (1:npti)  , zht_s_ini ) 
     272         CALL tab_2d_1d( npti, nptidx(1:npti), at_i_1d(1:npti)  , zat_i_ini ) 
     273         CALL tab_2d_1d( npti, nptidx(1:npti), t_i_1d (1:npti,1), ztm_i_ini ) 
     274         CALL tab_2d_1d( npti, nptidx(1:npti), t_s_1d (1:npti,1), ztm_s_ini ) 
     275         CALL tab_2d_1d( npti, nptidx(1:npti), t_su_1d(1:npti)  , zt_su_ini ) 
     276         CALL tab_2d_1d( npti, nptidx(1:npti), s_i_1d (1:npti)  , zsm_i_ini ) 
     277 
     278         ! allocate temporary arrays 
     279         ALLOCATE( zhi_2d(npti,jpl), zhs_2d(npti,jpl), zai_2d (npti,jpl), & 
     280            &      zti_2d(npti,jpl), zts_2d(npti,jpl), ztsu_2d(npti,jpl), zsi_2d(npti,jpl) ) 
    169281          
    170          !------------------------------------------------------------------ 
    171          ! 3) Distribute ice concentration and thickness into the categories 
    172          !------------------------------------------------------------------ 
    173          ! a gaussian distribution for ice concentration is used 
    174          ! then we check whether the distribution fullfills 
    175          ! volume and area conservation, positivity and ice categories bounds 
    176  
    177          IF( jpl == 1 ) THEN 
    178             ! 
    179             zh_i_ini(:,:,1) = zht_i_ini(:,:) 
    180             za_i_ini(:,:,1) = zat_i_ini(:,:)             
    181             ! 
    182          ELSE 
    183             zh_i_ini(:,:,:) = 0._wp  
    184             za_i_ini(:,:,:) = 0._wp 
    185             ! 
     282         ! distribute 1-cat into jpl-cat: (jpi*jpj) -> (jpi*jpj,jpl) 
     283         CALL ice_var_itd( h_i_1d(1:npti)  , h_s_1d(1:npti)  , at_i_1d(1:npti),                   zhi_2d, zhs_2d, zai_2d , & 
     284            &              t_i_1d(1:npti,1), t_s_1d(1:npti,1), t_su_1d(1:npti), s_i_1d(1:npti),   zti_2d, zts_2d, ztsu_2d, zsi_2d ) 
     285 
     286         ! move to 3D arrays: (jpi*jpj,jpl) -> (jpi,jpj,jpl) 
     287         DO jl = 1, jpl 
     288            zti_3d(:,:,jl) = rt0 * tmask(:,:,1) 
     289            zts_3d(:,:,jl) = rt0 * tmask(:,:,1) 
     290         END DO 
     291         CALL tab_2d_3d( npti, nptidx(1:npti), zhi_2d  , h_i  ) 
     292         CALL tab_2d_3d( npti, nptidx(1:npti), zhs_2d  , h_s  ) 
     293         CALL tab_2d_3d( npti, nptidx(1:npti), zai_2d  , a_i  ) 
     294         CALL tab_2d_3d( npti, nptidx(1:npti), zti_2d  , zti_3d ) 
     295         CALL tab_2d_3d( npti, nptidx(1:npti), zts_2d  , zts_3d ) 
     296         CALL tab_2d_3d( npti, nptidx(1:npti), ztsu_2d , t_su ) 
     297         CALL tab_2d_3d( npti, nptidx(1:npti), zsi_2d  , s_i  ) 
     298 
     299         ! deallocate temporary arrays 
     300         DEALLOCATE( zhi_2d, zhs_2d, zai_2d , & 
     301            &        zti_2d, zts_2d, ztsu_2d, zsi_2d ) 
     302 
     303         ! Melt ponds: distribute uniformely over the categories 
     304         IF ( ln_pnd_CST .OR. ln_pnd_H12 ) THEN 
     305            DO jl = 1, jpl 
     306               a_ip_frac(:,:,jl) = zapnd_ini(:,:) 
     307               h_ip     (:,:,jl) = zhpnd_ini(:,:) 
     308               a_ip     (:,:,jl) = a_ip_frac(:,:,jl) * a_i (:,:,jl)  
     309               v_ip     (:,:,jl) = h_ip     (:,:,jl) * a_ip(:,:,jl) 
     310            END DO 
     311         ENDIF 
     312           
     313         ! calculate extensive and intensive variables 
     314         CALL ice_var_salprof ! for sz_i 
     315         DO jl = 1, jpl 
    186316            DO jj = 1, jpj 
    187317               DO ji = 1, jpi 
    188                   ! 
    189                   IF( zat_i_ini(ji,jj) > 0._wp .AND. zht_i_ini(ji,jj) > 0._wp )THEN 
    190  
    191                      ! find which category (jl0) the input ice thickness falls into 
    192                      jl0 = jpl 
    193                      DO jl = 1, jpl 
    194                         IF ( ( zht_i_ini(ji,jj) >  hi_max(jl-1) ) .AND. ( zht_i_ini(ji,jj) <= hi_max(jl) ) ) THEN 
    195                            jl0 = jl 
    196                            CYCLE 
    197                         ENDIF 
    198                      END DO 
    199                      ! 
    200                      itest(:) = 0 
    201                      i_fill   = jpl + 1                                            !------------------------------------ 
    202                      DO WHILE ( ( SUM( itest(:) ) /= 4 ) .AND. ( i_fill >= 2 ) )   ! iterative loop on i_fill categories 
    203                         !                                                          !------------------------------------ 
    204                         i_fill = i_fill - 1 
    205                         ! 
    206                         zh_i_ini(ji,jj,:) = 0._wp  
    207                         za_i_ini(ji,jj,:) = 0._wp 
    208                         itest(:) = 0 
    209                         ! 
    210                         IF ( i_fill == 1 ) THEN      !-- case very thin ice: fill only category 1 
    211                            zh_i_ini(ji,jj,1) = zht_i_ini(ji,jj) 
    212                            za_i_ini(ji,jj,1) = zat_i_ini(ji,jj) 
    213                         ELSE                         !-- case ice is thicker: fill categories >1 
    214                            ! thickness 
    215                            DO jl = 1, i_fill-1 
    216                               zh_i_ini(ji,jj,jl) = hi_mean(jl) 
    217                            END DO 
    218                            ! 
    219                            ! concentration 
    220                            za_i_ini(ji,jj,jl0) = zat_i_ini(ji,jj) / SQRT(REAL(jpl)) 
    221                            DO jl = 1, i_fill - 1 
    222                               IF( jl /= jl0 )THEN 
    223                                  zarg               = ( zh_i_ini(ji,jj,jl) - zht_i_ini(ji,jj) ) / ( 0.5_wp * zht_i_ini(ji,jj) ) 
    224                                  za_i_ini(ji,jj,jl) = za_i_ini(ji,jj,jl0) * EXP(-zarg**2) 
    225                               ENDIF 
    226                            END DO 
    227  
    228                            ! last category 
    229                            za_i_ini(ji,jj,i_fill) = zat_i_ini(ji,jj) - SUM( za_i_ini(ji,jj,1:i_fill-1) ) 
    230                            zV = SUM( za_i_ini(ji,jj,1:i_fill-1) * zh_i_ini(ji,jj,1:i_fill-1) ) 
    231                            zh_i_ini(ji,jj,i_fill) = ( zvt_i_ini(ji,jj) - zV ) / MAX( za_i_ini(ji,jj,i_fill), epsi10 )  
    232  
    233                            ! correction if concentration of upper cat is greater than lower cat 
    234                            !   (it should be a gaussian around jl0 but sometimes it is not) 
    235                            IF ( jl0 /= jpl ) THEN 
    236                               DO jl = jpl, jl0+1, -1 
    237                                  IF ( za_i_ini(ji,jj,jl) > za_i_ini(ji,jj,jl-1) ) THEN 
    238                                     zdv = zh_i_ini(ji,jj,jl) * za_i_ini(ji,jj,jl) 
    239                                     zh_i_ini(ji,jj,jl    ) = 0._wp 
    240                                     za_i_ini(ji,jj,jl    ) = 0._wp 
    241                                     za_i_ini(ji,jj,1:jl-1) = za_i_ini(ji,jj,1:jl-1)  & 
    242                                        &                     + zdv / MAX( REAL(jl-1) * zht_i_ini(ji,jj), epsi10 ) 
    243                                  END IF 
    244                               ENDDO 
    245                            ENDIF 
    246                            ! 
    247                         ENDIF 
    248                         ! 
    249                         ! Compatibility tests 
    250                         zconv = ABS( zat_i_ini(ji,jj) - SUM( za_i_ini(ji,jj,1:jpl) ) )           ! Test 1: area conservation 
    251                         IF ( zconv < epsi06 ) itest(1) = 1 
    252                         ! 
    253                         zconv = ABS(       zat_i_ini(ji,jj)       * zht_i_ini(ji,jj)   &         ! Test 2: volume conservation 
    254                            &        - SUM( za_i_ini (ji,jj,1:jpl) * zh_i_ini (ji,jj,1:jpl) ) ) 
    255                         IF ( zconv < epsi06 ) itest(2) = 1 
    256                         ! 
    257                         IF ( zh_i_ini(ji,jj,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1           ! Test 3: thickness of the last category is in-bounds ? 
    258                         ! 
    259                         itest(4) = 1 
    260                         DO jl = 1, i_fill 
    261                            IF ( za_i_ini(ji,jj,jl) < 0._wp ) itest(4) = 0                        ! Test 4: positivity of ice concentrations 
    262                         END DO 
    263                         !                                                          !---------------------------- 
    264                      END DO                                                        ! end iteration on categories 
    265                      !                                                             !---------------------------- 
    266                      IF( lwp .AND. SUM(itest) /= 4 ) THEN  
    267                         WRITE(numout,*) 
    268                         WRITE(numout,*) ' !!!! ALERT itest is not equal to 4      !!! ' 
    269                         WRITE(numout,*) ' !!!! Something is wrong in the SI3 initialization procedure ' 
    270                         WRITE(numout,*) 
    271                         WRITE(numout,*) ' *** itest_i (i=1,4) = ', itest(:) 
    272                         WRITE(numout,*) ' zat_i_ini : ', zat_i_ini(ji,jj) 
    273                         WRITE(numout,*) ' zht_i_ini : ', zht_i_ini(ji,jj) 
    274                      ENDIF 
    275                      ! 
    276                   ENDIF 
    277                   ! 
     318                  v_i (ji,jj,jl) = h_i(ji,jj,jl) * a_i(ji,jj,jl) 
     319                  v_s (ji,jj,jl) = h_s(ji,jj,jl) * a_i(ji,jj,jl) 
     320                  sv_i(ji,jj,jl) = MIN( MAX( rn_simin , s_i(ji,jj,jl) ) , rn_simax ) * v_i(ji,jj,jl) 
    278321               END DO 
    279322            END DO 
    280          ENDIF 
    281           
    282          !--------------------------------------------------------------------- 
    283          ! 4) Fill in sea ice arrays 
    284          !--------------------------------------------------------------------- 
    285          ! 
    286          ! Ice concentration, thickness and volume, ice salinity, ice age, surface temperature 
    287          DO jl = 1, jpl ! loop over categories 
    288             DO jj = 1, jpj 
    289                DO ji = 1, jpi 
    290                   a_i(ji,jj,jl)  = zswitch(ji,jj) * za_i_ini(ji,jj,jl)                       ! concentration 
    291                   h_i(ji,jj,jl)  = zswitch(ji,jj) * zh_i_ini(ji,jj,jl)                       ! ice thickness 
    292                   s_i(ji,jj,jl)  = zswitch(ji,jj) * zsm_i_ini(ji,jj)                         ! salinity 
    293                   o_i(ji,jj,jl)  = 0._wp                                                     ! age (0 day) 
    294                   t_su(ji,jj,jl) = zswitch(ji,jj) * zts_u_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rt0 ! surf temp 
    295                   ! 
    296                   IF( zht_i_ini(ji,jj) > 0._wp )THEN 
    297                     h_s(ji,jj,jl)= h_i(ji,jj,jl) * ( zht_s_ini(ji,jj) / zht_i_ini(ji,jj) )  ! snow depth 
    298                   ELSE 
    299                     h_s(ji,jj,jl)= 0._wp 
    300                   ENDIF 
    301                   ! 
    302                   ! This case below should not be used if (h_s/h_i) is ok in namelist 
    303                   ! In case snow load is in excess that would lead to transformation from snow to ice 
    304                   ! Then, transfer the snow excess into the ice (different from icethd_dh) 
    305                   zdh = MAX( 0._wp, ( rhos * h_s(ji,jj,jl) + ( rhoi - rau0 ) * h_i(ji,jj,jl) ) * r1_rau0 )  
    306                   ! recompute h_i, h_s avoiding out of bounds values 
    307                   h_i(ji,jj,jl) = MIN( hi_max(jl), h_i(ji,jj,jl) + zdh ) 
    308                   h_s(ji,jj,jl) = MAX( 0._wp, h_s(ji,jj,jl) - zdh * rhoi * r1_rhos ) 
    309                   ! 
    310                   ! ice volume, salt content, age content 
    311                   v_i (ji,jj,jl) = h_i(ji,jj,jl) * a_i(ji,jj,jl)              ! ice volume 
    312                   v_s (ji,jj,jl) = h_s(ji,jj,jl) * a_i(ji,jj,jl)              ! snow volume 
    313                   sv_i(ji,jj,jl) = MIN( s_i(ji,jj,jl) , sss_m(ji,jj) ) * v_i(ji,jj,jl) ! salt content 
    314                   oa_i(ji,jj,jl) = o_i(ji,jj,jl) * a_i(ji,jj,jl)               ! age content 
    315                END DO 
    316             END DO 
    317          END DO 
    318          ! 
    319          IF( nn_icesal /= 2 )  THEN         ! for constant salinity in time 
    320             CALL ice_var_salprof 
    321             sv_i = s_i * v_i 
    322          ENDIF 
    323          !   
    324          ! Snow temperature and heat content 
    325          DO jk = 1, nlay_s 
    326             DO jl = 1, jpl ! loop over categories 
     323         END DO 
     324         ! 
     325         DO jl = 1, jpl 
     326            DO jk = 1, nlay_s 
    327327               DO jj = 1, jpj 
    328328                  DO ji = 1, jpi 
    329                      t_s(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rt0 
    330                      ! Snow energy of melting 
    331                      e_s(ji,jj,jk,jl) = zswitch(ji,jj) * rhos * ( rcpi * ( rt0 - t_s(ji,jj,jk,jl) ) + rLfus ) 
    332                      ! 
    333                      ! Mutliply by volume, and divide by number of layers to get heat content in J/m2 
    334                      e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * v_s(ji,jj,jl) * r1_nlay_s 
     329                     t_s(ji,jj,jk,jl) = zts_3d(ji,jj,jl) 
     330                     e_s(ji,jj,jk,jl) = zswitch(ji,jj) * v_s(ji,jj,jl) * r1_nlay_s * & 
     331                        &               rhos * ( rcpi * ( rt0 - t_s(ji,jj,jk,jl) ) + rLfus ) 
    335332                  END DO 
    336333               END DO 
     
    338335         END DO 
    339336         ! 
    340          ! Ice salinity, temperature and heat content 
    341          DO jk = 1, nlay_i 
    342             DO jl = 1, jpl ! loop over categories 
     337         DO jl = 1, jpl 
     338            DO jk = 1, nlay_i 
    343339               DO jj = 1, jpj 
    344340                  DO ji = 1, jpi 
    345                      t_i (ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rt0  
    346                      sz_i(ji,jj,jk,jl) = zswitch(ji,jj) * zsm_i_ini(ji,jj) + ( 1._wp - zswitch(ji,jj) ) * rn_simin 
    347                      ztmelts          = - rTmlt * sz_i(ji,jj,jk,jl) + rt0 !Melting temperature in K 
    348                      ! 
    349                      ! heat content per unit volume 
    350                      e_i(ji,jj,jk,jl) = zswitch(ji,jj) * rhoi * (   rcpi    * ( ztmelts - t_i(ji,jj,jk,jl) )           & 
    351                         &             + rLfus * ( 1._wp - (ztmelts-rt0) / MIN( (t_i(ji,jj,jk,jl)-rt0) , -epsi20 )  )   & 
    352                         &             - rcp  * ( ztmelts - rt0 ) ) 
    353                      ! 
    354                      ! Mutliply by ice volume, and divide by number of layers to get heat content in J/m2 
    355                      e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * v_i(ji,jj,jl) * r1_nlay_i 
     341                     t_i (ji,jj,jk,jl) = zti_3d(ji,jj,jl)  
     342                     ztmelts          = - rTmlt * sz_i(ji,jj,jk,jl) + rt0 ! melting temperature in K 
     343                     e_i(ji,jj,jk,jl) = zswitch(ji,jj) * v_i(ji,jj,jl) * r1_nlay_i * & 
     344                        &               rhoi * (  rcpi  * ( ztmelts - t_i(ji,jj,jk,jl) ) + & 
     345                        &                         rLfus * ( 1._wp - (ztmelts-rt0) / MIN( (t_i(ji,jj,jk,jl)-rt0), -epsi20 ) ) & 
     346                        &                       - rcp   * ( ztmelts - rt0 ) ) 
    356347                  END DO 
    357348               END DO 
    358349            END DO 
    359350         END DO 
    360          ! 
    361          tn_ice (:,:,:) = t_su (:,:,:) 
    362          t1_ice (:,:,:) = t_i (:,:,1,:)   ! initialisation of 1st layer temp for coupled simu 
    363  
    364          ! Melt pond volume and fraction 
    365          IF ( ln_pnd_CST .OR. ln_pnd_H12 ) THEN   ;   zfac = 1._wp 
    366          ELSE                                     ;   zfac = 0._wp 
    367          ENDIF  
    368          DO jl = 1, jpl 
    369             a_ip_frac(:,:,jl) = rn_apnd * zswitch(:,:) * zfac 
    370             h_ip     (:,:,jl) = rn_hpnd * zswitch(:,:) * zfac 
    371          END DO 
    372          a_ip(:,:,:) = a_ip_frac(:,:,:) * a_i (:,:,:)  
    373          v_ip(:,:,:) = h_ip     (:,:,:) * a_ip(:,:,:) 
    374          ! 
    375       ELSE ! if ln_iceini=false 
    376          a_i  (:,:,:) = 0._wp 
    377          v_i  (:,:,:) = 0._wp 
    378          v_s  (:,:,:) = 0._wp 
    379          sv_i (:,:,:) = 0._wp 
    380          oa_i (:,:,:) = 0._wp 
    381          h_i  (:,:,:) = 0._wp 
    382          h_s  (:,:,:) = 0._wp 
    383          s_i  (:,:,:) = 0._wp 
    384          o_i  (:,:,:) = 0._wp 
    385          ! 
    386          e_i(:,:,:,:) = 0._wp 
    387          e_s(:,:,:,:) = 0._wp 
    388          ! 
    389          DO jl = 1, jpl 
    390             DO jk = 1, nlay_i 
    391                t_i(:,:,jk,jl) = rt0 * tmask(:,:,1) 
    392             END DO 
    393             DO jk = 1, nlay_s 
    394                t_s(:,:,jk,jl) = rt0 * tmask(:,:,1) 
    395             END DO 
    396          END DO 
    397  
    398          tn_ice (:,:,:) = t_i (:,:,1,:) 
    399          t1_ice (:,:,:) = t_i (:,:,1,:)   ! initialisation of 1st layer temp for coupled simu 
    400           
    401          a_ip(:,:,:)      = 0._wp 
    402          v_ip(:,:,:)      = 0._wp 
    403          a_ip_frac(:,:,:) = 0._wp 
    404          h_ip     (:,:,:) = 0._wp 
     351 
     352         ! specific temperatures for coupled runs 
     353         tn_ice(:,:,:) = t_su(:,:,:) 
     354         t1_ice(:,:,:) = t_i (:,:,1,:) 
    405355         ! 
    406356      ENDIF ! ln_iceini 
    407357      ! 
    408       at_i (:,:) = 0.0_wp 
    409       DO jl = 1, jpl 
    410          at_i (:,:) = at_i (:,:) + a_i (:,:,jl) 
    411       END DO 
    412       ! 
    413       ! --- set ice velocities --- ! 
    414       u_ice (:,:) = 0._wp 
    415       v_ice (:,:) = 0._wp 
    416       ! fields needed for ice_dyn_adv_umx 
    417       l_split_advumx(1) = .FALSE. 
     358      at_i(:,:) = SUM( a_i, dim=3 ) 
    418359      ! 
    419360      !---------------------------------------------- 
    420       ! 5) Snow-ice mass (case ice is fully embedded) 
     361      ! 3) Snow-ice mass (case ice is fully embedded) 
    421362      !---------------------------------------------- 
    422363      snwice_mass  (:,:) = tmask(:,:,1) * SUM( rhos * v_s(:,:,:) + rhoi * v_i(:,:,:), dim=3  )   ! snow+ice mass 
     
    470411       
    471412      !------------------------------------ 
    472       ! 6) store fields at before time-step 
     413      ! 4) store fields at before time-step 
    473414      !------------------------------------ 
    474415      ! it is only necessary for the 1st interpolation by Agrif 
     
    508449      ! 
    509450      CHARACTER(len=256) ::  cn_dir          ! Root directory for location of ice files 
    510       TYPE(FLD_N)                    ::   sn_hti, sn_hts, sn_ati, sn_tsu, sn_tmi, sn_smi 
     451      TYPE(FLD_N)                    ::   sn_hti, sn_hts, sn_ati, sn_smi, sn_tmi, sn_tsu, sn_tms, sn_apd, sn_hpd 
    511452      TYPE(FLD_N), DIMENSION(jpfldi) ::   slf_i                 ! array of namelist informations on the fields to read 
    512453      ! 
    513       NAMELIST/namini/ ln_iceini, ln_iceini_file, rn_thres_sst, rn_hts_ini_n, rn_hts_ini_s,  & 
    514          &             rn_hti_ini_n, rn_hti_ini_s, rn_ati_ini_n, rn_ati_ini_s, rn_smi_ini_n, & 
    515          &             rn_smi_ini_s, rn_tmi_ini_n, rn_tmi_ini_s,                             & 
    516          &             sn_hti, sn_hts, sn_ati, sn_tsu, sn_tmi, sn_smi, cn_dir 
     454      NAMELIST/namini/ ln_iceini, ln_iceini_file, rn_thres_sst, & 
     455         &             rn_hti_ini_n, rn_hti_ini_s, rn_hts_ini_n, rn_hts_ini_s, & 
     456         &             rn_ati_ini_n, rn_ati_ini_s, rn_smi_ini_n, rn_smi_ini_s, & 
     457         &             rn_tmi_ini_n, rn_tmi_ini_s, rn_tsu_ini_n, rn_tsu_ini_s, rn_tms_ini_n, rn_tms_ini_s, & 
     458         &             rn_apd_ini_n, rn_apd_ini_s, rn_hpd_ini_n, rn_hpd_ini_s, & 
     459         &             sn_hti, sn_hts, sn_ati, sn_tsu, sn_tmi, sn_smi, sn_tms, sn_apd, sn_hpd, cn_dir 
    517460      !!----------------------------------------------------------------------------- 
    518461      ! 
     
    526469      ! 
    527470      slf_i(jp_hti) = sn_hti  ;  slf_i(jp_hts) = sn_hts 
    528       slf_i(jp_ati) = sn_ati  ;  slf_i(jp_tsu) = sn_tsu 
    529       slf_i(jp_tmi) = sn_tmi  ;  slf_i(jp_smi) = sn_smi 
     471      slf_i(jp_ati) = sn_ati  ;  slf_i(jp_smi) = sn_smi 
     472      slf_i(jp_tmi) = sn_tmi  ;  slf_i(jp_tsu) = sn_tsu   ;   slf_i(jp_tms) = sn_tms 
     473      slf_i(jp_apd) = sn_apd  ;  slf_i(jp_hpd) = sn_hpd 
    530474      ! 
    531475      IF(lwp) THEN                          ! control print 
     
    534478         WRITE(numout,*) '~~~~~~~~~~~~~~~' 
    535479         WRITE(numout,*) '   Namelist namini:' 
    536          WRITE(numout,*) '      initialization with ice (T) or not (F)                 ln_iceini       = ', ln_iceini 
    537          WRITE(numout,*) '      ice initialization from a netcdf file                  ln_iceini_file  = ', ln_iceini_file 
    538          WRITE(numout,*) '      max delta ocean temp. above Tfreeze with initial ice   rn_thres_sst    = ', rn_thres_sst 
    539          WRITE(numout,*) '      initial snow thickness in the north                    rn_hts_ini_n    = ', rn_hts_ini_n 
    540          WRITE(numout,*) '      initial snow thickness in the south                    rn_hts_ini_s    = ', rn_hts_ini_s  
    541          WRITE(numout,*) '      initial ice thickness  in the north                    rn_hti_ini_n    = ', rn_hti_ini_n 
    542          WRITE(numout,*) '      initial ice thickness  in the south                    rn_hti_ini_s    = ', rn_hti_ini_s 
    543          WRITE(numout,*) '      initial ice concentr.  in the north                    rn_ati_ini_n    = ', rn_ati_ini_n 
    544          WRITE(numout,*) '      initial ice concentr.  in the north                    rn_ati_ini_s    = ', rn_ati_ini_s 
    545          WRITE(numout,*) '      initial  ice salinity  in the north                    rn_smi_ini_n    = ', rn_smi_ini_n 
    546          WRITE(numout,*) '      initial  ice salinity  in the south                    rn_smi_ini_s    = ', rn_smi_ini_s 
    547          WRITE(numout,*) '      initial  ice/snw temp  in the north                    rn_tmi_ini_n    = ', rn_tmi_ini_n 
    548          WRITE(numout,*) '      initial  ice/snw temp  in the south                    rn_tmi_ini_s    = ', rn_tmi_ini_s 
     480         WRITE(numout,*) '      ice initialization (T) or not (F)                ln_iceini      = ', ln_iceini 
     481         WRITE(numout,*) '      ice initialization from a netcdf file            ln_iceini_file = ', ln_iceini_file 
     482         WRITE(numout,*) '      max ocean temp. above Tfreeze with initial ice   rn_thres_sst   = ', rn_thres_sst 
     483         IF( ln_iceini .AND. .NOT.ln_iceini_file ) THEN 
     484            WRITE(numout,*) '      initial snw thickness in the north-south         rn_hts_ini     = ', rn_hts_ini_n,rn_hts_ini_s  
     485            WRITE(numout,*) '      initial ice thickness in the north-south         rn_hti_ini     = ', rn_hti_ini_n,rn_hti_ini_s 
     486            WRITE(numout,*) '      initial ice concentr  in the north-south         rn_ati_ini     = ', rn_ati_ini_n,rn_ati_ini_s 
     487            WRITE(numout,*) '      initial ice salinity  in the north-south         rn_smi_ini     = ', rn_smi_ini_n,rn_smi_ini_s 
     488            WRITE(numout,*) '      initial surf temperat in the north-south         rn_tsu_ini     = ', rn_tsu_ini_n,rn_tsu_ini_s 
     489            WRITE(numout,*) '      initial ice temperat  in the north-south         rn_tmi_ini     = ', rn_tmi_ini_n,rn_tmi_ini_s 
     490            WRITE(numout,*) '      initial snw temperat  in the north-south         rn_tms_ini     = ', rn_tms_ini_n,rn_tms_ini_s 
     491            WRITE(numout,*) '      initial pnd fraction  in the north-south         rn_apd_ini     = ', rn_apd_ini_n,rn_apd_ini_s 
     492            WRITE(numout,*) '      initial pnd depth     in the north-south         rn_hpd_ini     = ', rn_hpd_ini_n,rn_hpd_ini_s 
     493         ENDIF 
    549494      ENDIF 
    550495      ! 
     
    554499         ALLOCATE( si(jpfldi), STAT=ierror ) 
    555500         IF( ierror > 0 ) THEN 
    556             CALL ctl_stop( 'Ice_ini in iceistate: unable to allocate si structure' )   ;   RETURN 
     501            CALL ctl_stop( 'ice_istate_ini in iceistate: unable to allocate si structure' )   ;   RETURN 
    557502         ENDIF 
    558503         ! 
    559504         DO ifpr = 1, jpfldi 
    560505            ALLOCATE( si(ifpr)%fnow(jpi,jpj,1) ) 
    561             ALLOCATE( si(ifpr)%fdta(jpi,jpj,1,2) ) 
     506            IF( slf_i(ifpr)%ln_tint )  ALLOCATE( si(ifpr)%fdta(jpi,jpj,1,2) ) 
    562507         END DO 
    563508         ! 
    564509         ! fill si with slf_i and control print 
    565          CALL fld_fill( si, slf_i, cn_dir, 'ice_istate', 'ice istate ini', 'numnam_ice' ) 
    566          ! 
    567          CALL fld_read( nit000, 1, si )                ! input fields provided at the current time-step 
     510         CALL fld_fill( si, slf_i, cn_dir, 'ice_istate_ini', 'initialization of sea ice fields', 'numnam_ice' ) 
    568511         ! 
    569512      ENDIF 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icerst.F90

    r10425 r11413  
    1414   !!   ice_rst_read  : read  restart file  
    1515   !!---------------------------------------------------------------------- 
    16    USE ice            ! sea-ice variables 
     16   USE ice            ! sea-ice: variables 
    1717   USE dom_oce        ! ocean domain 
     18   USE phycst  , ONLY : rt0 
    1819   USE sbc_oce , ONLY : nn_fsbc, ln_cpl 
    19    USE icectl 
     20   USE iceistate      ! sea-ice: initial state 
     21   USE icectl         ! sea-ice: control 
    2022   ! 
    2123   USE in_out_manager ! I/O manager 
     
    5355      IF( kt == nit000 )   lrst_ice = .FALSE.   ! default definition 
    5456 
     57      IF( ln_rst_list .OR. nn_stock /= -1 ) THEN 
    5558      ! in order to get better performances with NetCDF format, we open and define the ice restart file  
    5659      ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice  
    5760      ! restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1 
    58       IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc    & 
     61      IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nn_stock == nn_fsbc    & 
    5962         &                             .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN 
    6063         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
     
    8184         ENDIF 
    8285      ENDIF 
     86      ENDIF 
    8387      ! 
    8488      IF( ln_icectl )   CALL ice_prt( kt, iiceprt, jiceprt, 1, ' - Beginning the time step - ' )   ! control print 
     
    118122 
    119123      ! Prognostic variables 
    120       CALL iom_rstput( iter, nitrst, numriw, 'v_i' , v_i  ) 
    121       CALL iom_rstput( iter, nitrst, numriw, 'v_s' , v_s  ) 
    122       CALL iom_rstput( iter, nitrst, numriw, 'sv_i', sv_i ) 
    123       CALL iom_rstput( iter, nitrst, numriw, 'oa_i', oa_i ) 
    124       CALL iom_rstput( iter, nitrst, numriw, 'a_i' , a_i  ) 
    125       CALL iom_rstput( iter, nitrst, numriw, 't_su', t_su ) 
    126       ! Melt ponds 
    127       CALL iom_rstput( iter, nitrst, numriw, 'a_ip', a_ip ) 
    128       CALL iom_rstput( iter, nitrst, numriw, 'v_ip', v_ip ) 
     124      CALL iom_rstput( iter, nitrst, numriw, 'v_i'  , v_i   ) 
     125      CALL iom_rstput( iter, nitrst, numriw, 'v_s'  , v_s   ) 
     126      CALL iom_rstput( iter, nitrst, numriw, 'sv_i' , sv_i  ) 
     127      CALL iom_rstput( iter, nitrst, numriw, 'a_i'  , a_i   ) 
     128      CALL iom_rstput( iter, nitrst, numriw, 't_su' , t_su  ) 
     129      CALL iom_rstput( iter, nitrst, numriw, 'u_ice', u_ice ) 
     130      CALL iom_rstput( iter, nitrst, numriw, 'v_ice', v_ice ) 
     131      CALL iom_rstput( iter, nitrst, numriw, 'oa_i' , oa_i  ) 
     132      CALL iom_rstput( iter, nitrst, numriw, 'a_ip' , a_ip  ) 
     133      CALL iom_rstput( iter, nitrst, numriw, 'v_ip' , v_ip  ) 
    129134      ! Snow enthalpy 
    130135      DO jk = 1, nlay_s  
     
    141146         CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 
    142147      END DO 
    143       ! ice velocity 
    144       CALL iom_rstput( iter, nitrst, numriw, 'u_ice', u_ice ) ! u_ice 
    145       CALL iom_rstput( iter, nitrst, numriw, 'v_ice', v_ice ) ! v_ice 
    146148      ! fields needed for Met Office (Jules) coupling 
    147149      IF( ln_cpl ) THEN 
     
    169171      INTEGER           ::   jk 
    170172      LOGICAL           ::   llok 
    171       INTEGER           ::   id1            ! local integer 
     173      INTEGER           ::   id0, id1, id2, id3, id4   ! local integer 
    172174      CHARACTER(len=25) ::   znam 
    173175      CHARACTER(len=2)  ::   zchar, zchar1 
     
    184186      CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kdlev = jpl ) 
    185187 
    186       CALL iom_get( numrir, 'nn_fsbc', zfice ) 
    187       CALL iom_get( numrir, 'kt_ice' , ziter )     
    188       IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter 
    189       IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1 
    190  
    191       ! Control of date 
    192       IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   & 
    193          &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nit000 in ice restart',  & 
    194          &                   '   verify the file or rerun with the value 0 for the',        & 
    195          &                   '   control of time parameter  nrstdt' ) 
    196       IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   & 
    197          &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nn_fsbc in ice restart',  & 
    198          &                   '   verify the file or rerun with the value 0 for the',         & 
    199          &                   '   control of time parameter  nrstdt' ) 
    200  
    201       ! Prognostic variables  
    202       CALL iom_get( numrir, jpdom_autoglo, 'v_i' , v_i  ) 
    203       CALL iom_get( numrir, jpdom_autoglo, 'v_s' , v_s  ) 
    204       CALL iom_get( numrir, jpdom_autoglo, 'sv_i', sv_i ) 
    205       CALL iom_get( numrir, jpdom_autoglo, 'oa_i', oa_i ) 
    206       CALL iom_get( numrir, jpdom_autoglo, 'a_i' , a_i  ) 
    207       CALL iom_get( numrir, jpdom_autoglo, 't_su', t_su ) 
    208       ! Melt ponds 
    209       id1 = iom_varid( numrir, 'a_ip' , ldstop = .FALSE. ) 
    210       IF( id1 > 0 ) THEN                       ! fields exist (melt ponds) 
    211          CALL iom_get( numrir, jpdom_autoglo, 'a_ip' , a_ip ) 
    212          CALL iom_get( numrir, jpdom_autoglo, 'v_ip' , v_ip ) 
    213       ELSE                                     ! start from rest 
    214          IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it to zero' 
    215          a_ip(:,:,:) = 0._wp 
    216          v_ip(:,:,:) = 0._wp 
    217       ENDIF 
    218       ! Snow enthalpy 
    219       DO jk = 1, nlay_s 
    220          WRITE(zchar1,'(I2.2)') jk 
    221          znam = 'e_s'//'_l'//zchar1 
    222          CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) 
    223          e_s(:,:,jk,:) = z3d(:,:,:) 
    224       END DO 
    225       ! Ice enthalpy 
    226       DO jk = 1, nlay_i 
    227          WRITE(zchar1,'(I2.2)') jk 
    228          znam = 'e_i'//'_l'//zchar1 
    229          CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) 
    230          e_i(:,:,jk,:) = z3d(:,:,:) 
    231       END DO 
    232       ! ice velocity 
    233       CALL iom_get( numrir, jpdom_autoglo, 'u_ice', u_ice ) 
    234       CALL iom_get( numrir, jpdom_autoglo, 'v_ice', v_ice ) 
    235  
    236       CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables 
    237  
    238       ! fields needed for Met Office (Jules) coupling 
    239       IF( ln_cpl ) THEN 
    240          CALL iom_get( numrir, jpdom_autoglo, 'cnd_ice', cnd_ice ) 
    241          CALL iom_get( numrir, jpdom_autoglo, 't1_ice' , t1_ice  ) 
     188      ! test if v_i exists  
     189      id0 = iom_varid( numrir, 'v_i' , ldstop = .FALSE. ) 
     190 
     191      !                    ! ------------------------------ ! 
     192      IF( id0 > 0 ) THEN   ! == case of a normal restart == ! 
     193         !                 ! ------------------------------ ! 
     194          
     195         ! Time info 
     196         CALL iom_get( numrir, 'nn_fsbc', zfice ) 
     197         CALL iom_get( numrir, 'kt_ice' , ziter )     
     198         IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter 
     199         IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1 
     200 
     201         ! Control of date 
     202         IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   & 
     203            &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nit000 in ice restart',  & 
     204            &                   '   verify the file or rerun with the value 0 for the',        & 
     205            &                   '   control of time parameter  nrstdt' ) 
     206         IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   & 
     207            &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nn_fsbc in ice restart',  & 
     208            &                   '   verify the file or rerun with the value 0 for the',         & 
     209            &                   '   control of time parameter  nrstdt' ) 
     210 
     211         ! --- mandatory fields --- !  
     212         CALL iom_get( numrir, jpdom_autoglo, 'v_i'  , v_i   ) 
     213         CALL iom_get( numrir, jpdom_autoglo, 'v_s'  , v_s   ) 
     214         CALL iom_get( numrir, jpdom_autoglo, 'sv_i' , sv_i  ) 
     215         CALL iom_get( numrir, jpdom_autoglo, 'a_i'  , a_i   ) 
     216         CALL iom_get( numrir, jpdom_autoglo, 't_su' , t_su  ) 
     217         CALL iom_get( numrir, jpdom_autoglo, 'u_ice', u_ice ) 
     218         CALL iom_get( numrir, jpdom_autoglo, 'v_ice', v_ice ) 
     219         ! Snow enthalpy 
     220         DO jk = 1, nlay_s 
     221            WRITE(zchar1,'(I2.2)') jk 
     222            znam = 'e_s'//'_l'//zchar1 
     223            CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) 
     224            e_s(:,:,jk,:) = z3d(:,:,:) 
     225         END DO 
     226         ! Ice enthalpy 
     227         DO jk = 1, nlay_i 
     228            WRITE(zchar1,'(I2.2)') jk 
     229            znam = 'e_i'//'_l'//zchar1 
     230            CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) 
     231            e_i(:,:,jk,:) = z3d(:,:,:) 
     232         END DO 
     233         ! -- optional fields -- ! 
     234         ! ice age 
     235         id1 = iom_varid( numrir, 'oa_i' , ldstop = .FALSE. ) 
     236         IF( id1 > 0 ) THEN                       ! fields exist 
     237            CALL iom_get( numrir, jpdom_autoglo, 'oa_i', oa_i ) 
     238         ELSE                                     ! start from rest 
     239            IF(lwp) WRITE(numout,*) '   ==>>   previous run without ice age output then set it to zero' 
     240            oa_i(:,:,:) = 0._wp 
     241         ENDIF 
     242         ! melt ponds 
     243         id2 = iom_varid( numrir, 'a_ip' , ldstop = .FALSE. ) 
     244         IF( id2 > 0 ) THEN                       ! fields exist 
     245            CALL iom_get( numrir, jpdom_autoglo, 'a_ip' , a_ip ) 
     246            CALL iom_get( numrir, jpdom_autoglo, 'v_ip' , v_ip ) 
     247         ELSE                                     ! start from rest 
     248            IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it to zero' 
     249            a_ip(:,:,:) = 0._wp 
     250            v_ip(:,:,:) = 0._wp 
     251         ENDIF 
     252         ! fields needed for Met Office (Jules) coupling 
     253         IF( ln_cpl ) THEN 
     254            id3 = iom_varid( numrir, 'cnd_ice' , ldstop = .FALSE. ) 
     255            id4 = iom_varid( numrir, 't1_ice'  , ldstop = .FALSE. ) 
     256            IF( id3 > 0 .AND. id4 > 0 ) THEN         ! fields exist 
     257               CALL iom_get( numrir, jpdom_autoglo, 'cnd_ice', cnd_ice ) 
     258               CALL iom_get( numrir, jpdom_autoglo, 't1_ice' , t1_ice  ) 
     259            ELSE                                     ! start from rest 
     260               IF(lwp) WRITE(numout,*) '   ==>>   previous run without conductivity output then set it to zero' 
     261               cnd_ice(:,:,:) = 0._wp 
     262               t1_ice (:,:,:) = rt0 
     263            ENDIF 
     264         ENDIF 
     265 
     266         CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables 
     267 
     268         !                 ! ---------------------------------- ! 
     269      ELSE                 ! == case of a simplified restart == ! 
     270         !                 ! ---------------------------------- ! 
     271         CALL ctl_warn('ice_rst_read: you are using a simplified ice restart') 
     272         ! 
     273         CALL ice_istate_init 
     274         CALL ice_istate( nit000 ) 
     275         ! 
     276         IF( .NOT.ln_iceini .OR. .NOT.ln_iceini_file ) & 
     277            &   CALL ctl_stop('STOP', 'ice_rst_read: you need ln_ice_ini=T and ln_iceini_file=T') 
     278         ! 
    242279      ENDIF 
    243280 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icesbc.F90

    r11360 r11413  
    118118      INTEGER, INTENT(in) ::   ksbc   ! flux formulation (user defined, bulk or Pure Coupled) 
    119119      ! 
    120       INTEGER  ::   ji, jj, jl                                ! dummy loop index 
    121       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalb_os, zalb_cs  ! ice albedo under overcast/clear sky 
    122       REAL(wp), DIMENSION(jpi,jpj)     ::   zalb              ! 2D workspace 
     120      INTEGER  ::   ji, jj, jl      ! dummy loop index 
     121      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios  
     122      REAL(wp), DIMENSION(jpi,jpj,jpl)              ::   zalb_os, zalb_cs  ! ice albedo under overcast/clear sky 
     123      REAL(wp), DIMENSION(:,:)        , ALLOCATABLE ::   zalb, zmsk00      ! 2D workspace 
    123124      !!-------------------------------------------------------------------- 
    124125      ! 
     
    130131         WRITE(numout,*)'~~~~~~~~~~~~~~~' 
    131132      ENDIF 
     133 
     134      ! get missing value from xml 
     135      CALL iom_miss_val( "icetemp", zmiss_val ) 
    132136 
    133137      ! --- cloud-sky and overcast-sky ice albedos --- ! 
     
    157161 
    158162      !--- output ice albedo and surface albedo ---! 
    159       IF( iom_use('icealb') ) THEN 
    160          WHERE( at_i_b <= epsi06 )   ;   zalb(:,:) = rn_alb_oce 
    161          ELSEWHERE                   ;   zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b 
     163      IF( iom_use('icealb') .OR. iom_use('albedo') ) THEN 
     164 
     165         ALLOCATE( zalb(jpi,jpj), zmsk00(jpi,jpj) ) 
     166 
     167         WHERE( at_i_b <= epsi06 ) 
     168            zmsk00(:,:) = 0._wp 
     169            zalb  (:,:) = rn_alb_oce 
     170         ELSEWHERE 
     171            zmsk00(:,:) = 1._wp             
     172            zalb  (:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b 
    162173         END WHERE 
    163          CALL iom_put( "icealb" , zalb(:,:) ) 
    164       ENDIF 
    165       IF( iom_use('albedo') ) THEN 
     174         ! ice albedo 
     175         CALL iom_put( 'icealb' , zalb * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) ) 
     176         ! ice+ocean albedo 
    166177         zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) + rn_alb_oce * ( 1._wp - at_i_b ) 
    167          CALL iom_put( "albedo" , zalb(:,:) ) 
     178         CALL iom_put( 'albedo' , zalb ) 
     179 
     180         DEALLOCATE( zalb, zmsk00 ) 
     181 
    168182      ENDIF 
    169183      ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icestp.F90

    r11348 r11413  
    254254      IF( .NOT. ln_rstart ) THEN              ! start from rest: sea-ice deduced from sst 
    255255         CALL ice_istate_init 
    256          CALL ice_istate 
     256         CALL ice_istate( nit000 ) 
    257257      ELSE                                    ! start from a restart file 
    258258         CALL ice_rst_read 
     
    425425      wfx_err_sub(:,:) = 0._wp 
    426426      ! 
    427       afx_tot(:,:) = 0._wp   ; 
    428       ! 
    429427      diag_heat(:,:) = 0._wp ;   diag_sice(:,:) = 0._wp 
    430428      diag_vice(:,:) = 0._wp ;   diag_vsnw(:,:) = 0._wp 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/iceupdate.F90

    r10425 r11413  
    198198      ! --- salt fluxes [kg/m2/s] --- ! 
    199199      !                           ! sfxice =  sfxbog + sfxbom + sfxsum + sfxsni + sfxopw + sfxres + sfxdyn + sfxbri + sfxsub + sfxlam 
    200       IF( iom_use('sfxice'  ) )   CALL iom_put( "sfxice", sfx     * 1.e-03 )   ! salt flux from total ice growth/melt 
    201       IF( iom_use('sfxbog'  ) )   CALL iom_put( "sfxbog", sfx_bog * 1.e-03 )   ! salt flux from bottom growth 
    202       IF( iom_use('sfxbom'  ) )   CALL iom_put( "sfxbom", sfx_bom * 1.e-03 )   ! salt flux from bottom melting 
    203       IF( iom_use('sfxsum'  ) )   CALL iom_put( "sfxsum", sfx_sum * 1.e-03 )   ! salt flux from surface melting 
    204       IF( iom_use('sfxlam'  ) )   CALL iom_put( "sfxlam", sfx_lam * 1.e-03 )   ! salt flux from lateral melting 
    205       IF( iom_use('sfxsni'  ) )   CALL iom_put( "sfxsni", sfx_sni * 1.e-03 )   ! salt flux from snow ice formation 
    206       IF( iom_use('sfxopw'  ) )   CALL iom_put( "sfxopw", sfx_opw * 1.e-03 )   ! salt flux from open water formation 
    207       IF( iom_use('sfxdyn'  ) )   CALL iom_put( "sfxdyn", sfx_dyn * 1.e-03 )   ! salt flux from ridging rafting 
    208       IF( iom_use('sfxbri'  ) )   CALL iom_put( "sfxbri", sfx_bri * 1.e-03 )   ! salt flux from brines 
    209       IF( iom_use('sfxres'  ) )   CALL iom_put( "sfxres", sfx_res * 1.e-03 )   ! salt flux from undiagnosed processes 
    210       IF( iom_use('sfxsub'  ) )   CALL iom_put( "sfxsub", sfx_sub * 1.e-03 )   ! salt flux from sublimation 
     200      IF( iom_use('sfxice'  ) )   CALL iom_put( 'sfxice', sfx     * 1.e-03 )   ! salt flux from total ice growth/melt 
     201      IF( iom_use('sfxbog'  ) )   CALL iom_put( 'sfxbog', sfx_bog * 1.e-03 )   ! salt flux from bottom growth 
     202      IF( iom_use('sfxbom'  ) )   CALL iom_put( 'sfxbom', sfx_bom * 1.e-03 )   ! salt flux from bottom melting 
     203      IF( iom_use('sfxsum'  ) )   CALL iom_put( 'sfxsum', sfx_sum * 1.e-03 )   ! salt flux from surface melting 
     204      IF( iom_use('sfxlam'  ) )   CALL iom_put( 'sfxlam', sfx_lam * 1.e-03 )   ! salt flux from lateral melting 
     205      IF( iom_use('sfxsni'  ) )   CALL iom_put( 'sfxsni', sfx_sni * 1.e-03 )   ! salt flux from snow ice formation 
     206      IF( iom_use('sfxopw'  ) )   CALL iom_put( 'sfxopw', sfx_opw * 1.e-03 )   ! salt flux from open water formation 
     207      IF( iom_use('sfxdyn'  ) )   CALL iom_put( 'sfxdyn', sfx_dyn * 1.e-03 )   ! salt flux from ridging rafting 
     208      IF( iom_use('sfxbri'  ) )   CALL iom_put( 'sfxbri', sfx_bri * 1.e-03 )   ! salt flux from brines 
     209      IF( iom_use('sfxres'  ) )   CALL iom_put( 'sfxres', sfx_res * 1.e-03 )   ! salt flux from undiagnosed processes 
     210      IF( iom_use('sfxsub'  ) )   CALL iom_put( 'sfxsub', sfx_sub * 1.e-03 )   ! salt flux from sublimation 
    211211 
    212212      ! --- mass fluxes [kg/m2/s] --- ! 
    213       IF( iom_use('emp_oce' ) )   CALL iom_put( "emp_oce", emp_oce )   ! emp over ocean (taking into account the snow blown away from the ice) 
    214       IF( iom_use('emp_ice' ) )   CALL iom_put( "emp_ice", emp_ice )   ! emp over ice   (taking into account the snow blown away from the ice) 
     213      CALL iom_put( 'emp_oce', emp_oce )   ! emp over ocean (taking into account the snow blown away from the ice) 
     214      CALL iom_put( 'emp_ice', emp_ice )   ! emp over ice   (taking into account the snow blown away from the ice) 
    215215 
    216216      !                           ! vfxice = vfxbog + vfxbom + vfxsum + vfxsni + vfxopw + vfxdyn + vfxres + vfxlam + vfxpnd 
    217       IF( iom_use('vfxice'  ) )   CALL iom_put( "vfxice" , wfx_ice )   ! mass flux from total ice growth/melt 
    218       IF( iom_use('vfxbog'  ) )   CALL iom_put( "vfxbog" , wfx_bog )   ! mass flux from bottom growth 
    219       IF( iom_use('vfxbom'  ) )   CALL iom_put( "vfxbom" , wfx_bom )   ! mass flux from bottom melt  
    220       IF( iom_use('vfxsum'  ) )   CALL iom_put( "vfxsum" , wfx_sum )   ! mass flux from surface melt  
    221       IF( iom_use('vfxlam'  ) )   CALL iom_put( "vfxlam" , wfx_lam )   ! mass flux from lateral melt  
    222       IF( iom_use('vfxsni'  ) )   CALL iom_put( "vfxsni" , wfx_sni )   ! mass flux from snow-ice formation 
    223       IF( iom_use('vfxopw'  ) )   CALL iom_put( "vfxopw" , wfx_opw )   ! mass flux from growth in open water 
    224       IF( iom_use('vfxdyn'  ) )   CALL iom_put( "vfxdyn" , wfx_dyn )   ! mass flux from dynamics (ridging) 
    225       IF( iom_use('vfxres'  ) )   CALL iom_put( "vfxres" , wfx_res )   ! mass flux from undiagnosed processes  
    226       IF( iom_use('vfxpnd'  ) )   CALL iom_put( "vfxpnd" , wfx_pnd )   ! mass flux from melt ponds 
    227       IF( iom_use('vfxsub'  ) )   CALL iom_put( "vfxsub" , wfx_ice_sub )   ! mass flux from ice sublimation (ice-atm.) 
    228       IF( iom_use('vfxsub_err') ) CALL iom_put( "vfxsub_err", wfx_err_sub )   ! "excess" of sublimation sent to ocean       
    229  
    230       IF ( iom_use( "vfxthin" ) ) THEN   ! mass flux from ice growth in open water + thin ice (<20cm) => comparable to observations   
     217      CALL iom_put( 'vfxice'    , wfx_ice    )   ! mass flux from total ice growth/melt 
     218      CALL iom_put( 'vfxbog'    , wfx_bog    )   ! mass flux from bottom growth 
     219      CALL iom_put( 'vfxbom'    , wfx_bom    )   ! mass flux from bottom melt  
     220      CALL iom_put( 'vfxsum'    , wfx_sum    )   ! mass flux from surface melt  
     221      CALL iom_put( 'vfxlam'    , wfx_lam    )   ! mass flux from lateral melt  
     222      CALL iom_put( 'vfxsni'    , wfx_sni    )   ! mass flux from snow-ice formation 
     223      CALL iom_put( 'vfxopw'    , wfx_opw    )   ! mass flux from growth in open water 
     224      CALL iom_put( 'vfxdyn'    , wfx_dyn    )   ! mass flux from dynamics (ridging) 
     225      CALL iom_put( 'vfxres'    , wfx_res    )   ! mass flux from undiagnosed processes  
     226      CALL iom_put( 'vfxpnd'    , wfx_pnd    )   ! mass flux from melt ponds 
     227      CALL iom_put( 'vfxsub'    , wfx_ice_sub )   ! mass flux from ice sublimation (ice-atm.) 
     228      CALL iom_put( 'vfxsub_err', wfx_err_sub )   ! "excess" of sublimation sent to ocean       
     229 
     230      IF ( iom_use( 'vfxthin' ) ) THEN   ! mass flux from ice growth in open water + thin ice (<20cm) => comparable to observations   
    231231         WHERE( hm_i(:,:) < 0.2 .AND. hm_i(:,:) > 0. ) ; z2d = wfx_bog 
    232232         ELSEWHERE                                     ; z2d = 0._wp 
    233233         END WHERE 
    234          CALL iom_put( "vfxthin", wfx_opw + z2d ) 
    235       ENDIF 
    236  
    237       !                              ! vfxsnw = vfxsnw_sni + vfxsnw_dyn + vfxsnw_sum 
    238       IF( iom_use('vfxsnw'     ) )   CALL iom_put( "vfxsnw"     , wfx_snw     )   ! mass flux from total snow growth/melt 
    239       IF( iom_use('vfxsnw_sum' ) )   CALL iom_put( "vfxsnw_sum" , wfx_snw_sum )   ! mass flux from snow melt at the surface 
    240       IF( iom_use('vfxsnw_sni' ) )   CALL iom_put( "vfxsnw_sni" , wfx_snw_sni )   ! mass flux from snow melt during snow-ice formation  
    241       IF( iom_use('vfxsnw_dyn' ) )   CALL iom_put( "vfxsnw_dyn" , wfx_snw_dyn )   ! mass flux from dynamics (ridging)  
    242       IF( iom_use('vfxsnw_sub' ) )   CALL iom_put( "vfxsnw_sub" , wfx_snw_sub )   ! mass flux from snow sublimation (ice-atm.)  
    243       IF( iom_use('vfxsnw_pre' ) )   CALL iom_put( "vfxsnw_pre" , wfx_spr     )   ! snow precip 
     234         CALL iom_put( 'vfxthin', wfx_opw + z2d ) 
     235      ENDIF 
     236 
     237      !                            ! vfxsnw = vfxsnw_sni + vfxsnw_dyn + vfxsnw_sum 
     238      CALL iom_put( 'vfxsnw'     , wfx_snw     )   ! mass flux from total snow growth/melt 
     239      CALL iom_put( 'vfxsnw_sum' , wfx_snw_sum )   ! mass flux from snow melt at the surface 
     240      CALL iom_put( 'vfxsnw_sni' , wfx_snw_sni )   ! mass flux from snow melt during snow-ice formation  
     241      CALL iom_put( 'vfxsnw_dyn' , wfx_snw_dyn )   ! mass flux from dynamics (ridging)  
     242      CALL iom_put( 'vfxsnw_sub' , wfx_snw_sub )   ! mass flux from snow sublimation (ice-atm.)  
     243      CALL iom_put( 'vfxsnw_pre' , wfx_spr     )   ! snow precip 
    244244 
    245245      ! --- heat fluxes [W/m2] --- ! 
    246246      !                              ! qt_atm_oi - qt_oce_ai = hfxdhc - ( dihctrp + dshctrp ) 
    247       IF( iom_use('qsr_oce'    ) )   CALL iom_put( "qsr_oce"    , qsr_oce * ( 1._wp - at_i_b )                               )   !     solar flux at ocean surface 
    248       IF( iom_use('qns_oce'    ) )   CALL iom_put( "qns_oce"    , qns_oce * ( 1._wp - at_i_b ) + qemp_oce                    )   ! non-solar flux at ocean surface 
    249       IF( iom_use('qsr_ice'    ) )   CALL iom_put( "qsr_ice"    , SUM( qsr_ice * a_i_b, dim=3 )                              )   !     solar flux at ice surface 
    250       IF( iom_use('qns_ice'    ) )   CALL iom_put( "qns_ice"    , SUM( qns_ice * a_i_b, dim=3 ) + qemp_ice                   )   ! non-solar flux at ice surface 
    251       IF( iom_use('qtr_ice_bot') )   CALL iom_put( "qtr_ice_bot", SUM( qtr_ice_bot * a_i_b, dim=3 )                          )   !     solar flux transmitted thru ice 
    252       IF( iom_use('qtr_ice_top') )   CALL iom_put( "qtr_ice_top", SUM( qtr_ice_top * a_i_b, dim=3 )                          )   !     solar flux transmitted thru ice surface 
    253       IF( iom_use('qt_oce'     ) )   CALL iom_put( "qt_oce"     ,      ( qsr_oce + qns_oce ) * ( 1._wp - at_i_b ) + qemp_oce ) 
    254       IF( iom_use('qt_ice'     ) )   CALL iom_put( "qt_ice"     , SUM( ( qns_ice + qsr_ice ) * a_i_b, dim=3 )     + qemp_ice ) 
    255       IF( iom_use('qt_oce_ai'  ) )   CALL iom_put( "qt_oce_ai"  , qt_oce_ai * tmask(:,:,1)                                   )   ! total heat flux at the ocean   surface: interface oce-(ice+atm)  
    256       IF( iom_use('qt_atm_oi'  ) )   CALL iom_put( "qt_atm_oi"  , qt_atm_oi * tmask(:,:,1)                                   )   ! total heat flux at the oce-ice surface: interface atm-(ice+oce)  
    257       IF( iom_use('qemp_oce'   ) )   CALL iom_put( "qemp_oce"   , qemp_oce                                                   )   ! Downward Heat Flux from E-P over ocean 
    258       IF( iom_use('qemp_ice'   ) )   CALL iom_put( "qemp_ice"   , qemp_ice                                                   )   ! Downward Heat Flux from E-P over ice 
     247      IF( iom_use('qsr_oce'    ) )   CALL iom_put( 'qsr_oce'    , qsr_oce * ( 1._wp - at_i_b )                               )   !     solar flux at ocean surface 
     248      IF( iom_use('qns_oce'    ) )   CALL iom_put( 'qns_oce'    , qns_oce * ( 1._wp - at_i_b ) + qemp_oce                    )   ! non-solar flux at ocean surface 
     249      IF( iom_use('qsr_ice'    ) )   CALL iom_put( 'qsr_ice'    , SUM( qsr_ice * a_i_b, dim=3 )                              )   !     solar flux at ice surface 
     250      IF( iom_use('qns_ice'    ) )   CALL iom_put( 'qns_ice'    , SUM( qns_ice * a_i_b, dim=3 ) + qemp_ice                   )   ! non-solar flux at ice surface 
     251      IF( iom_use('qtr_ice_bot') )   CALL iom_put( 'qtr_ice_bot', SUM( qtr_ice_bot * a_i_b, dim=3 )                          )   !     solar flux transmitted thru ice 
     252      IF( iom_use('qtr_ice_top') )   CALL iom_put( 'qtr_ice_top', SUM( qtr_ice_top * a_i_b, dim=3 )                          )   !     solar flux transmitted thru ice surface 
     253      IF( iom_use('qt_oce'     ) )   CALL iom_put( 'qt_oce'     ,      ( qsr_oce + qns_oce ) * ( 1._wp - at_i_b ) + qemp_oce ) 
     254      IF( iom_use('qt_ice'     ) )   CALL iom_put( 'qt_ice'     , SUM( ( qns_ice + qsr_ice ) * a_i_b, dim=3 )     + qemp_ice ) 
     255      IF( iom_use('qt_oce_ai'  ) )   CALL iom_put( 'qt_oce_ai'  , qt_oce_ai * tmask(:,:,1)                                   )   ! total heat flux at the ocean   surface: interface oce-(ice+atm)  
     256      IF( iom_use('qt_atm_oi'  ) )   CALL iom_put( 'qt_atm_oi'  , qt_atm_oi * tmask(:,:,1)                                   )   ! total heat flux at the oce-ice surface: interface atm-(ice+oce)  
     257      IF( iom_use('qemp_oce'   ) )   CALL iom_put( 'qemp_oce'   , qemp_oce                                                   )   ! Downward Heat Flux from E-P over ocean 
     258      IF( iom_use('qemp_ice'   ) )   CALL iom_put( 'qemp_ice'   , qemp_ice                                                   )   ! Downward Heat Flux from E-P over ice 
    259259 
    260260      ! heat fluxes from ice transformations 
    261       !                              ! hfxdhc = hfxbog + hfxbom + hfxsum + hfxopw + hfxdif + hfxsnw - ( hfxthd + hfxdyn + hfxres + hfxsub + hfxspr ) 
    262       IF( iom_use('hfxbog'     ) )   CALL iom_put ("hfxbog"     , hfx_bog             )   ! heat flux used for ice bottom growth  
    263       IF( iom_use('hfxbom'     ) )   CALL iom_put ("hfxbom"     , hfx_bom             )   ! heat flux used for ice bottom melt 
    264       IF( iom_use('hfxsum'     ) )   CALL iom_put ("hfxsum"     , hfx_sum             )   ! heat flux used for ice surface melt 
    265       IF( iom_use('hfxopw'     ) )   CALL iom_put ("hfxopw"     , hfx_opw             )   ! heat flux used for ice formation in open water 
    266       IF( iom_use('hfxdif'     ) )   CALL iom_put ("hfxdif"     , hfx_dif             )   ! heat flux used for ice temperature change 
    267       IF( iom_use('hfxsnw'     ) )   CALL iom_put ("hfxsnw"     , hfx_snw             )   ! heat flux used for snow melt  
    268       IF( iom_use('hfxerr'     ) )   CALL iom_put ("hfxerr"     , hfx_err_dif        )   ! heat flux error after heat diffusion (included in qt_oce_ai) 
     261      !                            ! hfxdhc = hfxbog + hfxbom + hfxsum + hfxopw + hfxdif + hfxsnw - ( hfxthd + hfxdyn + hfxres + hfxsub + hfxspr ) 
     262      CALL iom_put ('hfxbog'     , hfx_bog     )   ! heat flux used for ice bottom growth  
     263      CALL iom_put ('hfxbom'     , hfx_bom     )   ! heat flux used for ice bottom melt 
     264      CALL iom_put ('hfxsum'     , hfx_sum     )   ! heat flux used for ice surface melt 
     265      CALL iom_put ('hfxopw'     , hfx_opw     )   ! heat flux used for ice formation in open water 
     266      CALL iom_put ('hfxdif'     , hfx_dif     )   ! heat flux used for ice temperature change 
     267      CALL iom_put ('hfxsnw'     , hfx_snw     )   ! heat flux used for snow melt  
     268      CALL iom_put ('hfxerr'     , hfx_err_dif )   ! heat flux error after heat diffusion (included in qt_oce_ai) 
    269269 
    270270      ! heat fluxes associated with mass exchange (freeze/melt/precip...) 
    271       IF( iom_use('hfxthd'     ) )   CALL iom_put ("hfxthd"     , hfx_thd             )   !   
    272       IF( iom_use('hfxdyn'     ) )   CALL iom_put ("hfxdyn"     , hfx_dyn             )   !   
    273       IF( iom_use('hfxres'     ) )   CALL iom_put ("hfxres"     , hfx_res             )   !   
    274       IF( iom_use('hfxsub'     ) )   CALL iom_put ("hfxsub"     , hfx_sub             )   !   
    275       IF( iom_use('hfxspr'     ) )   CALL iom_put ("hfxspr"     , hfx_spr             )   ! Heat flux from snow precip heat content  
     271      CALL iom_put ('hfxthd'     , hfx_thd     )   !   
     272      CALL iom_put ('hfxdyn'     , hfx_dyn     )   !   
     273      CALL iom_put ('hfxres'     , hfx_res     )   !   
     274      CALL iom_put ('hfxsub'     , hfx_sub     )   !   
     275      CALL iom_put ('hfxspr'     , hfx_spr     )   ! Heat flux from snow precip heat content  
    276276 
    277277      ! other heat fluxes 
    278       IF( iom_use('hfxsensib'  ) )   CALL iom_put( "hfxsensib"  ,     -qsb_ice_bot * at_i_b         )   ! Sensible oceanic heat flux 
    279       IF( iom_use('hfxcndbot'  ) )   CALL iom_put( "hfxcndbot"  , SUM( qcn_ice_bot * a_i_b, dim=3 ) )   ! Bottom conduction flux 
    280       IF( iom_use('hfxcndtop'  ) )   CALL iom_put( "hfxcndtop"  , SUM( qcn_ice_top * a_i_b, dim=3 ) )   ! Surface conduction flux 
    281  
    282       ! diags 
    283       IF( iom_use('hfxdhc'     ) )   CALL iom_put ("hfxdhc"     , diag_heat           )   ! Heat content variation in snow and ice  
    284       ! 
     278      IF( iom_use('hfxsensib'  ) )   CALL iom_put( 'hfxsensib'  ,     -qsb_ice_bot * at_i_b         )   ! Sensible oceanic heat flux 
     279      IF( iom_use('hfxcndbot'  ) )   CALL iom_put( 'hfxcndbot'  , SUM( qcn_ice_bot * a_i_b, dim=3 ) )   ! Bottom conduction flux 
     280      IF( iom_use('hfxcndtop'  ) )   CALL iom_put( 'hfxcndtop'  , SUM( qcn_ice_top * a_i_b, dim=3 ) )   ! Surface conduction flux 
     281 
    285282      ! controls 
    286283      !--------- 
     
    413410      !! ** Method  :   use of IOM library 
    414411      !!---------------------------------------------------------------------- 
    415       CHARACTER(len=*) , INTENT(in) ::   cdrw   ! "READ"/"WRITE" flag 
     412      CHARACTER(len=*) , INTENT(in) ::   cdrw   ! 'READ'/'WRITE' flag 
    416413      INTEGER, OPTIONAL, INTENT(in) ::   kt     ! ice time-step 
    417414      ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icevar.F90

    r11348 r11413  
    3232   !!                        - vt_s(jpi,jpj) 
    3333   !!                        - at_i(jpi,jpj) 
     34   !!                        - st_i(jpi,jpj) 
    3435   !!                        - et_s(jpi,jpj)  total snow heat content 
    3536   !!                        - et_i(jpi,jpj)  total ice thermal content  
     
    4647   !!   ice_var_zapneg    : remove negative ice fields 
    4748   !!   ice_var_roundoff  : remove negative values arising from roundoff erros 
    48    !!   ice_var_itd       : convert 1-cat to jpl-cat 
    49    !!   ice_var_itd2      : convert N-cat to jpl-cat 
     49   !!   ice_var_itd       : convert N-cat to M-cat 
    5050   !!   ice_var_bv        : brine volume 
    5151   !!   ice_var_enthalpy  : compute ice and snow enthalpies from temperature 
     
    104104      ! 
    105105      !                                      ! integrated values 
    106       vt_i(:,:) =       SUM( v_i(:,:,:)           , dim=3 ) 
    107       vt_s(:,:) =       SUM( v_s(:,:,:)           , dim=3 ) 
    108       at_i(:,:) =       SUM( a_i(:,:,:)           , dim=3 ) 
    109       et_s(:,:)  = SUM( SUM( e_s(:,:,:,:), dim=4 ), dim=3 ) 
    110       et_i(:,:)  = SUM( SUM( e_i(:,:,:,:), dim=4 ), dim=3 ) 
     106      vt_i(:,:) =       SUM( v_i (:,:,:)           , dim=3 ) 
     107      vt_s(:,:) =       SUM( v_s (:,:,:)           , dim=3 ) 
     108      st_i(:,:) =       SUM( sv_i(:,:,:)           , dim=3 ) 
     109      at_i(:,:) =       SUM( a_i (:,:,:)           , dim=3 ) 
     110      et_s(:,:)  = SUM( SUM( e_s (:,:,:,:), dim=4 ), dim=3 ) 
     111      et_i(:,:)  = SUM( SUM( e_i (:,:,:,:), dim=4 ), dim=3 ) 
    111112      ! 
    112113      at_ip(:,:) = SUM( a_ip(:,:,:), dim=3 ) ! melt ponds 
     
    142143         tm_si(:,:) = SUM( t_si(:,:,:) * a_i(:,:,:) , dim=3 ) * z1_at_i(:,:) 
    143144         om_i (:,:) = SUM( oa_i(:,:,:)              , dim=3 ) * z1_at_i(:,:) 
    144          sm_i (:,:) = SUM( sv_i(:,:,:)              , dim=3 ) * z1_vt_i(:,:) 
     145         sm_i (:,:) =      st_i(:,:)                          * z1_vt_i(:,:) 
    145146         ! 
    146147         tm_i(:,:) = 0._wp 
     
    268269      ! 
    269270      ! integrated values  
    270       vt_i (:,:) = SUM( v_i, dim=3 ) 
    271       vt_s (:,:) = SUM( v_s, dim=3 ) 
    272       at_i (:,:) = SUM( a_i, dim=3 ) 
     271      vt_i (:,:) = SUM( v_i , dim=3 ) 
     272      vt_s (:,:) = SUM( v_s , dim=3 ) 
     273      at_i (:,:) = SUM( a_i , dim=3 ) 
    273274      ! 
    274275   END SUBROUTINE ice_var_glo2eqv 
     
    538539 
    539540      ! to be sure that at_i is the sum of a_i(jl) 
    540       at_i (:,:) = SUM( a_i(:,:,:), dim=3 ) 
    541       vt_i (:,:) = SUM( v_i(:,:,:), dim=3 ) 
     541      at_i (:,:) = SUM( a_i (:,:,:), dim=3 ) 
     542      vt_i (:,:) = SUM( v_i (:,:,:), dim=3 ) 
     543!!clem add? 
     544!      vt_s (:,:) = SUM( v_s (:,:,:), dim=3 ) 
     545!      st_i (:,:) = SUM( sv_i(:,:,:), dim=3 ) 
     546!      et_s(:,:)  = SUM( SUM( e_s (:,:,:,:), dim=4 ), dim=3 ) 
     547!      et_i(:,:)  = SUM( SUM( e_i (:,:,:,:), dim=4 ), dim=3 ) 
     548!!clem 
    542549 
    543550      ! open water = 1 if at_i=0 
     
    932939               IF ( i_fill == 1 ) THEN      !-- case very thin ice: fill only category 1 
    933940                  ph_i(ji,1) = phti(ji) 
    934                   pa_i (ji,1) = pati (ji) 
     941                  pa_i(ji,1) = pati (ji) 
    935942               ELSE                         !-- case ice is thicker: fill categories >1 
    936943                  ! thickness 
     
    975982               IF ( zconv < epsi06 )   itest(2) = 1                                        ! Test 2: volume conservation 
    976983               ! 
    977                IF ( ph_i(ji,i_fill) >= hi_max(i_fill-1) )   itest(3) = 1                  ! Test 3: thickness of the last category is in-bounds ? 
     984               IF ( ph_i(ji,i_fill) >= hi_max(i_fill-1) )   itest(3) = 1                   ! Test 3: thickness of the last category is in-bounds ? 
    978985               ! 
    979986               itest(4) = 1 
    980987               DO jl = 1, i_fill 
    981                   IF ( pa_i(ji,jl) < 0._wp ) itest(4) = 0                                ! Test 4: positivity of ice concentrations 
     988                  IF ( pa_i(ji,jl) < 0._wp ) itest(4) = 0                                  ! Test 4: positivity of ice concentrations 
    982989               END DO 
    983990               !                                         !---------------------------- 
     
    10891096      ELSEIF( icat == 1 ) THEN          ! input cat = 1          ! 
    10901097         !                              ! ---------------------- ! 
    1091          CALL  ice_var_itd_1cMc( phti(:,1), phts(:,1), pati (:,1),            ph_i(:,:), ph_s(:,:), pa_i (:,:), & 
    1092             &                    ptmi(:,1), ptms(:,1), ptmsu(:,1), psmi(:,1), pt_i(:,:), pt_s(:,:), pt_su(:,:), ps_i(:,:) ) 
     1098         CALL  ice_var_itd_1cMc( phti(:,1), phts(:,1), pati (:,1),            ph_i(:,:), ph_s(:,:), pa_i (:,:) ) 
     1099!!         CALL  ice_var_itd_1cMc( phti(:,1), phts(:,1), pati (:,1),            ph_i(:,:), ph_s(:,:), pa_i (:,:), & 
     1100!!            &                    ptmi(:,1), ptms(:,1), ptmsu(:,1), psmi(:,1), pt_i(:,:), pt_s(:,:), pt_su(:,:), ps_i(:,:) ) 
    10931101         !                              ! ---------------------- ! 
    10941102      ELSEIF( jpl == 1 ) THEN           ! output cat = 1         ! 
    10951103         !                              ! ---------------------- ! 
    1096          CALL  ice_var_itd_Nc1c( phti(:,:), phts(:,:), pati (:,:),            ph_i(:,1), ph_s(:,1), pa_i (:,1), & 
    1097             &                    ptmi(:,:), ptms(:,:), ptmsu(:,:), psmi(:,:), pt_i(:,1), pt_s(:,1), pt_su(:,1), ps_i(:,1) )          
     1104         CALL  ice_var_itd_Nc1c( phti(:,:), phts(:,:), pati (:,:),            ph_i(:,1), ph_s(:,1), pa_i (:,1) ) 
     1105!!         CALL  ice_var_itd_Nc1c( phti(:,:), phts(:,:), pati (:,:),            ph_i(:,1), ph_s(:,1), pa_i (:,1), & 
     1106!!            &                    ptmi(:,:), ptms(:,:), ptmsu(:,:), psmi(:,:), pt_i(:,1), pt_s(:,1), pt_su(:,1), ps_i(:,1) )          
    10981107         !                              ! ----------------------- ! 
    10991108      ELSE                              ! input cat /= output cat ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/ICE/icewri.F90

    r10911 r11413  
    5050      INTEGER  ::   ji, jj, jk, jl  ! dummy loop indices 
    5151      REAL(wp) ::   z2da, z2db, zrho1, zrho2 
    52       REAL(wp), DIMENSION(jpi,jpj)     ::   z2d, zfast !  2D workspace 
     52      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios  
     53      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d, zfast                     ! 2D workspace 
    5354      REAL(wp), DIMENSION(jpi,jpj)     ::   zmsk00, zmsk05, zmsk15, zmsksn ! O%, 5% and 15% concentration mask and snow mask 
    5455      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zmsk00l, zmsksnl               ! cat masks 
     
    5859      REAL(wp) ::   zdiag_area_sh, zdiag_extt_sh, zdiag_volu_sh  
    5960      !!------------------------------------------------------------------- 
    60  
     61      ! 
    6162      IF( ln_timing )   CALL timing_start('icewri') 
     63 
     64      ! get missing value from xml 
     65      CALL iom_miss_val( 'icetemp', zmiss_val ) 
    6266 
    6367      ! brine volume 
     
    8589      ! Standard outputs 
    8690      !----------------- 
    87       zrho1 = ( rau0 - rhoi ) * r1_rau0; zrho2 = rhos * r1_rau0 
     91      zrho1 = ( rau0 - rhoi ) * r1_rau0 ; zrho2 = rhos * r1_rau0 
    8892      ! masks 
    89       IF( iom_use('icemask'  ) )   CALL iom_put( "icemask"  , zmsk00              )   ! ice mask 0% 
    90       IF( iom_use('icemask05') )   CALL iom_put( "icemask05", zmsk05              )   ! ice mask 5% 
    91       IF( iom_use('icemask15') )   CALL iom_put( "icemask15", zmsk15              )   ! ice mask 15% 
     93      CALL iom_put( 'icemask'  , zmsk00 )   ! ice mask 0% 
     94      CALL iom_put( 'icemask05', zmsk05 )   ! ice mask 5% 
     95      CALL iom_put( 'icemask15', zmsk15 )   ! ice mask 15% 
     96      CALL iom_put( 'icepres'  , zmsk00 )   ! Ice presence (1 or 0)  
    9297      ! 
    9398      ! general fields 
    94       IF( iom_use('icemass'  ) )   CALL iom_put( "icemass", rhoi * vt_i * zmsk00  )   ! Ice mass per cell area  
    95       IF( iom_use('snwmass'  ) )   CALL iom_put( "snwmass", rhos * vt_s * zmsksn  )   ! Snow mass per cell area 
    96       IF( iom_use('icepres'  ) )   CALL iom_put( "icepres", zmsk00                )   ! Ice presence (1 or 0)  
    97       IF( iom_use('iceconc'  ) )   CALL iom_put( "iceconc", at_i  * zmsk00        )   ! ice concentration 
    98       IF( iom_use('icevolu'  ) )   CALL iom_put( "icevolu", vt_i  * zmsk00        )   ! ice volume = mean ice thickness over the cell 
    99       IF( iom_use('icethic'  ) )   CALL iom_put( "icethic", hm_i  * zmsk00        )   ! ice thickness 
    100       IF( iom_use('snwthic'  ) )   CALL iom_put( "snwthic", hm_s  * zmsk00        )   ! snw thickness 
    101       IF( iom_use('icebrv'   ) )   CALL iom_put( "icebrv" , bvm_i * zmsk00 * 100. )   ! brine volume 
    102       IF( iom_use('iceage'   ) )   CALL iom_put( "iceage" , om_i  * zmsk15 / rday )   ! ice age 
    103       IF( iom_use('icehnew'  ) )   CALL iom_put( "icehnew", ht_i_new              )   ! new ice thickness formed in the leads 
    104       IF( iom_use('snwvolu'  ) )   CALL iom_put( "snwvolu", vt_s  * zmsksn        )   ! snow volume 
    105       IF( iom_use('icefrb') ) THEN 
     99      IF( iom_use('icemass' ) )   CALL iom_put( 'icemass', vt_i * rhoi * zmsk00 )                                           ! Ice mass per cell area  
     100      IF( iom_use('snwmass' ) )   CALL iom_put( 'snwmass', vt_s * rhos * zmsksn )                                           ! Snow mass per cell area 
     101      IF( iom_use('iceconc' ) )   CALL iom_put( 'iceconc', at_i        * zmsk00 )                                           ! ice concentration 
     102      IF( iom_use('icevolu' ) )   CALL iom_put( 'icevolu', vt_i        * zmsk00 )                                           ! ice volume = mean ice thickness over the cell 
     103      IF( iom_use('icethic' ) )   CALL iom_put( 'icethic', hm_i        * zmsk00 )                                           ! ice thickness 
     104      IF( iom_use('snwthic' ) )   CALL iom_put( 'snwthic', hm_s        * zmsk00 )                                           ! snw thickness 
     105      IF( iom_use('icebrv'  ) )   CALL iom_put( 'icebrv' , bvm_i* 100. * zmsk00 )                                           ! brine volume 
     106      IF( iom_use('iceage'  ) )   CALL iom_put( 'iceage' , om_i / rday * zmsk15 + zmiss_val * ( 1._wp - zmsk15 ) )          ! ice age 
     107      IF( iom_use('icehnew' ) )   CALL iom_put( 'icehnew', ht_i_new             )                                           ! new ice thickness formed in the leads 
     108      IF( iom_use('snwvolu' ) )   CALL iom_put( 'snwvolu', vt_s        * zmsksn )                                           ! snow volume 
     109      IF( iom_use('icefrb'  ) ) THEN                                                                                        ! Ice freeboard 
    106110         z2d(:,:) = ( zrho1 * hm_i(:,:) - zrho2 * hm_s(:,:) )                                          
    107111         WHERE( z2d < 0._wp )   z2d = 0._wp 
    108                                    CALL iom_put( "icefrb" , z2d * zmsk00          )   ! Ice freeboard 
     112                                  CALL iom_put( 'icefrb' , z2d * zmsk00         ) 
    109113      ENDIF 
    110       ! 
    111114      ! melt ponds 
    112       IF( iom_use('iceapnd'  ) )   CALL iom_put( "iceapnd", at_ip  * zmsk00       )   ! melt pond total fraction 
    113       IF( iom_use('icevpnd'  ) )   CALL iom_put( "icevpnd", vt_ip  * zmsk00       )   ! melt pond total volume per unit area 
    114       ! 
     115      IF( iom_use('iceapnd' ) )   CALL iom_put( 'iceapnd', at_ip  * zmsk00      )                                           ! melt pond total fraction 
     116      IF( iom_use('icevpnd' ) )   CALL iom_put( 'icevpnd', vt_ip  * zmsk00      )                                           ! melt pond total volume per unit area 
    115117      ! salt 
    116       IF( iom_use('icesalt'  ) )   CALL iom_put( "icesalt", sm_i  * zmsk00        )   ! mean ice salinity 
    117       IF( iom_use('icesalm'  ) )   CALL iom_put( "icesalm", SUM( sv_i, DIM = 3 ) * rhoi * 1.0e-3 * zmsk00 )   ! Mass of salt in sea ice per cell area 
    118  
     118      IF( iom_use('icesalt' ) )   CALL iom_put( 'icesalt', sm_i                 * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) ) ! mean ice salinity 
     119      IF( iom_use('icesalm' ) )   CALL iom_put( 'icesalm', st_i * rhoi * 1.0e-3 * zmsk00 )                                  ! Mass of salt in sea ice per cell area 
    119120      ! heat 
    120       IF( iom_use('icetemp'  ) )   CALL iom_put( "icetemp", ( tm_i  - rt0 ) * zmsk00 )   ! ice mean temperature 
    121       IF( iom_use('snwtemp'  ) )   CALL iom_put( "snwtemp", ( tm_s  - rt0 ) * zmsksn )   ! snw mean temperature 
    122       IF( iom_use('icettop'  ) )   CALL iom_put( "icettop", ( tm_su - rt0 ) * zmsk00 )   ! temperature at the ice surface 
    123       IF( iom_use('icetbot'  ) )   CALL iom_put( "icetbot", ( t_bo  - rt0 ) * zmsk00 )   ! temperature at the ice bottom 
    124       IF( iom_use('icetsni'  ) )   CALL iom_put( "icetsni", ( tm_si - rt0 ) * zmsk00 )   ! temperature at the snow-ice interface 
    125       IF( iom_use('icehc'    ) )   CALL iom_put( "icehc"  ,  -et_i          * zmsk00 )   ! ice heat content 
    126       IF( iom_use('snwhc'    ) )   CALL iom_put( "snwhc"  ,  -et_s          * zmsksn )   ! snow heat content 
    127  
     121      IF( iom_use('icetemp' ) )   CALL iom_put( 'icetemp', ( tm_i  - rt0 ) * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )      ! ice mean temperature 
     122      IF( iom_use('snwtemp' ) )   CALL iom_put( 'snwtemp', ( tm_s  - rt0 ) * zmsksn + zmiss_val * ( 1._wp - zmsksn ) )      ! snw mean temperature 
     123      IF( iom_use('icettop' ) )   CALL iom_put( 'icettop', ( tm_su - rt0 ) * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )      ! temperature at the ice surface 
     124      IF( iom_use('icetbot' ) )   CALL iom_put( 'icetbot', ( t_bo  - rt0 ) * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )      ! temperature at the ice bottom 
     125      IF( iom_use('icetsni' ) )   CALL iom_put( 'icetsni', ( tm_si - rt0 ) * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )      ! temperature at the snow-ice interface 
     126      IF( iom_use('icehc'   ) )   CALL iom_put( 'icehc'  ,  -et_i          * zmsk00 )                                       ! ice heat content 
     127      IF( iom_use('snwhc'   ) )   CALL iom_put( 'snwhc'  ,  -et_s          * zmsksn )                                       ! snow heat content 
    128128      ! momentum 
    129       IF( iom_use('uice'     ) )   CALL iom_put( "uice"   , u_ice                 )   ! ice velocity u component 
    130       IF( iom_use('vice'     ) )   CALL iom_put( "vice"   , v_ice                 )   ! ice velocity v component 
    131       IF( iom_use('utau_ai'  ) )   CALL iom_put( "utau_ai", utau_ice * zmsk00     )   ! Wind stress term in force balance (x) 
    132       IF( iom_use('vtau_ai'  ) )   CALL iom_put( "vtau_ai", vtau_ice * zmsk00     )   ! Wind stress term in force balance (y) 
    133  
    134       IF( iom_use('icevel') .OR. iom_use('fasticepres') ) THEN  
    135         ! module of ice velocity 
     129      IF( iom_use('uice'    ) )   CALL iom_put( 'uice'   , u_ice    )                                                       ! ice velocity u 
     130      IF( iom_use('vice'    ) )   CALL iom_put( 'vice'   , v_ice    )                                                       ! ice velocity v 
     131      ! 
     132      IF( iom_use('icevel') .OR. iom_use('fasticepres') ) THEN                                                              ! module of ice velocity 
    136133         DO jj = 2 , jpjm1 
    137134            DO ji = 2 , jpim1 
    138                z2da  = ( u_ice(ji,jj) + u_ice(ji-1,jj) ) 
    139                z2db  = ( v_ice(ji,jj) + v_ice(ji,jj-1) ) 
     135               z2da  = u_ice(ji,jj) + u_ice(ji-1,jj) 
     136               z2db  = v_ice(ji,jj) + v_ice(ji,jj-1) 
    140137               z2d(ji,jj) = 0.5_wp * SQRT( z2da * z2da + z2db * z2db ) 
    141138           END DO 
    142139         END DO 
    143140         CALL lbc_lnk( 'icewri', z2d, 'T', 1. ) 
    144          IF( iom_use('icevel') )   CALL iom_put( "icevel" , z2d ) 
    145  
    146         ! record presence of fast ice 
    147          WHERE( z2d(:,:) < 5.e-04_wp .AND. zmsk15(:,:) == 1._wp ) ; zfast(:,:) = 1._wp 
     141         CALL iom_put( 'icevel', z2d ) 
     142 
     143         WHERE( z2d(:,:) < 5.e-04_wp .AND. zmsk15(:,:) == 1._wp ) ; zfast(:,:) = 1._wp                                      ! record presence of fast ice 
    148144         ELSEWHERE                                                ; zfast(:,:) = 0._wp 
    149145         END WHERE 
    150          IF( iom_use('fasticepres') )   CALL iom_put( "fasticepres" , zfast ) 
     146         CALL iom_put( 'fasticepres', zfast ) 
    151147      ENDIF 
    152148 
    153149      ! --- category-dependent fields --- ! 
    154       IF( iom_use('icemask_cat' ) )   CALL iom_put( "icemask_cat" , zmsk00l                                                    )   ! ice mask 0% 
    155       IF( iom_use('iceconc_cat' ) )   CALL iom_put( "iceconc_cat" , a_i * zmsk00l                                              )   ! area for categories 
    156       IF( iom_use('icethic_cat' ) )   CALL iom_put( "icethic_cat" , h_i * zmsk00l                                              )   ! thickness for categories 
    157       IF( iom_use('snwthic_cat' ) )   CALL iom_put( "snwthic_cat" , h_s * zmsksnl                                              )   ! snow depth for categories 
    158       IF( iom_use('icesalt_cat' ) )   CALL iom_put( "icesalt_cat" , s_i * zmsk00l                                              )   ! salinity for categories 
    159       IF( iom_use('iceage_cat'  ) )   CALL iom_put( "iceage_cat"  , o_i * zmsk00l / rday                                       )   ! ice age 
    160       IF( iom_use('icetemp_cat' ) )   CALL iom_put( "icetemp_cat" , ( SUM( t_i(:,:,:,:), dim=3 ) * r1_nlay_i - rt0 ) * zmsk00l )   ! ice temperature 
    161       IF( iom_use('snwtemp_cat' ) )   CALL iom_put( "snwtemp_cat" , ( SUM( t_s(:,:,:,:), dim=3 ) * r1_nlay_s - rt0 ) * zmsksnl )   ! snow temperature 
    162       IF( iom_use('icettop_cat' ) )   CALL iom_put( "icettop_cat" , ( t_su - rt0 ) * zmsk00l                                   )   ! surface temperature 
    163       IF( iom_use('icebrv_cat'  ) )   CALL iom_put( "icebrv_cat"  ,   bv_i * 100.  * zmsk00l                                   )   ! brine volume 
    164       IF( iom_use('iceapnd_cat' ) )   CALL iom_put( "iceapnd_cat" ,   a_ip         * zmsk00l                                   )   ! melt pond frac for categories 
    165       IF( iom_use('icehpnd_cat' ) )   CALL iom_put( "icehpnd_cat" ,   h_ip         * zmsk00l                                   )   ! melt pond frac for categories 
    166       IF( iom_use('iceafpnd_cat') )   CALL iom_put( "iceafpnd_cat",   a_ip_frac    * zmsk00l                                   )   ! melt pond frac for categories 
     150      IF( iom_use('icemask_cat' ) )   CALL iom_put( 'icemask_cat' ,                  zmsk00l                                   ) ! ice mask 0% 
     151      IF( iom_use('iceconc_cat' ) )   CALL iom_put( 'iceconc_cat' , a_i            * zmsk00l                                   ) ! area for categories 
     152      IF( iom_use('icethic_cat' ) )   CALL iom_put( 'icethic_cat' , h_i            * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! thickness for categories 
     153      IF( iom_use('snwthic_cat' ) )   CALL iom_put( 'snwthic_cat' , h_s            * zmsksnl + zmiss_val * ( 1._wp - zmsksnl ) ) ! snow depth for categories 
     154      IF( iom_use('icesalt_cat' ) )   CALL iom_put( 'icesalt_cat' , s_i            * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! salinity for categories 
     155      IF( iom_use('iceage_cat'  ) )   CALL iom_put( 'iceage_cat'  , o_i / rday     * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! ice age 
     156      IF( iom_use('icetemp_cat' ) )   CALL iom_put( 'icetemp_cat' , ( SUM( t_i, dim=3 ) * r1_nlay_i - rt0 ) & 
     157         &                                                                         * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! ice temperature 
     158      IF( iom_use('snwtemp_cat' ) )   CALL iom_put( 'snwtemp_cat' , ( SUM( t_s, dim=3 ) * r1_nlay_s - rt0 ) & 
     159         &                                                                         * zmsksnl + zmiss_val * ( 1._wp - zmsksnl ) ) ! snow temperature 
     160      IF( iom_use('icettop_cat' ) )   CALL iom_put( 'icettop_cat' , ( t_su - rt0 ) * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! surface temperature 
     161      IF( iom_use('icebrv_cat'  ) )   CALL iom_put( 'icebrv_cat'  ,   bv_i * 100.  * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! brine volume 
     162      IF( iom_use('iceapnd_cat' ) )   CALL iom_put( 'iceapnd_cat' ,   a_ip         * zmsk00l                                   ) ! melt pond frac for categories 
     163      IF( iom_use('icehpnd_cat' ) )   CALL iom_put( 'icehpnd_cat' ,   h_ip         * zmsk00l + zmiss_val * ( 1._wp - zmsk00l ) ) ! melt pond frac for categories 
     164      IF( iom_use('iceafpnd_cat') )   CALL iom_put( 'iceafpnd_cat',   a_ip_frac    * zmsk00l                                   ) ! melt pond frac for categories 
    167165 
    168166      !------------------ 
     
    170168      !------------------ 
    171169      ! trends 
    172       IF( iom_use('dmithd') )   CALL iom_put( "dmithd", - wfx_bog - wfx_bom - wfx_sum - wfx_sni - wfx_opw - wfx_lam - wfx_res ) ! Sea-ice mass change from thermodynamics 
    173       IF( iom_use('dmidyn') )   CALL iom_put( "dmidyn", - wfx_dyn + rhoi * diag_trp_vi      )  ! Sea-ice mass change from dynamics(kg/m2/s) 
    174       IF( iom_use('dmiopw') )   CALL iom_put( "dmiopw", - wfx_opw                           )  ! Sea-ice mass change through growth in open water 
    175       IF( iom_use('dmibog') )   CALL iom_put( "dmibog", - wfx_bog                           )  ! Sea-ice mass change through basal growth 
    176       IF( iom_use('dmisni') )   CALL iom_put( "dmisni", - wfx_sni                           )  ! Sea-ice mass change through snow-to-ice conversion 
    177       IF( iom_use('dmisum') )   CALL iom_put( "dmisum", - wfx_sum                           )  ! Sea-ice mass change through surface melting 
    178       IF( iom_use('dmibom') )   CALL iom_put( "dmibom", - wfx_bom                           )  ! Sea-ice mass change through bottom melting 
    179       IF( iom_use('dmtsub') )   CALL iom_put( "dmtsub", - wfx_sub                           )  ! Sea-ice mass change through evaporation and sublimation 
    180       IF( iom_use('dmssub') )   CALL iom_put( "dmssub", - wfx_snw_sub                       )  ! Snow mass change through sublimation 
    181       IF( iom_use('dmisub') )   CALL iom_put( "dmisub", - wfx_ice_sub                       )  ! Sea-ice mass change through sublimation 
    182       IF( iom_use('dmsspr') )   CALL iom_put( "dmsspr", - wfx_spr                           )  ! Snow mass change through snow fall 
    183       IF( iom_use('dmsssi') )   CALL iom_put( "dmsssi",   wfx_sni*rhos*r1_rhoi              )  ! Snow mass change through snow-to-ice conversion 
    184       IF( iom_use('dmsmel') )   CALL iom_put( "dmsmel", - wfx_snw_sum                       )  ! Snow mass change through melt 
    185       IF( iom_use('dmsdyn') )   CALL iom_put( "dmsdyn", - wfx_snw_dyn + rhos * diag_trp_vs  )  ! Snow mass change through dynamics(kg/m2/s) 
    186  
     170      IF( iom_use('dmithd') )   CALL iom_put( 'dmithd', - wfx_bog - wfx_bom - wfx_sum - wfx_sni - wfx_opw - wfx_lam - wfx_res ) ! Sea-ice mass change from thermodynamics 
     171      IF( iom_use('dmidyn') )   CALL iom_put( 'dmidyn', - wfx_dyn + rhoi * diag_trp_vi                                        ) ! Sea-ice mass change from dynamics(kg/m2/s) 
     172      IF( iom_use('dmiopw') )   CALL iom_put( 'dmiopw', - wfx_opw                                                             ) ! Sea-ice mass change through growth in open water 
     173      IF( iom_use('dmibog') )   CALL iom_put( 'dmibog', - wfx_bog                                                             ) ! Sea-ice mass change through basal growth 
     174      IF( iom_use('dmisni') )   CALL iom_put( 'dmisni', - wfx_sni                                                             ) ! Sea-ice mass change through snow-to-ice conversion 
     175      IF( iom_use('dmisum') )   CALL iom_put( 'dmisum', - wfx_sum                                                             ) ! Sea-ice mass change through surface melting 
     176      IF( iom_use('dmibom') )   CALL iom_put( 'dmibom', - wfx_bom                                                             ) ! Sea-ice mass change through bottom melting 
     177      IF( iom_use('dmtsub') )   CALL iom_put( 'dmtsub', - wfx_sub                                                             ) ! Sea-ice mass change through evaporation and sublimation 
     178      IF( iom_use('dmssub') )   CALL iom_put( 'dmssub', - wfx_snw_sub                                                         ) ! Snow mass change through sublimation 
     179      IF( iom_use('dmisub') )   CALL iom_put( 'dmisub', - wfx_ice_sub                                                         ) ! Sea-ice mass change through sublimation 
     180      IF( iom_use('dmsspr') )   CALL iom_put( 'dmsspr', - wfx_spr                                                             ) ! Snow mass change through snow fall 
     181      IF( iom_use('dmsssi') )   CALL iom_put( 'dmsssi',   wfx_sni*rhos*r1_rhoi                                                ) ! Snow mass change through snow-to-ice conversion 
     182      IF( iom_use('dmsmel') )   CALL iom_put( 'dmsmel', - wfx_snw_sum                                                         ) ! Snow mass change through melt 
     183      IF( iom_use('dmsdyn') )   CALL iom_put( 'dmsdyn', - wfx_snw_dyn + rhos * diag_trp_vs                                    ) ! Snow mass change through dynamics(kg/m2/s) 
     184       
    187185      ! Global ice diagnostics 
    188       IF( iom_use('NH_icearea') .OR. iom_use('NH_icevolu') .OR. iom_use('NH_iceextt') )   THEN   ! NH diagnostics 
    189          ! 
    190          WHERE( ff_t > 0._wp )   ;   zmsk00(:,:) = 1.0e-12 
    191          ELSEWHERE               ;   zmsk00(:,:) = 0. 
    192          END WHERE  
    193          zdiag_area_nh = glob_sum( 'icewri', at_i(:,:) * zmsk00(:,:) * e1e2t(:,:) ) 
    194          zdiag_volu_nh = glob_sum( 'icewri', vt_i(:,:) * zmsk00(:,:) * e1e2t(:,:) ) 
    195          ! 
    196          WHERE( ff_t > 0._wp .AND. at_i > 0.15 )   ; zmsk00(:,:) = 1.0e-12 
    197          ELSEWHERE                                 ; zmsk00(:,:) = 0. 
    198          END WHERE  
    199          zdiag_extt_nh = glob_sum( 'icewri', zmsk00(:,:) * e1e2t(:,:) ) 
    200          ! 
    201          IF( iom_use('NH_icearea') )   CALL iom_put( "NH_icearea" ,  zdiag_area_nh ) 
    202          IF( iom_use('NH_icevolu') )   CALL iom_put( "NH_icevolu" ,  zdiag_volu_nh ) 
    203          IF( iom_use('NH_iceextt') )   CALL iom_put( "NH_iceextt" ,  zdiag_extt_nh ) 
     186      IF(  iom_use('NH_icearea') .OR. iom_use('NH_icevolu') .OR. iom_use('NH_iceextt') .OR. & 
     187         & iom_use('SH_icearea') .OR. iom_use('SH_icevolu') .OR. iom_use('SH_iceextt') ) THEN 
     188         ! 
     189         WHERE( ff_t(:,:) > 0._wp )   ;   z2d(:,:) = 1._wp 
     190         ELSEWHERE                    ;   z2d(:,:) = 0. 
     191         END WHERE 
     192         ! 
     193         IF( iom_use('NH_icearea') )   zdiag_area_nh = glob_sum( 'icewri', at_i *           z2d   * e1e2t * 1.e-12 ) 
     194         IF( iom_use('NH_icevolu') )   zdiag_volu_nh = glob_sum( 'icewri', vt_i *           z2d   * e1e2t * 1.e-12 ) 
     195         IF( iom_use('NH_iceextt') )   zdiag_extt_nh = glob_sum( 'icewri',                  z2d   * e1e2t * 1.e-12 * zmsk15 ) 
     196         ! 
     197         IF( iom_use('SH_icearea') )   zdiag_area_sh = glob_sum( 'icewri', at_i * ( 1._wp - z2d ) * e1e2t * 1.e-12 ) 
     198         IF( iom_use('SH_icevolu') )   zdiag_volu_sh = glob_sum( 'icewri', vt_i * ( 1._wp - z2d ) * e1e2t * 1.e-12 ) 
     199         IF( iom_use('SH_iceextt') )   zdiag_extt_sh = glob_sum( 'icewri',        ( 1._wp - z2d ) * e1e2t * 1.e-12 * zmsk15 ) 
     200         ! 
     201         CALL iom_put( 'NH_icearea' , zdiag_area_nh ) 
     202         CALL iom_put( 'NH_icevolu' , zdiag_volu_nh ) 
     203         CALL iom_put( 'NH_iceextt' , zdiag_extt_nh ) 
     204         CALL iom_put( 'SH_icearea' , zdiag_area_sh ) 
     205         CALL iom_put( 'SH_icevolu' , zdiag_volu_sh ) 
     206         CALL iom_put( 'SH_iceextt' , zdiag_extt_sh ) 
    204207         ! 
    205208      ENDIF 
    206       ! 
    207       IF( iom_use('SH_icearea') .OR. iom_use('SH_icevolu') .OR. iom_use('SH_iceextt') )   THEN   ! SH diagnostics 
    208          ! 
    209          WHERE( ff_t < 0._wp ); zmsk00(:,:) = 1.0e-12;  
    210          ELSEWHERE            ; zmsk00(:,:) = 0. 
    211          END WHERE  
    212          zdiag_area_sh = glob_sum( 'icewri', at_i(:,:) * zmsk00(:,:) * e1e2t(:,:) )  
    213          zdiag_volu_sh = glob_sum( 'icewri', vt_i(:,:) * zmsk00(:,:) * e1e2t(:,:) ) 
    214          ! 
    215          WHERE( ff_t < 0._wp .AND. at_i > 0.15 ); zmsk00(:,:) = 1.0e-12 
    216          ELSEWHERE                              ; zmsk00(:,:) = 0. 
    217          END WHERE  
    218          zdiag_extt_sh = glob_sum( 'icewri', zmsk00(:,:) * e1e2t(:,:) ) 
    219          ! 
    220          IF( iom_use('SH_icearea') ) CALL iom_put( "SH_icearea", zdiag_area_sh ) 
    221          IF( iom_use('SH_icevolu') ) CALL iom_put( "SH_icevolu", zdiag_volu_sh ) 
    222          IF( iom_use('SH_iceextt') ) CALL iom_put( "SH_iceextt", zdiag_extt_sh ) 
    223          ! 
    224       ENDIF  
    225209      ! 
    226210!!CR      !     !  Create an output files (output.lim.abort.nc) if S < 0 or u > 20 m/s 
    227211!!CR      !     IF( kindic < 0 )   CALL ice_wri_state( 'output.abort' ) 
    228212!!CR      !     not yet implemented 
    229 !!gm  idem for the ocean...  Ask Seb how to get read of ioipsl.... 
     213!!gm  idem for the ocean...  Ask Seb how to get rid of ioipsl.... 
    230214      ! 
    231215      IF( ln_timing )  CALL timing_stop('icewri') 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/BDY/bdydta.F90

    r11348 r11413  
    415415               bf_alias => bf(jp_bdyssh,jbdy:jbdy)                         ! alias for ssh structure of bdy number jbdy 
    416416               bn_alias => bn_ssh                                          ! alias for ssh structure of nambdy_dta  
    417                iszdim = idx_bdy(jbdy)%nblenrim(igrd)                       ! length of this bdy on this MPI processus : only rim 
     417               iszdim = idx_bdy(jbdy)%nblenrim(igrd)                       ! length of this bdy on this MPI processus : used only on the rim 
    418418            ENDIF 
    419419            ! ===================== 
     
    427427               llread = .NOT. ln_full_vel .AND. MOD(nn_dyn2d_dta(jbdy),2) == 1   ! don't get u2d from u3d and read NetCDF file 
    428428               bf_alias => bf(jp_bdyu2d,jbdy:jbdy)                         ! alias for u2d structure of bdy number jbdy 
    429                bn_alias => bn_u2d                                          ! alias for u2d structure of nambdy_dta  
    430                iszdim = idx_bdy(jbdy)%nblenrim(igrd)                       ! length of this bdy on this MPI processus : only rim 
     429               bn_alias => bn_u2d                                          ! alias for u2d structure of nambdy_dta 
     430               IF( ln_full_vel ) THEN  ;   iszdim = idx_bdy(jbdy)%nblen(igrd)      ! will be computed from u3d -> need on the full bdy 
     431               ELSE                    ;   iszdim = idx_bdy(jbdy)%nblenrim(igrd)   ! used only on the rim 
     432               ENDIF 
    431433            ENDIF 
    432434            IF( jfld == jp_bdyv2d ) THEN 
     
    438440               bf_alias => bf(jp_bdyv2d,jbdy:jbdy)                         ! alias for v2d structure of bdy number jbdy 
    439441               bn_alias => bn_v2d                                          ! alias for v2d structure of nambdy_dta  
    440                iszdim = idx_bdy(jbdy)%nblenrim(igrd)                       ! length of this bdy on this MPI processus : only rim 
     442               IF( ln_full_vel ) THEN  ;   iszdim = idx_bdy(jbdy)%nblen(igrd)      ! will be computed from v3d -> need on the full bdy 
     443               ELSE                    ;   iszdim = idx_bdy(jbdy)%nblenrim(igrd)   ! used only on the rim 
     444               ENDIF 
    441445            ENDIF 
    442446            ! ===================== 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/BDY/bdyini.F90

    r11348 r11413  
    386386 
    387387            CALL bdy_read_seg( ib_bdy, nblendta(:,ib_bdy) ) 
    388             ! Now look for crossings in user (namelist) defined open boundary segments: 
    389             IF( nbdysege > 0 .OR. nbdysegw > 0 .OR. nbdysegn > 0 .OR. nbdysegs > 0)   CALL bdy_ctl_seg 
    390388 
    391389         ELSE                                        ! Read size of arrays in boundary coordinates file. 
     
    400398         ! 
    401399      END DO ! ib_bdy 
     400 
     401      ! Now look for crossings in user (namelist) defined open boundary segments: 
     402      IF( nbdysege > 0 .OR. nbdysegw > 0 .OR. nbdysegn > 0 .OR. nbdysegs > 0)   CALL bdy_ctl_seg 
    402403       
    403404      ! Allocate arrays 
     
    11881189            &(jpjnob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' ) 
    11891190         IF (jpindt(ib).ge.jpinft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' ) 
    1190          IF (jpindt(ib).le.1     )     CALL ctl_stop( 'Start index out of domain' ) 
    1191          IF (jpinft(ib).ge.jpiglo)     CALL ctl_stop( 'End index out of domain' ) 
     1191         IF (jpindt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' ) 
     1192         IF (jpinft(ib).gt.jpiglo)     CALL ctl_stop( 'End index out of domain' ) 
    11921193      END DO 
    11931194      ! 
     
    11971198            &(jpjsob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' ) 
    11981199         IF (jpisdt(ib).ge.jpisft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' ) 
    1199          IF (jpisdt(ib).le.1     )     CALL ctl_stop( 'Start index out of domain' ) 
    1200          IF (jpisft(ib).ge.jpiglo)     CALL ctl_stop( 'End index out of domain' ) 
     1200         IF (jpisdt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' ) 
     1201         IF (jpisft(ib).gt.jpiglo)     CALL ctl_stop( 'End index out of domain' ) 
    12011202      END DO 
    12021203      ! 
     
    12061207            &(jpieob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' ) 
    12071208         IF (jpjedt(ib).ge.jpjeft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' ) 
    1208          IF (jpjedt(ib).le.1     )     CALL ctl_stop( 'Start index out of domain' ) 
    1209          IF (jpjeft(ib).ge.jpjglo)     CALL ctl_stop( 'End index out of domain' ) 
     1209         IF (jpjedt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' ) 
     1210         IF (jpjeft(ib).gt.jpjglo)     CALL ctl_stop( 'End index out of domain' ) 
    12101211      END DO 
    12111212      ! 
     
    12151216            &(jpiwob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' ) 
    12161217         IF (jpjwdt(ib).ge.jpjwft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' ) 
    1217          IF (jpjwdt(ib).le.1     )     CALL ctl_stop( 'Start index out of domain' ) 
    1218          IF (jpjwft(ib).ge.jpjglo)     CALL ctl_stop( 'End index out of domain' ) 
     1218         IF (jpjwdt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' ) 
     1219         IF (jpjwft(ib).gt.jpjglo)     CALL ctl_stop( 'End index out of domain' ) 
    12191220      ENDDO 
    12201221      ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/BDY/bdyvol.F90

    r11234 r11413  
    143143      ! Check the cumulated transport through unstructured OBC once barotropic velocities corrected 
    144144      ! ------------------------------------------------------ 
    145       IF( MOD( kt, nwrite ) == 0 .AND. ( kc == 1 ) ) THEN 
     145      IF( MOD( kt, nn_write ) == 0 .AND. ( kc == 1 ) ) THEN 
    146146         ! 
    147147         ! compute residual transport across boundary 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/DIA/diadct.F90

    r11348 r11413  
    1111   !!            3.4  ! 09/2011 (C Bricaud) 
    1212   !!---------------------------------------------------------------------- 
    13 #if defined key_diadct 
    14    !!---------------------------------------------------------------------- 
    15    !!   'key_diadct' : 
    16    !!---------------------------------------------------------------------- 
     13   !! does not work with agrif 
     14#if ! defined key_agrif 
    1715   !!---------------------------------------------------------------------- 
    1816   !!   dia_dct      :  Compute the transport through a sec. 
     
    4240 
    4341   PUBLIC   dia_dct      ! routine called by step.F90 
    44    PUBLIC   dia_dct_init ! routine called by opa.F90 
    45    PUBLIC   diadct_alloc ! routine called by nemo_init in nemogcm.F90  
    46    PRIVATE  readsec 
    47    PRIVATE  removepoints 
    48    PRIVATE  transport 
    49    PRIVATE  dia_dct_wri 
    50  
    51    LOGICAL, PUBLIC, PARAMETER ::   lk_diadct = .TRUE.   !: model-data diagnostics flag 
    52  
    53    INTEGER :: nn_dct        ! Frequency of computation 
    54    INTEGER :: nn_dctwri     ! Frequency of output 
    55    INTEGER :: nn_secdebug   ! Number of the section to debug 
     42   PUBLIC   dia_dct_init ! routine called by nemogcm.F90 
     43 
     44   !                         !!** namelist variables ** 
     45   LOGICAL, PUBLIC ::   ln_diadct     !: Calculate transport thru a section or not 
     46   INTEGER         ::   nn_dct        !  Frequency of computation 
     47   INTEGER         ::   nn_dctwri     !  Frequency of output 
     48   INTEGER         ::   nn_secdebug   !  Number of the section to debug 
    5649    
    5750   INTEGER, PARAMETER :: nb_class_max  = 10 
     
    10497CONTAINS 
    10598  
    106   INTEGER FUNCTION diadct_alloc()  
    107      !!----------------------------------------------------------------------  
    108      !!                   ***  FUNCTION diadct_alloc  ***  
    109      !!----------------------------------------------------------------------  
    110      INTEGER :: ierr(2)  
    111      !!----------------------------------------------------------------------  
    112  
    113      ALLOCATE(transports_3d(nb_3d_vars,nb_sec_max,nb_point_max,jpk), STAT=ierr(1) )  
    114      ALLOCATE(transports_2d(nb_2d_vars,nb_sec_max,nb_point_max)    , STAT=ierr(2) )  
    115  
    116      diadct_alloc = MAXVAL( ierr )  
    117      IF( diadct_alloc /= 0 )   CALL ctl_stop( 'STOP', 'diadct_alloc: failed to allocate arrays' )  
    118   
    119   END FUNCTION diadct_alloc  
    120  
     99   INTEGER FUNCTION diadct_alloc()  
     100      !!----------------------------------------------------------------------  
     101      !!                   ***  FUNCTION diadct_alloc  ***  
     102      !!----------------------------------------------------------------------  
     103 
     104      ALLOCATE( transports_3d(nb_3d_vars,nb_sec_max,nb_point_max,jpk), & 
     105         &      transports_2d(nb_2d_vars,nb_sec_max,nb_point_max)    , STAT=diadct_alloc )  
     106 
     107      CALL mpp_sum( 'diadct', diadct_alloc )  
     108      IF( diadct_alloc /= 0 )   CALL ctl_stop( 'STOP', 'diadct_alloc: failed to allocate arrays' )  
     109 
     110   END FUNCTION diadct_alloc 
    121111 
    122112   SUBROUTINE dia_dct_init 
     
    130120      INTEGER  ::   ios                 ! Local integer output status for namelist read 
    131121      !! 
    132       NAMELIST/namdct/nn_dct,nn_dctwri,nn_secdebug 
     122      NAMELIST/nam_diadct/ln_diadct, nn_dct, nn_dctwri, nn_secdebug 
    133123      !!--------------------------------------------------------------------- 
    134124 
    135      REWIND( numnam_ref )              ! Namelist namdct in reference namelist : Diagnostic: transport through sections 
    136      READ  ( numnam_ref, namdct, IOSTAT = ios, ERR = 901) 
    137 901  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdct in reference namelist' ) 
    138  
    139      REWIND( numnam_cfg )              ! Namelist namdct in configuration namelist : Diagnostic: transport through sections 
    140      READ  ( numnam_cfg, namdct, IOSTAT = ios, ERR = 902 ) 
    141 902  IF( ios >  0 ) CALL ctl_nam ( ios , 'namdct in configuration namelist' ) 
    142      IF(lwm) WRITE ( numond, namdct ) 
     125     REWIND( numnam_ref )              ! Namelist nam_diadct in reference namelist : Diagnostic: transport through sections 
     126     READ  ( numnam_ref, nam_diadct, IOSTAT = ios, ERR = 901) 
     127901  IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diadct in reference namelist' ) 
     128 
     129     REWIND( numnam_cfg )              ! Namelist nam_diadct in configuration namelist : Diagnostic: transport through sections 
     130     READ  ( numnam_cfg, nam_diadct, IOSTAT = ios, ERR = 902 ) 
     131902  IF( ios >  0 ) CALL ctl_nam ( ios , 'nam_diadct in configuration namelist' ) 
     132     IF(lwm) WRITE ( numond, nam_diadct ) 
    143133 
    144134     IF( lwp ) THEN 
     
    146136        WRITE(numout,*) "diadct_init: compute transports through sections " 
    147137        WRITE(numout,*) "~~~~~~~~~~~~~~~~~~~~~" 
    148         WRITE(numout,*) "       Frequency of computation: nn_dct    = ",nn_dct 
    149         WRITE(numout,*) "       Frequency of write:       nn_dctwri = ",nn_dctwri 
     138        WRITE(numout,*) "       Calculate transport thru sections: ln_diadct = ", ln_diadct 
     139        WRITE(numout,*) "       Frequency of computation:          nn_dct    = ", nn_dct 
     140        WRITE(numout,*) "       Frequency of write:                nn_dctwri = ", nn_dctwri 
    150141 
    151142        IF      ( nn_secdebug .GE. 1 .AND. nn_secdebug .LE. nb_sec_max )THEN 
     
    155146        ELSE                              ; WRITE(numout,*)"       Wrong value for nn_secdebug : ",nn_secdebug 
    156147        ENDIF 
    157  
     148     ENDIF 
     149 
     150     IF( ln_diadct ) THEN 
     151        ! control 
    158152        IF(nn_dct .GE. nn_dctwri .AND. MOD(nn_dct,nn_dctwri) .NE. 0)  & 
    159           &  CALL ctl_stop( 'diadct: nn_dct should be smaller and a multiple of nn_dctwri' ) 
    160  
     153           &  CALL ctl_stop( 'diadct: nn_dct should be smaller and a multiple of nn_dctwri' ) 
     154 
     155        ! allocate dia_dct arrays 
     156        IF( diadct_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'diadct_alloc: failed to allocate arrays' ) 
     157 
     158        !Read section_ijglobal.diadct 
     159        CALL readsec 
     160 
     161        !open output file 
     162        IF( lwm ) THEN 
     163           CALL ctl_opn( numdct_vol,  'volume_transport', 'NEW', 'FORMATTED', 'SEQUENTIAL', -1, numout,  .FALSE. ) 
     164           CALL ctl_opn( numdct_heat, 'heat_transport'  , 'NEW', 'FORMATTED', 'SEQUENTIAL', -1, numout,  .FALSE. ) 
     165           CALL ctl_opn( numdct_salt, 'salt_transport'  , 'NEW', 'FORMATTED', 'SEQUENTIAL', -1, numout,  .FALSE. ) 
     166        ENDIF 
     167 
     168        ! Initialise arrays to zero  
     169        transports_3d(:,:,:,:)=0.0  
     170        transports_2d(:,:,:)  =0.0  
     171        ! 
    161172     ENDIF 
    162  
    163      !Read section_ijglobal.diadct 
    164      CALL readsec 
    165  
    166      !open output file 
    167      IF( lwm ) THEN 
    168         CALL ctl_opn( numdct_vol,  'volume_transport', 'NEW', 'FORMATTED', 'SEQUENTIAL', -1, numout,  .FALSE. ) 
    169         CALL ctl_opn( numdct_heat, 'heat_transport'  , 'NEW', 'FORMATTED', 'SEQUENTIAL', -1, numout,  .FALSE. ) 
    170         CALL ctl_opn( numdct_salt, 'salt_transport'  , 'NEW', 'FORMATTED', 'SEQUENTIAL', -1, numout,  .FALSE. ) 
    171      ENDIF 
    172  
    173      ! Initialise arrays to zero  
    174      transports_3d(:,:,:,:)=0.0  
    175      transports_2d(:,:,:)  =0.0  
    176173     ! 
    177174  END SUBROUTINE dia_dct_init 
     
    12411238#else 
    12421239   !!---------------------------------------------------------------------- 
    1243    !!   Default option :                                       Dummy module 
     1240   !!   Dummy module                                              
    12441241   !!---------------------------------------------------------------------- 
    1245    LOGICAL, PUBLIC, PARAMETER ::   lk_diadct = .FALSE.    !: diamht flag 
    1246    PUBLIC  
    1247    !! $Id$ 
     1242   LOGICAL, PUBLIC ::   ln_diadct = .FALSE. 
    12481243CONTAINS 
    1249  
    1250    SUBROUTINE dia_dct_init          ! Dummy routine 
     1244   SUBROUTINE dia_dct_init 
    12511245      IMPLICIT NONE 
    1252       WRITE(*,*) 'dia_dct_init: You should not have seen this print! error?' 
    12531246   END SUBROUTINE dia_dct_init 
    1254  
    1255    SUBROUTINE dia_dct( kt )         ! Dummy routine 
     1247   SUBROUTINE dia_dct( kt ) 
    12561248      IMPLICIT NONE 
    1257       INTEGER, INTENT( in ) :: kt   ! ocean time-step index 
    1258       WRITE(*,*) 'dia_dct: You should not have seen this print! error?', kt 
     1249      INTEGER, INTENT(in) ::   kt 
    12591250   END SUBROUTINE dia_dct 
     1251   ! 
    12601252#endif 
    12611253 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/DIA/diaharm.F90

    r11348 r11413  
    55   !!====================================================================== 
    66   !! History :  3.1  !  2007  (O. Le Galloudec, J. Chanut)  Original code 
    7    !!---------------------------------------------------------------------- 
    8 #if defined key_diaharm 
    9    !!---------------------------------------------------------------------- 
    10    !!   'key_diaharm' 
    117   !!---------------------------------------------------------------------- 
    128   USE oce             ! ocean dynamics and tracers variables 
     
    2622   IMPLICIT NONE 
    2723   PRIVATE 
    28  
    29    LOGICAL, PUBLIC, PARAMETER :: lk_diaharm  = .TRUE. 
    3024    
    3125   INTEGER, PARAMETER :: jpincomax    = 2.*jpmax_harmo 
     
    3327 
    3428   !                         !!** namelist variables ** 
    35    INTEGER ::   nit000_han    ! First time step used for harmonic analysis 
    36    INTEGER ::   nitend_han    ! Last time step used for harmonic analysis 
    37    INTEGER ::   nstep_han     ! Time step frequency for harmonic analysis 
    38    INTEGER ::   nb_ana        ! Number of harmonics to analyse 
     29   LOGICAL, PUBLIC ::   ln_diaharm    ! Choose tidal harmonic output or not 
     30   INTEGER         ::   nit000_han    ! First time step used for harmonic analysis 
     31   INTEGER         ::   nitend_han    ! Last time step used for harmonic analysis 
     32   INTEGER         ::   nstep_han     ! Time step frequency for harmonic analysis 
     33   INTEGER         ::   nb_ana        ! Number of harmonics to analyse 
    3934 
    4035   INTEGER , ALLOCATABLE, DIMENSION(:)       ::   name 
     
    5348   CHARACTER (LEN=4), DIMENSION(jpmax_harmo) ::   tname   ! Names of tidal constituents ('M2', 'K1',...) 
    5449 
    55    PUBLIC   dia_harm   ! routine called by step.F90 
     50   PUBLIC   dia_harm        ! routine called by step.F90 
     51   PUBLIC   dia_harm_init   ! routine called by nemogcm.F90 
    5652 
    5753   !!---------------------------------------------------------------------- 
     
    7167      !! 
    7268      !!-------------------------------------------------------------------- 
    73       INTEGER :: jh, nhan, jk, ji 
     69      INTEGER ::   jh, nhan, ji 
    7470      INTEGER ::   ios                 ! Local integer output status for namelist read 
    7571 
    76       NAMELIST/nam_diaharm/ nit000_han, nitend_han, nstep_han, tname 
     72      NAMELIST/nam_diaharm/ ln_diaharm, nit000_han, nitend_han, nstep_han, tname 
    7773      !!---------------------------------------------------------------------- 
    7874 
     
    8278         WRITE(numout,*) '~~~~~~~ ' 
    8379      ENDIF 
    84       ! 
    85       IF( .NOT. ln_tide )   CALL ctl_stop( 'dia_harm_init : ln_tide must be true for harmonic analysis') 
    86       ! 
    87       CALL tide_init_Wave 
    8880      ! 
    8981      REWIND( numnam_ref )              ! Namelist nam_diaharm in reference namelist : Tidal harmonic analysis 
     
    9688      ! 
    9789      IF(lwp) THEN 
    98          WRITE(numout,*) 'First time step used for analysis:  nit000_han= ', nit000_han 
    99          WRITE(numout,*) 'Last  time step used for analysis:  nitend_han= ', nitend_han 
    100          WRITE(numout,*) 'Time step frequency for harmonic analysis:  nstep_han= ', nstep_han 
     90         WRITE(numout,*) 'Tidal diagnostics = ', ln_diaharm 
     91         WRITE(numout,*) '   First time step used for analysis:         nit000_han= ', nit000_han 
     92         WRITE(numout,*) '   Last  time step used for analysis:         nitend_han= ', nitend_han 
     93         WRITE(numout,*) '   Time step frequency for harmonic analysis: nstep_han = ', nstep_han 
    10194      ENDIF 
    10295 
    103       ! Basic checks on harmonic analysis time window: 
    104       ! ---------------------------------------------- 
    105       IF( nit000 > nit000_han )   CALL ctl_stop( 'dia_harm_init : nit000_han must be greater than nit000',   & 
    106          &                                       ' restart capability not implemented' ) 
    107       IF( nitend < nitend_han )   CALL ctl_stop( 'dia_harm_init : nitend_han must be lower than nitend',   & 
    108          &                                       'restart capability not implemented' ) 
    109  
    110       IF( MOD( nitend_han-nit000_han+1 , nstep_han ) /= 0 )   & 
    111          &                        CALL ctl_stop( 'dia_harm_init : analysis time span must be a multiple of nstep_han' ) 
    112  
    113       nb_ana = 0 
    114       DO jk=1,jpmax_harmo 
    115          DO ji=1,jpmax_harmo 
    116             IF(TRIM(tname(jk)) == Wave(ji)%cname_tide) THEN 
    117                nb_ana=nb_ana+1 
    118             ENDIF 
    119          END DO 
    120       END DO 
    121       ! 
    122       IF(lwp) THEN 
    123          WRITE(numout,*) '        Namelist nam_diaharm' 
    124          WRITE(numout,*) '        nb_ana    = ', nb_ana 
    125          CALL flush(numout) 
     96      IF( ln_diaharm .AND. .NOT.ln_tide )   CALL ctl_stop( 'dia_harm_init : ln_tide must be true for harmonic analysis') 
     97 
     98      IF( ln_diaharm ) THEN 
     99 
     100         CALL tide_init_Wave 
     101         ! 
     102         ! Basic checks on harmonic analysis time window: 
     103         ! ---------------------------------------------- 
     104         IF( nit000 > nit000_han )   CALL ctl_stop( 'dia_harm_init : nit000_han must be greater than nit000',   & 
     105            &                                       ' restart capability not implemented' ) 
     106         IF( nitend < nitend_han )   CALL ctl_stop( 'dia_harm_init : nitend_han must be lower than nitend',   & 
     107            &                                       'restart capability not implemented' ) 
     108 
     109         IF( MOD( nitend_han-nit000_han+1 , nstep_han ) /= 0 )   & 
     110            &                        CALL ctl_stop( 'dia_harm_init : analysis time span must be a multiple of nstep_han' ) 
     111         ! 
     112         nb_ana = 0 
     113         DO jh=1,jpmax_harmo 
     114            DO ji=1,jpmax_harmo 
     115               IF(TRIM(tname(jh)) == Wave(ji)%cname_tide) THEN 
     116                  nb_ana=nb_ana+1 
     117               ENDIF 
     118            END DO 
     119         END DO 
     120         ! 
     121         IF(lwp) THEN 
     122            WRITE(numout,*) '        Namelist nam_diaharm' 
     123            WRITE(numout,*) '        nb_ana    = ', nb_ana 
     124            CALL flush(numout) 
     125         ENDIF 
     126         ! 
     127         IF (nb_ana > jpmax_harmo) THEN 
     128            WRITE(ctmp1,*) ' nb_ana must be lower than jpmax_harmo' 
     129            WRITE(ctmp2,*) ' jpmax_harmo= ', jpmax_harmo 
     130            CALL ctl_stop( 'dia_harm_init', ctmp1, ctmp2 ) 
     131         ENDIF 
     132 
     133         ALLOCATE(name    (nb_ana)) 
     134         DO jh=1,nb_ana 
     135            DO ji=1,jpmax_harmo 
     136               IF (TRIM(tname(jh)) ==  Wave(ji)%cname_tide) THEN 
     137                  name(jh) = ji 
     138                  EXIT 
     139               END IF 
     140            END DO 
     141         END DO 
     142 
     143         ! Initialize frequency array: 
     144         ! --------------------------- 
     145         ALLOCATE( ana_freq(nb_ana), ut(nb_ana), vt(nb_ana), ft(nb_ana) ) 
     146 
     147         CALL tide_harmo( ana_freq, vt, ut, ft, name, nb_ana ) 
     148 
     149         IF(lwp) WRITE(numout,*) 'Analysed frequency  : ',nb_ana ,'Frequency ' 
     150 
     151         DO jh = 1, nb_ana 
     152            IF(lwp) WRITE(numout,*) '                    : ',tname(jh),' ',ana_freq(jh) 
     153         END DO 
     154 
     155         ! Initialize temporary arrays: 
     156         ! ---------------------------- 
     157         ALLOCATE( ana_temp(jpi,jpj,2*nb_ana,3) ) 
     158         ana_temp(:,:,:,:) = 0._wp 
     159 
    126160      ENDIF 
    127       ! 
    128       IF (nb_ana > jpmax_harmo) THEN 
    129          WRITE(ctmp1,*) ' nb_ana must be lower than jpmax_harmo' 
    130          WRITE(ctmp2,*) ' jpmax_harmo= ', jpmax_harmo 
    131          CALL ctl_stop( 'dia_harm_init', ctmp1, ctmp2 ) 
    132       ENDIF 
    133  
    134       ALLOCATE(name    (nb_ana)) 
    135       DO jk=1,nb_ana 
    136        DO ji=1,jpmax_harmo 
    137           IF (TRIM(tname(jk)) ==  Wave(ji)%cname_tide) THEN 
    138              name(jk) = ji 
    139              EXIT 
    140           END IF 
    141        END DO 
    142       END DO 
    143  
    144       ! Initialize frequency array: 
    145       ! --------------------------- 
    146       ALLOCATE( ana_freq(nb_ana), ut(nb_ana), vt(nb_ana), ft(nb_ana) ) 
    147  
    148       CALL tide_harmo( ana_freq, vt, ut, ft, name, nb_ana ) 
    149  
    150       IF(lwp) WRITE(numout,*) 'Analysed frequency  : ',nb_ana ,'Frequency ' 
    151  
    152       DO jh = 1, nb_ana 
    153         IF(lwp) WRITE(numout,*) '                    : ',tname(jh),' ',ana_freq(jh) 
    154       END DO 
    155  
    156       ! Initialize temporary arrays: 
    157       ! ---------------------------- 
    158       ALLOCATE( ana_temp(jpi,jpj,2*nb_ana,3) ) 
    159       ana_temp(:,:,:,:) = 0._wp 
    160161 
    161162   END SUBROUTINE dia_harm_init 
     
    177178      !!-------------------------------------------------------------------- 
    178179      IF( ln_timing )   CALL timing_start('dia_harm') 
    179       ! 
    180       IF( kt == nit000 )   CALL dia_harm_init 
    181180      ! 
    182181      IF( kt >= nit000_han .AND. kt <= nitend_han .AND. MOD(kt,nstep_han) == 0 ) THEN 
     
    422421      INTEGER, INTENT(in) ::   init  
    423422      ! 
    424       INTEGER                         :: ji_sd, jj_sd, ji1_sd, ji2_sd, jk1_sd, jk2_sd 
     423      INTEGER                         :: ji_sd, jj_sd, ji1_sd, ji2_sd, jh1_sd, jh2_sd 
    425424      REAL(wp)                        :: zval1, zval2, zx1 
    426425      REAL(wp), DIMENSION(jpincomax) :: ztmpx, zcol1, zcol2 
     
    434433         ztmp3(:,:) = 0._wp 
    435434         ! 
    436          DO jk1_sd = 1, nsparse 
    437             DO jk2_sd = 1, nsparse 
    438                nisparse(jk2_sd) = nisparse(jk2_sd) 
    439                njsparse(jk2_sd) = njsparse(jk2_sd) 
    440                IF( nisparse(jk2_sd) == nisparse(jk1_sd) ) THEN 
    441                   ztmp3(njsparse(jk1_sd),njsparse(jk2_sd)) = ztmp3(njsparse(jk1_sd),njsparse(jk2_sd))  & 
    442                      &                                     + valuesparse(jk1_sd)*valuesparse(jk2_sd) 
     435         DO jh1_sd = 1, nsparse 
     436            DO jh2_sd = 1, nsparse 
     437               nisparse(jh2_sd) = nisparse(jh2_sd) 
     438               njsparse(jh2_sd) = njsparse(jh2_sd) 
     439               IF( nisparse(jh2_sd) == nisparse(jh1_sd) ) THEN 
     440                  ztmp3(njsparse(jh1_sd),njsparse(jh2_sd)) = ztmp3(njsparse(jh1_sd),njsparse(jh2_sd))  & 
     441                     &                                     + valuesparse(jh1_sd)*valuesparse(jh2_sd) 
    443442               ENDIF 
    444443            END DO 
     
    515514   END SUBROUTINE SUR_DETERMINE 
    516515 
    517 #else 
    518    !!---------------------------------------------------------------------- 
    519    !!   Default case :   Empty module 
    520    !!---------------------------------------------------------------------- 
    521    LOGICAL, PUBLIC, PARAMETER ::   lk_diaharm = .FALSE. 
    522 CONTAINS 
    523    SUBROUTINE dia_harm ( kt )     ! Empty routine 
    524       INTEGER, INTENT( IN ) :: kt   
    525       WRITE(*,*) 'dia_harm: you should not have seen this print' 
    526    END SUBROUTINE dia_harm 
    527 #endif 
    528  
    529516   !!====================================================================== 
    530517END MODULE diaharm 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/DIA/diawri.F90

    r11363 r11413  
    437437      !!      define all the NETCDF files and fields 
    438438      !!      At each time step call histdef to compute the mean if ncessary 
    439       !!      Each nwrite time step, output the instantaneous or mean fields 
     439      !!      Each nn_write time step, output the instantaneous or mean fields 
    440440      !!---------------------------------------------------------------------- 
    441441      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     
    455455      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zw3d_abl   ! ABL 3D workspace 
    456456      !!---------------------------------------------------------------------- 
    457       !  
    458       IF( ln_timing )   CALL timing_start('dia_wri') 
    459457      ! 
    460458      IF( ninist == 1 ) THEN     !==  Output the initial state and forcings  ==! 
     
    464462      
    465463      ! 
     464      IF( nn_write == -1 )   RETURN   ! we will never do any output 
     465      !  
     466      IF( ln_timing )   CALL timing_start('dia_wri') 
     467      ! 
    466468      ! 0. Initialisation 
    467469      ! ----------------- 
     
    473475      clop = "x"         ! no use of the mask value (require less cpu time and otherwise the model crashes) 
    474476#if defined key_diainstant 
    475       zsto = nwrite * rdt 
     477      zsto = nn_write * rdt 
    476478      clop = "inst("//TRIM(clop)//")" 
    477479#else 
     
    479481      clop = "ave("//TRIM(clop)//")" 
    480482#endif 
    481       zout = nwrite * rdt 
     483      zout = nn_write * rdt 
    482484      zmax = ( nitend - nit000 + 1 ) * rdt 
    483485 
     
    511513         ! WRITE root name in date.file for use by postpro 
    512514         IF(lwp) THEN 
    513             CALL dia_nam( clhstnam, nwrite,' ' ) 
     515            CALL dia_nam( clhstnam, nn_write,' ' ) 
    514516            CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    515517            WRITE(inum,*) clhstnam 
     
    519521         ! Define the T grid FILE ( nid_T ) 
    520522 
    521          CALL dia_nam( clhstnam, nwrite, 'grid_T' ) 
     523         CALL dia_nam( clhstnam, nn_write, 'grid_T' ) 
    522524         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
    523525         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
     
    555557         ! Define the U grid FILE ( nid_U ) 
    556558 
    557          CALL dia_nam( clhstnam, nwrite, 'grid_U' ) 
     559         CALL dia_nam( clhstnam, nn_write, 'grid_U' ) 
    558560         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
    559561         CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu 
     
    568570         ! Define the V grid FILE ( nid_V ) 
    569571 
    570          CALL dia_nam( clhstnam, nwrite, 'grid_V' )                   ! filename 
     572         CALL dia_nam( clhstnam, nn_write, 'grid_V' )                   ! filename 
    571573         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam 
    572574         CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv 
     
    581583         ! Define the W grid FILE ( nid_W ) 
    582584 
    583          CALL dia_nam( clhstnam, nwrite, 'grid_W' )                   ! filename 
     585         CALL dia_nam( clhstnam, nn_write, 'grid_W' )                   ! filename 
    584586         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam 
    585587         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
     
    591593         IF( ln_abl ) THEN  
    592594         ! Define the ABL grid FILE ( nid_A ) 
    593             CALL dia_nam( clhstnam, nwrite, 'grid_ABL' ) 
     595            CALL dia_nam( clhstnam, nn_write, 'grid_ABL' ) 
    594596            IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
    595597            CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
     
    796798      ! donne le nombre d'elements, et ndex la liste des indices a sortir 
    797799 
    798       IF( lwp .AND. MOD( itmod, nwrite ) == 0 ) THEN  
     800      IF( lwp .AND. MOD( itmod, nn_write ) == 0 ) THEN  
    799801         WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step' 
    800802         WRITE(numout,*) '~~~~~~ ' 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/DOM/domain.F90

    r11348 r11413  
    336336            WRITE(numout,*) '      frequency of restart file       nn_stock        = ', nn_stock 
    337337         ENDIF 
     338#if ! defined key_iomput 
    338339         WRITE(numout,*) '      frequency of output file        nn_write        = ', nn_write 
     340#endif 
    339341         WRITE(numout,*) '      mask land points                ln_mskland      = ', ln_mskland 
    340342         WRITE(numout,*) '      additional CF standard metadata ln_cfmeta       = ', ln_cfmeta 
     
    358360      nleapy = nn_leapy 
    359361      ninist = nn_istate 
    360       nstock = nn_stock 
    361       nstocklist = nn_stocklist 
    362       nwrite = nn_write 
    363362      neuler = nn_euler 
    364363      IF( neuler == 1 .AND. .NOT. ln_rstart ) THEN 
     
    369368      ENDIF 
    370369      !                             ! control of output frequency 
    371       IF( nstock == 0 .OR. nstock > nitend ) THEN 
    372          WRITE(ctmp1,*) 'nstock = ', nstock, ' it is forced to ', nitend 
     370      IF( .NOT. ln_rst_list ) THEN     ! we use nn_stock 
     371         IF( nn_stock == -1 )   CALL ctl_warn( 'nn_stock = -1 --> no restart will be done' ) 
     372         IF( nn_stock == 0 .OR. nn_stock > nitend ) THEN 
     373            WRITE(ctmp1,*) 'nn_stock = ', nn_stock, ' it is forced to ', nitend 
     374            CALL ctl_warn( ctmp1 ) 
     375            nn_stock = nitend 
     376         ENDIF 
     377      ENDIF 
     378#if ! defined key_iomput 
     379      IF( nn_write == -1 )   CALL ctl_warn( 'nn_write = -1 --> no output files will be done' ) 
     380      IF ( nn_write == 0 ) THEN 
     381         WRITE(ctmp1,*) 'nn_write = ', nn_write, ' it is forced to ', nitend 
    373382         CALL ctl_warn( ctmp1 ) 
    374          nstock = nitend 
    375       ENDIF 
    376       IF ( nwrite == 0 ) THEN 
    377          WRITE(ctmp1,*) 'nwrite = ', nwrite, ' it is forced to ', nitend 
    378          CALL ctl_warn( ctmp1 ) 
    379          nwrite = nitend 
    380       ENDIF 
     383         nn_write = nitend 
     384      ENDIF 
     385#endif 
    381386 
    382387#if defined key_agrif 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/DYN/dynspg_ts.F90

    r11348 r11413  
    524524            ! 
    525525         ENDIF     
    526          ! sum over sub-time-steps to decide which baroclinic velocities to set to zero (zuwdav2 is only used when ln_wd_dl_bc=True)  
    527          IF ( ln_wd_dl_bc ) THEN 
    528             zuwdav2(1:jpim1,1:jpj  ) = zuwdav2(1:jpim1,1:jpj  ) + za2 * zuwdmask(1:jpim1,1:jpj  )   ! not jpi-column 
    529             zvwdav2(1:jpi  ,1:jpjm1) = zvwdav2(1:jpi  ,1:jpjm1) + za2 * zvwdmask(1:jpi  ,1:jpjm1)   ! not jpj-row 
    530          END IF 
    531526         ! 
    532527         ! 
     
    548543         un_adv(:,:) = un_adv(:,:) + za2 * zhU(:,:) * r1_e2u(:,:) 
    549544         vn_adv(:,:) = vn_adv(:,:) + za2 * zhV(:,:) * r1_e1v(:,:) 
     545         ! sum over sub-time-steps to decide which baroclinic velocities to set to zero (zuwdav2 is only used when ln_wd_dl_bc=True)  
     546         IF ( ln_wd_dl_bc ) THEN 
     547            zuwdav2(1:jpim1,1:jpj  ) = zuwdav2(1:jpim1,1:jpj  ) + za2 * zuwdmask(1:jpim1,1:jpj  )   ! not jpi-column 
     548            zvwdav2(1:jpi  ,1:jpjm1) = zvwdav2(1:jpi  ,1:jpjm1) + za2 * zvwdmask(1:jpi  ,1:jpjm1)   ! not jpj-row 
     549         END IF 
    550550         ! 
    551551         ! Duplicate sea level across open boundaries (this is only cosmetic if linssh=T) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/DYN/dynzdf.F90

    r10364 r11413  
    170170                     zzws = - zdt * ( avm(ji+1,jj,jk+1) + avm(ji,jj,jk+1) + akzu(ji,jj,jk+1) )   & 
    171171                        &         / ( ze3ua * e3uw_n(ji,jj,jk+1) ) * wumask(ji,jj,jk+1) 
    172                      zWui = 0.5_wp * ( wi(ji,jj,jk  ) + wi(ji+1,jj,jk  ) ) 
    173                      zWus = 0.5_wp * ( wi(ji,jj,jk+1) + wi(ji+1,jj,jk+1) ) 
     172                     zWui = ( wi(ji,jj,jk  ) + wi(ji+1,jj,jk  ) ) / ze3ua 
     173                     zWus = ( wi(ji,jj,jk+1) + wi(ji+1,jj,jk+1) ) / ze3ua 
    174174                     zwi(ji,jj,jk) = zzwi + zdt * MIN( zWui, 0._wp )  
    175175                     zws(ji,jj,jk) = zzws - zdt * MAX( zWus, 0._wp ) 
     
    185185                     zzwi = - zdt * ( avm(ji+1,jj,jk  ) + avm(ji,jj,jk  ) ) / ( ze3ua * e3uw_n(ji,jj,jk  ) ) * wumask(ji,jj,jk  ) 
    186186                     zzws = - zdt * ( avm(ji+1,jj,jk+1) + avm(ji,jj,jk+1) ) / ( ze3ua * e3uw_n(ji,jj,jk+1) ) * wumask(ji,jj,jk+1) 
    187                      zWui = 0.5_wp * ( wi(ji,jj,jk  ) + wi(ji+1,jj,jk  ) ) 
    188                      zWus = 0.5_wp * ( wi(ji,jj,jk+1) + wi(ji+1,jj,jk+1) ) 
     187                     zWui = ( wi(ji,jj,jk  ) + wi(ji+1,jj,jk  ) ) / ze3ua 
     188                     zWus = ( wi(ji,jj,jk+1) + wi(ji+1,jj,jk+1) ) / ze3ua 
    189189                     zwi(ji,jj,jk) = zzwi + zdt * MIN( zWui, 0._wp ) 
    190190                     zws(ji,jj,jk) = zzws - zdt * MAX( zWus, 0._wp ) 
     
    199199               ze3ua =  ( 1._wp - r_vvl ) * e3u_n(ji,jj,1) + r_vvl * e3u_a(ji,jj,1) 
    200200               zzws = - zdt * ( avm(ji+1,jj,2) + avm(ji  ,jj,2) ) / ( ze3ua * e3uw_n(ji,jj,2) ) * wumask(ji,jj,2) 
    201                zWus = 0.5_wp * ( wi(ji  ,jj,2) +  wi(ji+1,jj,2) ) 
     201               zWus = ( wi(ji  ,jj,2) +  wi(ji+1,jj,2) ) / ze3ua 
    202202               zws(ji,jj,1 ) = zzws - zdt * MAX( zWus, 0._wp ) 
    203203               zwd(ji,jj,1 ) = 1._wp - zzws - zdt * ( MIN( zWus, 0._wp ) ) 
     
    336336                     zzws = - zdt * ( avm(ji,jj+1,jk+1) + avm(ji,jj,jk+1) + akzv(ji,jj,jk+1) )   & 
    337337                        &         / ( ze3va * e3vw_n(ji,jj,jk+1) ) * wvmask(ji,jj,jk+1) 
    338                      zWvi = 0.5_wp * ( wi(ji,jj,jk  ) + wi(ji,jj+1,jk  ) ) * wvmask(ji,jj,jk  ) 
    339                      zWvs = 0.5_wp * ( wi(ji,jj,jk+1) + wi(ji,jj+1,jk+1) ) * wvmask(ji,jj,jk+1) 
     338                     zWvi = ( wi(ji,jj,jk  ) + wi(ji,jj+1,jk  ) ) / ze3va 
     339                     zWvs = ( wi(ji,jj,jk+1) + wi(ji,jj+1,jk+1) ) / ze3va 
    340340                     zwi(ji,jj,jk) = zzwi + zdt * MIN( zWvi, 0._wp ) 
    341341                     zws(ji,jj,jk) = zzws - zdt * MAX( zWvs, 0._wp ) 
     
    351351                     zzwi = - zdt * ( avm(ji,jj+1,jk  ) + avm(ji,jj,jk  ) ) / ( ze3va * e3vw_n(ji,jj,jk  ) ) * wvmask(ji,jj,jk  ) 
    352352                     zzws = - zdt * ( avm(ji,jj+1,jk+1) + avm(ji,jj,jk+1) ) / ( ze3va * e3vw_n(ji,jj,jk+1) ) * wvmask(ji,jj,jk+1) 
    353                      zWvi = 0.5_wp * ( wi(ji,jj,jk  ) + wi(ji,jj+1,jk  ) ) * wvmask(ji,jj,jk  ) 
    354                      zWvs = 0.5_wp * ( wi(ji,jj,jk+1) + wi(ji,jj+1,jk+1) ) * wvmask(ji,jj,jk+1) 
     353                     zWvi = ( wi(ji,jj,jk  ) + wi(ji,jj+1,jk  ) ) / ze3va 
     354                     zWvs = ( wi(ji,jj,jk+1) + wi(ji,jj+1,jk+1) ) / ze3va 
    355355                     zwi(ji,jj,jk) = zzwi  + zdt * MIN( zWvi, 0._wp ) 
    356356                     zws(ji,jj,jk) = zzws  - zdt * MAX( zWvs, 0._wp ) 
     
    365365               ze3va =  ( 1._wp - r_vvl ) * e3v_n(ji,jj,1) + r_vvl * e3v_a(ji,jj,1) 
    366366               zzws = - zdt * ( avm(ji,jj+1,2) + avm(ji,jj,2) ) / ( ze3va * e3vw_n(ji,jj,2) ) * wvmask(ji,jj,2) 
    367                zWvs = 0.5_wp * ( wi(ji,jj  ,2) +  wi(ji,jj+1,2) ) 
     367               zWvs = ( wi(ji,jj  ,2) +  wi(ji,jj+1,2) ) / ze3va 
    368368               zws(ji,jj,1 ) = zzws - zdt * MAX( zWvs, 0._wp ) 
    369369               zwd(ji,jj,1 ) = 1._wp - zzws - zdt * ( MIN( zWvs, 0._wp ) ) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/DYN/sshwzv.F90

    r10907 r11413  
    284284      ! 
    285285      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
    286       REAL(wp)             ::   zCu, zcff, z1_e3w                     ! local scalars 
     286      REAL(wp)             ::   zCu, zcff, z1_e3t                     ! local scalars 
    287287      REAL(wp) , PARAMETER ::   Cu_min = 0.15_wp                      ! local parameters 
    288288      REAL(wp) , PARAMETER ::   Cu_max = 0.27                         ! local parameters 
     
    297297         IF(lwp) WRITE(numout,*) 'wAimp : Courant number-based partitioning of now vertical velocity ' 
    298298         IF(lwp) WRITE(numout,*) '~~~~~ ' 
     299         wi(:,:,:) = 0._wp 
    299300      ENDIF 
    300301      ! 
     
    303304         DO jj = 2, jpjm1 
    304305            DO ji = 2, fs_jpim1   ! vector opt. 
    305                z1_e3w = 1._wp / e3w_n(ji,jj,jk) 
    306                Cu_adv(ji,jj,jk) = 2._wp * rdt * ( ( MAX( wn(ji,jj,jk) , 0._wp ) - MIN( wn(ji,jj,jk+1) , 0._wp ) )    &  ! 2*rdt and not r2dt (for restartability) 
    307                   &                             + ( MAX( e2u(ji  ,jj)*e3uw_n(ji  ,jj,jk)*un(ji  ,jj,jk), 0._wp ) -   & 
    308                   &                                 MIN( e2u(ji-1,jj)*e3uw_n(ji-1,jj,jk)*un(ji-1,jj,jk), 0._wp ) )   & 
    309                   &                               * r1_e1e2t(ji,jj)                                                  & 
    310                   &                             + ( MAX( e1v(ji,jj  )*e3vw_n(ji,jj  ,jk)*vn(ji,jj  ,jk), 0._wp ) -   & 
    311                   &                                 MIN( e1v(ji,jj-1)*e3vw_n(ji,jj-1,jk)*vn(ji,jj-1,jk), 0._wp ) )   & 
    312                   &                               * r1_e1e2t(ji,jj)                                                  & 
    313                   &                             ) * z1_e3w 
     306               z1_e3t = 1._wp / e3t_n(ji,jj,jk) 
     307               Cu_adv(ji,jj,jk) = 2._wp * rdt * ( ( MAX( wn(ji,jj,jk) , 0._wp ) - MIN( wn(ji,jj,jk+1) , 0._wp ) )   &  ! 2*rdt and not r2dt (for restartability) 
     308                  &                             + ( MAX( e2u(ji  ,jj)*e3u_n(ji  ,jj,jk)*un(ji  ,jj,jk), 0._wp ) -   & 
     309                  &                                 MIN( e2u(ji-1,jj)*e3u_n(ji-1,jj,jk)*un(ji-1,jj,jk), 0._wp ) )   & 
     310                  &                               * r1_e1e2t(ji,jj)                                                 & 
     311                  &                             + ( MAX( e1v(ji,jj  )*e3v_n(ji,jj  ,jk)*vn(ji,jj  ,jk), 0._wp ) -   & 
     312                  &                                 MIN( e1v(ji,jj-1)*e3v_n(ji,jj-1,jk)*vn(ji,jj-1,jk), 0._wp ) )   & 
     313                  &                               * r1_e1e2t(ji,jj)                                                 & 
     314                  &                             ) * z1_e3t 
    314315            END DO 
    315316         END DO 
     
    320321      ! 
    321322      IF( MAXVAL( Cu_adv(:,:,:) ) > Cu_min ) THEN       ! Quick check if any breaches anywhere 
    322          DO jk = 1, jpkm1                               ! or scan Courant criterion and partition 
     323         DO jk = jpkm1, 2, -1                           ! or scan Courant criterion and partition 
    323324            DO jj = 1, jpj                              ! w where necessary 
    324325               DO ji = 1, jpi 
    325326                  ! 
    326                   zCu = MAX( Cu_adv(ji,jj,jk) , Cu_adv(ji,jj,jk+1) ) 
     327                  zCu = MAX( Cu_adv(ji,jj,jk) , Cu_adv(ji,jj,jk-1) ) 
     328! alt: 
     329!                  IF ( wn(ji,jj,jk) > 0._wp ) THEN  
     330!                     zCu =  Cu_adv(ji,jj,jk)  
     331!                  ELSE 
     332!                     zCu =  Cu_adv(ji,jj,jk-1) 
     333!                  ENDIF  
    327334                  ! 
    328335                  IF( zCu <= Cu_min ) THEN              !<-- Fully explicit 
     
    343350            END DO 
    344351         END DO 
     352         Cu_adv(:,:,1) = 0._wp  
    345353      ELSE 
    346354         ! Fully explicit everywhere 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/FLO/flo4rk.F90

    r10068 r11413  
    44   !! Ocean floats :   trajectory computation using a 4th order Runge-Kutta 
    55   !!====================================================================== 
    6 #if   defined key_floats 
    7    !!---------------------------------------------------------------------- 
    8    !!   'key_floats'                                     float trajectories 
     6   !! 
    97   !!---------------------------------------------------------------------- 
    108   !!   flo_4rk        : Compute the geographical position of floats 
     
    445443   END SUBROUTINE flo_interp 
    446444 
    447 #  else 
    448    !!---------------------------------------------------------------------- 
    449    !!   No floats                                              Dummy module 
    450    !!---------------------------------------------------------------------- 
    451 #endif 
    452     
    453445   !!====================================================================== 
    454446END MODULE flo4rk 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/FLO/flo_oce.F90

    r10425 r11413  
    66   !! History :   OPA  ! 1999-10  (CLIPPER projet) 
    77   !!   NEMO      1.0  ! 2002-11  (G. Madec, A. Bozec)  F90: Free form and module 
    8    !!---------------------------------------------------------------------- 
    9 #if   defined   key_floats 
    10    !!---------------------------------------------------------------------- 
    11    !!   'key_floats'                                        drifting floats 
    128   !!---------------------------------------------------------------------- 
    139   USE par_oce         ! ocean parameters 
     
    2016   PUBLIC   flo_oce_alloc   ! Routine called in floats.F90 
    2117 
    22    LOGICAL, PUBLIC, PARAMETER ::   lk_floats = .TRUE.    !: float flag 
    23  
    2418   !! float parameters 
    2519   !! ---------------- 
     20   LOGICAL, PUBLIC ::   ln_floats   !: Activate floats or not 
    2621   INTEGER, PUBLIC ::   jpnfl       !: total number of floats during the run 
    2722   INTEGER, PUBLIC ::   jpnnewflo   !: number of floats added in a new run 
     
    6863   END FUNCTION flo_oce_alloc 
    6964 
    70 #else 
    71    !!---------------------------------------------------------------------- 
    72    !!   Default option :                                 NO drifting floats 
    73    !!---------------------------------------------------------------------- 
    74    LOGICAL, PUBLIC, PARAMETER ::   lk_floats = .FALSE.   !: float flag 
    75 #endif 
    76  
    7765   !!====================================================================== 
    7866END MODULE flo_oce 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/FLO/floats.F90

    r11348 r11413  
    77   !!   NEMO     1.0  ! 2002-06  (A. Bozec)  F90, Free form and module 
    88   !!---------------------------------------------------------------------- 
    9 #if   defined   key_floats 
    10    !!---------------------------------------------------------------------- 
    11    !!   'key_floats'                                     float trajectories 
     9   !! 
    1210   !!---------------------------------------------------------------------- 
    1311   !!   flo_stp   : float trajectories computation 
     
    3028 
    3129   PUBLIC   flo_stp    ! routine called by step.F90 
    32    PUBLIC   flo_init   ! routine called by opa.F90 
     30   PUBLIC   flo_init   ! routine called by nemogcm.F90 
    3331 
    3432   !!---------------------------------------------------------------------- 
     
    8179      INTEGER ::   ios                 ! Local integer output status for namelist read 
    8280      ! 
    83       NAMELIST/namflo/ jpnfl, jpnnewflo, ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4, ln_ariane, ln_flo_ascii 
     81      NAMELIST/namflo/ ln_floats, jpnfl, jpnnewflo, ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4, ln_ariane, ln_flo_ascii 
    8482      !!--------------------------------------------------------------------- 
    8583      ! 
     
    10098         WRITE(numout,*) 
    10199         WRITE(numout,*) '         Namelist floats :' 
    102          WRITE(numout,*) '            number of floats                      jpnfl        = ', jpnfl 
    103          WRITE(numout,*) '            number of new floats                  jpnflnewflo  = ', jpnnewflo 
    104          WRITE(numout,*) '            restart                               ln_rstflo    = ', ln_rstflo 
    105          WRITE(numout,*) '            frequency of float output file        nn_writefl   = ', nn_writefl 
    106          WRITE(numout,*) '            frequency of float restart file       nn_stockfl   = ', nn_stockfl 
    107          WRITE(numout,*) '            Argo type floats                      ln_argo      = ', ln_argo 
    108          WRITE(numout,*) '            Computation of T trajectories         ln_flork4    = ', ln_flork4 
    109          WRITE(numout,*) '            Use of ariane convention              ln_ariane    = ', ln_ariane 
    110          WRITE(numout,*) '            ascii output (T) or netcdf output (F) ln_flo_ascii = ', ln_flo_ascii 
     100         WRITE(numout,*) '            Activate floats or not                   ln_floats    = ', ln_floats 
     101         WRITE(numout,*) '               number of floats                      jpnfl        = ', jpnfl 
     102         WRITE(numout,*) '               number of new floats                  jpnflnewflo  = ', jpnnewflo 
     103         WRITE(numout,*) '               restart                               ln_rstflo    = ', ln_rstflo 
     104         WRITE(numout,*) '               frequency of float output file        nn_writefl   = ', nn_writefl 
     105         WRITE(numout,*) '               frequency of float restart file       nn_stockfl   = ', nn_stockfl 
     106         WRITE(numout,*) '               Argo type floats                      ln_argo      = ', ln_argo 
     107         WRITE(numout,*) '               Computation of T trajectories         ln_flork4    = ', ln_flork4 
     108         WRITE(numout,*) '               Use of ariane convention              ln_ariane    = ', ln_ariane 
     109         WRITE(numout,*) '               ascii output (T) or netcdf output (F) ln_flo_ascii = ', ln_flo_ascii 
    111110 
    112111      ENDIF 
    113112      ! 
    114       !                             ! allocate floats arrays 
    115       IF( flo_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_init : unable to allocate arrays' ) 
    116       ! 
    117       !                             ! allocate flodom arrays 
    118       IF( flo_dom_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_dom : unable to allocate arrays' ) 
    119       ! 
    120       !                             ! allocate flowri arrays 
    121       IF( flo_wri_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_wri : unable to allocate arrays' ) 
    122       ! 
    123       !                             ! allocate florst arrays 
    124       IF( flo_rst_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_rst : unable to allocate arrays' ) 
    125       ! 
    126       jpnrstflo = jpnfl-jpnnewflo   ! memory allocation  
    127       ! 
    128       DO jfl = 1, jpnfl             ! vertical axe for netcdf IOM ouput 
    129          nfloat(jfl) = jfl  
    130       END DO 
    131       ! 
    132       CALL flo_dom                  ! compute/read initial position of floats 
    133       ! 
    134       wb(:,:,:) = wn(:,:,:)         ! set wb for computation of floats trajectories at the first time step 
     113      IF( ln_floats ) THEN 
     114         !                             ! allocate floats arrays 
     115         IF( flo_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_init : unable to allocate arrays' ) 
     116         ! 
     117         !                             ! allocate flodom arrays 
     118         IF( flo_dom_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_dom : unable to allocate arrays' ) 
     119         ! 
     120         !                             ! allocate flowri arrays 
     121         IF( flo_wri_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_wri : unable to allocate arrays' ) 
     122         ! 
     123         !                             ! allocate florst arrays 
     124         IF( flo_rst_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_rst : unable to allocate arrays' ) 
     125         ! 
     126         jpnrstflo = jpnfl-jpnnewflo   ! memory allocation  
     127         ! 
     128         DO jfl = 1, jpnfl             ! vertical axe for netcdf IOM ouput 
     129            nfloat(jfl) = jfl  
     130         END DO 
     131         ! 
     132         CALL flo_dom                  ! compute/read initial position of floats 
     133         ! 
     134         wb(:,:,:) = wn(:,:,:)         ! set wb for computation of floats trajectories at the first time step 
     135         ! 
     136      ENDIF 
    135137      ! 
    136138   END SUBROUTINE flo_init 
    137139 
    138 #  else 
    139    !!---------------------------------------------------------------------- 
    140    !!   Default option :                                       Empty module 
    141    !!---------------------------------------------------------------------- 
    142 CONTAINS 
    143    SUBROUTINE flo_stp( kt )          ! Empty routine 
    144       IMPLICIT NONE 
    145       INTEGER, INTENT( in ) :: kt 
    146       WRITE(*,*) 'flo_stp: You should not have seen this print! error?', kt 
    147    END SUBROUTINE flo_stp 
    148    SUBROUTINE flo_init          ! Empty routine 
    149       IMPLICIT NONE 
    150    END SUBROUTINE flo_init 
    151 #endif 
    152  
    153140   !!====================================================================== 
    154141 END MODULE floats 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/FLO/floblk.F90

    r10425 r11413  
    44   !! Ocean floats :   trajectory computation 
    55   !!====================================================================== 
    6 #if   defined key_floats 
    7    !!---------------------------------------------------------------------- 
    8    !!   'key_floats'                                     float trajectories 
     6   !! 
    97   !!---------------------------------------------------------------------- 
    108   !!    flotblk     : compute float trajectories with Blanke algorithme 
     
    369367   END SUBROUTINE flo_blk 
    370368 
    371 #  else 
    372    !!---------------------------------------------------------------------- 
    373    !!   Default option                                         Empty module 
    374    !!---------------------------------------------------------------------- 
    375 CONTAINS 
    376    SUBROUTINE flo_blk                  ! Empty routine 
    377    END SUBROUTINE flo_blk  
    378 #endif 
    379     
    380369   !!====================================================================== 
    381370END MODULE floblk  
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/FLO/flodom.F90

    r10425 r11413  
    66   !! History :  OPA  ! 1998-07 (Y.Drillet, CLIPPER)  Original code 
    77   !!  NEMO      3.3  ! 2011-09 (C.Bricaud,S.Law-Chune Mercator-Ocean): add ARIANE convention + comsecitc changes 
    8    !!---------------------------------------------------------------------- 
    9 #if   defined key_floats 
    10    !!---------------------------------------------------------------------- 
    11    !!   'key_floats'                                     float trajectories 
    128   !!---------------------------------------------------------------------- 
    139   !!   flo_dom               : initialization of floats 
     
    455451   END FUNCTION flo_dom_alloc 
    456452 
    457  
    458 #else 
    459    !!---------------------------------------------------------------------- 
    460    !!   Default option                                         Empty module 
    461    !!---------------------------------------------------------------------- 
    462 CONTAINS 
    463    SUBROUTINE flo_dom                 ! Empty routine 
    464          WRITE(*,*) 'flo_dom: : You should not have seen this print! error?' 
    465    END SUBROUTINE flo_dom 
    466 #endif 
    467  
    468453   !!====================================================================== 
    469454END MODULE flodom 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/FLO/florst.F90

    r10425 r11413  
    88   !!   NEMO      1.0  !  2002-10  (A. Bozec)  F90 : Free form and module 
    99   !!             3.2  !  2010-08  (slaw, cbricaud): netcdf outputs and others  
    10    !!---------------------------------------------------------------------- 
    11 #if   defined key_floats 
    12    !!---------------------------------------------------------------------- 
    13    !!   'key_floats'                                     float trajectories 
    1410   !!---------------------------------------------------------------------- 
    1511   USE flo_oce         ! ocean drifting floats 
     
    125121   END SUBROUTINE flo_rst 
    126122 
    127 #  else 
    128    !!---------------------------------------------------------------------- 
    129    !!   Default option                                         Empty module 
    130    !!---------------------------------------------------------------------- 
    131 CONTAINS 
    132    SUBROUTINE flo_rst                 ! Empty routine 
    133    END SUBROUTINE flo_rst 
    134 #endif 
    135  
    136123   !!======================================================================= 
    137124END MODULE florst 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/FLO/flowri.F90

    r10425 r11413  
    1010   !!   NEMO      1.0  !  2002-10  (A. Bozec)  F90 : Free form and module 
    1111   !!             3.2  !  2010-08  (slaw, cbricaud): netcdf outputs and others  
    12    !!---------------------------------------------------------------------- 
    13 #if   defined key_floats 
    14    !!---------------------------------------------------------------------- 
    15    !!   'key_floats'                                     float trajectories 
    1612   !!---------------------------------------------------------------------- 
    1713   USE flo_oce         ! ocean drifting floats 
     
    179175               CALL ctl_opn( numflo, 'trajec_float', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    180176               irecflo = NINT( (nitend-nn_it000) / FLOAT(nn_writefl) ) 
    181                WRITE(numflo,*)cexper,no,irecflo,jpnfl,nn_writefl 
     177               WRITE(numflo,*) cexper, irecflo, jpnfl, nn_writefl 
    182178            ENDIF 
    183179 
     
    255251 
    256252               istart = (/jfl,irec/) 
    257                icfl   = INT( tpkfl(jfl) )            ! K-index of the nearest point before 
    258  
    259                CALL flioputv( numflo , 'traj_lon'    , zlon(jfl)        , start=istart ) 
    260                CALL flioputv( numflo , 'traj_lat'    , zlat(jfl)        , start=istart )   
    261                CALL flioputv( numflo , 'traj_depth'  , zdep(jfl)        , start=istart )   
    262                CALL flioputv( numflo , 'traj_temp'   , ztemp(icfl,jfl)  , start=istart )   
    263                CALL flioputv( numflo , 'traj_salt'   , zsal(icfl,jfl)   , start=istart )   
    264                CALL flioputv( numflo , 'traj_dens'   , zrho(icfl,jfl)   , start=istart )   
     253 
     254               CALL flioputv( numflo , 'traj_lon'    , zlon(jfl), start=istart ) 
     255               CALL flioputv( numflo , 'traj_lat'    , zlat(jfl), start=istart )   
     256               CALL flioputv( numflo , 'traj_depth'  , zdep(jfl), start=istart )   
     257               CALL flioputv( numflo , 'traj_temp'   , ztem(jfl), start=istart )   
     258               CALL flioputv( numflo , 'traj_salt'   , zsal(jfl), start=istart )   
     259               CALL flioputv( numflo , 'traj_dens'   , zrho(jfl), start=istart )   
    265260 
    266261            ENDDO 
     
    277272   END SUBROUTINE flo_wri 
    278273 
    279  
    280 #  else 
    281    !!---------------------------------------------------------------------- 
    282    !!   Default option                                         Empty module 
    283    !!---------------------------------------------------------------------- 
    284 CONTAINS 
    285    SUBROUTINE flo_wri                 ! Empty routine 
    286    END SUBROUTINE flo_wri 
    287 #endif 
    288  
    289274   !!======================================================================= 
    290275END MODULE flowri 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/IOM/in_out_manager.F90

    r11348 r11413  
    8080   INTEGER       ::   nleapy                      !: Leap year calendar flag (0/1 or 30) 
    8181   INTEGER       ::   ninist                      !: initial state output flag (0/1) 
    82    INTEGER       ::   nwrite                      !: model standard output frequency 
    83    INTEGER       ::   nstock                      !: restart file frequency 
    84    INTEGER, DIMENSION(10) :: nstocklist           !: restart dump times 
    8582 
    8683   !!---------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/IOM/iom.F90

    r11360 r11413  
    5858   PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get 
    5959   PUBLIC iom_chkatt, iom_getatt, iom_putatt, iom_getszuld, iom_rstput, iom_delay_rst, iom_put 
    60    PUBLIC iom_use, iom_context_finalize 
     60   PUBLIC iom_use, iom_context_finalize, iom_miss_val 
    6161 
    6262   PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d 
     
    230230          za_bnds(2,:) = ght_abl(2:jpka  ) + e3w_abl(2:jpka) 
    231231          CALL iom_set_axis_attr( "ghw_abl", bounds=za_bnds ) 
    232           ! 
    233 # if defined key_floats 
    234232          CALL iom_set_axis_attr( "nfloat", (/ (REAL(ji,wp), ji=1,jpnfl) /) ) 
    235 # endif 
    236233# if defined key_si3 
    237234          CALL iom_set_axis_attr( "ncatice", (/ (REAL(ji,wp), ji=1,jpl) /) ) 
     
    16891686      CHARACTER(LEN=*), INTENT(in) ::   cdname 
    16901687      REAL(wp)        , INTENT(in) ::   pfield0d 
    1691       REAL(wp)        , DIMENSION(jpi,jpj) ::   zz     ! masson 
     1688!!      REAL(wp)        , DIMENSION(jpi,jpj) ::   zz     ! masson 
    16921689#if defined key_iomput 
    1693       zz(:,:)=pfield0d 
    1694       CALL xios_send_field(cdname, zz) 
    1695       !CALL xios_send_field(cdname, (/pfield0d/))  
     1690!!clem      zz(:,:)=pfield0d 
     1691!!clem      CALL xios_send_field(cdname, zz) 
     1692      CALL xios_send_field(cdname, (/pfield0d/))  
    16961693#else 
    16971694      IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings 
     
    24062403   !!   NOT 'key_iomput'                               a few dummy routines 
    24072404   !!---------------------------------------------------------------------- 
    2408  
    24092405   SUBROUTINE iom_setkt( kt, cdname ) 
    24102406      INTEGER         , INTENT(in)::   kt  
     
    24212417 
    24222418   LOGICAL FUNCTION iom_use( cdname ) 
    2423       !!---------------------------------------------------------------------- 
    2424       !!---------------------------------------------------------------------- 
    24252419      CHARACTER(LEN=*), INTENT(in) ::   cdname 
    2426       !!---------------------------------------------------------------------- 
    24272420#if defined key_iomput 
    24282421      iom_use = xios_field_is_active( cdname ) 
     
    24312424#endif 
    24322425   END FUNCTION iom_use 
    2433     
     2426 
     2427   SUBROUTINE iom_miss_val( cdname, pmiss_val ) 
     2428      CHARACTER(LEN=*), INTENT(in ) ::   cdname 
     2429      REAL(wp)        , INTENT(out) ::   pmiss_val    
     2430#if defined key_iomput 
     2431      ! get missing value 
     2432      CALL xios_get_field_attr( cdname, default_value = pmiss_val ) 
     2433#else 
     2434      IF( .FALSE. )   WRITE(numout,*) cdname, pmiss_val   ! useless test to avoid compilation warnings 
     2435#endif 
     2436   END SUBROUTINE iom_miss_val 
     2437   
    24342438   !!====================================================================== 
    24352439END MODULE iom 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/IOM/restart.F90

    r10425 r11413  
    7070         IF( ln_rst_list ) THEN 
    7171            nrst_lst = 1 
    72             nitrst = nstocklist( nrst_lst ) 
     72            nitrst = nn_stocklist( nrst_lst ) 
    7373         ELSE 
    7474            nitrst = nitend 
    7575         ENDIF 
    7676      ENDIF 
     77       
     78      IF( .NOT. ln_rst_list .AND. nn_stock == -1 )   RETURN   ! we will never do any restart 
    7779 
    7880      ! frequency-based restart dumping (nn_stock) 
    79       IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nstock ) == 0 ) THEN    
     81      IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nn_stock ) == 0 ) THEN    
    8082         ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 
    81          nitrst = kt + nstock - 1                  ! define the next value of nitrst for restart writing 
     83         nitrst = kt + nn_stock - 1                  ! define the next value of nitrst for restart writing 
    8284         IF( nitrst > nitend )   nitrst = nitend   ! make sure we write a restart at the end of the run 
    8385      ENDIF 
     
    8587      ! we open and define the ocean restart file one time step before writing the data (-> at nitrst - 1) 
    8688      ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1 
    87       IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 
     89      IF( kt == nitrst - 1 .OR. nn_stock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 
    8890         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN  
    8991            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
     
    184186         lrst_oce = .FALSE. 
    185187            IF( ln_rst_list ) THEN 
    186                nrst_lst = MIN(nrst_lst + 1, SIZE(nstocklist,1)) 
    187                nitrst = nstocklist( nrst_lst ) 
     188               nrst_lst = MIN(nrst_lst + 1, SIZE(nn_stocklist,1)) 
     189               nitrst = nn_stocklist( nrst_lst ) 
    188190            ENDIF 
    189191      ENDIF 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/LBC/lib_mpp.F90

    r11348 r11413  
    6767   PUBLIC   mpp_report 
    6868   PUBLIC   tic_tac 
     69#if ! defined key_mpp_mpi 
     70   PUBLIC MPI_Wtime 
     71#endif 
    6972    
    7073   !! * Interfaces 
     
    660663 
    661664 
    662    SUBROUTINE mppstop( ldfinal, ld_force_abort )  
     665   SUBROUTINE mppstop( ld_abort )  
    663666      !!---------------------------------------------------------------------- 
    664667      !!                  ***  routine mppstop  *** 
     
    667670      !! 
    668671      !!---------------------------------------------------------------------- 
    669       LOGICAL, OPTIONAL, INTENT(in) :: ldfinal    ! source process number 
    670       LOGICAL, OPTIONAL, INTENT(in) :: ld_force_abort    ! source process number 
    671       LOGICAL ::   llfinal, ll_force_abort 
     672      LOGICAL, OPTIONAL, INTENT(in) :: ld_abort    ! source process number 
     673      LOGICAL ::   ll_abort 
    672674      INTEGER ::   info 
    673675      !!---------------------------------------------------------------------- 
    674       llfinal = .FALSE. 
    675       IF( PRESENT(ldfinal) ) llfinal = ldfinal 
    676       ll_force_abort = .FALSE. 
    677       IF( PRESENT(ld_force_abort) ) ll_force_abort = ld_force_abort 
    678       ! 
    679 #if defined key_mpp_mpi 
    680       IF(ll_force_abort) THEN 
     676      ll_abort = .FALSE. 
     677      IF( PRESENT(ld_abort) ) ll_abort = ld_abort 
     678      ! 
     679#if defined key_mpp_mpi 
     680      IF(ll_abort) THEN 
    681681         CALL mpi_abort( MPI_COMM_WORLD ) 
    682682      ELSE 
     
    685685      ENDIF 
    686686#endif 
    687       IF( .NOT. llfinal ) STOP 123 
     687      IF( ll_abort ) STOP 123 
    688688      ! 
    689689   END SUBROUTINE mppstop 
     
    10591059      INTEGER                            , INTENT(  out) ::   ierror 
    10601060   END SUBROUTINE mpi_wait 
     1061 
     1062    
     1063   FUNCTION MPI_Wtime() 
     1064      REAL(wp) ::  MPI_Wtime 
     1065      MPI_Wtime = -1. 
     1066   END FUNCTION MPI_Wtime 
    10611067#endif 
    10621068 
     
    11091115         WRITE(numout,*)  'huge E-R-R-O-R : immediate stop' 
    11101116         WRITE(numout,*)   
    1111          CALL mppstop( ld_force_abort = .true. ) 
     1117         CALL mppstop( ld_abort = .true. ) 
    11121118      ENDIF 
    11131119      ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/LBC/mppini.F90

    r11348 r11413  
    154154      LOGICAL ::   llbest, llauto 
    155155      LOGICAL ::   llwrtlay 
     156      LOGICAL ::   ln_listonly 
    156157      INTEGER, ALLOCATABLE, DIMENSION(:)     ::   iin, ii_nono, ii_noea          ! 1D workspace 
    157158      INTEGER, ALLOCATABLE, DIMENSION(:)     ::   ijn, ii_noso, ii_nowe          !  -     - 
     
    168169           &             rn_ice_tem, rn_ice_sal, rn_ice_age,                     & 
    169170           &             ln_vol, nn_volctl, nn_rimwidth 
    170       NAMELIST/nammpp/ jpni, jpnj, ln_nnogather 
     171      NAMELIST/nammpp/ jpni, jpnj, ln_nnogather, ln_listonly 
    171172      !!---------------------------------------------------------------------- 
    172173      ! 
     
    206207      IF(               ln_read_cfg ) CALL iom_open( cn_domcfg,    numbot ) 
    207208      IF( ln_bdy .AND. ln_mask_file ) CALL iom_open( cn_mask_file, numbdy ) 
     209      ! 
     210      IF( ln_listonly )   CALL mpp_init_bestpartition( MAX(mppsize,jpni*jpnj), ldlist = .TRUE. )   ! must be done by all core 
    208211      ! 
    209212      !  1. Dimension arrays for subdomains 
     
    268271         CALL ctl_stop( ctmp1, ctmp2, ctmp3, ' ', ctmp4, ' ' ) 
    269272         CALL mpp_init_bestpartition( mppsize, ldlist = .TRUE. )   ! must be done by all core 
    270          CALL ctl_stop( 'STOP' ) 
    271273      ENDIF 
    272274 
     
    293295         ENDIF 
    294296         CALL mpp_init_bestpartition( mppsize, ldlist = .TRUE. )   ! must be done by all core 
    295          CALL ctl_stop( 'STOP' ) 
    296297      ENDIF 
    297298 
     
    843844      INTEGER :: isziref, iszjref 
    844845      INTEGER :: inbij, iszij 
    845       INTEGER :: inbimax, inbjmax, inbijmax 
     846      INTEGER :: inbimax, inbjmax, inbijmax, inbijold 
    846847      INTEGER :: isz0, isz1 
    847848      INTEGER, DIMENSION(  :), ALLOCATABLE :: indexok 
     
    968969      DEALLOCATE( indexok, inbi1, inbj1, iszi1, iszj1 ) 
    969970 
    970       IF( llist ) THEN  ! we print about 21 best partitions 
     971      IF( llist ) THEN 
    971972         IF(lwp) THEN 
    972973            WRITE(numout,*) 
    973             WRITE(numout,         *) '                  For your information:' 
    974             WRITE(numout,'(a,i5,a)') '  list of the best partitions around ',   knbij, ' mpi processes' 
    975             WRITE(numout,         *) '  --------------------------------------', '-----', '--------------' 
     974            WRITE(numout,*) '                  For your information:' 
     975            WRITE(numout,*) '  list of the best partitions including land supression' 
     976            WRITE(numout,*) '  -----------------------------------------------------' 
    976977            WRITE(numout,*) 
    977978         END IF 
    978          iitarget = MINLOC( inbi0(:)*inbj0(:), mask = inbi0(:)*inbj0(:) >= knbij, dim = 1 ) 
    979          DO ji = MAX(1,iitarget-10), MIN(isz0,iitarget+10) 
     979         ji = isz0   ! initialization with the largest value 
     980         ALLOCATE( llisoce(inbi0(ji), inbj0(ji)) ) 
     981         CALL mpp_init_isoce( inbi0(ji), inbj0(ji), llisoce ) ! Warning: must be call by all cores (call mpp_sum) 
     982         inbijold = COUNT(llisoce) 
     983         DEALLOCATE( llisoce ) 
     984         DO ji =isz0-1,1,-1 
    980985            ALLOCATE( llisoce(inbi0(ji), inbj0(ji)) ) 
    981986            CALL mpp_init_isoce( inbi0(ji), inbj0(ji), llisoce ) ! Warning: must be call by all cores (call mpp_sum) 
    982987            inbij = COUNT(llisoce) 
    983988            DEALLOCATE( llisoce ) 
    984             IF(lwp) WRITE(numout,'(a, i5, a, i5, a, i4, a, i4, a, i9, a, i5, a, i5, a)')    & 
    985                &     'nb_cores ' , inbij,' oce + ', inbi0(ji)*inbj0(ji) - inbij             & 
    986                &                                , ' land ( ', inbi0(ji),' x ', inbj0(ji),   & 
    987                & ' ), nb_points ', iszi0(ji)*iszj0(ji),' ( ', iszi0(ji),' x ', iszj0(ji),' )' 
     989            IF(lwp .AND. inbij < inbijold) THEN 
     990               WRITE(numout,'(a, i6, a, i6, a, f4.1, a, i9, a, i6, a, i6, a)')                                 & 
     991                  &   'nb_cores oce: ', inbij, ', land domains excluded: ', inbi0(ji)*inbj0(ji) - inbij,       & 
     992                  &   ' (', REAL(inbi0(ji)*inbj0(ji) - inbij,wp) / REAL(inbi0(ji)*inbj0(ji),wp) *100.,         & 
     993                  &   '%), largest oce domain: ', iszi0(ji)*iszj0(ji), ' ( ', iszi0(ji),' x ', iszj0(ji), ' )' 
     994               inbijold = inbij 
     995            END IF 
    988996         END DO 
    989997         DEALLOCATE( inbi0, inbj0, iszi0, iszj0 ) 
    990          RETURN 
     998         IF(lwp) THEN 
     999            WRITE(numout,*) 
     1000            WRITE(numout,*)  '  -----------------------------------------------------------' 
     1001         ENDIF 
     1002         CALL mppsync 
     1003         CALL mppstop( ld_abort = .TRUE. ) 
    9911004      ENDIF 
    9921005       
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/SBC/sbcmod.F90

    r11348 r11413  
    316316      ! 
    317317      !                             !* check consistency between model timeline and nn_fsbc 
    318       IF( MOD( nitend - nit000 + 1, nn_fsbc) /= 0 .OR.   & 
    319           MOD( nstock             , nn_fsbc) /= 0 ) THEN 
    320          WRITE(ctmp1,*) 'sbc_init : experiment length (', nitend - nit000 + 1, ') or nstock (', nstock,   & 
    321             &           ' is NOT a multiple of nn_fsbc (', nn_fsbc, ')' 
    322          CALL ctl_stop( ctmp1, 'Impossible to properly do model restart' ) 
     318      IF( ln_rst_list .OR. nn_stock /= -1 ) THEN   ! we will do restart files 
     319         IF( MOD( nitend - nit000 + 1, nn_fsbc) /= 0 ) THEN 
     320            WRITE(ctmp1,*) 'sbc_init : experiment length (', nitend - nit000 + 1, ') is NOT a multiple of nn_fsbc (', nn_fsbc, ')' 
     321            CALL ctl_stop( ctmp1, 'Impossible to properly do model restart' ) 
     322         ENDIF 
     323         IF( .NOT. ln_rst_list .AND. MOD( nn_stock, nn_fsbc) /= 0 ) THEN   ! we don't use nn_stock if ln_rst_list 
     324            WRITE(ctmp1,*) 'sbc_init : nn_stock (', nn_stock, ') is NOT a multiple of nn_fsbc (', nn_fsbc, ')' 
     325            CALL ctl_stop( ctmp1, 'Impossible to properly do model restart' ) 
     326         ENDIF 
    323327      ENDIF 
    324328      ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/STO/stopar.F90

    r11348 r11413  
    270270      IF(lwm) WRITE ( numond, namsto ) 
    271271 
    272       IF( .NOT.ln_rststo ) THEN   ! no use of stochastic parameterization 
     272      IF( .NOT.ln_sto_eos ) THEN   ! no use of stochastic parameterization 
    273273         IF(lwp) THEN 
    274274            WRITE(numout,*) 
     
    750750      CHARACTER(LEN=9)    ::   clsto3d='sto3d_000' ! stochastic parameter variable name 
    751751      CHARACTER(LEN=10)   ::   clseed='seed0_0000' ! seed variable name 
    752  
     752      !!---------------------------------------------------------------------- 
     753 
     754      IF( .NOT. ln_rst_list .AND. nn_stock == -1 ) RETURN   ! we will never do any restart 
     755       
    753756      IF ( jpsto2d > 0 .OR. jpsto3d > 0 ) THEN 
    754757 
     
    790793         ! Open the restart file one timestep before writing restart 
    791794         IF( kt < nitend) THEN 
    792          IF( kt == nitrst - 1 .OR. nstock == 1 .OR. kt == nitend-1 ) THEN 
     795         IF( kt == nitrst - 1 .OR. nn_stock == 1 .OR. kt == nitend-1 ) THEN 
    793796            ! create the filename 
    794797            IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/TRA/traqsr.F90

    r11348 r11413  
    168168               DO jj = 2, jpjm1                       ! Separation in R-G-B depending of the surface Chl 
    169169                  DO ji = fs_2, fs_jpim1 
    170                      zchl    = sf_chl(1)%fnow(ji,jj,1) 
     170                     zchl    = MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) 
    171171                     zCtot   = 40.6  * zchl**0.459 
    172172                     zze     = 568.2 * zCtot**(-0.746) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/TRD/trdmxl_rst.F90

    r10425 r11413  
    4747      !!-------------------------------------------------------------------------------- 
    4848 
     49      IF( .NOT. ln_rst_list .AND. nn_stock == -1 )   RETURN   ! we will never do any restart 
     50 
    4951      ! to get better performances with NetCDF format: 
    5052      ! we open and define the ocean restart_mxl file one time step before writing the data (-> at nitrst - 1) 
    5153      ! except if we write ocean restart_mxl files every time step or if an ocean restart_mxl file was writen at nitend - 1 
    52       IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. MOD( nitend - 1, nstock ) == 0 ) ) THEN 
     54      IF( kt == nitrst - 1 .OR. nn_stock == 1 .OR. ( kt == nitend .AND. MOD( nitend - 1, nn_stock ) == 0 ) ) THEN 
    5355         ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    5456         IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/TRD/trdvor.F90

    r10425 r11413  
    4646   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avr      ! average 
    4747   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrb     ! before vorticity (kt-1) 
    48    REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrbb    ! vorticity at begining of the nwrite-1 timestep averaging period 
     48   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrbb    ! vorticity at begining of the nn_write-1 timestep averaging period 
    4949   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrbn    ! after vorticity at time step after the 
    50    REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   rotot        ! begining of the NWRITE-1 timesteps 
     50   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   rotot        ! begining of the NN_WRITE-1 timesteps 
    5151   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrtot   ! 
    5252   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrres   ! 
     
    129129      !!              from ocean surface down to control surface (NetCDF output) 
    130130      !! 
    131       !! ** Method/usage :   integration done over nwrite-1 time steps 
     131      !! ** Method/usage :   integration done over nn_write-1 time steps 
    132132      !! 
    133133      !! ** Action :   trends : 
     
    143143      !!                  vortrd (,,10) = forcing term 
    144144      !!                  vortrd (,,11) = bottom friction term 
    145       !!                  rotot(,) : total cumulative trends over nwrite-1 time steps 
     145      !!                  rotot(,) : total cumulative trends over nn_write-1 time steps 
    146146      !!                  vor_avrtot(,) : first membre of vrticity equation 
    147147      !!                  vor_avrres(,) : residual = dh/dt entrainment 
     
    214214      !!              from ocean surface down to control surface (NetCDF output) 
    215215      !! 
    216       !! ** Method/usage :   integration done over nwrite-1 time steps 
     216      !! ** Method/usage :   integration done over nn_write-1 time steps 
    217217      !! 
    218218      !! ** Action :     trends : 
     
    228228      !!                  vortrd (,,10) = forcing term 
    229229      !!      vortrd (,,11) = bottom friction term 
    230       !!                  rotot(,) : total cumulative trends over nwrite-1 time steps 
     230      !!                  rotot(,) : total cumulative trends over nn_write-1 time steps 
    231231      !!                  vor_avrtot(,) : first membre of vrticity equation 
    232232      !!                  vor_avrres(,) : residual = dh/dt entrainment 
     
    360360      ENDIF 
    361361 
    362       ! II.2 cumulated trends over analysis period (kt=2 to nwrite) 
     362      ! II.2 cumulated trends over analysis period (kt=2 to nn_write) 
    363363      ! ---------------------- 
    364       ! trends cumulated over nwrite-2 time steps 
     364      ! trends cumulated over nn_write-2 time steps 
    365365 
    366366      IF( kt >= nit000+2 ) THEN 
     
    376376      !   III. Output in netCDF + residual computation 
    377377      !  ============================================= 
    378  
     378       
    379379      ! define time axis 
    380380      it    = kt 
     
    504504      ENDIF 
    505505#if defined key_diainstant 
    506       zsto = nwrite*rdt 
     506      zsto = nn_write*rdt 
    507507      clop = "inst("//TRIM(clop)//")" 
    508508#else 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/USR/usrdef_nam.F90

    r11348 r11413  
    6363902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
    6464      ! 
    65       WRITE( numond, namusr_def ) 
     65      IF(lwm)   WRITE( numond, namusr_def ) 
    6666      ! 
    6767      cd_cfg = 'GYRE'               ! name & resolution (not used) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/ZDF/zdfiwm.F90

    r11348 r11413  
    414414      !!              de Lavergne et al. in prep., 2017 
    415415      !!---------------------------------------------------------------------- 
    416       INTEGER  ::   ji, jj, jk   ! dummy loop indices 
    417416      INTEGER  ::   inum         ! local integer 
    418417      INTEGER  ::   ios 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/nemogcm.F90

    r11348 r11413  
    5959   USE diaobs         ! Observation diagnostics       (dia_obs_init routine) 
    6060   USE diacfl         ! CFL diagnostics               (dia_cfl_init routine) 
     61   USE diaharm        ! tidal harmonics diagnostics  (dia_harm_init routine) 
    6162   USE step           ! NEMO time-stepping                 (stp     routine) 
    6263   USE icbini         ! handle bergs, initialisation 
     
    129130      !!---------------------------------------------------------------------- 
    130131      INTEGER ::   istp   ! time step index 
     132      REAL(wp)::   zstptiming   ! elapsed time for 1 time step 
    131133      !!---------------------------------------------------------------------- 
    132134      ! 
     
    189191         ! 
    190192         DO WHILE( istp <= nitend .AND. nstop == 0 ) 
    191 #if defined key_mpp_mpi 
     193 
    192194            ncom_stp = istp 
    193             IF ( istp == ( nit000 + 1 ) ) elapsed_time = MPI_Wtime() 
    194             IF ( istp ==         nitend ) elapsed_time = MPI_Wtime() - elapsed_time 
    195 #endif 
     195            IF( ln_timing ) THEN 
     196               zstptiming = MPI_Wtime() 
     197               IF ( istp == ( nit000 + 1 ) ) elapsed_time = zstptiming 
     198               IF ( istp ==         nitend ) elapsed_time = zstptiming - elapsed_time 
     199            ENDIF 
     200             
    196201            CALL stp        ( istp )  
    197202            istp = istp + 1 
     203 
     204            IF( lwp .AND. ln_timing )   WRITE(numtime,*) 'timing step ', istp-1, ' : ', MPI_Wtime() - zstptiming 
     205 
    198206         END DO 
    199207         ! 
     
    234242#else 
    235243      IF    ( lk_oasis ) THEN   ;   CALL cpl_finalize   ! end coupling and mpp communications with OASIS 
    236       ELSEIF( lk_mpp   ) THEN   ;   CALL mppstop( ldfinal = .TRUE. )   ! end mpp communications 
     244      ELSEIF( lk_mpp   ) THEN   ;   CALL mppstop      ! end mpp communications 
    237245      ENDIF 
    238246#endif 
     
    469477      
    470478      !                                      ! Diagnostics 
    471       IF( lk_floats    )   CALL     flo_init    ! drifting Floats 
     479                           CALL     flo_init    ! drifting Floats 
    472480      IF( ln_diacfl    )   CALL dia_cfl_init    ! Initialise CFL diagnostics 
    473481                           CALL dia_ptr_init    ! Poleward TRansports initialization 
    474       IF( lk_diadct    )   CALL dia_dct_init    ! Sections tranports 
     482                           CALL dia_dct_init    ! Sections tranports 
    475483                           CALL dia_hsb_init    ! heat content, salt content and volume budgets 
    476484                           CALL     trd_init    ! Mixed-layer/Vorticity/Integral constraints trends 
     
    478486                           CALL dia_tmb_init    ! TMB outputs 
    479487                           CALL dia_25h_init    ! 25h mean  outputs 
    480       IF( ln_diaobs    )   CALL dia_obs( nit000-1 )   ! Observation operator for restart 
     488                           CALL dia_harm_init   ! tidal harmonics outputs 
     489     IF( ln_diaobs    )    CALL dia_obs( nit000-1 )   ! Observation operator for restart 
    481490 
    482491      !                                      ! Assimilation increments 
     
    639648      USE trc_oce   , ONLY : trc_oce_alloc 
    640649      USE bdy_oce   , ONLY : bdy_oce_alloc 
    641 #if defined key_diadct  
    642       USE diadct    , ONLY : diadct_alloc  
    643 #endif  
    644650      ! 
    645651      INTEGER :: ierr 
     
    653659      ierr = ierr + bdy_oce_alloc()    ! bdy masks (incl. initialization) 
    654660      ! 
    655 #if defined key_diadct  
    656       ierr = ierr + diadct_alloc ()    !  
    657 #endif  
    658       ! 
    659661      CALL mpp_sum( 'nemogcm', ierr ) 
    660662      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'nemo_alloc: unable to allocate standard ocean arrays' ) 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/step.F90

    r11223 r11413  
    198198                            CALL div_hor    ( kstp )              ! Horizontal divergence  (2nd call in time-split case) 
    199199         IF(.NOT.ln_linssh) CALL dom_vvl_sf_nxt( kstp, kcall=2 )  ! after vertical scale factors (update depth average component) 
     200      ENDIF 
     201                         CALL dyn_zdf       ( kstp )  ! vertical diffusion 
     202 
     203      IF( ln_dynspg_ts ) THEN                          
    200204                            CALL wzv        ( kstp )              ! now cross-level velocity  
    201205         IF( ln_zad_Aimp )  CALL wAimp      ( kstp )  ! Adaptive-implicit vertical advection partitioning 
    202206      ENDIF 
    203        
    204                          CALL dyn_zdf       ( kstp )  ! vertical diffusion 
    205207 
    206208      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    212214      ! diagnostics and outputs 
    213215      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    214       IF( lk_floats  )   CALL flo_stp ( kstp )        ! drifting Floats 
     216      IF( ln_floats  )   CALL flo_stp ( kstp )        ! drifting Floats 
    215217      IF( ln_diacfl  )   CALL dia_cfl ( kstp )        ! Courant number diagnostics 
    216218      IF( lk_diahth  )   CALL dia_hth ( kstp )        ! Thermocline depth (20 degres isotherm depth) 
    217       IF( lk_diadct  )   CALL dia_dct ( kstp )        ! Transports 
     219      IF( ln_diadct  )   CALL dia_dct ( kstp )        ! Transports 
    218220                         CALL dia_ar5 ( kstp )        ! ar5 diag 
    219       IF( lk_diaharm )   CALL dia_harm( kstp )        ! Tidal harmonic analysis 
     221      IF( ln_diaharm )   CALL dia_harm( kstp )        ! Tidal harmonic analysis 
    220222                         CALL dia_wri ( kstp )        ! ocean model: outputs 
    221223      ! 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/timing.F90

    r10510 r11413  
    347347 
    348348      ! write output file 
     349      IF( lwriter ) WRITE(numtime,*)  
     350      IF( lwriter ) WRITE(numtime,*)  
    349351      IF( lwriter ) WRITE(numtime,*) 'Total timing (sum) :' 
    350352      IF( lwriter ) WRITE(numtime,*) '--------------------' 
     
    657659         ! Compute cpu/elapsed ratio 
    658660         zall_ratio(:) = all_ctime(:) / all_etime(:) 
    659          ztot_ratio    = SUM(zall_ratio(:)) 
    660          zavg_ratio    = ztot_ratio/REAL(jpnij,wp) 
     661         ztot_ratio    = SUM(all_ctime(:))/SUM(all_etime(:)) 
     662         zavg_ratio    = SUM(zall_ratio(:))/REAL(jpnij,wp) 
    661663         zmax_ratio    = MAXVAL(zall_ratio(:)) 
    662664         zmin_ratio    = MINVAL(zall_ratio(:))    
     
    667669         cllignes(2)='1x,"--------------------",//,' 
    668670         cllignes(3)='1x,"Process Rank |"," Elapsed Time (s) |"," CPU Time (s) |"," Ratio CPU/Elapsed",/,' 
    669          cllignes(4)='    (1x,i4,9x,"|",f12.3,6x,"|",f12.3,2x,"|",4x,f7.3,/),' 
    670          WRITE(cllignes(4)(1:4),'(I4)') jpnij 
     671         cllignes(4)='      (4x,i6,4x,"|",f12.3,6x,"|",f12.3,2x,"|",4x,f7.3,/),' 
     672         WRITE(cllignes(4)(1:6),'(I6)') jpnij 
    671673         cllignes(5)='1x,"Total        |",f12.3,6x,"|",F12.3,2x,"|",4x,f7.3,/,' 
    672674         cllignes(6)='1x,"Minimum      |",f12.3,6x,"|",F12.3,2x,"|",4x,f7.3,/,' 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/SAS/diawri.F90

    r11357 r11413  
    137137      !!      define all the NETCDF files and fields 
    138138      !!      At each time step call histdef to compute the mean if ncessary 
    139       !!      Each nwrite time step, output the instantaneous or mean fields 
     139      !!      Each nn_write time step, output the instantaneous or mean fields 
    140140      !!---------------------------------------------------------------------- 
    141141      !! 
     
    152152      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zw3d_abl   ! ABL 3D workspace 
    153153      !!---------------------------------------------------------------------- 
    154       !  
    155       IF( ln_timing )   CALL timing_start('dia_wri') 
    156154      ! 
    157155      ! Output the initial state and forcings 
     
    161159      ENDIF 
    162160      ! 
     161      IF( nn_write == -1 )   RETURN   ! we will never do any output 
     162      !  
     163      IF( ln_timing )   CALL timing_start('dia_wri') 
     164      ! 
    163165      ! 0. Initialisation 
    164166      ! ----------------- 
     
    173175      ENDIF 
    174176#if defined key_diainstant 
    175       zsto = nwrite * rdt 
     177      zsto = nn_write * rdt 
    176178      clop = "inst("//TRIM(clop)//")" 
    177179#else 
     
    179181      clop = "ave("//TRIM(clop)//")" 
    180182#endif 
    181       zout = nwrite * rdt 
     183      zout = nn_write * rdt 
    182184      zmax = ( nitend - nit000 + 1 ) * rdt 
    183185 
     
    211213         ! WRITE root name in date.file for use by postpro 
    212214         IF(lwp) THEN 
    213             CALL dia_nam( clhstnam, nwrite,' ' ) 
     215            CALL dia_nam( clhstnam, nn_write,' ' ) 
    214216            CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    215217            WRITE(inum,*) clhstnam 
     
    219221         ! Define the T grid FILE ( nid_T ) 
    220222 
    221          CALL dia_nam( clhstnam, nwrite, 'grid_T' ) 
     223         CALL dia_nam( clhstnam, nn_write, 'grid_T' ) 
    222224         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
    223225         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
     
    231233         ! Define the U grid FILE ( nid_U ) 
    232234 
    233          CALL dia_nam( clhstnam, nwrite, 'grid_U' ) 
     235         CALL dia_nam( clhstnam, nn_write, 'grid_U' ) 
    234236         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename 
    235237         CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu 
     
    243245         ! Define the V grid FILE ( nid_V ) 
    244246 
    245          CALL dia_nam( clhstnam, nwrite, 'grid_V' )                   ! filename 
     247         CALL dia_nam( clhstnam, nn_write, 'grid_V' )                   ! filename 
    246248         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam 
    247249         CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv 
     
    349351      ! donne le nombre d'elements, et ndex la liste des indices a sortir 
    350352 
    351       IF( lwp .AND. MOD( itmod, nwrite ) == 0 ) THEN  
     353      IF( lwp .AND. MOD( itmod, nn_write ) == 0 ) THEN  
    352354         WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step' 
    353355         WRITE(numout,*) '~~~~~~ ' 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/SAS/nemogcm.F90

    r11348 r11413  
    164164#else 
    165165      IF    ( lk_oasis ) THEN   ;   CALL cpl_finalize   ! end coupling and mpp communications with OASIS 
    166       ELSEIF( lk_mpp   ) THEN   ;   CALL mppstop( ldfinal = .TRUE. )   ! end mpp communications 
     166      ELSEIF( lk_mpp   ) THEN   ;   CALL mppstop        ! end mpp communications 
    167167      ENDIF 
    168168#endif 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/TOP/PISCES/SED/sedrst.F90

    r10425 r11413  
    4949            IF( ln_rst_list ) THEN 
    5050               nrst_lst = 1 
    51                nitrst = nstocklist( nrst_lst ) 
     51               nitrst = nn_stocklist( nrst_lst ) 
    5252            ELSE 
    5353               nitrst = nitend 
    5454            ENDIF 
    5555         ENDIF 
    56          IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nstock ) == 0 ) THEN 
     56         IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nn_stock ) == 0 ) THEN 
    5757            ! we use kt - 1 and not kt - nittrc000 to keep the same periodicity from the beginning of the experiment 
    58             nitrst = kt + nstock - 1                  ! define the next value of nitrst for restart writing 
     58            nitrst = kt + nn_stock - 1                  ! define the next value of nitrst for restart writing 
    5959            IF( nitrst > nitend )   nitrst = nitend   ! make sure we write a restart at the end of the run 
    6060         ENDIF 
     
    6262         IF( kt == nittrc000 ) lrst_sed = .FALSE. 
    6363      ENDIF 
     64 
     65      IF( .NOT. ln_rst_list .AND. nn_stock == -1 )   RETURN   ! we will never do any restart 
    6466 
    6567      ! to get better performances with NetCDF format: 
    6668      ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 
    6769      ! except if we write tracer restart files every tracer time step or if a tracer restart file was writen at nitend - 2*nn_dttrc + 1 
    68       IF( kt == nitrst - 2*nn_dtsed .OR. nstock == nn_dtsed .OR. ( kt == nitend - nn_dtsed .AND. .NOT. lrst_sed ) ) THEN 
     70      IF( kt == nitrst - 2*nn_dtsed .OR. nn_stock == nn_dtsed .OR. ( kt == nitend - nn_dtsed .AND. .NOT. lrst_sed ) ) THEN 
    6971         ! beware of the format used to write kt (default is i8.8, that should be large enough) 
    7072         IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst 
     
    300302          IF( l_offline .AND. ln_rst_list ) THEN 
    301303             nrst_lst = nrst_lst + 1 
    302              nitrst = nstocklist( nrst_lst ) 
     304             nitrst = nn_stocklist( nrst_lst ) 
    303305          ENDIF 
    304306      ENDIF 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/TOP/TRP/trcsink.F90

    r11348 r11413  
    8787         DO jj = 1, jpj 
    8888            DO ji = 1, jpi 
    89                IF( tmask(ji,jj,jk) == 1 ) THEN 
     89               IF( tmask(ji,jj,jk) == 1.0 ) THEN 
    9090                 zwsmax = 0.5 * e3t_n(ji,jj,jk) * rday / rsfact 
    9191                 zwsink(ji,jj,jk) = MIN( pwsink(ji,jj,jk), zwsmax * REAL( iiter(ji,jj), wp ) ) 
     92               ELSE 
     93                 ! provide a default value so there is no use of undefinite value in trc_sink2 for zwsink2 initialization 
     94                 zwsink(ji,jj,jk) = 0. 
    9295               ENDIF 
    9396            END DO 
  • NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/TOP/trcrst.F90

    r10425 r11413  
    5858            IF( ln_rst_list ) THEN 
    5959               nrst_lst = 1 
    60                nitrst = nstocklist( nrst_lst ) 
     60               nitrst = nn_stocklist( nrst_lst ) 
    6161            ELSE 
    6262               nitrst = nitend 
     
    6464         ENDIF 
    6565 
    66          IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nstock ) == 0 ) THEN 
     66         IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nn_stock ) == 0 ) THEN 
    6767            ! we use kt - 1 and not kt - nittrc000 to keep the same periodicity from the beginning of the experiment 
    68             nitrst = kt + nstock - 1                  ! define the next value of nitrst for restart writing 
     68            nitrst = kt + nn_stock - 1                  ! define the next value of nitrst for restart writing 
    6969            IF( nitrst > nitend )   nitrst = nitend   ! make sure we write a restart at the end of the run 
    7070         ENDIF 
     
    7272         IF( kt == nittrc000 ) lrst_trc = .FALSE. 
    7373      ENDIF 
     74 
     75      IF( .NOT. ln_rst_list .AND. nn_stock == -1 )   RETURN   ! we will never do any restart 
    7476 
    7577      ! to get better performances with NetCDF format: 
    7678      ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 
    7779      ! except if we write tracer restart files every tracer time step or if a tracer restart file was writen at nitend - 2*nn_dttrc + 1 
    78       IF( kt == nitrst - 2*nn_dttrc .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 
     80      IF( kt == nitrst - 2*nn_dttrc .OR. nn_stock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 
    7981         ! beware of the format used to write kt (default is i8.8, that should be large enough) 
    8082         IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst 
     
    153155          IF( l_offline .AND. ln_rst_list ) THEN 
    154156             nrst_lst = nrst_lst + 1 
    155              nitrst = nstocklist( nrst_lst ) 
     157             nitrst = nn_stocklist( nrst_lst ) 
    156158          ENDIF 
    157159      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.