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 tags/nemo_v2_3/NEMO/TOP_SRC/TRP – NEMO

source: tags/nemo_v2_3/NEMO/TOP_SRC/TRP/trcsbc.F90 @ 739

Last change on this file since 739 was 739, checked in by cetlod, 16 years ago

Update modules for passive tracers transport trends computation, see ticket:13

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.9 KB
Line 
1MODULE trcsbc
2   !!==============================================================================
3   !!                       ***  MODULE  trcsbc  ***
4   !! Ocean passive tracers:  surface boundary condition
5   !!==============================================================================
6#if defined key_passivetrc
7   !!----------------------------------------------------------------------
8   !!   trc_sbc      : update the tracer trend at ocean surface
9   !!----------------------------------------------------------------------
10   !! * Modules used
11   USE oce_trc             ! ocean dynamics and active tracers variables
12   USE trc                 ! ocean  passive tracers variables
13   USE prtctl_trc          ! Print control for debbuging
14
15
16   IMPLICIT NONE
17   PRIVATE
18
19   !! * Routine accessibility
20   PUBLIC trc_sbc              ! routine called by step.F90
21
22   !! * Substitutions
23#  include "passivetrc_substitute.h90"
24   !!----------------------------------------------------------------------
25   !!   TOP 1.0 , LOCEAN-IPSL (2005)
26   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/TRP/trcsbc.F90,v 1.10 2007/10/12 09:26:30 opalod Exp $
27   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
28   !!----------------------------------------------------------------------
29
30CONTAINS
31
32   SUBROUTINE trc_sbc ( kt )
33      !!----------------------------------------------------------------------
34      !!                  ***  ROUTINE trc_sbc  ***
35      !!                   
36      !! ** Purpose :   Compute the tracer surface boundary condition trend of
37      !!      (concentration/dilution effect) and add it to the general
38      !!       trend of tracer equations.
39      !!
40      !! ** Method :
41      !!      * concentration/dilution effect:
42      !!            The surface freshwater flux modify the ocean volume
43      !!         and thus the concentration of a tracer as :
44      !!            tra = tra + emp * trn / e3t   for k=1
45      !!         where emp, the surface freshwater budget (evaporation minus
46      !!         precipitation minus runoff) given in kg/m2/s is divided
47      !!         by 1000 kg/m3 (density of plain water) to obtain m/s.
48      !!
49      !! ** Action  : - Update the 1st level of tra with the trend associated
50      !!                with the tracer surface boundary condition
51      !!
52      !! History :
53      !!   8.2  !  98-10  (G. Madec, G. Roullet, M. Imbard)  Original code
54      !!   8.2  !  01-02  (D. Ludicone)  sea ice and free surface
55      !!   8.5  !  02-06  (G. Madec)  F90: Free form and module
56      !!   9.0  !  04-03  (C. Ethe)  adapted for passive tracers
57      !!----------------------------------------------------------------------
58      !! * Arguments
59      INTEGER, INTENT( in ) ::   kt          ! ocean time-step index
60
61      !! * Local declarations
62      INTEGER  ::   ji, jj, jn           ! dummy loop indices
63      REAL(wp) ::   ztra, zsrau, zse3t   ! temporary scalars
64      CHARACTER (len=22) :: charout
65      !!----------------------------------------------------------------------
66
67      IF( kt == nittrc000 ) THEN
68         IF(lwp) WRITE(numout,*)
69         IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition'
70         IF(lwp) WRITE(numout,*) '~~~~~~~ '
71      ENDIF
72
73      ! 0. initialization
74      zsrau = 1. / rauw
75      IF( .NOT. ln_sco )  zse3t = 1. / fse3t(1,1,1)
76#if defined key_trc_diatrd
77      DO jn = 1, jptra
78        IF (luttrd(jn)) trtrd(:,:,:,ikeep(jn),jpdiatrc) = 0.0
79      END DO
80#endif
81
82      DO jn = 1, jptra
83         ! 1. Concentration dillution effect on tra
84         DO jj = 2, jpj
85            DO ji = fs_2, fs_jpim1   ! vector opt.
86               IF( ln_sco ) zse3t = 1. / fse3t(ji,jj,1)
87               ! concent./dilut. effect
88               ztra = emps(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t * tmask(ji,jj,1)
89               
90               ! add the trend to the general tracer trend
91               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + ztra
92#if defined key_trc_diatrd
93               IF (luttrd(jn)) trtrd(ji,jj,1,ikeep(jn),jpdiatrc) = trtrd(ji,jj,1,jn,jpdiatrc)+ztra
94#endif
95            END DO
96         END DO
97         
98      END DO
99
100      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
101         WRITE(charout, FMT="('sbc')")
102         CALL prt_ctl_trc_info(charout)
103         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd')
104      ENDIF
105
106   END SUBROUTINE trc_sbc
107
108#else
109   !!----------------------------------------------------------------------
110   !!   Dummy module :                      NO passive tracer
111   !!----------------------------------------------------------------------
112CONTAINS
113   SUBROUTINE trc_sbc (kt)              ! Empty routine
114      INTEGER, INTENT(in) :: kt
115      WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt
116   END SUBROUTINE trc_sbc
117#endif
118   
119   !!======================================================================
120END MODULE trcsbc
Note: See TracBrowser for help on using the repository browser.