Ignore:
Timestamp:
2018-08-02T15:25:27+02:00 (2 years ago)
Author:
clem
Message:

nesting tools are partly rewritten (mostly for create_coordinates and bathy) to get better functionality. Now you can use the nesting to either define an agrif zoom or a regional domain (for bdy purposes). Also, the nesting tools output a domain_cfg.nc that can be directly used in NEMO4 without the need of DOMAINcfg tool. The option of median average for bathymetry interpolation still does not work properly but it's not new

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/tools/NESTING/src/agrif_connect_topo.f90

    r9753 r10025  
    5151    TYPE(Coordinates) :: Grid      
    5252    ! 
    53     ! 
    54     diff = 0 
    55     IF(MOD(rho,2) .EQ. 0) diff = 1 
    56     ! 
    57     indx = 1 + nbghostcellsfine + CEILING(irafx/2.0) + diff       
    58     indy = 1 + nbghostcellsfine + CEILING(irafy/2.0) + diff 
    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)  
    63     !     
    64     ALLOCATE(bathy_fin_constant(bornex-FLOOR(irafx/2.0):bornex2+FLOOR(irafx/2.0), & 
    65          borney-FLOOR(irafy/2.0):borney2+FLOOR(irafy/2.0))) 
    66     ! 
    67     DO j = borney,borney2,irafy 
    68  
    69        jpt = jmin + 1 + nbghostcellsfine + (j-indy)/irafy 
    70        IF(j<=1) jpt = jmin + 1 
    71  
    72        DO i = bornex,bornex2,irafx 
    73  
    74           ipt = imin + 1 + nbghostcellsfine + (i-indx)/irafx 
    75           IF(i<=1) ipt = imin + 1 
    76           !        
    77           DO jj = j-FLOOR(irafy/2.0),j+FLOOR(irafy/2.0)-diff 
    78              DO ii = i-FLOOR(irafx/2.0),i+FLOOR(irafx/2.0)-diff 
    79  
    80                 bathy_fin_constant(ii,jj) = coarse_bathy(ipt,jpt) 
    81  
     53    IF( ln_agrif_domain ) THEN 
     54    ! 
     55       diff = 0 
     56       IF(MOD(rho,2) .EQ. 0) diff = 1 
     57       ! 
     58       indx = 1 + nbghostcellsfine + CEILING(irafx/2.0) + diff       
     59       indy = 1 + nbghostcellsfine + CEILING(irafy/2.0) + diff 
     60       bornex = 1+nbghostcellsfine + CEILING(irafx/2.0) + diff - irafx 
     61       borney = 1+nbghostcellsfine + CEILING(irafy/2.0) + diff - irafy 
     62       bornex2 = nxfin - (nbghostcellsfine) + irafx - CEILING(irafx/2.0)  
     63       borney2 = nyfin - (nbghostcellsfine) + irafy - CEILING(irafy/2.0)  
     64       !     
     65       ALLOCATE(bathy_fin_constant(bornex-FLOOR(irafx/2.0):bornex2+FLOOR(irafx/2.0), & 
     66          borney-FLOOR(irafy/2.0):borney2+FLOOR(irafy/2.0))) 
     67       ! 
     68       DO j = borney,borney2,irafy 
     69           
     70          jpt = jmin + 1 + nbghostcellsfine + (j-indy)/irafy 
     71          IF(j<=1) jpt = jmin + 1 
     72           
     73          DO i = bornex,bornex2,irafx 
     74              
     75             ipt = imin + 1 + nbghostcellsfine + (i-indx)/irafx 
     76             IF(i<=1) ipt = imin + 1 
     77             !        
     78             DO jj = j-FLOOR(irafy/2.0),j+FLOOR(irafy/2.0)-diff 
     79                DO ii = i-FLOOR(irafx/2.0),i+FLOOR(irafx/2.0)-diff 
     80                    
     81                   bathy_fin_constant(ii,jj) = coarse_bathy(ipt,jpt) 
     82                    
     83                END DO 
    8284             END DO 
     85              
    8386          END DO 
    84  
    85        END DO 
    86     END DO 
     87       END DO 
     88        
     89    ELSE 
     90 
     91       ALLOCATE(bathy_fin_constant(1:nxfin,1:nyfin)) 
     92 
     93       DO j = 1,nyfin-irafy+1,irafy 
     94          jpt = jmin + FLOOR( (j - 1.) / irafy ) 
     95          ! 
     96          DO i = 1,nxfin-irafx+1,irafx 
     97             ipt = imin + FLOOR( (i - 1.) / irafx ) 
     98             ! 
     99             bathy_fin_constant(i:i+irafx-1,j:j+irafy-1) = coarse_bathy(ipt,jpt) 
     100             ! 
     101          END DO 
     102       END DO 
     103  
     104    ENDIF 
    87105    ! 
    88106    ! 
Note: See TracChangeset for help on using the changeset viewer.