diff --git a/src/physics/cam/cam_diagnostics.F90 b/src/physics/cam/cam_diagnostics.F90 index df039cf6e0..c45ddf9f73 100644 --- a/src/physics/cam/cam_diagnostics.F90 +++ b/src/physics/cam/cam_diagnostics.F90 @@ -60,6 +60,8 @@ module cam_diagnostics character(len=8) :: diag_cnst_conv_tend = 'q_only' ! output constituent tendencies due to convection ! 'none', 'q_only' or 'all' +character(len=16) :: yog_scheme ! Is YOG scheme in use to provide precipitation + integer, parameter :: surf_100000 = 1 integer, parameter :: surf_092500 = 2 integer, parameter :: surf_085000 = 3 @@ -92,6 +94,7 @@ module cam_diagnostics integer :: prec_dp_idx = 0 integer :: snow_dp_idx = 0 +integer :: prec_yog_idx = 0 integer :: prec_sh_idx = 0 integer :: snow_sh_idx = 0 integer :: prec_sed_idx = 0 @@ -710,6 +713,11 @@ subroutine diag_init_moist(pbuf2d) snow_sed_idx = pbuf_get_index('SNOW_SED', errcode=ierr) prec_pcw_idx = pbuf_get_index('PREC_PCW', errcode=ierr) snow_pcw_idx = pbuf_get_index('SNOW_PCW', errcode=ierr) + ! Check if we are using YOG scheme and create prec variable if neccessary. + call phys_getopts(yog_scheme_out = yog_scheme) + if (yog_scheme == 'on') then + prec_yog_idx = pbuf_get_index('PREC_YOG', errcode=ierr) + end if if (is_first_step()) then call pbuf_set_field(pbuf2d, trefmxav_idx, -1.0e36_r8) @@ -1507,6 +1515,7 @@ subroutine diag_conv(state, ztodt, pbuf) ! convective precipitation variables real(r8), pointer :: prec_dp(:) ! total precipitation from ZM convection real(r8), pointer :: snow_dp(:) ! snow from ZM convection + real(r8), pointer :: prec_yog(:) ! total precipitation from YOG convection real(r8), pointer :: prec_sh(:) ! total precipitation from Hack convection real(r8), pointer :: snow_sh(:) ! snow from Hack convection real(r8), pointer :: prec_sed(:) ! total precipitation from ZM convection @@ -1543,6 +1552,11 @@ subroutine diag_conv(state, ztodt, pbuf) else nullify(snow_dp) end if + if (prec_yog_idx > 0) then + call pbuf_get_field(pbuf, prec_yog_idx, prec_yog) + else + nullify(prec_yog) + end if if (prec_sh_idx > 0) then call pbuf_get_field(pbuf, prec_sh_idx, prec_sh) else @@ -1584,6 +1598,9 @@ subroutine diag_conv(state, ztodt, pbuf) else precc(:ncol) = 0._r8 end if + if (associated(prec_yog)) then + precc(:ncol) = precc(:ncol) + prec_yog(:ncol) + end if if (associated(prec_sed) .and. associated(prec_pcw)) then precl(:ncol) = prec_sed(:ncol) + prec_pcw(:ncol) else if (associated(prec_sed)) then diff --git a/src/physics/cam/yog_intr.F90 b/src/physics/cam/yog_intr.F90 index e64e287935..52ab080333 100644 --- a/src/physics/cam/yog_intr.F90 +++ b/src/physics/cam/yog_intr.F90 @@ -117,7 +117,7 @@ subroutine yog_init() call addfld ('YOGDQ ', (/ 'lev' /), 'A', 'kg/kg/s','Q tendency - Yuval-OGorman moist convection') call addfld ('YOGDICE', (/ 'lev' /), 'A', 'kg/kg/s','Cloud ice tendency - Yuval-OGorman convection') call addfld ('YOGDLIQ', (/ 'lev' /), 'A', 'kg/kg/s','Cloud liq tendency - Yuval-OGorman convection') - call addfld ('YOGPREC', horiz_only , 'A', 'm/s','Surface preciptation - Yuval-OGorman convection') + call addfld ('PREC_YOG', horiz_only , 'A', 'm/s','Surface preciptation - Yuval-OGorman convection') if (masterproc) then write(iulog,*)'YOG output fields added to buffer' end if @@ -126,11 +126,11 @@ subroutine yog_init() history_budget_histfile_num_out = history_budget_histfile_num) if ( history_budget ) then - call add_default('YOGDT ', history_budget_histfile_num, ' ') - call add_default('YOGDQ ', history_budget_histfile_num, ' ') - call add_default('YOGDICE', history_budget_histfile_num, ' ') - call add_default('YOGDLIQ', history_budget_histfile_num, ' ') - call add_default('YOGPREC', history_budget_histfile_num, ' ') + call add_default('YOGDT ' , history_budget_histfile_num, ' ') + call add_default('YOGDQ ' , history_budget_histfile_num, ' ') + call add_default('YOGDICE' , history_budget_histfile_num, ' ') + call add_default('YOGDLIQ' , history_budget_histfile_num, ' ') + call add_default('PREC_YOG', history_budget_histfile_num, ' ') end if call nn_convection_flux_CAM_init(yog_nn_weights, SAM_sounding) @@ -224,7 +224,7 @@ subroutine yog_tend(ztodt, state, ptend) call outfld('YOGDQ ',ptend%q(1,1,1) ,pcols ,lchnk ) call outfld('YOGDICE ',ptend%q(1,1,ixcldice) ,pcols ,lchnk ) call outfld('YOGDLIQ ',ptend%q(1,1,ixcldliq) ,pcols ,lchnk ) - call outfld('YOGPREC ',yog_precsfc ,pcols ,lchnk ) + call outfld('PREC_YOG',yog_precsfc ,pcols ,lchnk ) end subroutine yog_tend !=========================================================================================