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 trunk/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

source: trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90 @ 3294

Last change on this file since 3294 was 3294, checked in by rblod, 12 years ago

Merge of 3.4beta into the trunk

  • Property svn:keywords set to Id
File size: 6.2 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 trdmod_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 minus runoff) 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(:,:  ) :: zemps
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,      zemps  )
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
82      IF( lk_offline ) THEN          ! emps in dynamical files contains emps - rnf
83         zemps(:,:) = emps(:,:) 
84      ELSE                           ! Concentration dilution effect on tracer due to evaporation, precipitation, and river runoff
85         IF( lk_vvl ) THEN                      ! volume variable
86            zemps(:,:) = emps(:,:) - emp(:,:)   
87!!ch         zemps(:,:) = 0.
88         ELSE                                   ! linear free surface
89            IF( ln_rnf ) THEN  ;  zemps(:,:) = emps(:,:) - rnf(:,:)   !  E-P-R
90            ELSE               ;  zemps(:,:) = emps(:,:)
91            ENDIF
92         ENDIF
93      ENDIF 
94
95      ! 0. initialization
96      zsrau = 1. / rau0
97      DO jn = 1, jptra
98         !
99         IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)  ! save trends
100         !                                             ! add the trend to the general tracer trend
101         DO jj = 2, jpj
102            DO ji = fs_2, fs_jpim1   ! vector opt.
103               zse3t = 1. / fse3t(ji,jj,1)
104               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zemps(ji,jj) *  zsrau * trn(ji,jj,1,jn) * zse3t
105            END DO
106         END DO
107         
108         IF( l_trdtrc ) THEN
109            ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:)
110            CALL trd_tra( kt, 'TRC', jn, jptra_trd_nsr, ztrtrd )
111         END IF
112         !                                                       ! ===========
113      END DO                                                     ! tracer loop
114      !                                                          ! ===========
115      IF( ln_ctl )   THEN
116         WRITE(charout, FMT="('sbc ')") ;  CALL prt_ctl_trc_info(charout)
117                                           CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
118      ENDIF
119                      CALL wrk_dealloc( jpi, jpj,      zemps  )
120      IF( l_trdtrc )  CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd )
121      !
122      IF( nn_timing == 1 )  CALL timing_stop('trc_sbc')
123      !
124   END SUBROUTINE trc_sbc
125
126#else
127   !!----------------------------------------------------------------------
128   !!   Dummy module :                      NO passive tracer
129   !!----------------------------------------------------------------------
130CONTAINS
131   SUBROUTINE trc_sbc (kt)              ! Empty routine
132      INTEGER, INTENT(in) :: kt
133      WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt
134   END SUBROUTINE trc_sbc
135#endif
136   
137   !!======================================================================
138END MODULE trcsbc
Note: See TracBrowser for help on using the repository browser.