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.
trcnxt.F90 in trunk/NEMO/TOP_SRC/TRP – NEMO

source: trunk/NEMO/TOP_SRC/TRP/trcnxt.F90 @ 565

Last change on this file since 565 was 501, checked in by opalod, 18 years ago

nemo_v1_update_068:CE:re-organization of coordinate definition and scale factors

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 6.6 KB
Line 
1MODULE trcnxt
2   !!======================================================================
3   !!                       ***  MODULE  trcnxt  ***
4   !! Ocean passive tracers:  time stepping on passives tracers
5   !!======================================================================
6#if defined key_passivetrc   
7   !!----------------------------------------------------------------------
8   !!   trc_nxt     : time stepping on passive tracers
9   !!----------------------------------------------------------------------
10   !! * Modules used
11   USE oce_trc         ! ocean dynamics and tracers variables
12   USE trc             ! ocean passive tracers variables
13   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
14   USE trctrp_lec      ! pasive tracers transport
15   USE prtctl_trc      ! Print control for debbuging
16
17   IMPLICIT NONE
18   PRIVATE
19
20   !! * Routine accessibility
21   PUBLIC trc_nxt          ! routine called by step.F90
22   !!----------------------------------------------------------------------
23   !!   TOP 1.0 , LOCEAN-IPSL (2005)
24   !! $Header$
25   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
26   !!----------------------------------------------------------------------
27
28CONTAINS
29
30   SUBROUTINE trc_nxt( kt )
31      !!----------------------------------------------------------------------
32      !!                   ***  ROUTINE trcnxt  ***
33      !!
34      !! ** Purpose :   Compute the passive tracers fields at the
35      !!      next time-step from their temporal trends and swap the fields.
36      !!
37      !! ** Method  :   Apply lateral boundary conditions on (ua,va) through
38      !!      call to lbc_lnk routine
39      !!   default:
40      !!      arrays swap
41      !!         (trn) = (tra) ; (tra) = (0,0)
42      !!         (trb) = (trn)
43      !!
44      !!   For Arakawa or TVD Scheme :
45      !!      A Asselin time filter applied on now tracers (trn) to avoid
46      !!      the divergence of two consecutive time-steps and tr arrays
47      !!      to prepare the next time_step:
48      !!         (trb) = (trn) + atfp [ (trb) + (tra) - 2 (trn) ]
49      !!         (trn) = (tra) ; (tra) = (0,0)
50      !!
51      !!
52      !! ** Action  : - update trb, trn
53      !!
54      !! History :
55      !!   7.0  !  91-11  (G. Madec)  Original code
56      !!        !  93-03  (M. Guyon)  symetrical conditions
57      !!        !  95-02  (M. Levy)   passive tracers
58      !!        !  96-02  (G. Madec & M. Imbard)  opa release 8.0
59      !!   8.0  !  96-04  (A. Weaver)  Euler forward step
60      !!   8.2  !  99-02  (G. Madec, N. Grima)  semi-implicit pressure grad.
61      !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
62      !!        !  02-11  (C. Talandier, A-M Treguier) Open boundaries
63      !!   9.0  !  04-03  (C. Ethe) passive tracers
64      !!----------------------------------------------------------------------
65      !! * Arguments
66      INTEGER, INTENT( in ) ::   kt         ! ocean time-step index
67      !! * Local declarations
68      INTEGER ::   ji, jj, jk,jn   ! dummy loop indices
69      REAL(wp) ::   zfact, ztra    ! temporary scalar
70      CHARACTER (len=22) :: charout
71      !!----------------------------------------------------------------------
72
73      IF( kt == nittrc000 .AND. lwp ) THEN
74         WRITE(numout,*)
75         WRITE(numout,*) 'trc_nxt : time stepping on passive tracers'
76      ENDIF
77
78
79      DO jn = 1, jptra
80
81         ! 0. Lateral boundary conditions on tra (T-point, unchanged sign)
82         ! ---------------------------------============
83         CALL lbc_lnk( tra(:,:,:,jn), 'T', 1. )   
84         
85         !                                                ! ===============
86         DO jk = 1, jpk                                   ! Horizontal slab
87            !                                             ! ===============
88            ! 1. Leap-frog scheme (only in explicit case, otherwise the
89            ! -------------------  time stepping is already done in trczdf)
90            IF( l_trczdf_exp .AND. ( ln_trcadv_cen2 .OR. ln_trcadv_tvd) ) THEN
91               zfact = 2. * rdttra(jk) * FLOAT(ndttrc) 
92               IF( neuler == 0 .AND. kt == nittrc000 ) zfact = rdttra(jk) * FLOAT(ndttrc) 
93               tra(:,:,jk,jn) = ( trb(:,:,jk,jn) + zfact * tra(:,:,jk,jn) ) * tmask(:,:,jk)
94            ENDIF
95
96         END DO
97
98#if defined key_obc
99        CALL ctl_stop( '          Passive tracers and Open Boundary condition can not be used together ' &
100           &           '          Check in trc_nxt routine' )
101#endif
102
103         DO jk = 1, jpk 
104
105            ! 2. Time filter and swap of arrays
106            ! ---------------------------------
107            IF ( ln_trcadv_cen2 .OR. ln_trcadv_tvd  ) THEN
108
109               IF( neuler == 0 .AND. kt == nittrc000 ) THEN
110                  DO jj = 1, jpj
111                     DO ji = 1, jpi
112                        trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
113                        trn(ji,jj,jk,jn) = tra(ji,jj,jk,jn)
114                        tra(ji,jj,jk,jn) = 0.
115                     END DO
116                  END DO
117               ELSE
118                  DO jj = 1, jpj
119                     DO ji = 1, jpi
120                        trb(ji,jj,jk,jn) = atfp  * ( trb(ji,jj,jk,jn) + tra(ji,jj,jk,jn) ) + atfp1 * trn(ji,jj,jk,jn)
121                        trn(ji,jj,jk,jn) = tra(ji,jj,jk,jn)
122                        tra(ji,jj,jk,jn) = 0.
123                     END DO
124                  END DO
125               ENDIF
126
127            ELSE
128!  case of smolar scheme or muscl
129               DO jj = 1, jpj
130                  DO ji = 1, jpi
131                     trb(ji,jj,jk,jn) = tra(ji,jj,jk,jn)
132                     trn(ji,jj,jk,jn) = tra(ji,jj,jk,jn)
133                     tra(ji,jj,jk,jn) = 0.
134                  END DO
135               END DO
136
137            ENDIF
138            !                                             ! ===============
139         END DO                                           !   End of slab
140         !                                                ! ===============
141      END DO
142
143      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
144         WRITE(charout, FMT="('nxt')")
145         CALL prt_ctl_trc_info(charout)
146         CALL prt_ctl_trc(tab4d=trn, mask=tmask, clinfo=ctrcnm)
147      ENDIF
148
149
150   END SUBROUTINE trc_nxt
151
152#else
153   !!----------------------------------------------------------------------
154   !!   Default option                                         Empty module
155   !!----------------------------------------------------------------------
156CONTAINS
157   SUBROUTINE trc_nxt( kt ) 
158      INTEGER, INTENT(in) :: kt
159      WRITE(*,*) 'trc_nxt: You should not have seen this print! error?', kt
160   END SUBROUTINE trc_nxt
161#endif
162   !!======================================================================
163END MODULE trcnxt
Note: See TracBrowser for help on using the repository browser.