-
Notifications
You must be signed in to change notification settings - Fork 20
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
Complete Zhang McFarlane conversion to CCPP #186
Merged
cacraigucar
merged 57 commits into
ESCOMP:development
from
cacraigucar:atmos_phys_zmcleanup4
Jan 24, 2025
Merged
Changes from 36 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
c6f2699
Metadata completed and partial namelist
cacraigucar c6ddcb4
Remove unused variables
cacraigucar 2e96710
Cleanup3 updates and namelist xml file added
cacraigucar 3c6447a
put back in dif inside zm_convr_run
cacraigucar 2abb58d
Remove dif from calling list
cacraigucar 2d7b589
Bring limcnv calculation into init
cacraigucar 5b89cb5
Update ZM metadata, add namelist and preliminary mods for CAM-SIMA co…
cacraigucar 2208d45
Remove prdsnow completely
cacraigucar 70c0450
Add missing declaration for standard_name
cacraigucar 2252688
hook up constituents
cacraigucar c8076de
Updates to get ZM to compile in CAM-SIMA
cacraigucar 102cd40
Merge tag 'atmos_phys0_03_000' into atmos_phys_zmcleanup3
cacraigucar 755a07b
Fixes for cleanup3
cacraigucar e8dc85f
additional changes to get ZM running in CAM-SIMA
cacraigucar 6cf8164
Merge remote-tracking branch 'court/diagnostics' into atmos_phys_zmcl…
cacraigucar c790696
Preliminary zm_diagnostics
cacraigucar 00c566d
preliminary diagnostics for ZM
cacraigucar d9d0e5d
Merge pull request #110 from ESCOMP/development
cacraigucar 721142e
Merge tag 'atmos_phys_0_04_001' into atmos_phys_zmcleanup3
cacraigucar 34e609b
Remove zm_org logic per Rich Neale's advice
cacraigucar aba6bee
Changes to get ZM to run in CAM-SIMA
cacraigucar 094d677
Changes to fix answers - now roundoff
cacraigucar fd27d14
Change Liceense to Apache 2.0
nusbaume 592fe83
Remove old license file.
nusbaume bff9925
cleanup and fix a couple of bugs
cacraigucar 752c550
add some ZM diagnostics
cacraigucar 93a1dbf
Merge pull request #121 from ESCOMP/development
jimmielin f8ce60b
Merge pull request #130 from ESCOMP/development
nusbaume d17b4ed
Next phase of updates to ZM, including introducing zm_tendency_diagno…
cacraigucar 307d8bc
preliminary diagnostics
cacraigucar 67927f1
Merge pull request #146 from ESCOMP/development
mwaxmonsky e10f811
Upgrading to atmos_phys0_07_000 (#158)
jimmielin cb796e9
Add diagnostics for ZM
cacraigucar 5b34c32
Merge remote-tracking branch 'upstream/development' into atmos_phys_z…
cacraigucar f0f9ac6
Further cleanup
cacraigucar 3d44c2b
Finalize ZM diagnostics
cacraigucar 3349c8f
restore diagnostic message
cacraigucar 73d6a7d
Fix error message
cacraigucar d119665
Merge remote-tracking branch 'upstream/development' into atmos_phys_z…
cacraigucar 2380fa6
Make zm_conv_evap variables generic so it can be called by convect_sh…
cacraigucar 5766e67
Update NamesNotInDictionary ane preliminary ChangeLog
cacraigucar c3de846
Upgrading to atmos_phys0_07_001 (#187)
jimmielin 52e951e
Address reviewer comments
cacraigucar a6e3d34
Merge tag 'atmos_phys0_07_001' into atmos_phys_zmcleanup4
cacraigucar 5789a10
Address one more review comment
cacraigucar a7f33e5
Address second round of reviewer comments
cacraigucar 9d03025
one more change from second reviewer comments
cacraigucar 4eaff0d
Update CAM7 SDF
cacraigucar 582a284
Merge remote-tracking branch 'upstream/development' into atmos_phys_z…
cacraigucar 508f8df
Address more reviewer comments
cacraigucar be92b76
address more reviewer comments
cacraigucar 9834767
Merge remote-tracking branch 'refs/remotes/origin/atmos_phys_zmcleanu…
cacraigucar 3cf1473
further reviewer comment cleanup
cacraigucar c5b16f7
More reviewer comments
cacraigucar 1ef9358
One more change
cacraigucar 27e410b
Address more reviewer comments
cacraigucar 7d1ab92
Update NamesNotInDictionary.txt
cacraigucar 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
There are no files selected for viewing
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 @@ | ||
module cloud_fraction_fice | ||
|
||
use ccpp_kinds, only: kind_phys | ||
implicit none | ||
|
||
contains | ||
|
||
!================================================================================================ | ||
|
||
!=============================================================================== | ||
!> \section arg_table_cloud_fraction_fice_run Argument Table | ||
!! \htmlinclude cloud_fraction_fice_run.html | ||
!! | ||
subroutine cloud_fraction_fice_run(ncol, t, tmelt, top_lev, pver, fice, fsnow) | ||
! | ||
! Compute the fraction of the total cloud water which is in ice phase. | ||
! The fraction depends on temperature only. | ||
! This is the form that was used for radiation, the code came from cldefr originally | ||
! | ||
! Author: B. A. Boville Sept 10, 2002 | ||
! modified: PJR 3/13/03 (added fsnow to ascribe snow production for convection ) | ||
!----------------------------------------------------------------------- | ||
|
||
! Arguments | ||
integer, intent(in) :: ncol ! number of active columns | ||
real(kind_phys), intent(in) :: t(:,:) ! temperature | ||
real(kind_phys), intent(in) :: tmelt ! freezing point of water | ||
integer, intent(in) :: top_lev | ||
integer, intent(in) :: pver | ||
nusbaume marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
real(kind_phys), intent(out) :: fice(:,:) ! Fractional ice content within cloud | ||
real(kind_phys), intent(out) :: fsnow(:,:) ! Fractional snow content for convection | ||
|
||
! Local variables | ||
real(kind_phys) :: tmax_fice ! max temperature for cloud ice formation | ||
real(kind_phys) :: tmin_fice ! min temperature for cloud ice formation | ||
real(kind_phys) :: tmax_fsnow ! max temperature for transition to convective snow | ||
real(kind_phys) :: tmin_fsnow ! min temperature for transition to convective snow | ||
|
||
integer :: i,k ! loop indexes | ||
|
||
!----------------------------------------------------------------------- | ||
|
||
tmax_fice = tmelt - 10._kind_phys ! max temperature for cloud ice formation | ||
tmin_fice = tmax_fice - 30._kind_phys ! min temperature for cloud ice formation | ||
tmax_fsnow = tmelt ! max temperature for transition to convective snow | ||
tmin_fsnow = tmelt - 5._kind_phys ! min temperature for transition to convective snow | ||
|
||
fice(:,:top_lev-1) = 0._kind_phys | ||
fsnow(:,:top_lev-1) = 0._kind_phys | ||
|
||
! Define fractional amount of cloud that is ice | ||
do k=top_lev,pver | ||
do i=1,ncol | ||
|
||
! If warmer than tmax then water phase | ||
if (t(i,k) > tmax_fice) then | ||
fice(i,k) = 0.0_kind_phys | ||
|
||
! If colder than tmin then ice phase | ||
else if (t(i,k) < tmin_fice) then | ||
fice(i,k) = 1.0_kind_phys | ||
|
||
! Otherwise mixed phase, with ice fraction decreasing linearly from tmin to tmax | ||
else | ||
fice(i,k) =(tmax_fice - t(i,k)) / (tmax_fice - tmin_fice) | ||
end if | ||
|
||
! snow fraction partitioning | ||
|
||
! If warmer than tmax then water phase | ||
if (t(i,k) > tmax_fsnow) then | ||
fsnow(i,k) = 0.0_kind_phys | ||
|
||
! If colder than tmin then ice phase | ||
else if (t(i,k) < tmin_fsnow) then | ||
fsnow(i,k) = 1.0_kind_phys | ||
|
||
! Otherwise mixed phase, with ice fraction decreasing linearly from tmin to tmax | ||
else | ||
fsnow(i,k) =(tmax_fsnow - t(i,k)) / (tmax_fsnow - tmin_fsnow) | ||
end if | ||
|
||
end do | ||
end do | ||
|
||
end subroutine cloud_fraction_fice_run | ||
|
||
end module cloud_fraction_fice |
This file contains 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,49 @@ | ||
[ccpp-table-properties] | ||
name = cloud_fraction_fice | ||
type = scheme | ||
|
||
[ccpp-arg-table] | ||
name = cloud_fraction_fice_run | ||
type = scheme | ||
[ ncol ] | ||
standard_name = horizontal_loop_extent | ||
units = count | ||
type = integer | ||
dimensions = () | ||
intent = in | ||
[ t ] | ||
standard_name = air_temperature | ||
units = K | ||
type = real | kind = kind_phys | ||
dimensions = (horizontal_loop_extent,vertical_layer_dimension) | ||
intent = in | ||
[ tmelt ] | ||
standard_name = freezing_point_of_water | ||
units = K | ||
type = real | kind = kind_phys | ||
dimensions = () | ||
intent = in | ||
[ top_lev ] | ||
standard_name = index_of_pressure_at_troposphere_cloud_top | ||
nusbaume marked this conversation as resolved.
Show resolved
Hide resolved
|
||
units = index | ||
type = integer | ||
dimensions = () | ||
intent = in | ||
[ pver ] | ||
standard_name = vertical_layer_dimension | ||
units = count | ||
type = integer | ||
dimensions = () | ||
intent = in | ||
[ fice ] | ||
standard_name = mass_fraction_of_ice_content_within_stratiform_cloud | ||
units = fraction | ||
type = real | kind = kind_phys | ||
dimensions = (horizontal_loop_extent,vertical_layer_dimension) | ||
intent = out | ||
[ fsnow ] | ||
standard_name = mass_fraction_of_snow_content_within_stratiform_cloud | ||
units = fraction | ||
type = real | kind = kind_phys | ||
dimensions = (horizontal_loop_extent,vertical_layer_dimension) | ||
intent = out |
70 changes: 70 additions & 0 deletions
70
schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90
This file contains 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,70 @@ | ||
module zm_convr_tendency_diagnostics | ||
use ccpp_kinds, only: kind_phys | ||
|
||
implicit none | ||
private | ||
save | ||
|
||
public :: zm_convr_tendency_diagnostics_init ! init routine | ||
public :: zm_convr_tendency_diagnostics_run ! main routine | ||
|
||
CONTAINS | ||
|
||
!> \section arg_table_zm_convr_tendency_diagnostics_init Argument Table | ||
!! \htmlinclude zm_convr_tendency_diagnostics_init.html | ||
subroutine zm_convr_tendency_diagnostics_init(errmsg, errflg) | ||
use cam_history, only: history_add_field | ||
use cam_history_support, only: horiz_only | ||
|
||
character(len=512), intent(out) :: errmsg | ||
integer, intent(out) :: errflg | ||
|
||
! Local variables: | ||
|
||
errmsg = '' | ||
errflg = 0 | ||
|
||
call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') | ||
call history_add_field ('ZMDQ', 'Q tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'kg kg-1 s-1') | ||
|
||
end subroutine zm_convr_tendency_diagnostics_init | ||
|
||
!> \section arg_table_zm_convr_tendency_diagnostics_run Argument Table | ||
!! \htmlinclude zm_convr_tendency_diagnostics_run.html | ||
subroutine zm_convr_tendency_diagnostics_run(ncol, pver, cpair, heat, qtnd, errmsg, errflg) | ||
|
||
use cam_history, only: history_out_field | ||
|
||
!------------------------------------------------ | ||
! Input / output parameters | ||
!------------------------------------------------ | ||
integer, intent(in) :: ncol | ||
integer, intent(in) :: pver | ||
|
||
real(kind_phys), intent(in) :: cpair | ||
real(kind_phys), intent(in) :: heat(:,:) | ||
real(kind_phys), intent(in) :: qtnd(:,:) | ||
|
||
! CCPP error handling variables | ||
character(len=512), intent(out) :: errmsg | ||
integer, intent(out) :: errflg | ||
nusbaume marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
real(kind_phys) :: ftem(ncol,pver) | ||
|
||
integer :: index_cldliq | ||
nusbaume marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
errmsg = '' | ||
errflg = 0 | ||
|
||
ftem(:,:) = 0._kind_phys | ||
|
||
ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair | ||
call history_out_field('ZMDT ', ftem) | ||
nusbaume marked this conversation as resolved.
Show resolved
Hide resolved
|
||
call history_out_field('ZMDQ ', qtnd) | ||
|
||
end subroutine zm_convr_tendency_diagnostics_run | ||
|
||
!======================================================================= | ||
|
||
end module zm_convr_tendency_diagnostics |
70 changes: 70 additions & 0 deletions
70
schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta
This file contains 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,70 @@ | ||
[ccpp-table-properties] | ||
name = zm_convr_tendency_diagnostics | ||
type = scheme | ||
|
||
[ccpp-arg-table] | ||
name = zm_convr_tendency_diagnostics_init | ||
type = scheme | ||
[ errmsg ] | ||
standard_name = ccpp_error_message | ||
long_name = Error message for error handling in CCPP | ||
units = none | ||
type = character | kind = len=512 | ||
dimensions = () | ||
intent = out | ||
[ errflg ] | ||
standard_name = ccpp_error_code | ||
long_name = Error flag for error handling in CCPP | ||
units = 1 | ||
type = integer | ||
dimensions = () | ||
intent = out | ||
|
||
[ccpp-arg-table] | ||
name = zm_convr_tendency_diagnostics_run | ||
type = scheme | ||
[ ncol ] | ||
standard_name = horizontal_loop_extent | ||
units = count | ||
type = integer | ||
dimensions = () | ||
intent = in | ||
[ pver ] | ||
standard_name = vertical_layer_dimension | ||
units = count | ||
type = integer | ||
dimensions = () | ||
intent = in | ||
[ cpair ] | ||
standard_name = specific_heat_of_dry_air_at_constant_pressure | ||
units = J kg-1 K-1 | ||
type = real | kind = kind_phys | ||
dimensions = () | ||
intent = in | ||
[ heat ] | ||
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure | ||
units = J kg-1 s-1 | ||
type = real | kind = kind_phys | ||
dimensions = (horizontal_loop_extent,vertical_layer_dimension) | ||
intent = in | ||
[ qtnd ] | ||
standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water | ||
units = kg kg-1 s-1 | ||
type = real | kind = kind_phys | ||
dimensions = (horizontal_loop_extent,vertical_layer_dimension) | ||
intent = in | ||
[ errmsg ] | ||
standard_name = ccpp_error_message | ||
long_name = Error message for error handling in CCPP | ||
units = none | ||
type = character | kind = len=512 | ||
dimensions = () | ||
intent = out | ||
[ errflg ] | ||
standard_name = ccpp_error_code | ||
long_name = Error flag for error handling in CCPP | ||
units = 1 | ||
type = integer | ||
dimensions = () | ||
intent = out | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding a reminder to finish the
ChangeLog
or add the same info to the PR description before merging.