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_partial_steps.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_partial_steps.f90

    r9149 r9166  
    352352    IF ( MOD(irafx,2) .EQ. 0 ) diff = 1 
    353353    !        
    354     bornex = nbghostcellsfine + CEILING(irafx/2.0) + diff - irafx 
    355     borney = nbghostcellsfine + CEILING(irafy/2.0) + diff - irafy 
    356     bornex2 = nxfin - (nbghostcellsfine-1) - irafx - CEILING(irafx/2.0)  
    357     borney2 = nyfin - (nbghostcellsfine-1) - irafy - CEILING(irafy/2.0)                       
     354    bornex = nbghostcellsfine + 1 + CEILING(irafx/2.0) + diff - irafx 
     355    borney = nbghostcellsfine + 1 + CEILING(irafy/2.0) + diff - irafy 
     356    bornex2 = nxfin - nbghostcellsfine - irafx - CEILING(irafx/2.0)  
     357    borney2 = nyfin - nbghostcellsfine - irafy - CEILING(irafy/2.0)                       
    358358    ! 
    359359    ! 
     
    361361    ! 
    362362 
    363     CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,1,3+connectionsize*irafx-1, & 
     363    CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,1,2+nbghostcellsfine+connectionsize*irafx-1, & 
    364364         1,nyfin) 
    365365 
     
    368368    ! 
    369369 
    370     CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,nxfin-2-(connectionsize*irafx-1),nxfin, & 
     370    CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,nxfin-1-nbghostcellsfine-(connectionsize*irafx-1),nxfin, & 
    371371         1,nyfin) 
    372372 
     
    376376 
    377377    CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,1,nxfin, & 
    378          nyfin-2-(connectionsize*irafy-1),nyfin ) 
     378         nyfin-1 - nbghostcellsfine -(connectionsize*irafy-1),nyfin ) 
    379379 
    380380    ! 
     
    382382    ! 
    383383    CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,1,nxfin, & 
    384          1,3+connectionsize*irafy-1 ) 
     384         1,2+nbghostcellsfine+connectionsize*irafy-1 ) 
    385385 
    386386    !        
     
    430430    dyfin = 1./irafy 
    431431 
    432     ptx = 3 
    433     pty = 3 
     432    ptx = 1 + nbghostcellsfine + 1 
     433    pty = 1 + nbghostcellsfine + 1 
    434434 
    435435    xmin = (imin-1) * 1 
     
    526526          DO ii = i-FLOOR(irafx/2.0)+diff,i+FLOOR(irafx/2.0) 
    527527             x = ii-i - xdiff/2. 
    528              val = parentgrid%gdepw_ps(ipt,jpt)+slopex * x 
     528!!             val = parentgrid%gdepw_ps(ipt,jpt)+slopex * x 
    529529!! chanut: uncomment this to get nearest neighbor interpolation 
    530 !!             val = parentgrid%gdepw_ps(ipt,jpt)           
     530             val = parentgrid%gdepw_ps(ipt,jpt)           
    531531             gdepwtemp(ii,j) = val 
    532532             IF (gdepwtemp(ii,j) < mindepth) THEN 
     
    585585          DO jj = j-FLOOR(irafy/2.0)+diff,j+FLOOR(irafy/2.0) 
    586586             y = jj-j - xdiff/2. 
    587              val = gdepwtemp(i,j) + slopey*y 
     587!!             val = gdepwtemp(i,j) + slopey*y 
    588588!! chanut: uncomment this to get nearest neighbor interpolation 
    589 !!             val = gdepwtemp(i,j) 
     589             val = gdepwtemp(i,j) 
    590590             gdepwtemp(i,jj) = val      
    591591          ENDDO 
Note: See TracChangeset for help on using the changeset viewer.