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 3517 for branches/2012/dev_r3385_NOCS04_HAMF/NEMOGCM/NEMO/LIM_SRC_3/limupdate.F90 – NEMO

Ignore:
Timestamp:
2012-10-26T12:13:21+02:00 (12 years ago)
Author:
gm
Message:

gm: Branch: dev_r3385_NOCS04_HAMF; #665. update sbccpl ; change LIM3 from equivalent salt flux to salt flux and mass flux

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_r3385_NOCS04_HAMF/NEMOGCM/NEMO/LIM_SRC_3/limupdate.F90

    r3419 r3517  
    190190 
    191191                  ! is there any ice left ? 
    192                   zindic        = MAX( rzero, SIGN( rone, v_i(ji,jj,jl) - epsi10 ) )  
     192                  zindic = MAX( rzero , SIGN( rone, v_i(ji,jj,jl) - epsi10 ) )  
    193193                  !=1 if hi > 1e-3 and 0 if not 
    194                   zdvres        = MAX(0.0,-v_i(ji,jj,jl)) !residual volume if too much ice was molten 
     194                  zdvres = MAX( 0.0 , -v_i(ji,jj,jl) ) !residual volume if too much ice was molten 
    195195                  !this quantity is positive 
    196                   v_i(ji,jj,jl) = zindic*v_i(ji,jj,jl)    !ice volume cannot be negative 
     196                  v_i(ji,jj,jl) = zindic * v_i(ji,jj,jl)    !ice volume cannot be negative 
    197197                  !correct thermodynamic ablation 
    198                   d_v_i_thd(ji,jj,jl)  = zindic  *  d_v_i_thd(ji,jj,jl) + (1.0-zindic) * (-zviold - d_v_i_trp(ji,jj,jl))  
     198                  d_v_i_thd(ji,jj,jl) = zindic  *  d_v_i_thd(ji,jj,jl) + (1.0-zindic) * (-zviold - d_v_i_trp(ji,jj,jl))  
    199199                  ! THIS IS NEW 
    200                   d_a_i_thd(ji,jj,jl)  = zindic  *  d_a_i_thd(ji,jj,jl) + &  
    201                      (1.0-zindic) * (-old_a_i(ji,jj,jl))  
     200                  d_a_i_thd(ji,jj,jl) = zindic  *  d_a_i_thd(ji,jj,jl) + (1.0-zindic) * (-old_a_i(ji,jj,jl))  
    202201 
    203202                  !residual salt flux if ice is over-molten 
    204                   fsalt_res(ji,jj)  = fsalt_res(ji,jj) + ( sss_m(ji,jj) - sm_i(ji,jj,jl) ) * &  
    205                      ( rhoic * zdvres / rdt_ice ) 
    206                   !             fheat_res(ji,jj)  = fheat_res(ji,jj) + rhoic * lfus * zdvres / rdt_ice 
     203                  fsalt_res(ji,jj)  = fsalt_res(ji,jj) - sm_i(ji,jj,jl) * ( rhoic * zdvres * r1_rdtice ) 
     204                  !             fheat_res(ji,jj)  = fheat_res(ji,jj) + rhoic * lfus * zdvres * r1_rdtice 
    207205 
    208206                  ! is there any snow left ? 
    209                   zindsn        = MAX( rzero, SIGN( rone, v_s(ji,jj,jl) - epsi10 ) )  
    210                   zvsold        = v_s(ji,jj,jl) 
    211                   zdvres        = MAX(0.0,-v_s(ji,jj,jl)) !residual volume if too much ice was molten 
     207                  zindsn = MAX(  rzero, SIGN( rone , v_s(ji,jj,jl) - epsi10 ) )  
     208                  zvsold = v_s(ji,jj,jl) 
     209                  zdvres = MAX( 0.0 , -v_s(ji,jj,jl) )  !residual volume if too much ice was molten 
    212210                  !this quantity is positive 
    213211                  v_s(ji,jj,jl) = zindsn*v_s(ji,jj,jl)    !snow volume cannot be negative 
     
    215213                  d_v_s_thd(ji,jj,jl)  = zindsn  *  d_v_s_thd(ji,jj,jl) + &  
    216214                     (1.0-zindsn) * (-zvsold - d_v_s_trp(ji,jj,jl))  
    217                   !unsure correction on salt flux.... maybe future will tell it was not that right 
    218  
    219                   !residual salt flux if snow is over-molten 
    220                   fsalt_res(ji,jj)  = fsalt_res(ji,jj) + sss_m(ji,jj) * ( rhosn * zdvres / rdt_ice ) 
    221                   !this flux will be positive if snow was over-molten 
    222                   !             fheat_res(ji,jj)  = fheat_res(ji,jj) + rhosn * lfus * zdvres / rdt_ice 
     215 
     216                  !no salt flux when snow is over-molten 
     217                  !             fheat_res(ji,jj)  = fheat_res(ji,jj) + rhosn * lfus * zdvres * r1_rdtice 
    223218               ENDIF 
    224219            END DO !ji 
     
    306301      !-------------- 
    307302 
    308       IF(  num_sal == 2  .OR.  num_sal == 4  ) THEN      ! general case 
     303      IF(  num_sal == 2  ) THEN      ! Prognostic salinity [Sice=F(z,t)] 
    309304         ! 
    310305         IF( ln_nicep ) THEN   
     
    317312            WRITE(numout,*) ' v_s : ', v_s(jiindx, jjindx, 1:jpl) 
    318313         ENDIF 
    319  
     314         ! 
    320315         smv_i(:,:,:) = smv_i(:,:,:) + d_smv_i_thd(:,:,:) + d_smv_i_trp(:,:,:) 
    321316         ! 
     
    616611            DO ji = 1, jpi 
    617612               IF ( internal_melt(ji,jj,jl) == 1 ) THEN 
    618                   v_s(ji,jj,jl)   = 0.0 
    619                   e_s(ji,jj,1,jl) = 0.0 
     613                  v_s(ji,jj,jl)   = 0._wp 
     614                  e_s(ji,jj,1,jl) = 0._wp 
    620615                  !   ! release heat 
    621                   fheat_res(ji,jj) = fheat_res(ji,jj)  & 
    622                      + ze_s * v_s(ji,jj,jl) / rdt_ice 
     616                  fheat_res(ji,jj) = fheat_res(ji,jj) + ze_s  * v_s(ji,jj,jl) * r1_rdtice 
    623617                  ! release mass 
    624                   rdm_snw(ji,jj) =  rdm_snw(ji,jj) + rhosn * v_s(ji,jj,jl) 
     618                  rdm_snw  (ji,jj) = rdm_snw  (ji,jj) + rhosn * v_s(ji,jj,jl) 
    625619               ENDIF 
    626620            END DO 
     
    648642               !                ENDIF 
    649643               IF ((oa_i(ji,jj,jl)-1.0)*86400.0.gt.(rdt_ice*numit*a_i(ji,jj,jl))) THEN 
    650                   oa_i(ji,jj,jl) = rdt_ice*numit/86400.0*a_i(ji,jj,jl) 
     644                  oa_i(ji,jj,jl) = rdt_ice * numit / 86400.0 * a_i(ji,jj,jl) 
    651645               ENDIF 
    652646               oa_i(ji,jj,jl) = zindb*zindic*oa_i(ji,jj,jl) 
     
    657651               !             v_s(ji,jj,jl)  = MAX( zindb * v_s(ji,jj,jl), 0.0)  
    658652               ! snow thickness cannot be smaller than 1e-6 
    659                v_s(ji,jj,jl)  = zindsn*v_s(ji,jj,jl)*zindb 
     653               v_s(ji,jj,jl)  = zindsn * v_s(ji,jj,jl) * zindb 
    660654               v_s(ji,jj,jl)  = v_s(ji,jj,jl) *  MAX( 0.0 , SIGN( 1.0 , v_s(ji,jj,jl) - epsi06 ) ) 
    661655 
     
    737731      !--------------------- 
    738732 
    739       IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) THEN ! general case 
    740  
     733      IF(  num_sal == 2  ) THEN      ! Prognostic salinity [Sice=F(z,t)] 
     734         ! 
    741735         DO jl = 1, jpl 
    742736            DO jk = 1, nlay_i 
    743737               DO jj = 1, jpj  
    744                   DO ji = 1, jpi 
    745                      ! salinity stays in bounds 
    746                      smv_i(ji,jj,jl)  =  MAX(MIN((rhoic-rhosn)/rhoic*sss_m(ji,jj),smv_i(ji,jj,jl)), & 
    747                         0.1 * v_i(ji,jj,jl) ) 
     738                  DO ji = 1, jpi           ! salinity stays in bounds 
     739                     smv_i(ji,jj,jl)  =  MAX(MIN((rhoic-rhosn)/rhoic*sss_m(ji,jj),smv_i(ji,jj,jl)), 0.1 * v_i(ji,jj,jl) ) 
    748740                     i_ice_switch    =  1.0-MAX(0.0,SIGN(1.0,-v_i(ji,jj,jl))) 
    749                      smv_i(ji,jj,jl)  = i_ice_switch*smv_i(ji,jj,jl) + & 
    750                         0.1*(1.0-i_ice_switch)*v_i(ji,jj,jl) 
     741                     smv_i(ji,jj,jl)  = i_ice_switch*smv_i(ji,jj,jl) + 0.1*(1.0-i_ice_switch)*v_i(ji,jj,jl) 
    751742                  END DO ! ji 
    752743               END DO ! jj 
    753744            END DO !jk 
    754745         END DO !jl 
    755  
     746         ! 
    756747      ENDIF 
    757748 
     
    819810            ! 1) Count the number of existing categories 
    820811            DO jl  = 1, jpl 
     812!!cr : comment the second line of zindb definition, and use epsi04 in the 1st one 
    821813               zindb   =  MAX( rzero, SIGN( rone, v_i(ji,jj,jl) - epsi03 ) )  
    822814               zindb   =  MAX( rzero, SIGN( rone, v_i(ji,jj,jl) ) )  
Note: See TracChangeset for help on using the changeset viewer.