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.
trcsbc.F90 in branches/UKMO/dev_r5785_SSS_obsoper/trunk/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

source: branches/UKMO/dev_r5785_SSS_obsoper/trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90 @ 7740

Last change on this file since 7740 was 7740, checked in by mattmartin, 7 years ago

Removed svn keywords.

  • Property svn:keywords set to Id
File size: 6.1 KB
Line 
1MODULE trcsbc
2   !!==============================================================================
3   !!                       ***  MODULE  trcsbc  ***
4   !! Ocean passive tracers:  surface boundary condition
5   !!======================================================================
6   !! History :  8.2  !  1998-10  (G. Madec, G. Roullet, M. Imbard)  Original code
7   !!            8.2  !  2001-02  (D. Ludicone)  sea ice and free surface
8   !!            8.5  !  2002-06  (G. Madec)  F90: Free form and module
9   !!            9.0  !  2004-03  (C. Ethe)  adapted for passive tracers
10   !!                 !  2006-08  (C. Deltel) Diagnose ML trends for passive tracers
11   !!==============================================================================
12#if defined key_top
13   !!----------------------------------------------------------------------
14   !!   'key_top'                                                TOP models
15   !!----------------------------------------------------------------------
16   !!   trc_sbc      : update the tracer trend at ocean surface
17   !!----------------------------------------------------------------------
18   USE oce_trc         ! ocean dynamics and active tracers variables
19   USE trc             ! ocean  passive tracers variables
20   USE prtctl_trc      ! Print control for debbuging
21   USE trd_oce
22   USE trdtra
23
24   IMPLICIT NONE
25   PRIVATE
26
27   PUBLIC   trc_sbc   ! routine called by step.F90
28
29   !! * Substitutions
30#  include "top_substitute.h90"
31   !!----------------------------------------------------------------------
32   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
33   !! $Id$
34   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
35   !!----------------------------------------------------------------------
36CONTAINS
37
38   SUBROUTINE trc_sbc ( kt )
39      !!----------------------------------------------------------------------
40      !!                  ***  ROUTINE trc_sbc  ***
41      !!                   
42      !! ** Purpose :   Compute the tracer surface boundary condition trend of
43      !!      (concentration/dilution effect) and add it to the general
44      !!       trend of tracer equations.
45      !!
46      !! ** Method :
47      !!      * concentration/dilution effect:
48      !!            The surface freshwater flux modify the ocean volume
49      !!         and thus the concentration of a tracer as :
50      !!            tra = tra + emp * trn / e3t   for k=1
51      !!         where emp, the surface freshwater budget (evaporation minus
52      !!         precipitation ) given in kg/m2/s is divided
53      !!         by 1035 kg/m3 (density of ocean water) to obtain m/s.
54      !!
55      !! ** Action  : - Update the 1st level of tra with the trend associated
56      !!                with the tracer surface boundary condition
57      !!
58      !!----------------------------------------------------------------------
59      !
60      INTEGER, INTENT( in ) ::   kt          ! ocean time-step index
61      !
62      INTEGER  ::   ji, jj, jn           ! dummy loop indices
63      REAL(wp) ::   zsrau, zse3t   ! temporary scalars
64      CHARACTER (len=22) :: charout
65      REAL(wp), POINTER, DIMENSION(:,:  ) :: zsfx
66      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd
67      !!---------------------------------------------------------------------
68      !
69      IF( nn_timing == 1 )  CALL timing_start('trc_sbc')
70      !
71      ! Allocate temporary workspace
72                      CALL wrk_alloc( jpi, jpj,      zsfx   )
73      IF( l_trdtrc )  CALL wrk_alloc( jpi, jpj, jpk, ztrtrd )
74
75      IF( kt == nittrc000 ) THEN
76         IF(lwp) WRITE(numout,*)
77         IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition'
78         IF(lwp) WRITE(numout,*) '~~~~~~~ '
79      ENDIF
80
81      ! Coupling online : river runoff is added to the horizontal divergence (hdivn) in the subroutine sbc_rnf_div
82      ! one only consider the concentration/dilution effect due to evaporation minus precipitation + freezing/melting of sea-ice
83      ! Coupling offline : runoff are in emp which contains E-P-R
84      !
85      IF( .NOT. lk_offline .AND. lk_vvl ) THEN  ! online coupling with vvl
86         zsfx(:,:) = 0._wp
87      ELSE                                      ! online coupling free surface or offline with free surface
88         zsfx(:,:) = emp(:,:)
89      ENDIF
90
91      ! 0. initialization
92      zsrau = 1. / rau0
93      DO jn = 1, jptra
94         !
95         IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)  ! save trends
96         !                                             ! add the trend to the general tracer trend
97         DO jj = 2, jpj
98            DO ji = fs_2, fs_jpim1   ! vector opt.
99               zse3t = 1. / fse3t(ji,jj,1)
100               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zsfx(ji,jj) *  zsrau * trn(ji,jj,1,jn) * zse3t
101            END DO
102         END DO
103         
104         IF( l_trdtrc ) THEN
105            ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:)
106            CALL trd_tra( kt, 'TRC', jn, jptra_nsr, ztrtrd )
107         END IF
108         !                                                       ! ===========
109      END DO                                                     ! tracer loop
110      !                                                          ! ===========
111      IF( ln_ctl )   THEN
112         WRITE(charout, FMT="('sbc ')") ;  CALL prt_ctl_trc_info(charout)
113                                           CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
114      ENDIF
115                      CALL wrk_dealloc( jpi, jpj,      zsfx   )
116      IF( l_trdtrc )  CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd )
117      !
118      IF( nn_timing == 1 )  CALL timing_stop('trc_sbc')
119      !
120   END SUBROUTINE trc_sbc
121
122#else
123   !!----------------------------------------------------------------------
124   !!   Dummy module :                      NO passive tracer
125   !!----------------------------------------------------------------------
126CONTAINS
127   SUBROUTINE trc_sbc (kt)              ! Empty routine
128      INTEGER, INTENT(in) :: kt
129      WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt
130   END SUBROUTINE trc_sbc
131#endif
132   
133   !!======================================================================
134END MODULE trcsbc
Note: See TracBrowser for help on using the repository browser.