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 12928 for NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/TOP/TRP/trcsbc.F90 – NEMO

Ignore:
Timestamp:
2020-05-14T21:46:00+02:00 (4 years ago)
Author:
smueller
Message:

Synchronizing with /NEMO/trunk@12925 (ticket #2170)

Location:
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser

    • Property svn:externals
      •  

        old new  
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8 
         9# SETTE 
         10^/utils/CI/sette@HEAD         sette 
  • NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/TOP/TRP/trcsbc.F90

    r10788 r12928  
    2929 
    3030   !! * Substitutions 
    31 #  include "vectopt_loop_substitute.h90" 
     31#  include "do_loop_substitute.h90" 
    3232   !!---------------------------------------------------------------------- 
    3333   !! NEMO/TOP 4.0 , NEMO Consortium (2018) 
     
    3737CONTAINS 
    3838 
    39    SUBROUTINE trc_sbc ( kt ) 
     39   SUBROUTINE trc_sbc ( kt, Kmm, ptr, Krhs ) 
    4040      !!---------------------------------------------------------------------- 
    4141      !!                  ***  ROUTINE trc_sbc  *** 
     
    4949      !!            The surface freshwater flux modify the ocean volume 
    5050      !!         and thus the concentration of a tracer as : 
    51       !!            tra = tra + emp * trn / e3t   for k=1 
     51      !!            tr(Krhs) = tr(Krhs) + emp * tr(Kmm) / e3t   for k=1 
    5252      !!         where emp, the surface freshwater budget (evaporation minus 
    5353      !!         precipitation ) given in kg/m2/s is divided 
    5454      !!         by 1035 kg/m3 (density of ocean water) to obtain m/s. 
    5555      !! 
    56       !! ** Action  : - Update the 1st level of tra with the trend associated 
     56      !! ** Action  : - Update the 1st level of tr(:,:,:,:,Krhs) with the trend associated 
    5757      !!                with the tracer surface boundary condition  
    5858      !! 
    5959      !!---------------------------------------------------------------------- 
    60       INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     60      INTEGER,                                    INTENT(in   ) :: kt        ! ocean time-step index 
     61      INTEGER,                                    INTENT(in   ) :: Kmm, Krhs ! time level indices 
     62      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,jpt), INTENT(inout) :: ptr       ! passive tracers and RHS of tracer equation 
    6163      ! 
    6264      INTEGER  ::   ji, jj, jn                      ! dummy loop indices 
     
    8284         IF( ln_rsttr .AND. .NOT.ln_top_euler .AND.   &                     ! Restart: read in restart  file 
    8385            iom_varid( numrtr, 'sbc_'//TRIM(ctrcnm(1))//'_b', ldstop = .FALSE. ) > 0 ) THEN 
    84             IF(lwp) WRITE(numout,*) '          nittrc000-nn_dttrc surface tracer content forcing fields red in the restart file' 
     86            IF(lwp) WRITE(numout,*) '          nittrc000-1 surface tracer content forcing fields read in the restart file' 
    8587            zfact = 0.5_wp 
    8688            DO jn = 1, jptra 
     
    102104      ENDIF 
    103105 
    104       ! Coupling online : river runoff is added to the horizontal divergence (hdivn) in the subroutine sbc_rnf_div  
     106      ! Coupling online : river runoff is added to the horizontal divergence (hdiv) in the subroutine sbc_rnf_div  
    105107      ! one only consider the concentration/dilution effect due to evaporation minus precipitation + freezing/melting of sea-ice 
    106108      ! Coupling offline : runoff are in emp which contains E-P-R 
     
    118120         ! 
    119121         DO jn = 1, jptra 
    120             DO jj = 2, jpj 
    121                DO ji = fs_2, fs_jpim1   ! vector opt. 
    122                   sbc_trc(ji,jj,jn) = zsfx(ji,jj) * r1_rau0 * trn(ji,jj,1,jn) 
    123                END DO 
    124             END DO 
     122            DO_2D_01_00 
     123               sbc_trc(ji,jj,jn) = zsfx(ji,jj) * r1_rho0 * ptr(ji,jj,1,jn,Kmm) 
     124            END_2D 
    125125         END DO 
    126126         ! 
     
    128128         ! 
    129129         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 
     130            DO_2D_01_00 
     131               sbc_trc(ji,jj,jn) = ( zsfx(ji,jj) + fmmflx(ji,jj) ) * r1_rho0 * ptr(ji,jj,1,jn,Kmm) 
     132            END_2D 
    135133         END DO 
    136134         ! 
     
    138136         ! 
    139137         DO jn = 1, jptra 
    140             DO jj = 2, jpj 
    141                DO ji = fs_2, fs_jpim1   ! vector opt. 
    142                   zse3t = 1. / e3t_n(ji,jj,1) 
    143                   ! tracer flux at the ice/ocean interface (tracer/m2/s) 
    144                   zftra = - trc_i(ji,jj,jn) * fmmflx(ji,jj) ! uptake of tracer in the sea ice 
    145                   !                                         ! only used in the levitating sea ice case 
    146                   ! tracer flux only       : add concentration dilution term in net tracer flux, no F-M in volume flux 
    147                   ! tracer and mass fluxes : no concentration dilution term in net tracer flux, F-M term in volume flux 
    148                   ztfx  = zftra                        ! net tracer flux 
    149                   ! 
    150                   zdtra = r1_rau0 * ( ztfx + ( zsfx(ji,jj) + fmmflx(ji,jj) ) * trn(ji,jj,1,jn) )  
    151                   IF ( zdtra < 0. ) THEN 
    152                      zdtra  = MAX(zdtra, -trn(ji,jj,1,jn) * e3t_n(ji,jj,1) / r2dttrc )   ! avoid negative concentrations to arise 
    153                   ENDIF 
    154                   sbc_trc(ji,jj,jn) =  zdtra  
    155                END DO 
    156             END DO 
     138            DO_2D_01_00 
     139               zse3t = 1. / e3t(ji,jj,1,Kmm) 
     140               ! tracer flux at the ice/ocean interface (tracer/m2/s) 
     141               zftra = - trc_i(ji,jj,jn) * fmmflx(ji,jj) ! uptake of tracer in the sea ice 
     142               !                                         ! only used in the levitating sea ice case 
     143               ! tracer flux only       : add concentration dilution term in net tracer flux, no F-M in volume flux 
     144               ! tracer and mass fluxes : no concentration dilution term in net tracer flux, F-M term in volume flux 
     145               ztfx  = zftra                        ! net tracer flux 
     146               ! 
     147               zdtra = r1_rho0 * ( ztfx + ( zsfx(ji,jj) + fmmflx(ji,jj) ) * ptr(ji,jj,1,jn,Kmm) )  
     148               IF ( zdtra < 0. ) THEN 
     149                  zdtra  = MAX(zdtra, -ptr(ji,jj,1,jn,Kmm) * e3t(ji,jj,1,Kmm) / rDt_trc )   ! avoid negative concentrations to arise 
     150               ENDIF 
     151               sbc_trc(ji,jj,jn) =  zdtra  
     152            END_2D 
    157153         END DO 
    158154      END SELECT 
     
    162158      DO jn = 1, jptra 
    163159         ! 
    164          IF( l_trdtrc )   ztrtrd(:,:,:) = tra(:,:,:,jn)  ! save trends 
    165          ! 
    166          DO jj = 2, jpj 
    167             DO ji = fs_2, fs_jpim1   ! vector opt. 
    168                zse3t = zfact / e3t_n(ji,jj,1) 
    169                tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + ( sbc_trc_b(ji,jj,jn) + sbc_trc(ji,jj,jn) ) * zse3t 
    170             END DO 
    171          END DO 
     160         IF( l_trdtrc )   ztrtrd(:,:,:) = ptr(:,:,:,jn,Krhs)  ! save trends 
     161         ! 
     162         DO_2D_01_00 
     163            zse3t = zfact / e3t(ji,jj,1,Kmm) 
     164            ptr(ji,jj,1,jn,Krhs) = ptr(ji,jj,1,jn,Krhs) + ( sbc_trc_b(ji,jj,jn) + sbc_trc(ji,jj,jn) ) * zse3t 
     165         END_2D 
    172166         ! 
    173167         IF( l_trdtrc ) THEN 
    174             ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) 
    175             CALL trd_tra( kt, 'TRC', jn, jptra_nsr, ztrtrd ) 
     168            ztrtrd(:,:,:) = ptr(:,:,:,jn,Krhs) - ztrtrd(:,:,:) 
     169            CALL trd_tra( kt, Kmm, Krhs, 'TRC', jn, jptra_nsr, ztrtrd ) 
    176170         END IF 
    177171         !                                                       ! =========== 
     
    191185      ENDIF 
    192186      ! 
    193       IF( ln_ctl )   THEN 
     187      IF( sn_cfctl%l_prttrc )   THEN 
    194188         WRITE(charout, FMT="('sbc ')") ;  CALL prt_ctl_trc_info(charout) 
    195                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
     189                                           CALL prt_ctl_trc( tab4d=ptr(:,:,:,:,Krhs), mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 
    196190      ENDIF 
    197191      IF( l_trdtrc )  DEALLOCATE( ztrtrd ) 
     
    205199   !!   Dummy module :                      NO passive tracer 
    206200   !!---------------------------------------------------------------------- 
     201   USE par_oce 
     202   USE par_trc 
    207203CONTAINS 
    208    SUBROUTINE trc_sbc (kt)              ! Empty routine 
    209       INTEGER, INTENT(in) :: kt 
     204   SUBROUTINE trc_sbc ( kt, Kmm, ptr, Krhs )      ! Empty routine 
     205      INTEGER,                                    INTENT(in   ) :: kt        ! ocean time-step index 
     206      INTEGER,                                    INTENT(in   ) :: Kmm, Krhs ! time level indices 
     207      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,jpt), INTENT(inout) :: ptr       ! passive tracers and RHS of tracer equation 
    210208      WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt 
    211209   END SUBROUTINE trc_sbc 
Note: See TracChangeset for help on using the changeset viewer.