Skip to content

Commit 13f6b81

Browse files
committed
add simplified sponge layer
including namelist option to specify sponge layer bottom/start
1 parent 679cebf commit 13f6b81

File tree

5 files changed

+30
-25
lines changed

5 files changed

+30
-25
lines changed

components/eam/bld/namelist_files/namelist_defaults_eam.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,7 @@
12451245

12461246
<!-- viscosity -->
12471247

1248+
<tom_sponge_start> 0d0 </tom_sponge_start>
12481249
<nu_top> 2.5e5 </nu_top>
12491250
<nu_top dyn_target="theta-l" hgrid="ne120np4"> 1e5 </nu_top>
12501251
<nu_top dyn_target="theta-l" hgrid="ne240np4"> 4.3e4 </nu_top>

components/eam/bld/namelist_files/namelist_definition.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5784,6 +5784,12 @@ Second-order viscosity applied only near the model top [m^2/s].
57845784
Default: Set by build-namelist.
57855785
</entry>
57865786

5787+
<entry id="tom_sponge_start" type="real" category="se"
5788+
group="ctl_nl" valid_values="" >
5789+
Bottom of sponge layer in hPa.
5790+
Default: 0 (use default value based on reference pressure at model top).
5791+
</entry>
5792+
57875793
<entry id="fine_ne" type="integer" category="se"
57885794
group="ctl_nl" valid_values="" >
57895795
baseline ne for scalar hypervis tuning

components/homme/src/share/control_mod.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ module control_mod
161161
real (kind=real_kind), public :: nu_q = -1 ! default = nu tracer viscosity
162162
real (kind=real_kind), public :: nu_p = -1 ! default = nu ps equ. viscosity
163163
real (kind=real_kind), public :: nu_top = 0.0D5 ! top-of-the-model viscosity
164+
real (kind=real_kind), public :: tom_sponge_start=0 ! start of sponge layer, in hPa
164165

165166
integer, public :: hypervis_subcycle=1 ! number of subcycles for hyper viscsosity timestep
166167
integer, public :: hypervis_subcycle_tom=0 ! number of subcycles for TOM diffusion

components/homme/src/share/namelist_mod.F90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ module namelist_mod
6464
nu_div, &
6565
nu_p, &
6666
nu_top, &
67+
tom_sponge_start, &
6768
dcmip16_mu, &
6869
dcmip16_mu_s, &
6970
dcmip16_mu_q, &
@@ -284,6 +285,7 @@ subroutine readnl(par)
284285
nu_div, &
285286
nu_p, &
286287
nu_top, &
288+
tom_sponge_start, &
287289
dcmip16_mu, &
288290
dcmip16_mu_s, &
289291
dcmip16_mu_q, &
@@ -790,6 +792,7 @@ subroutine readnl(par)
790792
call MPI_bcast(nu_div, 1, MPIreal_t , par%root,par%comm,ierr)
791793
call MPI_bcast(nu_p, 1, MPIreal_t , par%root,par%comm,ierr)
792794
call MPI_bcast(nu_top, 1, MPIreal_t , par%root,par%comm,ierr)
795+
call MPI_bcast(tom_sponge_start,1, MPIreal_t , par%root,par%comm,ierr)
793796

794797
call MPI_bcast(dcmip16_mu, 1, MPIreal_t , par%root,par%comm,ierr)
795798
call MPI_bcast(dcmip16_mu_s, 1, MPIreal_t , par%root,par%comm,ierr)
@@ -1211,6 +1214,7 @@ subroutine readnl(par)
12111214
write(iulog,'(a,2e9.2)')"viscosity: nu_q = ",nu_q
12121215
write(iulog,'(a,2e9.2)')"viscosity: nu_p = ",nu_p
12131216
write(iulog,'(a,2e9.2)')"viscosity: nu_top = ",nu_top
1217+
write(iulog,'(a,2e9.2)')"viscosity: tom_sponge_start = ",tom_sponge_start
12141218

12151219
if(dcmip16_mu/=0) write(iulog,'(a,2e9.2)')"1st order viscosity: dcmip16_mu = ",dcmip16_mu
12161220
if(dcmip16_mu_s/=0)write(iulog,'(a,2e9.2)')"1st order viscosity: dcmip16_mu_s = ",dcmip16_mu_s

components/homme/src/theta-l/share/model_init_mod.F90

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module model_init_mod
2323
use viscosity_mod, only: make_c0_vector
2424
use kinds, only: real_kind,iulog
2525
use control_mod, only: qsplit,theta_hydrostatic_mode, hv_ref_profiles, &
26-
hv_theta_correction
26+
hv_theta_correction, tom_sponge_start
2727
use time_mod, only: timelevel_qdp, timelevel_t
2828
use physical_constants, only: g, TREF, Rgas, kappa
2929
use imex_mod, only: test_imex_jacobian
@@ -121,35 +121,28 @@ subroutine model_init2(elem,hybrid,deriv,hvcoord,tl,nets,nete )
121121
nlev_tom=0
122122
if (hybrid%masterthread) write(iulog,*) "sponge layer nu_top viscosity scaling factor"
123123
do k=1,nlev
124-
!press = (hvcoord%hyam(k)+hvcoord%hybm(k))*hvcoord%ps0
125-
!ptop = hvcoord%hyai(1)*hvcoord%ps0
126-
! sponge layer starts at p=4*ptop
127-
!
128-
! some test cases have ptop=200mb
129-
if (hvcoord%etai(1)==0) then
130-
! pure sigma coordinates could have etai(1)=0
131-
ptop_over_press = hvcoord%etam(1) / hvcoord%etam(k)
124+
if (tom_sponge_start==0) then
125+
! some test cases have ptop=200mb
126+
if (hvcoord%etai(1)==0) then
127+
! pure sigma coordinates could have etai(1)=0
128+
ptop_over_press = hvcoord%etam(1) / hvcoord%etam(k)
129+
else
130+
ptop_over_press = hvcoord%etai(1) / hvcoord%etam(k)
131+
endif
132+
! active for p<10*ptop (following cd_core.F90 in CAM-FV)
133+
! CAM 26L and 30L: top 3 levels
134+
! E3SM 72L: top 6 levels
135+
!original cam formula
136+
!nu_scale_top(k) = 8*(1+tanh(log(ptop_over_press))) ! active for p<4*ptop
137+
nu_scale_top(k) = 16*ptop_over_press**2 / (ptop_over_press**2 + 1)
132138
else
133-
ptop_over_press = hvcoord%etai(1) / hvcoord%etam(k)
139+
ptop_over_press = (tom_sponge_start/1d3) / hvcoord%etam(k)
140+
nu_scale_top(k)=0.15d0 * ptop_over_press**2
134141
endif
135142

136-
! active for p<10*ptop (following cd_core.F90 in CAM-FV)
137-
! CAM 26L and 30L: top 3 levels
138-
! E3SM 72L: top 6 levels
139-
!original cam formula
140-
!nu_scale_top(k) = 8*(1+tanh(log(ptop_over_press))) ! active for p<4*ptop
141-
nu_scale_top(k) = 16*ptop_over_press**2 / (ptop_over_press**2 + 1)
142-
143143
if (nu_scale_top(k)<0.15d0) nu_scale_top(k)=0
144+
if (nu_scale_top(k)>8d0) nu_scale_top(k)=8d0
144145

145-
!nu_scale_top(k) = 8*(1+.911*tanh(log(ptop_over_press))) ! active for p<6.5*ptop
146-
!if (nu_scale_top(k)<1d0) nu_scale_top(k)=0
147-
148-
! original CAM3/preqx formula
149-
!if (k==1) nu_scale_top(k)=4
150-
!if (k==2) nu_scale_top(k)=2
151-
!if (k==3) nu_scale_top(k)=1
152-
!if (k>3) nu_scale_top(k)=0
153146

154147
if (nu_scale_top(k)>0) nlev_tom=k
155148

0 commit comments

Comments
 (0)