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 4649 for branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90 – NEMO

Ignore:
Timestamp:
2014-05-27T11:28:12+02:00 (10 years ago)
Author:
clem
Message:

finalizing LIM3 heat budget conservation + multiple minor bugs corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90

    r4634 r4649  
    5353      ! 
    5454      INTEGER  ::   ji, jk     ! dummy loop indices  
    55       REAL(wp) ::   iflush, igravdr, ztmelts   ! local scalars 
    56       REAL(wp) ::   zaaa, zbbb, zccc, zdiscrim   ! local scalars 
     55      REAL(wp) ::   iflush, igravdr   ! local scalars 
    5756      !!--------------------------------------------------------------------- 
    5857 
     58      !--------------------------------------------------------- 
     59      !  0) Update ice salinity from snow-ice and bottom growth 
     60      !--------------------------------------------------------- 
     61      DO ji = kideb, kiut 
     62         sm_i_b(ji) = sm_i_b(ji) + dsm_i_se_1d(ji) + dsm_i_si_1d(ji) 
     63      END DO 
     64  
    5965      !------------------------------------------------------------------------------| 
    6066      ! 1) Constant salinity, constant in time                                       | 
     
    7177      !  Module 2 : Constant salinity varying in time                                | 
    7278      !------------------------------------------------------------------------------| 
    73  
    7479      IF(  num_sal == 2  ) THEN 
    7580 
     
    7883            ! Switches  
    7984            !---------- 
    80             iflush       =        MAX( 0._wp , SIGN( 1._wp , t_su_b(ji) - rtt )        )    ! =1 if summer  
    81             igravdr      =        MAX( 0._wp , SIGN( 1._wp , t_bo_b(ji) - t_su_b(ji) ) )    ! =1 if t_su < t_bo 
     85            iflush  = MAX( 0._wp , SIGN( 1._wp , t_su_b(ji) - rtt )        )    ! =1 if summer  
     86            igravdr = MAX( 0._wp , SIGN( 1._wp , t_bo_b(ji) - t_su_b(ji) ) )    ! =1 if t_su < t_bo 
    8287 
    8388            !--------------------- 
    8489            ! Salinity tendencies 
    8590            !--------------------- 
    86             !                                
    87             dsm_i_gd_1d(ji) = - igravdr * MAX( sm_i_b(ji) - sal_G , 0._wp ) / time_G * rdt_ice  ! drainage by gravity 
    88             dsm_i_fl_1d(ji) = - iflush  * MAX( sm_i_b(ji) - sal_F , 0._wp ) / time_F * rdt_ice  ! drainage by flushing  
    89             ! 
     91            ! drainage by gravity drainage 
     92            dsm_i_gd_1d(ji) = - igravdr * MAX( sm_i_b(ji) - sal_G , 0._wp ) / time_G * rdt_ice  
     93            ! drainage by flushing   
     94            dsm_i_fl_1d(ji) = - iflush  * MAX( sm_i_b(ji) - sal_F , 0._wp ) / time_F * rdt_ice 
     95 
    9096            !----------------- 
    9197            ! Update salinity    
     
    104110         ! Salinity profile 
    105111         CALL lim_var_salprof1d( kideb, kiut ) 
    106  
    107  
    108          ! Only necessary for conservation check since salinity is modified 
    109          !-------------------- 
    110          ! Temperature update 
    111          !-------------------- 
    112          DO jk = 1, nlay_i 
    113             DO ji = kideb, kiut 
    114                ztmelts    =  -tmut*s_i_b(ji,jk) + rtt 
    115                !Conversion q(S,T) -> T (second order equation) 
    116                zaaa         =  cpic 
    117                zbbb         =  ( rcp - cpic ) * ( ztmelts - rtt ) + q_i_b(ji,jk) / rhoic - lfus 
    118                zccc         =  lfus * ( ztmelts - rtt ) 
    119                zdiscrim     =  SQRT(  MAX( zbbb*zbbb - 4.0*zaaa*zccc, 0._wp )  ) 
    120                t_i_b(ji,jk) =  rtt - ( zbbb + zdiscrim ) / ( 2.0 *zaaa ) 
    121             END DO 
    122          END DO 
    123112         ! 
    124113      ENDIF  
     
    127116      !  Module 3 : Profile of salinity, constant in time                            | 
    128117      !------------------------------------------------------------------------------| 
    129  
    130118      IF(  num_sal == 3  )   CALL lim_var_salprof1d( kideb, kiut ) 
    131119 
Note: See TracChangeset for help on using the changeset viewer.