Skip to content

Commit 5de0be0

Browse files
committed
Merge branch 'mt5555/tom_sponge_start' (PR #4723)
Add a simplified sponge layer with namelist variable (tom_sponge_start) to set the starting layer This is needed to run at high resolution with the E3SM 72L configuration (72L sponge layer is too thin, it starts at the 1mb layer). 72L configurations will crash at NE256 and higher resolution without making the sponge layer thicker. It will also be useful for the SCREAM 128L configuration, where the sponge layer is most likely too thick (it starts at the 20mb layer) default: tom_sponge_start=0 (disabled). documentation: https://acme-climate.atlassian.net/wiki/spaces/DOC/pages/2967798203/EAM+Top+of+Model+Sponge+Layer [BFB]
2 parents b77e4b7 + 13f6b81 commit 5de0be0

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, &
@@ -285,6 +286,7 @@ subroutine readnl(par)
285286
nu_div, &
286287
nu_p, &
287288
nu_top, &
289+
tom_sponge_start, &
288290
dcmip16_mu, &
289291
dcmip16_mu_s, &
290292
dcmip16_mu_q, &
@@ -793,6 +795,7 @@ subroutine readnl(par)
793795
call MPI_bcast(nu_div, 1, MPIreal_t , par%root,par%comm,ierr)
794796
call MPI_bcast(nu_p, 1, MPIreal_t , par%root,par%comm,ierr)
795797
call MPI_bcast(nu_top, 1, MPIreal_t , par%root,par%comm,ierr)
798+
call MPI_bcast(tom_sponge_start,1, MPIreal_t , par%root,par%comm,ierr)
796799

797800
call MPI_bcast(dcmip16_mu, 1, MPIreal_t , par%root,par%comm,ierr)
798801
call MPI_bcast(dcmip16_mu_s, 1, MPIreal_t , par%root,par%comm,ierr)
@@ -1208,6 +1211,7 @@ subroutine readnl(par)
12081211
write(iulog,'(a,2e9.2)')"viscosity: nu_q = ",nu_q
12091212
write(iulog,'(a,2e9.2)')"viscosity: nu_p = ",nu_p
12101213
write(iulog,'(a,2e9.2)')"viscosity: nu_top = ",nu_top
1214+
write(iulog,'(a,2e9.2)')"viscosity: tom_sponge_start = ",tom_sponge_start
12111215

12121216
if(dcmip16_mu/=0) write(iulog,'(a,2e9.2)')"1st order viscosity: dcmip16_mu = ",dcmip16_mu
12131217
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
@@ -119,35 +119,28 @@ subroutine model_init2(elem,hybrid,deriv,hvcoord,tl,nets,nete )
119119
nlev_tom=0
120120
if (hybrid%masterthread) write(iulog,*) "sponge layer nu_top viscosity scaling factor"
121121
do k=1,nlev
122-
!press = (hvcoord%hyam(k)+hvcoord%hybm(k))*hvcoord%ps0
123-
!ptop = hvcoord%hyai(1)*hvcoord%ps0
124-
! sponge layer starts at p=4*ptop
125-
!
126-
! some test cases have ptop=200mb
127-
if (hvcoord%etai(1)==0) then
128-
! pure sigma coordinates could have etai(1)=0
129-
ptop_over_press = hvcoord%etam(1) / hvcoord%etam(k)
122+
if (tom_sponge_start==0) then
123+
! some test cases have ptop=200mb
124+
if (hvcoord%etai(1)==0) then
125+
! pure sigma coordinates could have etai(1)=0
126+
ptop_over_press = hvcoord%etam(1) / hvcoord%etam(k)
127+
else
128+
ptop_over_press = hvcoord%etai(1) / hvcoord%etam(k)
129+
endif
130+
! active for p<10*ptop (following cd_core.F90 in CAM-FV)
131+
! CAM 26L and 30L: top 3 levels
132+
! E3SM 72L: top 6 levels
133+
!original cam formula
134+
!nu_scale_top(k) = 8*(1+tanh(log(ptop_over_press))) ! active for p<4*ptop
135+
nu_scale_top(k) = 16*ptop_over_press**2 / (ptop_over_press**2 + 1)
130136
else
131-
ptop_over_press = hvcoord%etai(1) / hvcoord%etam(k)
137+
ptop_over_press = (tom_sponge_start/1d3) / hvcoord%etam(k)
138+
nu_scale_top(k)=0.15d0 * ptop_over_press**2
132139
endif
133140

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

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

152145
if (nu_scale_top(k)>0) nlev_tom=k
153146

0 commit comments

Comments
 (0)