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 9694 – NEMO

Changeset 9694


Ignore:
Timestamp:
2018-05-30T17:44:50+02:00 (6 years ago)
Author:
clem
Message:

change the nesting tools to choose the number of points copied from mother to child grids in the namelist (npt_copy) and change the name of nb_connection_pts to npt_connect

Location:
utils/tools/NESTING
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • utils/tools/NESTING/nordic1

    r9688 r9694  
    1111    new_topo = true 
    1212    elevation_database = 'GEBCO_2014_2D.nc' 
    13     elevation_name = 'elevation' 
    14     smoothing = true 
    15     smoothing_factor = 0.6 
    16     nb_connection_pts = 2     
    17     removeclosedseas = true 
    18     type_bathy_interp = 2  
    19     rn_hmin = -3  
     13    elevation_name     = 'elevation' 
     14    smoothing          = true 
     15    smoothing_factor   = 0.6 
     16    npt_connect        = 1      ! default = 3 
     17    npt_copy           = 1      ! default = 2 
     18    removeclosedseas   = true 
     19    type_bathy_interp  = 2  
     20    rn_hmin            = -3  
    2021/    
    2122 
     
    2728    rho  = 4 
    2829    rhot = 4 
    29     bathy_update = true 
     30    bathy_update        = true 
    3031    updated_parent_file = 'bathy_updated.nc'           
    3132/ 
     
    3334&vertical_grid     
    3435    ln_e3_dep = .true. 
    35     ppkth = 21.4333619793800 
    36     ppacr = 3 
    37     ppdzmin = 0 
    38     pphmax  = 0 
    39     psur = -4762.96143546300 
    40     pa0  = 255.58049070440 
    41     pa1  = 245.58132232490 
    42     N  = 31 
    43     ldbletanh   = .FALSE. 
    44     pa2         = 0 
    45     ppkth2      = 0 
    46     ppacr2      = 0 
     36    ppkth     = 21.4333619793800 
     37    ppacr     = 3 
     38    ppdzmin   = 0 
     39    pphmax    = 0 
     40    psur      = -4762.96143546300 
     41    pa0       = 255.58049070440 
     42    pa1       = 245.58132232490 
     43    N         = 31 
     44    ldbletanh = .FALSE. 
     45    pa2       = 0 
     46    ppkth2    = 0 
     47    ppacr2    = 0 
    4748/     
    4849     
    4950&partial_cells        
    50     partial_steps = true 
     51    partial_steps      = true 
    5152    parent_bathy_meter = 'bathy_meter.nc' 
    5253    parent_batmet_name = 'Bathymetry' 
    53     e3zps_min = 20. 
    54     e3zps_rat = 0.1 
     54    e3zps_min          = 20. 
     55    e3zps_rat          = 0.1 
    5556/ 
    5657 
  • utils/tools/NESTING/nordic1_update

    r9688 r9694  
    1111    new_topo = true 
    1212    elevation_database = '1_bathy_updated.nc' 
    13     elevation_name = 'Bathymetry' 
    14     smoothing = true 
    15     smoothing_factor = 0.6 
    16     nb_connection_pts = 2     
    17     removeclosedseas = true 
    18     type_bathy_interp = 2  
    19     rn_hmin = -3  
     13    elevation_name     = 'Bathymetry' 
     14    smoothing          = true 
     15    smoothing_factor   = 0.6 
     16    npt_connect        = 1     
     17    npt_copy           = 1 
     18    removeclosedseas   = true 
     19    type_bathy_interp  = 2  
     20    rn_hmin            = -3  
    2021/    
    2122 
     
    3334&vertical_grid     
    3435    ln_e3_dep = .true. 
    35     ppkth = 21.4333619793800 
    36     ppacr = 3 
    37     ppdzmin = 0 
    38     pphmax  = 0 
    39     psur = -4762.96143546300 
    40     pa0  = 255.58049070440 
    41     pa1  = 245.58132232490 
    42     N  = 31 
    43     ldbletanh   = .FALSE. 
    44     pa2         = 0 
    45     ppkth2      = 0 
    46     ppacr2      = 0 
     36    ppkth     = 21.4333619793800 
     37    ppacr     = 3 
     38    ppdzmin   = 0 
     39    pphmax    = 0 
     40    psur      = -4762.96143546300 
     41    pa0       = 255.58049070440 
     42    pa1       = 245.58132232490 
     43    N         = 31 
     44    ldbletanh = .FALSE. 
     45    pa2       = 0 
     46    ppkth2    = 0 
     47    ppacr2    = 0 
    4748/     
    4849     
    4950&partial_cells        
    50     partial_steps = true 
     51    partial_steps      = true 
    5152    parent_bathy_meter = 'bathy_updated.nc' 
    5253    parent_batmet_name = 'Bathymetry' 
    53     e3zps_min = 20. 
    54     e3zps_rat = 0.1 
     54    e3zps_min          = 20. 
     55    e3zps_rat          = 0.1 
    5556/ 
    5657 
  • utils/tools/NESTING/nordic2

    r9688 r9694  
    99     
    1010&bathymetry     
    11     new_topo = true 
     11    new_topo           = true 
    1212    elevation_database = 'GEBCO_2014_2D.nc' 
    13     elevation_name = 'elevation' 
    14     smoothing = true 
    15     smoothing_factor = 0.6 
    16     nb_connection_pts = 2  
    17     removeclosedseas = true 
    18     type_bathy_interp = 2 
    19     rn_hmin = -3 
     13    elevation_name     = 'elevation' 
     14    smoothing          = true 
     15    smoothing_factor   = 0.6 
     16    npt_connect        = 1  
     17    npt_copy           = 1 
     18    removeclosedseas   = true 
     19    type_bathy_interp  = 2 
     20    rn_hmin            = -3 
    2021/    
    2122 
     
    3334&vertical_grid     
    3435    ln_e3_dep = .true. 
    35     ppkth = 21.4333619793800 
    36     ppacr = 3 
    37     ppdzmin = 0 
    38     pphmax  = 0 
    39     psur = -4762.96143546300 
    40     pa0  = 255.58049070440 
    41     pa1  = 245.58132232490 
    42     N  = 31 
    43     ldbletanh   = .FALSE. 
    44     pa2         = 0 
    45     ppkth2      = 0 
    46     ppacr2      = 0 
     36    ppkth     = 21.4333619793800 
     37    ppacr     = 3 
     38    ppdzmin   = 0 
     39    pphmax    = 0 
     40    psur      = -4762.96143546300 
     41    pa0       = 255.58049070440 
     42    pa1       = 245.58132232490 
     43    N         = 31 
     44    ldbletanh = .FALSE. 
     45    pa2       = 0 
     46    ppkth2    = 0 
     47    ppacr2    = 0 
    4748/     
    4849     
    4950&partial_cells        
    50     partial_steps = true 
     51    partial_steps      = true 
    5152    parent_bathy_meter = '1_bathy_meter.nc' 
    5253    parent_batmet_name = 'Bathymetry' 
    53     e3zps_min = 20. 
    54     e3zps_rat = 0.1 
     54    e3zps_min          = 20. 
     55    e3zps_rat          = 0.1 
    5556/ 
    5657 
  • utils/tools/NESTING/src/agrif_connect_topo.f90

    r9166 r9694  
    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 
    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 
    915              ! 
    916              compt = compt + 1 
    917              ! 
    918 !          ENDIF 
     904          G0%Bathy_meter(ipt,jpt) = SUM(G1%Bathy_meter(ji-irafx/2+diff:ji+irafx/2,jj-irafy/2+diff:jj+irafy/2))/(irafx*irafy) 
     905          IF(G0%Bathy_meter(ipt,jpt).GT.0.)   G0%Bathy_meter(ipt,jpt) = MAX(G0%Bathy_meter(ipt,jpt),zmin) 
     906          ! 
     907          compt = compt + 1 
    919908          ! 
    920909       ENDDO 
  • utils/tools/NESTING/src/agrif_create_bathy.f90

    r9628 r9694  
    172172     CALL init_constant_bathy(G0%bathy_meter,bathy_fin_constant) 
    173173     ! 
    174      boundary = connectionsize*irafx + nbghostcellsfine + 1  
     174     boundary = npt_copy*irafx + nbghostcellsfine + 1  
    175175     ! 
    176176     ! connection carried out by copying parent grid values for the fine points 
     
    285285              Cell_lonmax = MAX(G1%glamf(ji-1,jj-1),G1%glamf(ji,jj-1),G1%glamf(ji,jj),G1%glamf(ji-1,jj)) 
    286286              Cell_latmin = MIN(G1%gphif(ji-1,jj-1),G1%gphif(ji,jj-1),G1%gphif(ji,jj),G1%gphif(ji-1,jj)) 
    287               Cell_latmax = MAX(G1%gphif(ji-1,jj-1),G1%gphif(ji,jj-1),G1%gphif(ji,jj),G1%gphif(ji-1,jj))                     
     287              Cell_latmax = MAX(G1%gphif(ji-1,jj-1),G1%gphif(ji,jj-1),G1%gphif(ji,jj),G1%gphif(ji-1,jj))  
    288288              !                
    289289              ! SEARCH FOR ALL POINTS CONTAINED IN THIS CELL 
     
    329329                 ALLOCATE( vardep(nxhr,nyhr) ) 
    330330                 ALLOCATE( mask_oce(nxhr,nyhr) ) 
    331                  mask_oce = 0         
     331                 mask_oce = 0        
    332332 
    333333                 vardep(:,:) = G0%bathy_meter(iimin:iimax,jjmin:jjmax) 
     
    356356                          G1%bathy_meter(ji,jj) = ( vardep1d(SUM(mask_oce)/2) + vardep1d(SUM(mask_oce)/2+1) )/2.0 
    357357                       END IF 
    358                        DEALLOCATE(vardep1d)         
     358                       DEALLOCATE(vardep1d)    
    359359                    ENDIF 
    360360                 ENDIF 
     
    458458        CALL Check_interp(G0,gdepw_ps_interp)      ! interpolation in connection zone (3 coarse grid cells) 
    459459        ! 
    460         boundary = connectionsize*irafx + nbghostcellsfine + 1                      
     460        boundary = npt_copy*irafx + nbghostcellsfine + 1                      
    461461! J chanut: exclude matching if no open boundaries 
    462462        IF (.NOT.ASSOCIATED(G1%wgt)) & 
     
    504504 
    505505        IF(.NOT. smoothing) WRITE(*,*) 'No smoothing process only connection is carried out' 
    506         WRITE(*,*) ' linear connection on ',nb_connection_pts,'coarse grid points' 
    507  
    508         connectionsize = 2 + nb_connection_pts  
     506        WRITE(*,*) ' linear connection on ',npt_connect,'coarse grid points' 
     507 
    509508        !             
    510509        gdepw_ps_interp = 0. 
     
    521520        ! 
    522521        wghts = 1. 
    523         DO ji = boundary + 1 , boundary + nb_connection_pts * irafx 
    524             wghts = wghts - (1. / (nb_connection_pts*irafx - 1. ) ) 
     522        DO ji = boundary + 1 , boundary + npt_connect * irafx 
     523            wghts = wghts - (1. / (npt_connect*irafx - 1. ) ) 
    525524            DO jj=1,nyfin 
    526525               IF (G1%gdepw_ps(nbghostcellsfine+1,jj) > 0.) THEN 
     
    531530       
    532531        wghts = 1. 
    533         DO ji = nxfin - boundary , nxfin - boundary - nb_connection_pts * irafx +1 , -1 
    534             wghts = wghts - (1. / (nb_connection_pts*irafx - 1. ) ) 
     532        DO ji = nxfin - boundary , nxfin - boundary - npt_connect * irafx +1 , -1 
     533            wghts = wghts - (1. / (npt_connect*irafx - 1. ) ) 
    535534            DO jj=1,nyfin 
    536535               IF (G1%gdepw_ps(nxfin-nbghostcellsfine,jj) > 0.) THEN 
     
    541540 
    542541        wghts = 1. 
    543         DO jj = boundary + 1 , boundary + nb_connection_pts * irafy 
    544             wghts = wghts - (1. / (nb_connection_pts*irafy - 1. ) ) 
     542        DO jj = boundary + 1 , boundary + npt_connect * irafy 
     543            wghts = wghts - (1. / (npt_connect*irafy - 1. ) ) 
    545544            DO ji=1,nxfin 
    546545               IF (G1%gdepw_ps(ji,nbghostcellsfine+1) > 0.) THEN 
     
    551550 
    552551        wghts = 1. 
    553         DO jj = nyfin - boundary , nyfin - boundary - nb_connection_pts * irafy +1, -1 
    554             wghts = wghts - (1. / (nb_connection_pts*irafy - 1. ) ) 
     552        DO jj = nyfin - boundary , nyfin - boundary - npt_connect * irafy +1, -1 
     553            wghts = wghts - (1. / (npt_connect*irafy - 1. ) ) 
    555554            DO ji=1,nxfin 
    556555               IF (G1%gdepw_ps(ji,nyfin-nbghostcellsfine) > 0.) THEN 
     
    564563        G1%bathy_meter = G1%gdepw_ps 
    565564        !                      
    566         connectionsize = 2  
    567565        !  
    568566! Chanut: remove smoothing if child grid bathymetry is found to already exist 
     
    570568 
    571569           ! 
    572            ! Smoothing to connect the connection zone (3 + nb_connection_pts coarse grid cells) and the interior domain 
     570           ! Smoothing to connect the connection zone (3 + npt_connect coarse grid cells) and the interior domain 
    573571           ! 
    574572! Chanut: smoothing everywhere then discard result in connection zone 
    575573           CALL smooth_topo(G1%gdepw_ps(1:nxfin,1:nyfin),nbiter) 
    576574           WHERE (G1%wgt(:,:)==0.) G1%bathy_meter(:,:) = G1%gdepw_ps(:,:) 
    577 !           boundary = (connectionsize+nb_connection_pts)*irafx + nbghostcellsfine + 1  
     575!           boundary = (npt_copy+npt_connect)*irafx + nbghostcellsfine + 1  
    578576!           CALL smooth_topo(G1%gdepw_ps(boundary:nxfin-boundary+1,boundary:nyfin-boundary+1),nbiter) 
    579577!           G1%bathy_meter = G1%gdepw_ps                          
     
    658656     CALL init_constant_bathy(G0%bathy_meter,bathy_fin_constant) 
    659657     ! 
    660      boundary = connectionsize*irafx + nbghostcellsfine + 1    
     658     boundary = npt_copy*irafx + nbghostcellsfine + 1    
    661659     !              
    662660     G1%bathy_meter(1:boundary,:) = bathy_fin_constant(1:boundary,:) 
  • utils/tools/NESTING/src/agrif_partial_steps.f90

    r9166 r9694  
    361361    ! 
    362362 
    363     CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,1,2+nbghostcellsfine+connectionsize*irafx-1, & 
     363    CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,1,2+nbghostcellsfine+(npt_copy+npt_connect)*irafx-1, & 
    364364         1,nyfin) 
    365365 
     
    368368    ! 
    369369 
    370     CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,nxfin-1-nbghostcellsfine-(connectionsize*irafx-1),nxfin, & 
     370    CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,nxfin-1-nbghostcellsfine-((npt_copy+npt_connect)*irafx-1),nxfin, & 
    371371         1,nyfin) 
    372372 
     
    376376 
    377377    CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,1,nxfin, & 
    378          nyfin-1 - nbghostcellsfine -(connectionsize*irafy-1),nyfin ) 
     378         nyfin-1 - nbghostcellsfine -((npt_copy+npt_connect)*irafy-1),nyfin ) 
    379379 
    380380    ! 
     
    382382    ! 
    383383    CALL correct_level( gdepwchild,ParentGrid,gdepw,e3t,1,nxfin, & 
    384          1,2+nbghostcellsfine+connectionsize*irafy-1 ) 
     384         1,2+nbghostcellsfine+(npt_copy+npt_connect)*irafy-1 ) 
    385385 
    386386    !        
  • utils/tools/NESTING/src/agrif_types.f90

    r9628 r9694  
    5050  INTEGER N,type_bathy_interp 
    5151  !  
    52   INTEGER jpizoom,jpjzoom,nb_connection_pts 
     52  INTEGER jpizoom,jpjzoom,npt_connect,npt_copy 
    5353  !       
    5454  REAL*8 rn_hmin 
     
    7373  !       
    7474  NAMELIST /bathymetry/new_topo,elevation_database,elevation_name,smoothing,smoothing_factor, & 
    75        nb_connection_pts,removeclosedseas,type_bathy_interp,rn_hmin       
     75       npt_connect,npt_copy,removeclosedseas,type_bathy_interp,rn_hmin       
    7676  !       
    7777  NAMELIST /nesting/imin,imax,jmin,jmax,rho,rhot,bathy_update,updated_parent_file       
     
    9090 
    9191  NAMELIST /restart_trc/ restart_trc_file,interp_type  
    92  
    93   INTEGER :: connectionsize = 2  
    9492  ! 
    9593CONTAINS 
     
    154152            FORM   = 'FORMATTED'      , & 
    155153            ACTION = 'READ'           , & 
    156             ACCESS = 'SEQUENTIAL'     )      
     154            ACCESS = 'SEQUENTIAL'     ) 
    157155       ! 
    158156       REWIND(unit_nml) 
    159157       READ (unit_nml , NML = input_output) 
    160158       READ (unit_nml , NML = coarse_grid_files) 
    161        READ (unit_nml , NML = bathymetry)    
     159       READ (unit_nml , NML = bathymetry) 
    162160       READ (unit_nml , NML = nesting)  
    163161       READ (unit_nml , NML = vertical_grid) 
Note: See TracChangeset for help on using the changeset viewer.