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_crs.F90 in branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

source: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc_crs.F90 @ 5601

Last change on this file since 5601 was 5601, checked in by cbricaud, 9 years ago

commit changes/bugfix/... for crs ; ok with time-splitting/fixed volume

  • Property svn:executable set to *
File size: 5.8 KB
Line 
1MODULE trcsbc_crs
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!cbr   USE crs
24
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC   trc_sbc_crs   ! routine called by step.F90
29
30   !! * Substitutions
31#  include "top_substitute.h90"
32   !!----------------------------------------------------------------------
33   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
34   !! $Id: trcsbc.F90 3294 2012-01-28 16:44:18Z rblod $
35   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
36   !!----------------------------------------------------------------------
37CONTAINS
38
39   SUBROUTINE trc_sbc_crs ( kt )
40      !!----------------------------------------------------------------------
41      !!                  ***  ROUTINE trc_sbc  ***
42      !!                   
43      !! ** Purpose :   Compute the tracer surface boundary condition trend of
44      !!      (concentration/dilution effect) and add it to the general
45      !!       trend of tracer equations.
46      !!
47      !! ** Method :
48      !!      * concentration/dilution effect:
49      !!            The surface freshwater flux modify the ocean volume
50      !!         and thus the concentration of a tracer as :
51      !!            tra = tra + emp * trn / e3t   for k=1
52      !!         where emp, the surface freshwater budget (evaporation minus
53      !!         precipitation minus runoff) given in kg/m2/s is divided
54      !!         by 1035 kg/m3 (density of ocean water) to obtain m/s.
55      !!
56      !! ** Action  : - Update the 1st level of tra with the trend associated
57      !!                with the tracer surface boundary condition
58      !!
59      !!----------------------------------------------------------------------
60      !
61      INTEGER, INTENT( in ) ::   kt          ! ocean time-step index
62      !
63      INTEGER  ::   ji, jj, jn           ! dummy loop indices
64      REAL(wp) ::   zsrau, zse3t   ! temporary scalars
65      CHARACTER (len=22) :: charout
66      REAL(wp), POINTER, DIMENSION(:,:  ) :: zsfx
67      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd
68      !!---------------------------------------------------------------------
69      !
70      IF( nn_timing == 1 )  CALL timing_start('trc_sbc')
71      !
72      ! Allocate temporary workspace
73                      CALL wrk_alloc( jpi, jpj,      zsfx  )
74      IF( l_trdtrc )  CALL wrk_alloc( jpi, jpj, jpk, ztrtrd )
75
76      IF( kt == nittrc000 ) THEN
77         IF(lwp) WRITE(numout,*)
78         IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition'
79         IF(lwp) WRITE(numout,*) '~~~~~~~ '
80      ENDIF
81
82     IF( .NOT. lk_offline .AND. lk_vvl ) THEN  ! online coupling with vvl
83         zsfx(:,:) = 0._wp
84      ELSE                                      ! online coupling free surface or offline with free surface
85         zsfx(:,:) = emp(:,:)
86      ENDIF
87
88      ! 0. initialization
89      zsrau = 1. / rau0
90      DO jn = 1, jptra
91         !
92         IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)  ! save trends
93         !                                             ! add the trend to the general tracer trend
94         DO jj = 2, jpj
95            DO ji = fs_2, fs_jpim1   ! vector opt.
96               zse3t = 1. / fse3t(ji,jj,1)
97               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zsfx(ji,jj) *  zsrau * trn(ji,jj,1,jn) * zse3t
98            END DO
99         END DO
100         
101         IF( l_trdtrc ) THEN
102            ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:)
103            CALL trd_tra( kt, 'TRC', jn, jptra_nsr, ztrtrd )
104         END IF
105         !                                                       ! ===========
106      END DO                                                     ! tracer loop
107      !                                                          ! ===========
108      IF( ln_ctl )   THEN
109         WRITE(charout, FMT="('sbc ')") ;  CALL prt_ctl_trc_info(charout)
110                                           CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
111      ENDIF
112                      CALL wrk_dealloc( jpi, jpj,      zsfx  )
113      IF( l_trdtrc )  CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd )
114      !
115      IF( nn_timing == 1 )  CALL timing_stop('trc_sbc')
116      !
117   END SUBROUTINE trc_sbc_crs
118
119#else
120   !!----------------------------------------------------------------------
121   !!   Dummy module :                      NO passive tracer
122   !!----------------------------------------------------------------------
123CONTAINS
124   SUBROUTINE trc_sbc_crs (kt)              ! Empty routine
125      INTEGER, INTENT(in) :: kt
126      WRITE(*,*) 'trc_sbc: You should not have seen this print! error?', kt
127   END SUBROUTINE trc_sbc_crs
128#endif
129   
130   !!======================================================================
131END MODULE trcsbc_crs
Note: See TracBrowser for help on using the repository browser.