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

source: trunk/NEMO/TOP_SRC/TRP/trcsbc.F90 @ 340

Last change on this file since 340 was 334, checked in by opalod, 19 years ago

nemo_v1_update_022 : CE + RB + CT : add print control possibility

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 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   !!   OPA 9.0 , LODYC-IPSL (2003)
26   !!----------------------------------------------------------------------
27
28CONTAINS
29
30   SUBROUTINE trc_sbc ( kt )
31      !!----------------------------------------------------------------------
32      !!                  ***  ROUTINE trc_sbc  ***
33      !!                   
34      !! ** Purpose :   Compute the tracer surface boundary condition trend of
35      !!      (concentration/dilution effect) and add it to the general
36      !!       trend of tracer equations.
37      !!
38      !! ** Method :
39      !!      * concentration/dilution effect:
40      !!            The surface freshwater flux modify the ocean volume
41      !!         and thus the concentration of a tracer as :
42      !!            tra = tra + emp * trn / e3t   for k=1
43      !!         where emp, the surface freshwater budget (evaporation minus
44      !!         precipitation minus runoff) given in kg/m2/s is divided
45      !!         by 1000 kg/m3 (density of plain water) to obtain m/s.
46      !!
47      !! ** Action  : - Update the 1st level of tra with the trend associated
48      !!                with the tracer surface boundary condition
49      !!
50      !! History :
51      !!   8.2  !  98-10  (G. Madec, G. Roullet, M. Imbard)  Original code
52      !!   8.2  !  01-02  (D. Ludicone)  sea ice and free surface
53      !!   8.5  !  02-06  (G. Madec)  F90: Free form and module
54      !!   9.0  !  04-03  (C. Ethe)  adapted for passive tracers
55      !!----------------------------------------------------------------------
56      !! * Arguments
57      INTEGER, INTENT( in ) ::   kt          ! ocean time-step index
58
59      !! * Local declarations
60      INTEGER  ::   ji, jj, jn           ! dummy loop indices
61      REAL(wp) ::   ztra, zsrau, zse3t   ! temporary scalars
62      CHARACTER (len=22) :: charout
63      !!----------------------------------------------------------------------
64
65      IF( kt == nittrc000 ) THEN
66         IF(lwp) WRITE(numout,*)
67         IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition'
68         IF(lwp) WRITE(numout,*) '~~~~~~~ '
69      ENDIF
70
71      ! 0. initialization
72      zsrau = 1. / rauw
73#if ! defined key_s_coord
74      zse3t = 1. / fse3t(1,1,1)
75#endif
76
77      DO jn = 1, jptra
78         ! 1. Concentration dillution effect on tra
79         DO jj = 2, jpj
80            DO ji = fs_2, fs_jpim1   ! vector opt.
81#if defined key_s_coord
82               zse3t = 1. / fse3t(ji,jj,1)
83#endif
84               ! concent./dilut. effect
85               ztra = emps(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t * tmask(ji,jj,1)
86               
87               ! add the trend to the general tracer trend
88               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + ztra
89            END DO
90         END DO
91         
92      END DO
93
94      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
95         WRITE(charout, FMT="('sbc')")
96         CALL prt_ctl_trc_info(charout)
97         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd')
98      ENDIF
99
100   END SUBROUTINE trc_sbc
101
102#else
103   !!----------------------------------------------------------------------
104   !!   Dummy module :                      NO passive tracer
105   !!----------------------------------------------------------------------
106CONTAINS
107   SUBROUTINE trc_sbc (kt)              ! Empty routine
108      INTEGER, INTENT(in) :: kt
109      WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt
110   END SUBROUTINE trc_sbc
111#endif
112   
113   !!======================================================================
114END MODULE trcsbc
Note: See TracBrowser for help on using the repository browser.