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 12065 for NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/TOP/TRP/trcsbc.F90 – NEMO

Ignore:
Timestamp:
2019-12-05T12:06:36+01:00 (4 years ago)
Author:
smueller
Message:

Synchronizing with /NEMO/trunk@12055 (ticket #2194)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/TOP/TRP/trcsbc.F90

    r10425 r12065  
    6161      ! 
    6262      INTEGER  ::   ji, jj, jn                      ! dummy loop indices 
    63       REAL(wp) ::   zse3t, zrtrn, zratio, zfact     ! local scalars 
    64       REAL(wp) ::   zftra, zcd, zdtra, ztfx, ztra   !   -      - 
     63      REAL(wp) ::   zse3t, zrtrn, zfact     ! local scalars 
     64      REAL(wp) ::   zftra, zdtra, ztfx, ztra   !   -      - 
    6565      CHARACTER (len=22) :: charout 
    6666      REAL(wp), DIMENSION(jpi,jpj)   ::   zsfx 
     
    113113 
    114114      ! 0. initialization 
    115       IF( nn_ice_tr == -1 ) THEN    ! No tracers in sea ice (null concentration in sea ice) 
     115      SELECT CASE ( nn_ice_tr ) 
     116 
     117      CASE ( -1 ) ! No tracers in sea ice (null concentration in sea ice) 
    116118         ! 
    117119         DO jn = 1, jptra 
     
    123125         END DO 
    124126         ! 
    125        ELSE 
     127      CASE ( 0 )  ! Same concentration in sea ice and in the ocean 
     128         ! 
     129         DO jn = 1, jptra 
     130            DO jj = 2, jpj 
     131               DO ji = fs_2, fs_jpim1   ! vector opt. 
     132                  sbc_trc(ji,jj,jn) = ( zsfx(ji,jj) + fmmflx(ji,jj) ) * r1_rau0 * trn(ji,jj,1,jn) 
     133               END DO 
     134            END DO 
     135         END DO 
     136         ! 
     137      CASE ( 1 )  ! Specific treatment of sea ice fluxes with an imposed concentration in sea ice  
    126138         ! 
    127139         DO jn = 1, jptra 
     
    131143                  ! tracer flux at the ice/ocean interface (tracer/m2/s) 
    132144                  zftra = - trc_i(ji,jj,jn) * fmmflx(ji,jj) ! uptake of tracer in the sea ice 
    133                   zcd   =   trc_o(ji,jj,jn) * fmmflx(ji,jj) ! concentration dilution due to freezing-melting, 
    134145                  !                                         ! only used in the levitating sea ice case 
    135146                  ! tracer flux only       : add concentration dilution term in net tracer flux, no F-M in volume flux 
    136147                  ! tracer and mass fluxes : no concentration dilution term in net tracer flux, F-M term in volume flux 
    137                   ztfx  = zftra                             ! net tracer flux 
     148                  ztfx  = zftra                        ! net tracer flux 
    138149                  ! 
    139                   zdtra = r1_rau0 * ( ztfx + zsfx(ji,jj) * trn(ji,jj,1,jn) )  
     150                  zdtra = r1_rau0 * ( ztfx + ( zsfx(ji,jj) + fmmflx(ji,jj) ) * trn(ji,jj,1,jn) )  
    140151                  IF ( zdtra < 0. ) THEN 
    141                      zratio = -zdtra * zse3t * r2dttrc / ( trn(ji,jj,1,jn) + zrtrn ) 
    142                      zdtra = MIN(1.0, zratio) * zdtra ! avoid negative concentrations to arise 
     152                     zdtra  = MAX(zdtra, -trn(ji,jj,1,jn) * e3t_n(ji,jj,1) / r2dttrc )   ! avoid negative concentrations to arise 
    143153                  ENDIF 
    144154                  sbc_trc(ji,jj,jn) =  zdtra  
     
    146156            END DO 
    147157         END DO 
    148       ENDIF 
     158      END SELECT 
    149159      ! 
    150160      CALL lbc_lnk( 'trcsbc', sbc_trc(:,:,:), 'T', 1. ) 
Note: See TracChangeset for help on using the changeset viewer.