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 14072 for NEMO/trunk/src/ICE – NEMO

Changeset 14072 for NEMO/trunk/src/ICE


Ignore:
Timestamp:
2020-12-04T08:48:38+01:00 (3 years ago)
Author:
laurent
Message:

Merging branch "2020/dev_r13648_ASINTER-04_laurent_bulk_ice", ticket #2369

Location:
NEMO/trunk/src/ICE
Files:
22 edited
2 copied

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/ICE/ice.F90

    r14006 r14072  
    6464   !! sv_i        |      -      |    Sea ice salt content         | pss.m | 
    6565   !! oa_i        |      -      |    Sea ice areal age content    | s     | 
    66    !! e_i         |             |    Ice enthalpy                 | J/m2  |  
    67    !!             |    e_i_1d   |    Ice enthalpy per unit vol.   | J/m3  |  
    68    !! e_s         |             |    Snow enthalpy                | J/m2  |  
    69    !!             |    e_s_1d   |    Snow enthalpy per unit vol.  | J/m3  |  
     66   !! e_i         |             |    Ice enthalpy                 | J/m2  | 
     67   !!             |    e_i_1d   |    Ice enthalpy per unit vol.   | J/m3  | 
     68   !! e_s         |             |    Snow enthalpy                | J/m2  | 
     69   !!             |    e_s_1d   |    Snow enthalpy per unit vol.  | J/m3  | 
    7070   !! a_ip        |      -      |    Ice pond concentration       |       | 
    7171   !! v_ip        |      -      |    Ice pond volume per unit area| m     | 
     
    108108   !! tm_i        |      -      |    Mean sea ice temperature     | K     | 
    109109   !! tm_s        |      -      |    Mean snow    temperature     | K     | 
    110    !! et_i        |      -      |    Total ice enthalpy           | J/m2  |  
    111    !! et_s        |      -      |    Total snow enthalpy          | J/m2  |  
    112    !! bv_i        |      -      |    relative brine volume        | ???   |  
     110   !! et_i        |      -      |    Total ice enthalpy           | J/m2  | 
     111   !! et_s        |      -      |    Total snow enthalpy          | J/m2  | 
     112   !! bv_i        |      -      |    relative brine volume        | ???   | 
    113113   !! at_ip       |      -      |    Total ice pond concentration |       | 
    114114   !! hm_ip       |      -      |    Mean ice pond depth          | m     | 
     
    122122   !!---------------------------------------------------------------------- 
    123123   !                                     !!** ice-generic parameters namelist (nampar) ** 
    124    INTEGER           , PUBLIC ::   jpl              !: number of ice  categories  
    125    INTEGER           , PUBLIC ::   nlay_i           !: number of ice  layers  
    126    INTEGER           , PUBLIC ::   nlay_s           !: number of snow layers  
     124   INTEGER           , PUBLIC ::   jpl              !: number of ice  categories 
     125   INTEGER           , PUBLIC ::   nlay_i           !: number of ice  layers 
     126   INTEGER           , PUBLIC ::   nlay_s           !: number of snow layers 
    127127   LOGICAL           , PUBLIC ::   ln_virtual_itd   !: virtual ITD mono-category parameterization (T) or not (F) 
    128128   LOGICAL           , PUBLIC ::   ln_icedyn        !: flag for ice dynamics (T) or not (F) 
     
    137137   !                                     !!** ice-itd namelist (namitd) ** 
    138138   REAL(wp), PUBLIC ::   rn_himin         !: minimum ice thickness 
    139     
     139 
    140140   !                                     !!** ice-dynamics namelist (namdyn) ** 
    141141   REAL(wp), PUBLIC ::   rn_ishlat        !: lateral boundary condition for sea-ice 
    142    LOGICAL , PUBLIC ::   ln_landfast_L16  !: landfast ice parameterizationfrom lemieux2016  
     142   LOGICAL , PUBLIC ::   ln_landfast_L16  !: landfast ice parameterizationfrom lemieux2016 
    143143   REAL(wp), PUBLIC ::   rn_lf_depfra     !:    fraction of ocean depth that ice must reach to initiate landfast ice 
    144    REAL(wp), PUBLIC ::   rn_lf_bfr        !:    maximum bottom stress per unit area of contact (lemieux2016) or per unit volume (home)  
     144   REAL(wp), PUBLIC ::   rn_lf_bfr        !:    maximum bottom stress per unit area of contact (lemieux2016) or per unit volume (home) 
    145145   REAL(wp), PUBLIC ::   rn_lf_relax      !:    relaxation time scale (s-1) to reach static friction 
    146146   REAL(wp), PUBLIC ::   rn_lf_tensile    !:    isotropic tensile strength 
     
    153153   LOGICAL , PUBLIC ::   ln_rhg_EVP       ! EVP rheology switch, used for rdgrft and rheology 
    154154   LOGICAL , PUBLIC ::   ln_rhg_EAP       ! EAP rheology switch, used for rdgrft and rheology 
    155    LOGICAL , PUBLIC ::   ln_aEVP          !: using adaptive EVP (T or F)  
     155   LOGICAL , PUBLIC ::   ln_aEVP          !: using adaptive EVP (T or F) 
    156156   REAL(wp), PUBLIC ::   rn_creepl        !: creep limit (has to be low enough, circa 10-9 m/s, depending on rheology) 
    157157   REAL(wp), PUBLIC ::   rn_ecc           !: eccentricity of the elliptical yield curve 
    158158   INTEGER , PUBLIC ::   nn_nevp          !: number of iterations for subcycling 
    159    REAL(wp), PUBLIC ::   rn_relast        !: ratio => telast/rDt_ice (1/3 or 1/9 depending on nb of subcycling nevp)  
    160    INTEGER , PUBLIC ::   nn_rhg_chkcvg    !: check ice rheology convergence  
     159   REAL(wp), PUBLIC ::   rn_relast        !: ratio => telast/rDt_ice (1/3 or 1/9 depending on nb of subcycling nevp) 
     160   INTEGER , PUBLIC ::   nn_rhg_chkcvg    !: check ice rheology convergence 
    161161   ! -- vp 
    162162   LOGICAL , PUBLIC ::   ln_rhg_VP        !: VP rheology 
     
    181181   INTEGER , PUBLIC ::   nn_flxdist       !: Redistribute heat flux over ice categories 
    182182   !                                      !   =-1  Do nothing (needs N(cat) fluxes) 
    183    !                                      !   = 0  Average N(cat) fluxes then apply the average over the N(cat) ice  
     183   !                                      !   = 0  Average N(cat) fluxes then apply the average over the N(cat) ice 
    184184   !                                      !   = 1  Average N(cat) fluxes then redistribute over the N(cat) ice using T-ice and albedo sensitivity 
    185185   !                                      !   = 2  Redistribute a single flux over categories 
    186186                                          ! -- icethd_zdf -- ! 
    187    LOGICAL , PUBLIC ::   ln_cndflx        !: use conduction flux as surface boundary condition (instead of qsr and qns)  
    188    LOGICAL , PUBLIC ::   ln_cndemulate    !: emulate conduction flux (if not provided)  
     187   LOGICAL , PUBLIC ::   ln_cndflx        !: use conduction flux as surface boundary condition (instead of qsr and qns) 
     188   LOGICAL , PUBLIC ::   ln_cndemulate    !: emulate conduction flux (if not provided) 
    189189   !                                      ! Conduction flux as surface forcing or not 
    190190   INTEGER, PUBLIC, PARAMETER ::   np_cnd_OFF = 0  !: no forcing from conduction flux (ice thermodynamics forced via qsr and qns) 
     
    192192   INTEGER, PUBLIC, PARAMETER ::   np_cnd_EMU = 2  !: emulate conduction flux via icethd_zdf.F90 (BL99) (1st round compute qcn and qsr_tr, 2nd round use it) 
    193193   INTEGER, PUBLIC ::   nn_qtrice         !: Solar flux transmitted thru the surface scattering layer: 
    194    !                                      !   = 0  Grenfell and Maykut 1977 (depends on cloudiness and is 0 when there is snow)  
     194   !                                      !   = 0  Grenfell and Maykut 1977 (depends on cloudiness and is 0 when there is snow) 
    195195   !                                      !   = 1  Lebrun 2019 (equals 0.3 anytime with different melting/dry snw conductivities) 
    196196   ! 
     
    198198   LOGICAL , PUBLIC ::   ln_cndi_U64      !: thermal conductivity: Untersteiner (1964) 
    199199   LOGICAL , PUBLIC ::   ln_cndi_P07      !: thermal conductivity: Pringle et al (2007) 
    200    REAL(wp), PUBLIC ::   rn_cnd_s         !: thermal conductivity of the snow [W/m/K]    
     200   REAL(wp), PUBLIC ::   rn_cnd_s         !: thermal conductivity of the snow [W/m/K] 
    201201   REAL(wp), PUBLIC ::   rn_kappa_i       !: coef. for the extinction of radiation in sea ice, Grenfell et al. (2006) [1/m] 
    202202   REAL(wp), PUBLIC ::   rn_kappa_s       !: coef. for the extinction of radiation in snw (nn_qtrice=0) [1/m] 
     
    236236   INTEGER , PUBLIC ::   jiceprt          !: debug j-point 
    237237 
    238    !                                     !!** some other parameters  
     238   !                                     !!** some other parameters 
    239239   INTEGER , PUBLIC ::   kt_ice           !: iteration number 
    240240   REAL(wp), PUBLIC ::   rDt_ice          !: ice time step 
    241241   REAL(wp), PUBLIC ::   r1_Dt_ice        !: = 1. / rDt_ice 
    242242   REAL(wp), PUBLIC ::   r1_nlay_i        !: 1 / nlay_i 
    243    REAL(wp), PUBLIC ::   r1_nlay_s        !: 1 / nlay_s  
     243   REAL(wp), PUBLIC ::   r1_nlay_s        !: 1 / nlay_s 
    244244   REAL(wp), PUBLIC ::   rswitch          !: switch for the presence of ice (1) or not (0) 
    245245   REAL(wp), PUBLIC ::   rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft   !: conservation diagnostics 
    246    REAL(wp), PUBLIC, PARAMETER ::   epsi06 = 1.e-06_wp  !: small number  
    247    REAL(wp), PUBLIC, PARAMETER ::   epsi10 = 1.e-10_wp  !: small number  
    248    REAL(wp), PUBLIC, PARAMETER ::   epsi20 = 1.e-20_wp  !: small number  
     246   REAL(wp), PUBLIC, PARAMETER ::   epsi06 = 1.e-06_wp  !: small number 
     247   REAL(wp), PUBLIC, PARAMETER ::   epsi10 = 1.e-10_wp  !: small number 
     248   REAL(wp), PUBLIC, PARAMETER ::   epsi20 = 1.e-20_wp  !: small number 
    249249 
    250250   !                                     !!** define arrays 
     
    259259   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdg_conv 
    260260   ! 
    261    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   t_bo            !: Sea-Ice bottom temperature [Kelvin]      
     261   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   t_bo            !: Sea-Ice bottom temperature [Kelvin] 
    262262   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   qlead           !: heat balance of the lead (or of the open ocean) 
    263263   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   qsb_ice_bot     !: net downward heat flux from the ice to the ocean 
     
    306306   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   qt_atm_oi       !: heat flux at the interface atm-[oce+ice]            [W.m-2] 
    307307   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   qt_oce_ai       !: heat flux at the interface oce-[atm+ice]            [W.m-2] 
    308     
     308 
    309309   ! heat flux associated with ice-atmosphere mass exchange 
    310310   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hfx_sub         !: heat flux for sublimation            [W.m-2] 
     
    389389   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   u_ice_b, v_ice_b           !: ice velocity 
    390390   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   at_i_b                     !: ice concentration (total) 
    391              
     391 
    392392   !!---------------------------------------------------------------------- 
    393393   !! * Ice thickness distribution variables 
    394394   !!---------------------------------------------------------------------- 
    395395   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_max            !: Boundary of ice thickness categories in thickness space 
    396    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_mean           !: Mean ice thickness in catgories  
     396   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_mean           !: Mean ice thickness in catgories 
    397397   ! 
    398398   !!---------------------------------------------------------------------- 
     
    405405   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_trp_sv       !: transport of salt content 
    406406   ! 
    407    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_heat         !: snw/ice heat content variation   [W/m2]  
    408    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_sice         !: ice salt content variation   []  
    409    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vice         !: ice volume variation   [m/s]  
    410    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vsnw         !: snw volume variation   [m/s]  
    411    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_aice         !: ice conc.  variation   [s-1]  
    412    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vpnd         !: pond volume variation  [m/s]  
     407   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_heat         !: snw/ice heat content variation   [W/m2] 
     408   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_sice         !: ice salt content variation   [] 
     409   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vice         !: ice volume variation   [m/s] 
     410   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vsnw         !: snw volume variation   [m/s] 
     411   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_aice         !: ice conc.  variation   [s-1] 
     412   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_vpnd         !: pond volume variation  [m/s] 
    413413   ! 
    414414   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   diag_adv_mass     !: advection of mass (kg/m2/s) 
     
    430430   !!---------------------------------------------------------------------- 
    431431   ! Extra sea ice diagnostics to address the data request 
    432    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   t_si            !: Temperature at Snow-ice interface (K)  
    433    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   tm_si           !: mean temperature at the snow-ice interface (K)  
     432   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   t_si            !: Temperature at Snow-ice interface (K) 
     433   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   tm_si           !: mean temperature at the snow-ice interface (K) 
    434434   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qcn_ice_bot     !: Bottom  conduction flux (W/m2) 
    435435   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qcn_ice_top     !: Surface conduction flux (W/m2) 
     
    469469         &      sfx_res    (jpi,jpj) , sfx_bri   (jpi,jpj) , sfx_dyn(jpi,jpj) , sfx_sub(jpi,jpj) , sfx_lam(jpi,jpj) ,  & 
    470470         &      sfx_bog    (jpi,jpj) , sfx_bom   (jpi,jpj) , sfx_sum(jpi,jpj) , sfx_sni(jpi,jpj) , sfx_opw(jpi,jpj) ,  & 
    471          &      hfx_res    (jpi,jpj) , hfx_snw   (jpi,jpj) , hfx_sub(jpi,jpj) ,                        &  
     471         &      hfx_res    (jpi,jpj) , hfx_snw   (jpi,jpj) , hfx_sub(jpi,jpj) ,                        & 
    472472         &      qt_atm_oi  (jpi,jpj) , qt_oce_ai (jpi,jpj) , fhld   (jpi,jpj) ,                        & 
    473473         &      hfx_sum    (jpi,jpj) , hfx_bom   (jpi,jpj) , hfx_bog(jpi,jpj) , hfx_dif(jpi,jpj) ,     & 
     
    513513      ii = ii + 1 
    514514      ALLOCATE( u_ice_b(jpi,jpj) , v_ice_b(jpi,jpj) , at_i_b(jpi,jpj) , STAT=ierr(ii) ) 
    515        
     515 
    516516      ! * Ice thickness distribution variables 
    517517      ii = ii + 1 
     
    520520      ! * Ice diagnostics 
    521521      ii = ii + 1 
    522       ALLOCATE( diag_trp_vi(jpi,jpj) , diag_trp_vs (jpi,jpj) , diag_trp_ei(jpi,jpj),                      &  
     522      ALLOCATE( diag_trp_vi(jpi,jpj) , diag_trp_vs (jpi,jpj) , diag_trp_ei(jpi,jpj),                      & 
    523523         &      diag_trp_es(jpi,jpj) , diag_trp_sv (jpi,jpj) , diag_heat  (jpi,jpj),                      & 
    524524         &      diag_sice  (jpi,jpj) , diag_vice   (jpi,jpj) , diag_vsnw  (jpi,jpj), diag_aice(jpi,jpj), diag_vpnd(jpi,jpj),  & 
     
    527527      ! * Ice conservation 
    528528      ii = ii + 1 
    529       ALLOCATE( diag_v (jpi,jpj) , diag_s (jpi,jpj) , diag_t (jpi,jpj),   &  
     529      ALLOCATE( diag_v (jpi,jpj) , diag_s (jpi,jpj) , diag_t (jpi,jpj),   & 
    530530         &      diag_fv(jpi,jpj) , diag_fs(jpi,jpj) , diag_ft(jpi,jpj), STAT=ierr(ii) ) 
    531        
     531 
    532532      ! * SIMIP diagnostics 
    533533      ii = ii + 1 
  • NEMO/trunk/src/ICE/icectl.F90

    r14005 r14072  
    1212   !!   'key_si3'                                       SI3 sea-ice model 
    1313   !!---------------------------------------------------------------------- 
    14    !!    ice_cons_hsm     : conservation tests on heat, salt and mass during a  time step (global)  
     14   !!    ice_cons_hsm     : conservation tests on heat, salt and mass during a  time step (global) 
    1515   !!    ice_cons_final   : conservation tests on heat, salt and mass at end of time step (global) 
    1616   !!    ice_cons2D       : conservation tests on heat, salt and mass at each gridcell 
     
    5555   CHARACTER(LEN=50)   ::   clname="icedrift_diagnostics.ascii"   ! ascii filename 
    5656   INTEGER             ::   numicedrift                           ! outfile unit 
    57    REAL(wp)            ::   rdiag_icemass, rdiag_icesalt, rdiag_iceheat  
    58    REAL(wp)            ::   rdiag_adv_icemass, rdiag_adv_icesalt, rdiag_adv_iceheat  
    59     
     57   REAL(wp)            ::   rdiag_icemass, rdiag_icesalt, rdiag_iceheat 
     58   REAL(wp)            ::   rdiag_adv_icemass, rdiag_adv_icesalt, rdiag_adv_iceheat 
     59 
    6060   !! * Substitutions 
    6161#  include "do_loop_substitute.h90" 
     
    7777      !!              It prints in ocean.output if there is a violation of conservation at each time-step 
    7878      !!              The thresholds (zchk_m, zchk_s, zchk_t) determine violations 
    79       !!              For salt and heat thresholds, ice is considered to have a salinity of 10  
    80       !!              and a heat content of 3e5 J/kg (=latent heat of fusion)  
     79      !!              For salt and heat thresholds, ice is considered to have a salinity of 10 
     80      !!              and a heat content of 3e5 J/kg (=latent heat of fusion) 
    8181      !!------------------------------------------------------------------- 
    8282      INTEGER         , INTENT(in)    ::   icount        ! called at: =0 the begining of the routine, =1  the end 
     
    148148         zetrp = glob_sum( 'icectl', diag_adv_heat * e1e2t ) 
    149149 
    150          ! ice area (+epsi10 to set a threshold > 0 when there is no ice)  
     150         ! ice area (+epsi10 to set a threshold > 0 when there is no ice) 
    151151         zarea = glob_sum( 'icectl', SUM( a_i + epsi10, dim=3 ) * e1e2t ) 
    152152 
     
    191191      !!              It prints in ocean.output if there is a violation of conservation at each time-step 
    192192      !!              The thresholds (zchk_m, zchk_s, zchk_t) determine the violations 
    193       !!              For salt and heat thresholds, ice is considered to have a salinity of 10  
    194       !!              and a heat content of 3e5 J/kg (=latent heat of fusion)  
     193      !!              For salt and heat thresholds, ice is considered to have a salinity of 10 
     194      !!              and a heat content of 3e5 J/kg (=latent heat of fusion) 
    195195      !!------------------------------------------------------------------- 
    196196      CHARACTER(len=*), INTENT(in) ::   cd_routine    ! name of the routine 
     
    214214      !!   &                                          ) * e1e2t ) 
    215215 
    216       ! ice area (+epsi10 to set a threshold > 0 when there is no ice)  
     216      ! ice area (+epsi10 to set a threshold > 0 when there is no ice) 
    217217      zarea = glob_sum( 'icectl', SUM( a_i + epsi10, dim=3 ) * e1e2t ) 
    218218 
     
    243243      !! 
    244244      REAL(wp), DIMENSION(jpi,jpj) ::   zdiag_mass, zdiag_salt, zdiag_heat, & 
    245          &                              zdiag_amin, zdiag_vmin, zdiag_smin, zdiag_emin !!, zdiag_amax   
     245         &                              zdiag_amin, zdiag_vmin, zdiag_smin, zdiag_emin !!, zdiag_amax 
    246246      INTEGER ::   jl, jk 
    247247      LOGICAL ::   ll_stop_m = .FALSE. 
     
    261261            &       wfx_snw_sni + wfx_snw_sum + wfx_snw_dyn + wfx_snw_sub + wfx_ice_sub + wfx_spr 
    262262         ! salt flux 
    263          pdiag_fs = sfx_bri + sfx_bog + sfx_bom + sfx_sum + sfx_sni + sfx_opw + sfx_res + sfx_dyn + sfx_sub + sfx_lam  
     263         pdiag_fs = sfx_bri + sfx_bog + sfx_bom + sfx_sum + sfx_sni + sfx_opw + sfx_res + sfx_dyn + sfx_sub + sfx_lam 
    264264         ! heat flux 
    265          pdiag_ft =   hfx_sum + hfx_bom + hfx_bog + hfx_dif + hfx_opw + hfx_snw  &  
     265         pdiag_ft =   hfx_sum + hfx_bom + hfx_bog + hfx_dif + hfx_opw + hfx_snw  & 
    266266            &       - hfx_thd - hfx_dyn - hfx_res - hfx_sub - hfx_spr 
    267267 
     
    283283         ! -- heat diag -- ! 
    284284         zdiag_heat =   ( SUM( SUM( e_i, dim=4 ), dim=3 ) + SUM( SUM( e_s, dim=4 ), dim=3 ) - pdiag_t ) * r1_Dt_ice & 
    285             &         + (  hfx_sum + hfx_bom + hfx_bog + hfx_dif + hfx_opw + hfx_snw                                &  
     285            &         + (  hfx_sum + hfx_bom + hfx_bog + hfx_dif + hfx_opw + hfx_snw                                & 
    286286            &            - hfx_thd - hfx_dyn - hfx_res - hfx_sub - hfx_spr )                                        & 
    287287            &         - pdiag_ft 
     
    324324         IF( ll_stop_s )   CALL ctl_stop( 'STOP', cd_routine//': ice salt conservation issue' ) 
    325325         IF( ll_stop_t )   CALL ctl_stop( 'STOP', cd_routine//': ice heat conservation issue' ) 
    326           
     326 
    327327      ENDIF 
    328328 
     
    332332      !!--------------------------------------------------------------------- 
    333333      !!                 ***  ROUTINE ice_cons_wri  *** 
    334       !!         
    335       !! ** Purpose :   create a NetCDF file named cdfile_name which contains  
     334      !! 
     335      !! ** Purpose :   create a NetCDF file named cdfile_name which contains 
    336336      !!                the instantaneous fields when conservation issue occurs 
    337337      !! 
     
    340340      CHARACTER(len=*), INTENT( in ) ::   cdfile_name      ! name of the file created 
    341341      REAL(wp), DIMENSION(:,:), INTENT( in ) ::   pdiag_mass, pdiag_salt, pdiag_heat, & 
    342          &                                        pdiag_amin, pdiag_vmin, pdiag_smin, pdiag_emin !!, pdiag_amax   
     342         &                                        pdiag_amin, pdiag_vmin, pdiag_smin, pdiag_emin !!, pdiag_amax 
    343343      !! 
    344344      INTEGER ::   inum 
    345345      !!---------------------------------------------------------------------- 
    346       !  
     346      ! 
    347347      IF(lwp) WRITE(numout,*) 
    348348      IF(lwp) WRITE(numout,*) 'ice_cons_wri : single instantaneous ice state' 
    349349      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~  named :', cdfile_name, '...nc' 
    350       IF(lwp) WRITE(numout,*)                 
     350      IF(lwp) WRITE(numout,*) 
    351351 
    352352      CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 
    353        
     353 
    354354      CALL iom_rstput( 0, 0, inum, 'cons_mass', pdiag_mass(:,:) , ktype = jp_r8 )    ! ice mass spurious lost/gain 
    355355      CALL iom_rstput( 0, 0, inum, 'cons_salt', pdiag_salt(:,:) , ktype = jp_r8 )    ! ice salt spurious lost/gain 
    356356      CALL iom_rstput( 0, 0, inum, 'cons_heat', pdiag_heat(:,:) , ktype = jp_r8 )    ! ice heat spurious lost/gain 
    357357      ! other diags 
    358       CALL iom_rstput( 0, 0, inum, 'aneg_count', pdiag_amin(:,:) , ktype = jp_r8 )    !  
    359       CALL iom_rstput( 0, 0, inum, 'vneg_count', pdiag_vmin(:,:) , ktype = jp_r8 )    !  
    360       CALL iom_rstput( 0, 0, inum, 'sneg_count', pdiag_smin(:,:) , ktype = jp_r8 )    !  
    361       CALL iom_rstput( 0, 0, inum, 'eneg_count', pdiag_emin(:,:) , ktype = jp_r8 )    !  
     358      CALL iom_rstput( 0, 0, inum, 'aneg_count', pdiag_amin(:,:) , ktype = jp_r8 )    ! 
     359      CALL iom_rstput( 0, 0, inum, 'vneg_count', pdiag_vmin(:,:) , ktype = jp_r8 )    ! 
     360      CALL iom_rstput( 0, 0, inum, 'sneg_count', pdiag_smin(:,:) , ktype = jp_r8 )    ! 
     361      CALL iom_rstput( 0, 0, inum, 'eneg_count', pdiag_emin(:,:) , ktype = jp_r8 )    ! 
    362362      ! mean state 
    363363      CALL iom_rstput( 0, 0, inum, 'icecon'    , SUM(a_i ,dim=3) , ktype = jp_r8 )    ! 
     
    366366      CALL iom_rstput( 0, 0, inum, 'pndvol'    , SUM(v_ip,dim=3) , ktype = jp_r8 )    ! 
    367367      CALL iom_rstput( 0, 0, inum, 'lidvol'    , SUM(v_il,dim=3) , ktype = jp_r8 )    ! 
    368        
     368 
    369369      CALL iom_close( inum ) 
    370370 
    371371   END SUBROUTINE ice_cons_wri 
    372     
     372 
    373373   SUBROUTINE ice_ctl( kt ) 
    374374      !!------------------------------------------------------------------- 
    375       !!                   ***  ROUTINE ice_ctl ***  
    376       !!                  
     375      !!                   ***  ROUTINE ice_ctl *** 
     376      !! 
    377377      !! ** Purpose :   control checks 
    378378      !!------------------------------------------------------------------- 
     
    386386      inb_alp(:) = 0 
    387387      ialert_id = 0 
    388        
     388 
    389389      ! Alert if very high salinity 
    390390      ialert_id = ialert_id + 1 ! reference number of this alert 
     
    430430         END_3D 
    431431      END DO 
    432    
     432 
    433433      ! Alert if very warm ice 
    434434      ialert_id = ialert_id + 1 ! reference number of this alert 
     
    444444         END_3D 
    445445      END DO 
    446        
     446 
    447447      ! Alerte if very thick ice 
    448448      ialert_id = ialert_id + 1 ! reference number of this alert 
    449449      cl_alname(ialert_id) = ' Very thick ice ' ! name of the alert 
    450       jl = jpl  
     450      jl = jpl 
    451451      DO_2D( 1, 1, 1, 1 ) 
    452452         IF( h_i(ji,jj,jl) > 50._wp ) THEN 
     
    460460      ialert_id = ialert_id + 1 ! reference number of this alert 
    461461      cl_alname(ialert_id) = ' Very thin ice ' ! name of the alert 
    462       jl = 1  
     462      jl = 1 
    463463      DO_2D( 1, 1, 1, 1 ) 
    464464         IF( h_i(ji,jj,jl) < rn_himin ) THEN 
     
    484484      cl_alname(ialert_id) = ' Ice on continents ' ! name of the alert 
    485485      DO_2D( 1, 1, 1, 1 ) 
    486          IF( tmask(ji,jj,1) == 0._wp .AND. ( at_i(ji,jj) > 0._wp .OR. vt_i(ji,jj) > 0._wp ) ) THEN  
     486         IF( tmask(ji,jj,1) == 0._wp .AND. ( at_i(ji,jj) > 0._wp .OR. vt_i(ji,jj) > 0._wp ) ) THEN 
    487487            WRITE(numout,*) ' ALERTE :   Ice on continents ',at_i(ji,jj),vt_i(ji,jj) 
    488488            WRITE(numout,*) ' at i,j = ',ji,jj 
     
    496496      DO_2D( 1, 1, 1, 1 ) 
    497497         IF(  ( vt_i(ji,jj) == 0._wp .AND. at_i(ji,jj) >  0._wp ) .OR. & 
    498             & ( vt_i(ji,jj) >  0._wp .AND. at_i(ji,jj) == 0._wp ) ) THEN  
     498            & ( vt_i(ji,jj) >  0._wp .AND. at_i(ji,jj) == 0._wp ) ) THEN 
    499499            WRITE(numout,*) ' ALERTE :   Incompatible ice conc and vol ',at_i(ji,jj),vt_i(ji,jj) 
    500500            WRITE(numout,*) ' at i,j = ',ji,jj 
     
    520520     ! 
    521521   END SUBROUTINE ice_ctl 
    522   
     522 
    523523   SUBROUTINE ice_prt( kt, ki, kj, kn, cd1 ) 
    524524      !!------------------------------------------------------------------- 
    525       !!                   ***  ROUTINE ice_prt ***  
    526       !!                  
    527       !! ** Purpose :   Writes global ice state on the (i,j) point  
    528       !!                in ocean.ouput  
    529       !!                3 possibilities exist  
     525      !!                   ***  ROUTINE ice_prt *** 
     526      !! 
     527      !! ** Purpose :   Writes global ice state on the (i,j) point 
     528      !!                in ocean.ouput 
     529      !!                3 possibilities exist 
    530530      !!                n = 1/-1 -> simple ice state 
    531531      !!                n = 2    -> exhaustive state 
    532532      !!                n = 3    -> ice/ocean salt fluxes 
    533533      !! 
    534       !! ** input   :   point coordinates (i,j)  
     534      !! ** input   :   point coordinates (i,j) 
    535535      !!                n : number of the option 
    536536      !!------------------------------------------------------------------- 
     
    550550            !  Simple state 
    551551            !---------------- 
    552              
     552 
    553553            IF ( kn == 1 .OR. kn == -1 ) THEN 
    554554               WRITE(numout,*) ' ice_prt - Point : ',ji,jj 
     
    566566               WRITE(numout,*) ' - Cell values ' 
    567567               WRITE(numout,*) '   ~~~~~~~~~~~ ' 
    568                WRITE(numout,*) ' at_i          : ', at_i(ji,jj)        
    569                WRITE(numout,*) ' ato_i         : ', ato_i(ji,jj)        
    570                WRITE(numout,*) ' vt_i          : ', vt_i(ji,jj)        
    571                WRITE(numout,*) ' vt_s          : ', vt_s(ji,jj)        
     568               WRITE(numout,*) ' at_i          : ', at_i(ji,jj) 
     569               WRITE(numout,*) ' ato_i         : ', ato_i(ji,jj) 
     570               WRITE(numout,*) ' vt_i          : ', vt_i(ji,jj) 
     571               WRITE(numout,*) ' vt_s          : ', vt_s(ji,jj) 
    572572               DO jl = 1, jpl 
    573573                  WRITE(numout,*) ' - Category (', jl,')' 
     
    592592            !  Exhaustive state 
    593593            !-------------------- 
    594              
     594 
    595595            IF ( kn .EQ. 2 ) THEN 
    596596               WRITE(numout,*) ' ice_prt - Point : ',ji,jj 
     
    598598               WRITE(numout,*) ' Exhaustive state ' 
    599599               WRITE(numout,*) ' lat - long ', gphit(ji,jj), glamt(ji,jj) 
    600                WRITE(numout,*)  
     600               WRITE(numout,*) 
    601601               WRITE(numout,*) ' - Cell values ' 
    602602               WRITE(numout,*) '   ~~~~~~~~~~~ ' 
    603                WRITE(numout,*) ' at_i          : ', at_i(ji,jj)        
    604                WRITE(numout,*) ' vt_i          : ', vt_i(ji,jj)        
    605                WRITE(numout,*) ' vt_s          : ', vt_s(ji,jj)        
     603               WRITE(numout,*) ' at_i          : ', at_i(ji,jj) 
     604               WRITE(numout,*) ' vt_i          : ', vt_i(ji,jj) 
     605               WRITE(numout,*) ' vt_s          : ', vt_s(ji,jj) 
    606606               WRITE(numout,*) ' u_ice(i-1,j)  : ', u_ice(ji-1,jj) 
    607607               WRITE(numout,*) ' u_ice(i  ,j)  : ', u_ice(ji,jj) 
     
    610610               WRITE(numout,*) ' strength      : ', strength(ji,jj) 
    611611               WRITE(numout,*) 
    612                 
     612 
    613613               DO jl = 1, jpl 
    614614                  WRITE(numout,*) ' - Category (',jl,')' 
    615                   WRITE(numout,*) '   ~~~~~~~~         '  
     615                  WRITE(numout,*) '   ~~~~~~~~         ' 
    616616                  WRITE(numout,*) ' h_i        : ', h_i(ji,jj,jl)              , ' h_s        : ', h_s(ji,jj,jl) 
    617617                  WRITE(numout,*) ' t_i        : ', t_i(ji,jj,1:nlay_i,jl) 
    618618                  WRITE(numout,*) ' t_su       : ', t_su(ji,jj,jl)             , ' t_s        : ', t_s(ji,jj,1:nlay_s,jl) 
    619619                  WRITE(numout,*) ' s_i        : ', s_i(ji,jj,jl)              , ' o_i        : ', o_i(ji,jj,jl) 
    620                   WRITE(numout,*) ' a_i        : ', a_i(ji,jj,jl)              , ' a_i_b      : ', a_i_b(ji,jj,jl)    
    621                   WRITE(numout,*) ' v_i        : ', v_i(ji,jj,jl)              , ' v_i_b      : ', v_i_b(ji,jj,jl)    
    622                   WRITE(numout,*) ' v_s        : ', v_s(ji,jj,jl)              , ' v_s_b      : ', v_s_b(ji,jj,jl)   
    623                   WRITE(numout,*) ' e_i1       : ', e_i(ji,jj,1,jl)            , ' ei1        : ', e_i_b(ji,jj,1,jl)  
    624                   WRITE(numout,*) ' e_i2       : ', e_i(ji,jj,2,jl)            , ' ei2_b      : ', e_i_b(ji,jj,2,jl)   
    625                   WRITE(numout,*) ' e_snow     : ', e_s(ji,jj,1,jl)            , ' e_snow_b   : ', e_s_b(ji,jj,1,jl)  
    626                   WRITE(numout,*) ' sv_i       : ', sv_i(ji,jj,jl)             , ' sv_i_b     : ', sv_i_b(ji,jj,jl)    
     620                  WRITE(numout,*) ' a_i        : ', a_i(ji,jj,jl)              , ' a_i_b      : ', a_i_b(ji,jj,jl) 
     621                  WRITE(numout,*) ' v_i        : ', v_i(ji,jj,jl)              , ' v_i_b      : ', v_i_b(ji,jj,jl) 
     622                  WRITE(numout,*) ' v_s        : ', v_s(ji,jj,jl)              , ' v_s_b      : ', v_s_b(ji,jj,jl) 
     623                  WRITE(numout,*) ' e_i1       : ', e_i(ji,jj,1,jl)            , ' ei1        : ', e_i_b(ji,jj,1,jl) 
     624                  WRITE(numout,*) ' e_i2       : ', e_i(ji,jj,2,jl)            , ' ei2_b      : ', e_i_b(ji,jj,2,jl) 
     625                  WRITE(numout,*) ' e_snow     : ', e_s(ji,jj,1,jl)            , ' e_snow_b   : ', e_s_b(ji,jj,1,jl) 
     626                  WRITE(numout,*) ' sv_i       : ', sv_i(ji,jj,jl)             , ' sv_i_b     : ', sv_i_b(ji,jj,jl) 
    627627               END DO !jl 
    628                 
     628 
    629629               WRITE(numout,*) 
    630630               WRITE(numout,*) ' - Heat / FW fluxes ' 
     
    634634               WRITE(numout,*) ' qns_ini       : ', (1._wp-at_i_b(ji,jj)) * qns(ji,jj) + SUM( a_i_b(ji,jj,:) * qns_ice(ji,jj,:) ) 
    635635               WRITE(numout,*) 
    636                WRITE(numout,*)  
    637                WRITE(numout,*) ' sst        : ', sst_m(ji,jj)   
    638                WRITE(numout,*) ' sss        : ', sss_m(ji,jj)   
    639                WRITE(numout,*)  
     636               WRITE(numout,*) 
     637               WRITE(numout,*) ' sst        : ', sst_m(ji,jj) 
     638               WRITE(numout,*) ' sss        : ', sss_m(ji,jj) 
     639               WRITE(numout,*) 
    640640               WRITE(numout,*) ' - Stresses ' 
    641641               WRITE(numout,*) '   ~~~~~~~~ ' 
    642                WRITE(numout,*) ' utau_ice   : ', utau_ice(ji,jj)  
     642               WRITE(numout,*) ' utau_ice   : ', utau_ice(ji,jj) 
    643643               WRITE(numout,*) ' vtau_ice   : ', vtau_ice(ji,jj) 
    644                WRITE(numout,*) ' utau       : ', utau    (ji,jj)  
     644               WRITE(numout,*) ' utau       : ', utau    (ji,jj) 
    645645               WRITE(numout,*) ' vtau       : ', vtau    (ji,jj) 
    646646            ENDIF 
    647              
     647 
    648648            !--------------------- 
    649649            ! Salt / heat fluxes 
    650650            !--------------------- 
    651              
     651 
    652652            IF ( kn .EQ. 3 ) THEN 
    653653               WRITE(numout,*) ' ice_prt - Point : ',ji,jj 
     
    664664               WRITE(numout,*) ' qt_atm_oi    : ', qt_atm_oi(ji,jj) 
    665665               WRITE(numout,*) ' qt_oce_ai    : ', qt_oce_ai(ji,jj) 
    666                WRITE(numout,*) ' dhc          : ', diag_heat(ji,jj)               
     666               WRITE(numout,*) ' dhc          : ', diag_heat(ji,jj) 
    667667               WRITE(numout,*) 
    668668               WRITE(numout,*) ' hfx_dyn      : ', hfx_dyn(ji,jj) 
    669669               WRITE(numout,*) ' hfx_thd      : ', hfx_thd(ji,jj) 
    670670               WRITE(numout,*) ' hfx_res      : ', hfx_res(ji,jj) 
    671                WRITE(numout,*) ' qsb_ice_bot  : ', qsb_ice_bot(ji,jj)  
     671               WRITE(numout,*) ' qsb_ice_bot  : ', qsb_ice_bot(ji,jj) 
    672672               WRITE(numout,*) ' qlead        : ', qlead(ji,jj) * r1_Dt_ice 
    673673               WRITE(numout,*) 
     
    680680               WRITE(numout,*) 
    681681               WRITE(numout,*) ' - Momentum fluxes ' 
    682                WRITE(numout,*) ' utau      : ', utau(ji,jj)  
     682               WRITE(numout,*) ' utau      : ', utau(ji,jj) 
    683683               WRITE(numout,*) ' vtau      : ', vtau(ji,jj) 
    684             ENDIF  
     684            ENDIF 
    685685            WRITE(numout,*) ' ' 
    686686            ! 
     
    694694      !!                  ***  ROUTINE ice_prt3D *** 
    695695      !! 
    696       !! ** Purpose : CTL prints of ice arrays in case sn_cfctl%prtctl is activated  
     696      !! ** Purpose : CTL prints of ice arrays in case sn_cfctl%prtctl is activated 
    697697      !! 
    698698      !!------------------------------------------------------------------- 
    699699      CHARACTER(len=*), INTENT(in) ::   cd_routine    ! name of the routine 
    700700      INTEGER                      ::   jk, jl        ! dummy loop indices 
    701        
     701 
    702702      CALL prt_ctl_info(' ========== ') 
    703703      CALL prt_ctl_info( cd_routine ) 
     
    718718      CALL prt_ctl(tab2d_1=delta_i    , clinfo1=' delta_i     :') 
    719719      CALL prt_ctl(tab2d_1=u_ice      , clinfo1=' u_ice       :', tab2d_2=v_ice      , clinfo2=' v_ice       :') 
    720         
     720 
    721721      DO jl = 1, jpl 
    722722         CALL prt_ctl_info(' ') 
     
    735735         CALL prt_ctl(tab2d_1=sv_i       (:,:,jl)        , clinfo1= ' sv_i        : ') 
    736736         CALL prt_ctl(tab2d_1=oa_i       (:,:,jl)        , clinfo1= ' oa_i        : ') 
    737           
     737 
    738738         DO jk = 1, nlay_i 
    739739            CALL prt_ctl_info(' - Layer : ', ivar=jk) 
     
    742742         END DO 
    743743      END DO 
    744        
     744 
    745745      CALL prt_ctl_info(' ') 
    746746      CALL prt_ctl_info(' - Stresses : ') 
     
    748748      CALL prt_ctl(tab2d_1=utau       , clinfo1= ' utau      : ', tab2d_2=vtau       , clinfo2= ' vtau      : ') 
    749749      CALL prt_ctl(tab2d_1=utau_ice   , clinfo1= ' utau_ice  : ', tab2d_2=vtau_ice   , clinfo2= ' vtau_ice  : ') 
    750        
     750 
    751751   END SUBROUTINE ice_prt3D 
    752752 
     
    853853      !!---------------------------------------------------------------------- 
    854854      !!                  ***  ROUTINE ice_drift_init  *** 
    855       !!                    
     855      !! 
    856856      !! ** Purpose :   create output file, initialise arrays 
    857857      !!---------------------------------------------------------------------- 
     
    879879      ! 
    880880   END SUBROUTINE ice_drift_init 
    881        
     881 
    882882#else 
    883883   !!---------------------------------------------------------------------- 
  • NEMO/trunk/src/ICE/icedia.F90

    r13970 r14072  
    22   !!====================================================================== 
    33   !!                       ***  MODULE icedia  *** 
    4    !!  Sea-Ice:   global budgets  
     4   !!  Sea-Ice:   global budgets 
    55   !!====================================================================== 
    66   !! History :  3.4  !  2012-10  (C. Rousset)       original code 
     
    3737   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   vol_loc_ini, sal_loc_ini, tem_loc_ini                    ! initial volume, salt and heat contents 
    3838   REAL(wp)                              ::   frc_sal, frc_voltop, frc_volbot, frc_temtop, frc_tembot  ! global forcing trends 
    39     
     39 
    4040   !!---------------------------------------------------------------------- 
    4141   !! NEMO/ICE 4.0 , NEMO Consortium (2018) 
     
    5959      !!--------------------------------------------------------------------------- 
    6060      !!                  ***  ROUTINE ice_dia  *** 
    61       !!      
    62       !! ** Purpose:   Compute the sea-ice global heat content, salt content  
     61      !! 
     62      !! ** Purpose:   Compute the sea-ice global heat content, salt content 
    6363      !!             and volume conservation 
    6464      !!--------------------------------------------------------------------------- 
    65       INTEGER, INTENT(in) ::   kt   ! ocean time step  
     65      INTEGER, INTENT(in) ::   kt   ! ocean time step 
    6666      !! 
    6767      REAL(wp)   ::   zbg_ivol, zbg_item, zbg_area, zbg_isal 
    6868      REAL(wp)   ::   zbg_svol, zbg_stem 
    6969      REAL(wp)   ::   z_frc_voltop, z_frc_temtop, z_frc_sal 
    70       REAL(wp)   ::   z_frc_volbot, z_frc_tembot   
    71       REAL(wp)   ::   zdiff_vol, zdiff_sal, zdiff_tem   
     70      REAL(wp)   ::   z_frc_volbot, z_frc_tembot 
     71      REAL(wp)   ::   zdiff_vol, zdiff_sal, zdiff_tem 
    7272      !!--------------------------------------------------------------------------- 
    7373      IF( ln_timing )   CALL timing_start('ice_dia') 
     
    8282         z1_e1e2 = 1._wp / glob_sum( 'icedia', e1e2t(:,:) ) 
    8383      ENDIF 
    84        
     84 
    8585      ! ----------------------- ! 
    8686      ! 1 -  Contents           ! 
     
    9696         zbg_stem = glob_sum( 'icedia', et_s(:,:) * e1e2t(:,:) ) * 1.e-20 ! heat content (1.e20 J) 
    9797 
    98          CALL iom_put( 'ibgvol_tot'  , zbg_ivol )  
    99          CALL iom_put( 'sbgvol_tot'  , zbg_svol )  
    100          CALL iom_put( 'ibgarea_tot' , zbg_area )  
    101          CALL iom_put( 'ibgsalt_tot' , zbg_isal )  
    102          CALL iom_put( 'ibgheat_tot' , zbg_item )  
    103          CALL iom_put( 'sbgheat_tot' , zbg_stem )  
    104   
     98         CALL iom_put( 'ibgvol_tot'  , zbg_ivol ) 
     99         CALL iom_put( 'sbgvol_tot'  , zbg_svol ) 
     100         CALL iom_put( 'ibgarea_tot' , zbg_area ) 
     101         CALL iom_put( 'ibgsalt_tot' , zbg_isal ) 
     102         CALL iom_put( 'ibgheat_tot' , zbg_item ) 
     103         CALL iom_put( 'sbgheat_tot' , zbg_stem ) 
     104 
    105105      ENDIF 
    106106 
     
    109109      ! ---------------------------! 
    110110      ! they must be kept outside an IF(iom_use) because of the call to dia_rst below 
    111       z_frc_volbot = r1_rho0 * glob_sum( 'icedia', -( wfx_ice(:,:) + wfx_snw(:,:) + wfx_err_sub(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater flux ice/snow-ocean  
     111      z_frc_volbot = r1_rho0 * glob_sum( 'icedia', -( wfx_ice(:,:) + wfx_snw(:,:) + wfx_err_sub(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater flux ice/snow-ocean 
    112112      z_frc_voltop = r1_rho0 * glob_sum( 'icedia', -( wfx_sub(:,:) + wfx_spr(:,:) )                    * e1e2t(:,:) ) * 1.e-9   ! freshwater flux ice/snow-atm 
    113113      z_frc_sal    = r1_rho0 * glob_sum( 'icedia', -      sfx(:,:)                                     * e1e2t(:,:) ) * 1.e-9   ! salt fluxes ice/snow-ocean 
     
    121121      frc_tembot  = frc_tembot  + z_frc_tembot  * rDt_ice ! 1.e20 J 
    122122 
    123       CALL iom_put( 'ibgfrcvoltop' , frc_voltop )   ! vol  forcing ice/snw-atm          (km3 equivalent ocean water)  
    124       CALL iom_put( 'ibgfrcvolbot' , frc_volbot )   ! vol  forcing ice/snw-ocean        (km3 equivalent ocean water)  
    125       CALL iom_put( 'ibgfrcsal'    , frc_sal    )   ! sal - forcing                     (psu*km3 equivalent ocean water)    
    126       CALL iom_put( 'ibgfrctemtop' , frc_temtop )   ! heat on top of ice/snw/ocean      (1.e20 J)    
    127       CALL iom_put( 'ibgfrctembot' , frc_tembot )   ! heat on top of ocean(below ice)   (1.e20 J)    
     123      CALL iom_put( 'ibgfrcvoltop' , frc_voltop )   ! vol  forcing ice/snw-atm          (km3 equivalent ocean water) 
     124      CALL iom_put( 'ibgfrcvolbot' , frc_volbot )   ! vol  forcing ice/snw-ocean        (km3 equivalent ocean water) 
     125      CALL iom_put( 'ibgfrcsal'    , frc_sal    )   ! sal - forcing                     (psu*km3 equivalent ocean water) 
     126      CALL iom_put( 'ibgfrctemtop' , frc_temtop )   ! heat on top of ice/snw/ocean      (1.e20 J) 
     127      CALL iom_put( 'ibgfrctembot' , frc_tembot )   ! heat on top of ocean(below ice)   (1.e20 J) 
    128128 
    129129      IF(  iom_use('ibgfrchfxtop') .OR. iom_use('ibgfrchfxbot') ) THEN 
    130130         CALL iom_put( 'ibgfrchfxtop' , frc_temtop * z1_e1e2 * 1.e-20 * kt*rn_Dt ) ! heat on top of ice/snw/ocean      (W/m2) 
    131          CALL iom_put( 'ibgfrchfxbot' , frc_tembot * z1_e1e2 * 1.e-20 * kt*rn_Dt ) ! heat on top of ocean(below ice)   (W/m2)  
    132       ENDIF 
    133        
     131         CALL iom_put( 'ibgfrchfxbot' , frc_tembot * z1_e1e2 * 1.e-20 * kt*rn_Dt ) ! heat on top of ocean(below ice)   (W/m2) 
     132      ENDIF 
     133 
    134134      ! ---------------------------------- ! 
    135135      ! 3 -  Content variations and drifts ! 
    136136      ! ---------------------------------- ! 
    137137      IF(  iom_use('ibgvolume') .OR. iom_use('ibgsaltco') .OR. iom_use('ibgheatco') .OR. iom_use('ibgheatfx') ) THEN 
    138              
    139          zdiff_vol = r1_rho0 * glob_sum( 'icedia', ( rhoi*vt_i(:,:) + rhos*vt_s(:,:) - vol_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater trend (km3)  
     138 
     139         zdiff_vol = r1_rho0 * glob_sum( 'icedia', ( rhoi*vt_i(:,:) + rhos*vt_s(:,:) - vol_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! freshwater trend (km3) 
    140140         zdiff_sal = r1_rho0 * glob_sum( 'icedia', ( rhoi*st_i(:,:)                  - sal_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-9   ! salt content trend (km3*pss) 
    141141         zdiff_tem =           glob_sum( 'icedia', ( et_i(:,:) + et_s(:,:)           - tem_loc_ini(:,:) ) * e1e2t(:,:) ) * 1.e-20  ! heat content trend (1.e20 J) 
    142142         !                               + SUM( qevap_ice * a_i_b, dim=3 )       !! clem: I think this term should not be there (but needs a check) 
    143           
     143 
    144144         zdiff_vol = zdiff_vol - ( frc_voltop + frc_volbot ) 
    145145         zdiff_sal = zdiff_sal - frc_sal 
    146146         zdiff_tem = zdiff_tem - ( frc_tembot - frc_temtop ) 
    147           
    148          CALL iom_put( 'ibgvolume' , zdiff_vol )   ! ice/snow volume  drift            (km3 equivalent ocean water)          
     147 
     148         CALL iom_put( 'ibgvolume' , zdiff_vol )   ! ice/snow volume  drift            (km3 equivalent ocean water) 
    149149         CALL iom_put( 'ibgsaltco' , zdiff_sal )   ! ice salt content drift            (psu*km3 equivalent ocean water) 
    150150         CALL iom_put( 'ibgheatco' , zdiff_tem )   ! ice/snow heat content drift       (1.e20 J) 
    151151         ! 
    152152      ENDIF 
    153        
     153 
    154154      IF( lrst_ice )   CALL ice_dia_rst( 'WRITE', kt_ice ) 
    155155      ! 
     
    162162      !!--------------------------------------------------------------------------- 
    163163      !!                  ***  ROUTINE ice_dia_init  *** 
    164       !!      
     164      !! 
    165165      !! ** Purpose: Initialization for the heat salt volume budgets 
    166       !!  
     166      !! 
    167167      !! ** Method : Compute initial heat content, salt content and volume 
    168168      !! 
     
    173173      INTEGER            ::   ios, ierror   ! local integer 
    174174      !! 
    175       NAMELIST/namdia/ ln_icediachk, rn_icechk_cel, rn_icechk_glo, ln_icediahsb, ln_icectl, iiceprt, jiceprt   
     175      NAMELIST/namdia/ ln_icediachk, rn_icechk_cel, rn_icechk_glo, ln_icediahsb, ln_icectl, iiceprt, jiceprt 
    176176      !!---------------------------------------------------------------------- 
    177177      ! 
     
    194194         WRITE(numout,*) '         chosen grid point position          (iiceprt,jiceprt)  = (', iiceprt,',', jiceprt,')' 
    195195      ENDIF 
    196       !       
     196      ! 
    197197      IF( ln_icediahsb ) THEN 
    198198         IF( ice_dia_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'ice_dia_init : unable to allocate arrays' )   ! allocate tke arrays 
     
    206206      !!--------------------------------------------------------------------- 
    207207      !!                   ***  ROUTINE icedia_rst  *** 
    208       !!                      
     208      !! 
    209209      !! ** Purpose :   Read or write DIA file in restart file 
    210210      !! 
     
    218218      !!---------------------------------------------------------------------- 
    219219      ! 
    220       IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise  
     220      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialise 
    221221         IF( ln_rstart ) THEN                   !* Read the restart file 
    222222            ! 
     
    238238            IF(lwp) WRITE(numout,*) '~~~~~~~' 
    239239            ! set trends to 0 
    240             frc_voltop  = 0._wp                                           
    241             frc_volbot  = 0._wp                                           
    242             frc_temtop  = 0._wp                                                  
    243             frc_tembot  = 0._wp                                                  
    244             frc_sal     = 0._wp                                                  
     240            frc_voltop  = 0._wp 
     241            frc_volbot  = 0._wp 
     242            frc_temtop  = 0._wp 
     243            frc_tembot  = 0._wp 
     244            frc_sal     = 0._wp 
    245245            ! record initial ice volume, salt and temp 
    246246            vol_loc_ini(:,:) = rhoi * vt_i(:,:) + rhos * vt_s(:,:)  ! ice/snow volume (kg/m2) 
     
    260260         ! 
    261261         ! Write in numriw (if iter == nitrst) 
    262          ! ------------------  
     262         ! ------------------ 
    263263         CALL iom_rstput( iter, nitrst, numriw, 'frc_voltop' , frc_voltop ) 
    264264         CALL iom_rstput( iter, nitrst, numriw, 'frc_volbot' , frc_volbot ) 
     
    273273      ! 
    274274   END SUBROUTINE ice_dia_rst 
    275   
     275 
    276276#else 
    277277   !!---------------------------------------------------------------------- 
  • NEMO/trunk/src/ICE/icedyn.F90

    r14005 r14072  
    22   !!====================================================================== 
    33   !!                     ***  MODULE  icedyn  *** 
    4    !!   Sea-Ice dynamics : master routine for sea ice dynamics  
     4   !!   Sea-Ice dynamics : master routine for sea ice dynamics 
    55   !!====================================================================== 
    66   !! history :  4.0  ! 2018  (C. Rousset)  original code SI3 [aka Sea Ice cube] 
     
    3636   PUBLIC   ice_dyn        ! called by icestp.F90 
    3737   PUBLIC   ice_dyn_init   ! called by icestp.F90 
    38     
     38 
    3939   INTEGER ::              nice_dyn   ! choice of the type of dynamics 
    4040   !                                        ! associated indices: 
    4141   INTEGER, PARAMETER ::   np_dynALL     = 1   ! full ice dynamics               (rheology + advection + ridging/rafting + correction) 
    42    INTEGER, PARAMETER ::   np_dynRHGADV  = 2   ! pure dynamics                   (rheology + advection)  
     42   INTEGER, PARAMETER ::   np_dynRHGADV  = 2   ! pure dynamics                   (rheology + advection) 
    4343   INTEGER, PARAMETER ::   np_dynADV1D   = 3   ! only advection 1D - test case from Schar & Smolarkiewicz 1996 
    4444   INTEGER, PARAMETER ::   np_dynADV2D   = 4   ! only advection 2D w prescribed vel.(rn_uvice + advection) 
     
    5151   REAL(wp) ::   rn_uice          !    prescribed u-vel (case np_dynADV1D & np_dynADV2D) 
    5252   REAL(wp) ::   rn_vice          !    prescribed v-vel (case np_dynADV1D & np_dynADV2D) 
    53     
     53 
    5454   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_icbmsk   ! structure of input grounded icebergs mask (file informations, fields read) 
    5555 
     
    6666      !!------------------------------------------------------------------- 
    6767      !!               ***  ROUTINE ice_dyn  *** 
    68       !!                
     68      !! 
    6969      !! ** Purpose :   this routine manages sea ice dynamics 
    7070      !! 
     
    9191         WRITE(numout,*)'~~~~~~~' 
    9292      ENDIF 
    93       !                       
     93      ! 
    9494      ! retrieve thickness from volume for landfast param. and UMx advection scheme 
    9595      WHERE( a_i(:,:,:) >= epsi20 ) 
     
    118118      CASE ( np_dynALL )           !==  all dynamical processes  ==! 
    119119         ! 
    120          CALL ice_dyn_rhg   ( kt, Kmm )                                     ! -- rheology   
     120         CALL ice_dyn_rhg   ( kt, Kmm )                                     ! -- rheology 
    121121         CALL ice_dyn_adv   ( kt )                                          ! -- advection of ice 
    122          CALL ice_dyn_rdgrft( kt )                                          ! -- ridging/rafting  
     122         CALL ice_dyn_rdgrft( kt )                                          ! -- ridging/rafting 
    123123         CALL ice_cor       ( kt , 1 )                                      ! -- Corrections 
    124124         ! 
    125125      CASE ( np_dynRHGADV  )       !==  no ridge/raft & no corrections ==! 
    126126         ! 
    127          CALL ice_dyn_rhg   ( kt, Kmm )                                     ! -- rheology   
     127         CALL ice_dyn_rhg   ( kt, Kmm )                                     ! -- rheology 
    128128         CALL ice_dyn_adv   ( kt )                                          ! -- advection of ice 
    129129         CALL Hpiling                                                       ! -- simple pile-up (replaces ridging/rafting) 
     
    134134         ! --- monotonicity test from Schar & Smolarkiewicz 1996 --- ! 
    135135         ! CFL = 0.5 at a distance from the bound of 1/6 of the basin length 
    136          ! Then for dx = 2m and dt = 1s => rn_uice = u (1/6th) = 1m/s  
     136         ! Then for dx = 2m and dt = 1s => rn_uice = u (1/6th) = 1m/s 
    137137         DO_2D( 1, 1, 1, 1 ) 
    138138            zcoefu = ( REAL(jpiglo+1)*0.5_wp - REAL(ji+nimpp-1) ) / ( REAL(jpiglo+1)*0.5_wp - 1._wp ) 
     
    156156      ! 
    157157      ! 
    158       ! diagnostics: divergence at T points  
     158      ! diagnostics: divergence at T points 
    159159      IF( iom_use('icediv') ) THEN 
    160160         ! 
     
    259259      ENDIF 
    260260      !                             !== set the choice of ice dynamics ==! 
    261       ioptio = 0  
     261      ioptio = 0 
    262262      !      !--- full dynamics                               (rheology + advection + ridging/rafting + correction) 
    263263      IF( ln_dynALL    ) THEN   ;   ioptio = ioptio + 1   ;   nice_dyn = np_dynALL       ;   ENDIF 
     
    292292         ALLOCATE( sf_icbmsk(1)%fnow(jpi,jpj,1) ) 
    293293         IF( sf_icbmsk(1)%ln_tint )   ALLOCATE( sf_icbmsk(1)%fdta(jpi,jpj,1,2) ) 
    294          IF( TRIM(sf_icbmsk(1)%clrootname) == 'NOT USED' ) sf_icbmsk(1)%fnow(:,:,1) = 0._wp   ! not used field  (set to 0)          
     294         IF( TRIM(sf_icbmsk(1)%clrootname) == 'NOT USED' ) sf_icbmsk(1)%fnow(:,:,1) = 0._wp   ! not used field  (set to 0) 
    295295      ELSE 
    296296         icb_mask(:,:) = 0._wp 
    297297      ENDIF 
    298       !                                      !--- other init  
     298      !                                      !--- other init 
    299299      CALL ice_dyn_rdgrft_init          ! set ice ridging/rafting parameters 
    300300      CALL ice_dyn_rhg_init             ! set ice rheology parameters 
     
    307307   !!   Default option         Empty module           NO SI3 sea-ice model 
    308308   !!---------------------------------------------------------------------- 
    309 #endif  
     309#endif 
    310310 
    311311   !!====================================================================== 
  • NEMO/trunk/src/ICE/icedyn_adv_pra.F90

    r14005 r14072  
    1 MODULE icedyn_adv_pra  
     1MODULE icedyn_adv_pra 
    22   !!====================================================================== 
    33   !!                       ***  MODULE icedyn_adv_pra   *** 
     
    3535 
    3636   ! Moments for advection 
    37    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxice, syice, sxxice, syyice, sxyice   ! ice thickness  
     37   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxice, syice, sxxice, syyice, sxyice   ! ice thickness 
    3838   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxsn , sysn , sxxsn , syysn , sxysn    ! snow thickness 
    3939   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxa  , sya  , sxxa  , syya  , sxya     ! ice concentration 
     
    5959      !!---------------------------------------------------------------------- 
    6060      !!                **  routine ice_dyn_adv_pra  ** 
    61       !!   
     61      !! 
    6262      !! ** purpose :   Computes and adds the advection trend to sea-ice 
    6363      !! 
     
    101101      REAL(wp), DIMENSION(jpi,jpj,nlay_i,jpl) ::   z0ei 
    102102      !! diagnostics 
    103       REAL(wp), DIMENSION(jpi,jpj)            ::   zdiag_adv_mass, zdiag_adv_salt, zdiag_adv_heat       
     103      REAL(wp), DIMENSION(jpi,jpj)            ::   zdiag_adv_mass, zdiag_adv_salt, zdiag_adv_heat 
    104104      !!---------------------------------------------------------------------- 
    105105      ! 
     
    127127         ELSEWHERE                      ; ze_s(:,:,jk,:) = 0._wp 
    128128         END WHERE 
    129       END DO    
     129      END DO 
    130130      CALL icemax4D( ze_i , zei_max ) 
    131131      CALL icemax4D( ze_s , zes_max ) 
     
    139139      zcflnow(1) =                  MAXVAL( ABS( pu_ice(:,:) ) * rDt_ice * r1_e1u(:,:) ) 
    140140      zcflnow(1) = MAX( zcflnow(1), MAXVAL( ABS( pv_ice(:,:) ) * rDt_ice * r1_e2v(:,:) ) ) 
    141        
     141 
    142142      ! non-blocking global communication send zcflnow and receive zcflprv 
    143143      CALL mpp_delay_max( 'icedyn_adv_pra', 'cflice', zcflnow(:), zcflprv(:), kt == nitend - nn_fsbc + 1 ) 
     
    148148      zdt = rDt_ice / REAL(icycle) 
    149149      z1_dt = 1._wp / zdt 
    150        
     150 
    151151      ! --- transport --- ! 
    152152      zudy(:,:) = pu_ice(:,:) * e2u(:,:) 
     
    164164         ! record at_i before advection (for open water) 
    165165         zati1(:,:) = SUM( pa_i(:,:,:), dim=3 ) 
    166           
    167          ! --- transported fields --- !                                         
     166 
     167         ! --- transported fields --- ! 
    168168         DO jl = 1, jpl 
    169169            zarea(:,:,jl) = e1e2t(:,:) 
     
    209209            END DO 
    210210            DO jk = 1, nlay_i                                                                           !--- ice heat content 
    211                CALL adv_x( zdt, zudy, 1._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   &  
     211               CALL adv_x( zdt, zudy, 1._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   & 
    212212                  &                                 sxxe(:,:,jk,:), sye(:,:,jk,:), syye(:,:,jk,:), sxye(:,:,jk,:) ) 
    213                CALL adv_y( zdt, zvdx, 0._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   &  
     213               CALL adv_y( zdt, zvdx, 0._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   & 
    214214                  &                                 sxxe(:,:,jk,:), sye(:,:,jk,:), syye(:,:,jk,:), sxye(:,:,jk,:) ) 
    215215            END DO 
     
    217217            IF ( ln_pnd_LEV .OR. ln_pnd_TOPO ) THEN 
    218218               CALL adv_x( zdt , zudy , 1._wp , zarea , z0ap , sxap , sxxap , syap , syyap , sxyap )    !--- melt pond fraction 
    219                CALL adv_y( zdt , zvdx , 0._wp , zarea , z0ap , sxap , sxxap , syap , syyap , sxyap )  
     219               CALL adv_y( zdt , zvdx , 0._wp , zarea , z0ap , sxap , sxxap , syap , syyap , sxyap ) 
    220220               CALL adv_x( zdt , zudy , 1._wp , zarea , z0vp , sxvp , sxxvp , syvp , syyvp , sxyvp )    !--- melt pond volume 
    221                CALL adv_y( zdt , zvdx , 0._wp , zarea , z0vp , sxvp , sxxvp , syvp , syyvp , sxyvp )  
     221               CALL adv_y( zdt , zvdx , 0._wp , zarea , z0vp , sxvp , sxxvp , syvp , syyvp , sxyvp ) 
    222222               IF ( ln_pnd_lids ) THEN 
    223223                  CALL adv_x( zdt , zudy , 1._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl ) !--- melt pond lid volume 
    224                   CALL adv_y( zdt , zvdx , 0._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl )  
     224                  CALL adv_y( zdt , zvdx , 0._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl ) 
    225225               ENDIF 
    226226            ENDIF 
     
    245245            END DO 
    246246            DO jk = 1, nlay_i                                                                           !--- ice heat content 
    247                CALL adv_y( zdt, zvdx, 1._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   &  
     247               CALL adv_y( zdt, zvdx, 1._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   & 
    248248                  &                                 sxxe(:,:,jk,:), sye(:,:,jk,:), syye(:,:,jk,:), sxye(:,:,jk,:) ) 
    249                CALL adv_x( zdt, zudy, 0._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   &  
     249               CALL adv_x( zdt, zudy, 0._wp, zarea, z0ei(:,:,jk,:), sxe(:,:,jk,:),   & 
    250250                  &                                 sxxe(:,:,jk,:), sye(:,:,jk,:), syye(:,:,jk,:), sxye(:,:,jk,:) ) 
    251251            END DO 
     
    257257               IF ( ln_pnd_lids ) THEN 
    258258                  CALL adv_y( zdt , zvdx , 1._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl ) !--- melt pond lid volume 
    259                   CALL adv_x( zdt , zudy , 0._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl )  
     259                  CALL adv_x( zdt , zudy , 0._wp , zarea , z0vl , sxvl , sxxvl , syvl , syyvl , sxyvl ) 
    260260               ENDIF 
    261261            ENDIF 
    262262            ! 
    263263         ENDIF 
    264           
     264 
    265265         ! --- Lateral boundary conditions --- ! 
    266266         !     caution: for gradients (sx and sy) the sign changes 
     
    276276            &                                , sxxage, 'T', 1._wp, syyage, 'T',  1._wp, sxyage, 'T',  1._wp  ) 
    277277         CALL lbc_lnk_multi( 'icedyn_adv_pra', z0es  , 'T', 1._wp, sxc0  , 'T', -1._wp, syc0  , 'T', -1._wp  & ! snw enthalpy 
    278             &                                , sxxc0 , 'T', 1._wp, syyc0 , 'T',  1._wp, sxyc0 , 'T',  1._wp  )  
     278            &                                , sxxc0 , 'T', 1._wp, syyc0 , 'T',  1._wp, sxyc0 , 'T',  1._wp  ) 
    279279         CALL lbc_lnk_multi( 'icedyn_adv_pra', z0ei  , 'T', 1._wp, sxe   , 'T', -1._wp, sye   , 'T', -1._wp  & ! ice enthalpy 
    280280            &                                , sxxe  , 'T', 1._wp, syye  , 'T',  1._wp, sxye  , 'T',  1._wp  ) 
     
    283283               &                                , sxxap, 'T', 1._wp, syyap, 'T',  1._wp, sxyap, 'T',  1._wp  & 
    284284               &                                , z0vp , 'T', 1._wp, sxvp , 'T', -1._wp, syvp , 'T', -1._wp  & ! melt pond volume 
    285                &                                , sxxvp, 'T', 1._wp, syyvp, 'T',  1._wp, sxyvp, 'T',  1._wp  )  
     285               &                                , sxxvp, 'T', 1._wp, syyvp, 'T',  1._wp, sxyvp, 'T',  1._wp  ) 
    286286            IF ( ln_pnd_lids ) THEN 
    287287               CALL lbc_lnk_multi( 'icedyn_adv_pra', z0vl ,'T', 1._wp, sxvl ,'T', -1._wp, syvl ,'T', -1._wp  & ! melt pond lid volume 
    288                   &                                , sxxvl,'T', 1._wp, syyvl,'T',  1._wp, sxyvl,'T',  1._wp  )  
     288                  &                                , sxxvl,'T', 1._wp, syyvl,'T',  1._wp, sxyvl,'T',  1._wp  ) 
    289289            ENDIF 
    290290         ENDIF 
     
    348348      ! 
    349349   END SUBROUTINE ice_dyn_adv_pra 
    350     
    351     
     350 
     351 
    352352   SUBROUTINE adv_x( pdt, put , pcrh, psm , ps0 ,   & 
    353353      &              psx, psxx, psy , psyy, psxy ) 
    354354      !!---------------------------------------------------------------------- 
    355355      !!                **  routine adv_x  ** 
    356       !!   
     356      !! 
    357357      !! ** purpose :   Computes and adds the advection trend to sea-ice 
    358358      !!                variable on x axis 
     
    363363      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psm                ! area 
    364364      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ps0                ! field to be advected 
    365       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psx , psy          ! 1st moments  
     365      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psx , psy          ! 1st moments 
    366366      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psxx, psyy, psxy   ! 2nd moments 
    367       !!  
     367      !! 
    368368      INTEGER  ::   ji, jj, jl, jcat                     ! dummy loop indices 
    369369      INTEGER  ::   jj0                                  ! dummy loop indices 
     
    386386      DO jl = 1, jcat   ! loop on categories 
    387387         ! 
    388          ! Limitation of moments.                                            
     388         ! Limitation of moments. 
    389389         DO jj = Njs0 - jj0, Nje0 + jj0 
    390              
     390 
    391391            DO ji = Nis0 - 1, Nie0 + 1 
    392392 
     
    399399               zpsxy = psxy(ji,jj,jl) 
    400400 
    401                !  Initialize volumes of boxes  (=area if adv_x first called, =psm otherwise)                                      
     401               !  Initialize volumes of boxes  (=area if adv_x first called, =psm otherwise) 
    402402               zpsm = MAX( pcrh * e1e2t(ji,jj) + ( 1.0 - pcrh ) * zpsm , epsi20 ) 
    403403               ! 
     
    408408               rswitch = ( 1.0 - MAX( 0._wp, SIGN( 1._wp, -zslpmax) ) ) * tmask(ji,jj,1)   ! Case of empty boxes & Apply mask 
    409409 
    410                zps0  = zslpmax   
     410               zps0  = zslpmax 
    411411               zpsx  = zs1new  * rswitch 
    412412               zpsxx = zs2new  * rswitch 
     
    415415               zpsxy = MIN( zslpmax, MAX( -zslpmax, zpsxy ) ) * rswitch 
    416416 
    417                !  Calculate fluxes and moments between boxes i<-->i+1               
    418                !                                !  Flux from i to i+1 WHEN u GT 0  
     417               !  Calculate fluxes and moments between boxes i<-->i+1 
     418               !                                !  Flux from i to i+1 WHEN u GT 0 
    419419               zbet(ji,jj)  =  MAX( 0._wp, SIGN( 1._wp, put(ji,jj) ) ) 
    420420               zalf         =  MAX( 0._wp, put(ji,jj) ) * pdt / zpsm 
     
    423423               zalf1q       =  zalf1 * zalf1 
    424424               ! 
    425                zfm (ji,jj)  =  zalf  *   zpsm  
     425               zfm (ji,jj)  =  zalf  *   zpsm 
    426426               zf0 (ji,jj)  =  zalf  * ( zps0  + zalf1 * ( zpsx + (zalf1 - zalf) * zpsxx ) ) 
    427427               zfx (ji,jj)  =  zalfq * ( zpsx  + 3.0 * zalf1 * zpsxx ) 
     
    441441               ! 
    442442               psm (ji,jj,jl) = zpsm ! optimization 
    443                ps0 (ji,jj,jl) = zps0  
    444                psx (ji,jj,jl) = zpsx  
     443               ps0 (ji,jj,jl) = zps0 
     444               psx (ji,jj,jl) = zpsx 
    445445               psxx(ji,jj,jl) = zpsxx 
    446                psy (ji,jj,jl) = zpsy  
     446               psy (ji,jj,jl) = zpsy 
    447447               psyy(ji,jj,jl) = zpsyy 
    448448               psxy(ji,jj,jl) = zpsxy 
    449449               ! 
    450450            END DO 
    451              
     451 
    452452            DO ji = Nis0 - 1, Nie0 
    453453               !                                !  Flux from i+1 to i when u LT 0. 
    454                zalf          = MAX( 0._wp, -put(ji,jj) ) * pdt / psm(ji+1,jj,jl)  
     454               zalf          = MAX( 0._wp, -put(ji,jj) ) * pdt / psm(ji+1,jj,jl) 
    455455               zalg  (ji,jj) = zalf 
    456456               zalfq         = zalf * zalf 
     
    491491               zpsxy = zalg1q(ji-1,jj) * zpsxy 
    492492 
    493                !   Put the temporary moments into appropriate neighboring boxes.     
     493               !   Put the temporary moments into appropriate neighboring boxes. 
    494494               !                                !   Flux from i to i+1 IF u GT 0. 
    495495               zbt   =       zbet(ji-1,jj) 
     
    508508                  &            + 3.0 * (- zalf1*zfy(ji-1,jj)  + zalf * zpsy ) )  & 
    509509                  &            + zbt1 * zpsxy 
    510                zpsy  =  zbt  * ( zpsy  + zfy (ji-1,jj) ) + zbt1 * zpsy  
     510               zpsy  =  zbt  * ( zpsy  + zfy (ji-1,jj) ) + zbt1 * zpsy 
    511511               zpsyy =  zbt  * ( zpsyy + zfyy(ji-1,jj) ) + zbt1 * zpsyy 
    512512 
     
    530530               ! 
    531531               psm (ji,jj,jl) = zpsm  ! optimization 
    532                ps0 (ji,jj,jl) = zps0  
    533                psx (ji,jj,jl) = zpsx  
     532               ps0 (ji,jj,jl) = zps0 
     533               psx (ji,jj,jl) = zpsx 
    534534               psxx(ji,jj,jl) = zpsxx 
    535                psy (ji,jj,jl) = zpsy  
     535               psy (ji,jj,jl) = zpsy 
    536536               psyy(ji,jj,jl) = zpsyy 
    537537               psxy(ji,jj,jl) = zpsxy 
     
    541541         ! 
    542542      END DO 
    543       !       
     543      ! 
    544544   END SUBROUTINE adv_x 
    545545 
     
    549549      !!--------------------------------------------------------------------- 
    550550      !!                **  routine adv_y  ** 
    551       !!             
    552       !! ** purpose :   Computes and adds the advection trend to sea-ice  
     551      !! 
     552      !! ** purpose :   Computes and adds the advection trend to sea-ice 
    553553      !!                variable on y axis 
    554554      !!--------------------------------------------------------------------- 
     
    558558      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psm                ! area 
    559559      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ps0                ! field to be advected 
    560       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psx , psy          ! 1st moments  
     560      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psx , psy          ! 1st moments 
    561561      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   psxx, psyy, psxy   ! 2nd moments 
    562562      !! 
     
    578578      ! 
    579579      jcat = SIZE( ps0 , 3 )   ! size of input arrays 
    580       !       
     580      ! 
    581581      DO jl = 1, jcat   ! loop on categories 
    582582         ! 
     
    601601            rswitch = ( 1.0 - MAX( 0._wp, SIGN( 1._wp, -zslpmax) ) ) * tmask(ji,jj,1)   ! Case of empty boxes & Apply mask 
    602602            ! 
    603             zps0  = zslpmax   
     603            zps0  = zslpmax 
    604604            zpsx  = zpsx  * rswitch 
    605605            zpsxx = zpsxx * rswitch 
     
    608608            zpsxy = MIN( zslpmax, MAX( -zslpmax, zpsxy ) ) * rswitch 
    609609 
    610             !  Calculate fluxes and moments between boxes j<-->j+1               
    611             !                                !  Flux from j to j+1 WHEN v GT 0    
     610            !  Calculate fluxes and moments between boxes j<-->j+1 
     611            !                                !  Flux from j to j+1 WHEN v GT 0 
    612612            zbet(ji,jj)  =  MAX( 0._wp, SIGN( 1._wp, pvt(ji,jj) ) ) 
    613613            zalf         =  MAX( 0._wp, pvt(ji,jj) ) * pdt / zpsm 
     
    617617            ! 
    618618            zfm (ji,jj)  =  zalf  * zpsm 
    619             zf0 (ji,jj)  =  zalf  * ( zps0 + zalf1 * ( zpsy  + (zalf1-zalf) * zpsyy ) )  
     619            zf0 (ji,jj)  =  zalf  * ( zps0 + zalf1 * ( zpsy  + (zalf1-zalf) * zpsyy ) ) 
    620620            zfy (ji,jj)  =  zalfq *( zpsy + 3.0*zalf1*zpsyy ) 
    621621            zfyy(ji,jj)  =  zalf  * zalfq * zpsyy 
     
    634634            ! 
    635635            psm (ji,jj,jl) = zpsm ! optimization 
    636             ps0 (ji,jj,jl) = zps0  
    637             psx (ji,jj,jl) = zpsx  
     636            ps0 (ji,jj,jl) = zps0 
     637            psx (ji,jj,jl) = zpsx 
    638638            psxx(ji,jj,jl) = zpsxx 
    639             psy (ji,jj,jl) = zpsy  
     639            psy (ji,jj,jl) = zpsy 
    640640            psyy(ji,jj,jl) = zpsyy 
    641641            psxy(ji,jj,jl) = zpsxy 
     
    644644         DO_2D( 1, 0, ji0, ji0 ) 
    645645            !                                !  Flux from j+1 to j when v LT 0. 
    646             zalf          = MAX( 0._wp, -pvt(ji,jj) ) * pdt / psm(ji,jj+1,jl)  
     646            zalf          = MAX( 0._wp, -pvt(ji,jj) ) * pdt / psm(ji,jj+1,jl) 
    647647            zalg  (ji,jj) = zalf 
    648648            zalfq         = zalf * zalf 
     
    683683            zpsxy = zalg1q(ji,jj-1) * zpsxy 
    684684 
    685             !   Put the temporary moments into appropriate neighboring boxes.     
     685            !   Put the temporary moments into appropriate neighboring boxes. 
    686686            !                                !   Flux from j to j+1 IF v GT 0. 
    687687            zbt   =       zbet(ji,jj-1) 
    688688            zbt1  = 1.0 - zbet(ji,jj-1) 
    689             zpsm  = zbt * ( zpsm + zfm(ji,jj-1) ) + zbt1 * zpsm  
    690             zalf  = zbt * zfm(ji,jj-1) / zpsm  
     689            zpsm  = zbt * ( zpsm + zfm(ji,jj-1) ) + zbt1 * zpsm 
     690            zalf  = zbt * zfm(ji,jj-1) / zpsm 
    691691            zalf1 = 1.0 - zalf 
    692692            ztemp = zalf * zps0 - zalf1 * zf0(ji,jj-1) 
     
    694694            zps0  =   zbt  * ( zps0 + zf0(ji,jj-1) ) + zbt1 * zps0 
    695695            zpsy  =   zbt  * ( zalf * zfy(ji,jj-1) + zalf1 * zpsy + 3.0 * ztemp )  & 
    696                &             + zbt1 * zpsy   
     696               &             + zbt1 * zpsy 
    697697            zpsyy =   zbt  * ( zalf * zalf * zfyy(ji,jj-1) + zalf1 * zalf1 * zpsyy                           & 
    698                &             + 5.0 * ( zalf * zalf1 * ( zpsy - zfy(ji,jj-1) ) - ( zalf1 - zalf ) * ztemp ) ) &  
     698               &             + 5.0 * ( zalf * zalf1 * ( zpsy - zfy(ji,jj-1) ) - ( zalf1 - zalf ) * ztemp ) ) & 
    699699               &             + zbt1 * zpsyy 
    700700            zpsxy =   zbt  * ( zalf * zfxy(ji,jj-1) + zalf1 * zpsxy             & 
    701701               &             + 3.0 * (- zalf1 * zfx(ji,jj-1) + zalf * zpsx ) )  & 
    702702               &             + zbt1 * zpsxy 
    703             zpsx  =   zbt * ( zpsx  + zfx (ji,jj-1) ) + zbt1 * zpsx  
     703            zpsx  =   zbt * ( zpsx  + zfx (ji,jj-1) ) + zbt1 * zpsx 
    704704            zpsxx =   zbt * ( zpsxx + zfxx(ji,jj-1) ) + zbt1 * zpsxx 
    705705 
     
    723723            ! 
    724724            psm (ji,jj,jl) = zpsm ! optimization 
    725             ps0 (ji,jj,jl) = zps0  
    726             psx (ji,jj,jl) = zpsx  
     725            ps0 (ji,jj,jl) = zps0 
     726            psx (ji,jj,jl) = zpsx 
    727727            psxx(ji,jj,jl) = zpsxx 
    728             psy (ji,jj,jl) = zpsy  
     728            psy (ji,jj,jl) = zpsy 
    729729            psyy(ji,jj,jl) = zpsyy 
    730730            psxy(ji,jj,jl) = zpsxy 
     
    796796                  pe_s(ji,jj,1:nlay_s,jl) = pe_s(ji,jj,1:nlay_s,jl) * zfra 
    797797                  pv_s(ji,jj,jl)          = pa_i(ji,jj,jl) * phs_max(ji,jj,jl) 
    798                ENDIF            
    799                !                   
     798               ENDIF 
     799               ! 
    800800               !                               ! -- check s_i -- ! 
    801801               ! if s_i is larger than the surrounding 9 pts => put salt excess in the ocean 
     
    809809            ENDIF 
    810810         END_2D 
    811       END DO  
     811      END DO 
    812812      ! 
    813813      !                                           ! -- check e_i/v_i -- ! 
     
    899899      !!                  ***  ROUTINE adv_pra_init  *** 
    900900      !! 
    901       !! ** Purpose :   allocate and initialize arrays for Prather advection  
     901      !! ** Purpose :   allocate and initialize arrays for Prather advection 
    902902      !!------------------------------------------------------------------- 
    903903      INTEGER ::   ierr 
     
    932932      !!--------------------------------------------------------------------- 
    933933      !!                   ***  ROUTINE adv_pra_rst  *** 
    934       !!                      
     934      !! 
    935935      !! ** Purpose :   Read or write file in restart file 
    936936      !! 
     
    991991            DO jk = 1, nlay_s 
    992992               WRITE(zchar1,'(I2.2)') jk 
    993                znam = 'sxc0'//'_l'//zchar1   
     993               znam = 'sxc0'//'_l'//zchar1 
    994994               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sxc0 (:,:,jk,:) = z3d(:,:,:) 
    995                znam = 'syc0'//'_l'//zchar1   
     995               znam = 'syc0'//'_l'//zchar1 
    996996               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   syc0 (:,:,jk,:) = z3d(:,:,:) 
    997                znam = 'sxxc0'//'_l'//zchar1  
     997               znam = 'sxxc0'//'_l'//zchar1 
    998998               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxxc0(:,:,jk,:) = z3d(:,:,:) 
    999                znam = 'syyc0'//'_l'//zchar1  
     999               znam = 'syyc0'//'_l'//zchar1 
    10001000               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   syyc0(:,:,jk,:) = z3d(:,:,:) 
    1001                znam = 'sxyc0'//'_l'//zchar1  
     1001               znam = 'sxyc0'//'_l'//zchar1 
    10021002               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxyc0(:,:,jk,:) = z3d(:,:,:) 
    10031003            END DO 
     
    10051005            DO jk = 1, nlay_i 
    10061006               WRITE(zchar1,'(I2.2)') jk 
    1007                znam = 'sxe'//'_l'//zchar1    
     1007               znam = 'sxe'//'_l'//zchar1 
    10081008               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sxe (:,:,jk,:) = z3d(:,:,:) 
    1009                znam = 'sye'//'_l'//zchar1    
     1009               znam = 'sye'//'_l'//zchar1 
    10101010               CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp )   ;   sye (:,:,jk,:) = z3d(:,:,:) 
    1011                znam = 'sxxe'//'_l'//zchar1   
     1011               znam = 'sxxe'//'_l'//zchar1 
    10121012               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxxe(:,:,jk,:) = z3d(:,:,:) 
    1013                znam = 'syye'//'_l'//zchar1   
     1013               znam = 'syye'//'_l'//zchar1 
    10141014               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   syye(:,:,jk,:) = z3d(:,:,:) 
    1015                znam = 'sxye'//'_l'//zchar1   
     1015               znam = 'sxye'//'_l'//zchar1 
    10161016               CALL iom_get( numrir, jpdom_auto, znam , z3d )   ;   sxye(:,:,jk,:) = z3d(:,:,:) 
    10171017            END DO 
     
    11651165   SUBROUTINE icemax3D( pice , pmax ) 
    11661166      !!--------------------------------------------------------------------- 
    1167       !!                   ***  ROUTINE icemax3D ***                      
     1167      !!                   ***  ROUTINE icemax3D *** 
    11681168      !! ** Purpose :  compute the max of the 9 points around 
    11691169      !!---------------------------------------------------------------------- 
     
    11741174      !!---------------------------------------------------------------------- 
    11751175      DO jl = 1, jpl 
    1176          DO jj = Njs0-1, Nje0+1     
     1176         DO jj = Njs0-1, Nje0+1 
    11771177            DO ji = Nis0, Nie0 
    11781178               zmax(ji,jj) = MAX( epsi20, pice(ji,jj,jl), pice(ji-1,jj,jl), pice(ji+1,jj,jl) ) 
    11791179            END DO 
    11801180         END DO 
    1181          DO jj = Njs0, Nje0     
     1181         DO jj = Njs0, Nje0 
    11821182            DO ji = Nis0, Nie0 
    11831183               pmax(ji,jj,jl) = MAX( epsi20, zmax(ji,jj), zmax(ji,jj-1), zmax(ji,jj+1) ) 
     
    11891189   SUBROUTINE icemax4D( pice , pmax ) 
    11901190      !!--------------------------------------------------------------------- 
    1191       !!                   ***  ROUTINE icemax4D ***                      
     1191      !!                   ***  ROUTINE icemax4D *** 
    11921192      !! ** Purpose :  compute the max of the 9 points around 
    11931193      !!---------------------------------------------------------------------- 
     
    12001200      DO jl = 1, jpl 
    12011201         DO jk = 1, jlay 
    1202             DO jj = Njs0-1, Nje0+1     
     1202            DO jj = Njs0-1, Nje0+1 
    12031203               DO ji = Nis0, Nie0 
    12041204                  zmax(ji,jj) = MAX( epsi20, pice(ji,jj,jk,jl), pice(ji-1,jj,jk,jl), pice(ji+1,jj,jk,jl) ) 
    12051205               END DO 
    12061206            END DO 
    1207             DO jj = Njs0, Nje0     
     1207            DO jj = Njs0, Nje0 
    12081208               DO ji = Nis0, Nie0 
    12091209                  pmax(ji,jj,jk,jl) = MAX( epsi20, zmax(ji,jj), zmax(ji,jj-1), zmax(ji,jj+1) ) 
  • NEMO/trunk/src/ICE/icedyn_adv_umx.F90

    r14005 r14072  
    1414   !!   ultimate_x(_y)    : compute a tracer value at velocity points using ULTIMATE scheme at various orders 
    1515   !!   macho             : compute the fluxes 
    16    !!   nonosc_ice        : limit the fluxes using a non-oscillatory algorithm  
     16   !!   nonosc_ice        : limit the fluxes using a non-oscillatory algorithm 
    1717   !!---------------------------------------------------------------------- 
    1818   USE phycst         ! physical constant 
     
    6363      !!---------------------------------------------------------------------- 
    6464      !!                  ***  ROUTINE ice_dyn_adv_umx  *** 
    65       !!  
    66       !! **  Purpose :   Compute the now trend due to total advection of  
     65      !! 
     66      !! **  Purpose :   Compute the now trend due to total advection of 
    6767      !!                 tracers and add it to the general trend of tracer equations 
    6868      !!                 using an "Ultimate-Macho" scheme 
    6969      !! 
    70       !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74.  
     70      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74. 
    7171      !!---------------------------------------------------------------------- 
    7272      INTEGER                     , INTENT(in   ) ::   kn_umx     ! order of the scheme (1-5=UM or 20=CEN2) 
     
    103103      REAL(wp), DIMENSION(jpi,jpj,nlay_s,jpl) ::   ze_s, zes_max 
    104104      ! 
    105       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zuv_ho, zvv_ho, zuv_ups, zvv_ups, z1_vi, z1_vs  
     105      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zuv_ho, zvv_ho, zuv_ups, zvv_ups, z1_vi, z1_vs 
    106106      !! diagnostics 
    107       REAL(wp), DIMENSION(jpi,jpj)            ::   zdiag_adv_mass, zdiag_adv_salt, zdiag_adv_heat       
     107      REAL(wp), DIMENSION(jpi,jpj)            ::   zdiag_adv_mass, zdiag_adv_salt, zdiag_adv_heat 
    108108      !!---------------------------------------------------------------------- 
    109109      ! 
     
    131131         ELSEWHERE                      ; ze_s(:,:,jk,:) = 0._wp 
    132132         END WHERE 
    133       END DO    
     133      END DO 
    134134      CALL icemax4D( ze_i , zei_max ) 
    135135      CALL icemax4D( ze_s , zes_max ) 
     
    143143      zcflnow(1) =                  MAXVAL( ABS( pu_ice(:,:) ) * rDt_ice * r1_e1u(:,:) ) 
    144144      zcflnow(1) = MAX( zcflnow(1), MAXVAL( ABS( pv_ice(:,:) ) * rDt_ice * r1_e2v(:,:) ) ) 
    145        
     145 
    146146      ! non-blocking global communication send zcflnow and receive zcflprv 
    147147      CALL mpp_delay_max( 'icedyn_adv_umx', 'cflice', zcflnow(:), zcflprv(:), kt == nitend - nn_fsbc + 1 ) 
     
    157157      zvdx(:,:) = pv_ice(:,:) * e1v(:,:) 
    158158      ! 
    159       ! setup transport for each ice cat  
     159      ! setup transport for each ice cat 
    160160      DO jl = 1, jpl 
    161161         zu_cat(:,:,jl) = zudy(:,:) 
     
    190190         ! record at_i before advection (for open water) 
    191191         zati1(:,:) = SUM( pa_i(:,:,:), dim=3 ) 
    192           
     192 
    193193         ! inverse of A and Ap 
    194194         WHERE( pa_i(:,:,:) >= epsi20 )   ;   z1_ai(:,:,:) = 1._wp / pa_i(:,:,:) 
     
    201201         ! setup a mask where advection will be upstream 
    202202         IF( ll_neg ) THEN 
    203             IF( .NOT. ALLOCATED(imsk_small) )   ALLOCATE( imsk_small(jpi,jpj,jpl) )  
    204             IF( .NOT. ALLOCATED(jmsk_small) )   ALLOCATE( jmsk_small(jpi,jpj,jpl) )  
     203            IF( .NOT. ALLOCATED(imsk_small) )   ALLOCATE( imsk_small(jpi,jpj,jpl) ) 
     204            IF( .NOT. ALLOCATED(jmsk_small) )   ALLOCATE( jmsk_small(jpi,jpj,jpl) ) 
    205205            DO jl = 1, jpl 
    206206               DO_2D( 1, 0, 1, 0 ) 
     
    232232            CALL adv_umx( zamsk, kn_umx, jt, kt, zdt, zudy , zvdx, zua_ho , zva_ho , zcu_box, zcv_box, & 
    233233               &                                      zhvar, pv_i, zua_ups, zva_ups ) 
    234             !== Snw volume ==!          
     234            !== Snw volume ==! 
    235235            zhvar(:,:,:) = pv_s(:,:,:) * z1_ai(:,:,:) 
    236236            CALL adv_umx( zamsk, kn_umx, jt, kt, zdt, zudy , zvdx, zua_ho , zva_ho , zcu_box, zcv_box, & 
     
    260260            CALL adv_umx( zamsk, kn_umx, jt, kt, zdt, zudy , zvdx, zua_ho , zva_ho , zcu_box, zcv_box, & 
    261261               &                                      zhvar, pv_i, zua_ups, zva_ups ) 
    262             !== Snw volume ==!          
     262            !== Snw volume ==! 
    263263            zhvar(:,:,:) = pv_s(:,:,:) * z1_ai(:,:,:) 
    264264            CALL adv_umx( zamsk, kn_umx, jt, kt, zdt, zudy , zvdx, zua_ho , zva_ho , zcu_box, zcv_box, & 
     
    316316                  &                                      zhvar, pe_i(:,:,jk,:), zuv_ups, zvv_ups ) 
    317317            END DO 
    318             !== Snow volume ==!          
     318            !== Snow volume ==! 
    319319            zuv_ups = zua_ups 
    320320            zvv_ups = zva_ups 
     
    374374         zati2(:,:) = SUM( pa_i(:,:,:), dim=3 ) 
    375375         DO_2D( 0, 0, 0, 0 ) 
    376             pato_i(ji,jj) = pato_i(ji,jj) - ( zati2(ji,jj) - zati1(ji,jj) ) &  
     376            pato_i(ji,jj) = pato_i(ji,jj) - ( zati2(ji,jj) - zati1(ji,jj) ) & 
    377377               &                          - ( zudy(ji,jj) - zudy(ji-1,jj) + zvdx(ji,jj) - zvdx(ji,jj-1) ) * r1_e1e2t(ji,jj) * zdt 
    378378         END_2D 
     
    406406   END SUBROUTINE ice_dyn_adv_umx 
    407407 
    408     
     408 
    409409   SUBROUTINE adv_umx( pamsk, kn_umx, jt, kt, pdt, pu, pv, puc, pvc, pubox, pvbox,  & 
    410410      &                                            pt, ptc, pua_ups, pva_ups, pua_ho, pva_ho ) 
    411411      !!---------------------------------------------------------------------- 
    412412      !!                  ***  ROUTINE adv_umx  *** 
    413       !!  
    414       !! **  Purpose :   Compute the now trend due to total advection of  
     413      !! 
     414      !! **  Purpose :   Compute the now trend due to total advection of 
    415415      !!                 tracers and add it to the general trend of tracer equations 
    416416      !! 
     
    434434      !! 
    435435      !!             in eq. c), one can solve the equation for  S (ln_advS=T), then dVS/dt = -div(uV * uS  / u) 
    436       !!                                                or for HS (ln_advS=F), then dVS/dt = -div(uA * uHS / u)  
     436      !!                                                or for HS (ln_advS=F), then dVS/dt = -div(uA * uHS / u) 
    437437      !! 
    438438      !! ** Note : - this method can lead to tiny negative V (-1.e-20) => set it to 0 while conserving mass etc. 
     
    462462      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out), OPTIONAL ::   pua_ho, pva_ho   ! high order u*a fluxes 
    463463      ! 
    464       INTEGER  ::   ji, jj, jl       ! dummy loop indices   
     464      INTEGER  ::   ji, jj, jl       ! dummy loop indices 
    465465      REAL(wp) ::   ztra             ! local scalar 
    466466      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zfu_ho , zfv_ho , zpt 
     
    468468      !!---------------------------------------------------------------------- 
    469469      ! 
    470       ! Upstream (_ups) fluxes  
     470      ! Upstream (_ups) fluxes 
    471471      ! ----------------------- 
    472472      CALL upstream( pamsk, jt, kt, pdt, pt, pu, pv, zt_ups, zfu_ups, zfv_ups ) 
    473        
    474       ! High order (_ho) fluxes  
     473 
     474      ! High order (_ho) fluxes 
    475475      ! ----------------------- 
    476476      SELECT CASE( kn_umx ) 
     
    506506                  zfv_ups(ji,jj,jl) = zfv_ups(ji,jj,jl) * pva_ups(ji,jj,jl) / pv(ji,jj) 
    507507               ELSE 
    508                   zfv_ho (ji,jj,jl) = 0._wp   
    509                   zfv_ups(ji,jj,jl) = 0._wp   
     508                  zfv_ho (ji,jj,jl) = 0._wp 
     509                  zfv_ups(ji,jj,jl) = 0._wp 
    510510               ENDIF 
    511511            END_2D 
     
    551551      DO jl = 1, jpl 
    552552         DO_2D( 0, 0, 0, 0 ) 
    553             ztra = - ( zfu_ho(ji,jj,jl) - zfu_ho(ji-1,jj,jl) + zfv_ho(ji,jj,jl) - zfv_ho(ji,jj-1,jl) )   
    554             ! 
    555             ptc(ji,jj,jl) = ( ptc(ji,jj,jl) + ztra * r1_e1e2t(ji,jj) * pdt ) * tmask(ji,jj,1)                
     553            ztra = - ( zfu_ho(ji,jj,jl) - zfu_ho(ji-1,jj,jl) + zfv_ho(ji,jj,jl) - zfv_ho(ji,jj-1,jl) ) 
     554            ! 
     555            ptc(ji,jj,jl) = ( ptc(ji,jj,jl) + ztra * r1_e1e2t(ji,jj) * pdt ) * tmask(ji,jj,1) 
    556556         END_2D 
    557557      END DO 
     
    563563      !!--------------------------------------------------------------------- 
    564564      !!                    ***  ROUTINE upstream  *** 
    565       !!      
     565      !! 
    566566      !! **  Purpose :   compute the upstream fluxes and upstream guess of tracer 
    567567      !!---------------------------------------------------------------------- 
     
    572572      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt               ! tracer fields 
    573573      REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pu, pv           ! 2 ice velocity components 
    574       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_ups           ! upstream guess of tracer  
    575       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ups, pfv_ups ! upstream fluxes  
     574      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_ups           ! upstream guess of tracer 
     575      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ups, pfv_ups ! upstream fluxes 
    576576      ! 
    577577      INTEGER  ::   ji, jj, jl    ! dummy loop indices 
     
    638638            ! 
    639639         ENDIF 
    640           
     640 
    641641      ENDIF 
    642642      ! 
     
    655655   END SUBROUTINE upstream 
    656656 
    657     
     657 
    658658   SUBROUTINE cen2( pamsk, jt, kt, pdt, pt, pu, pv, pt_ups, pfu_ups, pfv_ups, pfu_ho, pfv_ho ) 
    659659      !!--------------------------------------------------------------------- 
    660660      !!                    ***  ROUTINE cen2  *** 
    661       !!      
     661      !! 
    662662      !! **  Purpose :   compute the high order fluxes using a centered 
    663       !!                 second order scheme  
     663      !!                 second order scheme 
    664664      !!---------------------------------------------------------------------- 
    665665      REAL(wp)                        , INTENT(in   ) ::   pamsk            ! advection of concentration (1) or other tracers (0) 
     
    669669      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt               ! tracer fields 
    670670      REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pu, pv           ! 2 ice velocity components 
    671       REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt_ups           ! upstream guess of tracer  
    672       REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pfu_ups, pfv_ups ! upstream fluxes  
    673       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho, pfv_ho   ! high order fluxes  
     671      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt_ups           ! upstream guess of tracer 
     672      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pfu_ups, pfv_ups ! upstream fluxes 
     673      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho, pfv_ho   ! high order fluxes 
    674674      ! 
    675675      INTEGER  ::   ji, jj, jl    ! dummy loop indices 
     
    750750         ENDIF 
    751751         IF( np_limiter == 1 )   CALL nonosc_ice( pamsk, pdt, pu, pv, pt, pt_ups, pfu_ups, pfv_ups, pfu_ho, pfv_ho ) 
    752           
     752 
    753753      ENDIF 
    754     
     754 
    755755   END SUBROUTINE cen2 
    756756 
    757     
     757 
    758758   SUBROUTINE macho( pamsk, kn_umx, jt, kt, pdt, pt, pu, pv, pubox, pvbox, pt_ups, pfu_ups, pfv_ups, pfu_ho, pfv_ho ) 
    759759      !!--------------------------------------------------------------------- 
    760760      !!                    ***  ROUTINE macho  *** 
    761       !!      
    762       !! **  Purpose :   compute the high order fluxes using Ultimate-Macho scheme   
     761      !! 
     762      !! **  Purpose :   compute the high order fluxes using Ultimate-Macho scheme 
    763763      !! 
    764764      !! **  Method  :   ... 
    765765      !! 
    766       !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74.  
     766      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74. 
    767767      !!---------------------------------------------------------------------- 
    768768      REAL(wp)                        , INTENT(in   ) ::   pamsk            ! advection of concentration (1) or other tracers (0) 
     
    774774      REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pu, pv           ! 2 ice velocity components 
    775775      REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pubox, pvbox     ! upstream velocity 
    776       REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt_ups           ! upstream guess of tracer  
    777       REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pfu_ups, pfv_ups ! upstream fluxes  
    778       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho, pfv_ho   ! high order fluxes  
     776      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt_ups           ! upstream guess of tracer 
     777      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pfu_ups, pfv_ups ! upstream fluxes 
     778      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho, pfv_ho   ! high order fluxes 
    779779      ! 
    780780      INTEGER  ::   ji, jj, jl    ! dummy loop indices 
     
    807807         !                                                        !--  limiter in y --! 
    808808         IF( np_limiter == 2 .OR. np_limiter == 3 )   CALL limiter_y( pdt, pv, pt, pfv_ups, pfv_ho ) 
    809          !          
     809         ! 
    810810         ! 
    811811      ELSE                                                               !==  even ice time step:  adv_y then adv_x  ==! 
     
    821821                  &                              + pt   (ji,jj,jl) * ( pv  (ji,jj   ) - pv  (ji,jj-1   ) ) * r1_e1e2t(ji,jj) & 
    822822                  &                                                                                        * pamsk           & 
    823                   &                             ) * pdt ) * tmask(ji,jj,1)  
     823                  &                             ) * pdt ) * tmask(ji,jj,1) 
    824824            END_2D 
    825825         END DO 
     
    845845      !!--------------------------------------------------------------------- 
    846846      !!                    ***  ROUTINE ultimate_x  *** 
    847       !!      
    848       !! **  Purpose :   compute tracer at u-points  
     847      !! 
     848      !! **  Purpose :   compute tracer at u-points 
    849849      !! 
    850850      !! **  Method  :   ... 
    851851      !! 
    852       !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74.  
     852      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74. 
    853853      !!---------------------------------------------------------------------- 
    854854      REAL(wp)                        , INTENT(in   ) ::   pamsk     ! advection of concentration (1) or other tracers (0) 
     
    857857      REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pu        ! ice i-velocity component 
    858858      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt        ! tracer fields 
    859       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_u      ! tracer at u-point  
    860       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho    ! high order flux  
     859      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_u      ! tracer at u-point 
     860      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfu_ho    ! high order flux 
    861861      ! 
    862862      INTEGER  ::   ji, jj, jl             ! dummy loop indices 
     
    897897      ! 
    898898      CASE( 1 )                                                   !==  1st order central TIM  ==! (Eq. 21) 
    899          !         
     899         ! 
    900900         DO jl = 1, jpl 
    901901            DO_2D( 0, 0, 1, 0 ) 
     
    911911               zcu  = pu(ji,jj) * r1_e2u(ji,jj) * pdt * r1_e1u(ji,jj) 
    912912               pt_u(ji,jj,jl) = 0.5_wp * umask(ji,jj,1) * (                                pt(ji+1,jj,jl) + pt(ji,jj,jl)   & 
    913                   &                                                            - zcu   * ( pt(ji+1,jj,jl) - pt(ji,jj,jl) ) )  
    914             END_2D 
    915          END DO 
    916          !   
     913                  &                                                            - zcu   * ( pt(ji+1,jj,jl) - pt(ji,jj,jl) ) ) 
     914            END_2D 
     915         END DO 
     916         ! 
    917917      CASE( 3 )                                                   !==  3rd order central TIM  ==! (Eq. 24) 
    918918         ! 
     
    983983      ! 
    984984   END SUBROUTINE ultimate_x 
    985     
    986   
     985 
     986 
    987987   SUBROUTINE ultimate_y( pamsk, kn_umx, pdt, pt, pv, pt_v, pfv_ho ) 
    988988      !!--------------------------------------------------------------------- 
    989989      !!                    ***  ROUTINE ultimate_y  *** 
    990       !!      
    991       !! **  Purpose :   compute tracer at v-points  
     990      !! 
     991      !! **  Purpose :   compute tracer at v-points 
    992992      !! 
    993993      !! **  Method  :   ... 
    994994      !! 
    995       !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74.  
     995      !! Reference : Leonard, B.P., 1991, Comput. Methods Appl. Mech. Eng., 88, 17-74. 
    996996      !!---------------------------------------------------------------------- 
    997997      REAL(wp)                        , INTENT(in   ) ::   pamsk     ! advection of concentration (1) or other tracers (0) 
     
    10001000      REAL(wp), DIMENSION(:,:  )      , INTENT(in   ) ::   pv        ! ice j-velocity component 
    10011001      REAL(wp), DIMENSION(:,:,:)      , INTENT(in   ) ::   pt        ! tracer fields 
    1002       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_v      ! tracer at v-point  
    1003       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfv_ho    ! high order flux  
     1002      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pt_v      ! tracer at v-point 
     1003      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   pfv_ho    ! high order flux 
    10041004      ! 
    10051005      INTEGER  ::   ji, jj, jl         ! dummy loop indices 
     
    11151115      ! 
    11161116   END SUBROUTINE ultimate_y 
    1117       
     1117 
    11181118 
    11191119   SUBROUTINE nonosc_ice( pamsk, pdt, pu, pv, pt, pt_ups, pfu_ups, pfv_ups, pfu_ho, pfv_ho ) 
    11201120      !!--------------------------------------------------------------------- 
    11211121      !!                    ***  ROUTINE nonosc_ice  *** 
    1122       !!      
    1123       !! **  Purpose :   compute monotonic tracer fluxes from the upstream  
    1124       !!       scheme and the before field by a non-oscillatory algorithm  
     1122      !! 
     1123      !! **  Purpose :   compute monotonic tracer fluxes from the upstream 
     1124      !!       scheme and the before field by a non-oscillatory algorithm 
    11251125      !! 
    11261126      !! **  Method  :   ... 
     
    11411141      !!---------------------------------------------------------------------- 
    11421142      zbig = 1.e+40_wp 
    1143        
     1143 
    11441144      ! antidiffusive flux : high order minus low order 
    11451145      ! -------------------------------------------------- 
     
    11571157      !                                    pfu_ho 
    11581158      !                           *         ---> 
    1159       !                        |      |  *   |        |  
    1160       !                        |      |      |    *   |     
     1159      !                        |      |  *   |        | 
     1160      !                        |      |      |    *   | 
    11611161      !                        |      |      |        |    * 
    1162       !            t_ups :       i-1     i       i+1       i+2    
     1162      !            t_ups :       i-1     i       i+1       i+2 
    11631163      IF( ll_prelim ) THEN 
    1164           
     1164 
    11651165         DO jl = 1, jpl 
    11661166            DO_2D( 0, 0, 0, 0 ) 
     
    12001200      z1_dt = 1._wp / pdt 
    12011201      DO jl = 1, jpl 
    1202           
     1202 
    12031203         DO_2D( 1, 1, 1, 1 ) 
    12041204            IF    ( pt(ji,jj,jl) <= 0._wp .AND. pt_ups(ji,jj,jl) <= 0._wp ) THEN 
     
    12441244            ! if all the points are outside ice cover 
    12451245            IF( zup == -zbig )   zbetup(ji,jj,jl) = 0._wp ! zbig 
    1246             IF( zdo ==  zbig )   zbetdo(ji,jj,jl) = 0._wp ! zbig             
     1246            IF( zdo ==  zbig )   zbetdo(ji,jj,jl) = 0._wp ! zbig 
    12471247            ! 
    12481248         END_2D 
     
    12501250      CALL lbc_lnk_multi( 'icedyn_adv_umx', zbetup, 'T', 1.0_wp, zbetdo, 'T', 1.0_wp )   ! lateral boundary cond. (unchanged sign) 
    12511251 
    1252        
     1252 
    12531253      ! monotonic flux in the y direction 
    12541254      ! --------------------------------- 
     
    12801280   END SUBROUTINE nonosc_ice 
    12811281 
    1282     
     1282 
    12831283   SUBROUTINE limiter_x( pdt, pu, pt, pfu_ups, pfu_ho ) 
    12841284      !!--------------------------------------------------------------------- 
    12851285      !!                    ***  ROUTINE limiter_x  *** 
    1286       !!      
    1287       !! **  Purpose :   compute flux limiter  
     1286      !! 
     1287      !! **  Purpose :   compute flux limiter 
    12881288      !!---------------------------------------------------------------------- 
    12891289      REAL(wp)                  , INTENT(in   ) ::   pdt          ! tracer time-step 
     
    12951295      REAL(wp) ::   Cr, Rjm, Rj, Rjp, uCFL, zpsi, zh3, zlimiter, Rr 
    12961296      INTEGER  ::   ji, jj, jl    ! dummy loop indices 
    1297       REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpx       ! tracer slopes  
     1297      REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpx       ! tracer slopes 
    12981298      !!---------------------------------------------------------------------- 
    12991299      ! 
     
    13041304      END DO 
    13051305      CALL lbc_lnk( 'icedyn_adv_umx', zslpx, 'U', -1.0_wp)   ! lateral boundary cond. 
    1306        
     1306 
    13071307      DO jl = 1, jpl 
    13081308         DO_2D( 0, 0, 0, 0 ) 
    13091309            uCFL = pdt * ABS( pu(ji,jj) ) * r1_e1e2t(ji,jj) 
    1310              
     1310 
    13111311            Rjm = zslpx(ji-1,jj,jl) 
    13121312            Rj  = zslpx(ji  ,jj,jl) 
     
    13191319               ENDIF 
    13201320 
    1321                zh3 = pfu_ho(ji,jj,jl) - pfu_ups(ji,jj,jl)      
     1321               zh3 = pfu_ho(ji,jj,jl) - pfu_ups(ji,jj,jl) 
    13221322               IF( Rj > 0. ) THEN 
    13231323                  zlimiter =  MAX( 0., MIN( zh3, MAX(-Rr * 0.5 * ABS(pu(ji,jj)),  & 
     
    13711371   END SUBROUTINE limiter_x 
    13721372 
    1373     
     1373 
    13741374   SUBROUTINE limiter_y( pdt, pv, pt, pfv_ups, pfv_ho ) 
    13751375      !!--------------------------------------------------------------------- 
    13761376      !!                    ***  ROUTINE limiter_y  *** 
    1377       !!      
    1378       !! **  Purpose :   compute flux limiter  
     1377      !! 
     1378      !! **  Purpose :   compute flux limiter 
    13791379      !!---------------------------------------------------------------------- 
    13801380      REAL(wp)                   , INTENT(in   ) ::   pdt          ! tracer time-step 
     
    13861386      REAL(wp) ::   Cr, Rjm, Rj, Rjp, vCFL, zpsi, zh3, zlimiter, Rr 
    13871387      INTEGER  ::   ji, jj, jl    ! dummy loop indices 
    1388       REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpy       ! tracer slopes  
     1388      REAL(wp), DIMENSION (jpi,jpj,jpl) ::   zslpy       ! tracer slopes 
    13891389      !!---------------------------------------------------------------------- 
    13901390      ! 
     
    14101410               ENDIF 
    14111411 
    1412                zh3 = pfv_ho(ji,jj,jl) - pfv_ups(ji,jj,jl)      
     1412               zh3 = pfv_ho(ji,jj,jl) - pfv_ups(ji,jj,jl) 
    14131413               IF( Rj > 0. ) THEN 
    14141414                  zlimiter =  MAX( 0., MIN( zh3, MAX(-Rr * 0.5 * ABS(pv(ji,jj)),  & 
     
    15241524                  pe_s(ji,jj,1:nlay_s,jl) = pe_s(ji,jj,1:nlay_s,jl) * zfra 
    15251525                  pv_s(ji,jj,jl)          = pa_i(ji,jj,jl) * phs_max(ji,jj,jl) 
    1526                ENDIF            
    1527                !                   
     1526               ENDIF 
     1527               ! 
    15281528               !                               ! -- check s_i -- ! 
    15291529               ! if s_i is larger than the surrounding 9 pts => put salt excess in the ocean 
     
    15371537            ENDIF 
    15381538         END_2D 
    1539       END DO  
     1539      END DO 
    15401540      ! 
    15411541      !                                           ! -- check e_i/v_i -- ! 
     
    16241624   SUBROUTINE icemax3D( pice , pmax ) 
    16251625      !!--------------------------------------------------------------------- 
    1626       !!                   ***  ROUTINE icemax3D ***                      
     1626      !!                   ***  ROUTINE icemax3D *** 
    16271627      !! ** Purpose :  compute the max of the 9 points around 
    16281628      !!---------------------------------------------------------------------- 
     
    16331633      !!---------------------------------------------------------------------- 
    16341634      DO jl = 1, jpl 
    1635          DO jj = Njs0-1, Nje0+1     
     1635         DO jj = Njs0-1, Nje0+1 
    16361636            DO ji = Nis0, Nie0 
    16371637               zmax(ji,jj) = MAX( epsi20, pice(ji,jj,jl), pice(ji-1,jj,jl), pice(ji+1,jj,jl) ) 
    16381638            END DO 
    16391639         END DO 
    1640          DO jj = Njs0, Nje0     
     1640         DO jj = Njs0, Nje0 
    16411641            DO ji = Nis0, Nie0 
    16421642               pmax(ji,jj,jl) = MAX( epsi20, zmax(ji,jj), zmax(ji,jj-1), zmax(ji,jj+1) ) 
     
    16481648   SUBROUTINE icemax4D( pice , pmax ) 
    16491649      !!--------------------------------------------------------------------- 
    1650       !!                   ***  ROUTINE icemax4D ***                      
     1650      !!                   ***  ROUTINE icemax4D *** 
    16511651      !! ** Purpose :  compute the max of the 9 points around 
    16521652      !!---------------------------------------------------------------------- 
     
    16591659      DO jl = 1, jpl 
    16601660         DO jk = 1, jlay 
    1661             DO jj = Njs0-1, Nje0+1     
     1661            DO jj = Njs0-1, Nje0+1 
    16621662               DO ji = Nis0, Nie0 
    16631663                  zmax(ji,jj) = MAX( epsi20, pice(ji,jj,jk,jl), pice(ji-1,jj,jk,jl), pice(ji+1,jj,jk,jl) ) 
    16641664               END DO 
    16651665            END DO 
    1666             DO jj = Njs0, Nje0     
     1666            DO jj = Njs0, Nje0 
    16671667               DO ji = Nis0, Nie0 
    16681668                  pmax(ji,jj,jk,jl) = MAX( epsi20, zmax(ji,jj), zmax(ji,jj-1), zmax(ji,jj+1) ) 
  • NEMO/trunk/src/ICE/icedyn_rdgrft.F90

    r14011 r14072  
    22   !!====================================================================== 
    33   !!                       ***  MODULE icedyn_rdgrft *** 
    4    !!    sea-ice : Mechanical impact on ice thickness distribution       
     4   !!    sea-ice : Mechanical impact on ice thickness distribution 
    55   !!====================================================================== 
    6    !! History :       !  2006-02  (M. Vancoppenolle) Original code  
     6   !! History :       !  2006-02  (M. Vancoppenolle) Original code 
    77   !!            4.0  !  2018     (many people)      SI3 [aka Sea Ice cube] 
    88   !!---------------------------------------------------------------------- 
     
    1616   !!---------------------------------------------------------------------- 
    1717   USE dom_oce        ! ocean domain 
    18    USE phycst         ! physical constants (ocean directory)  
     18   USE phycst         ! physical constants (ocean directory) 
    1919   USE sbc_oce , ONLY : sss_m, sst_m   ! surface boundary condition: ocean fields 
    2020   USE ice1D          ! sea-ice: thermodynamics 
     
    5959   LOGICAL  ::   ln_str_H79       ! ice strength parameterization (Hibler79) 
    6060   REAL(wp) ::   rn_pstar         ! determines ice strength, Hibler JPO79 
    61    REAL(wp) ::   rn_csrdg         ! fraction of shearing energy contributing to ridging             
     61   REAL(wp) ::   rn_csrdg         ! fraction of shearing energy contributing to ridging 
    6262   LOGICAL  ::   ln_partf_lin     ! participation function linear (Thorndike et al. (1975)) 
    6363   REAL(wp) ::   rn_gstar         !    fractional area of young ice contributing to ridging 
    6464   LOGICAL  ::   ln_partf_exp     ! participation function exponential (Lipscomb et al. (2007)) 
    6565   REAL(wp) ::   rn_astar         !    equivalent of G* for an exponential participation function 
    66    LOGICAL  ::   ln_ridging       ! ridging of ice or not                         
     66   LOGICAL  ::   ln_ridging       ! ridging of ice or not 
    6767   REAL(wp) ::   rn_hstar         !    thickness that determines the maximal thickness of ridged ice 
    6868   REAL(wp) ::   rn_porordg       !    initial porosity of ridges (0.3 regular value) 
    6969   REAL(wp) ::   rn_fsnwrdg       !    fractional snow loss to the ocean during ridging 
    7070   REAL(wp) ::   rn_fpndrdg       !    fractional pond loss to the ocean during ridging 
    71    LOGICAL  ::   ln_rafting       ! rafting of ice or not                         
    72    REAL(wp) ::   rn_hraft         !    threshold thickness (m) for rafting / ridging  
     71   LOGICAL  ::   ln_rafting       ! rafting of ice or not 
     72   REAL(wp) ::   rn_hraft         !    threshold thickness (m) for rafting / ridging 
    7373   REAL(wp) ::   rn_craft         !    coefficient for smoothness of the hyperbolic tangent in rafting 
    7474   REAL(wp) ::   rn_fsnwrft       !    fractional snow loss to the ocean during rafting 
     
    124124      !!                Hibler, W. D. III, 1980, MWR, 108, 1943-1973, 1980. 
    125125      !!                Rothrock, D. A., 1975: JGR, 80, 4514-4519. 
    126       !!                Thorndike et al., 1975, JGR, 80, 4501-4513.  
     126      !!                Thorndike et al., 1975, JGR, 80, 4501-4513. 
    127127      !!                Bitz et al., JGR, 2001 
    128128      !!                Amundrud and Melling, JGR 2005 
    129       !!                Babko et al., JGR 2002  
     129      !!                Babko et al., JGR 2002 
    130130      !! 
    131131      !!     This routine is based on CICE code and authors William H. Lipscomb, 
     
    135135      !! 
    136136      INTEGER  ::   ji, jj, jk, jl             ! dummy loop index 
    137       INTEGER  ::   iter, iterate_ridging      ! local integer  
     137      INTEGER  ::   iter, iterate_ridging      ! local integer 
    138138      INTEGER  ::   ipti                       ! local integer 
    139139      REAL(wp) ::   zfac                       ! local scalar 
     
    142142      REAL(wp), DIMENSION(jpij) ::   zconv         ! 1D rdg_conv (if EAP rheology) 
    143143      ! 
    144       INTEGER, PARAMETER ::   jp_itermax = 20     
     144      INTEGER, PARAMETER ::   jp_itermax = 20 
    145145      !!------------------------------------------------------------------- 
    146146      ! controls 
     
    153153         IF(lwp) WRITE(numout,*)'ice_dyn_rdgrft: ice ridging and rafting' 
    154154         IF(lwp) WRITE(numout,*)'~~~~~~~~~~~~~~' 
    155       ENDIF       
     155      ENDIF 
    156156 
    157157      !-------------------------------- 
     
    168168         ENDIF 
    169169      END_2D 
    170        
     170 
    171171      !-------------------------------------------------------- 
    172172      ! 1) Dynamical inputs (closing rate, divergence, opening) 
    173173      !-------------------------------------------------------- 
    174174      IF( npti > 0 ) THEN 
    175          
     175 
    176176         ! just needed here 
    177177         CALL tab_2d_1d( npti, nptidx(1:npti), zdelt   (1:npti)      , delta_i ) 
     
    184184 
    185185         DO ji = 1, npti 
    186             ! closing_net = rate at which open water area is removed + ice area removed by ridging  
     186            ! closing_net = rate at which open water area is removed + ice area removed by ridging 
    187187            !                                                        - ice area added in new ridges 
    188             IF( ln_rhg_EVP .OR. ln_rhg_VP ) &  
     188            IF( ln_rhg_EVP .OR. ln_rhg_VP ) & 
    189189               &               closing_net(ji) = rn_csrdg * 0.5_wp * ( zdelt(ji) - ABS( zdivu(ji) ) ) - MIN( zdivu(ji), 0._wp ) 
    190190            IF( ln_rhg_EAP )   closing_net(ji) = zconv(ji) 
     
    225225      !----------------- 
    226226      IF( npti > 0 ) THEN 
    227           
     227 
    228228         CALL ice_dyn_1d2d( 1 )            ! --- Move to 1D arrays --- ! 
    229229 
    230230         iter            = 1 
    231          iterate_ridging = 1       
     231         iterate_ridging = 1 
    232232         !                                                        !----------------------! 
    233233         DO WHILE( iterate_ridging > 0 .AND. iter < jp_itermax )  !  ridging iterations  ! 
     
    268268 
    269269      ENDIF 
    270     
    271       CALL ice_var_agg( 1 )  
     270 
     271      CALL ice_var_agg( 1 ) 
    272272 
    273273      ! controls 
     
    287287      !! ** Purpose :   preparation for ridging calculations 
    288288      !! 
    289       !! ** Method  :   Compute the thickness distribution of the ice and open water  
     289      !! ** Method  :   Compute the thickness distribution of the ice and open water 
    290290      !!                participating in ridging and of the resulting ridges. 
    291291      !!------------------------------------------------------------------- 
    292       REAL(wp), DIMENSION(:)  , INTENT(in) ::   pato_i, pclosing_net  
    293       REAL(wp), DIMENSION(:,:), INTENT(in) ::   pa_i, pv_i  
     292      REAL(wp), DIMENSION(:)  , INTENT(in) ::   pato_i, pclosing_net 
     293      REAL(wp), DIMENSION(:,:), INTENT(in) ::   pa_i, pv_i 
    294294      !! 
    295295      INTEGER  ::   ji, jl                     ! dummy loop indices 
    296296      REAL(wp) ::   z1_gstar, z1_astar, zhmean, zfac   ! local scalar 
    297       REAL(wp), DIMENSION(jpij)        ::   zasum, z1_asum, zaksum   ! sum of a_i+ato_i and reverse  
     297      REAL(wp), DIMENSION(jpij)        ::   zasum, z1_asum, zaksum   ! sum of a_i+ato_i and reverse 
    298298      REAL(wp), DIMENSION(jpij,jpl)    ::   zhi                      ! ice thickness 
    299299      REAL(wp), DIMENSION(jpij,-1:jpl) ::   zGsum                    ! zGsum(n) = sum of areas in categories 0 to n 
     
    321321      ! This is analogous to 
    322322      !   a(h) = b(h)g(h) as defined in Thorndike et al. (1975). 
    323       !   assuming b(h) = (2/Gstar) * (1 - G(h)/Gstar).  
     323      !   assuming b(h) = (2/Gstar) * (1 - G(h)/Gstar). 
    324324      ! 
    325325      ! apartf = integrating b(h)g(h) between the category boundaries 
     
    346346      ! 
    347347      IF( ln_partf_lin ) THEN          !--- Linear formulation (Thorndike et al., 1975) 
    348          DO jl = 0, jpl     
     348         DO jl = 0, jpl 
    349349            DO ji = 1, npti 
    350350               IF    ( zGsum(ji,jl)   < rn_gstar ) THEN 
     
    361361         ! 
    362362      ELSEIF( ln_partf_exp ) THEN      !--- Exponential, more stable formulation (Lipscomb et al, 2007) 
    363          !                         
     363         ! 
    364364         zfac = 1._wp / ( 1._wp - EXP(-z1_astar) ) 
    365365         DO jl = -1, jpl 
     
    391391            END DO 
    392392         END DO 
    393       ELSEIF( ln_rafting .AND. .NOT. ln_ridging ) THEN   !- rafting alone    
     393      ELSEIF( ln_rafting .AND. .NOT. ln_ridging ) THEN   !- rafting alone 
    394394         DO jl = 1, jpl 
    395395            DO ji = 1, npti 
     
    402402            DO ji = 1, npti 
    403403               aridge(ji,jl) = 0._wp 
    404                araft (ji,jl) = 0._wp          
     404               araft (ji,jl) = 0._wp 
    405405            END DO 
    406406         END DO 
     
    411411      ! Compute max and min ridged ice thickness for each ridging category. 
    412412      ! Assume ridged ice is uniformly distributed between hrmin and hrmax. 
    413       !  
     413      ! 
    414414      ! This parameterization is a modified version of Hibler (1980). 
    415415      ! The mean ridging thickness, zhmean, is proportional to hi^(0.5) 
    416416      !  and for very thick ridging ice must be >= hrdg_hi_min*hi 
    417417      ! 
    418       ! The minimum ridging thickness, hrmin, is equal to 2*hi  
     418      ! The minimum ridging thickness, hrmin, is equal to 2*hi 
    419419      !  (i.e., rafting) and for very thick ridging ice is 
    420420      !  constrained by hrmin <= (zhmean + hi)/2. 
    421       !  
     421      ! 
    422422      ! The maximum ridging thickness, hrmax, is determined by zhmean and hrmin. 
    423423      ! 
     
    445445                  &                    + araft (ji,jl) * ( 1._wp - hi_hrft ) 
    446446            ELSE 
    447                hrmin  (ji,jl) = 0._wp  
    448                hrmax  (ji,jl) = 0._wp  
    449                hraft  (ji,jl) = 0._wp  
     447               hrmin  (ji,jl) = 0._wp 
     448               hrmax  (ji,jl) = 0._wp 
     449               hraft  (ji,jl) = 0._wp 
    450450               hi_hrdg(ji,jl) = 1._wp 
    451451            ENDIF 
     
    455455      ! 3) closing_gross 
    456456      !----------------- 
    457       ! Based on the ITD of ridging and ridged ice, convert the net closing rate to a gross closing rate.   
     457      ! Based on the ITD of ridging and ridged ice, convert the net closing rate to a gross closing rate. 
    458458      ! NOTE: 0 < aksum <= 1 
    459459      WHERE( zaksum(1:npti) > epsi10 )   ;   closing_gross(1:npti) = pclosing_net(1:npti) / zaksum(1:npti) 
    460460      ELSEWHERE                          ;   closing_gross(1:npti) = 0._wp 
    461461      END WHERE 
    462        
     462 
    463463      ! correction to closing rate if excessive ice removal 
    464464      !---------------------------------------------------- 
     
    472472            ENDIF 
    473473         END DO 
    474       END DO       
     474      END DO 
    475475 
    476476      ! 4) correction to opening if excessive open water removal 
     
    478478      ! Reduce the closing rate if more than 100% of the open water would be removed 
    479479      ! Reduce the opening rate in proportion 
    480       DO ji = 1, npti   
     480      DO ji = 1, npti 
    481481         zfac = pato_i(ji) + ( opning(ji) - apartf(ji,0) * closing_gross(ji) ) * rDt_ice 
    482482         IF( zfac < 0._wp ) THEN           ! would lead to negative ato_i 
    483             opning(ji) = apartf(ji,0) * closing_gross(ji) - pato_i(ji) * r1_Dt_ice  
     483            opning(ji) = apartf(ji,0) * closing_gross(ji) - pato_i(ji) * r1_Dt_ice 
    484484         ELSEIF( zfac > zasum(ji) ) THEN   ! would lead to ato_i > asum 
    485             opning(ji) = apartf(ji,0) * closing_gross(ji) + ( zasum(ji) - pato_i(ji) ) * r1_Dt_ice  
     485            opning(ji) = apartf(ji,0) * closing_gross(ji) + ( zasum(ji) - pato_i(ji) ) * r1_Dt_ice 
    486486         ENDIF 
    487487      END DO 
     
    503503      REAL(wp) ::   hL, hR, farea              ! left and right limits of integration and new area going to jl2 
    504504      REAL(wp) ::   vsw                        ! vol of water trapped into ridges 
    505       REAL(wp) ::   afrdg, afrft               ! fraction of category area ridged/rafted  
     505      REAL(wp) ::   afrdg, afrft               ! fraction of category area ridged/rafted 
    506506      REAL(wp)                  ::   airdg1, oirdg1, aprdg1, virdg1, sirdg1 
    507507      REAL(wp)                  ::   airft1, oirft1, aprft1 
     
    516516      REAL(wp), DIMENSION(jpij,nlay_s) ::   esrft     ! snow energy of rafting ice 
    517517      REAL(wp), DIMENSION(jpij,nlay_i) ::   eirft     ! ice  energy of rafting ice 
    518       REAL(wp), DIMENSION(jpij,nlay_s) ::   esrdg     ! enth*volume of new ridges       
     518      REAL(wp), DIMENSION(jpij,nlay_s) ::   esrdg     ! enth*volume of new ridges 
    519519      REAL(wp), DIMENSION(jpij,nlay_i) ::   eirdg     ! enth*volume of new ridges 
    520520      ! 
     
    529529         ato_i_1d(ji) = MAX( 0._wp, ato_i_1d(ji) + ( opning(ji) - apartf(ji,0) * closing_gross(ji) ) * rDt_ice ) 
    530530      END DO 
    531        
    532       ! 2) compute categories in which ice is removed (jl1)  
     531 
     532      ! 2) compute categories in which ice is removed (jl1) 
    533533      !---------------------------------------------------- 
    534534      DO jl1 = 1, jpl 
    535535 
    536          IF( nn_icesal /= 2 )  THEN       
     536         IF( nn_icesal /= 2 )  THEN 
    537537            CALL tab_2d_1d( npti, nptidx(1:npti), s_i_1d(1:npti), s_i(:,:,jl1) ) 
    538538         ENDIF 
     
    545545               ELSE                                 ;   z1_ai(ji) = 0._wp 
    546546               ENDIF 
    547                 
     547 
    548548               ! area of ridging / rafting ice (airdg1) and of new ridge (airdg2) 
    549549               airdg1 = aridge(ji,jl1) * closing_gross(ji) * rDt_ice 
     
    571571               sirdg2(ji) = sv_i_2d(ji,jl1)   * afrdg + vsw * sss_1d(ji) 
    572572               oirdg1     = oa_i_2d(ji,jl1)   * afrdg 
    573                oirdg2(ji) = oa_i_2d(ji,jl1)   * afrdg * hi_hrdg(ji,jl1)  
     573               oirdg2(ji) = oa_i_2d(ji,jl1)   * afrdg * hi_hrdg(ji,jl1) 
    574574 
    575575               virft(ji)  = v_i_2d (ji,jl1)   * afrft 
    576576               vsrft(ji)  = v_s_2d (ji,jl1)   * afrft 
    577                sirft(ji)  = sv_i_2d(ji,jl1)   * afrft  
    578                oirft1     = oa_i_2d(ji,jl1)   * afrft  
    579                oirft2(ji) = oa_i_2d(ji,jl1)   * afrft * hi_hrft  
     577               sirft(ji)  = sv_i_2d(ji,jl1)   * afrft 
     578               oirft1     = oa_i_2d(ji,jl1)   * afrft 
     579               oirft2(ji) = oa_i_2d(ji,jl1)   * afrft * hi_hrft 
    580580 
    581581               IF ( ln_pnd_LEV .OR. ln_pnd_TOPO ) THEN 
     
    595595               wfx_dyn_1d(ji) = wfx_dyn_1d(ji) - vsw * rhoi * r1_Dt_ice   ! increase in ice volume due to seawater frozen in voids 
    596596               sfx_dyn_1d(ji) = sfx_dyn_1d(ji) - vsw * sss_1d(ji) * rhoi * r1_Dt_ice 
    597                hfx_dyn_1d(ji) = hfx_dyn_1d(ji) + ersw(ji) * r1_Dt_ice          ! > 0 [W.m-2]  
     597               hfx_dyn_1d(ji) = hfx_dyn_1d(ji) + ersw(ji) * r1_Dt_ice          ! > 0 [W.m-2] 
    598598 
    599599               ! Put the snow lost by ridging into the ocean 
     
    606606                  sirdg2(ji)     = sirdg2(ji)     - vsw * ( sss_1d(ji) - s_i_1d(ji) )       ! ridge salinity = s_i 
    607607                  sfx_bri_1d(ji) = sfx_bri_1d(ji) + sss_1d(ji) * vsw * rhoi * r1_Dt_ice  &  ! put back sss_m into the ocean 
    608                      &                            - s_i_1d(ji) * vsw * rhoi * r1_Dt_ice     ! and get  s_i  from the ocean  
     608                     &                            - s_i_1d(ji) * vsw * rhoi * r1_Dt_ice     ! and get  s_i  from the ocean 
    609609               ENDIF 
    610610 
     
    643643                  ! Remove energy of new ridge to each category jl1 
    644644                  !------------------------------------------------- 
    645                   ze_s_2d(ji,jk,jl1) = ze_s_2d(ji,jk,jl1) * ( 1._wp - afrdg - afrft )  
     645                  ze_s_2d(ji,jk,jl1) = ze_s_2d(ji,jk,jl1) * ( 1._wp - afrdg - afrft ) 
    646646               ENDIF 
    647647            END DO 
    648648         END DO 
    649                    
     649 
    650650         ! special loop for e_i because of layers jk 
    651651         DO jk = 1, nlay_i 
     
    661661                  ! Remove energy of new ridge to each category jl1 
    662662                  !------------------------------------------------- 
    663                   ze_i_2d(ji,jk,jl1) = ze_i_2d(ji,jk,jl1) * ( 1._wp - afrdg - afrft )  
     663                  ze_i_2d(ji,jk,jl1) = ze_i_2d(ji,jk,jl1) * ( 1._wp - afrdg - afrft ) 
    664664               ENDIF 
    665665            END DO 
    666666         END DO 
    667           
    668          ! 3) compute categories in which ice is added (jl2)  
     667 
     668         ! 3) compute categories in which ice is added (jl2) 
    669669         !-------------------------------------------------- 
    670670         itest_rdg(1:npti) = 0 
    671671         itest_rft(1:npti) = 0 
    672          DO jl2  = 1, jpl  
     672         DO jl2  = 1, jpl 
    673673            ! 
    674674            DO ji = 1, npti 
     
    685685                     itest_rdg(ji) = 1   ! test for conservation 
    686686                  ELSE 
    687                      farea    = 0._wp  
    688                      fvol(ji) = 0._wp                   
     687                     farea    = 0._wp 
     688                     fvol(ji) = 0._wp 
    689689                  ENDIF 
    690690 
     
    701701                  ! Sometimes thickness is larger than hi_max(jpl) because of advection scheme (for very small areas) 
    702702                  ! Then ice volume is removed from one category but the ridging/rafting scheme 
    703                   ! does not know where to move it, leading to a conservation issue.   
     703                  ! does not know where to move it, leading to a conservation issue. 
    704704                  IF( itest_rdg(ji) == 0 .AND. jl2 == jpl ) THEN   ;   farea = 1._wp   ;   fvol(ji) = 1._wp   ;   ENDIF 
    705705                  IF( itest_rft(ji) == 0 .AND. jl2 == jpl )      zswitch(ji) = 1._wp 
     
    716716                     v_ip_2d (ji,jl2) = v_ip_2d(ji,jl2) + (   vprdg (ji) * rn_fpndrdg * fvol   (ji)   & 
    717717                        &                                   + vprft (ji) * rn_fpndrft * zswitch(ji)   ) 
    718                      a_ip_2d (ji,jl2) = a_ip_2d(ji,jl2) + (   aprdg2(ji) * rn_fpndrdg * farea         &  
     718                     a_ip_2d (ji,jl2) = a_ip_2d(ji,jl2) + (   aprdg2(ji) * rn_fpndrdg * farea         & 
    719719                        &                                   + aprft2(ji) * rn_fpndrft * zswitch(ji)   ) 
    720720                     IF ( ln_pnd_lids ) THEN 
     
    723723                     ENDIF 
    724724                  ENDIF 
    725                    
     725 
    726726               ENDIF 
    727727 
     
    741741               DO ji = 1, npti 
    742742                  IF( apartf(ji,jl1) > 0._wp .AND. closing_gross(ji) > 0._wp )   & 
    743                      &   ze_i_2d(ji,jk,jl2) = ze_i_2d(ji,jk,jl2) + eirdg(ji,jk) * fvol(ji) + eirft(ji,jk) * zswitch(ji)                   
     743                     &   ze_i_2d(ji,jk,jl2) = ze_i_2d(ji,jk,jl2) + eirdg(ji,jk) * fvol(ji) + eirft(ji,jk) * zswitch(ji) 
    744744               END DO 
    745745            END DO 
     
    763763      !! ** Purpose :   computes ice strength used in dynamics routines of ice thickness 
    764764      !! 
    765       !! ** Method  :   Compute the strength of the ice pack, defined as the energy (J m-2)  
     765      !! ** Method  :   Compute the strength of the ice pack, defined as the energy (J m-2) 
    766766      !!              dissipated per unit area removed from the ice pack under compression, 
    767767      !!              and assumed proportional to the change in potential energy caused 
     
    793793      CASE( 1 )               !--- Spatial smoothing 
    794794         DO_2D( 0, 0, 0, 0 ) 
    795             IF ( SUM( a_i(ji,jj,:) ) > 0._wp ) THEN  
     795            IF ( SUM( a_i(ji,jj,:) ) > 0._wp ) THEN 
    796796               zworka(ji,jj) = ( 4.0 * strength(ji,jj)              & 
    797                   &                  + strength(ji-1,jj) * tmask(ji-1,jj,1) + strength(ji+1,jj) * tmask(ji+1,jj,1) &   
     797                  &                  + strength(ji-1,jj) * tmask(ji-1,jj,1) + strength(ji+1,jj) * tmask(ji+1,jj,1) & 
    798798                  &                  + strength(ji,jj-1) * tmask(ji,jj-1,1) + strength(ji,jj+1) * tmask(ji,jj+1,1) & 
    799799                  &            ) / ( 4.0 + tmask(ji-1,jj,1) + tmask(ji+1,jj,1) + tmask(ji,jj-1,1) + tmask(ji,jj+1,1) ) 
     
    802802            ENDIF 
    803803         END_2D 
    804           
     804 
    805805         DO_2D( 0, 0, 0, 0 ) 
    806806            strength(ji,jj) = zworka(ji,jj) 
     
    815815         ! 
    816816         DO_2D( 0, 0, 0, 0 ) 
    817             IF ( SUM( a_i(ji,jj,:) ) > 0._wp ) THEN  
     817            IF ( SUM( a_i(ji,jj,:) ) > 0._wp ) THEN 
    818818               itframe = 1 ! number of time steps for the running mean 
    819819               IF ( zstrp1(ji,jj) > 0._wp ) itframe = itframe + 1 
     
    831831   END SUBROUTINE ice_strength 
    832832 
    833     
     833 
    834834   SUBROUTINE ice_dyn_1d2d( kn ) 
    835835      !!----------------------------------------------------------------------- 
    836       !!                   ***  ROUTINE ice_dyn_1d2d ***  
    837       !!                  
     836      !!                   ***  ROUTINE ice_dyn_1d2d *** 
     837      !! 
    838838      !! ** Purpose :   move arrays from 1d to 2d and the reverse 
    839839      !!----------------------------------------------------------------------- 
     
    905905      ! 
    906906   END SUBROUTINE ice_dyn_1d2d 
    907     
     907 
    908908 
    909909   SUBROUTINE ice_dyn_rdgrft_init 
     
    911911      !!                  ***  ROUTINE ice_dyn_rdgrft_init *** 
    912912      !! 
    913       !! ** Purpose :   Physical constants and parameters linked  
     913      !! ** Purpose :   Physical constants and parameters linked 
    914914      !!                to the mechanical ice redistribution 
    915915      !! 
    916       !! ** Method  :   Read the namdyn_rdgrft namelist  
    917       !!                and check the parameters values  
     916      !! ** Method  :   Read the namdyn_rdgrft namelist 
     917      !!                and check the parameters values 
    918918      !!                called at the first timestep (nit000) 
    919919      !! 
     
    925925         &                    rn_csrdg  ,                    & 
    926926         &                    ln_partf_lin, rn_gstar,        & 
    927          &                    ln_partf_exp, rn_astar,        &  
    928          &                    ln_ridging, rn_hstar, rn_porordg, rn_fsnwrdg, rn_fpndrdg,  &  
     927         &                    ln_partf_exp, rn_astar,        & 
     928         &                    ln_ridging, rn_hstar, rn_porordg, rn_fsnwrdg, rn_fpndrdg,  & 
    929929         &                    ln_rafting, rn_hraft, rn_craft  , rn_fsnwrft, rn_fpndrft 
    930930      !!------------------------------------------------------------------- 
     
    941941         WRITE(numout,*) '~~~~~~~~~~~~~~~~~~' 
    942942         WRITE(numout,*) '   Namelist namdyn_rdgrft:' 
    943          WRITE(numout,*) '      ice strength parameterization Hibler (1979)              ln_str_H79   = ', ln_str_H79  
     943         WRITE(numout,*) '      ice strength parameterization Hibler (1979)              ln_str_H79   = ', ln_str_H79 
    944944         WRITE(numout,*) '            1st bulk-rheology parameter                        rn_pstar     = ', rn_pstar 
    945945         WRITE(numout,*) '            2nd bulk-rhelogy parameter                         rn_crhg      = ', rn_crhg 
    946          WRITE(numout,*) '      Fraction of shear energy contributing to ridging         rn_csrdg     = ', rn_csrdg  
     946         WRITE(numout,*) '      Fraction of shear energy contributing to ridging         rn_csrdg     = ', rn_csrdg 
    947947         WRITE(numout,*) '      linear ridging participation function                    ln_partf_lin = ', ln_partf_lin 
    948948         WRITE(numout,*) '            Fraction of ice coverage contributing to ridging   rn_gstar     = ', rn_gstar 
     
    952952         WRITE(numout,*) '            max ridged ice thickness                           rn_hstar     = ', rn_hstar 
    953953         WRITE(numout,*) '            Initial porosity of ridges                         rn_porordg   = ', rn_porordg 
    954          WRITE(numout,*) '            Fraction of snow volume conserved during ridging   rn_fsnwrdg   = ', rn_fsnwrdg  
    955          WRITE(numout,*) '            Fraction of pond volume conserved during ridging   rn_fpndrdg   = ', rn_fpndrdg  
     954         WRITE(numout,*) '            Fraction of snow volume conserved during ridging   rn_fsnwrdg   = ', rn_fsnwrdg 
     955         WRITE(numout,*) '            Fraction of pond volume conserved during ridging   rn_fpndrdg   = ', rn_fpndrdg 
    956956         WRITE(numout,*) '      Rafting of ice sheets or not                             ln_rafting   = ', ln_rafting 
    957957         WRITE(numout,*) '            Parmeter thickness (threshold between ridge-raft)  rn_hraft     = ', rn_hraft 
    958          WRITE(numout,*) '            Rafting hyperbolic tangent coefficient             rn_craft     = ', rn_craft   
    959          WRITE(numout,*) '            Fraction of snow volume conserved during rafting   rn_fsnwrft   = ', rn_fsnwrft  
    960          WRITE(numout,*) '            Fraction of pond volume conserved during rafting   rn_fpndrft   = ', rn_fpndrft  
     958         WRITE(numout,*) '            Rafting hyperbolic tangent coefficient             rn_craft     = ', rn_craft 
     959         WRITE(numout,*) '            Fraction of snow volume conserved during rafting   rn_fsnwrft   = ', rn_fsnwrft 
     960         WRITE(numout,*) '            Fraction of pond volume conserved during rafting   rn_fpndrft   = ', rn_fpndrft 
    961961      ENDIF 
    962962      ! 
     
    972972            WRITE(numout,*) '      ==> only ice dynamics is activated, thus some parameters must be changed' 
    973973            WRITE(numout,*) '            rn_porordg   = ', rn_porordg 
    974             WRITE(numout,*) '            rn_fsnwrdg   = ', rn_fsnwrdg  
    975             WRITE(numout,*) '            rn_fpndrdg   = ', rn_fpndrdg  
    976             WRITE(numout,*) '            rn_fsnwrft   = ', rn_fsnwrft  
    977             WRITE(numout,*) '            rn_fpndrft   = ', rn_fpndrft  
     974            WRITE(numout,*) '            rn_fsnwrdg   = ', rn_fsnwrdg 
     975            WRITE(numout,*) '            rn_fpndrdg   = ', rn_fpndrdg 
     976            WRITE(numout,*) '            rn_fsnwrft   = ', rn_fsnwrft 
     977            WRITE(numout,*) '            rn_fpndrft   = ', rn_fpndrft 
    978978         ENDIF 
    979979      ENDIF 
  • NEMO/trunk/src/ICE/icedyn_rhg.F90

    r14006 r14072  
    22   !!====================================================================== 
    33   !!                     ***  MODULE  icedyn_rhg  *** 
    4    !!   Sea-Ice dynamics : master routine for rheology  
     4   !!   Sea-Ice dynamics : master routine for rheology 
    55   !!====================================================================== 
    66   !! history :  4.0  !  2018     (C. Rousset)      Original code 
     
    4949      !!------------------------------------------------------------------- 
    5050      !!               ***  ROUTINE ice_dyn_rhg  *** 
    51       !!                
     51      !! 
    5252      !! ** Purpose :   compute ice velocity 
    5353      !! 
     
    7272      !--------------! 
    7373      !== Rheology ==! 
    74       !--------------!    
     74      !--------------! 
    7575      SELECT CASE( nice_rhg ) 
    7676      !                                !------------------------! 
     
    7878         !                             !------------------------! 
    7979         CALL ice_dyn_rhg_evp( kt, Kmm, stress1_i, stress2_i, stress12_i, shear_i, divu_i, delta_i ) 
    80          !         
     80         ! 
    8181         !                             !------------------------! 
    8282      CASE( np_rhgVP  )                ! Viscous-Plastic        ! 
     
    121121      !! 
    122122      NAMELIST/namdyn_rhg/  ln_rhg_EVP, ln_aEVP, ln_rhg_EAP, rn_creepl, rn_ecc , nn_nevp, rn_relast, nn_rhg_chkcvg, &  !-- evp 
    123          &                  ln_rhg_VP, nn_vp_nout, nn_vp_ninn, nn_vp_chkcvg                                            !-- vp  
     123         &                  ln_rhg_VP, nn_vp_nout, nn_vp_ninn, nn_vp_chkcvg                                            !-- vp 
    124124      !!------------------------------------------------------------------- 
    125125      ! 
     
    156156      ! 
    157157      !                             !== set the choice of ice advection ==! 
    158       ioptio = 0  
     158      ioptio = 0 
    159159      IF( ln_rhg_EVP ) THEN   ;   ioptio = ioptio + 1   ;   nice_rhg = np_rhgEVP    ;   ENDIF 
    160160      IF( ln_rhg_EAP ) THEN   ;   ioptio = ioptio + 1   ;   nice_rhg = np_rhgEAP    ;   ENDIF 
    161       IF( ln_rhg_VP  ) THEN   ;   ioptio = ioptio + 1   ;   nice_rhg = np_rhgVP     ;   ENDIF  
     161      IF( ln_rhg_VP  ) THEN   ;   ioptio = ioptio + 1   ;   nice_rhg = np_rhgVP     ;   ENDIF 
    162162      IF( ioptio /= 1 )   CALL ctl_stop( 'ice_dyn_rhg_init: choose one and only one ice rheology' ) 
    163163      ! 
     
    172172   !!   Default option         Empty module           NO SI3 sea-ice model 
    173173   !!---------------------------------------------------------------------- 
    174 #endif  
     174#endif 
    175175 
    176176   !!====================================================================== 
  • NEMO/trunk/src/ICE/icedyn_rhg_evp.F90

    r14005 r14072  
    66   !! History :   -   !  2007-03  (M.A. Morales Maqueda, S. Bouillon) Original code 
    77   !!            3.0  !  2008-03  (M. Vancoppenolle) adaptation to new model 
    8    !!             -   !  2008-11  (M. Vancoppenolle, S. Bouillon, Y. Aksenov) add surface tilt in ice rheolohy  
     8   !!             -   !  2008-11  (M. Vancoppenolle, S. Bouillon, Y. Aksenov) add surface tilt in ice rheolohy 
    99   !!            3.3  !  2009-05  (G.Garric)    addition of the evp case 
    10    !!            3.4  !  2011-01  (A. Porter)   dynamical allocation  
     10   !!            3.4  !  2011-01  (A. Porter)   dynamical allocation 
    1111   !!            3.5  !  2012-08  (R. Benshila) AGRIF 
    1212   !!            3.6  !  2016-06  (C. Rousset)  Rewriting + landfast ice + mEVP (Bouillon 2013) 
     
    2828   USE icevar         ! ice_var_sshdyn 
    2929   USE icedyn_rdgrft  ! sea-ice: ice strength 
    30    USE bdy_oce , ONLY : ln_bdy  
    31    USE bdyice  
     30   USE bdy_oce , ONLY : ln_bdy 
     31   USE bdyice 
    3232#if defined key_agrif 
    3333   USE agrif_ice_interp 
     
    6969      !! 
    7070      !! ** purpose : determines sea ice drift from wind stress, ice-ocean 
    71       !!  stress and sea-surface slope. Ice-ice interaction is described by  
    72       !!  a non-linear elasto-viscous-plastic (EVP) law including shear  
    73       !!  strength and a bulk rheology (Hunke and Dukowicz, 2002).    
     71      !!  stress and sea-surface slope. Ice-ice interaction is described by 
     72      !!  a non-linear elasto-viscous-plastic (EVP) law including shear 
     73      !!  strength and a bulk rheology (Hunke and Dukowicz, 2002). 
    7474      !! 
    7575      !!  The points in the C-grid look like this, dear reader 
     
    7979      !!                                 | 
    8080      !!                      (ji-1,jj)  |  (ji,jj) 
    81       !!                             ---------    
     81      !!                             --------- 
    8282      !!                            |         | 
    8383      !!                            | (ji,jj) |------(ji,jj) 
    8484      !!                            |         | 
    85       !!                             ---------    
     85      !!                             --------- 
    8686      !!                     (ji-1,jj-1)     (ji,jj-1) 
    8787      !! 
     
    9090      !!                snow total volume (vt_s) per unit area 
    9191      !! 
    92       !! ** Action  : - compute u_ice, v_ice : the components of the  
     92      !! ** Action  : - compute u_ice, v_ice : the components of the 
    9393      !!                sea-ice velocity vector 
    9494      !!              - compute delta_i, shear_i, divu_i, which are inputs 
     
    9696      !! 
    9797      !! ** Steps   : 0) compute mask at F point 
    98       !!              1) Compute ice snow mass, ice strength  
     98      !!              1) Compute ice snow mass, ice strength 
    9999      !!              2) Compute wind, oceanic stresses, mass terms and 
    100100      !!                 coriolis terms of the momentum equation 
     
    152152      REAL(wp), DIMENSION(jpi,jpj) ::   zsshdyn                         ! array used for the calculation of ice surface slope: 
    153153      !                                                                 !    ocean surface (ssh_m) if ice is not embedded 
    154       !                                                                 !    ice bottom surface if ice is embedded    
     154      !                                                                 !    ice bottom surface if ice is embedded 
    155155      REAL(wp), DIMENSION(jpi,jpj) ::   zfU  , zfV                      ! internal stresses 
    156156      REAL(wp), DIMENSION(jpi,jpj) ::   zspgU, zspgV                    ! surface pressure gradient at U/V points 
     
    172172      !! --- diags 
    173173      REAL(wp) ::   zsig1, zsig2, zsig12, zfac, z1_strength 
    174       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zsig_I, zsig_II, zsig1_p, zsig2_p          
     174      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zsig_I, zsig_II, zsig1_p, zsig2_p 
    175175      !! --- SIMIP diags 
    176176      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_xmtrp_ice ! X-component of ice mass transport (kg/s) 
     
    179179      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_ymtrp_snw ! Y-component of snow mass transport (kg/s) 
    180180      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_xatrp     ! X-component of area transport (m2/s) 
    181       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_yatrp     ! Y-component of area transport (m2/s)       
     181      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdiag_yatrp     ! Y-component of area transport (m2/s) 
    182182      !!------------------------------------------------------------------- 
    183183 
     
    229229      ! 1) define some variables and initialize arrays 
    230230      !------------------------------------------------------------------------------! 
    231       zrhoco = rho0 * rn_cio  
     231      zrhoco = rho0 * rn_cio 
    232232 
    233233      ! ecc2: square of yield ellipse eccenticrity 
     
    248248      ENDIF 
    249249      z1_dtevp = 1._wp / zdtevp 
    250           
    251       ! Initialise stress tensor  
    252       zs1 (:,:) = pstress1_i (:,:)  
     250 
     251      ! Initialise stress tensor 
     252      zs1 (:,:) = pstress1_i (:,:) 
    253253      zs2 (:,:) = pstress2_i (:,:) 
    254254      zs12(:,:) = pstress12_i(:,:) 
     
    292292         ! dt/m at T points (for alpha and beta coefficients) 
    293293         zdt_m(ji,jj)    = zdtevp / MAX( zm1, zmmin ) 
    294           
     294 
    295295         ! m/dt 
    296296         zmU_t(ji,jj)    = zmassU * z1_dtevp 
    297297         zmV_t(ji,jj)    = zmassV * z1_dtevp 
    298           
     298 
    299299         ! Drag ice-atm. 
    300300         ztaux_ai(ji,jj) = zaU(ji,jj) * utau_ice(ji,jj) 
     
    350350      !                                               ! ==================== ! 
    351351      DO jter = 1 , nn_nevp                           !    loop over jter    ! 
    352          !                                            ! ==================== !         
     352         !                                            ! ==================== ! 
    353353         l_full_nf_update = jter == nn_nevp   ! false: disable full North fold update (performances) for iter = 1 to nn_nevp-1 
    354354         ! 
     
    377377               &   + zds(ji,jj-1) * zds(ji,jj-1) * e1e2f(ji,jj-1) + zds(ji-1,jj-1) * zds(ji-1,jj-1) * e1e2f(ji-1,jj-1)  & 
    378378               &   ) * 0.25_wp * r1_e1e2t(ji,jj) 
    379             
     379 
    380380            ! divergence at T points 
    381381            zdiv  = ( e2u(ji,jj) * u_ice(ji,jj) - e2u(ji-1,jj) * u_ice(ji-1,jj)   & 
     
    383383               &    ) * r1_e1e2t(ji,jj) 
    384384            zdiv2 = zdiv * zdiv 
    385              
     385 
    386386            ! tension at T points 
    387387            zdt  = ( ( u_ice(ji,jj) * r1_e2u(ji,jj) - u_ice(ji-1,jj) * r1_e2u(ji-1,jj) ) * e2t(ji,jj) * e2t(ji,jj)   & 
     
    389389               &   ) * r1_e1e2t(ji,jj) 
    390390            zdt2 = zdt * zdt 
    391              
     391 
    392392            ! delta at T points 
    393             zdelta(ji,jj) = SQRT( zdiv2 + ( zdt2 + zds2 ) * z1_ecc2 )   
     393            zdelta(ji,jj) = SQRT( zdiv2 + ( zdt2 + zds2 ) * z1_ecc2 ) 
    394394 
    395395         END_2D 
     
    407407               &    + e1v(ji,jj) * v_ice(ji,jj) - e1v(ji,jj-1) * v_ice(ji,jj-1)   & 
    408408               &    ) * r1_e1e2t(ji,jj) 
    409              
     409 
    410410            ! tension at T points (duplication to avoid communications) 
    411411            zdt  = ( ( u_ice(ji,jj) * r1_e2u(ji,jj) - u_ice(ji-1,jj) * r1_e2u(ji-1,jj) ) * e2t(ji,jj) * e2t(ji,jj)   & 
    412412               &   - ( v_ice(ji,jj) * r1_e1v(ji,jj) - v_ice(ji,jj-1) * r1_e1v(ji,jj-1) ) * e1t(ji,jj) * e1t(ji,jj)   & 
    413413               &   ) * r1_e1e2t(ji,jj) 
    414              
     414 
    415415            ! alpha for aEVP 
    416416            !   gamma = 0.5*P/(delta+creepl) * (c*pi)**2/Area * dt/m 
     
    427427               ! zalph2 = zalph1 
    428428            ENDIF 
    429              
     429 
    430430            ! stress at T points (zkt/=0 if landfast) 
    431431            zs1(ji,jj) = ( zs1(ji,jj)*zalph1 + zp_delt(ji,jj) * ( zdiv*(1._wp + zkt) - zdelta(ji,jj)*(1._wp - zkt) ) ) * z1_alph1 
    432432            zs2(ji,jj) = ( zs2(ji,jj)*zalph2 + zp_delt(ji,jj) * ( zdt * z1_ecc2 * (1._wp + zkt) ) ) * z1_alph2 
    433            
     433 
    434434         END_2D 
    435435 
     
    440440            END_2D 
    441441         ENDIF 
    442           
     442 
    443443         DO_2D( 1, 0, 1, 0 ) 
    444444 
     
    451451               ! zalph2 = zalph2 - 1._wp 
    452452            ENDIF 
    453              
     453 
    454454            ! P/delta at F points 
    455455            zp_delf = 0.25_wp * ( zp_delt(ji,jj) + zp_delt(ji+1,jj) + zp_delt(ji,jj+1) + zp_delt(ji+1,jj+1) ) 
    456              
     456 
    457457            ! stress at F points (zkt/=0 if landfast) 
    458458            zs12(ji,jj)= ( zs12(ji,jj) * zalph2 + zp_delf * ( zds(ji,jj) * z1_ecc2 * (1._wp + zkt) ) * 0.5_wp ) * z1_alph2 
     
    519519                     &                                    + zRHS + zTauO * v_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    520520                     &                                    ) / MAX( zepsi, zmV_t(ji,jj) * ( zbetav + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
    521                      &            + ( 1._wp - rswitch ) * (  v_ice_b(ji,jj)                                                   &  
     521                     &            + ( 1._wp - rswitch ) * (  v_ice_b(ji,jj)                                                   & 
    522522                     &                                     + v_ice  (ji,jj) * MAX( 0._wp, zbetav - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0 
    523523                     &                                    ) / ( zbetav + 1._wp )                                              & 
     
    574574                     &                                     + u_ice  (ji,jj) * MAX( 0._wp, zbetau - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0 
    575575                     &                                    ) / ( zbetau + 1._wp )                                              & 
    576                      &             ) * 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  
    577                      &           )   * zmsk00x(ji,jj) 
    578                ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009) 
    579                   u_ice(ji,jj) = ( (          rswitch   * ( zmU_t(ji,jj) * u_ice(ji,jj)                                       & ! previous velocity 
    580                      &                                    + zRHS + zTauO * u_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    581                      &                                    ) / MAX( zepsi, zmU_t(ji,jj) + zTauO - zTauB )                      & ! m/dt + tau_io(only ice part) + landfast 
    582                      &            + ( 1._wp - rswitch ) *   u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lf_relax )         & ! static friction => slow decrease to v=0 
    583                      &             ) * 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  
    584                      &           )   * zmsk00x(ji,jj) 
    585                ENDIF 
    586             END_2D 
    587             CALL lbc_lnk( 'icedyn_rhg_evp', u_ice, 'U', -1.0_wp ) 
    588             ! 
    589 #if defined key_agrif 
    590 !!            CALL agrif_interp_ice( 'U', jter, nn_nevp ) 
    591             CALL agrif_interp_ice( 'U' ) 
    592 #endif 
    593             IF( ln_bdy )   CALL bdy_ice_dyn( 'U' ) 
    594             ! 
    595          ELSE ! odd iterations 
    596             ! 
    597             DO_2D( 0, 0, 0, 0 ) 
    598                !                 !--- tau_io/(u_oce - u_ice) 
    599                zTauO = zaU(ji,jj) * zrhoco * SQRT( ( u_ice (ji,jj) - u_oce (ji,jj) ) * ( u_ice (ji,jj) - u_oce (ji,jj) )  & 
    600                   &                              + ( v_iceU(ji,jj) - v_oceU(ji,jj) ) * ( v_iceU(ji,jj) - v_oceU(ji,jj) ) ) 
    601                !                 !--- Ocean-to-Ice stress 
    602                ztaux_oi(ji,jj) = zTauO * ( u_oce(ji,jj) - u_ice(ji,jj) ) 
    603                ! 
    604                !                 !--- tau_bottom/u_ice 
    605                zvel  = 5.e-05_wp + SQRT( v_iceU(ji,jj) * v_iceU(ji,jj) + u_ice(ji,jj) * u_ice(ji,jj) ) 
    606                zTauB = ztaux_base(ji,jj) / zvel 
    607                !                 !--- OceanBottom-to-Ice stress 
    608                ztaux_bi(ji,jj) = zTauB * u_ice(ji,jj) 
    609                ! 
    610                !                 !--- Coriolis at U-points (energy conserving formulation) 
    611                zCorU(ji,jj)  =   0.25_wp * r1_e1u(ji,jj) *  & 
    612                   &    ( zmf(ji  ,jj) * ( e1v(ji  ,jj) * v_ice(ji  ,jj) + e1v(ji  ,jj-1) * v_ice(ji  ,jj-1) )  & 
    613                   &    + zmf(ji+1,jj) * ( e1v(ji+1,jj) * v_ice(ji+1,jj) + e1v(ji+1,jj-1) * v_ice(ji+1,jj-1) ) ) 
    614                ! 
    615                !                 !--- Sum of external forces (explicit solution) = F + tau_ia + Coriolis + spg + tau_io 
    616                zRHS = zfU(ji,jj) + ztaux_ai(ji,jj) + zCorU(ji,jj) + zspgU(ji,jj) + ztaux_oi(ji,jj) 
    617                ! 
    618                !                 !--- landfast switch => 0 = static  friction : TauB > RHS & sign(TauB) /= sign(RHS) 
    619                !                                         1 = sliding friction : TauB < RHS 
    620                rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, zRHS + ztaux_base(ji,jj) ) - SIGN( 1._wp, zRHS ) ) ) 
    621                ! 
    622                IF( ln_aEVP ) THEN !--- ice velocity using aEVP (Kimmritz et al 2016 & 2017) 
    623                   zbetau = MAX( zbeta(ji,jj), zbeta(ji+1,jj) ) 
    624                   u_ice(ji,jj) = ( (          rswitch   * ( zmU_t(ji,jj) * ( zbetau * u_ice(ji,jj) + u_ice_b(ji,jj) )         & ! previous velocity 
    625                      &                                    + zRHS + zTauO * u_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
    626                      &                                    ) / MAX( zepsi, zmU_t(ji,jj) * ( zbetau + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
    627                      &            + ( 1._wp - rswitch ) * (  u_ice_b(ji,jj)                                                   & 
    628                      &                                     + u_ice  (ji,jj) * MAX( 0._wp, zbetau - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0 
    629                      &                                    ) / ( zbetau + 1._wp )                                              & 
    630                      &             ) * 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  
     576                     &             ) * 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 
    631577                     &           )   * zmsk00x(ji,jj) 
    632578               ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009) 
     
    647593            IF( ln_bdy )   CALL bdy_ice_dyn( 'U' ) 
    648594            ! 
     595         ELSE ! odd iterations 
     596            ! 
     597            DO_2D( 0, 0, 0, 0 ) 
     598               !                 !--- tau_io/(u_oce - u_ice) 
     599               zTauO = zaU(ji,jj) * zrhoco * SQRT( ( u_ice (ji,jj) - u_oce (ji,jj) ) * ( u_ice (ji,jj) - u_oce (ji,jj) )  & 
     600                  &                              + ( v_iceU(ji,jj) - v_oceU(ji,jj) ) * ( v_iceU(ji,jj) - v_oceU(ji,jj) ) ) 
     601               !                 !--- Ocean-to-Ice stress 
     602               ztaux_oi(ji,jj) = zTauO * ( u_oce(ji,jj) - u_ice(ji,jj) ) 
     603               ! 
     604               !                 !--- tau_bottom/u_ice 
     605               zvel  = 5.e-05_wp + SQRT( v_iceU(ji,jj) * v_iceU(ji,jj) + u_ice(ji,jj) * u_ice(ji,jj) ) 
     606               zTauB = ztaux_base(ji,jj) / zvel 
     607               !                 !--- OceanBottom-to-Ice stress 
     608               ztaux_bi(ji,jj) = zTauB * u_ice(ji,jj) 
     609               ! 
     610               !                 !--- Coriolis at U-points (energy conserving formulation) 
     611               zCorU(ji,jj)  =   0.25_wp * r1_e1u(ji,jj) *  & 
     612                  &    ( zmf(ji  ,jj) * ( e1v(ji  ,jj) * v_ice(ji  ,jj) + e1v(ji  ,jj-1) * v_ice(ji  ,jj-1) )  & 
     613                  &    + zmf(ji+1,jj) * ( e1v(ji+1,jj) * v_ice(ji+1,jj) + e1v(ji+1,jj-1) * v_ice(ji+1,jj-1) ) ) 
     614               ! 
     615               !                 !--- Sum of external forces (explicit solution) = F + tau_ia + Coriolis + spg + tau_io 
     616               zRHS = zfU(ji,jj) + ztaux_ai(ji,jj) + zCorU(ji,jj) + zspgU(ji,jj) + ztaux_oi(ji,jj) 
     617               ! 
     618               !                 !--- landfast switch => 0 = static  friction : TauB > RHS & sign(TauB) /= sign(RHS) 
     619               !                                         1 = sliding friction : TauB < RHS 
     620               rswitch = 1._wp - MIN( 1._wp, ABS( SIGN( 1._wp, zRHS + ztaux_base(ji,jj) ) - SIGN( 1._wp, zRHS ) ) ) 
     621               ! 
     622               IF( ln_aEVP ) THEN !--- ice velocity using aEVP (Kimmritz et al 2016 & 2017) 
     623                  zbetau = MAX( zbeta(ji,jj), zbeta(ji+1,jj) ) 
     624                  u_ice(ji,jj) = ( (          rswitch   * ( zmU_t(ji,jj) * ( zbetau * u_ice(ji,jj) + u_ice_b(ji,jj) )         & ! previous velocity 
     625                     &                                    + zRHS + zTauO * u_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     626                     &                                    ) / MAX( zepsi, zmU_t(ji,jj) * ( zbetau + 1._wp ) + zTauO - zTauB ) & ! m/dt + tau_io(only ice part) + landfast 
     627                     &            + ( 1._wp - rswitch ) * (  u_ice_b(ji,jj)                                                   & 
     628                     &                                     + u_ice  (ji,jj) * MAX( 0._wp, zbetau - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0 
     629                     &                                    ) / ( zbetau + 1._wp )                                              & 
     630                     &             ) * 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 
     631                     &           )   * zmsk00x(ji,jj) 
     632               ELSE               !--- ice velocity using EVP implicit formulation (cf Madec doc & Bouillon 2009) 
     633                  u_ice(ji,jj) = ( (          rswitch   * ( zmU_t(ji,jj) * u_ice(ji,jj)                                       & ! previous velocity 
     634                     &                                    + zRHS + zTauO * u_ice(ji,jj)                                       & ! F + tau_ia + Coriolis + spg + tau_io(only ocean part) 
     635                     &                                    ) / MAX( zepsi, zmU_t(ji,jj) + zTauO - zTauB )                      & ! m/dt + tau_io(only ice part) + landfast 
     636                     &            + ( 1._wp - rswitch ) *   u_ice(ji,jj) * MAX( 0._wp, 1._wp - zdtevp * rn_lf_relax )         & ! static friction => slow decrease to v=0 
     637                     &             ) * 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 
     638                     &           )   * zmsk00x(ji,jj) 
     639               ENDIF 
     640            END_2D 
     641            CALL lbc_lnk( 'icedyn_rhg_evp', u_ice, 'U', -1.0_wp ) 
     642            ! 
     643#if defined key_agrif 
     644!!            CALL agrif_interp_ice( 'U', jter, nn_nevp ) 
     645            CALL agrif_interp_ice( 'U' ) 
     646#endif 
     647            IF( ln_bdy )   CALL bdy_ice_dyn( 'U' ) 
     648            ! 
    649649            DO_2D( 0, 0, 0, 0 ) 
    650650               !                 !--- tau_io/(v_oce - v_ice) 
     
    679679                     &            + ( 1._wp - rswitch ) * (  v_ice_b(ji,jj)                                                   & 
    680680                     &                                     + v_ice  (ji,jj) * MAX( 0._wp, zbetav - zdtevp * rn_lf_relax )     & ! static friction => slow decrease to v=0 
    681                      &                                    ) / ( zbetav + 1._wp )                                              &  
     681                     &                                    ) / ( zbetav + 1._wp )                                              & 
    682682                     &             ) * 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 
    683683                     &           )   * zmsk00y(ji,jj) 
     
    710710      ! 
    711711      !------------------------------------------------------------------------------! 
    712       ! 4) Recompute delta, shear and div (inputs for mechanical redistribution)  
     712      ! 4) Recompute delta, shear and div (inputs for mechanical redistribution) 
    713713      !------------------------------------------------------------------------------! 
    714714      DO_2D( 1, 0, 1, 0 ) 
     
    720720 
    721721      END_2D 
    722        
     722 
    723723      DO_2D( 0, 0, 0, 0 )   ! no vector loop 
    724           
     724 
    725725         ! tension**2 at T points 
    726726         zdt  = ( ( u_ice(ji,jj) * r1_e2u(ji,jj) - u_ice(ji-1,jj) * r1_e2u(ji-1,jj) ) * e2t(ji,jj) * e2t(ji,jj)   & 
     
    730730 
    731731         zten_i(ji,jj) = zdt 
    732           
     732 
    733733         ! shear**2 at T points (doc eq. A16) 
    734734         zds2 = ( zds(ji,jj  ) * zds(ji,jj  ) * e1e2f(ji,jj  ) + zds(ji-1,jj  ) * zds(ji-1,jj  ) * e1e2f(ji-1,jj  )  & 
    735735            &   + zds(ji,jj-1) * zds(ji,jj-1) * e1e2f(ji,jj-1) + zds(ji-1,jj-1) * zds(ji-1,jj-1) * e1e2f(ji-1,jj-1)  & 
    736736            &   ) * 0.25_wp * r1_e1e2t(ji,jj) 
    737           
     737 
    738738         ! shear at T points 
    739739         pshear_i(ji,jj) = SQRT( zdt2 + zds2 ) 
     
    743743            &             + e1v(ji,jj) * v_ice(ji,jj) - e1v(ji,jj-1) * v_ice(ji,jj-1)   & 
    744744            &             ) * r1_e1e2t(ji,jj) 
    745           
     745 
    746746         ! delta at T points 
    747          zfac            = SQRT( pdivu_i(ji,jj) * pdivu_i(ji,jj) + ( zdt2 + zds2 ) * z1_ecc2 ) ! delta   
     747         zfac            = SQRT( pdivu_i(ji,jj) * pdivu_i(ji,jj) + ( zdt2 + zds2 ) * z1_ecc2 ) ! delta 
    748748         rswitch         = 1._wp - MAX( 0._wp, SIGN( 1._wp, -zfac ) ) ! 0 if delta=0 
    749749         pdelta_i(ji,jj) = zfac + rn_creepl * rswitch ! delta+creepl 
     
    752752      CALL lbc_lnk_multi( 'icedyn_rhg_evp', pshear_i, 'T', 1._wp, pdivu_i, 'T', 1._wp, pdelta_i, 'T', 1._wp, zten_i, 'T', 1._wp, & 
    753753         &                                  zs1     , 'T', 1._wp, zs2    , 'T', 1._wp, zs12    , 'F', 1._wp ) 
    754        
     754 
    755755      ! --- Store the stress tensor for the next time step --- ! 
    756756      pstress1_i (:,:) = zs1 (:,:) 
     
    776776         CALL iom_put( 'vtau_bi' , ztauy_bi * zmsk00 ) 
    777777      ENDIF 
    778         
     778 
    779779      ! --- divergence, shear and strength --- ! 
    780780      IF( iom_use('icediv') )   CALL iom_put( 'icediv' , pdivu_i  * zmsk00 )   ! divergence 
     
    786786         ! 
    787787         ALLOCATE( zsig_I(jpi,jpj) , zsig_II(jpi,jpj) ) 
    788          !          
     788         ! 
    789789         DO_2D( 1, 1, 1, 1 ) 
    790              
     790 
    791791            ! Ice stresses 
    792792            ! sigma1, sigma2, sigma12 are some useful recombination of the stresses (Hunke and Dukowicz MWR 2002, Bouillon et al., OM2013) 
    793793            ! These are NOT stress tensor components, neither stress invariants, neither stress principal components 
    794794            ! I know, this can be confusing... 
    795             zfac             =   strength(ji,jj) / ( pdelta_i(ji,jj) + rn_creepl )  
     795            zfac             =   strength(ji,jj) / ( pdelta_i(ji,jj) + rn_creepl ) 
    796796            zsig1            =   zfac * ( pdivu_i(ji,jj) - pdelta_i(ji,jj) ) 
    797797            zsig2            =   zfac * z1_ecc2 * zten_i(ji,jj) 
    798798            zsig12           =   zfac * z1_ecc2 * pshear_i(ji,jj) 
    799              
     799 
    800800            ! Stress invariants (sigma_I, sigma_II, Coon 1974, Feltham 2008) 
    801801            zsig_I (ji,jj)   =   zsig1 * 0.5_wp                                           ! 1st stress invariant, aka average normal stress, aka negative pressure 
    802802            zsig_II(ji,jj)   =   SQRT ( MAX( 0._wp, zsig2 * zsig2 * 0.25_wp + zsig12 ) )  ! 2nd  ''       '', aka maximum shear stress 
    803                 
    804          END_2D          
     803 
     804         END_2D 
    805805         ! 
    806806         ! Stress tensor invariants (normal and shear stress N/m) - SIMIP diags - definitions following Coon (1974) and Feltham (2008) 
    807807         IF( iom_use('normstr') )   CALL iom_put( 'normstr', zsig_I (:,:) * zmsk00(:,:) ) ! Normal stress 
    808808         IF( iom_use('sheastr') )   CALL iom_put( 'sheastr', zsig_II(:,:) * zmsk00(:,:) ) ! Maximum shear stress 
    809           
     809 
    810810         DEALLOCATE ( zsig_I, zsig_II ) 
    811           
     811 
    812812      ENDIF 
    813813 
     
    818818      IF( iom_use('sig1_pnorm') .OR. iom_use('sig2_pnorm') ) THEN 
    819819         ! 
    820          ALLOCATE( zsig1_p(jpi,jpj) , zsig2_p(jpi,jpj) , zsig_I(jpi,jpj) , zsig_II(jpi,jpj) )          
    821          !          
     820         ALLOCATE( zsig1_p(jpi,jpj) , zsig2_p(jpi,jpj) , zsig_I(jpi,jpj) , zsig_II(jpi,jpj) ) 
     821         ! 
    822822         DO_2D( 1, 1, 1, 1 ) 
    823              
    824             ! Ice stresses computed with **viscosities** (delta, p/delta) at **previous** iterates  
     823 
     824            ! Ice stresses computed with **viscosities** (delta, p/delta) at **previous** iterates 
    825825            !                        and **deformations** at current iterates 
    826826            !                        following Lemieux & Dupont (2020) 
     
    829829            zsig2            =   zfac * z1_ecc2 * zten_i(ji,jj) 
    830830            zsig12           =   zfac * z1_ecc2 * pshear_i(ji,jj) 
    831              
     831 
    832832            ! Stress invariants (sigma_I, sigma_II, Coon 1974, Feltham 2008), T-point 
    833833            zsig_I(ji,jj)    =   zsig1 * 0.5_wp                                            ! 1st stress invariant, aka average normal stress, aka negative pressure 
    834834            zsig_II(ji,jj)   =   SQRT ( MAX( 0._wp, zsig2 * zsig2 * 0.25_wp + zsig12 ) )   ! 2nd  ''       '', aka maximum shear stress 
    835              
     835 
    836836            ! Normalized  principal stresses (used to display the ellipse) 
    837837            z1_strength      =   1._wp / MAX( 1._wp, strength(ji,jj) ) 
    838838            zsig1_p(ji,jj)   =   ( zsig_I(ji,jj) + zsig_II(ji,jj) ) * z1_strength 
    839839            zsig2_p(ji,jj)   =   ( zsig_I(ji,jj) - zsig_II(ji,jj) ) * z1_strength 
    840          END_2D               
    841          ! 
    842          CALL iom_put( 'sig1_pnorm' , zsig1_p )  
    843          CALL iom_put( 'sig2_pnorm' , zsig2_p )  
     840         END_2D 
     841         ! 
     842         CALL iom_put( 'sig1_pnorm' , zsig1_p ) 
     843         CALL iom_put( 'sig2_pnorm' , zsig2_p ) 
    844844 
    845845         DEALLOCATE( zsig1_p , zsig2_p , zsig_I, zsig_II ) 
    846           
     846 
    847847      ENDIF 
    848848 
     
    889889 
    890890         CALL iom_put( 'xmtrpice' , zdiag_xmtrp_ice )   ! X-component of sea-ice mass transport (kg/s) 
    891          CALL iom_put( 'ymtrpice' , zdiag_ymtrp_ice )   ! Y-component of sea-ice mass transport  
     891         CALL iom_put( 'ymtrpice' , zdiag_ymtrp_ice )   ! Y-component of sea-ice mass transport 
    892892         CALL iom_put( 'xmtrpsnw' , zdiag_xmtrp_snw )   ! X-component of snow mass transport (kg/s) 
    893893         CALL iom_put( 'ymtrpsnw' , zdiag_ymtrp_snw )   ! Y-component of snow mass transport 
     
    911911            ENDIF 
    912912         ENDIF 
    913       ENDIF       
     913      ENDIF 
    914914      ! 
    915915      DEALLOCATE( zmsk00, zmsk15 ) 
     
    921921      !!---------------------------------------------------------------------- 
    922922      !!                    ***  ROUTINE rhg_cvg  *** 
    923       !!                      
     923      !! 
    924924      !! ** Purpose :   check convergence of oce rheology 
    925925      !! 
     
    929929      !!                This routine is called every sub-iteration, so it is cpu expensive 
    930930      !! 
    931       !! ** Note    :   for the first sub-iteration, uice_cvg is set to 0 (too large otherwise)    
     931      !! ** Note    :   for the first sub-iteration, uice_cvg is set to 0 (too large otherwise) 
    932932      !!---------------------------------------------------------------------- 
    933933      INTEGER ,                 INTENT(in) ::   kt, kiter, kitermax       ! ocean time-step index 
     
    936936      INTEGER           ::   it, idtime, istatus 
    937937      INTEGER           ::   ji, jj          ! dummy loop indices 
    938       REAL(wp)          ::   zresm           ! local real  
     938      REAL(wp)          ::   zresm           ! local real 
    939939      CHARACTER(len=20) ::   clname 
    940940      REAL(wp), DIMENSION(jpi,jpj) ::   zres           ! check convergence 
     
    963963      ! time 
    964964      it = ( kt - 1 ) * kitermax + kiter 
    965        
     965 
    966966      ! convergence 
    967967      IF( kiter == 1 ) THEN ! remove the first iteration for calculations of convergence (always very large) 
     
    982982         IF( kt == nitend - nn_fsbc + 1 )   istatus = NF90_CLOSE(ncvgid) 
    983983      ENDIF 
    984        
     984 
    985985   END SUBROUTINE rhg_cvg 
    986986 
     
    989989      !!--------------------------------------------------------------------- 
    990990      !!                   ***  ROUTINE rhg_evp_rst  *** 
    991       !!                      
     991      !! 
    992992      !! ** Purpose :   Read or write RHG file in restart file 
    993993      !! 
     
    10411041   END SUBROUTINE rhg_evp_rst 
    10421042 
    1043     
     1043 
    10441044#else 
    10451045   !!---------------------------------------------------------------------- 
  • NEMO/trunk/src/ICE/iceistate.F90

    r14053 r14072  
    1818   USE oce            ! dynamics and tracers variables 
    1919   USE dom_oce        ! ocean domain 
    20    USE sbc_oce , ONLY : sst_m, sss_m, ln_ice_embd  
     20   USE sbc_oce , ONLY : sst_m, sss_m, ln_ice_embd 
    2121   USE sbc_ice , ONLY : tn_ice, snwice_mass, snwice_mass_b 
    2222   USE eosbn2         ! equation of state 
     
    4040   USE agrif_oce 
    4141   USE agrif_ice 
    42    USE agrif_ice_interp  
    43 # endif    
     42   USE agrif_ice_interp 
     43# endif 
    4444 
    4545   IMPLICIT NONE 
     
    9191      !! 
    9292      !! ** Method  :   This routine will put some ice where ocean 
    93       !!                is at the freezing point, then fill in ice  
    94       !!                state variables using prescribed initial  
    95       !!                values in the namelist             
     93      !!                is at the freezing point, then fill in ice 
     94      !!                state variables using prescribed initial 
     95      !!                values in the namelist 
    9696      !! 
    9797      !! ** Steps   :   1) Set initial surface and basal temperatures 
     
    103103      !!              where there is no ice 
    104104      !!-------------------------------------------------------------------- 
    105       INTEGER, INTENT(in) :: kt            ! time step  
     105      INTEGER, INTENT(in) :: kt            ! time step 
    106106      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa ! ocean time level indices 
    107107      ! 
     
    129129      ! basal temperature (considered at freezing point)   [Kelvin] 
    130130      CALL eos_fzp( sss_m(:,:), t_bo(:,:) ) 
    131       t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1)  
     131      t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) 
    132132      ! 
    133133      ! surface temperature and conductivity 
     
    154154      e_i (:,:,:,:) = 0._wp 
    155155      e_s (:,:,:,:) = 0._wp 
    156        
     156 
    157157      ! general fields 
    158158      a_i (:,:,:) = 0._wp 
     
    229229               IF( TRIM(si(jp_apd)%clrootname) == 'NOT USED' ) & 
    230230                  &     si(jp_apd)%fnow(:,:,1) = ( rn_apd_ini_n * zswitch + rn_apd_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) & ! rn_apd = pond fraction => rn_apnd * a_i = pond conc. 
    231                   &                              * si(jp_ati)%fnow(:,:,1)  
     231                  &                              * si(jp_ati)%fnow(:,:,1) 
    232232               ! 
    233233               ! pond depth 
     
    248248               ! 
    249249               ! change the switch for the following 
    250                WHERE( zat_i_ini(:,:) > 0._wp )   ;   zswitch(:,:) = tmask(:,:,1)  
     250               WHERE( zat_i_ini(:,:) > 0._wp )   ;   zswitch(:,:) = tmask(:,:,1) 
    251251               ELSEWHERE                         ;   zswitch(:,:) = 0._wp 
    252252               END WHERE 
     
    256256               !                          !---------------! 
    257257               ! no ice if (sst - Tfreez) >= thresold 
    258                WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst )   ;   zswitch(:,:) = 0._wp  
     258               WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst )   ;   zswitch(:,:) = 0._wp 
    259259               ELSEWHERE                                                                    ;   zswitch(:,:) = tmask(:,:,1) 
    260260               END WHERE 
     
    269269                  zt_su_ini(:,:) = rn_tsu_ini_n * zswitch(:,:) 
    270270                  ztm_s_ini(:,:) = rn_tms_ini_n * zswitch(:,:) 
    271                   zapnd_ini(:,:) = rn_apd_ini_n * zswitch(:,:) * zat_i_ini(:,:) ! rn_apd = pond fraction => rn_apd * a_i = pond conc.  
     271                  zapnd_ini(:,:) = rn_apd_ini_n * zswitch(:,:) * zat_i_ini(:,:) ! rn_apd = pond fraction => rn_apd * a_i = pond conc. 
    272272                  zhpnd_ini(:,:) = rn_hpd_ini_n * zswitch(:,:) 
    273273                  zhlid_ini(:,:) = rn_hld_ini_n * zswitch(:,:) 
     
    295295               zhlid_ini(:,:) = 0._wp 
    296296            ENDIF 
    297              
     297 
    298298            IF ( .NOT.ln_pnd_lids ) THEN 
    299299               zhlid_ini(:,:) = 0._wp 
    300300            ENDIF 
    301              
     301 
    302302            !----------------! 
    303303            ! 3) fill fields ! 
     
    323323            CALL tab_2d_1d( npti, nptidx(1:npti), h_ip_1d(1:npti)  , zhpnd_ini ) 
    324324            CALL tab_2d_1d( npti, nptidx(1:npti), h_il_1d(1:npti)  , zhlid_ini ) 
    325              
     325 
    326326            ! allocate temporary arrays 
    327327            ALLOCATE( zhi_2d (npti,jpl), zhs_2d (npti,jpl), zai_2d (npti,jpl), & 
     
    377377            DO jl = 1, jpl 
    378378               DO_3D( 1, 1, 1, 1, 1, nlay_i ) 
    379                   t_i (ji,jj,jk,jl) = zti_3d(ji,jj,jl)  
     379                  t_i (ji,jj,jk,jl) = zti_3d(ji,jj,jl) 
    380380                  ztmelts          = - rTmlt * sz_i(ji,jj,jk,jl) + rt0 ! melting temperature in K 
    381381                  e_i(ji,jj,jk,jl) = zswitch(ji,jj) * v_i(ji,jj,jl) * r1_nlay_i * & 
     
    385385               END_3D 
    386386            END DO 
    387              
     387 
    388388#if  defined key_agrif 
    389389         ELSE 
    390   
     390 
    391391            Agrif_SpecialValue    = -9999. 
    392392            Agrif_UseSpecialValue = .TRUE. 
     
    399399            use_sign_north = .FALSE. 
    400400            Agrif_UseSpecialValue = .FALSE. 
    401         ! lbc ????  
     401        ! lbc ???? 
    402402   ! Here we know : a_i, v_i, v_s, sv_i, oa_i, a_ip, v_ip, v_il, t_su, e_s, e_i 
    403403            CALL ice_var_glo2eqv 
     
    413413         v_ip(:,:,:) = h_ip(:,:,:) * a_ip(:,:,:) 
    414414         v_il(:,:,:) = h_il(:,:,:) * a_ip(:,:,:) 
    415           
     415 
    416416         ! specific temperatures for coupled runs 
    417417         tn_ice(:,:,:) = t_su(:,:,:) 
     
    456456      !!------------------------------------------------------------------- 
    457457      !!                   ***  ROUTINE ice_istate_init  *** 
    458       !!         
    459       !! ** Purpose :   Definition of initial state of the ice  
    460       !! 
    461       !! ** Method  :   Read the namini namelist and check the parameter  
     458      !! 
     459      !! ** Purpose :   Definition of initial state of the ice 
     460      !! 
     461      !! ** Method  :   Read the namini namelist and check the parameter 
    462462      !!              values called at the first timestep (nit000) 
    463463      !! 
     
    500500         WRITE(numout,*) '      max ocean temp. above Tfreeze with initial ice   rn_thres_sst   = ', rn_thres_sst 
    501501         IF( ln_iceini .AND. nn_iceini_file == 0 ) THEN 
    502             WRITE(numout,*) '      initial snw thickness in the north-south         rn_hts_ini     = ', rn_hts_ini_n,rn_hts_ini_s  
     502            WRITE(numout,*) '      initial snw thickness in the north-south         rn_hts_ini     = ', rn_hts_ini_n,rn_hts_ini_s 
    503503            WRITE(numout,*) '      initial ice thickness in the north-south         rn_hti_ini     = ', rn_hti_ini_n,rn_hti_ini_s 
    504504            WRITE(numout,*) '      initial ice concentr  in the north-south         rn_ati_ini     = ', rn_ati_ini_n,rn_ati_ini_s 
  • NEMO/trunk/src/ICE/iceitd.F90

    r14005 r14072  
    1818   !!---------------------------------------------------------------------- 
    1919   USE dom_oce        ! ocean domain 
    20    USE phycst         ! physical constants  
     20   USE phycst         ! physical constants 
    2121   USE ice1D          ! sea-ice: thermodynamic variables 
    2222   USE ice            ! sea-ice: variables 
     
    6666      !!                after thermodynamic growth of ice thickness 
    6767      !! 
    68       !! ** Method  :   Linear remapping  
     68      !! ** Method  :   Linear remapping 
    6969      !! 
    7070      !! References :   W.H. Lipscomb, JGR 2001 
    7171      !!------------------------------------------------------------------ 
    72       INTEGER , INTENT (in) ::   kt      ! Ocean time step  
     72      INTEGER , INTENT (in) ::   kt      ! Ocean time step 
    7373      ! 
    7474      INTEGER  ::   ji, jj, jl, jcat     ! dummy loop index 
     
    7676      REAL(wp) ::   zx1, zwk1, zdh0, zetamin, zdamax   ! local scalars 
    7777      REAL(wp) ::   zx2, zwk2, zda0, zetamax           !   -      - 
    78       REAL(wp) ::   zx3         
     78      REAL(wp) ::   zx3 
    7979      REAL(wp) ::   zslope          ! used to compute local thermodynamic "speeds" 
    8080      ! 
     
    9090      IF( ln_timing )   CALL timing_start('iceitd_rem') 
    9191 
    92       IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_rem: remapping ice thickness distribution'  
     92      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_rem: remapping ice thickness distribution' 
    9393 
    9494      IF( ln_icediachk )   CALL ice_cons_hsm(0, 'iceitd_rem', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) 
     
    107107         ENDIF 
    108108      END_2D 
    109        
     109 
    110110      !----------------------------------------------------------------------------------------------- 
    111111      !  2) Compute new category boundaries 
     
    143143               ELSEIF( a_ib_2d(ji,jl) <= epsi10 .AND. a_ib_2d(ji,jl+1) >  epsi10 ) THEN   ! a(jl)=0 => Hn* = Hn + fn+1*dt 
    144144                  zhbnew(ji,jl) = hi_max(jl) + zdhice(ji,jl+1) 
    145                ELSE                                                                       ! a(jl+1) & a(jl) = 0  
     145               ELSE                                                                       ! a(jl+1) & a(jl) = 0 
    146146                  zhbnew(ji,jl) = hi_max(jl) 
    147147               ENDIF 
    148148               ! 
    149149               ! --- 2 conditions for remapping --- ! 
    150                ! 1) hn(t+1)+espi < Hn* < hn+1(t+1)-epsi                
    151                !    Note: hn(t+1) must not be too close to either HR or HL otherwise a division by nearly 0 is possible  
     150               ! 1) hn(t+1)+espi < Hn* < hn+1(t+1)-epsi 
     151               !    Note: hn(t+1) must not be too close to either HR or HL otherwise a division by nearly 0 is possible 
    152152               !          in itd_glinear in the case (HR-HL) = 3(Hice - HL) or = 3(HR - Hice) 
    153153# if defined key_single 
     
    159159# endif 
    160160               ! 
    161                ! 2) Hn-1 < Hn* < Hn+1   
     161               ! 2) Hn-1 < Hn* < Hn+1 
    162162               IF( zhbnew(ji,jl) < hi_max(jl-1) )   nptidx(ji) = 0 
    163163               IF( zhbnew(ji,jl) > hi_max(jl+1) )   nptidx(ji) = 0 
     
    171171               zhbnew(ji,jpl) = MAX( hi_max(jpl-1), 3._wp * h_i_2d(ji,jpl) - 2._wp * zhbnew(ji,jpl-1) ) 
    172172            ELSE 
    173                zhbnew(ji,jpl) = hi_max(jpl)   
     173               zhbnew(ji,jpl) = hi_max(jpl) 
    174174            ENDIF 
    175175            ! 
    176176            ! --- 1 additional condition for remapping (1st category) --- ! 
    177             ! H0+epsi < h1(t) < H1-epsi  
    178             !    h1(t) must not be too close to either HR or HL otherwise a division by nearly 0 is possible  
     177            ! H0+epsi < h1(t) < H1-epsi 
     178            !    h1(t) must not be too close to either HR or HL otherwise a division by nearly 0 is possible 
    179179            !    in itd_glinear in the case (HR-HL) = 3(Hice - HL) or = 3(HR - Hice) 
    180180# if defined key_single 
     
    202202         ! 
    203203      ENDIF 
    204     
     204 
    205205      !----------------------------------------------------------------------------------------------- 
    206       !  4) Compute g(h)  
     206      !  4) Compute g(h) 
    207207      !----------------------------------------------------------------------------------------------- 
    208208      IF( npti > 0 ) THEN 
    209209         ! 
    210210         zhb0(:) = hi_max(0)   ;   zhb1(:) = hi_max(1) 
    211          g0(:,:) = 0._wp       ;   g1(:,:) = 0._wp  
    212          hL(:,:) = 0._wp       ;   hR(:,:) = 0._wp  
     211         g0(:,:) = 0._wp       ;   g1(:,:) = 0._wp 
     212         hL(:,:) = 0._wp       ;   hR(:,:) = 0._wp 
    213213         ! 
    214214         DO jl = 1, jpl 
     
    220220            ! 
    221221            IF( jl == 1 ) THEN 
    222                !   
     222               ! 
    223223               ! --- g(h) for category 1 --- ! 
    224224               CALL itd_glinear( zhb0(1:npti)  , zhb1(1:npti)  , h_ib_1d(1:npti)  , a_i_1d(1:npti)  ,  &   ! in 
     
    230230                  IF( a_i_1d(ji) > epsi10 ) THEN 
    231231                     ! 
    232                      zdh0 =  h_i_1d(ji) - h_ib_1d(ji)                 
     232                     zdh0 =  h_i_1d(ji) - h_ib_1d(ji) 
    233233                     IF( zdh0 < 0.0 ) THEN      ! remove area from category 1 
    234234                        zdh0 = MIN( -zdh0, hi_max(1) ) 
     
    238238                        IF( zetamax > 0.0 ) THEN 
    239239                           zx1    = zetamax 
    240                            zx2    = 0.5 * zetamax * zetamax  
     240                           zx2    = 0.5 * zetamax * zetamax 
    241241                           zda0   = g1(ji,1) * zx2 + g0(ji,1) * zx1                ! ice area removed 
    242                            zdamax = a_i_1d(ji) * (1.0 - h_i_1d(ji) / h_ib_1d(ji) ) ! Constrain new thickness <= h_i                 
     242                           zdamax = a_i_1d(ji) * (1.0 - h_i_1d(ji) / h_ib_1d(ji) ) ! Constrain new thickness <= h_i 
    243243                           zda0   = MIN( zda0, zdamax )                            ! ice area lost due to melting of thin ice (zdamax > 0) 
    244244                           ! Remove area, conserving volume 
     
    250250                     ELSE ! if ice accretion zdh0 > 0 
    251251                        ! zhbnew was 0, and is shifted to the right to account for thin ice growth in openwater (F0 = f1) 
    252                         zhbnew(ji,0) = MIN( zdh0, hi_max(1) )  
     252                        zhbnew(ji,0) = MIN( zdh0, hi_max(1) ) 
    253253                     ENDIF 
    254254                     ! 
     
    263263            ENDIF ! jl=1 
    264264            ! 
    265             ! --- g(h) for each thickness category --- !   
     265            ! --- g(h) for each thickness category --- ! 
    266266            CALL itd_glinear( zhbnew(1:npti,jl-1), zhbnew(1:npti,jl), h_i_1d(1:npti)   , a_i_1d(1:npti)   ,  &   ! in 
    267267               &              g0    (1:npti,jl  ), g1    (1:npti,jl), hL    (1:npti,jl), hR    (1:npti,jl)   )   ! out 
    268268            ! 
    269269         END DO 
    270           
     270 
    271271         !----------------------------------------------------------------------------------------------- 
    272272         !  5) Compute area and volume to be shifted across each boundary (Eq. 18) 
     
    278278               ! left and right integration limits in eta space 
    279279               IF (zhbnew(ji,jl) > hi_max(jl)) THEN ! Hn* > Hn => transfer from jl to jl+1 
    280                   zetamin = MAX( hi_max(jl)   , hL(ji,jl) ) - hL(ji,jl)   ! hi_max(jl) - hL  
     280                  zetamin = MAX( hi_max(jl)   , hL(ji,jl) ) - hL(ji,jl)   ! hi_max(jl) - hL 
    281281                  zetamax = MIN( zhbnew(ji,jl), hR(ji,jl) ) - hL(ji,jl)   ! hR - hL 
    282282                  jdonor(ji,jl) = jl 
     
    301301            END DO 
    302302         END DO 
    303           
     303 
    304304         !---------------------------------------------------------------------------------------------- 
    305305         ! 6) Shift ice between categories 
    306306         !---------------------------------------------------------------------------------------------- 
    307307         CALL itd_shiftice ( jdonor(1:npti,:), zdaice(1:npti,:), zdvice(1:npti,:) ) 
    308           
     308 
    309309         !---------------------------------------------------------------------------------------------- 
    310310         ! 7) Make sure h_i >= minimum ice thickness hi_min 
     
    316316         DO ji = 1, npti 
    317317            IF ( a_i_1d(ji) > epsi10 .AND. h_i_1d(ji) < rn_himin ) THEN 
    318                a_i_1d(ji) = a_i_1d(ji) * h_i_1d(ji) / rn_himin  
     318               a_i_1d(ji) = a_i_1d(ji) * h_i_1d(ji) / rn_himin 
    319319               IF( ln_pnd_LEV .OR. ln_pnd_TOPO )   a_ip_1d(ji) = a_ip_1d(ji) * h_i_1d(ji) / rn_himin 
    320320               h_i_1d(ji) = rn_himin 
     
    384384            pg1(ji) = 2._wp * zdhr * zwk1 * ( zwk2 - 0.5_wp )   ! Eq. 14 
    385385            ! 
    386          ELSE  ! remap_flag = .false. or a_i < epsi10  
     386         ELSE  ! remap_flag = .false. or a_i < epsi10 
    387387            phL(ji) = 0._wp 
    388388            phR(ji) = 0._wp 
     
    415415      REAL(wp), DIMENSION(jpij,nlay_s,jpl) ::   ze_s_2d 
    416416      !!------------------------------------------------------------------ 
    417           
     417 
    418418      CALL tab_3d_2d( npti, nptidx(1:npti), h_i_2d (1:npti,1:jpl), h_i  ) 
    419419      CALL tab_3d_2d( npti, nptidx(1:npti), a_i_2d (1:npti,1:jpl), a_i  ) 
     
    445445         END DO 
    446446      END DO 
    447        
     447 
    448448      !------------------------------------------------------------------------------- 
    449449      ! 2) Transfer volume and energy between categories 
     
    457457               ! 
    458458               IF ( jl1 == jl  ) THEN   ;   jl2 = jl1+1 
    459                ELSE                     ;   jl2 = jl  
     459               ELSE                     ;   jl2 = jl 
    460460               ENDIF 
    461461               ! 
     
    475475               ztrans         = v_s_2d(ji,jl1) * zworkv(ji)          ! Snow volumes 
    476476               v_s_2d(ji,jl1) = v_s_2d(ji,jl1) - ztrans 
    477                v_s_2d(ji,jl2) = v_s_2d(ji,jl2) + ztrans  
     477               v_s_2d(ji,jl2) = v_s_2d(ji,jl2) + ztrans 
    478478               ! 
    479479               ztrans          = oa_i_2d(ji,jl1) * zworka(ji)        ! Ice age 
     
    488488               zaTsfn(ji,jl1)  = zaTsfn(ji,jl1) - ztrans 
    489489               zaTsfn(ji,jl2)  = zaTsfn(ji,jl2) + ztrans 
    490                !   
     490               ! 
    491491               IF ( ln_pnd_LEV .OR. ln_pnd_TOPO ) THEN 
    492492                  ztrans          = a_ip_2d(ji,jl1) * zworka(ji)     ! Pond fraction 
    493493                  a_ip_2d(ji,jl1) = a_ip_2d(ji,jl1) - ztrans 
    494494                  a_ip_2d(ji,jl2) = a_ip_2d(ji,jl2) + ztrans 
    495                   !                                               
     495                  ! 
    496496                  ztrans          = v_ip_2d(ji,jl1) * zworkv(ji)     ! Pond volume 
    497497                  v_ip_2d(ji,jl1) = v_ip_2d(ji,jl1) - ztrans 
     
    555555            &   a_i_2d(1:npti,jl) = a_i_2d(1:npti,jl) * rn_amax_1d(1:npti) / zworka(1:npti) 
    556556      END DO 
    557        
     557 
    558558      !------------------------------------------------------------------------------- 
    559559      ! 4) Update ice thickness and temperature 
     
    564564      WHERE( a_i_2d(1:npti,:) >= epsi20 ) 
    565565# endif 
    566          h_i_2d (1:npti,:)  =  v_i_2d(1:npti,:) / a_i_2d(1:npti,:)  
    567          t_su_2d(1:npti,:)  =  zaTsfn(1:npti,:) / a_i_2d(1:npti,:)  
     566         h_i_2d (1:npti,:)  =  v_i_2d(1:npti,:) / a_i_2d(1:npti,:) 
     567         t_su_2d(1:npti,:)  =  zaTsfn(1:npti,:) / a_i_2d(1:npti,:) 
    568568      ELSEWHERE 
    569569         h_i_2d (1:npti,:)  = 0._wp 
     
    591591      ! 
    592592   END SUBROUTINE itd_shiftice 
    593     
     593 
    594594 
    595595   SUBROUTINE ice_itd_reb( kt ) 
     
    603603      !!              to the neighboring category 
    604604      !!------------------------------------------------------------------ 
    605       INTEGER , INTENT (in) ::   kt      ! Ocean time step  
     605      INTEGER , INTENT (in) ::   kt      ! Ocean time step 
    606606      INTEGER ::   ji, jj, jl   ! dummy loop indices 
    607607      ! 
     
    611611      IF( ln_timing )   CALL timing_start('iceitd_reb') 
    612612      ! 
    613       IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_reb: rebining ice thickness distribution'  
     613      IF( kt == nit000 .AND. lwp )   WRITE(numout,*) '-- ice_itd_reb: rebining ice thickness distribution' 
    614614      ! 
    615615      IF( ln_icediachk )   CALL ice_cons_hsm(0, 'iceitd_reb', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) 
     
    627627            IF( a_i(ji,jj,jl) > 0._wp .AND. v_i(ji,jj,jl) > (a_i(ji,jj,jl) * hi_max(jl)) ) THEN 
    628628               npti = npti + 1 
    629                nptidx( npti ) = (jj - 1) * jpi + ji                   
     629               nptidx( npti ) = (jj - 1) * jpi + ji 
    630630            ENDIF 
    631631         END_2D 
    632632         ! 
    633          IF( npti > 0 ) THEN             
     633         IF( npti > 0 ) THEN 
    634634            !!clem   CALL tab_2d_1d( npti, nptidx(1:npti), h_i_1d(1:npti), h_i(:,:,jl) ) 
    635635            CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d(1:npti), a_i(:,:,jl) ) 
     
    637637            ! 
    638638            DO ji = 1, npti 
    639                jdonor(ji,jl)  = jl  
     639               jdonor(ji,jl)  = jl 
    640640               ! how much of a_i you send in cat sup is somewhat arbitrary 
    641641               ! these are from CICE => transfer everything 
     
    663663            IF( a_i(ji,jj,jl+1) > 0._wp .AND. v_i(ji,jj,jl+1) <= (a_i(ji,jj,jl+1) * hi_max(jl)) ) THEN 
    664664               npti = npti + 1 
    665                nptidx( npti ) = (jj - 1) * jpi + ji                   
     665               nptidx( npti ) = (jj - 1) * jpi + ji 
    666666            ENDIF 
    667667         END_2D 
     
    672672            DO ji = 1, npti 
    673673               jdonor(ji,jl) = jl + 1 
    674                zdaice(ji,jl) = a_i_1d(ji)  
     674               zdaice(ji,jl) = a_i_1d(ji) 
    675675               zdvice(ji,jl) = v_i_1d(ji) 
    676676            END DO 
     
    721721         WRITE(numout,*) '         mean ice thickness in the domain                               rn_himean  = ', rn_himean 
    722722         WRITE(numout,*) '      Ice categories are defined by rn_catbnd                           ln_cat_usr = ', ln_cat_usr 
    723          WRITE(numout,*) '      minimum ice thickness allowed                                     rn_himin   = ', rn_himin  
    724          WRITE(numout,*) '      maximum ice thickness allowed                                     rn_himax   = ', rn_himax  
     723         WRITE(numout,*) '      minimum ice thickness allowed                                     rn_himin   = ', rn_himin 
     724         WRITE(numout,*) '      maximum ice thickness allowed                                     rn_himax   = ', rn_himax 
    725725      ENDIF 
    726726      ! 
     
    729729      !-----------------------------------! 
    730730      !                             !== set the choice of ice categories ==! 
    731       ioptio = 0  
     731      ioptio = 0 
    732732      IF( ln_cat_hfn ) THEN   ;   ioptio = ioptio + 1   ;   nice_catbnd = np_cathfn    ;   ENDIF 
    733733      IF( ln_cat_usr ) THEN   ;   ioptio = ioptio + 1   ;   nice_catbnd = np_catusr    ;   ENDIF 
  • NEMO/trunk/src/ICE/icerst.F90

    r14039 r14072  
    1111   !!---------------------------------------------------------------------- 
    1212   !!   ice_rst_opn   : open  restart file 
    13    !!   ice_rst_write : write restart file  
    14    !!   ice_rst_read  : read  restart file  
     13   !!   ice_rst_write : write restart file 
     14   !!   ice_rst_read  : read  restart file 
    1515   !!---------------------------------------------------------------------- 
    1616   USE ice            ! sea-ice: variables 
     
    5454      CHARACTER(len=20)   ::   clkt     ! ocean time-step define as a character 
    5555      CHARACTER(len=50)   ::   clname   ! ice output restart file name 
    56       CHARACTER(len=256)  ::   clpath   ! full path to ice output restart file  
     56      CHARACTER(len=256)  ::   clpath   ! full path to ice output restart file 
    5757      CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF 
    5858      !!---------------------------------------------------------------------- 
     
    6161 
    6262      IF( ln_rst_list .OR. nn_stock /= -1 ) THEN 
    63       ! in order to get better performances with NetCDF format, we open and define the ice restart file  
    64       ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice  
     63      ! in order to get better performances with NetCDF format, we open and define the ice restart file 
     64      ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice 
    6565      ! restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1 
    6666      IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nn_stock == nn_fsbc    & 
     
    7373            ! create the file 
    7474            clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
    75             clpath = TRIM(cn_icerst_outdir)  
     75            clpath = TRIM(cn_icerst_outdir) 
    7676            IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/' 
    7777            IF(lwp) THEN 
     
    132132         IF(lwp) WRITE(numout,*) 
    133133         IF(lwp) WRITE(numout,*) 'ice_rst_write : write ice restart file  kt =', kt 
    134          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'          
    135       ENDIF 
    136        
     134         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~' 
     135      ENDIF 
     136 
    137137      ! Write in numriw (if iter == nitrst) 
    138       ! ------------------  
     138      ! ------------------ 
    139139      !                                                                        ! calendar control 
    140       CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step  
     140      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step 
    141141      CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date 
    142        
     142 
    143143      IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'ICE', numriw )   ! save only ice delayed global communication variables 
    144144 
     
    156156      CALL iom_rstput( iter, nitrst, numriw, 'v_il' , v_il  ) 
    157157      ! Snow enthalpy 
    158       DO jk = 1, nlay_s  
     158      DO jk = 1, nlay_s 
    159159         WRITE(zchar1,'(I2.2)') jk 
    160160         znam = 'e_s'//'_l'//zchar1 
     
    163163      END DO 
    164164      ! Ice enthalpy 
    165       DO jk = 1, nlay_i  
     165      DO jk = 1, nlay_i 
    166166         WRITE(zchar1,'(I2.2)') jk 
    167167         znam = 'e_i'//'_l'//zchar1 
     
    224224!            clpname = cn_icerst_in 
    225225!         ELSE 
    226 !            clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in    
     226!            clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in 
    227227!         ENDIF 
    228228          CALL iom_init( cr_icerst_cxt, kdid = numrir, ld_closedef = .TRUE. ) 
    229229      ENDIF 
    230230 
    231       ! test if v_i exists  
     231      ! test if v_i exists 
    232232      id0 = iom_varid( numrir, 'v_i' , ldstop = .FALSE. ) 
    233233 
     
    237237         ! Time info 
    238238         CALL iom_get( numrir, 'nn_fsbc', zfice ) 
    239          CALL iom_get( numrir, 'kt_ice' , ziter )     
     239         CALL iom_get( numrir, 'kt_ice' , ziter ) 
    240240         IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter 
    241241         IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1 
     
    251251            &                   '   control of time parameter  nrstdt' ) 
    252252 
    253          ! --- mandatory fields --- !  
     253         ! --- mandatory fields --- ! 
    254254         CALL iom_get( numrir, jpdom_auto, 'v_i'  , v_i   ) 
    255255         CALL iom_get( numrir, jpdom_auto, 'v_s'  , v_s   ) 
  • NEMO/trunk/src/ICE/icesbc.F90

    r14005 r14072  
    5959      !! 
    6060      INTEGER  ::   ji, jj                 ! dummy loop index 
    61       REAL(wp), DIMENSION(jpi,jpj) ::   zutau_ice, zvtau_ice  
     61      REAL(wp), DIMENSION(jpi,jpj) ::   zutau_ice, zvtau_ice 
    6262      !!------------------------------------------------------------------- 
    6363      ! 
     
    7272      SELECT CASE( ksbc ) 
    7373         CASE( jp_usr     )   ;    CALL usrdef_sbc_ice_tau( kt )                 ! user defined formulation 
    74          CASE( jp_blk     )   ;    CALL blk_ice_1( sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1),   & 
    75             &                                      sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1),   & 
     74      CASE( jp_blk     ) 
     75         CALL blk_ice_1( sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1),   & 
     76            &                                      theta_air_zt(:,:), q_air_zt(:,:),   &   ! #LB: known from "sbc_oce" module... 
    7677            &                                      sf(jp_slp )%fnow(:,:,1), u_ice, v_ice, tm_su    ,   &   ! inputs 
    77             &                                      putaui = utau_ice, pvtaui = vtau_ice            )       ! outputs                              
     78            &                                      putaui = utau_ice, pvtaui = vtau_ice            )       ! outputs 
    7879 !        CASE( jp_abl     )    utau_ice & vtau_ice are computed in ablmod 
    7980         CASE( jp_purecpl )   ;    CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )   ! Coupled      formulation 
     
    9394   END SUBROUTINE ice_sbc_tau 
    9495 
    95     
     96 
    9697   SUBROUTINE ice_sbc_flx( kt, ksbc ) 
    9798      !!------------------------------------------------------------------- 
     
    108109      !!                dqns_ice                                 = non solar  heat sensistivity                  [W/m2] 
    109110      !!                qemp_oce, qemp_ice, qprec_ice, qevap_ice = sensible heat (associated with evap & precip) [W/m2] 
    110       !!            + some fields that are not used outside this module:  
     111      !!            + some fields that are not used outside this module: 
    111112      !!                qla_ice                                  = latent heat flux over ice                     [W/m2] 
    112113      !!                dqla_ice                                 = latent heat sensistivity                      [W/m2] 
     
    118119      ! 
    119120      INTEGER  ::   ji, jj, jl      ! dummy loop index 
    120       REAL(wp) ::   zmiss_val       ! missing value retrieved from xios  
     121      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios 
    121122      REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   zalb, zmsk00      ! 2D workspace 
    122123      !!-------------------------------------------------------------------- 
     
    142143                                  CALL usrdef_sbc_ice_flx( kt, h_s, h_i ) 
    143144      CASE( jp_blk, jp_abl )  !--- bulk formulation & ABL formulation 
    144                                   CALL blk_ice_2    ( t_su, h_s, h_i, alb_ice, sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1),    & 
    145             &                                           sf(jp_slp)%fnow(:,:,1), sf(jp_qlw)%fnow(:,:,1), sf(jp_prec)%fnow(:,:,1), sf(jp_snow)%fnow(:,:,1) )    !  
     145                                  CALL blk_ice_2    ( t_su, h_s, h_i, alb_ice, & 
     146            &                                         theta_air_zt(:,:), q_air_zt(:,:),    &   ! #LB: known from "sbc_oce" module... 
     147            &                                         sf(jp_slp)%fnow(:,:,1), sf(jp_qlw)%fnow(:,:,1), & 
     148            &                                         sf(jp_prec)%fnow(:,:,1), sf(jp_snow)%fnow(:,:,1) ) 
    146149         IF( ln_mixcpl        )   CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i ) 
    147150         IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist ) 
     
    163166            zalb  (:,:) = rn_alb_oce 
    164167         ELSEWHERE 
    165             zmsk00(:,:) = 1._wp             
     168            zmsk00(:,:) = 1._wp 
    166169            zalb  (:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b 
    167170         END WHERE 
     
    185188      !!                  ***  ROUTINE ice_flx_dist  *** 
    186189      !! 
    187       !! ** Purpose :   update the ice surface boundary condition by averaging  
     190      !! ** Purpose :   update the ice surface boundary condition by averaging 
    188191      !!              and/or redistributing fluxes on ice categories 
    189192      !! 
     
    192195      !! ** Action  :   depends on k_flxdist 
    193196      !!                = -1  Do nothing (needs N(cat) fluxes) 
    194       !!                =  0  Average N(cat) fluxes then apply the average over the N(cat) ice  
     197      !!                =  0  Average N(cat) fluxes then apply the average over the N(cat) ice 
    195198      !!                =  1  Average N(cat) fluxes then redistribute over the N(cat) ice 
    196199      !!                                                 using T-ice and albedo sensitivity 
     
    222225      ELSEWHERE                      ; z1_at_i(:,:) = 0._wp 
    223226      END WHERE 
    224        
     227 
    225228      SELECT CASE( k_flxdist )       !==  averaged on all ice categories  ==! 
    226229      ! 
    227230      CASE( 0 , 1 ) 
    228231         ! 
    229          ALLOCATE( z_qns_m(jpi,jpj), z_qsr_m(jpi,jpj), z_dqn_m(jpi,jpj), z_evap_m(jpi,jpj), z_devap_m(jpi,jpj) )   
     232         ALLOCATE( z_qns_m(jpi,jpj), z_qsr_m(jpi,jpj), z_dqn_m(jpi,jpj), z_evap_m(jpi,jpj), z_devap_m(jpi,jpj) ) 
    230233         ! 
    231234         z_qns_m  (:,:) = SUM( a_i(:,:,:) * pqns_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:) 
     
    242245         END DO 
    243246         ! 
    244          DEALLOCATE( z_qns_m, z_qsr_m, z_dqn_m, z_evap_m, z_devap_m )   
     247         DEALLOCATE( z_qns_m, z_qsr_m, z_dqn_m, z_evap_m, z_devap_m ) 
    245248         ! 
    246249      END SELECT 
     
    250253      CASE( 1 , 2 ) 
    251254         ! 
    252          ALLOCATE( zalb_m(jpi,jpj), ztem_m(jpi,jpj) )   
     255         ALLOCATE( zalb_m(jpi,jpj), ztem_m(jpi,jpj) ) 
    253256         ! 
    254257         zalb_m(:,:) = SUM( a_i(:,:,:) * palb_ice(:,:,:) , dim=3 ) * z1_at_i(:,:) 
     
    260263         END DO 
    261264         ! 
    262          DEALLOCATE( zalb_m, ztem_m )   
     265         DEALLOCATE( zalb_m, ztem_m ) 
    263266         ! 
    264267      END SELECT 
     
    272275      !! 
    273276      !! ** Purpose :   Physical constants and parameters linked to the ice dynamics 
    274       !!       
     277      !! 
    275278      !! ** Method  :   Read the namsbc namelist and check the ice-dynamic 
    276279      !!              parameter values called at the first timestep (nit000) 
  • NEMO/trunk/src/ICE/icestp.F90

    r14005 r14072  
    88   !!                        aka Sea Ice cube for its nickname 
    99   !! 
    10    !!    is originally based on LIM3, developed in Louvain-la-Neuve by:  
     10   !!    is originally based on LIM3, developed in Louvain-la-Neuve by: 
    1111   !!       * Martin Vancoppenolle (UCL-ASTR, Belgium) 
    1212   !!       * Sylvain Bouillon (UCL-ASTR, Belgium) 
     
    140140         IF( .NOT. Agrif_Root() )       nbstep_ice = MOD( nbstep_ice, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) + 1 
    141141         !                              ! these calls must remain here for restartability purposes 
    142                                         CALL agrif_interp_ice( 'T' )  
     142                                        CALL agrif_interp_ice( 'T' ) 
    143143                                        CALL agrif_interp_ice( 'U' ) 
    144144                                        CALL agrif_interp_ice( 'V' ) 
     
    152152         !    utau_ice, vtau_ice = surface ice stress [N/m2] 
    153153         !------------------------------------------------! 
    154                                         CALL ice_sbc_tau( kt, ksbc, utau_ice, vtau_ice )           
     154                                        CALL ice_sbc_tau( kt, ksbc, utau_ice, vtau_ice ) 
    155155         !-------------------------------------! 
    156156         ! --- ice dynamics and advection  --- ! 
    157157         !-------------------------------------! 
    158158                                        CALL diag_set0                ! set diag of mass, heat and salt fluxes to 0 
    159                                         CALL ice_rst_opn( kt )        ! Open Ice restart file (if necessary)  
     159                                        CALL ice_rst_opn( kt )        ! Open Ice restart file (if necessary) 
    160160         ! 
    161161         IF( ln_icedyn .AND. .NOT.lk_c1d )   & 
     
    169169         !                          !==  previous lead fraction and ice volume for flux calculations 
    170170                                        CALL ice_var_glo2eqv          ! h_i and h_s for ice albedo calculation 
    171                                         CALL ice_var_agg(1)           ! at_i for coupling  
     171                                        CALL ice_var_agg(1)           ! at_i for coupling 
    172172                                        CALL store_fields             ! Store now ice values 
    173173         ! 
     
    189189         ! --- ice thermodynamics --- ! 
    190190         !----------------------------! 
    191          IF( ln_icethd )                CALL ice_thd( kt )            ! -- Ice thermodynamics       
     191         IF( ln_icethd )                CALL ice_thd( kt )            ! -- Ice thermodynamics 
    192192         ! 
    193193                                        CALL diag_trends( 2 )         ! record thermo trends 
     
    197197                                        CALL ice_update_flx( kt )     ! -- Update ocean surface mass, heat and salt fluxes 
    198198         ! 
    199          IF( ln_icediahsb )             CALL ice_dia( kt )            ! -- Diagnostics outputs  
    200          ! 
    201          IF( ln_icediachk )             CALL ice_drift_wri( kt )      ! -- Diagnostics outputs for conservation  
    202          ! 
    203                                         CALL ice_wri( kt )            ! -- Ice outputs  
    204          ! 
    205          IF( lrst_ice )                 CALL ice_rst_write( kt )      ! -- Ice restart file  
     199         IF( ln_icediahsb )             CALL ice_dia( kt )            ! -- Diagnostics outputs 
     200         ! 
     201         IF( ln_icediachk )             CALL ice_drift_wri( kt )      ! -- Diagnostics outputs for conservation 
     202         ! 
     203                                        CALL ice_wri( kt )            ! -- Ice outputs 
     204         ! 
     205         IF( lrst_ice )                 CALL ice_rst_write( kt )      ! -- Ice restart file 
    206206         ! 
    207207         IF( ln_icectl )                CALL ice_ctl( kt )            ! -- Control checks 
     
    231231      !!---------------------------------------------------------------------- 
    232232      IF(lwp) WRITE(numout,*) 
    233       IF(lwp) WRITE(numout,*) 'Sea Ice Model: SI3 (Sea Ice modelling Integrated Initiative)'  
     233      IF(lwp) WRITE(numout,*) 'Sea Ice Model: SI3 (Sea Ice modelling Integrated Initiative)' 
    234234      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~' 
    235235      IF(lwp) WRITE(numout,*) 
    236       IF(lwp) WRITE(numout,*) 'ice_init: Arrays allocation & Initialization of all routines & init state'  
     236      IF(lwp) WRITE(numout,*) 'ice_init: Arrays allocation & Initialization of all routines & init state' 
    237237      IF(lwp) WRITE(numout,*) '~~~~~~~~' 
    238238      ! 
     
    250250      !                                ! Allocate the ice arrays (sbc_ice already allocated in sbc_init) 
    251251      ierr =        ice_alloc        ()      ! ice variables 
    252       ierr = ierr + sbc_ice_alloc    ()      ! surface boundary conditions  
     252      ierr = ierr + sbc_ice_alloc    ()      ! surface boundary conditions 
    253253      ierr = ierr + ice1D_alloc      ()      ! thermodynamics 
    254254      ! 
     
    333333         WRITE(numout,*) '         Ice dynamics       (T) or not (F)                   ln_icedyn = ', ln_icedyn 
    334334         WRITE(numout,*) '         Ice thermodynamics (T) or not (F)                   ln_icethd = ', ln_icethd 
    335          WRITE(numout,*) '         maximum ice concentration for NH                              = ', rn_amax_n  
     335         WRITE(numout,*) '         maximum ice concentration for NH                              = ', rn_amax_n 
    336336         WRITE(numout,*) '         maximum ice concentration for SH                              = ', rn_amax_s 
    337337      ENDIF 
     
    417417         wfx_bom(ji,jj) = 0._wp   ;   wfx_sum(ji,jj) = 0._wp 
    418418         wfx_res(ji,jj) = 0._wp   ;   wfx_sub(ji,jj) = 0._wp 
    419          wfx_spr(ji,jj) = 0._wp   ;   wfx_lam(ji,jj) = 0._wp   
     419         wfx_spr(ji,jj) = 0._wp   ;   wfx_lam(ji,jj) = 0._wp 
    420420         wfx_snw_dyn(ji,jj) = 0._wp ; wfx_snw_sum(ji,jj) = 0._wp 
    421421         wfx_snw_sub(ji,jj) = 0._wp ; wfx_ice_sub(ji,jj) = 0._wp 
    422          wfx_snw_sni(ji,jj) = 0._wp  
     422         wfx_snw_sni(ji,jj) = 0._wp 
    423423         wfx_pnd(ji,jj) = 0._wp 
    424424 
  • NEMO/trunk/src/ICE/icetab.F90

    r13715 r14072  
    1717   USE par_oce 
    1818   USE ice, ONLY : jpl 
    19     
     19 
    2020   IMPLICIT NONE 
    2121   PRIVATE 
  • NEMO/trunk/src/ICE/icethd.F90

    r14005 r14072  
    6969   SUBROUTINE ice_thd( kt ) 
    7070      !!------------------------------------------------------------------- 
    71       !!                ***  ROUTINE ice_thd  ***        
    72       !!   
     71      !!                ***  ROUTINE ice_thd  *** 
     72      !! 
    7373      !! ** Purpose : This routine manages ice thermodynamics 
    74       !!          
     74      !! 
    7575      !! ** Action : - computation of oceanic sensible heat flux at the ice base 
    7676      !!                              energy budget in the leads 
     
    114114         ztice_cvgerr = 0._wp ; ztice_cvgstp = 0._wp 
    115115      ENDIF 
    116        
     116 
    117117      !---------------------------------------------! 
    118118      ! computation of friction velocity at T points 
     
    157157         ! --- Sensible ocean-to-ice heat flux (W/m2) --- ! 
    158158         !     (mostly>0 but <0 if supercooling) 
    159          zfric_u            = MAX( SQRT( zfric(ji,jj) ), zfric_umin )  
     159         zfric_u            = MAX( SQRT( zfric(ji,jj) ), zfric_umin ) 
    160160         qsb_ice_bot(ji,jj) = rswitch * rho0 * rcp * zch * zfric_u * ( ( sst_m(ji,jj) + rt0 ) - t_bo(ji,jj) ) 
    161           
    162          ! upper bound for qsb_ice_bot: the heat retrieved from the ocean must be smaller than the heat necessary to reach  
     161 
     162         ! upper bound for qsb_ice_bot: the heat retrieved from the ocean must be smaller than the heat necessary to reach 
    163163         !                              the freezing point, so that we do not have SST < T_freeze 
    164164         !                              This implies: qsb_ice_bot(ji,jj) * at_i(ji,jj) * rtdice <= - zqfr_neg 
     
    210210         ! 
    211211      END_2D 
    212        
     212 
    213213      ! In case we bypass open-water ice formation 
    214214      IF( .NOT. ln_icedO )  qlead(:,:) = 0._wp 
     
    227227         npti = 0 ; nptidx(:) = 0 
    228228         DO_2D( 1, 1, 1, 1 ) 
    229             IF ( a_i(ji,jj,jl) > epsi10 ) THEN      
     229            IF ( a_i(ji,jj,jl) > epsi10 ) THEN 
    230230               npti         = npti  + 1 
    231231               nptidx(npti) = (jj - 1) * jpi + ji 
     
    234234 
    235235         IF( npti > 0 ) THEN  ! If there is no ice, do nothing. 
    236             !                                                                 
     236            ! 
    237237                              CALL ice_thd_1d2d( jl, 1 )            ! --- Move to 1D arrays --- ! 
    238238            !                                                       ! --- & Change units of e_i, e_s from J/m2 to J/m3 --- ! 
    239239            ! 
    240             s_i_new   (1:npti) = 0._wp ; dh_s_tot(1:npti) = 0._wp   ! --- some init --- !  (important to have them here)  
    241             dh_i_sum  (1:npti) = 0._wp ; dh_i_bom(1:npti) = 0._wp ; dh_i_itm  (1:npti) = 0._wp  
     240            s_i_new   (1:npti) = 0._wp ; dh_s_tot(1:npti) = 0._wp   ! --- some init --- !  (important to have them here) 
     241            dh_i_sum  (1:npti) = 0._wp ; dh_i_bom(1:npti) = 0._wp ; dh_i_itm  (1:npti) = 0._wp 
    242242            dh_i_sub  (1:npti) = 0._wp ; dh_i_bog(1:npti) = 0._wp 
    243243            dh_snowice(1:npti) = 0._wp ; dh_s_mlt(1:npti) = 0._wp 
    244             !                                       
     244            ! 
    245245                              CALL ice_thd_zdf                      ! --- Ice-Snow temperature --- ! 
    246246            ! 
    247247            IF( ln_icedH ) THEN                                     ! --- Growing/Melting --- ! 
    248                               CALL ice_thd_dh                           ! Ice-Snow thickness    
     248                              CALL ice_thd_dh                           ! Ice-Snow thickness 
    249249                              CALL ice_thd_ent( e_i_1d(1:npti,:) )      ! Ice enthalpy remapping 
    250250            ENDIF 
    251                               CALL ice_thd_sal( ln_icedS )          ! --- Ice salinity --- !     
     251                              CALL ice_thd_sal( ln_icedS )          ! --- Ice salinity --- ! 
    252252            ! 
    253253                              CALL ice_thd_temp                     ! --- Temperature update --- ! 
     
    266266      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'icethd', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) 
    267267      IF( ln_icediachk )   CALL ice_cons2D  (1, 'icethd',  diag_v,  diag_s,  diag_t,  diag_fv,  diag_fs,  diag_ft) 
    268       !                    
     268      ! 
    269269      IF ( ln_pnd .AND. ln_icedH ) & 
    270          &                    CALL ice_thd_pnd                      ! --- Melt ponds  
     270         &                    CALL ice_thd_pnd                      ! --- Melt ponds 
    271271      ! 
    272272      IF( jpl > 1  )          CALL ice_itd_rem( kt )                ! --- Transport ice between thickness categories --- ! 
     
    276276                              CALL ice_cor( kt , 2 )                ! --- Corrections --- ! 
    277277      ! 
    278       oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * rDt_ice              ! ice natural aging incrementation      
     278      oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * rDt_ice              ! ice natural aging incrementation 
    279279      ! 
    280280      ! convergence tests 
     
    290290      IF( ln_timing )   CALL timing_stop('icethd')                                        ! timing 
    291291      ! 
    292    END SUBROUTINE ice_thd  
    293  
    294   
     292   END SUBROUTINE ice_thd 
     293 
     294 
    295295   SUBROUTINE ice_thd_temp 
    296296      !!----------------------------------------------------------------------- 
    297       !!                   ***  ROUTINE ice_thd_temp ***  
    298       !!                  
     297      !!                   ***  ROUTINE ice_thd_temp *** 
     298      !! 
    299299      !! ** Purpose :   Computes sea ice temperature (Kelvin) from enthalpy 
    300300      !! 
     
    302302      !!------------------------------------------------------------------- 
    303303      INTEGER  ::   ji, jk   ! dummy loop indices 
    304       REAL(wp) ::   ztmelts, zbbb, zccc  ! local scalar  
     304      REAL(wp) ::   ztmelts, zbbb, zccc  ! local scalar 
    305305      !!------------------------------------------------------------------- 
    306306      ! Recover ice temperature 
     
    312312            zccc          = SQRT( MAX( zbbb * zbbb - 4._wp * rcpi * rLfus * ztmelts, 0._wp ) ) 
    313313            t_i_1d(ji,jk) = rt0 - ( zbbb + zccc ) * 0.5_wp * r1_rcpi 
    314              
     314 
    315315            ! mask temperature 
    316             rswitch       = 1._wp - MAX( 0._wp , SIGN( 1._wp , - h_i_1d(ji) ) )  
     316            rswitch       = 1._wp - MAX( 0._wp , SIGN( 1._wp , - h_i_1d(ji) ) ) 
    317317            t_i_1d(ji,jk) = rswitch * t_i_1d(ji,jk) + ( 1._wp - rswitch ) * rt0 
    318          END DO  
    319       END DO  
     318         END DO 
     319      END DO 
    320320      ! 
    321321   END SUBROUTINE ice_thd_temp 
     
    324324   SUBROUTINE ice_thd_mono 
    325325      !!----------------------------------------------------------------------- 
    326       !!                   ***  ROUTINE ice_thd_mono ***  
    327       !!                  
     326      !!                   ***  ROUTINE ice_thd_mono *** 
     327      !! 
    328328      !! ** Purpose :   Lateral melting in case virtual_itd 
    329329      !!                          ( dA = A/2h dh ) 
     
    332332      REAL(wp) ::   zhi_bef            ! ice thickness before thermo 
    333333      REAL(wp) ::   zdh_mel, zda_mel   ! net melting 
    334       REAL(wp) ::   zvi, zvs           ! ice/snow volumes  
     334      REAL(wp) ::   zvi, zvs           ! ice/snow volumes 
    335335      !!----------------------------------------------------------------------- 
    336336      ! 
     
    344344            rswitch     = MAX( 0._wp , SIGN( 1._wp , zhi_bef - epsi20 ) ) 
    345345            zda_mel     = rswitch * a_i_1d(ji) * zdh_mel / ( 2._wp * MAX( zhi_bef, epsi20 ) ) 
    346             a_i_1d(ji)  = MAX( epsi20, a_i_1d(ji) + zda_mel )  
     346            a_i_1d(ji)  = MAX( epsi20, a_i_1d(ji) + zda_mel ) 
    347347            ! adjust thickness 
    348             h_i_1d(ji) = zvi / a_i_1d(ji)             
    349             h_s_1d(ji) = zvs / a_i_1d(ji)             
     348            h_i_1d(ji) = zvi / a_i_1d(ji) 
     349            h_s_1d(ji) = zvs / a_i_1d(ji) 
    350350            ! retrieve total concentration 
    351351            at_i_1d(ji) = a_i_1d(ji) 
     
    358358   SUBROUTINE ice_thd_1d2d( kl, kn ) 
    359359      !!----------------------------------------------------------------------- 
    360       !!                   ***  ROUTINE ice_thd_1d2d ***  
    361       !!                  
     360      !!                   ***  ROUTINE ice_thd_1d2d *** 
     361      !! 
    362362      !! ** Purpose :   move arrays from 1d to 2d and the reverse 
    363363      !!----------------------------------------------------------------------- 
    364       INTEGER, INTENT(in) ::   kl   ! index of the ice category  
     364      INTEGER, INTENT(in) ::   kl   ! index of the ice category 
    365365      INTEGER, INTENT(in) ::   kn   ! 1= from 2D to 1D   ;   2= from 1D to 2D 
    366366      ! 
     
    394394         CALL tab_2d_1d( npti, nptidx(1:npti), dqns_ice_1d   (1:npti), dqns_ice(:,:,kl)     ) 
    395395         CALL tab_2d_1d( npti, nptidx(1:npti), t_bo_1d       (1:npti), t_bo                 ) 
    396          CALL tab_2d_1d( npti, nptidx(1:npti), sprecip_1d    (1:npti), sprecip              )  
     396         CALL tab_2d_1d( npti, nptidx(1:npti), sprecip_1d    (1:npti), sprecip              ) 
    397397         CALL tab_2d_1d( npti, nptidx(1:npti), qsb_ice_bot_1d(1:npti), qsb_ice_bot          ) 
    398398         CALL tab_2d_1d( npti, nptidx(1:npti), fhld_1d       (1:npti), fhld                 ) 
    399           
     399 
    400400         CALL tab_2d_1d( npti, nptidx(1:npti), qml_ice_1d    (1:npti), qml_ice    (:,:,kl) ) 
    401401         CALL tab_2d_1d( npti, nptidx(1:npti), qcn_ice_1d    (1:npti), qcn_ice    (:,:,kl) ) 
     
    471471         sv_i_1d(1:npti) = s_i_1d (1:npti) * v_i_1d (1:npti) 
    472472         oa_i_1d(1:npti) = o_i_1d (1:npti) * a_i_1d (1:npti) 
    473           
     473 
    474474         CALL tab_1d_2d( npti, nptidx(1:npti), at_i_1d(1:npti), at_i             ) 
    475475         CALL tab_1d_2d( npti, nptidx(1:npti), a_i_1d (1:npti), a_i (:,:,kl)     ) 
     
    532532         CALL tab_1d_2d( npti, nptidx(1:npti), dh_i_sum  (1:npti) , dh_i_sum_2d(:,:,kl) ) 
    533533         CALL tab_1d_2d( npti, nptidx(1:npti), dh_s_mlt  (1:npti) , dh_s_mlt_2d(:,:,kl) ) 
    534          ! SIMIP diagnostics          
     534         ! SIMIP diagnostics 
    535535         CALL tab_1d_2d( npti, nptidx(1:npti), t_si_1d       (1:npti), t_si       (:,:,kl) ) 
    536536         CALL tab_1d_2d( npti, nptidx(1:npti), qcn_ice_bot_1d(1:npti), qcn_ice_bot(:,:,kl) ) 
     
    554554   SUBROUTINE ice_thd_init 
    555555      !!------------------------------------------------------------------- 
    556       !!                   ***  ROUTINE ice_thd_init ***  
    557       !!                  
     556      !!                   ***  ROUTINE ice_thd_init *** 
     557      !! 
    558558      !! ** Purpose :   Physical constants and parameters associated with 
    559559      !!                ice thermodynamics 
  • NEMO/trunk/src/ICE/icethd_dh.F90

    r14005 r14072  
    22   !!====================================================================== 
    33   !!                       ***  MODULE icethd_dh *** 
    4    !!   seaice : thermodynamic growth and melt  
     4   !!   seaice : thermodynamic growth and melt 
    55   !!====================================================================== 
    66   !! History :       !  2003-05  (M. Vancoppenolle) Original code in 1D 
    7    !!                 !  2005-06  (M. Vancoppenolle) 3D version  
     7   !!                 !  2005-06  (M. Vancoppenolle) 3D version 
    88   !!            4.0  !  2018     (many people)      SI3 [aka Sea Ice cube] 
    99   !!---------------------------------------------------------------------- 
     
    2424   USE lib_mpp        ! MPP library 
    2525   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero) 
    26     
     26 
    2727   IMPLICIT NONE 
    2828   PRIVATE 
     
    5959      !! 
    6060      !! References : Bitz and Lipscomb, 1999, J. Geophys. Res. 
    61       !!              Fichefet T. and M. Maqueda 1997, J. Geophys. Res., 102(C6), 12609-12646    
    62       !!              Vancoppenolle, Fichefet and Bitz, 2005, Geophys. Res. Let.  
     61      !!              Fichefet T. and M. Maqueda 1997, J. Geophys. Res., 102(C6), 12609-12646 
     62      !!              Vancoppenolle, Fichefet and Bitz, 2005, Geophys. Res. Let. 
    6363      !!              Vancoppenolle et al.,2009, Ocean Modelling 
    6464      !!------------------------------------------------------------------ 
     
    6767 
    6868      REAL(wp) ::   ztmelts      ! local scalar 
    69       REAL(wp) ::   zdum        
     69      REAL(wp) ::   zdum 
    7070      REAL(wp) ::   zfracs       ! fractionation coefficient for bottom salt entrapment 
    7171      REAL(wp) ::   zswi1        ! switch for computation of bottom salinity 
     
    8787      REAL(wp), DIMENSION(jpij) ::   zf_tt       ! Heat budget to determine melting or freezing(W.m-2) 
    8888      REAL(wp), DIMENSION(jpij) ::   zevap_rema  ! remaining mass flux from sublimation        (kg.m-2) 
    89       REAL(wp), DIMENSION(jpij) ::   zdeltah      
     89      REAL(wp), DIMENSION(jpij) ::   zdeltah 
    9090      REAL(wp), DIMENSION(jpij) ::   zsnw        ! distribution of snow after wind blowing 
    9191 
    92       INTEGER , DIMENSION(jpij,nlay_i)     ::   icount    ! number of layers vanishing by melting  
     92      INTEGER , DIMENSION(jpij,nlay_i)     ::   icount    ! number of layers vanishing by melting 
    9393      REAL(wp), DIMENSION(jpij,0:nlay_i+1) ::   zh_i      ! ice layer thickness (m) 
    9494      REAL(wp), DIMENSION(jpij,0:nlay_s  ) ::   zh_s      ! snw layer thickness (m) 
     
    9797      REAL(wp) ::   zswitch_sal 
    9898 
    99       INTEGER  ::   num_iter_max      ! Heat conservation  
     99      INTEGER  ::   num_iter_max      ! Heat conservation 
    100100      !!------------------------------------------------------------------ 
    101101 
     
    149149      ! 
    150150      DO ji = 1, npti 
    151          zf_tt(ji)         = qcn_ice_bot_1d(ji) + qsb_ice_bot_1d(ji) + fhld_1d(ji) + qtr_ice_bot_1d(ji) * frq_m_1d(ji)  
     151         zf_tt(ji)         = qcn_ice_bot_1d(ji) + qsb_ice_bot_1d(ji) + fhld_1d(ji) + qtr_ice_bot_1d(ji) * frq_m_1d(ji) 
    152152         zq_bot(ji)        = MAX( 0._wp, zf_tt(ji) * rDt_ice ) 
    153153      END DO 
     
    172172            END IF 
    173173         END DO 
    174       END DO          
     174      END DO 
    175175 
    176176      ! Snow precipitation 
     
    202202               zdum    = - rswitch * zq_top(ji) / MAX( ze_s(ji,jk), epsi20 )   ! thickness change 
    203203               zdum    = MAX( zdum , - zh_s(ji,jk) )                           ! bound melting 
    204                 
     204 
    205205               hfx_snw_1d    (ji) = hfx_snw_1d    (ji) - ze_s(ji,jk) * zdum * a_i_1d(ji) * r1_Dt_ice   ! heat used to melt snow(W.m-2, >0) 
    206206               wfx_snw_sum_1d(ji) = wfx_snw_sum_1d(ji) - rhos        * zdum * a_i_1d(ji) * r1_Dt_ice   ! snow melting only = water into the ocean 
    207                 
     207 
    208208               ! updates available heat + thickness 
    209209               dh_s_mlt(ji)    =              dh_s_mlt(ji)    + zdum 
     
    217217      END DO 
    218218 
    219       ! Snow sublimation  
     219      ! Snow sublimation 
    220220      !----------------- 
    221221      ! qla_ice is always >=0 (upwards), heat goes to the atmosphere, therefore snow sublimates 
     
    225225      DO ji = 1, npti 
    226226         IF( evap_ice_1d(ji) > 0._wp ) THEN 
    227             zdeltah   (ji) = MAX( - evap_ice_1d(ji) * r1_rhos * rDt_ice, - h_s_1d(ji) )   ! amount of snw that sublimates, < 0             
     227            zdeltah   (ji) = MAX( - evap_ice_1d(ji) * r1_rhos * rDt_ice, - h_s_1d(ji) )   ! amount of snw that sublimates, < 0 
    228228            zevap_rema(ji) = MAX( 0._wp, evap_ice_1d(ji) * rDt_ice + zdeltah(ji) * rhos ) ! remaining evap in kg.m-2 (used for ice sublimation later on) 
    229229         ENDIF 
    230230      END DO 
    231        
     231 
    232232      DO jk = 0, nlay_s 
    233233         DO ji = 1, npti 
     
    247247      END DO 
    248248 
    249       !       
     249      ! 
    250250      !                       ! ============ ! 
    251251      !                       !     Ice      ! 
    252252      !                       ! ============ ! 
    253253 
    254       ! Surface ice melting  
     254      ! Surface ice melting 
    255255      !-------------------- 
    256256      DO jk = 1, nlay_i 
    257257         DO ji = 1, npti 
    258258            ztmelts = - rTmlt * sz_i_1d(ji,jk)   ! Melting point of layer k [C] 
    259              
     259 
    260260            IF( t_i_1d(ji,jk) >= (ztmelts+rt0) ) THEN   !-- Internal melting 
    261261 
    262                zEi            = - e_i_1d(ji,jk) * r1_rhoi             ! Specific enthalpy of layer k [J/kg, <0]        
     262               zEi            = - e_i_1d(ji,jk) * r1_rhoi             ! Specific enthalpy of layer k [J/kg, <0] 
    263263               zdE            =   0._wp                               ! Specific enthalpy difference (J/kg, <0) 
    264264               !                                                          set up at 0 since no energy is needed to melt water...(it is already melted) 
    265                zdum           = MIN( 0._wp , - zh_i(ji,jk) )          ! internal melting occurs when the internal temperature is above freezing      
     265               zdum           = MIN( 0._wp , - zh_i(ji,jk) )          ! internal melting occurs when the internal temperature is above freezing 
    266266               !                                                          this should normally not happen, but sometimes, heat diffusion leads to this 
    267267               zfmdt          = - zdum * rhoi                         ! Recompute mass flux [kg/m2, >0] 
     
    275275               !                                                                                          using s_i_1d and not sz_i_1d(jk) is ok 
    276276            ELSE                                        !-- Surface melting 
    277                 
     277 
    278278               zEi            = - e_i_1d(ji,jk) * r1_rhoi             ! Specific enthalpy of layer k [J/kg, <0] 
    279279               zEw            =    rcp * ztmelts                      ! Specific enthalpy of resulting meltwater [J/kg, <0] 
    280280               zdE            =    zEi - zEw                          ! Specific enthalpy difference < 0 
    281                 
     281 
    282282               zfmdt          = - zq_top(ji) / zdE                    ! Mass flux to the ocean [kg/m2, >0] 
    283                 
     283 
    284284               zdum           = - zfmdt * r1_rhoi                     ! Melt of layer jk [m, <0] 
    285                 
     285 
    286286               zdum           = MIN( 0._wp , MAX( zdum , - zh_i(ji,jk) ) )    ! Melt of layer jk cannot exceed the layer thickness [m, <0] 
    287287 
    288288               zq_top(ji)     = MAX( 0._wp , zq_top(ji) - zdum * rhoi * zdE ) ! update available heat 
    289                 
     289 
    290290               dh_i_sum(ji)   = dh_i_sum(ji) + zdum                   ! Cumulate surface melt 
    291                 
     291 
    292292               zfmdt          = - rhoi * zdum                         ! Recompute mass flux [kg/m2, >0] 
    293                 
     293 
    294294               zQm            = zfmdt * zEw                           ! Energy of the melt water sent to the ocean [J/m2, <0] 
    295                 
     295 
    296296               hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw  * zfmdt             * a_i_1d(ji) * r1_Dt_ice    ! Heat flux [W.m-2], < 0 
    297                hfx_sum_1d(ji) = hfx_sum_1d(ji) - zdE  * zfmdt             * a_i_1d(ji) * r1_Dt_ice    ! Heat flux used in this process [W.m-2], > 0   
     297               hfx_sum_1d(ji) = hfx_sum_1d(ji) - zdE  * zfmdt             * a_i_1d(ji) * r1_Dt_ice    ! Heat flux used in this process [W.m-2], > 0 
    298298               wfx_sum_1d(ji) = wfx_sum_1d(ji) - rhoi * zdum              * a_i_1d(ji) * r1_Dt_ice    ! Mass flux 
    299299               sfx_sum_1d(ji) = sfx_sum_1d(ji) - rhoi * zdum * s_i_1d(ji) * a_i_1d(ji) * r1_Dt_ice    ! Salt flux >0 
    300                !                                                                                          using s_i_1d and not sz_i_1d(jk) is ok)  
     300               !                                                                                          using s_i_1d and not sz_i_1d(jk) is ok) 
    301301            END IF 
    302302            ! update thickness 
     
    320320            !                                                                                                            if all ice is melted. => must be corrected 
    321321            ! update remaining mass flux and thickness 
    322             zevap_rema(ji) = zevap_rema(ji) + zdum * rhoi             
     322            zevap_rema(ji) = zevap_rema(ji) + zdum * rhoi 
    323323            zh_i(ji,jk)    = MAX( 0._wp, zh_i(ji,jk) + zdum ) 
    324324            h_i_1d(ji)     = MAX( 0._wp, h_i_1d(ji)  + zdum ) 
     
    329329            h_i_old (ji,jk) = h_i_old (ji,jk) + zdum 
    330330 
    331             ! record which layers have disappeared (for bottom melting)  
     331            ! record which layers have disappeared (for bottom melting) 
    332332            !    => icount=0 : no layer has vanished 
    333333            !    => icount=5 : 5 layers have vanished 
    334             rswitch       = MAX( 0._wp , SIGN( 1._wp , - zh_i(ji,jk) ) )  
     334            rswitch       = MAX( 0._wp , SIGN( 1._wp , - zh_i(ji,jk) ) ) 
    335335            icount(ji,jk) = NINT( rswitch ) 
    336                          
    337          END DO 
    338       END DO 
    339        
     336 
     337         END DO 
     338      END DO 
     339 
    340340      ! remaining "potential" evap is sent to ocean 
    341341      DO ji = 1, npti 
     
    344344 
    345345 
    346       ! Ice Basal growth  
     346      ! Ice Basal growth 
    347347      !------------------ 
    348348      ! Basal growth is driven by heat imbalance at the ice-ocean interface, 
    349       ! between the inner conductive flux  (qcn_ice_bot), from the open water heat flux  
    350       ! (fhld) and the sensible ice-ocean flux (qsb_ice_bot).  
    351       ! qcn_ice_bot is positive downwards. qsb_ice_bot and fhld are positive to the ice  
     349      ! between the inner conductive flux  (qcn_ice_bot), from the open water heat flux 
     350      ! (fhld) and the sensible ice-ocean flux (qsb_ice_bot). 
     351      ! qcn_ice_bot is positive downwards. qsb_ice_bot and fhld are positive to the ice 
    352352 
    353353      ! If salinity varies in time, an iterative procedure is required, because 
     
    359359      num_iter_max = 1 
    360360      IF( nn_icesal == 2 )   num_iter_max = 5  ! salinity varying in time 
    361        
     361 
    362362      DO ji = 1, npti 
    363363         IF(  zf_tt(ji) < 0._wp  ) THEN 
     
    366366               ! New bottom ice salinity (Cox & Weeks, JGR88 ) 
    367367               !--- zswi1  if dh/dt < 2.0e-8 
    368                !--- zswi12 if 2.0e-8 < dh/dt < 3.6e-7  
     368               !--- zswi12 if 2.0e-8 < dh/dt < 3.6e-7 
    369369               !--- zswi2  if dh/dt > 3.6e-7 
    370370               zgrr     = MIN( 1.0e-3, MAX ( dh_i_bog(ji) * r1_Dt_ice , epsi10 ) ) 
     
    380380 
    381381               zt_i_new       = zswitch_sal * t_bo_1d(ji) + ( 1. - zswitch_sal) * t_i_1d(ji, nlay_i) 
    382                 
     382 
    383383               zEi            = rcpi * ( zt_i_new - (ztmelts+rt0) ) &                                  ! Specific enthalpy of forming ice (J/kg, <0) 
    384384                  &             - rLfus * ( 1.0 - ztmelts / ( MIN( zt_i_new - rt0, -epsi10 ) ) ) + rcp * ztmelts 
     
    389389 
    390390               dh_i_bog(ji)   = rDt_ice * MAX( 0._wp , zf_tt(ji) / ( zdE * rhoi ) ) 
    391                 
     391 
    392392            END DO 
    393             ! Contribution to Energy and Salt Fluxes                                     
     393            ! Contribution to Energy and Salt Fluxes 
    394394            zfmdt = - rhoi * dh_i_bog(ji)                                                              ! Mass flux x time step (kg/m2, < 0) 
    395              
     395 
    396396            hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw  * zfmdt                      * a_i_1d(ji) * r1_Dt_ice   ! Heat flux to the ocean [W.m-2], >0 
    397             hfx_bog_1d(ji) = hfx_bog_1d(ji) - zdE  * zfmdt                      * a_i_1d(ji) * r1_Dt_ice   ! Heat flux used in this process [W.m-2], <0           
     397            hfx_bog_1d(ji) = hfx_bog_1d(ji) - zdE  * zfmdt                      * a_i_1d(ji) * r1_Dt_ice   ! Heat flux used in this process [W.m-2], <0 
    398398            wfx_bog_1d(ji) = wfx_bog_1d(ji) - rhoi * dh_i_bog(ji)               * a_i_1d(ji) * r1_Dt_ice   ! Mass flux, <0 
    399399            sfx_bog_1d(ji) = sfx_bog_1d(ji) - rhoi * dh_i_bog(ji) * s_i_new(ji) * a_i_1d(ji) * r1_Dt_ice   ! Salt flux, <0 
     
    415415      DO jk = nlay_i, 1, -1 
    416416         DO ji = 1, npti 
    417             IF(  zf_tt(ji)  >  0._wp  .AND. jk > icount(ji,jk) ) THEN   ! do not calculate where layer has already disappeared by surface melting  
     417            IF(  zf_tt(ji)  >  0._wp  .AND. jk > icount(ji,jk) ) THEN   ! do not calculate where layer has already disappeared by surface melting 
    418418 
    419419               ztmelts = - rTmlt * sz_i_1d(ji,jk)  ! Melting point of layer jk (C) 
     
    424424                  zdE            = 0._wp                         ! Specific enthalpy difference   (J/kg, <0) 
    425425                  !                                                  set up at 0 since no energy is needed to melt water...(it is already melted) 
    426                   zdum           = MIN( 0._wp , - zh_i(ji,jk) )  ! internal melting occurs when the internal temperature is above freezing      
     426                  zdum           = MIN( 0._wp , - zh_i(ji,jk) )  ! internal melting occurs when the internal temperature is above freezing 
    427427                  !                                                  this should normally not happen, but sometimes, heat diffusion leads to this 
    428428                  dh_i_itm (ji)  = dh_i_itm(ji) + zdum 
     
    446446 
    447447                  zdum           = MIN( 0._wp , MAX( zdum, - zh_i(ji,jk) ) )       ! bound thickness change 
    448                    
     448 
    449449                  zq_bot(ji)     = MAX( 0._wp , zq_bot(ji) - zdum * rhoi * zdE )   ! update available heat. MAX is necessary for roundup errors 
    450450 
     
    455455                  zQm            = zfmdt * zEw                                     ! Heat exchanged with ocean 
    456456 
    457                   hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw  * zfmdt             * a_i_1d(ji) * r1_Dt_ice   ! Heat flux to the ocean [W.m-2], <0   
     457                  hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw  * zfmdt             * a_i_1d(ji) * r1_Dt_ice   ! Heat flux to the ocean [W.m-2], <0 
    458458                  hfx_bom_1d(ji) = hfx_bom_1d(ji) - zdE  * zfmdt             * a_i_1d(ji) * r1_Dt_ice   ! Heat used in this process [W.m-2], >0 
    459459                  wfx_bom_1d(ji) = wfx_bom_1d(ji) - rhoi * zdum              * a_i_1d(ji) * r1_Dt_ice   ! Mass flux 
     
    488488         END DO 
    489489      END DO 
    490        
     490 
    491491      ! Snow load on ice 
    492492      ! ----------------- 
     
    511511         END DO 
    512512      END DO 
    513        
     513 
    514514      ! Snow-Ice formation 
    515515      ! ------------------ 
    516       ! When snow load exceeds Archimede's limit, snow-ice interface goes down under sea-level,  
     516      ! When snow load exceeds Archimede's limit, snow-ice interface goes down under sea-level, 
    517517      ! flooding of seawater transforms snow into ice. Thickness that is transformed is dh_snowice (positive for the ice) 
    518518      z1_rho = 1._wp / ( rhos+rho0-rhoi ) 
     
    528528         zfmdt          = ( rhos - rhoi ) * dh_snowice(ji)    ! <0 
    529529         zEw            = rcp * sst_1d(ji) 
    530          zQm            = zfmdt * zEw  
    531           
     530         zQm            = zfmdt * zEw 
     531 
    532532         hfx_thd_1d(ji) = hfx_thd_1d(ji) + zEw        * zfmdt * a_i_1d(ji) * r1_Dt_ice ! Heat flux 
    533533         sfx_sni_1d(ji) = sfx_sni_1d(ji) + sss_1d(ji) * zfmdt * a_i_1d(ji) * r1_Dt_ice ! Salt flux 
     
    536536         IF( nn_icesal /= 2 )  THEN 
    537537            sfx_bri_1d(ji) = sfx_bri_1d(ji) - sss_1d(ji) * zfmdt                 * a_i_1d(ji) * r1_Dt_ice  &  ! put back sss_m     into the ocean 
    538                &                            - s_i_1d(ji) * dh_snowice(ji) * rhoi * a_i_1d(ji) * r1_Dt_ice     ! and get  rn_icesal from the ocean  
     538               &                            - s_i_1d(ji) * dh_snowice(ji) * rhoi * a_i_1d(ji) * r1_Dt_ice     ! and get  rn_icesal from the ocean 
    539539         ENDIF 
    540540 
     
    574574      !-------------------------------------------- 
    575575      CALL snw_ent( zh_s, ze_s, e_s_1d ) 
    576        
     576 
    577577      ! recalculate t_s_1d from e_s_1d 
    578578      DO jk = 1, nlay_s 
     
    589589 
    590590      ! --- ensure that a_i = 0 & h_s = 0 where h_i = 0 --- 
    591       WHERE( h_i_1d(1:npti) == 0._wp )    
     591      WHERE( h_i_1d(1:npti) == 0._wp ) 
    592592         a_i_1d (1:npti) = 0._wp 
    593593         h_s_1d (1:npti) = 0._wp 
    594594         t_su_1d(1:npti) = rt0 
    595595      END WHERE 
    596        
     596 
    597597   END SUBROUTINE ice_thd_dh 
    598598 
     
    602602      !! 
    603603      !! ** Purpose : 
    604       !!           This routine computes new vertical grids in the snow,  
    605       !!           and consistently redistributes temperatures.  
     604      !!           This routine computes new vertical grids in the snow, 
     605      !!           and consistently redistributes temperatures. 
    606606      !!           Redistribution is made so as to ensure to energy conservation 
    607607      !! 
    608608      !! 
    609609      !! ** Method  : linear conservative remapping 
    610       !!            
     610      !! 
    611611      !! ** Steps : 1) cumulative integrals of old enthalpies/thicknesses 
    612612      !!            2) linear remapping on the new layers 
     
    637637      !  1) Cumulative integral of old enthalpy * thickness and layers interfaces 
    638638      !-------------------------------------------------------------------------- 
    639       zeh_cum0(1:npti,0) = 0._wp  
     639      zeh_cum0(1:npti,0) = 0._wp 
    640640      zh_cum0 (1:npti,0) = 0._wp 
    641641      DO jk0 = 1, nlay_s+1 
     
    651651      ! new layer thickesses 
    652652      DO ji = 1, npti 
    653          zhnew(ji) = SUM( ph_old(ji,0:nlay_s) ) * r1_nlay_s   
     653         zhnew(ji) = SUM( ph_old(ji,0:nlay_s) ) * r1_nlay_s 
    654654      END DO 
    655655 
     
    662662      END DO 
    663663 
    664       zeh_cum1(1:npti,0:nlay_s) = 0._wp  
     664      zeh_cum1(1:npti,0:nlay_s) = 0._wp 
    665665      ! new cumulative q*h => linear interpolation 
    666666      DO jk0 = 1, nlay_s+1 
     
    676676      END DO 
    677677      ! to ensure that total heat content is strictly conserved, set: 
    678       zeh_cum1(1:npti,nlay_s) = zeh_cum0(1:npti,nlay_s+1)  
     678      zeh_cum1(1:npti,nlay_s) = zeh_cum0(1:npti,nlay_s+1) 
    679679 
    680680      ! new enthalpies 
    681681      DO jk1 = 1, nlay_s 
    682682         DO ji = 1, npti 
    683             rswitch      = MAX( 0._wp , SIGN( 1._wp , zhnew(ji) - epsi20 ) )  
     683            rswitch      = MAX( 0._wp , SIGN( 1._wp , zhnew(ji) - epsi20 ) ) 
    684684            pe_new(ji,jk1) = rswitch * ( zeh_cum1(ji,jk1) - zeh_cum1(ji,jk1-1) ) / MAX( zhnew(ji), epsi20 ) 
    685685         END DO 
    686686      END DO 
    687        
     687 
    688688   END SUBROUTINE snw_ent 
    689689 
    690     
     690 
    691691#else 
    692692   !!---------------------------------------------------------------------- 
  • NEMO/trunk/src/ICE/icethd_pnd.F90

    r14005 r14072  
    1 MODULE icethd_pnd  
     1MODULE icethd_pnd 
    22   !!====================================================================== 
    33   !!                     ***  MODULE  icethd_pnd   *** 
     
    4141   INTEGER, PARAMETER ::   np_pndTOPO = 3   ! Level ice pond scheme 
    4242 
    43    !--------------------------------------------------------------------------  
     43   !-------------------------------------------------------------------------- 
    4444   ! Diagnostics for pond volume per area 
    4545   ! 
     
    5656   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   diag_dvpn_drn       ! pond volume lost by drainage     [-] 
    5757   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   diag_dvpn_lid       ! exchange with lid / refreezing   [-] 
    58    REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   diag_dvpn_rnf       ! meltwater pond lost to runoff    [-]       
     58   REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   diag_dvpn_rnf       ! meltwater pond lost to runoff    [-] 
    5959   REAL(wp), ALLOCATABLE, DIMENSION(:)   ::   diag_dvpn_mlt_1d    ! meltwater pond volume input      [-] 
    6060   REAL(wp), ALLOCATABLE, DIMENSION(:)   ::   diag_dvpn_drn_1d    ! pond volume lost by drainage     [-] 
     
    7575      !!------------------------------------------------------------------- 
    7676      !!               ***  ROUTINE ice_thd_pnd   *** 
    77       !!                
     77      !! 
    7878      !! ** Purpose :   change melt pond fraction and thickness 
    7979      !! 
     
    8484      INTEGER ::   ji, jj, jl        ! loop indices 
    8585      !!------------------------------------------------------------------- 
    86        
     86 
    8787      ALLOCATE( diag_dvpn_mlt(jpi,jpj), diag_dvpn_lid(jpi,jpj), diag_dvpn_drn(jpi,jpj), diag_dvpn_rnf(jpi,jpj) ) 
    8888      ALLOCATE( diag_dvpn_mlt_1d(jpij), diag_dvpn_lid_1d(jpij), diag_dvpn_drn_1d(jpij), diag_dvpn_rnf_1d(jpij) ) 
     
    111111         END_2D 
    112112      END DO 
    113        
     113 
    114114      !------------------------------ 
    115115      !  Identify grid cells with ice 
     
    148148      DEALLOCATE( diag_dvpn_mlt   , diag_dvpn_lid   , diag_dvpn_drn   , diag_dvpn_rnf    ) 
    149149      DEALLOCATE( diag_dvpn_mlt_1d, diag_dvpn_lid_1d, diag_dvpn_drn_1d, diag_dvpn_rnf_1d ) 
    150        
    151    END SUBROUTINE ice_thd_pnd  
    152  
    153  
    154    SUBROUTINE pnd_CST  
     150 
     151   END SUBROUTINE ice_thd_pnd 
     152 
     153 
     154   SUBROUTINE pnd_CST 
    155155      !!------------------------------------------------------------------- 
    156156      !!                ***  ROUTINE pnd_CST  *** 
     
    158158      !! ** Purpose :   Compute melt pond evolution 
    159159      !! 
    160       !! ** Method  :   Melt pond fraction and thickness are prescribed  
     160      !! ** Method  :   Melt pond fraction and thickness are prescribed 
    161161      !!                to non-zero values when t_su = 0C 
    162162      !! 
    163163      !! ** Tunable parameters : pond fraction (rn_apnd), pond depth (rn_hpnd) 
    164       !!                 
     164      !! 
    165165      !! ** Note   : Coupling with such melt ponds is only radiative 
    166166      !!             Advection, ridging, rafting... are bypassed 
     
    172172      !!------------------------------------------------------------------- 
    173173      DO jl = 1, jpl 
    174           
     174 
    175175         CALL tab_2d_1d( npti, nptidx(1:npti), a_i_1d    (1:npti), a_i    (:,:,jl) ) 
    176176         CALL tab_2d_1d( npti, nptidx(1:npti), t_su_1d   (1:npti), t_su   (:,:,jl) ) 
     
    185185            ! 
    186186            IF( a_i_1d(ji) >= 0.01_wp .AND. t_su_1d(ji) >= rt0 ) THEN 
    187                h_ip_1d(ji)      = rn_hpnd     
     187               h_ip_1d(ji)      = rn_hpnd 
    188188               a_ip_1d(ji)      = rn_apnd * a_i_1d(ji) 
    189189               h_il_1d(ji)      = 0._wp    ! no pond lids whatsoever 
    190190            ELSE 
    191                h_ip_1d(ji)      = 0._wp     
     191               h_ip_1d(ji)      = 0._wp 
    192192               a_ip_1d(ji)      = 0._wp 
    193193               h_il_1d(ji)      = 0._wp 
     
    222222      !! ** Method  : A fraction of meltwater is accumulated in ponds and sent to ocean when surface is freezing 
    223223      !!              We  work with volumes and then redistribute changes into thickness and concentration 
    224       !!              assuming linear relationship between the two.  
     224      !!              assuming linear relationship between the two. 
    225225      !! 
    226226      !! ** Action  : - pond growth:      Vp = Vp + dVmelt                                          --- from Holland et al 2012 --- 
     
    237237      !!                                     dH = lid thickness change. Retrieved from this eq.:    --- from Flocco et al 2010 --- 
    238238      !! 
    239       !!                                                                   rhoi * Lf * dH/dt = ki * MAX(Tp-Tsu,0) / H  
     239      !!                                                                   rhoi * Lf * dH/dt = ki * MAX(Tp-Tsu,0) / H 
    240240      !!                                                                      H = lid thickness 
    241241      !!                                                                      Lf = latent heat of fusion 
     
    260260      !! 
    261261      !! ** Tunable parameters : rn_apnd_max, rn_apnd_min, rn_pnd_flush 
    262       !!  
    263       !! ** Note       :   Mostly stolen from CICE but not only. These are between level-ice ponds and CESM ponds.  
     262      !! 
     263      !! ** Note       :   Mostly stolen from CICE but not only. These are between level-ice ponds and CESM ponds. 
    264264      !! 
    265265      !! ** References :   Flocco and Feltham (JGR, 2007) 
     
    267267      !!                   Holland et al      (J. Clim, 2012) 
    268268      !!                   Hunke et al        (OM 2012) 
    269       !!-------------------------------------------------------------------   
     269      !!------------------------------------------------------------------- 
    270270      REAL(wp), DIMENSION(nlay_i) ::   ztmp           ! temporary array 
    271271      !! 
     
    287287      INTEGER  ::   ji, jk, jl                        ! loop indices 
    288288      !!------------------------------------------------------------------- 
    289       z1_rhow   = 1._wp / rhow  
     289      z1_rhow   = 1._wp / rhow 
    290290      z1_aspect = 1._wp / zaspect 
    291       z1_Tp     = 1._wp / zTp  
    292        
     291      z1_Tp     = 1._wp / zTp 
     292 
    293293      CALL tab_2d_1d( npti, nptidx(1:npti), at_i_1d          (1:npti), at_i          ) 
    294294      CALL tab_2d_1d( npti, nptidx(1:npti), wfx_pnd_1d       (1:npti), wfx_pnd       ) 
    295        
     295 
    296296      CALL tab_2d_1d( npti, nptidx(1:npti), diag_dvpn_mlt_1d (1:npti), diag_dvpn_mlt ) 
    297297      CALL tab_2d_1d( npti, nptidx(1:npti), diag_dvpn_drn_1d (1:npti), diag_dvpn_drn ) 
     
    315315            CALL tab_2d_1d( npti, nptidx(1:npti), t_i_1d (1:npti,jk), t_i (:,:,jk,jl) ) 
    316316         END DO 
    317           
     317 
    318318         !----------------------- 
    319319         ! Melt pond calculations 
     
    342342               zdv_avail = -( dh_i_sum(ji)*rhoi + dh_s_mlt(ji)*rhos ) * z1_rhow * a_i_1d(ji) ! > 0 
    343343               zfr_mlt   = rn_apnd_min + ( rn_apnd_max - rn_apnd_min ) * at_i_1d(ji) !  = ( 1 - r ) = fraction of melt water that is not flushed 
    344                zdv_mlt   = MAX( 0._wp, zfr_mlt * zdv_avail ) ! max for roundoff errors?  
     344               zdv_mlt   = MAX( 0._wp, zfr_mlt * zdv_avail ) ! max for roundoff errors? 
    345345               ! 
    346346               !--- overflow ---! 
     
    349349               !    If pond area exceeds zfr_mlt * a_i_1d(ji) then reduce the pond volume 
    350350               !       a_ip_max = zfr_mlt * a_i 
    351                !       => from zaspect = h_ip / (a_ip / a_i), set v_ip_max as:  
     351               !       => from zaspect = h_ip / (a_ip / a_i), set v_ip_max as: 
    352352               zv_ip_max = zfr_mlt**2 * a_i_1d(ji) * zaspect 
    353353               zdv_mlt   = MAX( 0._wp, MIN( zdv_mlt, zv_ip_max - v_ip_1d(ji) ) ) 
     
    356356               !    If pond depth exceeds half the ice thickness then reduce the pond volume 
    357357               !       h_ip_max = 0.5 * h_i 
    358                !       => from zaspect = h_ip / (a_ip / a_i), set v_ip_max as:  
     358               !       => from zaspect = h_ip / (a_ip / a_i), set v_ip_max as: 
    359359               zv_ip_max = z1_aspect * a_i_1d(ji) * 0.25 * h_i_1d(ji) * h_i_1d(ji) 
    360360               zdv_mlt   = MAX( 0._wp, MIN( zdv_mlt, zv_ip_max - v_ip_1d(ji) ) ) 
     
    375375               IF( ln_pnd_lids ) THEN 
    376376                  ! 
    377                   !--- Lid growing and subsequent pond shrinking ---!  
     377                  !--- Lid growing and subsequent pond shrinking ---! 
    378378                  zdv_frz = - 0.5_wp * MAX( 0._wp, -v_il_1d(ji) + & ! Flocco 2010 (eq. 5) solved implicitly as aH**2 + bH + c = 0 
    379379                     &                    SQRT( v_il_1d(ji)**2 + a_ip_1d(ji)**2 * 4._wp * rcnd_i * zdT * rDt_ice / (rLfus * rhow) ) ) ! max for roundoff errors 
     
    386386 
    387387               ELSE 
    388                   zdv_frz = v_ip_1d(ji) * ( EXP( 0.01_wp * zdT * z1_Tp ) - 1._wp )  ! Holland 2012 (eq. 6)  
     388                  zdv_frz = v_ip_1d(ji) * ( EXP( 0.01_wp * zdT * z1_Tp ) - 1._wp )  ! Holland 2012 (eq. 6) 
    389389                  ! Pond shrinking 
    390390                  v_ip_1d(ji) = MAX( 0._wp, v_ip_1d(ji) + zdv_frz ) 
     
    398398               ! 
    399399 
    400                !------------------------------------------------!             
     400               !------------------------------------------------! 
    401401               ! Pond drainage through brine network (flushing) ! 
    402402               !------------------------------------------------! 
     
    420420               ! Do the drainage using Darcy's law 
    421421               zdv_flush   = -zperm * rho0 * grav * zhp * rDt_ice / (zvisc * h_i_1d(ji)) * a_ip_1d(ji) * rn_pnd_flush ! zflush comes from Hunke et al. (2012) 
    422                zdv_flush   = MAX( zdv_flush, -v_ip_1d(ji) ) ! < 0  
     422               zdv_flush   = MAX( zdv_flush, -v_ip_1d(ji) ) ! < 0 
    423423               v_ip_1d(ji) = v_ip_1d(ji) + zdv_flush 
    424424 
     
    479479 
    480480 
    481    SUBROUTINE pnd_TOPO     
    482                                           
     481   SUBROUTINE pnd_TOPO 
     482 
    483483      !!------------------------------------------------------------------- 
    484484      !!                ***  ROUTINE pnd_TOPO  *** 
     
    488488      !! 
    489489      !! ** Method  :   This code is initially based on Flocco and Feltham 
    490       !!                (2007) and Flocco et al. (2010).  
     490      !!                (2007) and Flocco et al. (2010). 
    491491      !! 
    492492      !!                - Calculate available pond water base on surface meltwater 
     
    532532      REAL(wp), DIMENSION(jpi,jpj) ::   zvolp, &     !! total melt pond water available before redistribution and drainage 
    533533                                        zvolp_res    !! remaining melt pond water available after drainage 
    534                                          
     534 
    535535      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z1_a_i 
    536536 
     
    545545 
    546546      CALL ctl_stop( 'STOP', 'icethd_pnd : topographic melt ponds are still an ongoing work' ) 
    547        
     547 
    548548      !--------------------------------------------------------------- 
    549549      ! Initialise 
     
    553553      zrhoi_L   = rhoi * rLfus      ! volumetric latent heat (J/m^3) 
    554554      zTp       = rt0 - 0.15_wp          ! pond freezing point, slightly below 0C (ponds are bid saline) 
    555       z1_rhow   = 1._wp / rhow  
     555      z1_rhow   = 1._wp / rhow 
    556556 
    557557      ! Set required ice variables (hard-coded here for now) 
    558 !      zfpond(:,:) = 0._wp          ! contributing freshwater flux (?)  
    559        
     558!      zfpond(:,:) = 0._wp          ! contributing freshwater flux (?) 
     559 
    560560      at_i (:,:) = SUM( a_i (:,:,:), dim=3 ) ! ice fraction 
    561561      vt_i (:,:) = SUM( v_i (:,:,:), dim=3 ) ! volume per grid area 
    562562      vt_ip(:,:) = SUM( v_ip(:,:,:), dim=3 ) ! pond volume per grid area 
    563563      vt_il(:,:) = SUM( v_il(:,:,:), dim=3 ) ! lid volume per grid area 
    564        
     564 
    565565      ! thickness 
    566566      WHERE( a_i(:,:,:) > epsi20 )   ;   z1_a_i(:,:,:) = 1._wp / a_i(:,:,:) 
     
    568568      END WHERE 
    569569      h_i(:,:,:) = v_i (:,:,:) * z1_a_i(:,:,:) 
    570        
     570 
    571571      !--------------------------------------------------------------- 
    572572      ! Change 2D to 1D 
    573573      !--------------------------------------------------------------- 
    574       ! MV  
     574      ! MV 
    575575      ! a less computing-intensive version would have 2D-1D passage here 
    576576      ! use what we have in iceitd.F90 (incremental remapping) 
     
    582582      ! Holland et al (2012) suggest that the fraction of runoff decreases with total ice fraction 
    583583      ! I cite her words, they are very talkative 
    584       ! "grid cells with very little ice cover (and hence more open water area)  
     584      ! "grid cells with very little ice cover (and hence more open water area) 
    585585      ! have a higher runoff fraction to rep- resent the greater proximity of ice to open water." 
    586586      ! "This results in the same runoff fraction r for each ice category within a grid cell" 
    587        
     587 
    588588      zvolp(:,:) = 0._wp 
    589589 
    590590      DO jl = 1, jpl 
    591591         DO_2D( 1, 1, 1, 1 ) 
    592                   
     592 
    593593               IF ( a_i(ji,jj,jl) > epsi10 ) THEN 
    594              
     594 
    595595                  !--- Available and contributing meltwater for melt ponding ---! 
    596596                  zv_mlt  = - ( dh_i_sum_2d(ji,jj,jl) * rhoi + dh_s_mlt_2d(ji,jj,jl) * rhos ) &        ! available volume of surface melt water per grid area 
     
    601601 
    602602                  diag_dvpn_mlt(ji,jj) = diag_dvpn_mlt(ji,jj) + zv_mlt * r1_Dt_ice                     ! diags 
    603                   diag_dvpn_rnf(ji,jj) = diag_dvpn_rnf(ji,jj) + ( 1. - zfr_mlt ) * zv_mlt * r1_Dt_ice    
     603                  diag_dvpn_rnf(ji,jj) = diag_dvpn_rnf(ji,jj) + ( 1. - zfr_mlt ) * zv_mlt * r1_Dt_ice 
    604604 
    605605                  !--- Create possible new ponds 
     
    610610                     a_ip_frac(ji,jj,jl)  = 1.0_wp    ! pond fraction of sea ice (apnd for CICE) 
    611611                  ENDIF 
    612                    
     612 
    613613                  !--- Deepen existing ponds with no change in pond fraction, before redistribution and drainage 
    614614                  v_ip(ji,jj,jl) = v_ip(ji,jj,jl) +  zv_pnd                                            ! use pond water to increase thickness 
    615615                  h_ip(ji,jj,jl) = v_ip(ji,jj,jl) / a_ip(ji,jj,jl) 
    616                    
     616 
    617617                  !--- Total available pond water volume (pre-existing + newly produced)j 
    618                   zvolp(ji,jj)   = zvolp(ji,jj)   + v_ip(ji,jj,jl)  
     618                  zvolp(ji,jj)   = zvolp(ji,jj)   + v_ip(ji,jj,jl) 
    619619!                 zfpond(ji,jj) = zfpond(ji,jj) + zpond * a_ip_frac(ji,jj,jl) ! useless for now 
    620                     
     620 
    621621               ENDIF ! a_i 
    622622 
    623623         END_2D 
    624624      END DO ! ji 
    625                    
     625 
    626626      !-------------------------------------------------------------- 
    627627      ! Redistribute and drain water from ponds 
    628       !--------------------------------------------------------------    
     628      !-------------------------------------------------------------- 
    629629      CALL ice_thd_pnd_area( zvolp, zvolp_res ) 
    630                                     
     630 
    631631      !-------------------------------------------------------------- 
    632632      ! Melt pond lid growth and melt 
    633       !--------------------------------------------------------------    
    634        
     633      !-------------------------------------------------------------- 
     634 
    635635      IF( ln_pnd_lids ) THEN 
    636636 
     
    638638 
    639639            IF ( at_i(ji,jj) > 0.01 .AND. hm_i(ji,jj) > rn_himin .AND. vt_ip(ji,jj) > zvp_min * at_i(ji,jj) ) THEN 
    640                    
     640 
    641641               !-------------------------- 
    642642               ! Pond lid growth and melt 
     
    648648               END DO 
    649649               zTavg = zTavg / a_i(ji,jj,jl) !!! could get a division by zero here 
    650           
     650 
    651651               DO jl = 1, jpl-1 
    652              
     652 
    653653                  IF ( v_il(ji,jj,jl) > epsi10 ) THEN 
    654                 
     654 
    655655                     !---------------------------------------------------------------- 
    656656                     ! Lid melting: floating upper ice layer melts in whole or part 
     
    660660 
    661661                        zdvice = MIN( dh_i_sum_2d(ji,jj,jl)*a_ip(ji,jj,jl), v_il(ji,jj,jl) ) 
    662                          
     662 
    663663                        IF ( zdvice > epsi10 ) THEN 
    664                          
     664 
    665665                           v_il (ji,jj,jl) = v_il (ji,jj,jl)   - zdvice 
    666                            v_ip(ji,jj,jl)  = v_ip(ji,jj,jl)    + zdvice ! MV: not sure i understand dh_i_sum seems counted twice -  
     666                           v_ip(ji,jj,jl)  = v_ip(ji,jj,jl)    + zdvice ! MV: not sure i understand dh_i_sum seems counted twice - 
    667667                                                                        ! as it is already counted in surface melt 
    668668!                          zvolp(ji,jj)     = zvolp(ji,jj)     + zdvice ! pointless to calculate total volume (done in icevar) 
    669669!                          zfpond(ji,jj)    = fpond(ji,jj)     + zdvice ! pointless to follow fw budget (ponds have no fw) 
    670                       
     670 
    671671                           IF ( v_il(ji,jj,jl) < epsi10 .AND. v_ip(ji,jj,jl) > epsi10) THEN 
    672672                           ! ice lid melted and category is pond covered 
    673                               v_ip(ji,jj,jl)  = v_ip(ji,jj,jl)  + v_il(ji,jj,jl)  
    674 !                             zfpond(ji,jj)    = zfpond (ji,jj)    + v_il(ji,jj,jl)  
     673                              v_ip(ji,jj,jl)  = v_ip(ji,jj,jl)  + v_il(ji,jj,jl) 
     674!                             zfpond(ji,jj)    = zfpond (ji,jj)    + v_il(ji,jj,jl) 
    675675                              v_il(ji,jj,jl)   = 0._wp 
    676676                           ENDIF 
    677677                           h_ip(ji,jj,jl) = v_ip(ji,jj,jl) / a_ip(ji,jj,jl) !!! could get a division by zero here 
    678                             
     678 
    679679                           diag_dvpn_lid(ji,jj) = diag_dvpn_lid(ji,jj) + zdvice   ! diag 
    680                             
     680 
    681681                        ENDIF 
    682                          
     682 
    683683                     !---------------------------------------------------------------- 
    684                      ! Freeze pre-existing lid  
     684                     ! Freeze pre-existing lid 
    685685                     !---------------------------------------------------------------- 
    686686 
     
    688688 
    689689                        ! differential growth of base of surface floating ice layer 
    690                         zdTice = MAX( - t_su(ji,jj,jl) - zTd , 0._wp ) ! > 0    
     690                        zdTice = MAX( - t_su(ji,jj,jl) - zTd , 0._wp ) ! > 0 
    691691                        zomega = rcnd_i * zdTice / zrhoi_L 
    692692                        zdHui  = SQRT( 2._wp * zomega * rDt_ice + ( v_il(ji,jj,jl) / a_i(ji,jj,jl) )**2 ) & 
    693693                               - v_il(ji,jj,jl) / a_i(ji,jj,jl) 
    694694                        zdvice = min( zdHui*a_ip(ji,jj,jl) , v_ip(ji,jj,jl) ) 
    695                    
     695 
    696696                        IF ( zdvice > epsi10 ) THEN 
    697697                           v_il (ji,jj,jl)  = v_il(ji,jj,jl)   + zdvice 
     
    700700!                          zfpond(ji,jj)   = zfpond(ji,jj)    - zdvice 
    701701                           h_ip(ji,jj,jl)   = v_ip(ji,jj,jl) / a_ip(ji,jj,jl) 
    702                             
     702 
    703703                           diag_dvpn_lid(ji,jj) = diag_dvpn_lid(ji,jj) - zdvice    ! diag 
    704                             
     704 
    705705                        ENDIF 
    706                    
     706 
    707707                     ENDIF ! Tsfcn(i,j,n) 
    708708 
     
    714714 
    715715                  ELSE ! v_il < epsi10 
    716                      
     716 
    717717                     ! thickness of newly formed ice 
    718718                     ! the surface temperature of a meltpond is the same as that 
    719                      ! of the ice underneath (0C), and the thermodynamic surface  
     719                     ! of the ice underneath (0C), and the thermodynamic surface 
    720720                     ! flux is the same 
    721                       
     721 
    722722                     !!! we need net surface energy flux, excluding conduction 
    723723                     !!! fsurf is summed over categories in CICE 
    724724                     !!! we have the category-dependent flux, let us use it ? 
    725                      zfsurf = qns_ice(ji,jj,jl) + qsr_ice(ji,jj,jl)                      
     725                     zfsurf = qns_ice(ji,jj,jl) + qsr_ice(ji,jj,jl) 
    726726                     zdHui  = MAX ( -zfsurf * rDt_ice/zrhoi_L , 0._wp ) 
    727727                     zdvice = MIN ( zdHui * a_ip(ji,jj,jl) , v_ip(ji,jj,jl) ) 
     
    729729                        v_il (ji,jj,jl)  = v_il(ji,jj,jl)   + zdvice 
    730730                        v_ip(ji,jj,jl)   = v_ip(ji,jj,jl)   - zdvice 
    731                          
     731 
    732732                        diag_dvpn_lid(ji,jj) = diag_dvpn_lid(ji,jj) - zdvice      ! diag 
    733733!                       zvolp(ji,jj)     = zvolp(ji,jj)     - zdvice 
     
    735735                        h_ip(ji,jj,jl)   = v_ip(ji,jj,jl) / a_ip(ji,jj,jl) ! MV - in principle, this is useless as h_ip is computed in icevar 
    736736                     ENDIF 
    737                 
     737 
    738738                  ENDIF  ! v_il 
    739              
     739 
    740740               END DO ! jl 
    741741 
     
    745745               v_il(ji,jj,:) = 0._wp 
    746746!              zfpond(ji,jj) = zfpond(ji,jj)- zvolp(ji,jj) 
    747 !                 zvolp(ji,jj)    = 0._wp          
     747!                 zvolp(ji,jj)    = 0._wp 
    748748 
    749749            ENDIF 
     
    769769!                 v_il(ji,jj,jl) = 0._wp ! probably uselesss now since we get zap_small 
    770770!              ENDIF 
    771        
     771 
    772772               ! recalculate equivalent pond variables 
    773773               IF ( a_ip(ji,jj,jl) > epsi10) THEN 
     
    779779!                 h_il(ji,jj,jl)      = 0._wp ! MV in principle, useless as omputed in icevar 
    780780!              ENDIF 
    781                 
     781 
    782782         END_2D 
    783783 
     
    787787   END SUBROUTINE pnd_TOPO 
    788788 
    789     
     789 
    790790   SUBROUTINE ice_thd_pnd_area( zvolp , zdvolp ) 
    791791 
     
    793793       !!                ***  ROUTINE ice_thd_pnd_area *** 
    794794       !! 
    795        !! ** Purpose : Given the total volume of available pond water,  
     795       !! ** Purpose : Given the total volume of available pond water, 
    796796       !!              redistribute and drain water 
    797797       !! 
     
    823823       !! 
    824824       !!------------------------------------------------------------------ 
    825         
     825 
    826826       REAL (wp), DIMENSION(jpi,jpj), INTENT(INOUT) :: & 
    827827          zvolp,                                       &  ! total available pond water 
     
    865865       a_ip(:,:,:) = 0._wp 
    866866       h_ip(:,:,:) = 0._wp 
    867   
     867 
    868868       DO_2D( 1, 1, 1, 1 ) 
    869   
     869 
    870870             IF ( at_i(ji,jj) > 0.01 .AND. hm_i(ji,jj) > rn_himin .AND. zvolp(ji,jj) > zvp_min * at_i(ji,jj) ) THEN 
    871   
     871 
    872872        !------------------------------------------------------------------- 
    873873        ! initialize 
    874874        !------------------------------------------------------------------- 
    875   
     875 
    876876        DO jl = 1, jpl 
    877   
     877 
    878878           !---------------------------------------- 
    879879           ! compute the effective snow fraction 
    880880           !---------------------------------------- 
    881   
     881 
    882882           IF (a_i(ji,jj,jl) < epsi10)  THEN 
    883883              hicen(jl) =  0._wp 
     
    889889              hsnon(jl) = v_s(ji,jj,jl) / a_i(ji,jj,jl) 
    890890              reduced_aicen(jl) = 1._wp ! n=jpl 
    891   
     891 
    892892              !js: initial code in NEMO_DEV 
    893893              !IF (n < jpl) reduced_aicen(jl) = aicen(jl) & 
    894894              !                     * (-0.024_wp*hicen(jl) + 0.832_wp) 
    895   
     895 
    896896              !js: from CICE 5.1.2: this limit reduced_aicen to 0.2 when hicen is too large 
    897               IF (jl < jpl) reduced_aicen(jl) = a_i(ji,jj,jl) &  
     897              IF (jl < jpl) reduced_aicen(jl) = a_i(ji,jj,jl) & 
    898898                                   * max(0.2_wp,(-0.024_wp*hicen(jl) + 0.832_wp)) 
    899   
     899 
    900900              asnon(jl) = reduced_aicen(jl)  ! effective snow fraction (empirical) 
    901901              ! MV should check whether this makes sense to have the same effective snow fraction in here 
    902902              ! OLI: it probably doesn't 
    903903           END IF 
    904   
     904 
    905905  ! This choice for alfa and beta ignores hydrostatic equilibium of categories. 
    906906  ! Hydrostatic equilibium of the entire ITD is accounted for below, assuming 
     
    911911  ! alfan = 60% of the ice volume) in each category lies above the reference line, 
    912912  ! and 40% below. Note: p6 is an arbitrary choice, but alfa+beta=1 is required. 
    913   
     913 
    914914  ! MV: 
    915915  ! Note that this choice is not in the original FF07 paper and has been adopted in CICE 
    916916  ! No reason why is explained in the doc, but I guess there is a reason. I'll try to investigate, maybe 
    917   
     917 
    918918  ! Where does that choice come from ? => OLI : Coz' Chuck Norris said so... 
    919   
     919 
    920920           alfan(jl) = 0.6 * hicen(jl) 
    921921           betan(jl) = 0.4 * hicen(jl) 
    922   
     922 
    923923           cum_max_vol(jl)     = 0._wp 
    924924           cum_max_vol_tmp(jl) = 0._wp 
    925   
     925 
    926926        END DO ! jpl 
    927   
     927 
    928928        cum_max_vol_tmp(0) = 0._wp 
    929929        drain = 0._wp 
    930930        zdvolp(ji,jj) = 0._wp 
    931   
     931 
    932932        !---------------------------------------------------------- 
    933933        ! Drain overflow water, update pond fraction and volume 
    934934        !---------------------------------------------------------- 
    935   
     935 
    936936        !-------------------------------------------------------------------------- 
    937937        ! the maximum amount of water that can be contained up to each ice category 
     
    940940        ! Then the excess volume cum_max_vol(jl) drains out of the system 
    941941        ! It should be added to wfx_pnd_out 
    942   
     942 
    943943        DO jl = 1, jpl-1 ! last category can not hold any volume 
    944   
     944 
    945945           IF (alfan(jl+1) >= alfan(jl) .AND. alfan(jl+1) > 0._wp ) THEN 
    946   
     946 
    947947              ! total volume in level including snow 
    948948              cum_max_vol_tmp(jl) = cum_max_vol_tmp(jl-1) + & 
    949949                 (alfan(jl+1) - alfan(jl)) * sum(reduced_aicen(1:jl)) 
    950   
     950 
    951951              ! subtract snow solid volumes from lower categories in current level 
    952952              DO ns = 1, jl 
     
    956956                      max(min(hsnon(ns)+alfan(ns)-alfan(jl), alfan(jl+1)-alfan(jl)), 0._wp) 
    957957              END DO 
    958   
     958 
    959959           ELSE ! assume higher categories unoccupied 
    960960              cum_max_vol_tmp(jl) = cum_max_vol_tmp(jl-1) 
     
    966966        cum_max_vol_tmp(jpl) = cum_max_vol_tmp(jpl-1)  ! last category holds no volume 
    967967        cum_max_vol  (1:jpl) = cum_max_vol_tmp(1:jpl) 
    968   
     968 
    969969        !---------------------------------------------------------------- 
    970970        ! is there more meltwater than can be held in the floe? 
     
    973973           drain = zvolp(ji,jj) - cum_max_vol(jpl) + epsi10 
    974974           zvolp(ji,jj) = zvolp(ji,jj) - drain ! update meltwater volume available 
    975   
     975 
    976976           diag_dvpn_rnf(ji,jj) = - drain      ! diag - overflow counted in the runoff part (arbitrary choice) 
    977             
     977 
    978978           zdvolp(ji,jj) = drain         ! this is the drained water 
    979979           IF (zvolp(ji,jj) < epsi10) THEN 
     
    982982           END IF 
    983983        END IF 
    984   
     984 
    985985        ! height and area corresponding to the remaining volume 
    986986        ! routine leaves zvolp unchanged 
    987987        CALL ice_thd_pnd_depth(reduced_aicen, asnon, hsnon, alfan, zvolp(ji,jj), cum_max_vol, hpond, m_index) 
    988   
     988 
    989989        DO jl = 1, m_index 
    990990           !h_ip(jl) = hpond - alfan(jl) + alfan(1) ! here oui choulde update 
     
    996996        END DO 
    997997        !zapond = sum(a_ip(1:m_index))     !js: from CICE 5.1.2; not in Icepack1.1.0-6-gac6195d 
    998   
     998 
    999999        !------------------------------------------------------------------------ 
    10001000        ! Drainage through brine network (permeability) 
    10011001        !------------------------------------------------------------------------ 
    10021002        !!! drainage due to ice permeability - Darcy's law 
    1003   
     1003 
    10041004        ! sea water level 
    1005         msno = 0._wp  
     1005        msno = 0._wp 
    10061006        DO jl = 1 , jpl 
    10071007          msno = msno + v_s(ji,jj,jl) * rhos 
     
    10101010        hsl_rel = floe_weight / rho0 & 
    10111011                - ( ( sum(betan(:)*a_i(ji,jj,:)) / at_i(ji,jj) ) + alfan(1) ) 
    1012   
     1012 
    10131013        deltah = hpond - hsl_rel 
    10141014        pressure_head = grav * rho0 * max(deltah, 0._wp) 
    1015   
     1015 
    10161016        ! drain if ice is permeable 
    10171017        permflag = 0 
    1018   
     1018 
    10191019        IF (pressure_head > 0._wp) THEN 
    10201020           DO jl = 1, jpl-1 
    10211021              IF ( hicen(jl) /= 0._wp ) THEN 
    1022   
     1022 
    10231023              !IF (hicen(jl) > 0._wp) THEN           !js: from CICE 5.1.2 
    1024   
     1024 
    10251025                 perm = 0._wp ! MV ugly dummy patch 
    1026                  CALL ice_thd_pnd_perm(t_i(ji,jj,:,jl),  sz_i(ji,jj,:,jl), perm) ! bof  
     1026                 CALL ice_thd_pnd_perm(t_i(ji,jj,:,jl),  sz_i(ji,jj,:,jl), perm) ! bof 
    10271027                 IF (perm > 0._wp) permflag = 1 
    1028   
     1028 
    10291029                 drain = perm*a_ip(ji,jj,jl)*pressure_head*rDt_ice / & 
    10301030                                          (viscosity*hicen(jl)) 
    10311031                 zdvolp(ji,jj) = zdvolp(ji,jj) + min(drain, zvolp(ji,jj)) 
    10321032                 zvolp(ji,jj) = max(zvolp(ji,jj) - drain, 0._wp) 
    1033   
     1033 
    10341034                 diag_dvpn_drn(ji,jj) = - drain ! diag (could be better coded) 
    1035                   
     1035 
    10361036                 IF (zvolp(ji,jj) < epsi10) THEN 
    10371037                    zdvolp(ji,jj) = zdvolp(ji,jj) + zvolp(ji,jj) 
     
    10401040             END IF 
    10411041          END DO 
    1042   
     1042 
    10431043           ! adjust melt pond dimensions 
    10441044           IF (permflag > 0) THEN 
     
    10521052           END IF 
    10531053        END IF ! pressure_head 
    1054   
     1054 
    10551055        !------------------------------- 
    10561056        ! remove water from the snow 
     
    10601060        ! snow in melt ponds is not melted 
    10611061        !------------------------------------------------------------------------ 
    1062          
     1062 
    10631063        ! MV here, it seems that we remove some meltwater from the ponds, but I can't really tell 
    10641064        ! how much, so I did not diagnose it 
    10651065        ! so if there is a problem here, nobody is going to see it... 
    1066          
    1067   
     1066 
     1067 
    10681068        ! Calculate pond volume for lower categories 
    10691069        DO jl = 1,m_index-1 
     
    10711071                          - (rhos/rhow) * asnon(jl) * min(hsnon(jl), h_ip(ji,jj,jl)) 
    10721072        END DO 
    1073   
     1073 
    10741074        ! Calculate pond volume for highest category = remaining pond volume 
    1075   
     1075 
    10761076        ! The following is completely unclear to Martin at least 
    10771077        ! Could we redefine properly and recode in a more readable way ? 
    1078   
     1078 
    10791079        ! m_index = last category with melt pond 
    1080   
     1080 
    10811081        IF (m_index == 1) v_ip(ji,jj,m_index) = zvolp(ji,jj) ! volume of mw in 1st category is the total volume of melt water 
    1082   
     1082 
    10831083        IF (m_index > 1) THEN 
    10841084          IF (zvolp(ji,jj) > sum( v_ip(ji,jj,1:m_index-1))) THEN 
    10851085             v_ip(ji,jj,m_index) = zvolp(ji,jj) - sum(v_ip(ji,jj,1:m_index-1)) 
    10861086          ELSE 
    1087              v_ip(ji,jj,m_index) = 0._wp  
     1087             v_ip(ji,jj,m_index) = 0._wp 
    10881088             h_ip(ji,jj,m_index) = 0._wp 
    10891089             a_ip(ji,jj,m_index) = 0._wp 
     
    10941094          END IF 
    10951095        END IF 
    1096   
     1096 
    10971097        DO jl = 1,m_index 
    10981098           IF (a_ip(ji,jj,jl) > epsi10) THEN 
     
    11001100           ELSE 
    11011101              zdvolp(ji,jj) = zdvolp(ji,jj) + v_ip(ji,jj,jl) 
    1102               h_ip(ji,jj,jl) = 0._wp  
     1102              h_ip(ji,jj,jl) = 0._wp 
    11031103              v_ip(ji,jj,jl)  = 0._wp 
    11041104              a_ip(ji,jj,jl) = 0._wp 
     
    11061106        END DO 
    11071107        DO jl = m_index+1, jpl 
    1108            h_ip(ji,jj,jl) = 0._wp  
    1109            a_ip(ji,jj,jl) = 0._wp  
    1110            v_ip(ji,jj,jl) = 0._wp  
     1108           h_ip(ji,jj,jl) = 0._wp 
     1109           a_ip(ji,jj,jl) = 0._wp 
     1110           v_ip(ji,jj,jl) = 0._wp 
    11111111        END DO 
    1112          
     1112 
    11131113           ENDIF 
    11141114 
     
    13191319 
    13201320       DO k = 1, nlay_i 
    1321         
     1321 
    13221322          Sbr    = - Tin(k) / rTmlt ! Consistent expression with SI3 (linear liquidus) 
    13231323          ! Best expression to date is that one (Vancoppenolle et al JGR 2019) 
    13241324          ! Sbr  = - 18.7 * Tin(k) - 0.519 * Tin(k)**2 - 0.00535 * Tin(k) **3 
    13251325          phi(k) = salin(k) / Sbr 
    1326            
     1326 
    13271327       END DO 
    13281328 
     
    13351335   END SUBROUTINE ice_thd_pnd_perm 
    13361336 
    1337    SUBROUTINE ice_thd_pnd_init  
     1337   SUBROUTINE ice_thd_pnd_init 
    13381338      !!------------------------------------------------------------------- 
    13391339      !!                  ***  ROUTINE ice_thd_pnd_init   *** 
     
    13421342      !!              over sea ice 
    13431343      !! 
    1344       !! ** Method  :  Read the namthd_pnd  namelist and check the melt pond   
     1344      !! ** Method  :  Read the namthd_pnd  namelist and check the melt pond 
    13451345      !!               parameter values called at the first timestep (nit000) 
    13461346      !! 
    1347       !! ** input   :   Namelist namthd_pnd   
     1347      !! ** input   :   Namelist namthd_pnd 
    13481348      !!------------------------------------------------------------------- 
    13491349      INTEGER  ::   ios, ioptio   ! Local integer 
     
    13891389      ! 
    13901390      SELECT CASE( nice_pnd ) 
    1391       CASE( np_pndNO )          
     1391      CASE( np_pndNO ) 
    13921392         IF( ln_pnd_alb  ) THEN ; ln_pnd_alb  = .FALSE. ; CALL ctl_warn( 'ln_pnd_alb=false when no ponds' )  ; ENDIF 
    13931393         IF( ln_pnd_lids ) THEN ; ln_pnd_lids = .FALSE. ; CALL ctl_warn( 'ln_pnd_lids=false when no ponds' ) ; ENDIF 
    1394       CASE( np_pndCST )          
     1394      CASE( np_pndCST ) 
    13951395         IF( ln_pnd_lids ) THEN ; ln_pnd_lids = .FALSE. ; CALL ctl_warn( 'ln_pnd_lids=false when constant ponds' ) ; ENDIF 
    13961396      END SELECT 
    13971397      ! 
    13981398   END SUBROUTINE ice_thd_pnd_init 
    1399     
     1399 
    14001400#else 
    14011401   !!---------------------------------------------------------------------- 
    14021402   !!   Default option          Empty module          NO SI3 sea-ice model 
    14031403   !!---------------------------------------------------------------------- 
    1404 #endif  
     1404#endif 
    14051405 
    14061406   !!====================================================================== 
    1407 END MODULE icethd_pnd  
     1407END MODULE icethd_pnd 
  • NEMO/trunk/src/ICE/icethd_zdf_bl99.F90

    r14005 r14072  
    22   !!====================================================================== 
    33   !!                       ***  MODULE icethd_zdf_BL99 *** 
    4    !!   sea-ice: vertical heat diffusion in sea ice (computation of temperatures)  
     4   !!   sea-ice: vertical heat diffusion in sea ice (computation of temperatures) 
    55   !!====================================================================== 
    66   !! History :       !  2003-02  (M. Vancoppenolle) original 1D code 
     
    1515   !!---------------------------------------------------------------------- 
    1616   USE dom_oce        ! ocean space and time domain 
    17    USE phycst         ! physical constants (ocean directory)  
     17   USE phycst         ! physical constants (ocean directory) 
    1818   USE ice            ! sea-ice: variables 
    1919   USE ice1D          ! sea-ice: thermodynamics variables 
     
    4444      !! 
    4545      !! ** Method  : solves the heat equation diffusion with a Neumann boundary 
    46       !!              condition at the surface and a Dirichlet one at the bottom.  
     46      !!              condition at the surface and a Dirichlet one at the bottom. 
    4747      !!              Solar radiation is partially absorbed into the ice. 
    48       !!              The specific heat and thermal conductivities depend on ice  
    49       !!              salinity and temperature to take into account brine pocket    
     48      !!              The specific heat and thermal conductivities depend on ice 
     49      !!              salinity and temperature to take into account brine pocket 
    5050      !!              melting. The numerical scheme is an iterative Crank-Nicolson 
    5151      !!              on a non-uniform multilayer grid in the ice and snow system. 
     
    9191      REAL(wp) ::   zbeta     =  0.117_wp     ! for thermal conductivity (could be 0.13) 
    9292      REAL(wp) ::   zkimin    =  0.10_wp      ! minimum ice thermal conductivity 
    93       REAL(wp) ::   ztsu_err  =  1.e-5_wp     ! range around which t_su is considered at 0C  
    94       REAL(wp) ::   zdti_bnd  =  1.e-4_wp     ! maximal authorized error on temperature  
    95       REAL(wp) ::   zhs_ssl   =  0.03_wp      ! surface scattering layer in the snow  
     93      REAL(wp) ::   ztsu_err  =  1.e-5_wp     ! range around which t_su is considered at 0C 
     94      REAL(wp) ::   zdti_bnd  =  1.e-4_wp     ! maximal authorized error on temperature 
     95      REAL(wp) ::   zhs_ssl   =  0.03_wp      ! surface scattering layer in the snow 
    9696      REAL(wp) ::   zhi_ssl   =  0.10_wp      ! surface scattering layer in the ice 
    9797      REAL(wp) ::   zh_min    =  1.e-3_wp     ! minimum ice/snow thickness for conduction 
    9898      REAL(wp) ::   ztmelts                   ! ice melting temperature 
    99       REAL(wp) ::   zdti_max                  ! current maximal error on temperature  
     99      REAL(wp) ::   zdti_max                  ! current maximal error on temperature 
    100100      REAL(wp) ::   zcpi                      ! Ice specific heat 
    101101      REAL(wp) ::   zhfx_err, zdq             ! diag errors on heat 
     
    127127      REAL(wp), DIMENSION(jpij)          ::   zq_ini      ! diag errors on heat 
    128128      REAL(wp), DIMENSION(jpij)          ::   zghe        ! G(he), th. conduct enhancement factor, mono-cat 
    129       REAL(wp), DIMENSION(jpij)          ::   za_s_fra    ! ice fraction covered by snow  
    130       REAL(wp), DIMENSION(jpij)          ::   isnow       ! snow presence (1) or not (0)  
    131       REAL(wp), DIMENSION(jpij)          ::   isnow_comb  ! snow presence for met-office  
     129      REAL(wp), DIMENSION(jpij)          ::   za_s_fra    ! ice fraction covered by snow 
     130      REAL(wp), DIMENSION(jpij)          ::   isnow       ! snow presence (1) or not (0) 
     131      REAL(wp), DIMENSION(jpij)          ::   isnow_comb  ! snow presence for met-office 
    132132      REAL(wp), DIMENSION(jpij,nlay_i+nlay_s+1)   ::   zindterm    ! 'Ind'ependent term 
    133133      REAL(wp), DIMENSION(jpij,nlay_i+nlay_s+1)   ::   zindtbis    ! Temporary 'ind'ependent term 
     
    139139      REAL(wp) ::   zhe        ! dummy factor 
    140140      REAL(wp) ::   zcnd_i     ! mean sea ice thermal conductivity 
    141       !!------------------------------------------------------------------      
     141      !!------------------------------------------------------------------ 
    142142 
    143143      ! --- diag error on heat diffusion - PART 1 --- ! 
    144144      DO ji = 1, npti 
    145145         zq_ini(ji) = ( SUM( e_i_1d(ji,1:nlay_i) ) * h_i_1d(ji) * r1_nlay_i +  & 
    146             &           SUM( e_s_1d(ji,1:nlay_s) ) * h_s_1d(ji) * r1_nlay_s )  
     146            &           SUM( e_s_1d(ji,1:nlay_s) ) * h_s_1d(ji) * r1_nlay_s ) 
    147147      END DO 
    148148 
    149149      ! calculate ice fraction covered by snow for radiation 
    150150      CALL ice_var_snwfra( h_s_1d(1:npti), za_s_fra(1:npti) ) 
    151        
     151 
    152152      !------------------ 
    153153      ! 1) Initialization 
     
    155155      ! 
    156156      ! extinction radiation in the snow 
    157       IF    ( nn_qtrice == 0 ) THEN   ! constant  
     157      IF    ( nn_qtrice == 0 ) THEN   ! constant 
    158158         zraext_s(1:npti) = rn_kappa_s 
    159159      ELSEIF( nn_qtrice == 1 ) THEN   ! depends on melting/freezing conditions 
     
    166166      DO ji = 1, npti 
    167167         ! ice thickness 
    168          IF( h_i_1d(ji) > 0._wp ) THEN  
     168         IF( h_i_1d(ji) > 0._wp ) THEN 
    169169            zh_i  (ji) = MAX( zh_min , h_i_1d(ji) ) * r1_nlay_i ! set a minimum thickness for conduction 
    170170            z1_h_i(ji) = 1._wp / zh_i(ji)                       !       it must be very small 
     
    198198         ztsuold    (1:npti) = t_su_1d(1:npti)                          ! surface temperature initial value 
    199199         t_su_1d    (1:npti) = MIN( t_su_1d(1:npti), rt0 - ztsu_err )   ! required to leave the choice between melting or not 
    200          zdqns_ice_b(1:npti) = dqns_ice_1d(1:npti)                      ! derivative of incoming nonsolar flux  
     200         zdqns_ice_b(1:npti) = dqns_ice_1d(1:npti)                      ! derivative of incoming nonsolar flux 
    201201         zqns_ice_b (1:npti) = qns_ice_1d(1:npti)                       ! store previous qns_ice_1d value 
    202202         ! 
     
    221221      ! 
    222222      zradtr_i(1:npti,0) = zradtr_s(1:npti,nlay_s) * za_s_fra(1:npti) + qtr_ice_top_1d(1:npti) * ( 1._wp - za_s_fra(1:npti) ) 
    223       DO jk = 1, nlay_i  
     223      DO jk = 1, nlay_i 
    224224         DO ji = 1, npti 
    225225            !                             ! radiation transmitted below the layer-th ice layer 
     
    227227               &                                       * EXP( - rn_kappa_i * MAX( 0._wp, zh_i(ji) * REAL(jk) - zh_min  ) ) & 
    228228               &            + ( 1._wp - za_s_fra(ji) ) * qtr_ice_top_1d(ji)                        &   ! part snow free 
    229                &                                       * EXP( - rn_kappa_i * MAX( 0._wp, zh_i(ji) * REAL(jk) - zhi_ssl ) )             
     229               &                                       * EXP( - rn_kappa_i * MAX( 0._wp, zh_i(ji) * REAL(jk) - zhi_ssl ) ) 
    230230            !                             ! radiation absorbed by the layer-th ice layer 
    231231            zradab_i(ji,jk) = zradtr_i(ji,jk-1) - zradtr_i(ji,jk) 
     
    288288         DO ji = 1, npti 
    289289            IF ( .NOT. l_T_converged(ji) ) & 
    290                ztcond_i(ji,:) = MAX( zkimin, ztcond_i_cp(ji,:) )         
     290               ztcond_i(ji,:) = MAX( zkimin, ztcond_i_cp(ji,:) ) 
    291291         END DO 
    292292         ! 
     
    401401            zdiagbis(1:npti,:)   = 0._wp 
    402402 
    403             DO jm = nlay_s + 2, nlay_s + nlay_i  
     403            DO jm = nlay_s + 2, nlay_s + nlay_i 
    404404               DO ji = 1, npti 
    405405                  jk = jm - nlay_s - 1 
     
    414414            DO ji = 1, npti 
    415415               ! ice bottom term 
    416                ztrid   (ji,jm,1) =       - zeta_i(ji,nlay_i) *   zkappa_i(ji,nlay_i-1)    
     416               ztrid   (ji,jm,1) =       - zeta_i(ji,nlay_i) *   zkappa_i(ji,nlay_i-1) 
    417417               ztrid   (ji,jm,2) = 1._wp + zeta_i(ji,nlay_i) * ( zkappa_i(ji,nlay_i-1) + zkappa_i(ji,nlay_i) * zg1 ) 
    418418               ztrid   (ji,jm,3) = 0._wp 
    419419               zindterm(ji,jm)   = ztiold(ji,nlay_i) + zeta_i(ji,nlay_i) *  & 
    420                   &              ( zradab_i(ji,nlay_i) + zkappa_i(ji,nlay_i) * zg1 * t_bo_1d(ji) )  
     420                  &              ( zradab_i(ji,nlay_i) + zkappa_i(ji,nlay_i) * zg1 * t_bo_1d(ji) ) 
    421421            END DO 
    422422 
     
    433433                     zindterm(ji,jm)   = ztsold(ji,jk) + zeta_s(ji,jk) * zradab_s(ji,jk) 
    434434                  END DO 
    435                    
     435 
    436436                  ! case of only one layer in the ice (ice equation is altered) 
    437437                  IF( nlay_i == 1 ) THEN 
    438438                     ztrid   (ji,nlay_s+2,3) = 0._wp 
    439                      zindterm(ji,nlay_s+2)   = zindterm(ji,nlay_s+2) + zeta_i(ji,1) * zkappa_i(ji,1) * t_bo_1d(ji)  
    440                   ENDIF 
    441                    
     439                     zindterm(ji,nlay_s+2)   = zindterm(ji,nlay_s+2) + zeta_i(ji,1) * zkappa_i(ji,1) * t_bo_1d(ji) 
     440                  ENDIF 
     441 
    442442                  IF( t_su_1d(ji) < rt0 ) THEN   !--  case 1 : no surface melting 
    443                       
     443 
    444444                     jm_min(ji) = 1 
    445445                     jm_max(ji) = nlay_i + nlay_s + 1 
    446                       
     446 
    447447                     ! surface equation 
    448448                     ztrid   (ji,1,1) = 0._wp 
     
    450450                     ztrid   (ji,1,3) =                   zg1s * zkappa_s(ji,0) 
    451451                     zindterm(ji,1)   = zdqns_ice_b(ji) * t_su_1d(ji) - zfnet(ji) 
    452                       
     452 
    453453                     ! first layer of snow equation 
    454454                     ztrid   (ji,2,1) =       - zeta_s(ji,1) *                    zkappa_s(ji,0) * zg1s 
     
    456456                     ztrid   (ji,2,3) =       - zeta_s(ji,1) *   zkappa_s(ji,1) 
    457457                     zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * zradab_s(ji,1) 
    458                       
     458 
    459459                  ELSE                            !--  case 2 : surface is melting 
    460460                     ! 
    461461                     jm_min(ji) = 2 
    462462                     jm_max(ji) = nlay_i + nlay_s + 1 
    463                       
     463 
    464464                     ! first layer of snow equation 
    465465                     ztrid   (ji,2,1) = 0._wp 
    466466                     ztrid   (ji,2,2) = 1._wp + zeta_s(ji,1) * ( zkappa_s(ji,1) + zkappa_s(ji,0) * zg1s ) 
    467                      ztrid   (ji,2,3) =       - zeta_s(ji,1) *   zkappa_s(ji,1)  
    468                      zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * ( zradab_s(ji,1) + zkappa_s(ji,0) * zg1s * t_su_1d(ji) )  
     467                     ztrid   (ji,2,3) =       - zeta_s(ji,1) *   zkappa_s(ji,1) 
     468                     zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * ( zradab_s(ji,1) + zkappa_s(ji,0) * zg1s * t_su_1d(ji) ) 
    469469                  ENDIF 
    470470                  !                            !---------------------! 
     
    476476                     jm_min(ji) = nlay_s + 1 
    477477                     jm_max(ji) = nlay_i + nlay_s + 1 
    478                       
    479                      ! surface equation    
     478 
     479                     ! surface equation 
    480480                     ztrid   (ji,jm_min(ji),1) = 0._wp 
    481                      ztrid   (ji,jm_min(ji),2) = zdqns_ice_b(ji) - zkappa_i(ji,0) * zg1     
     481                     ztrid   (ji,jm_min(ji),2) = zdqns_ice_b(ji) - zkappa_i(ji,0) * zg1 
    482482                     ztrid   (ji,jm_min(ji),3) =                   zkappa_i(ji,0) * zg1 
    483483                     zindterm(ji,jm_min(ji))   = zdqns_ice_b(ji) * t_su_1d(ji) - zfnet(ji) 
    484                       
     484 
    485485                     ! first layer of ice equation 
    486486                     ztrid   (ji,jm_min(ji)+1,1) =       - zeta_i(ji,1) *                    zkappa_i(ji,0) * zg1 
    487487                     ztrid   (ji,jm_min(ji)+1,2) = 1._wp + zeta_i(ji,1) * ( zkappa_i(ji,1) + zkappa_i(ji,0) * zg1 ) 
    488                      ztrid   (ji,jm_min(ji)+1,3) =       - zeta_i(ji,1) *   zkappa_i(ji,1)   
    489                      zindterm(ji,jm_min(ji)+1)   = ztiold(ji,1) + zeta_i(ji,1) * zradab_i(ji,1)   
    490                       
     488                     ztrid   (ji,jm_min(ji)+1,3) =       - zeta_i(ji,1) *   zkappa_i(ji,1) 
     489                     zindterm(ji,jm_min(ji)+1)   = ztiold(ji,1) + zeta_i(ji,1) * zradab_i(ji,1) 
     490 
    491491                     ! case of only one layer in the ice (surface & ice equations are altered) 
    492492                     IF( nlay_i == 1 ) THEN 
     
    499499                        zindterm(ji,jm_min(ji)+1)   = ztiold(ji,1) + zeta_i(ji,1) * (zradab_i(ji,1) + zkappa_i(ji,1) * t_bo_1d(ji)) 
    500500                     ENDIF 
    501                       
     501 
    502502                  ELSE                            !--  case 2 : surface is melting 
    503                       
     503 
    504504                     jm_min(ji) = nlay_s + 2 
    505505                     jm_max(ji) = nlay_i + nlay_s + 1 
    506                       
     506 
    507507                     ! first layer of ice equation 
    508508                     ztrid   (ji,jm_min(ji),1) = 0._wp 
    509                      ztrid   (ji,jm_min(ji),2) = 1._wp + zeta_i(ji,1) * ( zkappa_i(ji,1) + zkappa_i(ji,0) * zg1 )   
     509                     ztrid   (ji,jm_min(ji),2) = 1._wp + zeta_i(ji,1) * ( zkappa_i(ji,1) + zkappa_i(ji,0) * zg1 ) 
    510510                     ztrid   (ji,jm_min(ji),3) =       - zeta_i(ji,1) *   zkappa_i(ji,1) 
    511                      zindterm(ji,jm_min(ji))   = ztiold(ji,1) + zeta_i(ji,1) * (zradab_i(ji,1) + zkappa_i(ji,0) * zg1 * t_su_1d(ji))  
    512                       
     511                     zindterm(ji,jm_min(ji))   = ztiold(ji,1) + zeta_i(ji,1) * (zradab_i(ji,1) + zkappa_i(ji,0) * zg1 * t_su_1d(ji)) 
     512 
    513513                     ! case of only one layer in the ice (surface & ice equations are altered) 
    514514                     IF( nlay_i == 1 ) THEN 
     
    519519                           &                      + t_su_1d(ji) * zeta_i(ji,1) * zkappa_i(ji,0) * 2._wp 
    520520                     ENDIF 
    521                       
     521 
    522522                  ENDIF 
    523523               ENDIF 
     
    540540!!$            END DO 
    541541!!$            !!clem SNWLAY => check why LIM1D does not get this loop. Is nlay_i+5 correct? 
    542 !!$             
     542!!$ 
    543543!!$            DO jk = jm_mint+1, jm_maxt 
    544544!!$               DO ji = 1, npti 
     
    574574            END DO 
    575575 
    576             ! snow temperatures       
     576            ! snow temperatures 
    577577            DO ji = 1, npti 
    578578               ! Variables used after iterations 
     
    589589               END DO 
    590590            END DO 
    591              
     591 
    592592            ! surface temperature 
    593593            DO ji = 1, npti 
     
    628628                     zdti_max      =  MAX( zdti_max, ABS( t_i_1d(ji,jk) - ztib(ji,jk) ) ) 
    629629                  END DO 
    630                    
     630 
    631631                  ! convergence test 
    632632                  IF( ln_zdf_chkcvg ) THEN 
     
    665665            zdiagbis(1:npti,:)   = 0._wp 
    666666 
    667             DO jm = nlay_s + 2, nlay_s + nlay_i  
     667            DO jm = nlay_s + 2, nlay_s + nlay_i 
    668668               DO ji = 1, npti 
    669669                  jk = jm - nlay_s - 1 
     
    678678            DO ji = 1, npti 
    679679               ! ice bottom term 
    680                ztrid   (ji,jm,1) =       - zeta_i(ji,nlay_i) *   zkappa_i(ji,nlay_i-1)    
     680               ztrid   (ji,jm,1) =       - zeta_i(ji,nlay_i) *   zkappa_i(ji,nlay_i-1) 
    681681               ztrid   (ji,jm,2) = 1._wp + zeta_i(ji,nlay_i) * ( zkappa_i(ji,nlay_i-1) + zkappa_i(ji,nlay_i) * zg1 ) 
    682682               ztrid   (ji,jm,3) = 0._wp 
    683683               zindterm(ji,jm)   = ztiold(ji,nlay_i) + zeta_i(ji,nlay_i) *  & 
    684                   &              ( zradab_i(ji,nlay_i) + zkappa_i(ji,nlay_i) * zg1 * t_bo_1d(ji) )  
     684                  &              ( zradab_i(ji,nlay_i) + zkappa_i(ji,nlay_i) * zg1 * t_bo_1d(ji) ) 
    685685            ENDDO 
    686686 
     
    697697                     zindterm(ji,jm)   = ztsold(ji,jk) + zeta_s(ji,jk) * zradab_s(ji,jk) 
    698698                  END DO 
    699                    
     699 
    700700                  ! case of only one layer in the ice (ice equation is altered) 
    701701                  IF ( nlay_i == 1 ) THEN 
    702702                     ztrid   (ji,nlay_s+2,3) = 0._wp 
    703                      zindterm(ji,nlay_s+2)   = zindterm(ji,nlay_s+2) + zeta_i(ji,1) * zkappa_i(ji,1) * t_bo_1d(ji)  
    704                   ENDIF 
    705                    
     703                     zindterm(ji,nlay_s+2)   = zindterm(ji,nlay_s+2) + zeta_i(ji,1) * zkappa_i(ji,1) * t_bo_1d(ji) 
     704                  ENDIF 
     705 
    706706                  jm_min(ji) = 2 
    707707                  jm_max(ji) = nlay_i + nlay_s + 1 
    708                    
     708 
    709709                  ! first layer of snow equation 
    710710                  ztrid   (ji,2,1) = 0._wp 
    711711                  ztrid   (ji,2,2) = 1._wp + zeta_s(ji,1) * zkappa_s(ji,1) 
    712                   ztrid   (ji,2,3) =       - zeta_s(ji,1) * zkappa_s(ji,1)  
    713                   zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * ( zradab_s(ji,1) + qcn_ice_1d(ji) )  
    714                    
     712                  ztrid   (ji,2,3) =       - zeta_s(ji,1) * zkappa_s(ji,1) 
     713                  zindterm(ji,2)   = ztsold(ji,1) + zeta_s(ji,1) * ( zradab_s(ji,1) + qcn_ice_1d(ji) ) 
     714 
    715715                  !                            !---------------------! 
    716716               ELSE                            ! cells without snow  ! 
     
    718718                  jm_min(ji) = nlay_s + 2 
    719719                  jm_max(ji) = nlay_i + nlay_s + 1 
    720                    
     720 
    721721                  ! first layer of ice equation 
    722722                  ztrid   (ji,jm_min(ji),1) = 0._wp 
    723                   ztrid   (ji,jm_min(ji),2) = 1._wp + zeta_i(ji,1) * zkappa_i(ji,1)   
     723                  ztrid   (ji,jm_min(ji),2) = 1._wp + zeta_i(ji,1) * zkappa_i(ji,1) 
    724724                  ztrid   (ji,jm_min(ji),3) =       - zeta_i(ji,1) * zkappa_i(ji,1) 
    725725                  zindterm(ji,jm_min(ji))   = ztiold(ji,1) + zeta_i(ji,1) * ( zradab_i(ji,1) + qcn_ice_1d(ji) ) 
    726                    
     726 
    727727                  ! case of only one layer in the ice (surface & ice equations are altered) 
    728728                  IF( nlay_i == 1 ) THEN 
     
    733733                        &                                     ( zradab_i(ji,1) + zkappa_i(ji,1) * t_bo_1d(ji) + qcn_ice_1d(ji) ) 
    734734                  ENDIF 
    735                    
     735 
    736736               ENDIF 
    737737               ! 
     
    752752!!$               jm_maxt = MAX(jm_max(ji),jm_maxt) 
    753753!!$            END DO 
    754 !!$             
     754!!$ 
    755755!!$            DO jk = jm_mint+1, jm_maxt 
    756756!!$               DO ji = 1, npti 
     
    786786               END DO 
    787787            END DO 
    788              
    789             ! snow temperatures       
     788 
     789            ! snow temperatures 
    790790            DO ji = 1, npti 
    791791               ! Variables used after iterations 
     
    823823 
    824824                  DO jk = 1, nlay_i 
    825                      ztmelts       = -rTmlt * sz_i_1d(ji,jk) + rt0  
     825                     ztmelts       = -rTmlt * sz_i_1d(ji,jk) + rt0 
    826826                     t_i_1d(ji,jk) =  MAX( MIN( t_i_1d(ji,jk), ztmelts ), rt0 - 100._wp ) 
    827827                     zdti_max      =  MAX ( zdti_max, ABS( t_i_1d(ji,jk) - ztib(ji,jk) ) ) 
     
    885885         ! 
    886886         DO ji = 1, npti 
    887             hfx_err_dif_1d(ji) = hfx_err_dif_1d(ji) - ( qns_ice_1d(ji) - zqns_ice_b(ji) ) * a_i_1d(ji)  
     887            hfx_err_dif_1d(ji) = hfx_err_dif_1d(ji) - ( qns_ice_1d(ji) - zqns_ice_b(ji) ) * a_i_1d(ji) 
    888888         END DO 
    889889         ! 
     
    893893      ! 
    894894      IF( k_cnd == np_cnd_OFF .OR. k_cnd == np_cnd_ON ) THEN 
    895           
    896          CALL ice_var_enthalpy        
    897           
     895 
     896         CALL ice_var_enthalpy 
     897 
    898898         ! zhfx_err = correction on the diagnosed heat flux due to non-convergence of the algorithm used to solve heat equation 
    899899         DO ji = 1, npti 
    900900            zdq = - zq_ini(ji) + ( SUM( e_i_1d(ji,1:nlay_i) ) * h_i_1d(ji) * r1_nlay_i +  & 
    901901               &                   SUM( e_s_1d(ji,1:nlay_s) ) * h_s_1d(ji) * r1_nlay_s ) 
    902              
     902 
    903903            IF( k_cnd == np_cnd_OFF ) THEN 
    904                 
     904 
    905905               IF( t_su_1d(ji) < rt0 ) THEN  ! case T_su < 0degC 
    906906                  zhfx_err = ( qns_ice_1d(ji)     + qsr_ice_1d(ji)     - zradtr_i(ji,nlay_i) - qcn_ice_bot_1d(ji)  & 
     
    910910                     &       + zdq * r1_Dt_ice ) * a_i_1d(ji) 
    911911               ENDIF 
    912                 
     912 
    913913            ELSEIF( k_cnd == np_cnd_ON ) THEN 
    914              
     914 
    915915               zhfx_err    = ( qcn_ice_top_1d(ji) + qtr_ice_top_1d(ji) - zradtr_i(ji,nlay_i) - qcn_ice_bot_1d(ji)  & 
    916916                  &          + zdq * r1_Dt_ice ) * a_i_1d(ji) 
    917              
     917 
    918918            ENDIF 
    919919            ! 
     
    921921            hfx_err_dif_1d(ji) = hfx_err_dif_1d(ji) + zhfx_err 
    922922            ! 
    923             ! hfx_dif = Heat flux diagnostic of sensible heat used to warm/cool ice in W.m-2    
     923            ! hfx_dif = Heat flux diagnostic of sensible heat used to warm/cool ice in W.m-2 
    924924            hfx_dif_1d(ji) = hfx_dif_1d(ji) - zdq * r1_Dt_ice * a_i_1d(ji) 
    925925            ! 
     
    952952      ! --- SIMIP diagnostics 
    953953      ! 
    954       DO ji = 1, npti          
     954      DO ji = 1, npti 
    955955         !--- Snow-ice interfacial temperature (diagnostic SIMIP) 
    956956         IF( h_s_1d(ji) >= zhs_ssl ) THEN 
  • NEMO/trunk/src/ICE/iceupdate.F90

    r14005 r14072  
    6767      !!------------------------------------------------------------------- 
    6868      !!                ***  ROUTINE ice_update_flx *** 
    69       !!   
    70       !! ** Purpose :   Update the surface ocean boundary condition for heat  
     69      !! 
     70      !! ** Purpose :   Update the surface ocean boundary condition for heat 
    7171      !!                salt and mass over areas where sea-ice is non-zero 
    72       !!          
     72      !! 
    7373      !! ** Action  : - computes the heat and freshwater/salt fluxes 
    7474      !!                at the ice-ocean interface. 
    7575      !!              - Update the ocean sbc 
    76       !!      
    77       !! ** Outputs : - qsr     : sea heat flux:     solar  
     76      !! 
     77      !! ** Outputs : - qsr     : sea heat flux:     solar 
    7878      !!              - qns     : sea heat flux: non solar 
    79       !!              - emp     : freshwater budget: volume flux  
    80       !!              - sfx     : salt flux  
     79      !!              - emp     : freshwater budget: volume flux 
     80      !!              - sfx     : salt flux 
    8181      !!              - fr_i    : ice fraction 
    8282      !!              - tn_ice  : sea-ice surface temperature 
     
    104104      ! Net heat flux on top of the ice-ocean (W.m-2) 
    105105      !---------------------------------------------- 
    106       qt_atm_oi(:,:) = qns_tot(:,:) + qsr_tot(:,:)  
     106      qt_atm_oi(:,:) = qns_tot(:,:) + qsr_tot(:,:) 
    107107 
    108108      ! --- case we bypass ice thermodynamics --- ! 
     
    114114         qevap_ice  (:,:,:) = 0._wp 
    115115      ENDIF 
    116        
     116 
    117117      DO_2D( 1, 1, 1, 1 ) 
    118118 
    119          ! Solar heat flux reaching the ocean (max) = zqsr (W.m-2)  
     119         ! Solar heat flux reaching the ocean (max) = zqsr (W.m-2) 
    120120         !--------------------------------------------------- 
    121121         zqsr = qsr_tot(ji,jj) - SUM( a_i_b(ji,jj,:) * ( qsr_ice(ji,jj,:) - qtr_ice_bot(ji,jj,:) ) ) 
    122122 
    123          ! Total heat flux reaching the ocean = qt_oce_ai (W.m-2)  
     123         ! Total heat flux reaching the ocean = qt_oce_ai (W.m-2) 
    124124         !--------------------------------------------------- 
    125125         qt_oce_ai(ji,jj) = qt_atm_oi(ji,jj) - hfx_sum(ji,jj) - hfx_bom(ji,jj) - hfx_bog(ji,jj) & 
    126126            &                                - hfx_dif(ji,jj) - hfx_opw(ji,jj) - hfx_snw(ji,jj) & 
    127127            &                                + hfx_thd(ji,jj) + hfx_dyn(ji,jj) + hfx_res(ji,jj) & 
    128             &                                + hfx_sub(ji,jj) - SUM( qevap_ice(ji,jj,:) * a_i_b(ji,jj,:) ) + hfx_spr(ji,jj)                  
    129           
     128            &                                + hfx_sub(ji,jj) - SUM( qevap_ice(ji,jj,:) * a_i_b(ji,jj,:) ) + hfx_spr(ji,jj) 
     129 
    130130         ! New qsr and qns used to compute the oceanic heat flux at the next time step 
    131131         !---------------------------------------------------------------------------- 
     
    144144         ! 
    145145         ! the non-solar is simply derived from the solar flux 
    146          qns(ji,jj) = qt_oce_ai(ji,jj) - zqsr               
    147           
    148          ! Mass flux at the atm. surface        
     146         qns(ji,jj) = qt_oce_ai(ji,jj) - zqsr 
     147 
     148         ! Mass flux at the atm. surface 
    149149         !----------------------------------- 
    150150         wfx_sub(ji,jj) = wfx_snw_sub(ji,jj) + wfx_ice_sub(ji,jj) 
    151151 
    152          ! Mass flux at the ocean surface       
     152         ! Mass flux at the ocean surface 
    153153         !------------------------------------ 
    154154         ! ice-ocean  mass flux 
    155155         wfx_ice(ji,jj) = wfx_bog(ji,jj) + wfx_bom(ji,jj) + wfx_sum(ji,jj) + wfx_sni(ji,jj)   & 
    156156            &           + wfx_opw(ji,jj) + wfx_dyn(ji,jj) + wfx_res(ji,jj) + wfx_lam(ji,jj) 
    157           
     157 
    158158         ! snw-ocean mass flux 
    159159         wfx_snw(ji,jj) = wfx_snw_sni(ji,jj) + wfx_snw_dyn(ji,jj) + wfx_snw_sum(ji,jj) 
    160           
     160 
    161161         ! total mass flux at the ocean/ice interface 
    162162         fmmflx(ji,jj) =                - wfx_ice(ji,jj) - wfx_snw(ji,jj) - wfx_pnd(ji,jj) - wfx_err_sub(ji,jj)   ! ice-ocean mass flux saved at least for biogeochemical model 
    163163         emp   (ji,jj) = emp_oce(ji,jj) - wfx_ice(ji,jj) - wfx_snw(ji,jj) - wfx_pnd(ji,jj) - wfx_err_sub(ji,jj)   ! atm-ocean + ice-ocean mass flux 
    164164 
    165          ! Salt flux at the ocean surface       
     165         ! Salt flux at the ocean surface 
    166166         !------------------------------------------ 
    167167         sfx(ji,jj) = sfx_bog(ji,jj) + sfx_bom(ji,jj) + sfx_sum(ji,jj) + sfx_sni(ji,jj) + sfx_opw(ji,jj)   & 
    168168            &       + sfx_res(ji,jj) + sfx_dyn(ji,jj) + sfx_bri(ji,jj) + sfx_sub(ji,jj) + sfx_lam(ji,jj) 
    169           
    170          ! Mass of snow and ice per unit area    
     169 
     170         ! Mass of snow and ice per unit area 
    171171         !---------------------------------------- 
    172172         snwice_mass_b(ji,jj) = snwice_mass(ji,jj)       ! save mass from the previous ice time step 
    173173         !                                               ! new mass per unit area 
    174          snwice_mass  (ji,jj) = tmask(ji,jj,1) * ( rhos * vt_s(ji,jj) + rhoi * vt_i(ji,jj) + rhow * (vt_ip(ji,jj) + vt_il(ji,jj)) )  
     174         snwice_mass  (ji,jj) = tmask(ji,jj,1) * ( rhos * vt_s(ji,jj) + rhoi * vt_i(ji,jj) + rhow * (vt_ip(ji,jj) + vt_il(ji,jj)) ) 
    175175         !                                               ! time evolution of snow+ice mass 
    176176         snwice_fmass (ji,jj) = ( snwice_mass(ji,jj) - snwice_mass_b(ji,jj) ) * r1_Dt_ice 
    177           
     177 
    178178      END_2D 
    179179 
    180180      ! Storing the transmitted variables 
    181181      !---------------------------------- 
    182       fr_i  (:,:)   = at_i(:,:)             ! Sea-ice fraction             
    183       tn_ice(:,:,:) = t_su(:,:,:)           ! Ice surface temperature                       
     182      fr_i  (:,:)   = at_i(:,:)             ! Sea-ice fraction 
     183      tn_ice(:,:,:) = t_su(:,:,:)           ! Ice surface temperature 
    184184 
    185185      ! Snow/ice albedo (only if sent to coupler, useless in forced mode) 
     
    216216      CALL iom_put( 'vfxice'    , wfx_ice     )   ! mass flux from total ice growth/melt 
    217217      CALL iom_put( 'vfxbog'    , wfx_bog     )   ! mass flux from bottom growth 
    218       CALL iom_put( 'vfxbom'    , wfx_bom     )   ! mass flux from bottom melt  
    219       CALL iom_put( 'vfxsum'    , wfx_sum     )   ! mass flux from surface melt  
    220       CALL iom_put( 'vfxlam'    , wfx_lam     )   ! mass flux from lateral melt  
     218      CALL iom_put( 'vfxbom'    , wfx_bom     )   ! mass flux from bottom melt 
     219      CALL iom_put( 'vfxsum'    , wfx_sum     )   ! mass flux from surface melt 
     220      CALL iom_put( 'vfxlam'    , wfx_lam     )   ! mass flux from lateral melt 
    221221      CALL iom_put( 'vfxsni'    , wfx_sni     )   ! mass flux from snow-ice formation 
    222222      CALL iom_put( 'vfxopw'    , wfx_opw     )   ! mass flux from growth in open water 
    223223      CALL iom_put( 'vfxdyn'    , wfx_dyn     )   ! mass flux from dynamics (ridging) 
    224       CALL iom_put( 'vfxres'    , wfx_res     )   ! mass flux from undiagnosed processes  
     224      CALL iom_put( 'vfxres'    , wfx_res     )   ! mass flux from undiagnosed processes 
    225225      CALL iom_put( 'vfxpnd'    , wfx_pnd     )   ! mass flux from melt ponds 
    226226      CALL iom_put( 'vfxsub'    , wfx_ice_sub )   ! mass flux from ice sublimation (ice-atm.) 
    227       CALL iom_put( 'vfxsub_err', wfx_err_sub )   ! "excess" of sublimation sent to ocean       
    228  
    229       IF ( iom_use( 'vfxthin' ) ) THEN   ! mass flux from ice growth in open water + thin ice (<20cm) => comparable to observations   
     227      CALL iom_put( 'vfxsub_err', wfx_err_sub )   ! "excess" of sublimation sent to ocean 
     228 
     229      IF ( iom_use( 'vfxthin' ) ) THEN   ! mass flux from ice growth in open water + thin ice (<20cm) => comparable to observations 
    230230         WHERE( hm_i(:,:) < 0.2 .AND. hm_i(:,:) > 0. ) ; z2d = wfx_bog 
    231231         ELSEWHERE                                     ; z2d = 0._wp 
     
    237237      CALL iom_put( 'vfxsnw'     , wfx_snw     )   ! mass flux from total snow growth/melt 
    238238      CALL iom_put( 'vfxsnw_sum' , wfx_snw_sum )   ! mass flux from snow melt at the surface 
    239       CALL iom_put( 'vfxsnw_sni' , wfx_snw_sni )   ! mass flux from snow melt during snow-ice formation  
    240       CALL iom_put( 'vfxsnw_dyn' , wfx_snw_dyn )   ! mass flux from dynamics (ridging)  
    241       CALL iom_put( 'vfxsnw_sub' , wfx_snw_sub )   ! mass flux from snow sublimation (ice-atm.)  
     239      CALL iom_put( 'vfxsnw_sni' , wfx_snw_sni )   ! mass flux from snow melt during snow-ice formation 
     240      CALL iom_put( 'vfxsnw_dyn' , wfx_snw_dyn )   ! mass flux from dynamics (ridging) 
     241      CALL iom_put( 'vfxsnw_sub' , wfx_snw_sub )   ! mass flux from snow sublimation (ice-atm.) 
    242242      CALL iom_put( 'vfxsnw_pre' , wfx_spr     )   ! snow precip 
    243243 
     
    252252      IF( iom_use('qt_oce'     ) )   CALL iom_put( 'qt_oce'     ,      ( qsr_oce + qns_oce ) * ( 1._wp - at_i_b ) + qemp_oce ) 
    253253      IF( iom_use('qt_ice'     ) )   CALL iom_put( 'qt_ice'     , SUM( ( qns_ice + qsr_ice ) * a_i_b, dim=3 )     + qemp_ice ) 
    254       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)  
    255       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)  
     254      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) 
     255      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) 
    256256      IF( iom_use('qemp_oce'   ) )   CALL iom_put( 'qemp_oce'   , qemp_oce                                                   )   ! Downward Heat Flux from E-P over ocean 
    257257      IF( iom_use('qemp_ice'   ) )   CALL iom_put( 'qemp_ice'   , qemp_ice                                                   )   ! Downward Heat Flux from E-P over ice 
     
    259259      ! heat fluxes from ice transformations 
    260260      !                            ! hfxdhc = hfxbog + hfxbom + hfxsum + hfxopw + hfxdif + hfxsnw - ( hfxthd + hfxdyn + hfxres + hfxsub + hfxspr ) 
    261       CALL iom_put ('hfxbog'     , hfx_bog     )   ! heat flux used for ice bottom growth  
     261      CALL iom_put ('hfxbog'     , hfx_bog     )   ! heat flux used for ice bottom growth 
    262262      CALL iom_put ('hfxbom'     , hfx_bom     )   ! heat flux used for ice bottom melt 
    263263      CALL iom_put ('hfxsum'     , hfx_sum     )   ! heat flux used for ice surface melt 
    264264      CALL iom_put ('hfxopw'     , hfx_opw     )   ! heat flux used for ice formation in open water 
    265265      CALL iom_put ('hfxdif'     , hfx_dif     )   ! heat flux used for ice temperature change 
    266       CALL iom_put ('hfxsnw'     , hfx_snw     )   ! heat flux used for snow melt  
     266      CALL iom_put ('hfxsnw'     , hfx_snw     )   ! heat flux used for snow melt 
    267267      CALL iom_put ('hfxerr'     , hfx_err_dif )   ! heat flux error after heat diffusion 
    268268 
    269269      ! heat fluxes associated with mass exchange (freeze/melt/precip...) 
    270       CALL iom_put ('hfxthd'     , hfx_thd     )   !   
    271       CALL iom_put ('hfxdyn'     , hfx_dyn     )   !   
    272       CALL iom_put ('hfxres'     , hfx_res     )   !   
    273       CALL iom_put ('hfxsub'     , hfx_sub     )   !   
    274       CALL iom_put ('hfxspr'     , hfx_spr     )   ! Heat flux from snow precip heat content  
     270      CALL iom_put ('hfxthd'     , hfx_thd     )   ! 
     271      CALL iom_put ('hfxdyn'     , hfx_dyn     )   ! 
     272      CALL iom_put ('hfxres'     , hfx_res     )   ! 
     273      CALL iom_put ('hfxsub'     , hfx_sub     )   ! 
     274      CALL iom_put ('hfxspr'     , hfx_spr     )   ! Heat flux from snow precip heat content 
    275275 
    276276      ! other heat fluxes 
     
    294294      !!------------------------------------------------------------------- 
    295295      !!                ***  ROUTINE ice_update_tau *** 
    296       !!   
     296      !! 
    297297      !! ** Purpose : Update the ocean surface stresses due to the ice 
    298       !!          
     298      !! 
    299299      !! ** Action  : * at each ice time step (every nn_fsbc time step): 
    300       !!                - compute the modulus of ice-ocean relative velocity  
     300      !!                - compute the modulus of ice-ocean relative velocity 
    301301      !!                  (*rho*Cd) at T-point (C-grid) or I-point (B-grid) 
    302302      !!                      tmod_io = rhoco * | U_ice-U_oce | 
    303303      !!                - update the modulus of stress at ocean surface 
    304304      !!                      taum = (1-a) * taum + a * tmod_io * | U_ice-U_oce | 
    305       !!              * at each ocean time step (every kt):  
     305      !!              * at each ocean time step (every kt): 
    306306      !!                  compute linearized ice-ocean stresses as 
    307307      !!                      Utau = tmod_io * | U_ice - pU_oce | 
     
    310310      !!    NB: - ice-ocean rotation angle no more allowed 
    311311      !!        - here we make an approximation: taum is only computed every ice time step 
    312       !!          This avoids mutiple average to pass from T -> U,V grids and next from U,V grids  
     312      !!          This avoids mutiple average to pass from T -> U,V grids and next from U,V grids 
    313313      !!          to T grid. taum is used in TKE and GLS, which should not be too sensitive to this approximaton... 
    314314      !! 
     
    337337         DO_2D( 0, 0, 0, 0 )                          !* update the modulus of stress at ocean surface (T-point) 
    338338            !                                               ! 2*(U_ice-U_oce) at T-point 
    339             zu_t = u_ice(ji,jj) + u_ice(ji-1,jj) - u_oce(ji,jj) - u_oce(ji-1,jj)    
    340             zv_t = v_ice(ji,jj) + v_ice(ji,jj-1) - v_oce(ji,jj) - v_oce(ji,jj-1)  
     339            zu_t = u_ice(ji,jj) + u_ice(ji-1,jj) - u_oce(ji,jj) - u_oce(ji-1,jj) 
     340            zv_t = v_ice(ji,jj) + v_ice(ji,jj-1) - v_oce(ji,jj) - v_oce(ji,jj-1) 
    341341            !                                              ! |U_ice-U_oce|^2 
    342342            zmodt =  0.25_wp * (  zu_t * zu_t + zv_t * zv_t  ) 
     
    354354      !                                      !==  every ocean time-step  ==! 
    355355      IF ( ln_drgice_imp ) THEN 
    356          ! Save drag with right sign to update top drag in the ocean implicit friction  
    357          rCdU_ice(:,:) = -r1_rho0 * tmod_io(:,:) * at_i(:,:) * tmask(:,:,1)  
     356         ! Save drag with right sign to update top drag in the ocean implicit friction 
     357         rCdU_ice(:,:) = -r1_rho0 * tmod_io(:,:) * at_i(:,:) * tmask(:,:,1) 
    358358         zflagi = 0._wp 
    359359      ELSE 
     
    362362      ! 
    363363      DO_2D( 0, 0, 0, 0 )                             !* update the stress WITHOUT an ice-ocean rotation angle 
    364          ! ice area at u and v-points  
     364         ! ice area at u and v-points 
    365365         zat_u  = ( at_i(ji,jj) * tmask(ji,jj,1) + at_i (ji+1,jj    ) * tmask(ji+1,jj  ,1) )  & 
    366366            &     / MAX( 1.0_wp , tmask(ji,jj,1) + tmask(ji+1,jj  ,1) ) 
     
    377377      ! 
    378378      IF( ln_timing )   CALL timing_stop('ice_update') 
    379       !   
     379      ! 
    380380   END SUBROUTINE ice_update_tau 
    381381 
     
    384384      !!------------------------------------------------------------------- 
    385385      !!                  ***  ROUTINE ice_update_init  *** 
    386       !!              
     386      !! 
    387387      !! ** Purpose :   allocate ice-ocean stress fields and read restarts 
    388388      !!                containing the snow & ice mass 
     
    408408      !!--------------------------------------------------------------------- 
    409409      !!                   ***  ROUTINE rhg_evp_rst  *** 
    410       !!                      
     410      !! 
    411411      !! ** Purpose :   Read or write RHG file in restart file 
    412412      !! 
     
    456456   !!   Default option         Dummy module           NO SI3 sea-ice model 
    457457   !!---------------------------------------------------------------------- 
    458 #endif  
     458#endif 
    459459 
    460460   !!====================================================================== 
  • NEMO/trunk/src/ICE/icevar.F90

    r14005 r14072  
    3434   !!                        - st_i(jpi,jpj) 
    3535   !!                        - et_s(jpi,jpj)  total snow heat content 
    36    !!                        - et_i(jpi,jpj)  total ice thermal content  
     36   !!                        - et_i(jpi,jpj)  total ice thermal content 
    3737   !!                        - sm_i(jpi,jpj)  mean ice salinity 
    3838   !!                        - tm_i(jpi,jpj)  mean ice temperature 
     
    5555   !!---------------------------------------------------------------------- 
    5656   USE dom_oce        ! ocean space and time domain 
    57    USE phycst         ! physical constants (ocean directory)  
     57   USE phycst         ! physical constants (ocean directory) 
    5858   USE sbc_oce , ONLY : sss_m, ln_ice_embd, nn_fsbc 
    5959   USE ice            ! sea-ice: variables 
     
    6767   PRIVATE 
    6868 
    69    PUBLIC   ice_var_agg           
    70    PUBLIC   ice_var_glo2eqv       
    71    PUBLIC   ice_var_eqv2glo       
    72    PUBLIC   ice_var_salprof       
    73    PUBLIC   ice_var_salprof1d     
     69   PUBLIC   ice_var_agg 
     70   PUBLIC   ice_var_glo2eqv 
     71   PUBLIC   ice_var_eqv2glo 
     72   PUBLIC   ice_var_salprof 
     73   PUBLIC   ice_var_salprof1d 
    7474   PUBLIC   ice_var_zapsmall 
    7575   PUBLIC   ice_var_zapneg 
    7676   PUBLIC   ice_var_roundoff 
    77    PUBLIC   ice_var_bv            
    78    PUBLIC   ice_var_enthalpy            
     77   PUBLIC   ice_var_bv 
     78   PUBLIC   ice_var_enthalpy 
    7979   PUBLIC   ice_var_sshdyn 
    8080   PUBLIC   ice_var_itd 
     
    108108      !!                ***  ROUTINE ice_var_agg  *** 
    109109      !! 
    110       !! ** Purpose :   aggregates ice-thickness-category variables to  
     110      !! ** Purpose :   aggregates ice-thickness-category variables to 
    111111      !!              all-ice variables, i.e. it turns VGLO into VAGG 
    112112      !!------------------------------------------------------------------- 
     
    130130      vt_il(:,:) = SUM( v_il(:,:,:), dim=3 ) 
    131131      ! 
    132       ato_i(:,:) = 1._wp - at_i(:,:)         ! open water fraction   
     132      ato_i(:,:) = 1._wp - at_i(:,:)         ! open water fraction 
    133133      ! 
    134134      !!GS: tm_su always needed by ABL over sea-ice 
     
    155155         hm_i(:,:) = vt_i(:,:) * z1_at_i(:,:) 
    156156         hm_s(:,:) = vt_s(:,:) * z1_at_i(:,:) 
    157          !          
     157         ! 
    158158         !                          ! mean temperature (K), salinity and age 
    159159         tm_si(:,:) = SUM( t_si(:,:,:) * a_i(:,:,:) , dim=3 ) * z1_at_i(:,:) 
     
    182182         WHERE( at_ip(:,:) > epsi20 )   ;   hm_ip(:,:) = vt_ip(:,:) / at_ip(:,:)   ;   hm_il(:,:) = vt_il(:,:) / at_ip(:,:) 
    183183         ELSEWHERE                      ;   hm_ip(:,:) = 0._wp                     ;   hm_il(:,:) = 0._wp 
    184          END WHERE          
     184         END WHERE 
    185185         ! 
    186186         DEALLOCATE( z1_vt_i , z1_vt_s ) 
     
    197197      !!                ***  ROUTINE ice_var_glo2eqv *** 
    198198      !! 
    199       !! ** Purpose :   computes equivalent variables as function of   
     199      !! ** Purpose :   computes equivalent variables as function of 
    200200      !!              global variables, i.e. it turns VGLO into VEQV 
    201201      !!------------------------------------------------------------------- 
     
    210210      !!------------------------------------------------------------------- 
    211211 
    212 !!gm Question 2:  It is possible to define existence of sea-ice in a common way between  
     212!!gm Question 2:  It is possible to define existence of sea-ice in a common way between 
    213213!!                ice area and ice volume ? 
    214214!!                the idea is to be able to define one for all at the begining of this routine 
     
    234234 
    235235      zhmax    =          hi_max(jpl) 
    236       z1_zhmax =  1._wp / hi_max(jpl)                
     236      z1_zhmax =  1._wp / hi_max(jpl) 
    237237      WHERE( h_i(:,:,jpl) > zhmax )   ! bound h_i by hi_max (i.e. 99 m) with associated update of ice area 
    238238         h_i   (:,:,jpl) = zhmax 
    239          a_i   (:,:,jpl) = v_i(:,:,jpl) * z1_zhmax  
     239         a_i   (:,:,jpl) = v_i(:,:,jpl) * z1_zhmax 
    240240         z1_a_i(:,:,jpl) = zhmax * z1_v_i(:,:,jpl) 
    241241      END WHERE 
    242242      !                                           !--- snow thickness 
    243243      h_s(:,:,:) = v_s (:,:,:) * z1_a_i(:,:,:) 
    244       !                                           !--- ice age       
     244      !                                           !--- ice age 
    245245      o_i(:,:,:) = oa_i(:,:,:) * z1_a_i(:,:,:) 
    246       !                                           !--- pond and lid thickness       
     246      !                                           !--- pond and lid thickness 
    247247      h_ip(:,:,:) = v_ip(:,:,:) * z1_a_ip(:,:,:) 
    248248      h_il(:,:,:) = v_il(:,:,:) * z1_a_ip(:,:,:) 
     
    258258      a_ip_eff = MIN( a_ip_eff, 1._wp - za_s_fra )   ! make sure (a_ip_eff + a_s_fra) <= 1 
    259259      ! 
    260       !                                           !---  salinity (with a minimum value imposed everywhere)      
     260      !                                           !---  salinity (with a minimum value imposed everywhere) 
    261261      IF( nn_icesal == 2 ) THEN 
    262262         WHERE( v_i(:,:,:) > epsi20 )   ;   s_i(:,:,:) = MAX( rn_simin , MIN( rn_simax, sv_i(:,:,:) * z1_v_i(:,:,:) ) ) 
     
    272272      DO jl = 1, jpl 
    273273         DO_3D( 1, 1, 1, 1, 1, nlay_i ) 
    274             IF ( v_i(ji,jj,jl) > epsi20 ) THEN     !--- icy area  
     274            IF ( v_i(ji,jj,jl) > epsi20 ) THEN     !--- icy area 
    275275               ! 
    276276               ze_i             =   e_i (ji,jj,jk,jl) * z1_v_i(ji,jj,jl) * zlay_i             ! Energy of melting e(S,T) [J.m-3] 
     
    300300      END DO 
    301301      ! 
    302       ! integrated values  
     302      ! integrated values 
    303303      vt_i (:,:) = SUM( v_i , dim=3 ) 
    304304      vt_s (:,:) = SUM( v_s , dim=3 ) 
     
    312312      !!                ***  ROUTINE ice_var_eqv2glo *** 
    313313      !! 
    314       !! ** Purpose :   computes global variables as function of  
     314      !! ** Purpose :   computes global variables as function of 
    315315      !!              equivalent variables,  i.e. it turns VEQV into VGLO 
    316316      !!------------------------------------------------------------------- 
     
    329329      !!                ***  ROUTINE ice_var_salprof *** 
    330330      !! 
    331       !! ** Purpose :   computes salinity profile in function of bulk salinity      
    332       !! 
    333       !! ** Method  : If bulk salinity greater than zsi1,  
     331      !! ** Purpose :   computes salinity profile in function of bulk salinity 
     332      !! 
     333      !! ** Method  : If bulk salinity greater than zsi1, 
    334334      !!              the profile is assumed to be constant (S_inf) 
    335335      !!              If bulk salinity lower than zsi0, 
     
    348348      !!------------------------------------------------------------------- 
    349349 
    350 !!gm Question: Remove the option 3 ?  How many years since it last use ?  
     350!!gm Question: Remove the option 3 ?  How many years since it last use ? 
    351351 
    352352      SELECT CASE ( nn_icesal ) 
     
    369369            END DO 
    370370         END DO 
    371          !                                      ! Slope of the linear profile  
     371         !                                      ! Slope of the linear profile 
    372372         WHERE( h_i(:,:,:) > epsi20 )   ;   z_slope_s(:,:,:) = 2._wp * s_i(:,:,:) / h_i(:,:,:) 
    373373         ELSEWHERE                      ;   z_slope_s(:,:,:) = 0._wp 
     
    379379               zalpha(ji,jj,jl) = MAX(  0._wp , MIN( ( zsi1 - s_i(ji,jj,jl) ) * z1_dS , 1._wp )  ) 
    380380               !                             ! force a constant profile when SSS too low (Baltic Sea) 
    381                IF( 2._wp * s_i(ji,jj,jl) >= sss_m(ji,jj) )   zalpha(ji,jj,jl) = 0._wp   
     381               IF( 2._wp * s_i(ji,jj,jl) >= sss_m(ji,jj) )   zalpha(ji,jj,jl) = 0._wp 
    382382            END_2D 
    383383         END DO 
     
    448448         ALLOCATE( z_slope_s(jpij), zalpha(jpij) ) 
    449449         ! 
    450          !                                      ! Slope of the linear profile  
     450         !                                      ! Slope of the linear profile 
    451451         WHERE( h_i_1d(1:npti) > epsi20 )   ;   z_slope_s(1:npti) = 2._wp * s_i_1d(1:npti) / h_i_1d(1:npti) 
    452452         ELSEWHERE                          ;   z_slope_s(1:npti) = 0._wp 
    453453         END WHERE 
    454           
     454 
    455455         z1_dS = 1._wp / ( zsi1 - zsi0 ) 
    456456         DO ji = 1, npti 
     
    557557         END_2D 
    558558         ! 
    559       END DO  
     559      END DO 
    560560 
    561561      ! to be sure that at_i is the sum of a_i(jl) 
     
    648648         END_2D 
    649649         ! 
    650       END DO  
     650      END DO 
    651651      ! 
    652652      WHERE( pato_i(:,:)   < 0._wp )   pato_i(:,:)   = 0._wp 
     
    693693      ! 
    694694   END SUBROUTINE ice_var_roundoff 
    695     
     695 
    696696 
    697697   SUBROUTINE ice_var_bv 
     
    713713      DO jl = 1, jpl 
    714714         DO jk = 1, nlay_i 
    715             WHERE( t_i(:,:,jk,jl) < rt0 - epsi10 )    
     715            WHERE( t_i(:,:,jk,jl) < rt0 - epsi10 ) 
    716716               bv_i(:,:,jl) = bv_i(:,:,jl) - rTmlt * sz_i(:,:,jk,jl) * r1_nlay_i / ( t_i(:,:,jk,jl) - rt0 ) 
    717717            END WHERE 
     
    727727   SUBROUTINE ice_var_enthalpy 
    728728      !!------------------------------------------------------------------- 
    729       !!                   ***  ROUTINE ice_var_enthalpy ***  
    730       !!                  
     729      !!                   ***  ROUTINE ice_var_enthalpy *** 
     730      !! 
    731731      !! ** Purpose :   Computes sea ice energy of melting q_i (J.m-3) from temperature 
    732732      !! 
     
    734734      !!------------------------------------------------------------------- 
    735735      INTEGER  ::   ji, jk   ! dummy loop indices 
    736       REAL(wp) ::   ztmelts  ! local scalar  
     736      REAL(wp) ::   ztmelts  ! local scalar 
    737737      !!------------------------------------------------------------------- 
    738738      ! 
     
    741741            ztmelts      = - rTmlt  * sz_i_1d(ji,jk) 
    742742            t_i_1d(ji,jk) = MIN( t_i_1d(ji,jk), ztmelts + rt0 ) ! Force t_i_1d to be lower than melting point => likely conservation issue 
    743                                                                 !   (sometimes zdf scheme produces abnormally high temperatures)    
     743                                                                !   (sometimes zdf scheme produces abnormally high temperatures) 
    744744            e_i_1d(ji,jk) = rhoi * ( rcpi  * ( ztmelts - ( t_i_1d(ji,jk) - rt0 ) )           & 
    745745               &                   + rLfus * ( 1._wp - ztmelts / ( t_i_1d(ji,jk) - rt0 ) )   & 
     
    755755   END SUBROUTINE ice_var_enthalpy 
    756756 
    757     
     757 
    758758   FUNCTION ice_var_sshdyn(pssh, psnwice_mass, psnwice_mass_b) 
    759759      !!--------------------------------------------------------------------- 
    760760      !!                   ***  ROUTINE ice_var_sshdyn  *** 
    761       !!                      
     761      !! 
    762762      !! ** Purpose :  compute the equivalent ssh in lead when sea ice is embedded 
    763763      !! 
     
    765765      !! 
    766766      !! ** Reference : Jean-Michel Campin, John Marshall, David Ferreira, 
    767       !!                Sea ice-ocean coupling using a rescaled vertical coordinate z*,  
     767      !!                Sea ice-ocean coupling using a rescaled vertical coordinate z*, 
    768768      !!                Ocean Modelling, Volume 24, Issues 1-2, 2008 
    769769      !!---------------------------------------------------------------------- 
     
    783783      ! compute ice load used to define the equivalent ssh in lead 
    784784      IF( ln_ice_embd ) THEN 
    785          !                                             
     785         ! 
    786786         ! average interpolation coeff as used in dynspg = (1/nn_fsbc)   * {SUM[n/nn_fsbc], n=0,nn_fsbc-1} 
    787787         !                                               = (1/nn_fsbc)^2 * {SUM[n]        , n=0,nn_fsbc-1} 
     
    802802   END FUNCTION ice_var_sshdyn 
    803803 
    804     
     804 
    805805   !!------------------------------------------------------------------- 
    806806   !!                ***  INTERFACE ice_var_itd   *** 
     
    831831      ph_ip(:) = phtip(:) 
    832832      ph_il(:) = phtil(:) 
    833        
     833 
    834834   END SUBROUTINE ice_var_itd_1c1c 
    835835 
     
    846846      REAL(wp), ALLOCATABLE, DIMENSION(:) ::   z1_ai, z1_vi, z1_vs 
    847847      ! 
    848       INTEGER ::   idim   
     848      INTEGER ::   idim 
    849849      !!------------------------------------------------------------------- 
    850850      ! 
     
    888888      ! 
    889889   END SUBROUTINE ice_var_itd_Nc1c 
    890     
     890 
    891891   SUBROUTINE ice_var_itd_1cMc( phti, phts, pati ,                             ph_i, ph_s, pa_i, & 
    892892      &                         ptmi, ptms, ptmsu, psmi, patip, phtip, phtil,  pt_i, pt_s, pt_su, ps_i, pa_ip, ph_ip, ph_il ) 
     
    898898      !! ** Method:   ice thickness distribution follows a gamma function from Abraham et al. (2015) 
    899899      !!              it has the property of conserving total concentration and volume 
    900       !!               
     900      !! 
    901901      !! 
    902902      !! ** Arguments : phti: 1-cat ice thickness 
     
    904904      !!                pati: 1-cat ice concentration 
    905905      !! 
    906       !! ** Output    : jpl-cat  
     906      !! ** Output    : jpl-cat 
    907907      !! 
    908908      !!  Abraham, C., Steiner, N., Monahan, A. and Michel, C., 2015. 
    909909      !!               Effects of subgrid‐scale snow thickness variability on radiative transfer in sea ice. 
    910       !!               Journal of Geophysical Research: Oceans, 120(8), pp.5597-5614  
     910      !!               Journal of Geophysical Research: Oceans, 120(8), pp.5597-5614 
    911911      !!------------------------------------------------------------------- 
    912912      REAL(wp), DIMENSION(:),   INTENT(in)    ::   phti, phts, pati    ! input  ice/snow variables 
     
    987987               ! In case snow load is in excess that would lead to transformation from snow to ice 
    988988               ! Then, transfer the snow excess into the ice (different from icethd_dh) 
    989                zdh = MAX( 0._wp, ( rhos * ph_s(ji,jl) + ( rhoi - rho0 ) * ph_i(ji,jl) ) * r1_rho0 )  
     989               zdh = MAX( 0._wp, ( rhos * ph_s(ji,jl) + ( rhoi - rho0 ) * ph_i(ji,jl) ) * r1_rho0 ) 
    990990               ! recompute h_i, h_s avoiding out of bounds values 
    991991               ph_i(ji,jl) = MIN( hi_max(jl), ph_i(ji,jl) + zdh ) 
     
    10471047      !! 
    10481048      !! ** Method:   Iterative procedure 
    1049       !!                 
     1049      !! 
    10501050      !!               1) Fill ice cat that correspond to input thicknesses 
    10511051      !!                  Find the lowest(jlmin) and highest(jlmax) cat that are filled 
    10521052      !! 
    10531053      !!               2) Expand the filling to the cat jlmin-1 and jlmax+1 
    1054       !!                   by removing 25% ice area from jlmin and jlmax (resp.)  
    1055       !!               
    1056       !!               3) Expand the filling to the empty cat between jlmin and jlmax  
     1054      !!                   by removing 25% ice area from jlmin and jlmax (resp.) 
     1055      !! 
     1056      !!               3) Expand the filling to the empty cat between jlmin and jlmax 
    10571057      !!                   by a) removing 25% ice area from the lower cat (ascendant loop jlmin=>jlmax) 
    10581058      !!                      b) removing 25% ice area from the higher cat (descendant loop jlmax=>jlmin) 
     
    10621062      !!                pati: N-cat ice concentration 
    10631063      !! 
    1064       !! ** Output    : jpl-cat  
    1065       !! 
    1066       !!  (Example of application: BDY forcings when inputs have N-cat /= jpl)   
     1064      !! ** Output    : jpl-cat 
     1065      !! 
     1066      !!  (Example of application: BDY forcings when inputs have N-cat /= jpl) 
    10671067      !!------------------------------------------------------------------- 
    10681068      REAL(wp), DIMENSION(:,:), INTENT(in)    ::   phti, phts, pati    ! input  ice/snow variables 
     
    10771077      REAL(wp), PARAMETER ::   ztrans = 0.25_wp 
    10781078      INTEGER  ::   ji, jl, jl1, jl2 
    1079       INTEGER  ::   idim, icat   
     1079      INTEGER  ::   idim, icat 
    10801080      !!------------------------------------------------------------------- 
    10811081      ! 
     
    11161116      ELSE                              ! input cat /= output cat ! 
    11171117         !                              ! ----------------------- ! 
    1118           
     1118 
    11191119         ALLOCATE( jlfil(idim,jpl), jlfil2(idim,jpl) )       ! allocate arrays 
    11201120         ALLOCATE( jlmin(idim), jlmax(idim) ) 
     
    11261126         ! 
    11271127         ! --- fill the categories --- ! 
    1128          !     find where cat-input = cat-output and fill cat-output fields   
     1128         !     find where cat-input = cat-output and fill cat-output fields 
    11291129         jlmax(:) = 0 
    11301130         jlmin(:) = 999 
     
    11471147         END DO 
    11481148         ! 
    1149          ! --- fill the gaps between categories --- !   
     1149         ! --- fill the gaps between categories --- ! 
    11501150         !     transfer from categories filled at the previous step to the empty ones in between 
    11511151         DO ji = 1, idim 
     
    11681168         END DO 
    11691169         ! 
    1170          jlfil2(:,:) = jlfil(:,:)  
     1170         jlfil2(:,:) = jlfil(:,:) 
    11711171         ! fill categories from low to high 
    11721172         DO jl = 2, jpl-1 
     
    11891189                  ! fill low 
    11901190                  pa_i(ji,jl) = pa_i(ji,jl) + ztrans * pa_i(ji,jl+1) 
    1191                   ph_i(ji,jl) = hi_mean(jl)  
     1191                  ph_i(ji,jl) = hi_mean(jl) 
    11921192                  jlfil2(ji,jl) = jl 
    11931193                  ! remove high 
     
    12791279   !!               we argue that snow does not cover the whole ice because 
    12801280   !!               of wind blowing... 
    1281    !!                 
     1281   !! 
    12821282   !! ** Arguments : ph_s: snow thickness 
    1283    !!                 
     1283   !! 
    12841284   !! ** Output    : pa_s_fra: fraction of ice covered by snow 
    12851285   !! 
     
    13261326      ENDIF 
    13271327   END SUBROUTINE ice_var_snwfra_1d 
    1328     
     1328 
    13291329   !!-------------------------------------------------------------------------- 
    13301330   !! INTERFACE ice_var_snwblow 
     
    13361336   !!                If snow fall was uniform, a fraction (1-at_i) would fall into leads 
    13371337   !!                but because of the winds, more snow falls on leads than on sea ice 
    1338    !!                and a greater fraction (1-at_i)^beta of the total mass of snow  
     1338   !!                and a greater fraction (1-at_i)^beta of the total mass of snow 
    13391339   !!                (beta < 1) falls in leads. 
    1340    !!                In reality, beta depends on wind speed,  
    1341    !!                and should decrease with increasing wind speed but here, it is  
     1340   !!                In reality, beta depends on wind speed, 
     1341   !!                and should decrease with increasing wind speed but here, it is 
    13421342   !!                considered as a constant. an average value is 0.66 
    13431343   !!-------------------------------------------------------------------------- 
  • NEMO/trunk/src/ICE/icewri.F90

    r14005 r14072  
    1010   !!   'key_si3'                                       SI3 sea-ice model 
    1111   !!---------------------------------------------------------------------- 
    12    !!   ice_wri       : write of the diagnostics variables in ouput file  
     12   !!   ice_wri       : write of the diagnostics variables in ouput file 
    1313   !!   ice_wri_state : write for initial state or/and abandon 
    1414   !!---------------------------------------------------------------------- 
     
    3333 
    3434   PUBLIC ice_wri        ! called by ice_stp 
    35    PUBLIC ice_wri_state  ! called by dia_wri_state  
     35   PUBLIC ice_wri_state  ! called by dia_wri_state 
    3636 
    3737   !! * Substitutions 
     
    5252      INTEGER  ::   ji, jj, jk, jl  ! dummy loop indices 
    5353      REAL(wp) ::   z2da, z2db, zrho1, zrho2 
    54       REAL(wp) ::   zmiss_val       ! missing value retrieved from xios  
     54      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios 
    5555      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d, zfast                     ! 2D workspace 
    5656      REAL(wp), DIMENSION(jpi,jpj)     ::   zmsk00, zmsk05, zmsk15, zmsksn ! O%, 5% and 15% concentration mask and snow mask 
     
    5959      ! Global ice diagnostics (SIMIP) 
    6060      REAL(wp) ::   zdiag_area_nh, zdiag_extt_nh, zdiag_volu_nh   ! area, extent, volume 
    61       REAL(wp) ::   zdiag_area_sh, zdiag_extt_sh, zdiag_volu_sh  
     61      REAL(wp) ::   zdiag_area_sh, zdiag_extt_sh, zdiag_volu_sh 
    6262      !!------------------------------------------------------------------- 
    6363      ! 
     
    9292      CALL iom_put( 'icemask05', zmsk05 )   ! ice mask 5% 
    9393      CALL iom_put( 'icemask15', zmsk15 )   ! ice mask 15% 
    94       CALL iom_put( 'icepres'  , zmsk00 )   ! Ice presence (1 or 0)  
     94      CALL iom_put( 'icepres'  , zmsk00 )   ! Ice presence (1 or 0) 
    9595      ! 
    9696      ! general fields 
    97       IF( iom_use('icemass' ) )   CALL iom_put( 'icemass', vt_i * rhoi * zmsk00 )                                           ! Ice mass per cell area  
     97      IF( iom_use('icemass' ) )   CALL iom_put( 'icemass', vt_i * rhoi * zmsk00 )                                           ! Ice mass per cell area 
    9898      IF( iom_use('snwmass' ) )   CALL iom_put( 'snwmass', vt_s * rhos * zmsksn )                                           ! Snow mass per cell area 
    9999      IF( iom_use('iceconc' ) )   CALL iom_put( 'iceconc', at_i        * zmsk00 )                                           ! ice concentration 
     
    106106      IF( iom_use('snwvolu' ) )   CALL iom_put( 'snwvolu', vt_s        * zmsksn )                                           ! snow volume 
    107107      IF( iom_use('icefrb'  ) ) THEN                                                                                        ! Ice freeboard 
    108          z2d(:,:) = ( zrho1 * hm_i(:,:) - zrho2 * hm_s(:,:) )                                          
     108         z2d(:,:) = ( zrho1 * hm_i(:,:) - zrho2 * hm_s(:,:) ) 
    109109         WHERE( z2d < 0._wp )   z2d = 0._wp 
    110110                                  CALL iom_put( 'icefrb' , z2d * zmsk00         ) 
     
    186186      IF( iom_use('dmsmel') )   CALL iom_put( 'dmsmel', - wfx_snw_sum                                                         ) ! Snow mass change through melt 
    187187      IF( iom_use('dmsdyn') )   CALL iom_put( 'dmsdyn', - wfx_snw_dyn + rhos * diag_trp_vs                                    ) ! Snow mass change through dynamics(kg/m2/s) 
    188        
     188 
    189189      ! Global ice diagnostics 
    190190      IF(  iom_use('NH_icearea') .OR. iom_use('NH_icevolu') .OR. iom_use('NH_iceextt') .OR. & 
     
    221221   END SUBROUTINE ice_wri 
    222222 
    223   
     223 
    224224   SUBROUTINE ice_wri_state( kid ) 
    225225      !!--------------------------------------------------------------------- 
    226226      !!                 ***  ROUTINE ice_wri_state  *** 
    227       !!         
    228       !! ** Purpose :   create a NetCDF file named cdfile_name which contains  
     227      !! 
     228      !! ** Purpose :   create a NetCDF file named cdfile_name which contains 
    229229      !!      the instantaneous ice state and forcing fields for ice model 
    230230      !!        Used to find errors in the initial state or save the last 
     
    233233      !! History :   4.0  !  2013-06  (C. Rousset) 
    234234      !!---------------------------------------------------------------------- 
    235       INTEGER, INTENT( in ) ::   kid  
     235      INTEGER, INTENT( in ) ::   kid 
    236236      !!---------------------------------------------------------------------- 
    237237      ! 
Note: See TracChangeset for help on using the changeset viewer.