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

Ignore:
Timestamp:
2007-03-07T14:28:16+01:00 (17 years ago)
Author:
opalod
Message:

nemo_v2_update_008:RB: clean agrif routines and add sponge layer coefficient in namelist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/NST_SRC/agrif_top_update.F90

    r628 r636  
    11#define TWO_WAY 
    22 
    3       Module agrif_top_update 
     3MODULE agrif_top_update 
     4 
    45#if defined key_agrif && defined key_passivetrc 
    5       USE par_oce 
    6       USE oce 
    7       USE dom_oce 
    8       USE trc 
    9       USE sms 
    10        
    11       Integer, Parameter :: nbclineupdate = 3 
    12       Integer :: nbcline 
     6   USE par_oce 
     7   USE oce 
     8   USE dom_oce 
     9   USE trcstp 
     10   USE sms 
    1311 
    14       Contains 
     12   IMPLICIT NONE 
     13   PRIVATE 
    1514 
    16       Subroutine Agrif_Update_Trc( kt ) 
    17 ! 
    18 !     Modules used: 
    19 ! 
     15   PUBLIC Agrif_Update_Trc 
    2016 
    21       implicit none 
    22 ! 
    23 !     Declarations: 
    24       INTEGER :: kt 
    25 ! 
    26 ! 
    27 !     Variables 
    28 ! 
    29       Real :: tabtemp(jpi,jpj,jpk,jptra) 
    30 ! 
    31 !     Begin 
    32 ! 
     17   INTEGER, PARAMETER :: nbclineupdate = 3 
     18   INTEGER :: nbcline 
    3319 
    34       IF ((Agrif_NbStepint() .NE. (Agrif_irhot()-1)).AND.(kt /= 0)) Return 
    35 #if defined TWO_WAYxiv8 
     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 
    3633      Agrif_UseSpecialValueInUpdate = .TRUE. 
    3734      Agrif_SpecialValueFineGrid = 0. 
    38       IF (mod(nbcline,nbclineupdate) == 0) THEN 
    39       Call Agrif_Update_Variable(tabtemp,trn, procname=updateTRC) 
     35  
     36     IF (MOD(nbcline,nbclineupdate) == 0) THEN 
     37         CALL Agrif_Update_Variable(ztra,trn, procname=updateTRC) 
    4038      ELSE 
    41       Call Agrif_Update_Variable(tabtemp,trn,locupdate=(/0,2/), procname=updateTRC) 
     39         CALL Agrif_Update_Variable(ztra,trn,locupdate=(/0,2/), procname=updateTRC) 
    4240      ENDIF 
    43  
    4441 
    4542      Agrif_UseSpecialValueInUpdate = .FALSE. 
    4643#endif 
    4744 
    48       End subroutine Agrif_Update_Trc 
     45   END SUBROUTINE Agrif_Update_Trc 
    4946 
     47   SUBROUTINE updateTRC(tabres,i1,i2,j1,j2,k1,k2,before) 
     48      !!--------------------------------------------- 
     49      !!   *** ROUTINE UpdateTrc *** 
     50      !!--------------------------------------------- 
     51#  include "domzgr_substitute.h90" 
    5052 
    51        subroutine updateTRC(tabres,i1,i2,j1,j2,k1,k2,before) 
    52        Implicit none 
    53 #  include "domzgr_substitute.h90" 
    54        integer i1,i2,j1,j2,k1,k2 
    55        integer ji,jj,jk,jn 
    56        real,dimension(i1:i2,j1:j2,k1:k2,jptra) :: tabres 
    57        LOGICAL :: before 
     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 
    5858 
    59     DO jn=1, jptra   
    60        IF (before) THEN 
    61         
    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 
    68          ENDDO 
    69           
    70        ELSE 
     59      DO jn=1, jptra   
    7160 
    72          DO jk=k1,k2 
    73            DO jj=j1,j2 
    74              DO ji=i1,i2 
    75                IF (tabres(ji,jj,jk,jn).NE.0.) THEN 
    76                trn(ji,jj,jk,jn) = tabres(ji,jj,jk,jn) * tmask(ji,jj,jk) 
    77                ENDIF 
    78              ENDDO 
     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 
    7968            ENDDO 
    80           ENDDO 
    81        ENDIF 
     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 
    8280 
    83     END DO 
    84   
    85        end subroutine updateTRC 
     81      END DO 
    8682 
    87         
     83   END SUBROUTINE updateTRC 
    8884 
    89         
    9085#else 
    91        CONTAINS 
    92        subroutine agrif_top_update_empty 
    93        end subroutine agrif_top_update_empty 
     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 
    9493#endif 
    95        End Module agrif_top_update 
     94END Module agrif_top_update 
Note: See TracChangeset for help on using the changeset viewer.