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 13565 for NEMO/branches – NEMO

Changeset 13565 for NEMO/branches


Ignore:
Timestamp:
2020-10-05T16:18:53+02:00 (4 years ago)
Author:
jchanut
Message:

#2222, 1) Added parent bathymetry volume consistency check 2) Added velocity extrapolation in update 3) Corrected bdy issue #2519

Location:
NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce.F90

    r13351 r13565  
    7070   INTEGER, PUBLIC :: mbkt_id, ht0_id 
    7171   INTEGER, PUBLIC :: glamt_id, gphit_id 
     72   INTEGER, PUBLIC :: batupd_id 
    7273   INTEGER, PUBLIC :: kindic_agr 
    7374 
  • NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_sponge.F90

    r13498 r13565  
    137137          
    138138         ztabramp(:,:) = 0._wp 
    139  
    140          ! Trick to remove sponge in 2DV domains: 
    141          IF ( nbcellsx <= 3 ) ispongearea = -1 
    142          IF ( nbcellsy <= 3 ) jspongearea = -1 
    143139 
    144140         IF( lk_west ) THEN                             ! --- West --- ! 
  • NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_oce_update.F90

    r13351 r13565  
    2121   USE zdf_oce        ! vertical physics: ocean variables  
    2222   USE agrif_oce 
     23   USE dom_oce 
    2324   ! 
    2425   USE in_out_manager ! I/O manager 
     
    3233 
    3334   PUBLIC   Agrif_Update_Tra, Agrif_Update_Dyn, Agrif_Update_vvl, Agrif_Update_ssh 
    34    PUBLIC   Update_Scales 
     35   PUBLIC   Update_Scales, Agrif_Check_parent_bat 
    3536 
    3637   !!---------------------------------------------------------------------- 
     
    5051      IF (lwp.AND.lk_agrif_debug) Write(*,*) 'Update tracers  from grid Number',Agrif_Fixed() 
    5152 
    52       Agrif_UseSpecialValueInUpdate = .NOT.l_vremap 
     53      Agrif_UseSpecialValueInUpdate = .NOT.ln_vert_remap 
    5354      Agrif_SpecialValueFineGrid    = 0._wp 
    5455      l_vremap                      = ln_vert_remap 
     
    343344                  N_in = 0 
    344345                  DO jk=k1,k2 !k2 = jpk of child grid 
    345                      IF (tabres(ji,jj,jk,n2) == 0._wp  ) EXIT 
     346                     IF (tabres(ji,jj,jk,n2) <= 1.e-6_wp  ) EXIT 
    346347                     N_in = N_in + 1 
    347348                     tabin(jk,:) = tabres(ji,jj,jk,n1:n2-1)/tabres(ji,jj,jk,n2) 
     
    448449      REAL(wp) :: h_in(k1:k2) 
    449450      REAL(wp) :: h_out(1:jpk) 
    450       INTEGER  :: N_in, N_out 
    451       REAL(wp) :: h_diff, excess, thick 
     451      INTEGER  :: N_in, N_out, N_in_save, N_out_save 
     452      REAL(wp) :: zhmin, zd 
    452453      REAL(wp) :: tabin(k1:k2) 
    453454! VERTICAL REFINEMENT END 
     
    470471 
    471472         tabres_child(:,:,:) = 0._wp 
    472          AGRIF_SpecialValue = 0._wp 
    473473 
    474474         IF ( l_vremap ) THEN 
     
    480480                  tabin(:) = 0._wp 
    481481                  DO jk=k1,k2 !k2=jpk of child grid 
    482                      IF( tabres(ji,jj,jk,2) == 0.) EXIT 
     482                     IF( tabres(ji,jj,jk,2)*r1_e2u(ji,jj) <= 1.e-6_wp ) EXIT 
    483483                     N_in = N_in + 1 
    484484                     tabin(jk) = tabres(ji,jj,jk,1)/tabres(ji,jj,jk,2) 
     
    487487                  N_out = 0 
    488488                  DO jk=1,jpk 
    489                      IF (umask(ji,jj,jk) == 0) EXIT 
     489                     IF (umask(ji,jj,jk) == 0._wp) EXIT 
    490490                     N_out = N_out + 1 
    491491                     h_out(N_out) = e3u(ji,jj,jk,Kmm_a) 
    492492                  ENDDO 
    493493                  IF (N_in * N_out > 0) THEN 
    494                      h_diff = sum(h_out(1:N_out))-sum(h_in(1:N_in)) 
    495                      excess = 0._wp 
    496                      IF (h_diff < -1.e-4) THEN 
    497                         DO jk=N_in,1,-1 
    498                            thick = MIN(-1*h_diff, h_in(jk)) 
    499                            excess = excess + tabin(jk)*thick*e2u(ji,jj) 
    500                            tabin(jk) = tabin(jk)*(1. - thick/h_in(jk)) 
    501                            h_diff = h_diff + thick 
    502                            IF ( h_diff == 0) THEN 
     494                     ! Deal with potentially different depths at velocity points: 
     495                     N_in_save  = N_in 
     496                     N_out_save = N_out 
     497                     IF ( ABS(sum(h_out(1:N_out))-sum(h_in(1:N_in))) > 1.e-6_wp ) THEN 
     498                        zhmin = MIN(sum(h_out(1:N_out)), sum(h_in(1:N_in))) 
     499                        zd = 0._wp 
     500                        DO jk=1, N_in_save 
     501                           IF ( (zd +  h_in(jk)) > zhmin-1.e-6) THEN 
    503502                              N_in = jk 
    504                               h_in(jk) = h_in(jk) - thick 
    505                               EXIT 
     503                              h_in(jk) = zhmin - zd 
     504                              EXIT  
    506505                           ENDIF 
    507                         ENDDO 
    508                      ENDIF 
     506                           zd = zd + h_in(jk) 
     507                        END DO 
     508                        zd = 0._wp 
     509                        DO jk=1, N_out_save 
     510                           IF ( (zd +  h_out(jk)) > zhmin-1.e-6) THEN 
     511                              N_out = jk 
     512                              h_out(jk) = zhmin - zd 
     513                              EXIT  
     514                           ENDIF 
     515                           zd = zd + h_out(jk) 
     516                        END DO 
     517                     END IF 
    509518                     CALL reconstructandremap(tabin(1:N_in),h_in(1:N_in),tabres_child(ji,jj,1:N_out),h_out(1:N_out),N_in,N_out,1) 
    510                      tabres_child(ji,jj,N_out) = tabres_child(ji,jj,N_out) + excess/(e2u(ji,jj)*h_out(N_out)) 
     519                     IF (N_out < N_out_save) tabres_child(ji,jj,N_out+1:N_out_save) = tabres_child(ji,jj,N_out) 
    511520                  ENDIF 
    512521               ENDDO 
     
    606615      REAL(wp) :: h_in(k1:k2) 
    607616      REAL(wp) :: h_out(1:jpk) 
    608       INTEGER :: N_in, N_out 
    609       REAL(wp) :: h_diff, excess, thick 
     617      INTEGER  :: N_in, N_out, N_in_save, N_out_save 
     618      REAL(wp) :: zhmin, zd 
    610619      REAL(wp) :: tabin(k1:k2) 
    611620! VERTICAL REFINEMENT END 
     
    628637 
    629638         tabres_child(:,:,:) = 0._wp 
    630          AGRIF_SpecialValue = 0._wp 
    631639 
    632640         IF ( l_vremap ) THEN 
     
    636644                  N_in = 0 
    637645                  DO jk=k1,k2 
    638                      IF (tabres(ji,jj,jk,2) == 0) EXIT 
     646                     IF (tabres(ji,jj,jk,2)* r1_e1v(ji,jj) <= 1.e-6_wp) EXIT 
    639647                     N_in = N_in + 1 
    640648                     tabin(jk) = tabres(ji,jj,jk,1)/tabres(ji,jj,jk,2) 
     
    648656                  ENDDO 
    649657                  IF (N_in * N_out > 0) THEN 
    650                      h_diff = sum(h_out(1:N_out))-sum(h_in(1:N_in)) 
    651                      excess = 0._wp 
    652                      IF (h_diff < -1.e-4) then 
    653 !Even if bathy at T points match it's possible for the V points to be deeper in the child grid.  
    654 !In this case we need to move transport from the child grid cells below bed of parent grid into the bottom cell. 
    655                         DO jk=N_in,1,-1 
    656                            thick = MIN(-1*h_diff, h_in(jk)) 
    657                            excess = excess + tabin(jk)*thick*e2u(ji,jj) 
    658                            tabin(jk) = tabin(jk)*(1. - thick/h_in(jk)) 
    659                            h_diff = h_diff + thick 
    660                            IF ( h_diff == 0) THEN 
     658                     ! Deal with potentially different depths at velocity points: 
     659                     N_in_save  = N_in 
     660                     N_out_save = N_out 
     661                     IF ( ABS(sum(h_out(1:N_out))-sum(h_in(1:N_in))) > 1.e-6_wp ) THEN 
     662                        zhmin = MIN(sum(h_out(1:N_out)), sum(h_in(1:N_in))) 
     663                        zd = 0._wp 
     664                        DO jk=1, N_in_save 
     665                           IF ( (zd +  h_in(jk)) > zhmin-1.e-6) THEN 
    661666                              N_in = jk 
    662                               h_in(jk) = h_in(jk) - thick 
    663                               EXIT 
     667                              h_in(jk) = zhmin - zd 
     668                              EXIT  
    664669                           ENDIF 
    665                         ENDDO 
    666                      ENDIF 
     670                           zd = zd + h_in(jk) 
     671                        END DO 
     672                        zd = 0._wp 
     673                        DO jk=1, N_out_save 
     674                           IF ( (zd +  h_out(jk)) > zhmin-1.e-6) THEN 
     675                              N_out = jk 
     676                              h_out(jk) = zhmin - zd 
     677                              EXIT  
     678                           ENDIF 
     679                           zd = zd + h_out(jk) 
     680                        END DO 
     681                     END IF 
    667682                     CALL reconstructandremap(tabin(1:N_in),h_in(1:N_in),tabres_child(ji,jj,1:N_out),h_out(1:N_out),N_in,N_out,1) 
    668                      tabres_child(ji,jj,N_out) = tabres_child(ji,jj,N_out) + excess/(e1v(ji,jj)*h_out(N_out)) 
     683                     IF (N_out < N_out_save) tabres_child(ji,jj,N_out+1:N_out_save) = tabres_child(ji,jj,N_out) 
    669684                  ENDIF 
    670685               ENDDO 
     
    13161331   END SUBROUTINE updatee3t 
    13171332 
     1333   SUBROUTINE Agrif_Check_parent_bat( ) 
     1334      !!---------------------------------------------------------------------- 
     1335      !!                   *** ROUTINE Agrif_Check_parent_bat *** 
     1336      !!---------------------------------------------------------------------- 
     1337      !  
     1338      IF (( .NOT.ln_agrif_2way ).OR.(.NOT.ln_chk_bathy).OR.(Agrif_Root())) RETURN 
     1339      ! 
     1340      Agrif_UseSpecialValueInUpdate = .FALSE. 
     1341      ! 
     1342      IF(lwp) WRITE(numout,*) ' ' 
     1343      IF(lwp) WRITE(numout,*) 'AGRIF: Check parent volume at Level:', Agrif_Level() 
     1344      ! 
     1345# if ! defined DECAL_FEEDBACK && ! defined DECAL_FEEDBACK_2D 
     1346      CALL Agrif_Update_Variable(batupd_id,procname = update_bat) 
     1347# else 
     1348      CALL Agrif_Update_Variable(batupd_id,locupdate=(/1,0/),procname = update_bat) 
     1349# endif 
     1350      ! 
     1351      kindic_agr = Agrif_Parent(kindic_agr) 
     1352      CALL mpp_sum( 'Agrif_Check_parent_bat', kindic_agr ) 
     1353 
     1354      IF( kindic_agr /= 0 ) THEN 
     1355         CALL ctl_stop('==> Averaged Bathymetry does not match parent volume')  
     1356      ELSE 
     1357         IF(lwp) WRITE(numout,*) '==> Averaged Bathymetry matches parent '  
     1358         IF(lwp) WRITE(numout,*) '' 
     1359      ENDIF 
     1360      ! 
     1361   END SUBROUTINE Agrif_Check_parent_bat 
     1362 
     1363   SUBROUTINE update_bat(ptab, i1, i2, j1, j2, before ) 
     1364      !!--------------------------------------------- 
     1365      !!           *** ROUTINE update_bat *** 
     1366      !!--------------------------------------------- 
     1367      REAL(wp), DIMENSION(i1:i2,j1:j2) :: ptab 
     1368      INTEGER, INTENT(in) :: i1, i2, j1, j2 
     1369      LOGICAL, INTENT(in) :: before 
     1370      INTEGER :: ji, jj 
     1371      ! 
     1372      !!--------------------------------------------- 
     1373      ! 
     1374      IF( before ) THEN 
     1375         ptab(i1:i2,j1:j2) = ht_0(i1:i2,j1:j2) * tmask(i1:i2,j1:j2,1) 
     1376      ELSE 
     1377         kindic_agr = 0 
     1378         ! 
     1379         DO jj=j1,j2 
     1380            DO ji=i1,i2 
     1381               IF ( (ssmask(ji,jj).NE.0._wp).AND.& 
     1382               & (ABS(ptab(ji,jj)-ht_0(ji,jj)).GE.1.e-6) ) THEN  
     1383                  kindic_agr = kindic_agr + 1  
     1384               ENDIF 
     1385            END DO 
     1386         END DO 
     1387         ! 
     1388      ENDIF 
     1389      ! 
     1390   END SUBROUTINE update_bat 
     1391 
    13181392#else 
    13191393   !!---------------------------------------------------------------------- 
  • NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/NST/agrif_user.F90

    r13371 r13565  
    9191      CALL agrif_declare_variable((/2,2    /),(/ind2  ,ind3      /),(/'x','y'        /),(/1,1    /),(/jpi,jpj        /),sshini_id) 
    9292      !  
     93      ! Update location 
     94      CALL agrif_declare_variable((/2,2/),(/ind2  ,ind3  /),(/'x','y'/),(/1,1/),(/jpi,jpj/), batupd_id) 
    9395      
    9496      ! 2. Type of interpolation 
     
    138140      CALL Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Average       , update2=Agrif_Update_Full_Weighting) 
    139141      CALL Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Full_Weighting, update2=Agrif_Update_Average       ) 
     142      CALL Agrif_Set_Updatetype(batupd_id, update = Agrif_Update_Full_Weighting) 
    140143#else 
    141144      CALL Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Copy          , update2=Agrif_Update_Average       ) 
    142145      CALL Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Average       , update2=Agrif_Update_Copy          ) 
    143 #endif 
    144        
     146      CALL Agrif_Set_Updatetype(batupd_id, update = Agrif_Update_Average) 
     147#endif       
     148 
    145149   !   CALL Agrif_Set_ExternalMapping(nemo_mapping) 
    146150      ! 
     
    199203      IF ( ln_sco.AND.Agrif_Parent(ln_sco) ) THEN  
    200204         DO_2D( 1, 0, 1, 0 ) 
    201             hu0_parent(ji,jj) = 0.5_wp * ( ht0_parent(ji,jj)+ht0_parent(ji+1,jj) ) 
    202             hv0_parent(ji,jj) = 0.5_wp * ( ht0_parent(ji,jj)+ht0_parent(ji,jj+1) ) 
     205            hu0_parent(ji,jj) = 0.5_wp * ( ht0_parent(ji,jj)+ht0_parent(ji+1,jj) ) * ssumask(ji,jj) 
     206            hv0_parent(ji,jj) = 0.5_wp * ( ht0_parent(ji,jj)+ht0_parent(ji,jj+1) ) * ssvmask(ji,jj) 
    203207         END_2D 
    204208      ELSE 
     
    432436! 
    433437! > Divergence conserving alternative: 
     438!      CALL Agrif_Set_bcinterp( ts_interp_id,interp =AGRIF_constant) 
     439!      CALL Agrif_Set_bcinterp( un_interp_id,interp1=Agrif_linear,interp2=AGRIF_constant   ) 
     440!      CALL Agrif_Set_bcinterp( vn_interp_id,interp1=AGRIF_constant   ,interp2=Agrif_linear) 
     441! 
     442!      CALL Agrif_Set_bcinterp(  ts_sponge_id,interp =AGRIF_constant) 
     443!      CALL Agrif_Set_bcinterp(  un_sponge_id,interp1=Agrif_linear,interp2=AGRIF_constant   ) 
     444!      CALL Agrif_Set_bcinterp(  vn_sponge_id,interp1=AGRIF_constant   ,interp2=Agrif_linear) 
     445! 
    434446!      CALL Agrif_Set_bcinterp(sshn_id,interp=AGRIF_constant) 
    435447!      CALL Agrif_Set_bcinterp(unb_id,interp1=Agrif_linear,interp2=AGRIF_constant) 
     
    785797      ENDIF 
    786798 
     799! JC => side effects of lines below to be checked: 
    787800      lk_west  = .NOT. ( Agrif_Ix() == 1 ) 
    788801      lk_east  = .NOT. ( Agrif_Ix() + nbcellsx/AGRIF_Irhox() == Agrif_Parent(jpiglo) -1 ) 
    789802      lk_south = .NOT. ( Agrif_Iy() == 1 ) 
    790803      lk_north = .NOT. ( Agrif_Iy() + nbcellsy/AGRIF_Irhoy() == Agrif_Parent(jpjglo) -1 ) 
    791  
    792804      ! 
    793805      ! Set the number of ghost cells according to periodicity 
     
    798810      IF(   jperio == 1  )   nbghostcells_x   = 0 
    799811      IF( .NOT. lk_south )   nbghostcells_y_s = 0 
     812      ! For 2DV domains: 
     813      IF (( nbcellsy <= 3 ).AND.(AGRIF_Irhoy()==1)) THEN 
     814         lk_north  = .FALSE. ; lk_south = .FALSE. 
     815         nbghostcells_y_s = nbghostcells 
     816      ENDIF 
     817      IF (( nbcellsx <= 3 ).AND.(AGRIF_Irhox()==1)) THEN 
     818         lk_east  = .FALSE. ; lk_north = .FALSE. 
     819      ENDIF 
    800820      ! Some checks 
    801821      IF( jpiglo /= nbcellsx + 2 + 2*nn_hls + nbghostcells_x   + nbghostcells_x   )   CALL ctl_stop( 'STOP',    & 
  • NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/BDY/bdyini.F90

    r13286 r13565  
    397397      IF( nbdysege > 0 .OR. nbdysegw > 0 .OR. nbdysegn > 0 .OR. nbdysegs > 0)   CALL bdy_ctl_seg 
    398398       
     399 
    399400      ! Allocate arrays 
    400401      !--------------- 
     
    786787                  ii = idx_bdy(ib_bdy)%nbi(ib,igrd) 
    787788                  ij = idx_bdy(ib_bdy)%nbj(ib,igrd) 
    788                   IF(  mig(ii) > 2 .AND. mig(ii) < jpiglo-2 .AND. mjg(ij) > 2 .AND. mjg(ij) < jpjglo-2  ) THEN 
     789                  IF(  mig0(ii) > 2 .AND. mig0(ii) < Ni0glo-2 .AND. mjg0(ij) > 2 .AND. mjg0(ij) < Nj0glo-2  ) THEN 
    789790                     WRITE(ctmp1,*) ' Orlanski is not safe when the open boundaries are on the interior of the computational domain' 
    790791                     CALL ctl_stop( ctmp1 ) 
     
    11111112      CASE( 'N' ) 
    11121113         IF( nbdyind == -1 ) THEN  ! Automatic boundary definition: if nbdysegX = -1 
    1113             nbdyind  = jpjglo - 2  ! set boundary to whole side of model domain. 
     1114            nbdyind  = Nj0glo - 2  ! set boundary to whole side of model domain. 
    11141115            nbdybeg  = 2 
    1115             nbdyend  = jpiglo - 1 
     1116            nbdyend  = Ni0glo - 1 
    11161117         ENDIF 
    11171118         nbdysegn = nbdysegn + 1 
    11181119         npckgn(nbdysegn) = kb_bdy ! Save bdy package number 
    1119          jpjnob(nbdysegn) = nbdyind 
     1120         jpjnob(nbdysegn) = nbdyind  
    11201121         jpindt(nbdysegn) = nbdybeg 
    11211122         jpinft(nbdysegn) = nbdyend 
     
    11251126            nbdyind  = 2           ! set boundary to whole side of model domain. 
    11261127            nbdybeg  = 2 
    1127             nbdyend  = jpiglo - 1 
     1128            nbdyend  = Ni0glo - 1 
    11281129         ENDIF 
    11291130         nbdysegs = nbdysegs + 1 
     
    11351136      CASE( 'E' ) 
    11361137         IF( nbdyind == -1 ) THEN  ! Automatic boundary definition: if nbdysegX = -1 
    1137             nbdyind  = jpiglo - 2  ! set boundary to whole side of model domain. 
     1138            nbdyind  = Ni0glo - 2  ! set boundary to whole side of model domain. 
    11381139            nbdybeg  = 2 
    1139             nbdyend  = jpjglo - 1 
     1140            nbdyend  = Nj0glo - 1  
    11401141         ENDIF 
    11411142         nbdysege = nbdysege + 1  
     
    11491150            nbdyind  = 2           ! set boundary to whole side of model domain. 
    11501151            nbdybeg  = 2 
    1151             nbdyend  = jpjglo - 1 
     1152            nbdyend  = Nj0glo - 1 
    11521153         ENDIF 
    11531154         nbdysegw = nbdysegw + 1 
     
    11961197      DO ib = 1, nbdysegn 
    11971198         IF (lwp) WRITE(numout,*) '**check north seg bounds pckg: ', npckgn(ib) 
    1198          IF ((jpjnob(ib).ge.jpjglo-1).or.&  
     1199         IF ((jpjnob(ib).ge.Nj0glo-1).or.&  
    11991200            &(jpjnob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' ) 
    12001201         IF (jpindt(ib).ge.jpinft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' ) 
    12011202         IF (jpindt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' ) 
    1202          IF (jpinft(ib).gt.jpiglo)     CALL ctl_stop( 'End index out of domain' ) 
     1203         IF (jpinft(ib).gt.Ni0glo)     CALL ctl_stop( 'End index out of domain' ) 
    12031204      END DO 
    12041205      ! 
    12051206      DO ib = 1, nbdysegs 
    12061207         IF (lwp) WRITE(numout,*) '**check south seg bounds pckg: ', npckgs(ib) 
    1207          IF ((jpjsob(ib).ge.jpjglo-1).or.&  
     1208         IF ((jpjsob(ib).ge.Nj0glo-1).or.&  
    12081209            &(jpjsob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' ) 
    12091210         IF (jpisdt(ib).ge.jpisft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' ) 
    12101211         IF (jpisdt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' ) 
    1211          IF (jpisft(ib).gt.jpiglo)     CALL ctl_stop( 'End index out of domain' ) 
     1212         IF (jpisft(ib).gt.Ni0glo)     CALL ctl_stop( 'End index out of domain' ) 
    12121213      END DO 
    12131214      ! 
    12141215      DO ib = 1, nbdysege 
    12151216         IF (lwp) WRITE(numout,*) '**check east  seg bounds pckg: ', npckge(ib) 
    1216          IF ((jpieob(ib).ge.jpiglo-1).or.&  
     1217         IF ((jpieob(ib).ge.Ni0glo-1).or.&  
    12171218            &(jpieob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' ) 
    12181219         IF (jpjedt(ib).ge.jpjeft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' ) 
    12191220         IF (jpjedt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' ) 
    1220          IF (jpjeft(ib).gt.jpjglo)     CALL ctl_stop( 'End index out of domain' ) 
     1221         IF (jpjeft(ib).gt.Nj0glo)     CALL ctl_stop( 'End index out of domain' ) 
    12211222      END DO 
    12221223      ! 
    12231224      DO ib = 1, nbdysegw 
    12241225         IF (lwp) WRITE(numout,*) '**check west  seg bounds pckg: ', npckgw(ib) 
    1225          IF ((jpiwob(ib).ge.jpiglo-1).or.&  
     1226         IF ((jpiwob(ib).ge.Ni0glo-1).or.&  
    12261227            &(jpiwob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' ) 
    12271228         IF (jpjwdt(ib).ge.jpjwft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' ) 
    12281229         IF (jpjwdt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' ) 
    1229          IF (jpjwft(ib).gt.jpjglo)     CALL ctl_stop( 'End index out of domain' ) 
     1230         IF (jpjwft(ib).gt.Nj0glo)     CALL ctl_stop( 'End index out of domain' ) 
    12301231      ENDDO 
    12311232      ! 
     
    13781379         DO ji = 1, jpi 
    13791380            DO jj = 1, jpj              
    1380               IF( mig(ji) == jpiwob(ib) .AND. mjg(jj) == jpjwdt(ib) )   ztestmask(1) = tmask(ji,jj,1) 
    1381               IF( mig(ji) == jpiwob(ib) .AND. mjg(jj) == jpjwft(ib) )   ztestmask(2) = tmask(ji,jj,1)   
     1381              IF( mig0(ji) == jpiwob(ib) .AND. mjg0(jj) == jpjwdt(ib) )   ztestmask(1) = tmask(ji,jj,1) 
     1382              IF( mig0(ji) == jpiwob(ib) .AND. mjg0(jj) == jpjwft(ib) )   ztestmask(2) = tmask(ji,jj,1)   
    13821383            END DO 
    13831384         END DO 
     
    14141415         DO ji = 1, jpi 
    14151416            DO jj = 1, jpj              
    1416               IF( mig(ji) == jpieob(ib)+1 .AND. mjg(jj) == jpjedt(ib) )   ztestmask(1) = tmask(ji,jj,1) 
    1417               IF( mig(ji) == jpieob(ib)+1 .AND. mjg(jj) == jpjeft(ib) )   ztestmask(2) = tmask(ji,jj,1)   
     1417              IF( mig0(ji) == jpieob(ib)+1 .AND. mjg0(jj) == jpjedt(ib) )   ztestmask(1) = tmask(ji,jj,1) 
     1418              IF( mig0(ji) == jpieob(ib)+1 .AND. mjg0(jj) == jpjeft(ib) )   ztestmask(2) = tmask(ji,jj,1)   
    14181419            END DO 
    14191420         END DO 
     
    14501451         DO ji = 1, jpi 
    14511452            DO jj = 1, jpj              
    1452               IF( mjg(jj) == jpjsob(ib) .AND. mig(ji) == jpisdt(ib) )   ztestmask(1) = tmask(ji,jj,1) 
    1453               IF( mjg(jj) == jpjsob(ib) .AND. mig(ji) == jpisft(ib) )   ztestmask(2) = tmask(ji,jj,1)   
     1453              IF( mjg0(jj) == jpjsob(ib) .AND. mig0(ji) == jpisdt(ib) )   ztestmask(1) = tmask(ji,jj,1) 
     1454              IF( mjg0(jj) == jpjsob(ib) .AND. mig0(ji) == jpisft(ib) )   ztestmask(2) = tmask(ji,jj,1)   
    14541455            END DO 
    14551456         END DO 
     
    14721473         DO ji = 1, jpi 
    14731474            DO jj = 1, jpj              
    1474                IF( mjg(jj) == jpjnob(ib)+1 .AND. mig(ji) == jpindt(ib) )   ztestmask(1) = tmask(ji,jj,1) 
    1475                IF( mjg(jj) == jpjnob(ib)+1 .AND. mig(ji) == jpinft(ib) )   ztestmask(2) = tmask(ji,jj,1)   
     1475               IF( mjg0(jj) == jpjnob(ib)+1 .AND. mig0(ji) == jpindt(ib) )   ztestmask(1) = tmask(ji,jj,1) 
     1476               IF( mjg0(jj) == jpjnob(ib)+1 .AND. mig0(ji) == jpinft(ib) )   ztestmask(2) = tmask(ji,jj,1)   
    14761477            END DO 
    14771478         END DO 
     
    15261527            DO ij = jpjedt(iseg), jpjeft(iseg) 
    15271528               icount = icount + 1 
    1528                nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir 
    1529                nbjdta(icount, igrd, ib_bdy) = ij 
     1529               nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir + nn_hls 
     1530               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls 
    15301531               nbrdta(icount, igrd, ib_bdy) = ir 
    15311532            ENDDO 
     
    15381539            DO ij = jpjedt(iseg), jpjeft(iseg) 
    15391540               icount = icount + 1 
    1540                nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 1 - ir 
    1541                nbjdta(icount, igrd, ib_bdy) = ij 
     1541               nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 1 - ir + nn_hls 
     1542               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls 
    15421543               nbrdta(icount, igrd, ib_bdy) = ir 
    15431544            ENDDO 
     
    15511552            DO ij = jpjedt(iseg), jpjeft(iseg) 
    15521553               icount = icount + 1 
    1553                nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir 
    1554                nbjdta(icount, igrd, ib_bdy) = ij 
     1554               nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir + nn_hls 
     1555               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls 
    15551556               nbrdta(icount, igrd, ib_bdy) = ir 
    15561557            ENDDO 
     
    15711572            DO ij = jpjwdt(iseg), jpjwft(iseg) 
    15721573               icount = icount + 1 
    1573                nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 
    1574                nbjdta(icount, igrd, ib_bdy) = ij 
     1574               nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 + nn_hls 
     1575               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls 
    15751576               nbrdta(icount, igrd, ib_bdy) = ir 
    15761577            ENDDO 
     
    15831584            DO ij = jpjwdt(iseg), jpjwft(iseg) 
    15841585               icount = icount + 1 
    1585                nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 
    1586                nbjdta(icount, igrd, ib_bdy) = ij 
     1586               nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 + nn_hls 
     1587               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls 
    15871588               nbrdta(icount, igrd, ib_bdy) = ir 
    15881589            ENDDO 
     
    15961597            DO ij = jpjwdt(iseg), jpjwft(iseg) 
    15971598               icount = icount + 1 
    1598                nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 
    1599                nbjdta(icount, igrd, ib_bdy) = ij 
     1599               nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 + nn_hls 
     1600               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls 
    16001601               nbrdta(icount, igrd, ib_bdy) = ir 
    16011602            ENDDO 
     
    16161617            DO ii = jpindt(iseg), jpinft(iseg) 
    16171618               icount = icount + 1 
    1618                nbidta(icount, igrd, ib_bdy) = ii 
    1619                nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir  
     1619               nbidta(icount, igrd, ib_bdy) = ii + nn_hls 
     1620               nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir + nn_hls  
    16201621               nbrdta(icount, igrd, ib_bdy) = ir 
    16211622            ENDDO 
     
    16291630            DO ii = jpindt(iseg), jpinft(iseg) 
    16301631               icount = icount + 1 
    1631                nbidta(icount, igrd, ib_bdy) = ii 
    1632                nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir 
     1632               nbidta(icount, igrd, ib_bdy) = ii + nn_hls 
     1633               nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir + nn_hls 
    16331634               nbrdta(icount, igrd, ib_bdy) = ir 
    16341635            ENDDO 
     
    16431644            DO ii = jpindt(iseg), jpinft(iseg) 
    16441645               icount = icount + 1 
    1645                nbidta(icount, igrd, ib_bdy) = ii 
    1646                nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 1 - ir 
     1646               nbidta(icount, igrd, ib_bdy) = ii + nn_hls 
     1647               nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 1 - ir + nn_hls 
    16471648               nbrdta(icount, igrd, ib_bdy) = ir 
    16481649            ENDDO 
     
    16611662            DO ii = jpisdt(iseg), jpisft(iseg) 
    16621663               icount = icount + 1 
    1663                nbidta(icount, igrd, ib_bdy) = ii 
    1664                nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1 
     1664               nbidta(icount, igrd, ib_bdy) = ii + nn_hls 
     1665               nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1 + nn_hls 
    16651666               nbrdta(icount, igrd, ib_bdy) = ir 
    16661667            ENDDO 
     
    16741675            DO ii = jpisdt(iseg), jpisft(iseg) 
    16751676               icount = icount + 1 
    1676                nbidta(icount, igrd, ib_bdy) = ii 
    1677                nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1 
     1677               nbidta(icount, igrd, ib_bdy) = ii + nn_hls 
     1678               nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1 + nn_hls 
    16781679               nbrdta(icount, igrd, ib_bdy) = ir 
    16791680            ENDDO 
     
    16881689            DO ii = jpisdt(iseg), jpisft(iseg) 
    16891690               icount = icount + 1 
    1690                nbidta(icount, igrd, ib_bdy) = ii 
    1691                nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1 
     1691               nbidta(icount, igrd, ib_bdy) = ii + nn_hls 
     1692               nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1 + nn_hls 
    16921693               nbrdta(icount, igrd, ib_bdy) = ir 
    16931694            ENDDO 
  • NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/DIA/diawri.F90

    r13295 r13565  
    137137      CALL iom_put("e3v_0", e3v_0(:,:,:) ) 
    138138      ! 
     139      IF ( iom_use("tpt_dep") ) THEN 
     140         DO jk = 1, jpk 
     141            z3d(:,:,jk) = gdept(:,:,jk,Kmm) 
     142         END DO 
     143         CALL iom_put( "tpt_dep",     z3d(:,:,:) ) 
     144      ENDIF 
     145 
    139146      IF ( iom_use("e3t") .OR. iom_use("e3tdef") ) THEN  ! time-varying e3t 
    140147         DO jk = 1, jpk 
  • NEMO/branches/2020/dev_r13312_AGRIF-03-04_jchanut_vinterp_tstep/src/OCE/nemogcm.F90

    r13286 r13565  
    9898#if defined key_agrif 
    9999   USE agrif_all_update   ! Master Agrif update 
     100   USE agrif_oce_update 
    100101#endif 
    101102   USE halo_mng 
     
    181182      Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs   ! agrif_oce module copies of time level indices 
    182183      CALL Agrif_step_child_adj(Agrif_Update_All) 
     184      CALL Agrif_step_child_adj(Agrif_Check_parent_bat) 
    183185      ! 
    184186      DO WHILE( istp <= nitend .AND. nstop == 0 ) 
Note: See TracChangeset for help on using the changeset viewer.