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 8486 for branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/icestp.F90 – NEMO

Ignore:
Timestamp:
2017-09-01T15:49:35+02:00 (7 years ago)
Author:
clem
Message:

changes in style - part1 - (now the code looks better txs to Gurvan's comments)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/icestp.F90

    r8426 r8486  
    1717#if defined key_lim3 
    1818   !!---------------------------------------------------------------------- 
    19    !!   'key_lim3' :                                  LIM 3.0 sea-ice model 
    20    !!---------------------------------------------------------------------- 
    21    !!   ice_stp  : sea-ice model time-stepping and update ocean sbc over ice-covered area 
    22    !!---------------------------------------------------------------------- 
    23    USE oce             ! ocean dynamics and tracers 
    24    USE dom_oce         ! ocean space and time domain 
    25    USE ice             ! LIM-3: ice variables 
    26    USE ice1D           ! LIM-3: thermodynamical variables 
     19   !!   'key_lim3'                                    LIM 3.0 sea-ice model 
     20   !!---------------------------------------------------------------------- 
     21   !!   ice_stp       : sea-ice model time-stepping and update ocean surf. boundary cond. over ice-covered area 
     22   !!   ice_init      : 
     23   !!   ice_run_init  :  
     24   !!---------------------------------------------------------------------- 
     25   USE oce            ! ocean dynamics and tracers 
     26   USE dom_oce        ! ocean space and time domain 
     27   USE c1d            ! 1D vertical configuration 
     28   USE ice            ! sea-ice: variables 
     29   USE ice1D          ! sea-ice: thermodynamical 1D variables 
    2730   ! 
    28    USE sbc_oce         ! Surface boundary condition: ocean fields 
    29    USE sbc_ice         ! Surface boundary condition: ice   fields 
    30    USE iceforcing      ! Surface boundary condition for sea ice 
     31   USE sbc_oce        ! Surface boundary condition: ocean fields 
     32   USE sbc_ice        ! Surface boundary condition: ice   fields 
     33   USE iceforcing     ! sea-ice: Surface boundary condition       !!gm why not icesbc module name 
    3134   ! 
    32    USE phycst          ! Define parameters for the routines 
    33    USE eosbn2          ! equation of state 
    34    USE icerhg          ! Ice rheology 
    35    USE iceadv          ! Ice advection 
    36    USE icethd          ! Ice thermodynamics 
    37    USE icerdgrft       ! Ice ridging/rafting 
    38    USE iceupdate       ! sea surface boundary condition 
    39    USE icedia          ! Ice budget diagnostics 
    40    USE icewri          ! Ice outputs 
    41    USE icerst          ! Ice restarts 
    42    USE icecor          ! Ice corrections 
    43    USE icevar          ! Ice variables switch 
    44    USE icectl          ! 
     35   USE phycst         ! Define parameters for the routines 
     36   USE eosbn2         ! equation of state 
     37   USE icerhg         ! sea-ice: rheology 
     38   USE iceadv         ! sea-ice: advection 
     39   USE icethd         ! sea-ice: thermodynamics 
     40   USE icerdgrft      ! sea-ice: ridging/rafting 
     41   USE iceupdate      ! sea-ice: sea surface boundary condition update 
     42   USE icedia         ! sea-ice: budget diagnostics 
     43   USE icewri         ! sea-ice: outputs 
     44   USE icerst         ! sea-ice: restarts 
     45   USE icecor         ! sea-ice: corrections 
     46   USE icevar         ! sea-ice: operations 
     47   USE icectl         ! sea-ice: control 
    4548   ! MV MP 2016 
    46    USE limmp 
     49   USE limmp          ! sea-ice: melt ponds 
    4750   ! END MV MP 2016 
    48    USE iceist          ! LIM initial state 
    49    USE icethd_sal      ! LIM ice thermodynamics: salinity 
     51   USE iceist         ! sea-ice: initial state 
     52   USE icethd_sal     ! sea-ice: thermodynamics and salinity 
    5053   ! 
    51    USE c1d             ! 1D vertical configuration 
    52    USE in_out_manager  ! I/O manager 
    53    USE iom             ! I/O manager library 
    54    USE prtctl          ! Print control 
    55    USE lib_fortran     ! 
    56    USE lbclnk          ! lateral boundary condition - MPP link 
    57    USE lib_mpp         ! MPP library 
    58    USE timing          ! Timing 
    59  
    60    USE bdy_oce   , ONLY: ln_bdy 
    61    USE bdyice          ! unstructured open boundary data 
     54   USE bdy_oce , ONLY : ln_bdy   ! flag for bdy 
     55   USE bdyice         ! unstructured open boundary data for sea-ice 
    6256# if defined key_agrif 
    6357   USE agrif_ice 
     
    6559   USE agrif_lim3_interp 
    6660# endif 
     61   ! 
     62   USE in_out_manager ! I/O manager 
     63   USE iom            ! I/O manager library 
     64   USE prtctl         ! Print control 
     65   USE lib_fortran    !  
     66   USE lbclnk         ! lateral boundary condition - MPP link 
     67   USE lib_mpp        ! MPP library 
     68   USE timing         ! Timing 
    6769 
    6870   IMPLICIT NONE 
    6971   PRIVATE 
    7072 
    71    PUBLIC ice_stp  ! routine called by sbcmod.F90 
    72    PUBLIC ice_init ! routine called by sbcmod.F90 
     73   PUBLIC   ice_stp    ! called by sbcmod.F90 
     74   PUBLIC   ice_init   ! called by sbcmod.F90 
     75 
     76   INTEGER ::              nice_dyn   ! choice of the type of advection scheme 
     77   !                                  ! associated indices: 
     78   INTEGER, PARAMETER ::   np_dynNO   = 0   ! no ice dynamics and ice advection 
     79   INTEGER, PARAMETER ::   np_dynFULL = 1   ! full ice dynamics  (rheology + advection + ridging/rafting + correction) 
     80   INTEGER, PARAMETER ::   np_dyn     = 2   ! no ridging/rafting (rheology + advection                   + correction) 
     81   INTEGER, PARAMETER ::   np_dynPURE = 3   ! pure dynamics      (rheology + advection)  
    7382 
    7483   !! * Substitutions 
    7584#  include "vectopt_loop_substitute.h90" 
    7685   !!---------------------------------------------------------------------- 
    77    !! NEMO/OPA 4.0 , UCL NEMO Consortium (2011) 
     86   !! NEMO/ICE 4.0 , NEMO Consortium (2017) 
    7887   !! $Id: icestp.F90 8319 2017-07-11 15:00:44Z clem $ 
    7988   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    8594      !!                  ***  ROUTINE ice_stp  *** 
    8695      !! 
    87       !! ** Purpose :   update the ocean surface boundary condition via the 
    88       !!                Louvain la Neuve Sea Ice Model time stepping 
     96      !! ** Purpose :   sea-ice model time-stepping and update ocean surface 
     97      !!              boundary condition over ice-covered area 
    8998      !! 
    9099      !! ** Method  :   ice model time stepping 
     
    102111      !!--------------------------------------------------------------------- 
    103112      INTEGER, INTENT(in) ::   kt      ! ocean time step 
    104       INTEGER, INTENT(in) ::   ksbc    ! type of sbc flux ( 1 = user defined formulation,  
    105                                        !                    3 = bulk formulation, 
    106                                        !                    4 = Pure Coupled formulation) 
    107       INTEGER  ::   jl                 ! dummy loop index 
    108       !!---------------------------------------------------------------------- 
    109  
     113      INTEGER, INTENT(in) ::   ksbc    ! flux formulation (user defined, bulk, or Pure Coupled) 
     114      ! 
     115      INTEGER ::   jl   ! dummy loop index 
     116      !!---------------------------------------------------------------------- 
     117      ! 
    110118      IF( nn_timing == 1 )   CALL timing_start('ice_stp') 
    111  
    112       !-----------------------! 
    113       ! --- Ice time step --- ! 
    114       !-----------------------! 
    115       IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN 
    116           
    117          ! Ice model time step 
    118          kt_ice = kt 
    119  
     119      ! 
     120      !                                      !-----------------------! 
     121      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN   ! --- Ice time step --- ! 
     122         !                                   !-----------------------! 
     123         ! 
     124         kt_ice = kt       ! Ice model time step 
     125         ! 
    120126# if defined key_agrif 
    121127         IF( .NOT. Agrif_Root() )  lim_nbstep = MOD( lim_nbstep, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) + 1 
    122128# endif 
    123129 
    124          ! mean surface ocean current at ice velocity point (C-grid dynamics :  U- & V-points as the ocean) 
     130         !                 ! mean surface ocean current at ice velocity point 
    125131         u_oce(:,:) = ssu_m(:,:) * umask(:,:,1) 
    126132         v_oce(:,:) = ssv_m(:,:) * vmask(:,:,1) 
    127  
    128          ! masked sea surface freezing temperature [Kelvin] (set to rt0 over land) 
     133!!gm the umask, vmask above is useless as ssu_m, ssv_m are build from masked un,vn (used t be here for B-grid sea-ice) 
     134 
     135         !                 ! masked sea surface freezing temperature [Kelvin] (set to rt0 over land) 
    129136         CALL eos_fzp( sss_m(:,:) , t_bo(:,:) ) 
    130137         t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) + rt0 * ( 1._wp - tmask(:,:,1) ) 
    131138         ! 
    132                                       CALL ice_bef         ! Store previous ice values 
     139         CALL ice_bef      ! Store previous ice values 
     140         ! 
    133141         !------------------------------------------------! 
    134142         ! --- Dynamical coupling with the atmosphere --- ! 
    135143         !------------------------------------------------! 
    136          ! it provides: 
     144         ! It provides the following fields used in sea ice model: 
    137145         !    utau_ice, vtau_ice = surface ice stress [N/m2] 
    138          !-------------------------------------------------- 
    139                                       CALL ice_forcing_tau( kt, ksbc, utau_ice, vtau_ice ) 
     146         !------------------------------------------------! 
     147         CALL ice_forcing_tau( kt, ksbc, utau_ice, vtau_ice ) 
    140148                                       
    141          !-------------------------------------------------------! 
    142          ! --- ice dynamics and transport (except in 1D case) ---! 
    143          !-------------------------------------------------------! 
    144                                       CALL ice_diag0           ! set diag of mass, heat and salt fluxes to 0 
    145                                       CALL ice_rst_opn( kt )   ! Open Ice restart file 
    146          ! 
    147          ! --- zap this if no ice dynamics --- ! 
    148          IF( .NOT. lk_c1d .AND. ln_limdyn ) THEN 
    149                                       CALL ice_rhg( kt )       ! -- rheology   
    150                                       CALL ice_adv( kt )       ! -- advection 
    151             IF( nn_limdyn == 2 .AND. nn_monocat /= 2 )  &      ! -- ridging/rafting 
    152                &                      CALL ice_rdgrft( kt )          
    153             IF( nn_limdyn == 2 )      CALL ice_cor( kt , 1 )   ! -- Corrections 
    154             ! 
    155          ENDIF 
    156          ! --- 
    157           
     149         !-------------------------------------! 
     150         ! --- ice dynamics and advection  --- ! 
     151         !-------------------------------------! 
     152         CALL ice_diag0             ! set diag of mass, heat and salt fluxes to 0 
     153         CALL ice_rst_opn( kt )     ! Open Ice restart file (if necessary)  
     154         ! 
     155         SELECT CASE( nice_dyn )    
     156         CASE ( np_dynFULL )          !==  all dynamical processes  ==! 
     157            CALL ice_rhg   ( kt )          ! -- rheology   
     158            CALL ice_adv   ( kt )          ! -- advection of ice 
     159            CALL ice_rdgrft( kt )          ! -- ridging/rafting  
     160            CALL ice_cor   ( kt , 1 )      ! -- Corrections 
     161         CASE ( np_dyn )              !==  pure dynamics only ==!   (no ridging/rafting)   (nono cat. case 2) 
     162            CALL ice_rhg   ( kt )          ! -- rheology   
     163            CALL ice_adv   ( kt )          ! -- advection of ice 
     164            CALL ice_cor   ( kt , 1 )      ! -- Corrections 
     165         CASE ( np_dynPURE )          !==  pure dynamics only ==!   (nn_limdyn= 0 or 1 ) 
     166            CALL ice_rhg   ( kt )          ! -- rheology   
     167            CALL ice_adv   ( kt )          ! -- advection of ice 
     168         END SELECT 
     169         ! 
     170         !                          !==  lateral boundary conditions  ==! 
    158171#if defined key_agrif 
    159          IF( .NOT. Agrif_Root() )     CALL agrif_interp_lim3('T') 
     172         IF( .NOT. Agrif_Root()     )   CALL agrif_interp_lim3('T')   ! -- AGRIF  
    160173#endif 
    161          IF( ln_limthd .AND. ln_bdy ) CALL bdy_ice( kt )       ! -- bdy ice thermo  
    162          ! previous lead fraction and ice volume for flux calculations 
    163                                       CALL ice_var_glo2eqv     ! ht_i and ht_s for ice albedo calculation 
    164                                       CALL ice_var_agg(1)      ! at_i for coupling  
    165                                       CALL ice_bef 
     174         IF( ln_limthd .AND. ln_bdy )   CALL bdy_ice( kt )            ! -- bdy ice thermo 
     175         ! 
     176         ! 
     177         !                          !==  previous lead fraction and ice volume for flux calculations 
     178         ! 
     179         CALL ice_var_glo2eqv            ! ht_i and ht_s for ice albedo calculation 
     180         CALL ice_var_agg(1)             ! at_i for coupling  
     181         CALL ice_bef                    ! Store previous ice values 
    166182 
    167183         !------------------------------------------------------! 
     
    169185         !------------------------------------------------------! 
    170186         ! It provides the following fields used in sea ice model: 
    171          !    fr1_i0  , fr2_i0                         = 1sr & 2nd fraction of qsr penetration in ice  [%] 
    172          !    emp_oce , emp_ice                        = E-P over ocean and sea ice                    [Kg/m2/s] 
    173          !    sprecip                                  = solid precipitation                           [Kg/m2/s] 
    174          !    evap_ice                                 = sublimation                                   [Kg/m2/s] 
    175          !    qsr_tot , qns_tot                        = solar & non solar heat flux (total)           [W/m2] 
    176          !    qsr_ice , qns_ice                        = solar & non solar heat flux over ice          [W/m2] 
    177          !    dqns_ice                                 = non solar  heat sensistivity                  [W/m2] 
    178          !    qemp_oce, qemp_ice, qprec_ice, qevap_ice = sensible heat (associated with evap & precip) [W/m2] 
    179          !------------------------------------------------------------------------------------------------------ 
    180                                       CALL ice_forcing_flx( kt, ksbc ) 
     187         !    fr1_i0  , fr2_i0     = 1sr & 2nd fraction of qsr penetration in ice  [%] 
     188         !    emp_oce , emp_ice    = E-P over ocean and sea ice                    [Kg/m2/s] 
     189         !    sprecip              = solid precipitation                           [Kg/m2/s] 
     190         !    evap_ice             = sublimation                                   [Kg/m2/s] 
     191         !    qsr_tot , qns_tot    = solar & non solar heat flux (total)           [W/m2] 
     192         !    qsr_ice , qns_ice    = solar & non solar heat flux over ice          [W/m2] 
     193         !    dqns_ice             = non solar  heat sensistivity                  [W/m2] 
     194         !    qemp_oce, qemp_ice,  = sensible heat (associated with evap & precip) [W/m2] 
     195         !    qprec_ice, qevap_ice 
     196         !------------------------------------------------------! 
     197         CALL ice_forcing_flx( kt, ksbc ) 
    181198 
    182199         !----------------------------! 
    183200         ! --- ice thermodynamics --- ! 
    184201         !----------------------------! 
    185          ! --- zap this if no ice thermo --- ! 
    186          IF( ln_limthd )              CALL ice_thd( kt )        ! -- Ice thermodynamics       
     202         IF( ln_limthd )            CALL ice_thd( kt )          ! -- Ice thermodynamics       
    187203 
    188204         ! MV MP 2016 
    189          IF ( ln_pnd )                CALL lim_mp( kt )         ! -- Melt ponds 
     205         IF ( ln_pnd )              CALL lim_mp( kt )           ! -- Melt ponds 
    190206         ! END MV MP 2016 
    191207 
    192          IF( ln_limthd )              CALL ice_cor( kt , 2 )    ! -- Corrections 
     208         IF( ln_limthd )            CALL ice_cor( kt , 2 )      ! -- Corrections 
    193209         ! --- 
    194210# if defined key_agrif 
    195          IF( .NOT. Agrif_Root() )     CALL agrif_update_lim3( kt ) 
     211         IF( .NOT. Agrif_Root() )   CALL agrif_update_lim3( kt ) 
    196212# endif 
    197                                       CALL ice_var_glo2eqv      ! necessary calls (at least for coupling) 
    198                                       CALL ice_var_agg( 2 )     ! necessary calls (at least for coupling) 
    199                                       ! 
     213                                    CALL ice_var_glo2eqv        ! necessary calls (at least for coupling) 
     214                                    CALL ice_var_agg( 2 )       ! necessary calls (at least for coupling) 
     215                                    ! 
    200216!! clem: one should switch the calculation of the fluxes onto the parent grid but the following calls do not work 
    201217!!       moreover it should only be called at the update frequency (as in agrif_lim3_update.F90) 
     
    203219!!         IF( .NOT. Agrif_Root() )   CALL Agrif_ChildGrid_To_ParentGrid() 
    204220!!# endif 
    205                                       CALL ice_update_flx( kt )    ! -- Update surface ocean mass, heat and salt fluxes 
     221                                    CALL ice_update_flx( kt )   ! -- Update ocean surface mass, heat and salt fluxes 
    206222!!# if defined key_agrif 
    207223!!         IF( .NOT. Agrif_Root() )   CALL Agrif_ParentGrid_To_ChildGrid() 
    208224!!# endif 
    209          IF( ln_limdiahsb )           CALL ice_dia( kt )     ! -- Diagnostics and outputs  
     225         IF( ln_limdiahsb )           CALL ice_dia( kt )        ! -- Diagnostics and outputs  
    210226         ! 
    211227                                      CALL ice_wri( 1 )         ! -- Ice outputs  
    212228         ! 
    213          IF( kt == nit000 .AND. ln_rstart )   & 
     229         IF( kt == nit000 .AND. ln_rstart )   &                !!gm  I don't understand the ln_rstart, if needed, add a comment, please 
    214230            &                         CALL iom_close( numrir )  ! close input ice restart file 
    215231         ! 
     
    287303      IF( ln_limdiahsb) CALL ice_dia_init  ! initialization for diags 
    288304      ! 
    289       fr_i(:,:)     = at_i(:,:)         ! initialisation of sea-ice fraction 
     305      fr_i  (:,:)   = at_i(:,:)         ! initialisation of sea-ice fraction 
    290306      tn_ice(:,:,:) = t_su(:,:,:)       ! initialisation of surface temp for coupled simu 
    291307      ! 
    292308      DO jj = 1, jpj 
    293309         DO ji = 1, jpi 
    294             IF( gphit(ji,jj) > 0._wp ) THEN  ;  rn_amax_2d(ji,jj) = rn_amax_n  ! NH 
    295             ELSE                             ;  rn_amax_2d(ji,jj) = rn_amax_s  ! SH 
     310            IF( gphit(ji,jj) > 0._wp ) THEN   ;   rn_amax_2d(ji,jj) = rn_amax_n  ! NH 
     311            ELSE                              ;   rn_amax_2d(ji,jj) = rn_amax_s  ! SH 
    296312            ENDIF 
    297313         END DO 
     
    318334      !!------------------------------------------------------------------- 
    319335      ! 
    320       REWIND( numnam_ice_ref )              ! Namelist namicerun in reference namelist : Parameters for ice 
     336      REWIND( numnam_ice_ref )      ! Namelist namicerun in reference namelist : Parameters for ice 
    321337      READ  ( numnam_ice_ref, namicerun, IOSTAT = ios, ERR = 901) 
    322338901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in reference namelist', lwp ) 
    323339 
    324       REWIND( numnam_ice_cfg )              ! Namelist namicerun in configuration namelist : Parameters for ice 
     340      REWIND( numnam_ice_cfg )      ! Namelist namicerun in configuration namelist : Parameters for ice 
    325341      READ  ( numnam_ice_cfg, namicerun, IOSTAT = ios, ERR = 902 ) 
    326342902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in configuration namelist', lwp ) 
    327343      IF(lwm) WRITE ( numoni, namicerun ) 
    328344      ! 
    329       REWIND( numnam_ice_ref )              ! Namelist namicediag in reference namelist : Parameters for ice 
     345      REWIND( numnam_ice_ref )      ! Namelist namicediag in reference namelist : Parameters for ice 
    330346      READ  ( numnam_ice_ref, namicediag, IOSTAT = ios, ERR = 903) 
    331347903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicediag in reference namelist', lwp ) 
    332348 
    333       REWIND( numnam_ice_cfg )              ! Namelist namicediag in configuration namelist : Parameters for ice 
     349      REWIND( numnam_ice_cfg )      ! Namelist namicediag in configuration namelist : Parameters for ice 
    334350      READ  ( numnam_ice_cfg, namicediag, IOSTAT = ios, ERR = 904 ) 
    335351904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicediag in configuration namelist', lwp ) 
    336352      IF(lwm) WRITE ( numoni, namicediag ) 
    337353      ! 
    338       IF(lwp) THEN                        ! control print 
     354      IF(lwp) THEN                  ! control print 
    339355         WRITE(numout,*) 
    340356         WRITE(numout,*) 'ice_run_init : ice share parameters for dynamics/advection/thermo of sea-ice' 
    341357         WRITE(numout,*) ' ~~~~~~' 
    342          WRITE(numout,*) '   number of ice  categories                              jpl    = ', jpl 
    343          WRITE(numout,*) '   number of ice  layers                                  nlay_i = ', nlay_i 
    344          WRITE(numout,*) '   number of snow layers                                  nlay_s = ', nlay_s 
    345          WRITE(numout,*) '   virtual ITD mono-category param (1-4) or not (0)   nn_monocat = ', nn_monocat 
    346          WRITE(numout,*) '   maximum ice concentration for NH                              = ', rn_amax_n  
    347          WRITE(numout,*) '   maximum ice concentration for SH                              = ', rn_amax_s 
    348          WRITE(numout,*) '   Ice thermodynamics (T) or not (F)                  ln_limthd  = ', ln_limthd 
    349          WRITE(numout,*) '   Ice dynamics       (T) or not (F)                  ln_limdyn  = ', ln_limdyn 
    350          WRITE(numout,*) '     (ln_limdyn=T) Ice dynamics switch                nn_limdyn  = ', nn_limdyn 
    351          WRITE(numout,*) '       2: total' 
    352          WRITE(numout,*) '       1: advection only (no diffusion, no ridging/rafting)' 
    353          WRITE(numout,*) '       0: advection only (as 1 + prescribed velocity, bypass rheology)' 
    354          WRITE(numout,*) '     (ln_limdyn=T) prescribed u-vel (case nn_limdyn=0)           = ', rn_uice 
    355          WRITE(numout,*) '     (ln_limdyn=T) prescribed v-vel (case nn_limdyn=0)           = ', rn_vice 
     358         WRITE(numout,*) '   Namelist namicerun : ' 
     359         WRITE(numout,*) '      number of ice  categories                              jpl    = ', jpl 
     360         WRITE(numout,*) '      number of ice  layers                                  nlay_i = ', nlay_i 
     361         WRITE(numout,*) '      number of snow layers                                  nlay_s = ', nlay_s 
     362         WRITE(numout,*) '      virtual ITD mono-category param (1-4) or not (0)   nn_monocat = ', nn_monocat 
     363         WRITE(numout,*) '      maximum ice concentration for NH                              = ', rn_amax_n  
     364         WRITE(numout,*) '      maximum ice concentration for SH                              = ', rn_amax_s 
     365         WRITE(numout,*) '      Ice thermodynamics (T) or not (F)                  ln_limthd  = ', ln_limthd 
     366         WRITE(numout,*) '      Ice dynamics       (T) or not (F)                  ln_limdyn  = ', ln_limdyn 
     367         WRITE(numout,*) '         associated switch                               nn_limdyn  = ', nn_limdyn 
     368         WRITE(numout,*) '            =2 all processes (default option)' 
     369         WRITE(numout,*) '            =1 advection only (no ridging/rafting)' 
     370         WRITE(numout,*) '            =0 advection only with prescribed velocity given by ' 
     371         WRITE(numout,*) '               a uniform field        (u,v)_ice = (rn_uice,rn_vice) = (', rn_uice,',', rn_vice,')' 
    356372         WRITE(numout,*) 
    357          WRITE(numout,*) '...and ice diagnostics' 
    358          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~' 
    359          WRITE(numout,*) '   Diagnose online heat/mass/salt budget     ln_limdiachk  = ', ln_limdiachk 
    360          WRITE(numout,*) '   Output          heat/mass/salt budget     ln_limdiahsb  = ', ln_limdiahsb 
    361          WRITE(numout,*) '   control prints in ocean.out for (i,j)=(iiceprt,jiceprt) = ', ln_limctl 
    362          WRITE(numout,*) '   i-index for control prints (ln_limctl=true)             = ', iiceprt 
    363          WRITE(numout,*) '   j-index for control prints (ln_limctl=true)             = ', jiceprt 
     373         WRITE(numout,*) '   Namelist namicediag : ' 
     374         WRITE(numout,*) '      Diagnose online heat/mass/salt budget      ln_limdiachk = ', ln_limdiachk 
     375         WRITE(numout,*) '      Output          heat/mass/salt budget      ln_limdiahsb = ', ln_limdiahsb 
     376         WRITE(numout,*) '      control prints for a given grid point         ln_limctl = ', ln_limctl 
     377         WRITE(numout,*) '         chosen grid point position         (iiceprt,jiceprt) = (', iiceprt,',', jiceprt,')' 
    364378      ENDIF 
    365379      ! 
    366       IF ( ( jpl > 1 ) .AND. ( nn_monocat == 1 ) ) THEN 
     380      !                                         !--- check consistency 
     381      IF ( jpl > 1 .AND. nn_monocat == 1 ) THEN 
    367382         nn_monocat = 0 
    368383         IF(lwp) WRITE(numout,*) 
    369384         IF(lwp) WRITE(numout,*) '   nn_monocat forced to 0 as jpl>1, i.e. multi-category case is chosen' 
    370385      ENDIF 
    371       IF ( ( jpl == 1 ) .AND. ( nn_monocat == 0 ) ) THEN 
     386      IF ( jpl == 1 .AND. nn_monocat == 0 ) THEN 
    372387         CALL ctl_stop( 'STOP', 'ice_run_init : if jpl=1 then nn_monocat should be between 1 and 4' ) 
    373388      ENDIF 
    374389      ! 
    375       ! sea-ice timestep and inverse 
    376       rdt_ice   = REAL(nn_fsbc) * rdt   
    377       r1_rdtice = 1._wp / rdt_ice  
    378  
    379       ! inverse of nlay_i and nlay_s 
    380       r1_nlay_i = 1._wp / REAL( nlay_i, wp ) 
     390      IF( ln_bdy .AND. ln_limdiachk )   CALL ctl_warn('ice_run_init: online conservation check does not work with BDY') 
     391      ! 
     392      !                             ! set the choice of ice dynamics 
     393      IF( lk_c1d .OR. .NOT.ln_limdyn ) THEN 
     394         nice_dyn = np_dynNO                    !--- no dynamics 
     395      ELSE 
     396         SELECT CASE( nn_limdyn ) 
     397         CASE( 2 )                     
     398            IF( nn_monocat /= 2 ) THEN          !--- full dynamics (rheology + advection + ridging/rafting + correction) 
     399               nice_dyn = np_dynFULL 
     400            ELSE 
     401               nice_dyn = np_dyn                !--- dynamics without ridging/rafting 
     402            ENDIF 
     403         CASE( 0 , 1 )                          !--- dynamics without ridging/rafting and correction  
     404            nice_dyn = np_dynPURE 
     405         END SELECT 
     406      ENDIF 
     407      !                                         !--- simple conservative piling, comparable with LIM2 
     408      l_piling = nn_limdyn == 1 .OR. ( nn_monocat == 2  .AND.  jpl == 1 ) 
     409      ! 
     410      rdt_ice   = REAL(nn_fsbc) * rdt           !--- sea-ice timestep and inverse 
     411      r1_rdtice = 1._wp / rdt_ice 
     412      IF( lwp ) WRITE(numout,*) '   ice timestep rdt_ice  = ', rdt_ice 
     413      ! 
     414      r1_nlay_i = 1._wp / REAL( nlay_i, wp )    !--- inverse of nlay_i and nlay_s 
    381415      r1_nlay_s = 1._wp / REAL( nlay_s, wp ) 
    382       ! 
    383       IF( lwp .AND. ln_bdy .AND. ln_limdiachk )  & 
    384          &   CALL ctl_warn('online conservation check activated but it does not work with BDY') 
    385       ! 
    386       IF( lwp ) WRITE(numout,*) '   ice timestep rdt_ice  = ', rdt_ice 
    387416      ! 
    388417   END SUBROUTINE ice_run_init 
     
    397426      !! ** input   :   Namelist namiceitd 
    398427      !!------------------------------------------------------------------- 
    399       INTEGER  ::   ios                 ! Local integer output status for namelist read 
     428      INTEGER  ::   jl    ! dummy loop index 
     429      INTEGER  ::   ios   ! Local integer output status for namelist read 
     430      REAL(wp) ::   zc1, zc2, zc3, zx1          ! local scalars 
     431      REAL(wp) ::   zhmax, znum, zden, zalpha   !   -      - 
     432      !! 
    400433      NAMELIST/namiceitd/ rn_himean 
    401       ! 
    402       INTEGER  ::   jl                   ! dummy loop index 
    403       REAL(wp) ::   zc1, zc2, zc3, zx1   ! local scalars 
    404       REAL(wp) ::   zhmax, znum, zden, zalpha ! 
    405434      !!------------------------------------------------------------------ 
    406435      ! 
    407       REWIND( numnam_ice_ref )              ! Namelist namiceitd in reference namelist : Parameters for ice 
     436      REWIND( numnam_ice_ref )      ! Namelist namiceitd in reference namelist : Parameters for ice 
    408437      READ  ( numnam_ice_ref, namiceitd, IOSTAT = ios, ERR = 905) 
    409438905   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceitd in reference namelist', lwp ) 
    410439 
    411       REWIND( numnam_ice_cfg )              ! Namelist namiceitd in configuration namelist : Parameters for ice 
     440      REWIND( numnam_ice_cfg )      ! Namelist namiceitd in configuration namelist : Parameters for ice 
    412441      READ  ( numnam_ice_cfg, namiceitd, IOSTAT = ios, ERR = 906 ) 
    413442906   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceitd in configuration namelist', lwp ) 
    414443      IF(lwm) WRITE ( numoni, namiceitd ) 
    415444      ! 
    416       IF(lwp) THEN                        ! control print 
     445      IF(lwp) THEN                  ! control print 
    417446         WRITE(numout,*) 
    418447         WRITE(numout,*) 'ice_itd_init : Initialization of ice cat distribution ' 
    419448         WRITE(numout,*) '~~~~~~~~~~~~' 
    420          WRITE(numout,*) '   mean ice thickness in the domain            rn_himean = ', rn_himean 
     449         WRITE(numout,*) '   Namelist namicerun : ' 
     450         WRITE(numout,*) '      mean ice thickness in the domain               rn_himean = ', rn_himean 
    421451      ENDIF 
    422452      ! 
    423       !---------------------------------- 
    424       !- Thickness categories boundaries 
    425       !---------------------------------- 
    426       ! 
    427       !==  h^(-alpha) function  ==! 
    428       zalpha = 0.05_wp 
     453      !-----------------------------------! 
     454      !  Thickness categories boundaries  ! 
     455      !-----------------------------------! 
     456      ! 
     457      zalpha = 0.05_wp              ! max of each category (from h^(-alpha) function) 
    429458      zhmax  = 3._wp * rn_himean 
    430459      DO jl = 1, jpl 
     
    441470      ! 
    442471      IF(lwp) WRITE(numout,*) 
    443       IF(lwp) WRITE(numout,*) '      Thickness category boundaries ' 
    444       IF(lwp) WRITE(numout,*) '         hi_max ', hi_max(0:jpl) 
     472      IF(lwp) WRITE(numout,*) '   ===>>>   resulting thickness category boundaries :' 
     473      IF(lwp) WRITE(numout,*) '            hi_max(:)= ', hi_max(0:jpl) 
    445474      ! 
    446475   END SUBROUTINE ice_itd_init 
     476 
    447477 
    448478   SUBROUTINE ice_bef 
     
    472502         END DO    
    473503      END DO 
    474       CALL lbc_lnk_multi( a_i_b, 'T', 1., v_i_b , 'T', 1., v_s_b , 'T', 1., smv_i_b, 'T', 1., & 
    475          &               oa_i_b, 'T', 1., ht_i_b, 'T', 1., ht_s_b, 'T', 1. ) 
     504      CALL lbc_lnk_multi(  a_i_b, 'T', 1., v_i_b , 'T', 1., ht_i_b, 'T', 1., smv_i_b, 'T', 1.,  & 
     505         &                oa_i_b, 'T', 1., v_s_b , 'T', 1., ht_s_b, 'T', 1. ) 
    476506      CALL lbc_lnk( e_i_b, 'T', 1. ) 
    477507      CALL lbc_lnk( e_s_b, 'T', 1. ) 
    478508       
     509!!gm Question:  here , a_i_b, u_ice and v_ice  are defined over the whole domain,  
     510!!gm            so why not just a copy over the whole domain and no lbc_lnk ? 
     511!!gm            that is some thing like: 
     512!            at_i_b(:,:)  = SUM( a_i_b(:,:,:), dim=3 ) 
     513!            u_ice_b(:,:) = u_ice(:,:) 
     514!            v_ice_b(:,:) = v_ice(:,:) 
     515!    idem for the loop above 
     516!!gm 
    479517      ! ice velocities & total concentration 
    480518      DO jj = 2, jpjm1 
     
    486524      END DO 
    487525      CALL lbc_lnk_multi( at_i_b, 'T', 1., u_ice_b , 'U', -1., v_ice_b , 'V', -1. ) 
    488        
     526      ! 
    489527   END SUBROUTINE ice_bef 
    490528 
     
    552590   !!---------------------------------------------------------------------- 
    553591CONTAINS 
    554    ! 
    555592   SUBROUTINE ice_stp ( kt, ksbc )     ! Dummy routine 
    556593      INTEGER, INTENT(in) ::   kt, ksbc 
    557594      WRITE(*,*) 'ice_stp: You should not have seen this print! error?', kt 
    558595   END SUBROUTINE ice_stp 
    559    ! 
    560596   SUBROUTINE ice_init                 ! Dummy routine 
    561597   END SUBROUTINE ice_init 
Note: See TracChangeset for help on using the changeset viewer.