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

Last change on this file since 1271 was 1271, checked in by rblod, 15 years ago

Addapt AGRIF routines to the new TOP organization, clean some routines and add a sponge layer for passive tracers, see ticket #293

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