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 9166 for branches/2017/dev_merge_2017/NEMOGCM/TOOLS/NESTING/src/agrif_connect_topo.f90 – NEMO

Ignore:
Timestamp:
2017-12-22T16:45:51+01:00 (6 years ago)
Author:
jchanut
Message:

NESTING TOOLS:
Fixes to account for user defined number of ghostcells - still set to 1 to be consistent with NEMO
Set child grid bathymetry near boundaries to nearest neighbor interpolation from parent
Update Coarse grid bathymetry so that each cell volume matches child grid average

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/TOOLS/NESTING/src/agrif_connect_topo.f90

    r9149 r9166  
    5757    indx = 2 + CEILING(irafx/2.0) + diff       
    5858    indy = 2 + CEILING(irafy/2.0) + diff 
    59     bornex = nbghostcellsfine + CEILING(irafx/2.0) + diff - irafx 
    60     borney = nbghostcellsfine + CEILING(irafy/2.0) + diff - irafy 
    61     bornex2 = nxfin - (nbghostcellsfine-1) + irafx - CEILING(irafx/2.0)  
    62     borney2 = nyfin - (nbghostcellsfine-1) + irafy - CEILING(irafy/2.0)  
     59    bornex = 1+nbghostcellsfine + CEILING(irafx/2.0) + diff - irafx 
     60    borney = 1+nbghostcellsfine + CEILING(irafy/2.0) + diff - irafy 
     61    bornex2 = nxfin - (nbghostcellsfine) + irafx - CEILING(irafx/2.0)  
     62    borney2 = nyfin - (nbghostcellsfine) + irafy - CEILING(irafy/2.0)  
    6363    !     
    6464    ALLOCATE(bathy_fin_constant(bornex-FLOOR(irafx/2.0):bornex2+FLOOR(irafx/2.0), & 
     
    902902          ipt = imin + 3 - 1 + (ji - ideb) / irafx 
    903903          ! 
    904           IF( G0%Bathy_meter(ipt,jpt) .LE. 0. .AND.                      & 
    905                MAXVAL(G1%Bathy_meter(ji-irafx/2+diff:ji+irafx/2, & 
    906                jj-irafy/2+diff:jj+irafy/2)).GT. 0.  ) THEN 
    907              G0%Bathy_meter(ipt,jpt) = zmin 
     904!          IF( G0%Bathy_meter(ipt,jpt) .LE. 0. .AND.                      & 
     905!               MAXVAL(G1%Bathy_meter(ji-irafx/2+diff:ji+irafx/2, & 
     906!               jj-irafy/2+diff:jj+irafy/2)).GT. 0.  ) THEN 
     907!             G0%Bathy_meter(ipt,jpt) = zmin 
     908             G0%Bathy_meter(ipt,jpt) =&  
     909             SUM(G1%Bathy_meter(ji-irafx/2+diff:ji+irafx/2, & 
     910                                 jj-irafy/2+diff:jj+irafy/2))& 
     911                /irafx/irafy             
     912             IF(G0%Bathy_meter(ipt,jpt).GT.0.) THEN 
     913                 G0%Bathy_meter(ipt,jpt) = MAX( G0%Bathy_meter(ipt,jpt),zmin)    
     914             ENDIF 
    908915             ! 
    909916             compt = compt + 1 
    910917             ! 
    911           ENDIF 
     918!          ENDIF 
    912919          ! 
    913920       ENDDO 
Note: See TracChangeset for help on using the changeset viewer.