Skip to content
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

Open
wants to merge 49 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
c6f2699
Metadata completed and partial namelist
cacraigucar May 17, 2024
c6ddcb4
Remove unused variables
cacraigucar May 17, 2024
2e96710
Cleanup3 updates and namelist xml file added
cacraigucar May 23, 2024
3c6447a
put back in dif inside zm_convr_run
cacraigucar May 24, 2024
2abb58d
Remove dif from calling list
cacraigucar May 24, 2024
2d7b589
Bring limcnv calculation into init
cacraigucar May 29, 2024
5b89cb5
Update ZM metadata, add namelist and preliminary mods for CAM-SIMA co…
cacraigucar Jun 14, 2024
2208d45
Remove prdsnow completely
cacraigucar Jun 14, 2024
70c0450
Add missing declaration for standard_name
cacraigucar Jun 14, 2024
2252688
hook up constituents
cacraigucar Jun 18, 2024
c8076de
Updates to get ZM to compile in CAM-SIMA
cacraigucar Jul 15, 2024
102cd40
Merge tag 'atmos_phys0_03_000' into atmos_phys_zmcleanup3
cacraigucar Jul 24, 2024
755a07b
Fixes for cleanup3
cacraigucar Aug 5, 2024
e8dc85f
additional changes to get ZM running in CAM-SIMA
cacraigucar Aug 7, 2024
6cf8164
Merge remote-tracking branch 'court/diagnostics' into atmos_phys_zmcl…
cacraigucar Aug 7, 2024
c790696
Preliminary zm_diagnostics
cacraigucar Aug 7, 2024
00c566d
preliminary diagnostics for ZM
cacraigucar Aug 14, 2024
d9d0e5d
Merge pull request #110 from ESCOMP/development
cacraigucar Aug 15, 2024
721142e
Merge tag 'atmos_phys_0_04_001' into atmos_phys_zmcleanup3
cacraigucar Aug 23, 2024
34e609b
Remove zm_org logic per Rich Neale's advice
cacraigucar Aug 23, 2024
aba6bee
Changes to get ZM to run in CAM-SIMA
cacraigucar Aug 28, 2024
094d677
Changes to fix answers - now roundoff
cacraigucar Sep 19, 2024
fd27d14
Change Liceense to Apache 2.0
nusbaume Sep 24, 2024
592fe83
Remove old license file.
nusbaume Sep 24, 2024
bff9925
cleanup and fix a couple of bugs
cacraigucar Sep 27, 2024
752c550
add some ZM diagnostics
cacraigucar Sep 30, 2024
93a1dbf
Merge pull request #121 from ESCOMP/development
jimmielin Sep 30, 2024
f8ce60b
Merge pull request #130 from ESCOMP/development
nusbaume Oct 3, 2024
d17b4ed
Next phase of updates to ZM, including introducing zm_tendency_diagno…
cacraigucar Oct 11, 2024
307d8bc
preliminary diagnostics
cacraigucar Oct 22, 2024
67927f1
Merge pull request #146 from ESCOMP/development
mwaxmonsky Oct 25, 2024
e10f811
Upgrading to atmos_phys0_07_000 (#158)
jimmielin Nov 19, 2024
cb796e9
Add diagnostics for ZM
cacraigucar Nov 26, 2024
5b34c32
Merge remote-tracking branch 'upstream/development' into atmos_phys_z…
cacraigucar Dec 9, 2024
f0f9ac6
Further cleanup
cacraigucar Dec 9, 2024
3d44c2b
Finalize ZM diagnostics
cacraigucar Dec 16, 2024
3349c8f
restore diagnostic message
cacraigucar Dec 18, 2024
73d6a7d
Fix error message
cacraigucar Dec 18, 2024
d119665
Merge remote-tracking branch 'upstream/development' into atmos_phys_z…
cacraigucar Dec 19, 2024
2380fa6
Make zm_conv_evap variables generic so it can be called by convect_sh…
cacraigucar Dec 24, 2024
5766e67
Update NamesNotInDictionary ane preliminary ChangeLog
cacraigucar Dec 24, 2024
c3de846
Upgrading to atmos_phys0_07_001 (#187)
jimmielin Dec 31, 2024
52e951e
Address reviewer comments
cacraigucar Jan 13, 2025
a6e3d34
Merge tag 'atmos_phys0_07_001' into atmos_phys_zmcleanup4
cacraigucar Jan 13, 2025
5789a10
Address one more review comment
cacraigucar Jan 13, 2025
a7f33e5
Address second round of reviewer comments
cacraigucar Jan 14, 2025
9d03025
one more change from second reviewer comments
cacraigucar Jan 14, 2025
4eaff0d
Update CAM7 SDF
cacraigucar Jan 16, 2025
582a284
Merge remote-tracking branch 'upstream/development' into atmos_phys_z…
cacraigucar Jan 16, 2025
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
56 changes: 56 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@

===============================================================

Tag name:
Originator(s): cacraig
Date: Dec 24, 2024
One-line Summary: Complete Zhang McFarlane conversion to CCPP
Github PR URL:

This PR fixes the following NCAR/atmospheric_physics Github issues:
Add ccpp'ized ZM : https://github.com/ESCOMP/atmospheric_physics/issues/66

Code reviewed by:

List all existing files that have been added (A), modified (M), or deleted (D),
and describe the changes:
A schemes/cloud_fraction/cloud_fraction_fice.F90
A schemes/cloud_fraction/cloud_fraction_fice.meta
A schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90
A schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta
A schemes/sima_diagnostics/zm_diagnostics.F90
A schemes/sima_diagnostics/zm_diagnostics.meta
A schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90
A schemes/sima_diagnostics/zm_evap_tendency_diagnostics.meta
A schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90
A schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.meta
A schemes/sima_diagnostics/zm_tendency_diagnostics.F90
A schemes/sima_diagnostics/zm_tendency_diagnostics.meta
A schemes/utilities/to_be_ccppized_temporary.F90
A schemes/utilities/to_be_ccppized_temporary.meta
A schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.F90
A schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.meta
A schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90
A schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta
M schemes/zhang_mcfarlane/zm_conv_convtran.F90
M schemes/zhang_mcfarlane/zm_conv_convtran.meta
M schemes/zhang_mcfarlane/zm_conv_evap.F90
M schemes/zhang_mcfarlane/zm_conv_evap.meta
M schemes/zhang_mcfarlane/zm_conv_momtran.F90
M schemes/zhang_mcfarlane/zm_conv_momtran.meta
M schemes/zhang_mcfarlane/zm_convr.F90
M schemes/zhang_mcfarlane/zm_convr.meta
A schemes/zhang_mcfarlane/zm_convr_namelist.xml
A suites/suite_zhang_mcfarlane.xml
M test/test_schemes/initialize_constituents.F90
A to_be_ccppized/error_messages.F90
A to_be_ccppized/namelist_utils.F90
A to_be_ccppized/units.F90
A to_be_ccppized/wv_sat_methods.F90
A to_be_ccppized/wv_saturation.F90

List and Describe any test failures:

Summarize any changes to answers:

===============================================================
===============================================================

Tag name: atmos_phys0_07_000
Expand Down
463 changes: 273 additions & 190 deletions doc/NamesNotInDictionary.txt

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions schemes/cloud_fraction/cloud_fraction_fice.F90
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

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
49 changes: 49 additions & 0 deletions schemes/cloud_fraction/cloud_fraction_fice.meta
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
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 schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90
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


real(kind_phys) :: ftem(ncol,pver)

integer :: index_cldliq

errmsg = ''
errflg = 0

ftem(:,:) = 0._kind_phys

ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair
call history_out_field('ZMDT ', ftem)
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 schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta
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

Loading
Loading