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 11822 for NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/TRP/trcsbc.F90 – NEMO

Ignore:
Timestamp:
2019-10-29T11:41:36+01:00 (4 years ago)
Author:
acc
Message:

Branch 2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps. Sette tested updates to branch to align with trunk changes between 10721 and 11740. Sette tests are passing but results differ from branch before these changes (except for GYRE_PISCES and VORTEX) and branch results already differed from trunk because of algorithmic fixes. Will need more checks to confirm correctness.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/TRP/trcsbc.F90

    r11504 r11822  
    6363      ! 
    6464      INTEGER  ::   ji, jj, jn                      ! dummy loop indices 
    65       REAL(wp) ::   zse3t, zrtrn, zratio, zfact     ! local scalars 
    66       REAL(wp) ::   zftra, zcd, zdtra, ztfx, ztra   !   -      - 
     65      REAL(wp) ::   zse3t, zrtrn, zfact     ! local scalars 
     66      REAL(wp) ::   zftra, zdtra, ztfx, ztra   !   -      - 
    6767      CHARACTER (len=22) :: charout 
    6868      REAL(wp), DIMENSION(jpi,jpj)   ::   zsfx 
     
    115115 
    116116      ! 0. initialization 
    117       IF( nn_ice_tr == -1 ) THEN    ! No tracers in sea ice (null concentration in sea ice) 
     117      SELECT CASE ( nn_ice_tr ) 
     118 
     119      CASE ( -1 ) ! No tracers in sea ice (null concentration in sea ice) 
    118120         ! 
    119121         DO jn = 1, jptra 
     
    125127         END DO 
    126128         ! 
    127        ELSE 
     129      CASE ( 0 )  ! Same concentration in sea ice and in the ocean 
     130         ! 
     131         DO jn = 1, jptra 
     132            DO jj = 2, jpj 
     133               DO ji = fs_2, fs_jpim1   ! vector opt. 
     134                  sbc_trc(ji,jj,jn) = ( zsfx(ji,jj) + fmmflx(ji,jj) ) * r1_rau0 * ptr(ji,jj,1,jn,Kmm) 
     135               END DO 
     136            END DO 
     137         END DO 
     138         ! 
     139      CASE ( 1 )  ! Specific treatment of sea ice fluxes with an imposed concentration in sea ice  
    128140         ! 
    129141         DO jn = 1, jptra 
     
    133145                  ! tracer flux at the ice/ocean interface (tracer/m2/s) 
    134146                  zftra = - trc_i(ji,jj,jn) * fmmflx(ji,jj) ! uptake of tracer in the sea ice 
    135                   zcd   =   trc_o(ji,jj,jn) * fmmflx(ji,jj) ! concentration dilution due to freezing-melting, 
    136147                  !                                         ! only used in the levitating sea ice case 
    137148                  ! tracer flux only       : add concentration dilution term in net tracer flux, no F-M in volume flux 
    138149                  ! tracer and mass fluxes : no concentration dilution term in net tracer flux, F-M term in volume flux 
    139                   ztfx  = zftra                             ! net tracer flux 
     150                  ztfx  = zftra                        ! net tracer flux 
    140151                  ! 
    141                   zdtra = r1_rau0 * ( ztfx + zsfx(ji,jj) * ptr(ji,jj,1,jn,Kmm) )  
     152                  zdtra = r1_rau0 * ( ztfx + ( zsfx(ji,jj) + fmmflx(ji,jj) ) * ptr(ji,jj,1,jn,Kmm) )  
    142153                  IF ( zdtra < 0. ) THEN 
    143                      zratio = -zdtra * zse3t * r2dttrc / ( ptr(ji,jj,1,jn,Kmm) + zrtrn ) 
    144                      zdtra = MIN(1.0, zratio) * zdtra ! avoid negative concentrations to arise 
     154                     zdtra  = MAX(zdtra, -ptr(ji,jj,1,jn,Kmm) * e3t(ji,jj,1,Kmm) / r2dttrc )   ! avoid negative concentrations to arise 
    145155                  ENDIF 
    146156                  sbc_trc(ji,jj,jn) =  zdtra  
     
    148158            END DO 
    149159         END DO 
    150       ENDIF 
     160      END SELECT 
    151161      ! 
    152162      CALL lbc_lnk( 'trcsbc', sbc_trc(:,:,:), 'T', 1. ) 
Note: See TracChangeset for help on using the changeset viewer.