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

Changeset 1876 for trunk


Ignore:
Timestamp:
2010-05-18T17:35:35+02:00 (14 years ago)
Author:
rblod
Message:

Corrections for AGRIF inside OBC see ticket #673

Location:
trunk/NEMO
Files:
11 edited

Legend:

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

    r1605 r1876  
    7373      USE tradmp 
    7474#endif 
     75#if defined key_obc   ||   defined key_esopa 
     76      USE obc_par 
     77#endif 
    7578      USE sol_oce 
    7679      USE in_out_manager 
     
    105108      ! no tracer damping on fine grids 
    106109      lk_tradmp = .FALSE. 
     110#endif 
     111#if defined key_obc || defined key_esopa 
     112      ! no open boundary on fine grids 
     113      lk_obc = .FALSE. 
    107114#endif 
    108115      ! 1. Declaration of the type of variable which have to be interpolated 
  • trunk/NEMO/OPA_SRC/DOM/dom_oce.F90

    r1792 r1876  
    219219#else 
    220220   LOGICAL, PUBLIC, PARAMETER ::   lk_agrif = .FALSE.   !: agrif flag 
    221  
    222 CONTAINS 
    223    LOGICAL FUNCTION Agrif_Root() 
    224       Agrif_Root = .TRUE. 
    225    END FUNCTION Agrif_Root 
    226  
    227    CHARACTER(len=3) FUNCTION Agrif_CFixed() 
    228      Agrif_CFixed = '0'  
    229    END FUNCTION Agrif_CFixed 
    230221#endif 
    231222 
  • trunk/NEMO/OPA_SRC/DYN/dynnxt.F90

    r1740 r1876  
    146146# if defined key_obc 
    147147      !                                !* OBC open boundaries 
    148       CALL obc_dyn( kt ) 
     148      IF( lk_obc )   CALL obc_dyn( kt ) 
    149149      ! 
    150150      IF ( lk_dynspg_exp .OR. lk_dynspg_ts ) THEN 
  • trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90

    r1792 r1876  
    186186 
    187187#if defined key_obc 
    188       CALL obc_dyn( kt )      ! Update velocities on each open boundary with the radiation algorithm 
    189       CALL obc_vol( kt )      ! Correction of the barotropic componant velocity to control the volume of the system 
     188      IF( lk_obc )   CALL obc_dyn( kt )   ! Update velocities on each open boundary with the radiation algorithm 
     189      IF( lk_obc )   CALL obc_vol( kt )   ! Correction of the barotropic componant velocity to control the volume of the system 
    190190#endif 
    191191#if defined key_bdy 
     
    315315#if defined key_obc 
    316316            ! caution : grad D = 0 along open boundaries 
    317             spgu(ji,jj) = z2dt * ztdgu * obcumask(ji,jj) 
    318             spgv(ji,jj) = z2dt * ztdgv * obcvmask(ji,jj) 
     317            IF( Agrif_Root() ) THEN 
     318               spgu(ji,jj) = z2dt * ztdgu * obcumask(ji,jj) 
     319               spgv(ji,jj) = z2dt * ztdgv * obcvmask(ji,jj) 
     320            ELSE 
     321               spgu(ji,jj) = z2dt * ztdgu 
     322               spgv(ji,jj) = z2dt * ztdgv 
     323            ENDIF 
    319324#elif defined key_bdy 
    320325            ! caution : grad D = 0 along open boundaries 
     
    330335      END DO 
    331336 
    332 #if defined key_agrif 
     337#if defined key_agrif       
    333338      IF( .NOT. Agrif_Root() ) THEN 
    334339         ! caution : grad D (fine) = grad D (coarse) at coarse/fine interface 
     
    338343         IF( nbondj ==  1 .OR. nbondj == 2 ) spgv(:,nlcj-2) = z2dtg * z2dt * laplacv(:,nlcj-2) * vmask(:,nlcj-2,1) 
    339344      ENDIF 
    340 #endif 
    341  
     345#endif       
    342346      ! Add the trends multiplied by z2dt to the after velocity 
    343347      ! ------------------------------------------------------- 
  • trunk/NEMO/OPA_SRC/OBC/obc_par.F90

    r1647 r1876  
    2525   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    2626   !!---------------------------------------------------------------------- 
    27    LOGICAL, PUBLIC, PARAMETER ::   lk_obc = .TRUE.   !: Ocean Boundary Condition flag 
     27#if ! defined key_agrif 
     28   LOGICAL, PUBLIC, PARAMETER ::   lk_obc = .TRUE.     !: Ocean Boundary Condition flag 
     29#else 
     30   LOGICAL, PUBLIC            ::   lk_obc = .TRUE.     !: Ocean Boundary Condition flag 
     31#endif 
    2832 
    2933# if defined key_eel_r5 
     
    4347   !! open boundary parameter 
    4448   !!--------------------------------------------------------------------- 
    45    INTEGER, PARAMETER ::     &  !: time dimension of the BCS fields on input 
     49   INTEGER ::     &  !: time dimension of the BCS fields on input 
    4650      jptobc  =         2  
    4751   !! * EAST open boundary 
    48    LOGICAL, PARAMETER ::     &  !: 
     52   LOGICAL ::     &  !: 
    4953      lp_obc_east = .FALSE.     !: to active or not the East open boundary 
    50    INTEGER, PARAMETER ::     &  !: 
     54   INTEGER ::     &  
    5155      jpieob  = jpiglo-2,    &  !: i-localization of the East open boundary (must be ocean U-point) 
    5256      jpjed   =        2,    &  !: j-starting indice of the East open boundary (must be land T-point) 
     
    5660 
    5761   !! * WEST open boundary 
    58    LOGICAL, PARAMETER ::     &  !: 
     62   LOGICAL ::     &  !: 
    5963      lp_obc_west = .FALSE.     !: to active or not the West open boundary 
    60    INTEGER, PARAMETER ::     &  !: 
     64   INTEGER ::     &  !: 
    6165      jpiwob  =          2,    &  !: i-localization of the West open boundary (must be ocean U-point) 
    6266      jpjwd   =          2,    &  !: j-starting indice of the West open boundary (must be land T-point) 
     
    6670 
    6771   !! * NORTH open boundary 
    68    LOGICAL, PARAMETER ::     &  !: 
     72   LOGICAL ::     &  !: 
    6973      lp_obc_north = .FALSE.    !: to active or not the North open boundary 
    70    INTEGER, PARAMETER ::     &  !: 
     74   INTEGER ::     &  !: 
    7175      jpjnob  = jpjglo-2,    &  !: j-localization of the North open boundary (must be ocean V-point) 
    7276      jpind   =        2,    &  !: i-starting indice of the North open boundary (must be land T-point) 
     
    7680 
    7781   !! * SOUTH open boundary 
    78    LOGICAL, PARAMETER ::     &  !: 
     82   LOGICAL ::     &  !: 
    7983      lp_obc_south = .FALSE.    !: to active or not the South open boundary 
    80    INTEGER, PARAMETER ::     &  !: 
     84   INTEGER ::     &  !: 
    8185      jpjsob  =        2,    &  !: j-localization of the South open boundary (must be ocean V-point) 
    8286      jpisd   =        2,    &  !: i-starting indice of the South open boundary (must be land T-point) 
  • trunk/NEMO/OPA_SRC/OBC/obc_par_EEL_R5.h90

    r1152 r1876  
    1515   LOGICAL, PARAMETER ::     &  !: 
    1616      lp_obc_east = .TRUE.      !: to active or not the East open boundary 
    17    INTEGER, PARAMETER ::     &  !: 
     17 
     18     INTEGER   & 
     19#if !defined key_agrif 
     20     , PARAMETER   & 
     21#endif 
     22    ::     & 
    1823      jpieob  = jpiglo-2,    &  !: i-localization of the East open boundary (must be ocean U-point) 
    1924      jpjed   =        2,    &  !: j-starting indice of the East open boundary (must be land T-point) 
     
    2530   LOGICAL, PARAMETER ::     &  !: 
    2631      lp_obc_west = .TRUE.      !: to active or not the West open boundary 
    27    INTEGER, PARAMETER ::     & 
     32 
     33     INTEGER   & 
     34#if !defined key_agrif 
     35     , PARAMETER   & 
     36#endif 
     37    ::     & 
    2838      jpiwob  =          2,    &  !: i-localization of the West open boundary (must be ocean U-point) 
    2939      jpjwd   =          2,    &  !: j-starting indice of the West open boundary (must be land T-point) 
     
    3545   LOGICAL, PARAMETER ::     &  !: 
    3646      lp_obc_north = .FALSE.    !: to active or not the North open boundary 
    37    INTEGER, PARAMETER ::     &  !: 
     47 
     48     INTEGER   & 
     49#if !defined key_agrif 
     50     , PARAMETER   & 
     51#endif 
     52    ::     & 
    3853      jpjnob  = jpjglo-2,    &  !: j-localization of the North open boundary (must be ocean V-point) 
    3954      jpind   =        2,    &  !: i-starting indice of the North open boundary (must be land T-point) 
     
    4560   LOGICAL, PARAMETER ::     &  !: 
    4661      lp_obc_south = .FALSE.    !: to active or not the South open boundary 
    47    INTEGER, PARAMETER ::     &  !: 
     62 
     63     INTEGER   & 
     64#if !defined key_agrif 
     65     , PARAMETER   & 
     66#endif 
     67    ::     & 
    4868      jpjsob  =        2,    &  !: j-localization of the South open boundary (must be ocean V-point) 
    4969      jpisd   =        2,    &  !: i-starting indice of the South open boundary (must be land T-point) 
  • trunk/NEMO/OPA_SRC/OBC/obc_par_POMME_R025.h90

    r1648 r1876  
    44   !! open boundary parameter : POMME configuration 
    55   !!--------------------------------------------------------------------- 
    6      INTEGER, PARAMETER ::     &  !: time dimension of the BCS fields on input 
    7       jptobc  =         14 
     6   INTEGER, PARAMETER ::  jptobc  =       14    
     7   !: time dimension of the BCS fields on input 
    88 
    99   !! * EAST open boundary 
    1010   LOGICAL, PARAMETER ::     &  !: 
    1111      lp_obc_east = .TRUE.      !: 
    12    INTEGER, PARAMETER ::     &  !: 
    1312 
     13     INTEGER   & 
     14#if !defined key_agrif 
     15     , PARAMETER   &  
     16#endif 
     17    ::     &  
    1418      ! * default values * 
    1519      !jpieob = jpiglo-2,    &  !: i-localization of the East open boundary (must be ocean U-point) 
    1620      !jpjed  =        2,    &  !: j-starting indice of the East open boundary (must be land T-point) 
    1721      !jpjef  = jpjglo-1,    &  !: j-ending   indice of the East open boundary (must be land T-point) 
    18  
    1922      jpieob = jpiglo-2,    &  !: i-localization of the East open boundary (must be ocean U-point) 
    2023      jpjed  =        1,    &  !: j-starting indice of the East open boundary (must be land T-point) 
    2124      jpjef  =   jpjglo,    &  !: j-ending   indice of the East open boundary (must be land T-point) 
    22  
    2325      jpjedp1 =  jpjed+1,    &  !: first ocean point         "                 " 
    2426      jpjefm1 =  jpjef-1        !: last  ocean point         "                 " 
     
    2729   LOGICAL, PARAMETER ::     &  !: 
    2830      lp_obc_west = .TRUE.     !: to active or not the West open boundary 
    29    INTEGER, PARAMETER ::     &  !: 
    3031 
     32     INTEGER   & 
     33#if !defined key_agrif 
     34     , PARAMETER   &  
     35#endif 
     36    ::     &  
    3137      ! * default values * 
    3238      !jpiwob  =        2,   &  !: i-localization of the West open boundary (must be ocean U-point) 
    3339      !jpjwd   =        2,   &  !: j-starting indice of the West open boundary (must be land T-point) 
    3440      !jpjwf   = jpjglo-1,   &  !: j-ending   indice of the West open boundary (must be land T-point) 
    35  
    3641      jpiwob  =        2,   &  !: i-localization of the West open boundary (must be ocean U-point) 
    3742      jpjwd   =        1,   &  !: j-starting indice of the West open boundary (must be land T-point) 
    3843      jpjwf   =   jpjglo,   &  !: j-ending   indice of the West open boundary (must be land T-point) 
    39  
    4044      jpjwdp1 =  jpjwd+1,    &  !: first ocean point         "                 " 
    4145      jpjwfm1 =  jpjwf-1        !: last  ocean point         "                 " 
     
    4448   LOGICAL, PARAMETER ::     &  !: 
    4549      lp_obc_north = .TRUE.     !: 
    46    INTEGER, PARAMETER ::     &  !: 
    4750 
     51     INTEGER   & 
     52#if !defined key_agrif 
     53     , PARAMETER   &  
     54#endif 
     55    ::     &  
    4856      ! * default values * 
    4957      !jpjnob = jpjglo-2,    &  !: j-localization of the North open boundary (must be ocean V-point) 
    5058      !jpind  =        2,    &  !: i-starting indice of the North open boundary (must be land T-point) 
    5159      !jpinf  = jpiglo-1,    &  !: i-ending   indice of the North open boundary (must be land T-point) 
    52  
    5360      jpjnob = jpjglo-2,    &  !: j-localization of the North open boundary (must be ocean V-point) 
    5461      jpind  =        1,    &  !: i-starting indice of the North open boundary (must be land T-point) 
    5562      jpinf  =   jpiglo,    &  !: i-ending   indice of the North open boundary (must be land T-point) 
    56  
    5763      jpindp1 =  jpind+1,    &  !: first ocean point         "                 " 
    5864      jpinfm1 =  jpinf-1        !: last  ocean point         "                 " 
     
    6167   LOGICAL, PARAMETER ::     &  !: 
    6268      lp_obc_south = .TRUE.     !: INDICE to active or not the South open boundary 
    63    INTEGER, PARAMETER ::     &  !: 
    6469 
     70     INTEGER   & 
     71#if !defined key_agrif 
     72     , PARAMETER   &  
     73#endif 
     74    ::     &  
    6575      ! * default values * 
    6676      !jpjsob =        2,    &  !: j-localization of the South open boundary (must be ocean V-point) 
    6777      !jpisd  =        2,    &  !: i-starting indice of the South open boundary (must be land T-point) 
    6878      !jpisf  = jpiglo-1,    &  !: i-ending   indice of the South open boundary (must be land T-point) 
    69  
    7079      jpjsob =        2,    &  !: j-localization of the South open boundary (must be ocean V-point) 
    7180      jpisd  =        1,    &  !: i-starting indice of the South open boundary (must be land T-point) 
    7281      jpisf  =   jpiglo,    &  !: i-ending   indice of the South open boundary (must be land T-point) 
    73  
    7482      jpisdp1 =  jpisd+1,    &  !: first ocean point         "                 " 
    7583      jpisfm1 =  jpisf-1        !: last  ocean point         "                 " 
  • trunk/NEMO/OPA_SRC/OBC/obcdta.F90

    r1732 r1876  
    469469       ENDIF 
    470470    ELSE 
     471#if defined key_agrif 
     472       IF ( ASSOCIATED(ztcobc) ) DEALLOCATE ( ztcobc ) 
     473#else 
    471474       IF ( ALLOCATED(ztcobc) ) DEALLOCATE ( ztcobc ) 
     475#endif 
    472476       ALLOCATE (ztcobc(itobc)) 
    473477       DO ji=1,1   ! use a dummy loop to read ztcobc only once 
  • trunk/NEMO/OPA_SRC/SOL/solmat.F90

    r1792 r1876  
    9999       
    100100#  elif defined key_dynspg_flt && defined key_obc 
    101  
    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 
     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 
     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 
    140141         END DO 
    141       END DO 
     142      ENDIF 
    142143#endif 
    143144 
    144       IF( .NOT. Agrif_Root() ) THEN   ! Fine grid boundaries 
     145#if defined key_agrif 
     146      IF( .NOT.AGRIF_ROOT() ) THEN 
    145147         ! 
    146148         IF( nbondi == -1 .OR. nbondi == 2 )   bmask(2     ,:     ) = 0.e0 
     
    191193         !  
    192194      ENDIF 
     195#endif 
    193196 
    194197      ! 2. Boundary conditions  
  • trunk/NEMO/OPA_SRC/TRA/tranxt.F90

    r1601 r1876  
    3838   USE agrif_opa_update 
    3939   USE agrif_opa_interp 
     40   USE obc_oce  
    4041 
    4142   IMPLICIT NONE 
     
    101102      ! 
    102103#if defined key_obc 
    103       CALL obc_tra( kt )               ! OBC open boundaries 
     104      IF( lk_obc )   CALL obc_tra( kt )  ! OBC open boundaries 
    104105#endif 
    105106#if defined key_bdy 
  • trunk/NEMO/OPA_SRC/par_POMME_R025.h90

    r1648 r1876  
    2222      jp_cfg = 025  ,        &  !: resolution of the configuration (degrees) 
    2323      ! Original data size 
    24  
    2524      ! ORCA025 global grid size 
    2625      jpiglo_ORCA025 = 1442, & 
    2726      jpjglo_ORCA025 = 1021, &  ! not used currently 
    28  
    2927      ! POMME "global" domain localisation in the ORCA025 global grid 
    3028      jpi_iw    = 1059,      &  
     
    3230      jpj_js    = 661,       & 
    3331      jpj_jn    = 700,       & 
    34  
    3532      jpidta  = ( jpi_ie - jpi_iw + 1 ), &   !: =30 first horizontal dimension > or = to jpi 
    3633      jpjdta  = ( jpj_jn - jpj_js + 1 ), &   !: =40 second                     > or = to jpj 
    3734      jpkdta  = 46 ,         &  !: number of levels           > or = to jpk 
    38  
    3935      ! total domain matrix size 
    4036      jpiglo  = jpidta,      &  !: first  dimension of global domain --> i 
Note: See TracChangeset for help on using the changeset viewer.