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 1792 for trunk/NEMO/OPA_SRC/DYN/divcur.F90 – NEMO

Ignore:
Timestamp:
2009-12-21T16:05:15+01:00 (14 years ago)
Author:
rblod
Message:

Add fake agrif_root function, see ticket #628

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DYN/divcur.F90

    r1152 r1792  
    123123 
    124124#if defined key_obc 
    125 #if defined key_agrif 
    126          IF (Agrif_Root() ) THEN 
    127 #endif 
    128          ! open boundaries (div must be zero behind the open boundary) 
    129          !  mpp remark: The zeroing of hdivn can probably be extended to 1->jpi/jpj for the correct row/column 
    130          IF( lp_obc_east  )   hdivn(nie0p1:nie1p1,nje0  :nje1  ,jk) = 0.e0      ! east 
    131          IF( lp_obc_west  )   hdivn(niw0  :niw1  ,njw0  :njw1  ,jk) = 0.e0      ! west 
    132          IF( lp_obc_north )   hdivn(nin0  :nin1  ,njn0p1:njn1p1,jk) = 0.e0      ! north 
    133          IF( lp_obc_south )   hdivn(nis0  :nis1  ,njs0  :njs1  ,jk) = 0.e0      ! south 
    134 #if defined key_agrif 
    135          ENDIF 
    136 #endif 
     125         IF( Agrif_Root() ) THEN 
     126            ! open boundaries (div must be zero behind the open boundary) 
     127            !  mpp remark: The zeroing of hdivn can probably be extended to 1->jpi/jpj for the correct row/column 
     128            IF( lp_obc_east  )   hdivn(nie0p1:nie1p1,nje0  :nje1  ,jk) = 0.e0      ! east 
     129            IF( lp_obc_west  )   hdivn(niw0  :niw1  ,njw0  :njw1  ,jk) = 0.e0      ! west 
     130            IF( lp_obc_north )   hdivn(nin0  :nin1  ,njn0p1:njn1p1,jk) = 0.e0      ! north 
     131            IF( lp_obc_south )   hdivn(nis0  :nis1  ,njs0  :njs1  ,jk) = 0.e0      ! south 
     132         ENDIF 
    137133#endif          
    138134#if defined key_bdy 
    139135         ! unstructured open boundaries (div must be zero behind the open boundary) 
    140136         DO jj = 1, jpj 
    141            DO ji = 1, jpi 
    142              hdivn(ji,jj,jk)=hdivn(ji,jj,jk)*bdytmask(ji,jj) 
    143            END DO 
     137            DO ji = 1, jpi 
     138               hdivn(ji,jj,jk)=hdivn(ji,jj,jk)*bdytmask(ji,jj) 
     139            END DO 
    144140         END DO 
    145141#endif          
    146 #if defined key_agrif 
    147          if ( .NOT. AGRIF_Root() ) then 
    148            IF ((nbondi ==  1).OR.(nbondi == 2)) hdivn(nlci-1 , :     ,jk) = 0.e0      ! east 
    149            IF ((nbondi == -1).OR.(nbondi == 2)) hdivn(2      , :     ,jk) = 0.e0      ! west 
    150            IF ((nbondj ==  1).OR.(nbondj == 2)) hdivn(:      ,nlcj-1 ,jk) = 0.e0      ! north 
    151            IF ((nbondj == -1).OR.(nbondj == 2)) hdivn(:      ,2      ,jk) = 0.e0      ! south 
    152          endif 
    153 #endif     
     142         IF( .NOT. AGRIF_Root() ) THEN 
     143            IF ((nbondi ==  1).OR.(nbondi == 2)) hdivn(nlci-1 , :     ,jk) = 0.e0      ! east 
     144            IF ((nbondi == -1).OR.(nbondi == 2)) hdivn(2      , :     ,jk) = 0.e0      ! west 
     145            IF ((nbondj ==  1).OR.(nbondj == 2)) hdivn(:      ,nlcj-1 ,jk) = 0.e0      ! north 
     146            IF ((nbondj == -1).OR.(nbondj == 2)) hdivn(:      ,2      ,jk) = 0.e0      ! south 
     147         ENDIF 
    154148 
    155149         !                                             ! -------- 
     
    341335 
    342336#if defined key_obc 
    343 #if defined key_agrif 
    344          IF ( Agrif_Root() ) THEN 
    345 #endif 
    346          ! open boundaries (div must be zero behind the open boundary) 
    347          !  mpp remark: The zeroing of hdivn can probably be extended to 1->jpi/jpj for the correct row/column 
    348          IF( lp_obc_east  )   hdivn(nie0p1:nie1p1,nje0  :nje1  ,jk) = 0.e0      ! east 
    349          IF( lp_obc_west  )   hdivn(niw0  :niw1  ,njw0  :njw1  ,jk) = 0.e0      ! west 
    350          IF( lp_obc_north )   hdivn(nin0  :nin1  ,njn0p1:njn1p1,jk) = 0.e0      ! north 
    351          IF( lp_obc_south )   hdivn(nis0  :nis1  ,njs0  :njs1  ,jk) = 0.e0      ! south 
    352 #if defined key_agrif 
    353          ENDIF 
    354 #endif 
     337         IF( Agrif_Root() ) THEN 
     338            ! open boundaries (div must be zero behind the open boundary) 
     339            !  mpp remark: The zeroing of hdivn can probably be extended to 1->jpi/jpj for the correct row/column 
     340            IF( lp_obc_east  )   hdivn(nie0p1:nie1p1,nje0  :nje1  ,jk) = 0.e0      ! east 
     341            IF( lp_obc_west  )   hdivn(niw0  :niw1  ,njw0  :njw1  ,jk) = 0.e0      ! west 
     342            IF( lp_obc_north )   hdivn(nin0  :nin1  ,njn0p1:njn1p1,jk) = 0.e0      ! north 
     343            IF( lp_obc_south )   hdivn(nis0  :nis1  ,njs0  :njs1  ,jk) = 0.e0      ! south 
     344         ENDIF 
    355345#endif          
    356346#if defined key_bdy 
     
    362352         END DO 
    363353#endif         
    364 #if defined key_agrif 
    365          if ( .NOT. AGRIF_Root() ) then 
     354         IF( .NOT. AGRIF_Root() ) THEN 
    366355            IF ((nbondi ==  1).OR.(nbondi == 2)) hdivn(nlci-1 , :     ,jk) = 0.e0      ! east 
    367356            IF ((nbondi == -1).OR.(nbondi == 2)) hdivn(2      , :     ,jk) = 0.e0      ! west 
    368357            IF ((nbondj ==  1).OR.(nbondj == 2)) hdivn(:      ,nlcj-1 ,jk) = 0.e0      ! north 
    369358            IF ((nbondj == -1).OR.(nbondj == 2)) hdivn(:      ,2      ,jk) = 0.e0      ! south 
    370          endif 
    371 #endif     
     359         ENDIF 
    372360 
    373361         !                                             ! -------- 
Note: See TracChangeset for help on using the changeset viewer.