CCPP updates for PUMAS round3#75
Conversation
…dditional PUMAS settings check.
nusbaume
left a comment
There was a problem hiding this comment.
Thanks for making the changes needed to get PUMAS working in CAM-SIMA @cacraigucar! I have some questions and change requests, but most are just repeated standard name updates (or things I messed up in the first CCPP attempt). Of course if you have any questions or concerns with any of my requests please let me know!
| !> \section arg_table_micro_pumas_ccpp_init Argument Table | ||
| !! \htmlinclude micro_pumas_ccpp_init.html | ||
| subroutine micro_pumas_ccpp_init(gravit, rair, rh2o, cpair, tmelt, latvap, latice, & | ||
| subroutine micro_pumas_ccpp_init(Gravit, rair, rh2o, cpair, tmelt, latvap, latice, & |
There was a problem hiding this comment.
Why capitalize Gravit here?
There was a problem hiding this comment.
I don't know - some random keystroke in vi. Reverted
There was a problem hiding this comment.
I realize this was my doing, but can we change this from 512 to * so that it can be whatever length the host model/framework wants it to be?
| character(len=*), intent(out) :: errmsg !PUMAS/CCPP error message (none) | |
| integer, intent(out) :: errcode !CCPP error code (1) |
| !Set error code to non-zero value if PUMAS returns an error message: | ||
| if (trim(pumas_errstring) /= "") then | ||
| errcode = 1 | ||
| errmsg = trim(pumas_errstring) | ||
| return | ||
| end if |
There was a problem hiding this comment.
I don't think this code block is needed given that it is basically a copy of the code block immediately below it (which doesn't need a return as it is already at the end of the subroutine).
| @@ -7,12 +7,13 @@ module micro_pumas_ccpp | |||
There was a problem hiding this comment.
Can we get rid of the un-needed save here? I again realize this was my doing. Thanks!
| errmsg, errcode) | ||
|
|
||
| !External dependencies: | ||
| use ccpp_kinds, only: kind_phys |
There was a problem hiding this comment.
Do we need ccpp_kinds here anymore?
| units = none | ||
| dimensions = () | ||
| type = character | ||
| kind = len=512 |
There was a problem hiding this comment.
Just noting that this should probably be kind = len=*:
| kind = len=512 | |
| kind = len=* |
There was a problem hiding this comment.
changed everywhere
|
|
||
| implicit none | ||
| private | ||
| save |
There was a problem hiding this comment.
Remove unnecessary save here?
|
|
||
|
|
||
| ! CCPP error handling variables | ||
| character(len=512), intent(out) :: errmsg |
There was a problem hiding this comment.
Make this len=* here?
| character(len=512), intent(out) :: errmsg | |
| character(len=*), intent(out) :: errmsg |
| #Core PUMAS dependencies: | ||
| dependencies = micro_pumas_v1.F90,pumas_kinds.F90 | ||
| dependencies = pumas_gamma_function.F90,micro_pumas_utils.F90 | ||
| dependencies = micro_pumas_diags.F90 | ||
| dependencies = pumas_stochastic_collect_tau.F90,tau_neural_net_quantile.F90 | ||
| dependencies = module_neural_net.F90,ML_fixer_check.F90 | ||
|
|
||
| #External dependencies: | ||
| #Lives in NCAR/ccpp-physics | ||
| dependencies = ../../../to_be_ccppized/wv_sat_methods.F90 |
There was a problem hiding this comment.
I think this can be simplified to the following:
| #Core PUMAS dependencies: | |
| dependencies = micro_pumas_v1.F90,pumas_kinds.F90 | |
| dependencies = pumas_gamma_function.F90,micro_pumas_utils.F90 | |
| dependencies = micro_pumas_diags.F90 | |
| dependencies = pumas_stochastic_collect_tau.F90,tau_neural_net_quantile.F90 | |
| dependencies = module_neural_net.F90,ML_fixer_check.F90 | |
| #External dependencies: | |
| #Lives in NCAR/ccpp-physics | |
| dependencies = ../../../to_be_ccppized/wv_sat_methods.F90 | |
| #Core PUMAS dependencies: | |
| dependencies = pumas_kinds.F90 | |
| dependencies = micro_pumas_diags.F90 |
There was a problem hiding this comment.
Ha, ha - this is the quick stub I threw together based off the full diagnostics package. The plan is to remove it when the diagnostics are officially committed. I'll clean it up, even though it will be shortlived.
|
|
||
| module micro_pumas_tempfix | ||
|
|
||
| use micro_pumas_diags, only: proc_rates_type |
There was a problem hiding this comment.
Can we move this use statement down to the subroutine level?
cacraigucar
left a comment
There was a problem hiding this comment.
Once this is approved (and I've run my CAM and CAM-SIMA tests), I will include updating to this PUMAS tag in my misc ESCOMP/CAM PR I am putting together.
|
|
||
| module micro_pumas_tempfix | ||
|
|
||
| use micro_pumas_diags, only: proc_rates_type |
|
|
||
| implicit none | ||
| private | ||
| save |
|
|
||
|
|
||
| ! CCPP error handling variables | ||
| character(len=512), intent(out) :: errmsg |
| #Core PUMAS dependencies: | ||
| dependencies = micro_pumas_v1.F90,pumas_kinds.F90 | ||
| dependencies = pumas_gamma_function.F90,micro_pumas_utils.F90 | ||
| dependencies = micro_pumas_diags.F90 | ||
| dependencies = pumas_stochastic_collect_tau.F90,tau_neural_net_quantile.F90 | ||
| dependencies = module_neural_net.F90,ML_fixer_check.F90 | ||
|
|
||
| #External dependencies: | ||
| #Lives in NCAR/ccpp-physics | ||
| dependencies = ../../../to_be_ccppized/wv_sat_methods.F90 |
There was a problem hiding this comment.
Ha, ha - this is the quick stub I threw together based off the full diagnostics package. The plan is to remove it when the diagnostics are officially committed. I'll clean it up, even though it will be shortlived.
| !> \section arg_table_micro_pumas_ccpp_init Argument Table | ||
| !! \htmlinclude micro_pumas_ccpp_init.html | ||
| subroutine micro_pumas_ccpp_init(gravit, rair, rh2o, cpair, tmelt, latvap, latice, & | ||
| subroutine micro_pumas_ccpp_init(Gravit, rair, rh2o, cpair, tmelt, latvap, latice, & |
There was a problem hiding this comment.
I don't know - some random keystroke in vi. Reverted
| [micro_reff_snow_out] | ||
| standard_name = microphysics_effective_radius_of_stratiform_snow_particle | ||
| [pumas_reff_snow_out] | ||
| standard_name = pumas_effective_radius_of_stratiform_snow_particle |
There was a problem hiding this comment.
changed two places
| units = none | ||
| dimensions = () | ||
| type = character | ||
| kind = len=512 |
There was a problem hiding this comment.
changed everywhere
| [micro_numsnow_tend_external_in] | ||
| standard_name = microphysics_tendency_of_mass_number_concentration_of_snow_wrt_moist_air_and_condensed_water_from_external_microphysics | ||
| [pumas_numsnow_tend_external] | ||
| standard_name = tendency_of_pumas_mass_number_concentration_of_snow_wrt_moist_air_and_condensed_water_from_external |
| @@ -7,12 +7,13 @@ module micro_pumas_ccpp | |||
Round3 updates to get PUMAS into CCPP. These updates allow the CCPP version of PUMAS to compile in CAM-SIMA. These changes should be bit-for-bit in CAM (currently just tested the aux_cam izumi gnu and nag tests and they were bit-for-bit).
Major change was to move the conversion to pumas_r8 out of PUMAS and into the CAM-SIMA interstitial code. The reasoning to do this is that two copies were occurring - one to subset to the PUMAS dimension in the interstitial and then one to convert to pumas_r8 inside PUMAS. By moving it out, both subsetting and unit conversion can occur in one copy.
There is also a placeholder routine and metadata: micro_pumas_tempfix.F90. This placeholder routine defines the proc_rates_type DDT. This is basically a stub version of the PUMAS diagnostics routine which has not been completely implemented. When the PUMAS CCPP diagnostics routine is brought in, the micro_pumas_tempfix.F90 can be removed. Until then, it is needed to allow PUMAS to build in CCPP.