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 2031 for trunk – NEMO

Changeset 2031 for trunk


Ignore:
Timestamp:
2010-07-29T14:31:53+02:00 (14 years ago)
Author:
rblod
Message:

Fix issues with OBC and AGRIF, see ticket #688 and #692

Location:
trunk/NEMO
Files:
5 edited

Legend:

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

    r1876 r2031  
    101101#endif 
    102102 
    103       Call opa_init  ! Initializations of each fine grid 
    104       Call agrif_opa_init 
    105  
    106103      ! Specific fine grid Initializations 
    107104#if defined key_tradmp || defined key_esopa 
     
    113110      lk_obc = .FALSE. 
    114111#endif 
     112 
     113      Call opa_init  ! Initializations of each fine grid 
     114      Call agrif_opa_init 
     115 
    115116      ! 1. Declaration of the type of variable which have to be interpolated 
    116117      !--------------------------------------------------------------------- 
  • trunk/NEMO/OPA_SRC/OBC/obc_par.F90

    r1876 r2031  
    4747   !! open boundary parameter 
    4848   !!--------------------------------------------------------------------- 
    49    INTEGER ::     &  !: time dimension of the BCS fields on input 
     49   INTEGER, PARAMETER ::     &  !: time dimension of the BCS fields on input 
    5050      jptobc  =         2  
    5151   !! * EAST open boundary 
    52    LOGICAL ::     &  !: 
     52   LOGICAL, PARAMETER ::     &  !: 
    5353      lp_obc_east = .FALSE.     !: to active or not the East open boundary 
    54    INTEGER ::     &  
     54     INTEGER   & 
     55#if !defined key_agrif 
     56     , PARAMETER   &  
     57#endif 
     58    ::     &  
    5559      jpieob  = jpiglo-2,    &  !: i-localization of the East open boundary (must be ocean U-point) 
    5660      jpjed   =        2,    &  !: j-starting indice of the East open boundary (must be land T-point) 
     
    6064 
    6165   !! * WEST open boundary 
    62    LOGICAL ::     &  !: 
     66   LOGICAL, PARAMETER ::     &  !: 
    6367      lp_obc_west = .FALSE.     !: to active or not the West open boundary 
    64    INTEGER ::     &  !: 
     68     INTEGER   & 
     69#if !defined key_agrif 
     70     , PARAMETER   &  
     71#endif 
     72    ::     &  
    6573      jpiwob  =          2,    &  !: i-localization of the West open boundary (must be ocean U-point) 
    6674      jpjwd   =          2,    &  !: j-starting indice of the West open boundary (must be land T-point) 
     
    7078 
    7179   !! * NORTH open boundary 
    72    LOGICAL ::     &  !: 
     80   LOGICAL, PARAMETER ::     &  !: 
    7381      lp_obc_north = .FALSE.    !: to active or not the North open boundary 
    74    INTEGER ::     &  !: 
     82     INTEGER   & 
     83#if !defined key_agrif 
     84     , PARAMETER   &  
     85#endif 
     86    ::     &  
    7587      jpjnob  = jpjglo-2,    &  !: j-localization of the North open boundary (must be ocean V-point) 
    7688      jpind   =        2,    &  !: i-starting indice of the North open boundary (must be land T-point) 
     
    8092 
    8193   !! * SOUTH open boundary 
    82    LOGICAL ::     &  !: 
     94   LOGICAL, PARAMETER ::     &  !: 
    8395      lp_obc_south = .FALSE.    !: to active or not the South open boundary 
    84    INTEGER ::     &  !: 
     96     INTEGER   & 
     97#if !defined key_agrif 
     98     , PARAMETER   &  
     99#endif 
     100    ::     &  
    85101      jpjsob  =        2,    &  !: j-localization of the South open boundary (must be ocean V-point) 
    86102      jpisd   =        2,    &  !: i-starting indice of the South open boundary (must be land T-point) 
  • trunk/NEMO/OPA_SRC/OBC/obcdta.F90

    r1876 r2031  
    3030 
    3131  !! * Shared module variables 
     32!$AGRIF_DO_NOT_TREAT 
    3233  REAL(wp),  DIMENSION(2)              ::  zjcnes_obc   !  
    3334  REAL(wp),  DIMENSION(:), ALLOCATABLE :: ztcobc 
     35!$AGRIF_END_DO_NOT_TREAT 
    3436  REAL(wp) :: rdt_obc 
    3537  REAL(wp) :: zjcnes 
     
    469471       ENDIF 
    470472    ELSE 
    471 #if defined key_agrif 
    472        IF ( ASSOCIATED(ztcobc) ) DEALLOCATE ( ztcobc ) 
    473 #else 
    474473       IF ( ALLOCATED(ztcobc) ) DEALLOCATE ( ztcobc ) 
    475 #endif 
    476474       ALLOCATE (ztcobc(itobc)) 
    477475       DO ji=1,1   ! use a dummy loop to read ztcobc only once 
  • trunk/NEMO/OPA_SRC/SOL/solmat.F90

    r1876 r2031  
    8080      ENDIF 
    8181 
    82 #if defined key_dynspg_flt && ! defined key_obc 
     82#if defined key_dynspg_flt  
     83#   if ! defined key_obc 
    8384 
    8485      DO jj = 2, jpjm1                      ! matrix of free surface elliptic system 
     
    9798         END DO 
    9899      END DO 
    99        
    100 #  elif defined key_dynspg_flt && defined key_obc 
    101       IF( Agrif_Root() ) THEN 
    102          DO jj = 2, jpjm1                      ! matrix of free surface elliptic system with open boundaries 
    103             DO ji = 2, jpim1 
    104                zcoef = z2dt * z2dt * grav * bmask(ji,jj) 
    105                !                                    ! south coefficient 
    106                IF( lp_obc_south .AND. ( jj == njs0p1 ) ) THEN 
    107                   zcoefs = -zcoef * hv(ji,jj-1) * e1v(ji,jj-1)/e2v(ji,jj-1)*(1.-vsmsk(ji,1)) 
    108                ELSE 
    109                   zcoefs = -zcoef * hv(ji,jj-1) * e1v(ji,jj-1)/e2v(ji,jj-1) 
    110                END IF 
    111                gcp(ji,jj,1) = zcoefs 
    112                ! 
    113                !                                    ! west coefficient 
    114                IF( lp_obc_west  .AND. ( ji == niw0p1 ) ) THEN 
    115                   zcoefw = -zcoef * hu(ji-1,jj) * e2u(ji-1,jj)/e1u(ji-1,jj)*(1.-uwmsk(jj,1)) 
    116                ELSE 
    117                   zcoefw = -zcoef * hu(ji-1,jj) * e2u(ji-1,jj)/e1u(ji-1,jj) 
    118                END IF 
    119                gcp(ji,jj,2) = zcoefw 
    120                ! 
    121                !                                    ! east coefficient 
    122                IF( lp_obc_east  .AND. ( ji == nie0 ) ) THEN 
    123                   zcoefe = -zcoef * hu(ji,jj) * e2u(ji,jj)/e1u(ji,jj)*(1.-uemsk(jj,1)) 
    124                ELSE 
    125                   zcoefe = -zcoef * hu(ji,jj) * e2u(ji,jj)/e1u(ji,jj) 
    126                END IF 
    127                gcp(ji,jj,3) = zcoefe 
    128                ! 
    129                !                                    ! north coefficient 
    130                IF( lp_obc_north .AND. ( jj == njn0 ) ) THEN 
    131                   zcoefn = -zcoef * hv(ji,jj) * e1v(ji,jj)/e2v(ji,jj)*(1.-vnmsk(ji,1)) 
    132                ELSE 
     100#   else 
     101    IF ( Agrif_Root() ) THEN 
     102      DO jj = 2, jpjm1                      ! matrix of free surface elliptic system with open boundaries 
     103         DO ji = 2, jpim1 
     104            zcoef = z2dt * z2dt * grav * bmask(ji,jj) 
     105            !                                    ! south coefficient 
     106            IF( lp_obc_south .AND. ( jj == njs0p1 ) ) THEN 
     107               zcoefs = -zcoef * hv(ji,jj-1) * e1v(ji,jj-1)/e2v(ji,jj-1)*(1.-vsmsk(ji,1)) 
     108            ELSE 
     109               zcoefs = -zcoef * hv(ji,jj-1) * e1v(ji,jj-1)/e2v(ji,jj-1) 
     110            END IF 
     111            gcp(ji,jj,1) = zcoefs 
     112            ! 
     113            !                                    ! west coefficient 
     114            IF( lp_obc_west  .AND. ( ji == niw0p1 ) ) THEN 
     115               zcoefw = -zcoef * hu(ji-1,jj) * e2u(ji-1,jj)/e1u(ji-1,jj)*(1.-uwmsk(jj,1)) 
     116            ELSE 
     117               zcoefw = -zcoef * hu(ji-1,jj) * e2u(ji-1,jj)/e1u(ji-1,jj) 
     118            END IF 
     119            gcp(ji,jj,2) = zcoefw 
     120            ! 
     121            !                                    ! east coefficient 
     122            IF( lp_obc_east  .AND. ( ji == nie0 ) ) THEN 
     123               zcoefe = -zcoef * hu(ji,jj) * e2u(ji,jj)/e1u(ji,jj)*(1.-uemsk(jj,1)) 
     124            ELSE 
     125               zcoefe = -zcoef * hu(ji,jj) * e2u(ji,jj)/e1u(ji,jj) 
     126            END IF 
     127            gcp(ji,jj,3) = zcoefe 
     128            ! 
     129            !                                    ! north coefficient 
     130            IF( lp_obc_north .AND. ( jj == njn0 ) ) THEN 
     131               zcoefn = -zcoef * hv(ji,jj) * e1v(ji,jj)/e2v(ji,jj)*(1.-vnmsk(ji,1)) 
     132            ELSE 
    133133               zcoefn = -zcoef * hv(ji,jj) * e1v(ji,jj)/e2v(ji,jj) 
    134                END IF 
    135                gcp(ji,jj,4) = zcoefn 
    136                ! 
    137                !                                    ! diagonal coefficient 
    138                gcdmat(ji,jj) = e1t(ji,jj)*e2t(ji,jj)*bmask(ji,jj)   & 
    139                   &            - zcoefs -zcoefw -zcoefe -zcoefn 
    140             END DO 
    141          END DO 
    142       ENDIF 
     134            END IF 
     135            gcp(ji,jj,4) = zcoefn 
     136            ! 
     137            !                                    ! diagonal coefficient 
     138            gcdmat(ji,jj) = e1t(ji,jj)*e2t(ji,jj)*bmask(ji,jj)   & 
     139               &            - zcoefs -zcoefw -zcoefe -zcoefn 
     140         END DO 
     141      END DO 
     142    ELSE 
     143      DO jj = 2, jpjm1                      ! matrix of free surface elliptic system 
     144         DO ji = 2, jpim1 
     145            zcoef = z2dt * z2dt * grav * bmask(ji,jj) 
     146            zcoefs = -zcoef * hv(ji  ,jj-1) * e1v(ji  ,jj-1) / e2v(ji  ,jj-1)    ! south coefficient 
     147            zcoefw = -zcoef * hu(ji-1,jj  ) * e2u(ji-1,jj  ) / e1u(ji-1,jj  )    ! west coefficient 
     148            zcoefe = -zcoef * hu(ji  ,jj  ) * e2u(ji  ,jj  ) / e1u(ji  ,jj  )    ! east coefficient 
     149            zcoefn = -zcoef * hv(ji  ,jj  ) * e1v(ji  ,jj  ) / e2v(ji  ,jj  )    ! north coefficient 
     150            gcp(ji,jj,1) = zcoefs 
     151            gcp(ji,jj,2) = zcoefw 
     152            gcp(ji,jj,3) = zcoefe 
     153            gcp(ji,jj,4) = zcoefn 
     154            gcdmat(ji,jj) = e1t(ji,jj) * e2t(ji,jj) * bmask(ji,jj)    &          ! diagonal coefficient 
     155               &          - zcoefs -zcoefw -zcoefe -zcoefn 
     156         END DO 
     157      END DO 
     158    ENDIF 
     159#   endif 
    143160#endif 
    144161 
    145 #if defined key_agrif 
    146       IF( .NOT.AGRIF_ROOT() ) THEN 
     162      IF( .NOT. Agrif_Root() ) THEN 
    147163         ! 
    148164         IF( nbondi == -1 .OR. nbondi == 2 )   bmask(2     ,:     ) = 0.e0 
     
    193209         !  
    194210      ENDIF 
    195 #endif 
    196211 
    197212      ! 2. Boundary conditions  
  • trunk/NEMO/OPA_SRC/TRA/traqsr.F90

    r1756 r2031  
    4545    
    4646   ! Module variables 
     47!$AGRIF_DO_NOT_TREAT 
    4748   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_chl   ! structure of input Chl (file informations, fields read) 
    4849   INTEGER ::   nksr   ! levels below which the light cannot penetrate ( depth larger than 391 m) 
    4950   REAL(wp), DIMENSION(3,61) ::   rkrgb   !: tabulated attenuation coefficients for RGB absorption 
     51!$AGRIF_END_DO_NOT_TREAT 
    5052 
    5153   !! * Substitutions 
Note: See TracChangeset for help on using the changeset viewer.