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 5878 for branches/UKMO/dev_r5518_bdy_sponge_temp/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90 – NEMO

Ignore:
Timestamp:
2015-11-11T19:11:01+01:00 (8 years ago)
Author:
deazer
Message:

Adds simple ramp of diffusion coefficient in BDY rim using TANH weighting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_bdy_sponge_temp/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90

    r5876 r5878  
    102102         &             cn_ice_lim, nn_ice_lim_dta,                           & 
    103103         &             rn_ice_tem, rn_ice_sal, rn_ice_age,                 & 
    104          &             ln_vol, nn_volctl, nn_rimwidth 
     104         &             ln_vol, nn_volctl, nn_rimwidth,                     & 
     105         &             ln_sponge, rn_sponge 
    105106      !! 
    106107      NAMELIST/nambdy_index/ ctypebdy, nbdyind, nbdybeg, nbdyend 
     
    365366        IF(lwp) WRITE(numout,*) '      Width of relaxation zone = ', nn_rimwidth(ib_bdy) 
    366367        IF(lwp) WRITE(numout,*) 
     368        IF( ln_sponge(ib_bdy) ) THEN                     ! check sponge layer choice 
     369             IF(lwp) WRITE(numout,*) 'Sponge layer applied at open boundaries' 
     370             IF(lwp) WRITE(numout,*) 'Multiplier for diffusion in sponge layer : ', rn_sponge 
     371             IF(lwp) WRITE(numout,*) 
     372           ELSE 
     373             IF(lwp) WRITE(numout,*) 'No volume correction applied at open boundaries' 
     374             IF(lwp) WRITE(numout,*) 
     375           ENDIF 
    367376 
    368377      ENDDO 
     
    383392        ENDIF 
    384393     ENDIF 
     394 
     395     sponge_factor(:,:) = 1.0 
    385396 
    386397      ! ------------------------------------------------- 
     
    11031114            END DO 
    11041115         END DO  
     1116      ! Compute multiplier for diffusion for sponge layer 
     1117           ! ------------------------------------------------- 
     1118           IF( ln_sponge(ib_bdy) ) THEN 
     1119              igrd=1 
     1120              DO ib = 1, idx_bdy(ib_bdy)%nblen(igrd) 
     1121                 nbi => idx_bdy(ib_bdy)%nbi(ib,igrd) 
     1122                 nbj => idx_bdy(ib_bdy)%nbj(ib,igrd) 
     1123                 nbr => idx_bdy(ib_bdy)%nbr(ib,igrd) 
     1124                 sponge_factor(nbi,nbj) = 1.0 + (rn_sponge-1.0) * ( 1.- TANH( FLOAT( nbr - 1 ) *0.5 ) ) 
     1125                 ! 0.5 factor says how fast tanh goes to 1 - reduce this to have 
     1126                 ! effect on more of the rimwidth 
     1127              END DO 
     1128           ENDIF 
     1129 
    11051130 
    11061131      ENDDO 
Note: See TracChangeset for help on using the changeset viewer.