-
Notifications
You must be signed in to change notification settings - Fork 34
Complete CCPPization of CAM5 UW PBL scheme (diag_TKE) #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 a972d91
Update interfaces to run phase
jimmielin a3a6794
Refactor HB: move kinematic fluxes and obklen to common vdiff interst…
jimmielin a544023
Draft metadata
jimmielin 8e83bb0
Remove unused metadata that was removed
jimmielin 3e6fb40
Keep removing moved metadata
jimmielin 1f935fc
Keep removing moved metadata (2)
jimmielin 633b8a6
Initial fixes for b4b in SIMA -- up to constituent diffusion
jimmielin 06fdad4
Fix for #332
jimmielin 8de2a05
Handle dropmixnuc; batch of fixes for constituent vertical diffusion …
jimmielin 92c64a8
Change cflx from coupler to from interstitial
jimmielin 0a75ad2
Do not mutate const_array; mutate q1 in vdiff ndropmixed alternate
jimmielin ca7f025
Sketch out UW PBL diagnostics; REARRANGE HB tautotx/tautoty and chang…
jimmielin 7896907
Fix turbtype_real dimension to pverp
jimmielin c47066c
Remove extraneous comments (as they are documented in the actual scheme)
jimmielin f7ca8e7
Fix qrl unit - should be adj by pressure thickness
jimmielin ea0f256
Merge branch 'main' into hplin/diag_tke_rebase_main
jimmielin 7b38644
Address review comments.
jimmielin 466253f
Update schemes/bretherton_park/bretherton_park_diff.meta
jimmielin f70b041
Fix qrl output unit
jimmielin 04d7c80
Address review comments
jimmielin a82989a
Merge branch 'hplin/diag_tke_rebase_main' of github.com:jimmielin/atm…
jimmielin 7742067
Fix namelist comment
jimmielin 401c2ba
Merge branch 'main' into hplin/diag_tke_rebase_main
jimmielin a73195d
Address second reviewer comments
jimmielin 1f445a1
Merge branch 'main' into hplin/diag_tke_rebase_main
jimmielin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"> | ||
| <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. | ||
|
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. | ||
|
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> | ||
Large diffs are not rendered by default.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
schemes/bretherton_park/eddy_diffusivity_adjustment_above_pbl.F90
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
|
nusbaume marked this conversation as resolved.
Outdated
|
||
| module eddy_diffusivity_adjustment_above_pbl | ||
| use ccpp_kinds, only: kind_phys | ||
|
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 | ||
|
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 | ||
|
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 | ||
|
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
86
schemes/bretherton_park/eddy_diffusivity_adjustment_above_pbl.meta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
52 changes: 52 additions & 0 deletions
52
schemes/bretherton_park/eddy_diffusivity_adjustment_above_pbl_namelist.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"> | ||
|
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. | ||
|
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> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.