Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
86dd6e9
Initial push of UW PBL
jimmielin Nov 11, 2025
a972d91
Update interfaces to run phase
jimmielin Nov 12, 2025
a3a6794
Refactor HB: move kinematic fluxes and obklen to common vdiff interst…
jimmielin Nov 13, 2025
a544023
Draft metadata
jimmielin Nov 18, 2025
8e83bb0
Remove unused metadata that was removed
jimmielin Nov 19, 2025
3e6fb40
Keep removing moved metadata
jimmielin Nov 19, 2025
1f935fc
Keep removing moved metadata (2)
jimmielin Nov 19, 2025
633b8a6
Initial fixes for b4b in SIMA -- up to constituent diffusion
jimmielin Nov 19, 2025
06fdad4
Fix for #332
jimmielin Nov 20, 2025
8de2a05
Handle dropmixnuc; batch of fixes for constituent vertical diffusion …
jimmielin Nov 20, 2025
92c64a8
Change cflx from coupler to from interstitial
jimmielin Nov 20, 2025
0a75ad2
Do not mutate const_array; mutate q1 in vdiff ndropmixed alternate
jimmielin Nov 21, 2025
ca7f025
Sketch out UW PBL diagnostics; REARRANGE HB tautotx/tautoty and chang…
jimmielin Jan 2, 2026
7896907
Fix turbtype_real dimension to pverp
jimmielin Jan 5, 2026
c47066c
Remove extraneous comments (as they are documented in the actual scheme)
jimmielin Jan 5, 2026
f7ca8e7
Fix qrl unit - should be adj by pressure thickness
jimmielin Mar 9, 2026
ea0f256
Merge branch 'main' into hplin/diag_tke_rebase_main
jimmielin Apr 21, 2026
7b38644
Address review comments.
jimmielin Apr 21, 2026
466253f
Update schemes/bretherton_park/bretherton_park_diff.meta
jimmielin Apr 21, 2026
f70b041
Fix qrl output unit
jimmielin Apr 24, 2026
04d7c80
Address review comments
jimmielin Apr 24, 2026
a82989a
Merge branch 'hplin/diag_tke_rebase_main' of github.com:jimmielin/atm…
jimmielin Apr 24, 2026
7742067
Fix namelist comment
jimmielin Apr 24, 2026
401c2ba
Merge branch 'main' into hplin/diag_tke_rebase_main
jimmielin Apr 25, 2026
a73195d
Address second reviewer comments
jimmielin May 12, 2026
1f445a1
Merge branch 'main' into hplin/diag_tke_rebase_main
jimmielin May 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
742 changes: 742 additions & 0 deletions schemes/bretherton_park/bretherton_park_diff.F90

Large diffs are not rendered by default.

830 changes: 830 additions & 0 deletions schemes/bretherton_park/bretherton_park_diff.meta

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions schemes/bretherton_park/bretherton_park_diff_namelist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0"?>

<?xml-stylesheet type="text/xsl"?>

<entry_id_pg version="2.0">
Comment thread
nusbaume marked this conversation as resolved.
<entry id="eddy_lbulk_max">
<type>real</type>
<kind>kind_phys</kind>
<category>pbl</category>
<group>eddy_diff_nl</group>
<standard_name>maximum_master_length_scale_for_eddy_diffusion</standard_name>
<units>m</units>
<desc>
Maximum master length scale designed to address issues in diag_TKE outside the boundary layer. In order not to disturb turbulence characteristics in the lower troposphere, this should be set at least larger than a few km. However, this does not significantly improve the values outside of the boundary layer. Smaller values make some improvement, but it is also noisy. Better results are seen using eddy_leng_max or kv_freetrop_scale.
Comment thread
nusbaume marked this conversation as resolved.
Outdated
Default: 40000 m
</desc>
<values>
<value>40.D3</value>
</values>
</entry>

<entry id="eddy_leng_max">
<type>real</type>
<kind>kind_phys</kind>
<category>pbl</category>
<group>eddy_diff_nl</group>
<standard_name>maximum_dissipation_length_scale_for_eddy_diffusion</standard_name>
<units>m</units>
<desc>
Maximum dissipation length scale designed to address issues with diag_TKE outside the boundary layer, where the default value generates large diffusivities. A value of 30 m is consistent with the length scales used in the HB scheme; however, this will also reduce value in the boundary layer.
Comment thread
nusbaume marked this conversation as resolved.
Outdated
Default: 40000 m
</desc>
<values>
<value>40.D3</value>
<!-- waccm: 100.D0 -->
</values>
</entry>

<entry id="eddy_max_bot_pressure">
<type>real</type>
<kind>kind_phys</kind>
<category>pbl</category>
<group>eddy_diff_nl</group>
<standard_name>air_pressure_threshold_for_maximum_turbulent_length_scale_application</standard_name>
<units>hPa</units>
<desc>
Bottom pressure level at which namelist values for eddy_leng_max and eddy_lbulk_max are applied. Default values are used at lower levels (i.e. the boundary layer).
Default: 100.D3 hPa
</desc>
<values>
<value>100.D3</value>
<!-- waccm: 100.D0 -->
</values>
</entry>

<entry id="eddy_moist_entrain_a2l">
<type>real</type>
<kind>kind_phys</kind>
<category>pbl</category>
<group>eddy_diff_nl</group>
<standard_name>tunable_parameter_for_moist_entrainment_enhancement_in_pbl</standard_name>
<units>1</units>
<desc>
Moist entrainment enhancement parameter. Default: 30.D0
</desc>
<values>
<value>30.D0</value>
</values>
</entry>

<entry id="eddy_wstarent">
<type>logical</type>
<category>pbl</category>
<group>eddy_diff_nl</group>
<standard_name>use_wstar_entrainment_closure_formulation_for_eddy_diffusion_scheme</standard_name>
<units>flag</units>
<desc>
Use wstar (.true.) or TKE (.false.) entrainment closure in UW eddy diffusion scheme.
Default: TRUE
</desc>
<values>
<value>.true.</value>
</values>
</entry>



</entry_id_pg>
3,404 changes: 3,404 additions & 0 deletions schemes/bretherton_park/eddy_diff.F90

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions schemes/bretherton_park/eddy_diffusivity_adjustment_above_pbl.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
! Adjusts eddy diffusivities above the planetary boundary layer
! to address potentially excessive values in the free troposphere and upper atmosphere
! in the UW PBL scheme.
Comment thread
nusbaume marked this conversation as resolved.
Outdated
module eddy_diffusivity_adjustment_above_pbl
use ccpp_kinds, only: kind_phys
Comment thread
nusbaume marked this conversation as resolved.
Outdated

implicit none
private

! public CCPP-compliant subroutines
public :: eddy_diffusivity_adjustment_above_pbl_run

contains

! Adjust eddy diffusivities above the PBL to prevent excessive values
! in the free troposphere and upper atmosphere.
!
! The diffusivities from diag_TKE (UW) can be much larger than from HB in the free
Comment thread
nusbaume marked this conversation as resolved.
Outdated
! troposphere and upper atmosphere. These seem to be larger than observations,
! and in WACCM the gw_drag code is already applying an eddy diffusivity in the
Comment thread
nusbaume marked this conversation as resolved.
Outdated
! upper atmosphere. Optionally, adjust the diffusivities in the free troposphere
! or the upper atmosphere.
!
! NOTE: Further investigation should be done as to why the diffusivities are
! larger in diag_TKE.
!> \section arg_table_eddy_diffusivity_adjustment_above_pbl_run Argument Table
!! \htmlinclude eddy_diffusivity_adjustment_above_pbl_run.html
subroutine eddy_diffusivity_adjustment_above_pbl_run( &
ncol, pverp, &
kv_top_pressure, &
kv_freetrop_scale, &
kv_top_scale, &
zi, pint, pblh, &
kvh, kvm, kvq, &
errmsg, errflg)

! Input arguments
integer, intent(in) :: ncol
integer, intent(in) :: pverp
real(kind_phys), intent(in) :: kv_top_pressure ! Upper atmosphere pressure threshold [Pa]
real(kind_phys), intent(in) :: kv_freetrop_scale ! Free troposphere scale factor
real(kind_phys), intent(in) :: kv_top_scale ! Upper atmosphere scale factor
real(kind_phys), intent(in) :: zi(:, :) ! Geopotential height at interfaces [m]
real(kind_phys), intent(in) :: pint(:, :) ! Pressure at interfaces [Pa]
real(kind_phys), intent(in) :: pblh(:) ! Planetary boundary layer height [m]

! Input/Output arguments
real(kind_phys), intent(inout) :: kvh(:, :) ! Eddy diffusivity for heat at interfaces [m2 s-1]
real(kind_phys), intent(inout) :: kvm(:, :) ! Eddy diffusivity for momentum at interfaces [m2 s-1]
real(kind_phys), intent(inout) :: kvq(:, :) ! Eddy diffusivity for constituents at interfaces [m2 s-1]

! Output arguments
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errflg

! Local variables
integer :: i, k

errmsg = ''
errflg = 0

! Only apply adjustment if scaling factors differ from unity
if ((kv_freetrop_scale /= 1.0_kind_phys) .or. &
((kv_top_scale /= 1.0_kind_phys) .and. (kv_top_pressure > 0.0_kind_phys))) then
do i = 1, ncol
do k = 1, pverp
! Outside of the boundary layer?
if (zi(i, k) > pblh(i)) then
! In the upper atmosphere?
if (pint(i, k) <= kv_top_pressure) then
kvh(i, k) = kvh(i, k) * kv_top_scale
kvm(i, k) = kvm(i, k) * kv_top_scale
kvq(i, k) = kvq(i, k) * kv_top_scale
else
! In the free troposphere
kvh(i, k) = kvh(i, k) * kv_freetrop_scale
kvm(i, k) = kvm(i, k) * kv_freetrop_scale
kvq(i, k) = kvq(i, k) * kv_freetrop_scale
end if
else ! within PBL.
exit
Comment thread
nusbaume marked this conversation as resolved.
Outdated
end if
end do
end do
end if

end subroutine eddy_diffusivity_adjustment_above_pbl_run

end module eddy_diffusivity_adjustment_above_pbl
86 changes: 86 additions & 0 deletions schemes/bretherton_park/eddy_diffusivity_adjustment_above_pbl.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[ccpp-table-properties]
name = eddy_diffusivity_adjustment_above_pbl
type = scheme

[ccpp-arg-table]
name = eddy_diffusivity_adjustment_above_pbl_run
type = scheme
[ ncol ]
standard_name = horizontal_loop_extent
units = count
type = integer
dimensions = ()
intent = in
[ pverp ]
standard_name = vertical_interface_dimension
units = count
type = integer
dimensions = ()
intent = in
[ kv_top_pressure ]
standard_name = air_pressure_threshold_for_eddy_diffusivity_adjustment
units = Pa
type = real | kind = kind_phys
dimensions = ()
intent = in
[ kv_freetrop_scale ]
standard_name = free_troposphere_eddy_diffusivity_scaling_factor_for_eddy_diffusivity_adjustment
units = 1
type = real | kind = kind_phys
dimensions = ()
intent = in
[ kv_top_scale ]
standard_name = upper_atmosphere_eddy_diffusivity_scaling_factor_for_eddy_diffusivity_adjustment
units = 1
type = real | kind = kind_phys
dimensions = ()
intent = in
[ zi ]
standard_name = geopotential_height_wrt_surface_at_interface
units = m
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = in
[ pint ]
standard_name = air_pressure_at_interface
units = Pa
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = in
[ pblh ]
standard_name = atmosphere_boundary_layer_thickness
units = m
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = in
[ kvh ]
standard_name = eddy_heat_diffusivity_at_interfaces
units = m2 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = inout
[ kvm ]
standard_name = eddy_momentum_diffusivity_at_interfaces
units = m2 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = inout
[ kvq ]
standard_name = eddy_constituent_diffusivity_at_interfaces
units = m2 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = inout
[ errmsg ]
standard_name = ccpp_error_message
units = none
type = character | kind = len=512
dimensions = ()
intent = out
[ errflg ]
standard_name = ccpp_error_code
units = 1
type = integer
dimensions = ()
intent = out

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0"?>

<?xml-stylesheet type="text/xsl"?>

<entry_id_pg version="2.0">
Comment thread
nusbaume marked this conversation as resolved.
<entry id="kv_top_pressure">
<type>real</type>
<kind>kind_phys</kind>
<category>pbl</category>
<group>eddy_diff_adj_nl</group>
<standard_name>air_pressure_threshold_for_eddy_diffusivity_adjustment</standard_name>
<units>Pa</units>
<desc>
Pressure (Pa) that defined the upper atmosphere for adjustment of eddy diffusivities from diag_TKE using kv_top_scale.
Comment thread
nusbaume marked this conversation as resolved.
Outdated
Default: 0
</desc>
<values>
<value>0.0</value>
</values>
</entry>
<entry id="kv_top_scale">
<type>real</type>
<kind>kind_phys</kind>
<category>pbl</category>
<group>eddy_diff_adj_nl</group>
<standard_name>upper_atmosphere_eddy_diffusivity_scaling_factor_for_eddy_diffusivity_adjustment</standard_name>
<units>1</units>
<desc>
Scaling factor that is applied (multiplied) to the eddy diffusivities in the upper atmosphere (see kv_top_pressure).
Default: 1.0
</desc>
<values>
<value>1.0</value>
<!-- waccm: 0.0 -->
</values>
</entry>
<entry id="kv_freetrop_scale">
<type>real</type>
<kind>kind_phys</kind>
<category>pbl</category>
<group>eddy_diff_adj_nl</group>
<standard_name>free_troposphere_eddy_diffusivity_scaling_factor_for_eddy_diffusivity_adjustment</standard_name>
<units>1</units>
<desc>
Scaling factor that is applied (multiplied) to the eddy diffusivities in the free troposphere (boundary layer to kv_top_pressure)
Default: 1.0
</desc>
<values>
<value>1.0</value>
</values>
</entry>
</entry_id_pg>
Loading
Loading