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

source: branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90 @ 3681

Last change on this file since 3681 was 3681, checked in by cetlod, 11 years ago

dev_MERGE_2012: minor bugs corrections, see ticket #1028

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