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.
agrif_top_update.F90 in trunk/NEMO/NST_SRC – NEMO

source: trunk/NEMO/NST_SRC/agrif_top_update.F90 @ 1206

Last change on this file since 1206 was 1206, checked in by rblod, 16 years ago

Suppress key_passive_trc => key_top

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1#define TWO_WAY
2
3MODULE agrif_top_update
4
5#if defined key_agrif && defined key_top
6   USE par_oce
7   USE oce
8   USE dom_oce
9   USE agrif_oce
10   USE trcstp
11   USE sms
12
13   IMPLICIT NONE
14   PRIVATE
15
16   PUBLIC Agrif_Update_Trc
17
18   INTEGER :: nbcline
19
20   !!----------------------------------------------------------------------
21   !!   OPA 9.0 , LOCEAN-IPSL (2006)
22   !! $Id$
23   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
24   !!----------------------------------------------------------------------
25
26   CONTAINS
27
28   SUBROUTINE Agrif_Update_Trc( kt )
29      !!---------------------------------------------
30      !!   *** ROUTINE Agrif_Update_Trc ***
31      !!---------------------------------------------
32      INTEGER, INTENT(in) :: kt
33 
34      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: ztra
35
36      IF ((Agrif_NbStepint() .NE. (Agrif_irhot()-1)).AND.(kt /= 0)) RETURN
37
38#if defined TWO_WAY
39      Agrif_UseSpecialValueInUpdate = .TRUE.
40      Agrif_SpecialValueFineGrid = 0.
41 
42     IF (MOD(nbcline,nbclineupdate) == 0) THEN
43         CALL Agrif_Update_Variable(ztra,trn, procname=updateTRC)
44      ELSE
45         CALL Agrif_Update_Variable(ztra,trn,locupdate=(/0,2/), procname=updateTRC)
46      ENDIF
47
48      Agrif_UseSpecialValueInUpdate = .FALSE.
49#endif
50
51   END SUBROUTINE Agrif_Update_Trc
52
53   SUBROUTINE updateTRC(tabres,i1,i2,j1,j2,k1,k2,before)
54      !!---------------------------------------------
55      !!   *** ROUTINE UpdateTrc ***
56      !!---------------------------------------------
57#  include "domzgr_substitute.h90"
58
59      INTEGER, INTENT(in) :: i1,i2,j1,j2,k1,k2
60      REAL, DIMENSION(i1:i2,j1:j2,k1:k2,jptra), INTENT(inout) :: tabres
61      LOGICAL, INTENT(in) :: before
62   
63      INTEGER :: ji,jj,jk,jn
64
65      DO jn=1, jptra 
66
67         IF (before) THEN
68            DO jk=k1,k2
69               DO jj=j1,j2
70                  DO ji=i1,i2
71                     tabres(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
72                  ENDDO
73               ENDDO
74            ENDDO
75         ELSE
76            DO jk=k1,k2
77               DO jj=j1,j2
78                  DO ji=i1,i2
79                     IF (tabres(ji,jj,jk,jn).NE.0.) THEN
80                        trn(ji,jj,jk,jn) = tabres(ji,jj,jk,jn) * tmask(ji,jj,jk)
81                     ENDIF
82                  ENDDO
83               ENDDO
84            ENDDO
85         ENDIF
86
87      END DO
88
89   END SUBROUTINE updateTRC
90
91#else
92CONTAINS
93   SUBROUTINE agrif_top_update_empty
94      !!---------------------------------------------
95      !!   *** ROUTINE agrif_Top_update_empty ***
96      !!---------------------------------------------
97      WRITE(*,*)  'agrif_top_update : You should not have seen this print! error?'
98   END SUBROUTINE agrif_top_update_empty
99#endif
100END Module agrif_top_update
Note: See TracBrowser for help on using the repository browser.