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 @ 719

Last change on this file since 719 was 719, checked in by ctlod, 17 years ago

get back to the nemo_v2_3 version for trunk

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