MODULE trcsbc !!============================================================================== !! *** MODULE trcsbc *** !! Ocean passive tracers: surface boundary condition !!====================================================================== !! History : 8.2 ! 1998-10 (G. Madec, G. Roullet, M. Imbard) Original code !! 8.2 ! 2001-02 (D. Ludicone) sea ice and free surface !! 8.5 ! 2002-06 (G. Madec) F90: Free form and module !! 9.0 ! 2004-03 (C. Ethe) adapted for passive tracers !! ! 2006-08 (C. Deltel) Diagnose ML trends for passive tracers !!============================================================================== #if defined key_top !!---------------------------------------------------------------------- !! 'key_top' TOP models !!---------------------------------------------------------------------- !! trc_sbc : update the tracer trend at ocean surface !!---------------------------------------------------------------------- !! * Modules used USE oce_trc ! ocean dynamics and active tracers variables USE trc ! ocean passive tracers variables USE prtctl_trc ! Print control for debbuging USE trdmod_oce USE trdtra IMPLICIT NONE PRIVATE !! * Routine accessibility PUBLIC trc_sbc ! routine called by step.F90 !! * Substitutions # include "top_substitute.h90" !!---------------------------------------------------------------------- !! TOP 1.0 , LOCEAN-IPSL (2005) !! $Id$ !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt !!---------------------------------------------------------------------- CONTAINS SUBROUTINE trc_sbc ( kt ) !!---------------------------------------------------------------------- !! *** ROUTINE trc_sbc *** !! !! ** Purpose : Compute the tracer surface boundary condition trend of !! (concentration/dilution effect) and add it to the general !! trend of tracer equations. !! !! ** Method : !! * concentration/dilution effect: !! The surface freshwater flux modify the ocean volume !! and thus the concentration of a tracer as : !! tra = tra + emp * trn / e3t for k=1 !! where emp, the surface freshwater budget (evaporation minus !! precipitation minus runoff) given in kg/m2/s is divided !! by 1035 kg/m3 (density of ocean water) to obtain m/s. !! !! ** Action : - Update the 1st level of tra with the trend associated !! with the tracer surface boundary condition !! !!---------------------------------------------------------------------- !! * Arguments INTEGER, INTENT( in ) :: kt ! ocean time-step index !! * Local declarations INTEGER :: ji, jj, jn ! dummy loop indices REAL(wp) :: zsrau, zse3t ! temporary scalars REAL(wp), DIMENSION(jpi,jpj) :: zemps ! surface freshwater flux REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrtrd CHARACTER (len=22) :: charout !!---------------------------------------------------------------------- IF( kt == nit000 ) THEN IF(lwp) WRITE(numout,*) IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' IF(lwp) WRITE(numout,*) '~~~~~~~ ' ENDIF IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) #if ! defined key_offline ! Concentration dilution effect on tracer due to evaporation, precipitation, and river runoff IF( lk_vvl ) THEN ! volume variable zemps(:,:) = emps(:,:) - emp(:,:) !!ch zemps(:,:) = 0. ELSE ! linear free surface IF( ln_rnf ) THEN ; zemps(:,:) = emps(:,:) - rnf(:,:) ! E-P-R ELSE ; zemps(:,:) = emps(:,:) ENDIF ENDIF #else ! emps in dynamical files contains emps - rnf IF( lk_vvl ) THEN ; zemps(:,:) = 0. ! No concentration/dilution effect ELSE ; zemps(:,:) = emps(:,:) ! emps -rnf ENDIF #endif ! 0. initialization zsrau = 1. / rau0 DO jn = 1, jptra ! IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) ! save trends ! ! add the trend to the general tracer trend DO jj = 2, jpj DO ji = fs_2, fs_jpim1 ! vector opt. zse3t = 1. / fse3t(ji,jj,1) tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zemps(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t END DO END DO IF( l_trdtrc ) THEN ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) CALL trd_tra( kt, 'TRC', jn, jptra_trd_nsr, ztrtrd ) END IF ! ! =========== END DO ! tracer loop ! ! =========== IF( l_trdtrc ) DEALLOCATE( ztrtrd ) IF( ln_ctl ) THEN WRITE(charout, FMT="('sbc ')") ; CALL prt_ctl_trc_info(charout) CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) ENDIF END SUBROUTINE trc_sbc #else !!---------------------------------------------------------------------- !! Dummy module : NO passive tracer !!---------------------------------------------------------------------- CONTAINS SUBROUTINE trc_sbc (kt) ! Empty routine INTEGER, INTENT(in) :: kt WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt END SUBROUTINE trc_sbc #endif !!====================================================================== END MODULE trcsbc