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

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

Add svn Id (first try), see ticket #210

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