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 14630 for utils/tools/DOMAINcfg/src/domzgr.F90 – NEMO

Ignore:
Timestamp:
2021-03-23T16:19:36+01:00 (3 years ago)
Author:
jchanut
Message:

AGFdomcfg: 1) restore use of analytical grids (i.e. case where jphgr_msh>0). That may be useful to set up test cases with AGRIF. 2) Add random topography over a flat bottom if nn_bathy = -1 (in place of a Gaussian bump). This illustrates well where the interface matching and update are done. #2638

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/tools/DOMAINcfg/src/domzgr.F90

    r14623 r14630  
    562562      INTEGER , ALLOCATABLE, DIMENSION(:,:) ::   idta   ! global domain integer data 
    563563      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zdta   ! global domain scalar data 
     564      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zrand  
    564565      !!---------------------------------------------------------------------- 
    565566      ! 
     
    574575         ALLOCATE( idta(jpiglo,jpjglo), STAT=ierror ) 
    575576         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'zgr_bat: unable to allocate idta array' ) 
    576          ALLOCATE( zdta(jpiglo,jpjglo), STAT=ierror ) 
     577         ALLOCATE( zdta(jpiglo,jpjglo), zrand(jpiglo,jpjglo), STAT=ierror ) 
    577578         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'zgr_bat: unable to allocate zdta array' ) 
    578579         ! 
     
    599600         ELSE                                         ! bump centered in the basin 
    600601            IF(lwp) WRITE(numout,*) 
    601             IF(lwp) WRITE(numout,*) '         bathymetry field: flat basin with a bump' 
     602!            IF(lwp) WRITE(numout,*) '         bathymetry field: flat basin with a bump' 
     603            IF(lwp) WRITE(numout,*) '         bathymetry field: flat basin with random noise' 
    602604            ii_bump = jpiglo / 2                           ! i-index of the bump center 
    603605            ij_bump = jpjglo / 2                           ! j-index of the bump center 
     
    605607            h_bump  =  2700._wp                            ! bump height (meters) 
    606608            h_oce   = gdepw_1d(jpk)                        ! background ocean depth (meters) 
    607             IF(lwp) WRITE(numout,*) '            bump characteristics: ' 
    608             IF(lwp) WRITE(numout,*) '               bump center (i,j)   = ', ii_bump, ii_bump 
    609             IF(lwp) WRITE(numout,*) '               bump height         = ', h_bump , ' meters' 
    610             IF(lwp) WRITE(numout,*) '               bump radius         = ', r_bump , ' index' 
    611             IF(lwp) WRITE(numout,*) '            background ocean depth = ', h_oce  , ' meters' 
     609!            IF(lwp) WRITE(numout,*) '            bump characteristics: ' 
     610!            IF(lwp) WRITE(numout,*) '               bump center (i,j)   = ', ii_bump, ii_bump 
     611!            IF(lwp) WRITE(numout,*) '               bump height         = ', h_bump , ' meters' 
     612!            IF(lwp) WRITE(numout,*) '               bump radius         = ', r_bump , ' index' 
     613!            IF(lwp) WRITE(numout,*) '            background ocean depth = ', h_oce  , ' meters' 
    612614            !                                         
     615            CALL RANDOM_SEED() 
     616            CALL RANDOM_NUMBER(zrand) 
    613617            DO jj = 1, jpjglo                              ! zdta : 
    614618               DO ji = 1, jpiglo 
    615                   zi = FLOAT( ji - ii_bump ) * ppe1_m / r_bump 
    616                   zj = FLOAT( jj - ij_bump ) * ppe2_m / r_bump 
    617                   zdta(ji,jj) = h_oce - h_bump * EXP( -( zi*zi + zj*zj ) ) 
     619!                  zi = FLOAT( ji - ii_bump ) * ppe1_m / r_bump 
     620!                  zj = FLOAT( jj - ij_bump ) * ppe2_m / r_bump 
     621!                  zdta(ji,jj) = h_oce - h_bump * EXP( -( zi*zi + zj*zj ) ) 
     622                  zdta(ji,jj) = h_oce + 0.1_wp *h_oce * (zrand(ji,jj)-1._wp)  
    618623               END DO 
    619624            END DO 
     
    657662         misfdep(:,:)=1 
    658663         ! 
    659          DEALLOCATE( idta, zdta ) 
     664         DEALLOCATE( idta, zdta , zrand) 
    660665         ! 
    661666         !                                            ! ================ ! 
Note: See TracChangeset for help on using the changeset viewer.