From 8a8056efa8b7360d74386951803430ebd6e20236 Mon Sep 17 00:00:00 2001 From: pjpegion Date: Wed, 2 Dec 2020 18:14:13 +0000 Subject: [PATCH 01/11] add mp perts to GFS_stochastics --- physics/GFS_stochastics.F90 | 57 ++++++++++++++++++++++- physics/GFS_stochastics.meta | 90 ++++++++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+), 2 deletions(-) diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index 9b4533cf9..863d7c6cc 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -30,8 +30,10 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, do_skeb, do_ca,ca_global,ca1,si,vfact_ca, & zmtnblck, sppt_wts, skebu_wts, skebv_wts, shum_wts,& sppt_wts_inv, skebu_wts_inv, skebv_wts_inv, & - shum_wts_inv, diss_est, & - ugrs, vgrs, tgrs, qgrs, gu0, gv0, gt0, gq0, dtdtr, & + shum_wts_inv, diss_est, ugrs, vgrs, tgrs, & + qgrs, qgrs_cw, qgrs_rw, qgrs_sw, qgrs_iw, qgrs_gl, & + gu0, gv0, gt0, gq0, & + qg0_cw, qg0_rw, qg0_sw, qg0_iw, qg0_gl, dtdtr, & rain, rainc, tprcp, totprcp, cnvprcp, & totprcpb, cnvprcpb, cplflx, & rain_cpl, snow_cpl, drain_cpl, dsnow_cpl, & @@ -68,10 +70,20 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs real(kind_phys), dimension(1:im,1:km), intent(in) :: tgrs real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_cw + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_rw + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_sw + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_iw + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_gl real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0 + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_cw + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_rw + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_sw + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_iw + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_gl ! dtdtr only allocated if do_sppt == .true. real(kind_phys), dimension(:,:), intent(in) :: dtdtr real(kind_phys), dimension(1:im), intent(in) :: rain @@ -142,6 +154,47 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, gq0(i,k) = qnew gt0(i,k) = tgrs(i,k) + tpert + dtdtr(i,k) endif + if (present(gq0_cw) .AND. present(qgrs_cw)) then + qpert = gq0_cw(i,k) - qgrs_cw(i,k) * sppt_wts(i,k) + qnew = qgrs_cw(i,k,l+1)+qpert + gq0_cw(i,k) = qnew + if (qnew < 0.0) then + gq0_cw(i,k) = 0.0 + endif + endif + if (present(gq0_rw) .AND. present(qgrs_rw)) then + qpert = gq0_rw(i,k) - qgrs_rw(i,k) * sppt_wts(i,k) + qnew = qgrs_rw(i,k,l+1)+qpert + gq0_rw(i,k) = qnew + if (qnew < 0.0) then + gq0_rw(i,k) = 0.0 + endif + endif + if (present(gq0_sw) .AND. present(qgrs_sw)) then + qpert = gq0_sw(i,k) - qgrs_sw(i,k) * sppt_wts(i,k) + qnew = qgrs_sw(i,k,l+1)+qpert + gq0_sw(i,k) = qnew + if (qnew < 0.0) then + gq0_sw(i,k) = 0.0 + endif + endif + if (present(gq0_iw) .AND. present(qgrs_iw)) then + qpert = gq0_iw(i,k) - qgrs_iw(i,k) * sppt_wts(i,k) + qnew = qgrs_iw(i,k,l+1)+qpert + gq0_iw(i,k) = qnew + if (qnew < 0.0) then + gq0_iw(i,k) = 0.0 + endif + endif + enddo + if (present(gq0_gl) .AND. present(qgrs_gl)) then + qpert = gq0_gl(i,k) - qgrs_gl(i,k) * sppt_wts(i,k) + qnew = qgrs_gl(i,k,l+1)+qpert + gq0_gl(i,k) = qnew + if (qnew < 0.0) then + gq0_gl(i,k) = 0.0 + endif + endif enddo enddo diff --git a/physics/GFS_stochastics.meta b/physics/GFS_stochastics.meta index 43c7b2d42..e0c2da2d1 100644 --- a/physics/GFS_stochastics.meta +++ b/physics/GFS_stochastics.meta @@ -232,6 +232,51 @@ kind = kind_phys intent = in optional = F +[qgrs_cw] + standard_name = cloud_condensed_water_mixing_ratio + long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[ggrs_rw] + standard_name = rain_water_mixing_ratio + long_name = moist mixing ratio of rain + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[ggrs_iw] + standard_name = ice_water_mixing_ratio + long_name = moist mixing ratio of cloud ice + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[ggrs_sw] + standard_name = snow_water_mixing_ratio + long_name = moist mixing ratio of snow + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[qgrs_gl] + standard_name = graupel_mixing_ratio + long_name = moist ratio of mass of graupel to mass of dry air plus vapor (without condensates) + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T [gu0] standard_name = x_wind_updated_by_physics long_name = zonal wind updated by physics @@ -268,6 +313,51 @@ kind = kind_phys intent = inout optional = F +[gq0_cw] + standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics + long_name = cloud condensed water mixing ratio updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[gq0_rw] + standard_name = rain_water_mixing_ratio_updated_by_physics + long_name = moist mixing ratio of rain updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[gq0_iw] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = moist mixing ratio of cloud ice updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[gq0_sw] + standard_name = snow_water_mixing_ratio_updated_by_physics + long_name = moist mixing ratio of snow updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[gq0_gl] + standard_name = graupel_mixing_ratio_updated_by_physics + long_name = moist ratio of mass of graupel to mass of dry air plus vapor (without condensates) updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T [dtdtr] standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step long_name = temp. change due to radiative heating per time step From 3226ffb715ea226d0a1f396b38318796193913dc Mon Sep 17 00:00:00 2001 From: pjpegion Date: Wed, 2 Dec 2020 18:51:43 +0000 Subject: [PATCH 02/11] add CN perts to GFS_stochastics --- physics/GFS_stochastics.F90 | 58 +++++++++++++++++++-- physics/GFS_stochastics.meta | 98 ++++++++++++++++++++++++++++++++++-- 2 files changed, 149 insertions(+), 7 deletions(-) diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index 863d7c6cc..949b4f9ec 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -32,8 +32,10 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, sppt_wts_inv, skebu_wts_inv, skebv_wts_inv, & shum_wts_inv, diss_est, ugrs, vgrs, tgrs, & qgrs, qgrs_cw, qgrs_rw, qgrs_sw, qgrs_iw, qgrs_gl, & - gu0, gv0, gt0, gq0, & - qg0_cw, qg0_rw, qg0_sw, qg0_iw, qg0_gl, dtdtr, & + qgrs_ni, qgrs_nr, qgrs_nc, qgrs_nwfa, qgrs_nifa, & + gu0, gv0, gt0, gq0, dtdtr, & + gq0_cw, gq0_rw, gq0_sw, gq0_iw, gq0_gl, & + gq0_ni, gq0_nr, gq0_nc, gq0_nwfa, gq0_nifa, & rain, rainc, tprcp, totprcp, cnvprcp, & totprcpb, cnvprcpb, cplflx, & rain_cpl, snow_cpl, drain_cpl, dsnow_cpl, & @@ -75,6 +77,11 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_sw real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_iw real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_gl + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_ni + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_nr + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_nc + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_nwfa + real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_nifa real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 @@ -84,6 +91,11 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_sw real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_iw real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_gl + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_ni + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_nr + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_nc + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_nwfa + real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_nifa ! dtdtr only allocated if do_sppt == .true. real(kind_phys), dimension(:,:), intent(in) :: dtdtr real(kind_phys), dimension(1:im), intent(in) :: rain @@ -186,7 +198,6 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, gq0_iw(i,k) = 0.0 endif endif - enddo if (present(gq0_gl) .AND. present(qgrs_gl)) then qpert = gq0_gl(i,k) - qgrs_gl(i,k) * sppt_wts(i,k) qnew = qgrs_gl(i,k,l+1)+qpert @@ -195,6 +206,47 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, gq0_gl(i,k) = 0.0 endif endif + if (present(gq0_ni) .AND. present(qgrs_ni)) then + qpert = gq0_ni(i,k) - qgrs_ni(i,k) * sppt_wts(i,k) + qnew = qgrs_ni(i,k,l+1)+qpert + gq0_ni(i,k) = qnew + if (qnew < 0.0) then + gq0_ni(i,k) = 0.0 + endif + endif + if (present(gq0_nr) .AND. present(qgrs_nr)) then + qpert = gq0_nr(i,k) - qgrs_nr(i,k) * sppt_wts(i,k) + qnew = qgrs_nr(i,k,l+1)+qpert + gq0_nr(i,k) = qnew + if (qnew < 0.0) then + gq0_nr(i,k) = 0.0 + endif + endif + if (present(gq0_nnc .AND. present(qgrs_nc)) then + qpert = gq0_nc(i,k) - qgrs_nc(i,k) * sppt_wts(i,k) + qnew = qgrs_nc(i,k,l+1)+qpert + gq0_nc(i,k) = qnew + if (qnew < 0.0) then + gq0_nc(i,k) = 0.0 + endif + endif + if (present(gq0_nwfa) .AND. present(qgrs_nwfa)) then + qpert = gq0_nwfa(i,k) - qgrs_nwfa(i,k) * sppt_wts(i,k) + qnew = qgrs_nwfa(i,k,l+1)+qpert + gq0_nwfa(i,k) = qnew + if (qnew < 0.0) then + gq0_nwfa(i,k) = 0.0 + endif + endif + enddo + if (present(gq0_nifa) .AND. present(qgrs_nifa)) then + qpert = gq0_nifa(i,k) - qgrs_nifa(i,k) * sppt_wts(i,k) + qnew = qgrs_nifa(i,k,l+1)+qpert + gq0_nifa(i,k) = qnew + if (qnew < 0.0) then + gq0_nifa(i,k) = 0.0 + endif + endif enddo enddo diff --git a/physics/GFS_stochastics.meta b/physics/GFS_stochastics.meta index e0c2da2d1..08f9f004e 100644 --- a/physics/GFS_stochastics.meta +++ b/physics/GFS_stochastics.meta @@ -248,7 +248,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = T [ggrs_iw] standard_name = ice_water_mixing_ratio @@ -257,7 +257,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = T [ggrs_sw] standard_name = snow_water_mixing_ratio @@ -266,7 +266,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = T [qgrs_gl] standard_name = graupel_mixing_ratio @@ -275,7 +275,52 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = in + optional = T +[qgrs_ni] + standard_name = ice_number_concentration + long_name = ice number concentration + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[gqrs_nr] + standard_name = rain_number_concentration + long_name = rain number concentration + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[gqrs_nc] + standard_name = cloud_droplet_number_concentration + long_name = cloud droplet number concentration + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[qgrs_nwfa] + standard_name = water_friendly_aerosol_number_concentration + long_name = number concentration of water-friendly aerosols + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[qgrs_nifa] + standard_name = ice_friendly_aerosol_number_concentration + long_name = number concentration of ice-friendly aerosols + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in optional = T [gu0] standard_name = x_wind_updated_by_physics @@ -358,6 +403,51 @@ kind = kind_phys intent = inout optional = T +[gq0_ni] + standard_name = ice_number_concentration_updated_by_physics + long_name = ice number concentration + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[gq0_nr] + standard_name = rain_number_concentration_updated_by_physics + long_name = rain number concentration + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[gq0_nc] + standard_name = cloud_droplet_number_concentration_updated_by_physics + long_name = cloud droplet number concentration + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[gq0_nwfa] + standard_name = water_friendly_aerosol_number_concentration_updated_by_physics + long_name = number concentration of water-friendly aerosols + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[gq0_nifa] + standard_name = ice_friendly_aerosol_number_concentration_updated_by_physics + long_name = number concentration of ice-friendly aerosols + units = kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T [dtdtr] standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step long_name = temp. change due to radiative heating per time step From ac42e80f60d89ebca802a159abda6ee7c1f6f954 Mon Sep 17 00:00:00 2001 From: pjpegion Date: Tue, 8 Dec 2020 18:49:28 +0000 Subject: [PATCH 03/11] additions for MP perturbations --- physics/GFS_stochastics.F90 | 178 +++++++++++++---------------------- physics/GFS_stochastics.meta | 168 +++++++++++++-------------------- 2 files changed, 130 insertions(+), 216 deletions(-) diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index 949b4f9ec..b125f881d 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -26,19 +26,18 @@ end subroutine GFS_stochastics_finalize !! -# defines random seed indices for radiation (in a reproducible way) !! -# interpolates coefficients for prognostic ozone calculation !! -# performs surface data cycling via the GFS gcycle routine - subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, & - do_skeb, do_ca,ca_global,ca1,si,vfact_ca, & + subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, & + do_shum ,do_skeb, do_ca,ca_global,ca1,si,vfact_ca, & zmtnblck, sppt_wts, skebu_wts, skebv_wts, shum_wts,& sppt_wts_inv, skebu_wts_inv, skebv_wts_inv, & - shum_wts_inv, diss_est, ugrs, vgrs, tgrs, & - qgrs, qgrs_cw, qgrs_rw, qgrs_sw, qgrs_iw, qgrs_gl, & - qgrs_ni, qgrs_nr, qgrs_nc, qgrs_nwfa, qgrs_nifa, & - gu0, gv0, gt0, gq0, dtdtr, & + shum_wts_inv, diss_est, ugrs, vgrs, tgrs, qgrs_wv, & + qgrs_cw, qgrs_rw, qgrs_sw, qgrs_iw, qgrs_gl, & + gu0, gv0, gt0, gq0_wv, dtdtr, & gq0_cw, gq0_rw, gq0_sw, gq0_iw, gq0_gl, & - gq0_ni, gq0_nr, gq0_nc, gq0_nwfa, gq0_nifa, & rain, rainc, tprcp, totprcp, cnvprcp, & totprcpb, cnvprcpb, cplflx, & rain_cpl, snow_cpl, drain_cpl, dsnow_cpl, & + ntcw,ntrw,ntsw,ntiw,ntgl, & errmsg, errflg) use machine, only: kind_phys @@ -49,6 +48,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, integer, intent(in) :: km integer, intent(in) :: kdt logical, intent(in) :: do_sppt + logical, intent(in) :: do_pertmp logical, intent(in) :: do_ca logical, intent(in) :: ca_global logical, intent(in) :: use_zmtnblck @@ -71,31 +71,26 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, real(kind_phys), dimension(1:im,1:km), intent(in) :: ugrs real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs real(kind_phys), dimension(1:im,1:km), intent(in) :: tgrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_cw - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_rw - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_sw - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_iw - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_gl - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_ni - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_nr - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_nc - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_nwfa - real(kind_phys), dimension(1:im,1:km), intent(in),optional :: qgrs_nifa + real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs_wv + real(kind_phys), dimension(:,:), intent(in) :: qgrs_cw + real(kind_phys), dimension(:,:), intent(in) :: qgrs_rw + real(kind_phys), dimension(:,:), intent(in) :: qgrs_sw + real(kind_phys), dimension(:,:), intent(in) :: qgrs_iw + real(kind_phys), dimension(:,:), intent(in) :: qgrs_gl real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0 - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_cw - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_rw - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_sw - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_iw - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_gl - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_ni - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_nr - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_nc - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_nwfa - real(kind_phys), dimension(1:im,1:km), intent(inout),optional :: gq0_nifa + real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0_wv + real(kind_phys), dimension(:,:), intent(inout) :: gq0_cw + real(kind_phys), dimension(:,:), intent(inout) :: gq0_rw + real(kind_phys), dimension(:,:), intent(inout) :: gq0_sw + real(kind_phys), dimension(:,:), intent(inout) :: gq0_iw + real(kind_phys), dimension(:,:), intent(inout) :: gq0_gl + integer, intent(in) :: ntcw + integer, intent(in) :: ntrw + integer, intent(in) :: ntsw + integer, intent(in) :: ntiw + integer, intent(in) :: ntgl ! dtdtr only allocated if do_sppt == .true. real(kind_phys), dimension(:,:), intent(in) :: dtdtr real(kind_phys), dimension(1:im), intent(in) :: rain @@ -155,96 +150,57 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, upert = (gu0(i,k) - ugrs(i,k)) * sppt_wts(i,k) vpert = (gv0(i,k) - vgrs(i,k)) * sppt_wts(i,k) tpert = (gt0(i,k) - tgrs(i,k) - dtdtr(i,k)) * sppt_wts(i,k) - qpert = (gq0(i,k) - qgrs(i,k)) * sppt_wts(i,k) + qpert = (gq0_wv(i,k) - qgrs_wv(i,k)) * sppt_wts(i,k) gu0(i,k) = ugrs(i,k)+upert gv0(i,k) = vgrs(i,k)+vpert !negative humidity check - qnew = qgrs(i,k)+qpert + qnew = qgrs_wv(i,k)+qpert if (qnew >= 1.0e-10) then - gq0(i,k) = qnew + gq0_wv(i,k) = qnew gt0(i,k) = tgrs(i,k) + tpert + dtdtr(i,k) endif - if (present(gq0_cw) .AND. present(qgrs_cw)) then - qpert = gq0_cw(i,k) - qgrs_cw(i,k) * sppt_wts(i,k) - qnew = qgrs_cw(i,k,l+1)+qpert - gq0_cw(i,k) = qnew - if (qnew < 0.0) then - gq0_cw(i,k) = 0.0 - endif - endif - if (present(gq0_rw) .AND. present(qgrs_rw)) then - qpert = gq0_rw(i,k) - qgrs_rw(i,k) * sppt_wts(i,k) - qnew = qgrs_rw(i,k,l+1)+qpert - gq0_rw(i,k) = qnew - if (qnew < 0.0) then - gq0_rw(i,k) = 0.0 - endif - endif - if (present(gq0_sw) .AND. present(qgrs_sw)) then - qpert = gq0_sw(i,k) - qgrs_sw(i,k) * sppt_wts(i,k) - qnew = qgrs_sw(i,k,l+1)+qpert - gq0_sw(i,k) = qnew - if (qnew < 0.0) then - gq0_sw(i,k) = 0.0 - endif - endif - if (present(gq0_iw) .AND. present(qgrs_iw)) then - qpert = gq0_iw(i,k) - qgrs_iw(i,k) * sppt_wts(i,k) - qnew = qgrs_iw(i,k,l+1)+qpert - gq0_iw(i,k) = qnew - if (qnew < 0.0) then - gq0_iw(i,k) = 0.0 - endif - endif - if (present(gq0_gl) .AND. present(qgrs_gl)) then - qpert = gq0_gl(i,k) - qgrs_gl(i,k) * sppt_wts(i,k) - qnew = qgrs_gl(i,k,l+1)+qpert - gq0_gl(i,k) = qnew - if (qnew < 0.0) then - gq0_gl(i,k) = 0.0 - endif - endif - if (present(gq0_ni) .AND. present(qgrs_ni)) then - qpert = gq0_ni(i,k) - qgrs_ni(i,k) * sppt_wts(i,k) - qnew = qgrs_ni(i,k,l+1)+qpert - gq0_ni(i,k) = qnew - if (qnew < 0.0) then - gq0_ni(i,k) = 0.0 + if (do_pertmp) then + if (ntcw>0) then + qpert = gq0_cw(i,k) - qgrs_cw(i,k) * sppt_wts(i,k) + qnew = qgrs_cw(i,k)+qpert + gq0_cw(i,k) = qnew + if (qnew < 0.0) then + gq0_cw(i,k) = 0.0 + endif endif - endif - if (present(gq0_nr) .AND. present(qgrs_nr)) then - qpert = gq0_nr(i,k) - qgrs_nr(i,k) * sppt_wts(i,k) - qnew = qgrs_nr(i,k,l+1)+qpert - gq0_nr(i,k) = qnew - if (qnew < 0.0) then - gq0_nr(i,k) = 0.0 + if (ntrw>0) then + qpert = gq0_rw(i,k) - qgrs_rw(i,k) * sppt_wts(i,k) + qnew = qgrs_rw(i,k)+qpert + gq0_rw(i,k) = qnew + if (qnew < 0.0) then + gq0_rw(i,k) = 0.0 + endif endif - endif - if (present(gq0_nnc .AND. present(qgrs_nc)) then - qpert = gq0_nc(i,k) - qgrs_nc(i,k) * sppt_wts(i,k) - qnew = qgrs_nc(i,k,l+1)+qpert - gq0_nc(i,k) = qnew - if (qnew < 0.0) then - gq0_nc(i,k) = 0.0 + if (ntsw>0) then + qpert = gq0_sw(i,k) - qgrs_sw(i,k) * sppt_wts(i,k) + qnew = qgrs_sw(i,k)+qpert + gq0_sw(i,k) = qnew + if (qnew < 0.0) then + gq0_sw(i,k) = 0.0 + endif endif - endif - if (present(gq0_nwfa) .AND. present(qgrs_nwfa)) then - qpert = gq0_nwfa(i,k) - qgrs_nwfa(i,k) * sppt_wts(i,k) - qnew = qgrs_nwfa(i,k,l+1)+qpert - gq0_nwfa(i,k) = qnew - if (qnew < 0.0) then - gq0_nwfa(i,k) = 0.0 + if (ntiw>0) then + qpert = gq0_iw(i,k) - qgrs_iw(i,k) * sppt_wts(i,k) + qnew = qgrs_iw(i,k)+qpert + gq0_iw(i,k) = qnew + if (qnew < 0.0) then + gq0_iw(i,k) = 0.0 + endif endif - endif - enddo - if (present(gq0_nifa) .AND. present(qgrs_nifa)) then - qpert = gq0_nifa(i,k) - qgrs_nifa(i,k) * sppt_wts(i,k) - qnew = qgrs_nifa(i,k,l+1)+qpert - gq0_nifa(i,k) = qnew - if (qnew < 0.0) then - gq0_nifa(i,k) = 0.0 + if (ntgl>0) then + qpert = gq0_gl(i,k) - qgrs_gl(i,k) * sppt_wts(i,k) + qnew = qgrs_gl(i,k)+qpert + gq0_gl(i,k) = qnew + if (qnew < 0.0) then + gq0_gl(i,k) = 0.0 + endif endif endif enddo @@ -307,13 +263,13 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, upert = (gu0(i,k) - ugrs(i,k)) * ca(i,k) vpert = (gv0(i,k) - vgrs(i,k)) * ca(i,k) tpert = (gt0(i,k) - tgrs(i,k) - dtdtr(i,k)) * ca(i,k) - qpert = (gq0(i,k) - qgrs(i,k)) * ca(i,k) + qpert = (gq0_wv(i,k) - qgrs_wv(i,k)) * ca(i,k) gu0(i,k) = ugrs(i,k)+upert gv0(i,k) = vgrs(i,k)+vpert !negative humidity check - qnew = qgrs(i,k)+qpert + qnew = qgrs_wv(i,k)+qpert if (qnew >= 1.0e-10) then - gq0(i,k) = qnew + gq0_wv(i,k) = qnew gt0(i,k) = tgrs(i,k) + tpert + dtdtr(i,k) endif enddo @@ -338,7 +294,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, if (do_shum) then do k=1,km - gq0(:,k) = gq0(:,k)*(1.0 + shum_wts(:,k)) + gq0_wv(:,k) = gq0_wv(:,k)*(1.0 + shum_wts(:,k)) shum_wts_inv(:,k) = shum_wts(:,k) end do endif diff --git a/physics/GFS_stochastics.meta b/physics/GFS_stochastics.meta index 08f9f004e..aae5868d1 100644 --- a/physics/GFS_stochastics.meta +++ b/physics/GFS_stochastics.meta @@ -31,6 +31,46 @@ type = integer intent = in optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntiw] + standard_name = index_for_ice_cloud_condensate + long_name = tracer index for ice water + units = index + dimensions = () + intent = in + optional = F + type = integer +[ntrw] + standard_name = index_for_rain_water + long_name = tracer index for rain water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsw] + standard_name = index_for_snow_water + long_name = tracer index for snow water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntgl] + standard_name = index_for_graupel + long_name = tracer index for graupel + units = index + dimensions = () + type = integer + intent = in + optional = F [do_sppt] standard_name = flag_for_stochastic_physics_perturbations long_name = flag for stochastic physics perturbations @@ -39,6 +79,14 @@ type = logical intent = in optional = F +[do_pertmp] + standard_name = flag_for_stochastic_microphysics_perturbations + long_name = flag for stochastic microphysics physics perturbations + units = flag + dimensions = () + type = logical + intent = in + optional = F [use_zmtnblck] standard_name = flag_for_mountain_blocking long_name = flag for mountain blocking @@ -223,7 +271,7 @@ kind = kind_phys intent = in optional = F -[qgrs] +[qgrs_wv] standard_name = water_vapor_specific_humidity long_name = water vapor specific humidity units = kg kg-1 @@ -240,8 +288,8 @@ type = real kind = kind_phys intent = in - optional = T -[ggrs_rw] + optional = F +[qgrs_rw] standard_name = rain_water_mixing_ratio long_name = moist mixing ratio of rain units = kg kg-1 @@ -249,8 +297,8 @@ type = real kind = kind_phys intent = in - optional = T -[ggrs_iw] + optional = F +[qgrs_iw] standard_name = ice_water_mixing_ratio long_name = moist mixing ratio of cloud ice units = kg kg-1 @@ -258,8 +306,8 @@ type = real kind = kind_phys intent = in - optional = T -[ggrs_sw] + optional = F +[qgrs_sw] standard_name = snow_water_mixing_ratio long_name = moist mixing ratio of snow units = kg kg-1 @@ -267,7 +315,7 @@ type = real kind = kind_phys intent = in - optional = T + optional = F [qgrs_gl] standard_name = graupel_mixing_ratio long_name = moist ratio of mass of graupel to mass of dry air plus vapor (without condensates) @@ -276,52 +324,7 @@ type = real kind = kind_phys intent = in - optional = T -[qgrs_ni] - standard_name = ice_number_concentration - long_name = ice number concentration - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = T -[gqrs_nr] - standard_name = rain_number_concentration - long_name = rain number concentration - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = T -[gqrs_nc] - standard_name = cloud_droplet_number_concentration - long_name = cloud droplet number concentration - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = T -[qgrs_nwfa] - standard_name = water_friendly_aerosol_number_concentration - long_name = number concentration of water-friendly aerosols - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = T -[qgrs_nifa] - standard_name = ice_friendly_aerosol_number_concentration - long_name = number concentration of ice-friendly aerosols - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = T + optional = F [gu0] standard_name = x_wind_updated_by_physics long_name = zonal wind updated by physics @@ -349,7 +352,7 @@ kind = kind_phys intent = inout optional = F -[gq0] +[gq0_wv] standard_name = water_vapor_specific_humidity_updated_by_physics long_name = water vapor specific humidity updated by physics units = kg kg-1 @@ -366,7 +369,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [gq0_rw] standard_name = rain_water_mixing_ratio_updated_by_physics long_name = moist mixing ratio of rain updated by physics @@ -375,7 +378,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [gq0_iw] standard_name = ice_water_mixing_ratio_updated_by_physics long_name = moist mixing ratio of cloud ice updated by physics @@ -384,7 +387,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [gq0_sw] standard_name = snow_water_mixing_ratio_updated_by_physics long_name = moist mixing ratio of snow updated by physics @@ -393,7 +396,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [gq0_gl] standard_name = graupel_mixing_ratio_updated_by_physics long_name = moist ratio of mass of graupel to mass of dry air plus vapor (without condensates) updated by physics @@ -402,52 +405,7 @@ type = real kind = kind_phys intent = inout - optional = T -[gq0_ni] - standard_name = ice_number_concentration_updated_by_physics - long_name = ice number concentration - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = T -[gq0_nr] - standard_name = rain_number_concentration_updated_by_physics - long_name = rain number concentration - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = T -[gq0_nc] - standard_name = cloud_droplet_number_concentration_updated_by_physics - long_name = cloud droplet number concentration - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = T -[gq0_nwfa] - standard_name = water_friendly_aerosol_number_concentration_updated_by_physics - long_name = number concentration of water-friendly aerosols - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = T -[gq0_nifa] - standard_name = ice_friendly_aerosol_number_concentration_updated_by_physics - long_name = number concentration of ice-friendly aerosols - units = kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = T + optional = F [dtdtr] standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step long_name = temp. change due to radiative heating per time step From 6782e0e006083c210663adc8c73ef21b37bb5bb7 Mon Sep 17 00:00:00 2001 From: pjpegion Date: Mon, 14 Dec 2020 15:44:44 +0000 Subject: [PATCH 04/11] add temporary surface perturbation diagnostic --- physics/GFS_surface_generic.F90 | 6 +++++- physics/GFS_surface_generic.meta | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 72efcea60..e7a81b7c4 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -29,7 +29,7 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, sigmaf, soiltyp, vegtype, slopetyp, work3, tsurf, zlvl, do_sppt, ca_global,dtdtr,& drain_cpl, dsnow_cpl, rain_cpl, snow_cpl, lndp_type, n_var_lndp, sfc_wts, & lndp_var_list, lndp_prt_list, & - z01d, zt1d, bexp1d, xlai1d, vegf1d, lndp_vgf, & + z01d, zt1d, bexp1d, xlai1d, vegf1d, lndp_vgf, sfc_wts_inv, & cplflx, flag_cice, islmsk_cice, slimskin_cpl, tisfc, tsfco, fice, hice, & wind, u1, v1, cnvwind, smcwlt2, smcref2, errmsg, errflg) @@ -68,6 +68,7 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, real(kind=kind_phys), dimension(im), intent(out) :: xlai1d real(kind=kind_phys), dimension(im), intent(out) :: vegf1d real(kind=kind_phys), intent(out) :: lndp_vgf + real(kind=kind_phys), dimension(im,n_var_lndp), intent(inout) :: sfc_wts_inv logical, intent(in) :: cplflx real(kind=kind_phys), dimension(im), intent(in) :: slimskin_cpl @@ -108,6 +109,9 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, ! Turn vegetation fraction pattern into percentile pattern lndp_vgf=-999. + if (lndp_type>0) then + sfc_wts_inv(:,:)=sfc_wts(:,:) + endif if (lndp_type==1) then do k =1,n_var_lndp select case(lndp_var_list(k)) diff --git a/physics/GFS_surface_generic.meta b/physics/GFS_surface_generic.meta index 68713ab19..44e4f7f68 100644 --- a/physics/GFS_surface_generic.meta +++ b/physics/GFS_surface_generic.meta @@ -274,8 +274,17 @@ kind = kind_phys intent = in optional = F +[sfc_wts_inv] + standard_name = weights_for_stochastic_surface_physics_perturbation_flipped + long_name = weights for stochastic surface physics perturbation, flipped + units = none + dimensions = (horizontal_loop_extent,number_of_land_surface_variables_perturbed) + type = real + kind = kind_phys + intent = inout + optional = F [lndp_prt_list] - standard_name =magnitude_of_perturbations_for_landperts + standard_name = magnitude_of_perturbations_for_landperts long_name = magnitude of perturbations for landperts units = variable dimensions = (number_of_land_surface_variables_perturbed) From 4c7d8ad899116aafe4ff2f02bcce1ff997881483 Mon Sep 17 00:00:00 2001 From: pjpegion Date: Wed, 23 Dec 2020 22:12:27 +0000 Subject: [PATCH 05/11] merge with upstream NCAR --- physics/rte-rrtmgp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/rte-rrtmgp b/physics/rte-rrtmgp index 33c8a984c..566bee9cd 160000 --- a/physics/rte-rrtmgp +++ b/physics/rte-rrtmgp @@ -1 +1 @@ -Subproject commit 33c8a984c17cf41be5d4c2928242e1b4239bfc40 +Subproject commit 566bee9cd6f9977e82d75d9b4964b20b1ff6163d From 3750b6b1c45eb56807668a34b230eaaa62d97e59 Mon Sep 17 00:00:00 2001 From: pjpegion Date: Wed, 6 Jan 2021 15:38:27 +0000 Subject: [PATCH 06/11] add cloud perturbations and clean up radiation perturbations --- physics/GFS_MP_generic.F90 | 10 +--- physics/GFS_MP_generic.meta | 34 -------------- physics/GFS_debug.F90 | 2 +- physics/GFS_rrtmg_pre.F90 | 73 ++++++++++++++++++++++++++--- physics/GFS_rrtmg_pre.meta | 26 ++++++++++ physics/GFS_stochastics.F90 | 32 +++++++------ physics/GFS_stochastics.meta | 19 ++++++-- physics/GFS_suite_interstitial.F90 | 5 +- physics/GFS_suite_interstitial.meta | 9 ---- physics/GFS_surface_generic.F90 | 8 +--- physics/GFS_surface_generic.meta | 25 ---------- physics/dcyc2.f | 30 +++++++++--- physics/dcyc2.meta | 22 +++++++-- 13 files changed, 170 insertions(+), 125 deletions(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 435a80509..672be5ba6 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -89,7 +89,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_qv, rain0, ice0, snow0, & graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, & totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, dt3dt, dq3dt, rain_cpl, rainc_cpl, snow_cpl, pwat, & - do_sppt, ca_global, dtdtr, dtdtc, drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & + drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, errmsg, errflg) ! use machine, only: kind_phys @@ -119,9 +119,6 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, real(kind=kind_phys), dimension(:,:), intent(inout) :: dq3dt ! only if ldiag3d and qdiag3d ! Stochastic physics / surface perturbations - logical, intent(in) :: do_sppt, ca_global - real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdtr - real(kind=kind_phys), dimension(im,levs), intent(in) :: dtdtc real(kind=kind_phys), dimension(im), intent(inout) :: drain_cpl real(kind=kind_phys), dimension(im), intent(inout) :: dsnow_cpl @@ -391,11 +388,6 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, pwat(i) = pwat(i) * onebg enddo - ! Stochastic physics / surface perturbations - if (do_sppt .or. ca_global) then -!--- radiation heating rate - dtdtr(1:im,:) = dtdtr(1:im,:) + dtdtc(1:im,:)*dtf - endif end subroutine GFS_MP_generic_post_run !> @} diff --git a/physics/GFS_MP_generic.meta b/physics/GFS_MP_generic.meta index 981f5478d..c42b12c31 100644 --- a/physics/GFS_MP_generic.meta +++ b/physics/GFS_MP_generic.meta @@ -728,40 +728,6 @@ kind = kind_phys intent = inout optional = F -[do_sppt] - standard_name = flag_for_stochastic_physics_perturbations - long_name = flag for stochastic physics perturbations - units = flag - dimensions = () - type = logical - intent = in - optional = F -[ca_global] - standard_name = flag_for_global_cellular_automata - long_name = switch for global ca - units = flag - dimensions = () - type = logical - intent = in - optional = F -[dtdtr] - standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step - long_name = temp. change due to radiative heating per time step - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[dtdtc] - standard_name = tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky - long_name = clear sky radiative (shortwave + longwave) heating rate at current time - units = K s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F [drain_cpl] standard_name = tendency_of_lwe_thickness_of_precipitation_amount_for_coupling long_name = change in rain_cpl (coupling_type) diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index b5066637d..0b90f2ade 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -534,7 +534,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%acvt' , Tbd%acvt) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%hpbl' , Tbd%hpbl) if (Model%do_sppt) then - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%dtdtr' , Tbd%dtdtr) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%dtdtnp' , Tbd%dtdtnp) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%dtotprcp' , Tbd%dtotprcp) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%dcnvprcp' , Tbd%dcnvprcp) end if diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 109df3b65..524a34b26 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -26,8 +26,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & ltaerosol, lgfdlmprad, uni_cld, effr_in, do_mynnedmf, lmfshal, & lmfdeep2, fhswr, fhlwr, solhr, sup, eps, epsm1, fvirt, & rog, rocp, con_rd, xlat_d, xlat, xlon, coslat, sinlat, tsfc, slmsk, & - prsi, prsl, prslk, tgrs, sfc_wts, mg_cld, effrr_in, & - cnvw_in, cnvc_in, qgrs, aer_nm, dx, icloud, & !inputs from here and above + prsi, prsl, prslk, tgrs, sfc_wts, mg_cld, effrr_in, pert_clds,sppt_wts,& + sppt_amp, cnvw_in, cnvc_in, qgrs, aer_nm, dx, icloud, & !inputs from here and above coszen, coszdg, effrl_inout, effri_inout, effrs_inout, & clouds1, clouds2, clouds3, clouds4, clouds5, & !in/out from here and above kd, kt, kb, mtopa, mbota, raddt, tsfg, tsfa, de_lgth, alb1d, delp, dz, & !output from here and below @@ -65,7 +65,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & & profsw_type, NBDSW use module_radlw_parameters, only: topflw_type, sfcflw_type, & & proflw_type, NBDLW - use surface_perturbation, only: cdfnor + use surface_perturbation, only: cdfnor,ppfbet ! For Thompson MP use module_mp_thompson, only: calc_effectRad, Nt_c @@ -97,9 +97,9 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & logical, intent(in) :: lsswr, lslwr, ltaerosol, lgfdlmprad, & uni_cld, effr_in, do_mynnedmf, & - lmfshal, lmfdeep2 + lmfshal, lmfdeep2, pert_clds - real(kind=kind_phys), intent(in) :: fhswr, fhlwr, solhr, sup, julian + real(kind=kind_phys), intent(in) :: fhswr, fhlwr, solhr, sup, julian, sppt_amp real(kind=kind_phys), intent(in) :: eps, epsm1, fvirt, rog, rocp, con_rd real(kind=kind_phys), dimension(:), intent(in) :: xlat_d, xlat, xlon, & @@ -109,7 +109,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, prsl, prslk, & tgrs, sfc_wts, & mg_cld, effrr_in, & - cnvw_in, cnvc_in + cnvw_in, cnvc_in, & + sppt_wts real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs, aer_nm @@ -182,7 +183,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & real(kind=kind_phys), dimension(im,lm+LTP) :: & htswc, htlwc, gcice, grain, grime, htsw0, htlw0, & rhly, tvly,qstl, vvel, clw, ciw, prslk1, tem2da, & - dzb, hzb, cldcov, deltaq, cnvc, cnvw, & + dzb, hzb, cldcov, deltaq, cnvc, cnvw, & effrl, effri, effrr, effrs, rho, orho, plyrpa ! for Thompson MP @@ -200,6 +201,11 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & real(kind=kind_phys), dimension(im,lm+LTP,NF_VGAS) :: gasvmr real(kind=kind_phys), dimension(im,lm+LTP,NBDSW,NF_AESW) :: faersw real(kind=kind_phys), dimension(im,lm+LTP,NBDLW,NF_AELW) :: faerlw + + ! for stochastic cloud perturbations + real(kind=kind_phys), dimension(im) :: cldp1d + real (kind=kind_phys) :: alpha0,beta0,m,s,cldtmp,tmp_wt,cdfz + integer :: iflag integer :: ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & @@ -932,6 +938,34 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & ccnd(1:IM,1:LMK,1) = ccnd(1:IM,1:LMK,1) + cnvw(1:IM,1:LMK) endif +! perturb cld cover + !if (pert_clds) then + ! cldp1d(:) = 0. + ! do i=1,im + ! tmp_wt= -1*log( ( 2.0 / ( sppt_wts(i,38) ) ) - 1 ) + ! call cdfnor(tmp_wt,cdfz) + ! cldp1d(i) = cdfz + ! enddo + ! do i = 1, IM + ! do k = 1, LM + ! ! compute beta distribution parameters + ! m = cldcov(i,k+kd) + ! if (m<0.99 .AND. m > 0.01) then + ! s = sppt_amp*m*(1.-m) + ! alpha0 = m*m*(1.-m)/(s*s)-m + ! beta0 = alpha0*(1.-m)/m + ! ! compute beta distribution value corresponding + ! ! to the given percentile albPpert to use as new albedo + ! call ppfbet(cldp1d(i),alpha0,beta0,iflag,cldtmp) + ! cldcov(i,k+kd) = cldtmp + ! else + ! cldcov(i,k+kd) = m + ! endif + ! enddo ! end_do_i_loop + ! enddo ! end_do_k_loop + !endif + !print*,'after cld perts',minval(cldcov),maxval(cldcov) + if (imp_physics == imp_physics_zhao_carr .or. imp_physics == imp_physics_mg) then ! zhao/moorthi's prognostic cloud scheme ! or unified cloud and/or with MG microphysics @@ -1038,6 +1072,31 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & ! endif ! end_if_ntcw +! perturb cld cover + if (pert_clds) then + do i=1,im + tmp_wt= -1*log( ( 2.0 / ( sppt_wts(i,38) ) ) - 1 ) + call cdfnor(tmp_wt,cdfz) + cldp1d(i) = cdfz + enddo + do k = 1, LMK + do i = 1, IM + ! compute beta distribution parameters + m = clouds(i,k,1) + if (m<0.99 .AND. m > 0.01) then + s = sppt_amp*m*(1.-m) + alpha0 = m*m*(1.-m)/(s*s)-m + beta0 = alpha0*(1.-m)/m + ! compute beta distribution value corresponding + ! to the given percentile albPpert to use as new albedo + call ppfbet(cldp1d(i),alpha0,beta0,iflag,cldtmp) + clouds(i,k,1) = cldtmp + else + clouds(i,k,1) = m + endif + enddo ! end_do_i_loop + enddo ! end_do_k_loop + endif do k = 1, LMK do i = 1, IM clouds1(i,k) = clouds(i,k,1) diff --git a/physics/GFS_rrtmg_pre.meta b/physics/GFS_rrtmg_pre.meta index eaa878ee7..14403f63d 100644 --- a/physics/GFS_rrtmg_pre.meta +++ b/physics/GFS_rrtmg_pre.meta @@ -395,6 +395,32 @@ type = logical intent = in optional = F +[sppt_wts] + standard_name = weights_for_stochastic_sppt_perturbation + long_name = weights for stochastic sppt perturbation + units = none + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sppt_amp] + standard_name = total_ampltiude_of_sppt_perturbation + long_name = toal ampltidue of stochastic sppt perturbation + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pert_clds] + standard_name = flag_for_stochastic_cloud_fraction_perturbations + long_name = flag for stochastic cloud fraction physics perturbations + units = flag + dimensions = () + type = logical + intent = in + optional = F [do_mynnedmf] standard_name = do_mynnedmf long_name = flag to activate MYNN-EDMF diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index b125f881d..a3b4f30cf 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -26,13 +26,13 @@ end subroutine GFS_stochastics_finalize !! -# defines random seed indices for radiation (in a reproducible way) !! -# interpolates coefficients for prognostic ozone calculation !! -# performs surface data cycling via the GFS gcycle routine - subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, & + subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblck, & do_shum ,do_skeb, do_ca,ca_global,ca1,si,vfact_ca, & zmtnblck, sppt_wts, skebu_wts, skebv_wts, shum_wts,& sppt_wts_inv, skebu_wts_inv, skebv_wts_inv, & shum_wts_inv, diss_est, ugrs, vgrs, tgrs, qgrs_wv, & qgrs_cw, qgrs_rw, qgrs_sw, qgrs_iw, qgrs_gl, & - gu0, gv0, gt0, gq0_wv, dtdtr, & + gu0, gv0, gt0, gq0_wv, dtdtnp, & gq0_cw, gq0_rw, gq0_sw, gq0_iw, gq0_gl, & rain, rainc, tprcp, totprcp, cnvprcp, & totprcpb, cnvprcpb, cplflx, & @@ -47,8 +47,9 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, integer, intent(in) :: im integer, intent(in) :: km integer, intent(in) :: kdt + real(kind_phys), intent(in) :: delt logical, intent(in) :: do_sppt - logical, intent(in) :: do_pertmp + logical, intent(in) :: pert_mp logical, intent(in) :: do_ca logical, intent(in) :: ca_global logical, intent(in) :: use_zmtnblck @@ -91,8 +92,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, integer, intent(in) :: ntsw integer, intent(in) :: ntiw integer, intent(in) :: ntgl - ! dtdtr only allocated if do_sppt == .true. - real(kind_phys), dimension(:,:), intent(in) :: dtdtr + real(kind_phys), dimension(1:im,1:km), intent(inout) :: dtdtnp real(kind_phys), dimension(1:im), intent(in) :: rain real(kind_phys), dimension(1:im), intent(in) :: rainc real(kind_phys), dimension(1:im), intent(inout) :: tprcp @@ -149,7 +149,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, upert = (gu0(i,k) - ugrs(i,k)) * sppt_wts(i,k) vpert = (gv0(i,k) - vgrs(i,k)) * sppt_wts(i,k) - tpert = (gt0(i,k) - tgrs(i,k) - dtdtr(i,k)) * sppt_wts(i,k) + tpert = (gt0(i,k) - tgrs(i,k) - (delt*dtdtnp(i,k))) * sppt_wts(i,k) qpert = (gq0_wv(i,k) - qgrs_wv(i,k)) * sppt_wts(i,k) gu0(i,k) = ugrs(i,k)+upert @@ -159,11 +159,11 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, qnew = qgrs_wv(i,k)+qpert if (qnew >= 1.0e-10) then gq0_wv(i,k) = qnew - gt0(i,k) = tgrs(i,k) + tpert + dtdtr(i,k) + gt0(i,k) = tgrs(i,k) + tpert + (delt*dtdtnp(i,k)) endif - if (do_pertmp) then + if (pert_mp) then if (ntcw>0) then - qpert = gq0_cw(i,k) - qgrs_cw(i,k) * sppt_wts(i,k) + qpert = (gq0_cw(i,k) - qgrs_cw(i,k)) * sppt_wts(i,k) qnew = qgrs_cw(i,k)+qpert gq0_cw(i,k) = qnew if (qnew < 0.0) then @@ -171,7 +171,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, endif endif if (ntrw>0) then - qpert = gq0_rw(i,k) - qgrs_rw(i,k) * sppt_wts(i,k) + qpert = (gq0_rw(i,k) - qgrs_rw(i,k)) * sppt_wts(i,k) qnew = qgrs_rw(i,k)+qpert gq0_rw(i,k) = qnew if (qnew < 0.0) then @@ -179,7 +179,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, endif endif if (ntsw>0) then - qpert = gq0_sw(i,k) - qgrs_sw(i,k) * sppt_wts(i,k) + qpert = (gq0_sw(i,k) - qgrs_sw(i,k)) * sppt_wts(i,k) qnew = qgrs_sw(i,k)+qpert gq0_sw(i,k) = qnew if (qnew < 0.0) then @@ -187,7 +187,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, endif endif if (ntiw>0) then - qpert = gq0_iw(i,k) - qgrs_iw(i,k) * sppt_wts(i,k) + qpert = (gq0_iw(i,k) - qgrs_iw(i,k)) * sppt_wts(i,k) qnew = qgrs_iw(i,k)+qpert gq0_iw(i,k) = qnew if (qnew < 0.0) then @@ -195,7 +195,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, endif endif if (ntgl>0) then - qpert = gq0_gl(i,k) - qgrs_gl(i,k) * sppt_wts(i,k) + qpert = (gq0_gl(i,k) - qgrs_gl(i,k)) * sppt_wts(i,k) qnew = qgrs_gl(i,k)+qpert gq0_gl(i,k) = qnew if (qnew < 0.0) then @@ -219,6 +219,8 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, rain_cpl(:) = rain_cpl(:) + (sppt_wts(:,15) - 1.0)*drain_cpl(:) snow_cpl(:) = snow_cpl(:) + (sppt_wts(:,15) - 1.0)*dsnow_cpl(:) endif +!zero out radiative heating tendency for next physics step + dtdtnp(:,:)=0.0 endif @@ -262,7 +264,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, upert = (gu0(i,k) - ugrs(i,k)) * ca(i,k) vpert = (gv0(i,k) - vgrs(i,k)) * ca(i,k) - tpert = (gt0(i,k) - tgrs(i,k) - dtdtr(i,k)) * ca(i,k) + tpert = (gt0(i,k) - tgrs(i,k) - (delt*dtdtnp(i,k))) * ca(i,k) qpert = (gq0_wv(i,k) - qgrs_wv(i,k)) * ca(i,k) gu0(i,k) = ugrs(i,k)+upert gv0(i,k) = vgrs(i,k)+vpert @@ -270,7 +272,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, do_pertmp, use_zmtnblck, qnew = qgrs_wv(i,k)+qpert if (qnew >= 1.0e-10) then gq0_wv(i,k) = qnew - gt0(i,k) = tgrs(i,k) + tpert + dtdtr(i,k) + gt0(i,k) = tgrs(i,k) + tpert + (delt*dtdtnp(i,k)) endif enddo enddo diff --git a/physics/GFS_stochastics.meta b/physics/GFS_stochastics.meta index aae5868d1..26dcfd47e 100644 --- a/physics/GFS_stochastics.meta +++ b/physics/GFS_stochastics.meta @@ -31,6 +31,15 @@ type = integer intent = in optional = F +[delt] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [ntcw] standard_name = index_for_liquid_cloud_condensate long_name = tracer index for cloud condensate (or liquid water) @@ -79,7 +88,7 @@ type = logical intent = in optional = F -[do_pertmp] +[pert_mp] standard_name = flag_for_stochastic_microphysics_perturbations long_name = flag for stochastic microphysics physics perturbations units = flag @@ -406,10 +415,10 @@ kind = kind_phys intent = inout optional = F -[dtdtr] - standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step - long_name = temp. change due to radiative heating per time step - units = K +[dtdtnp] + standard_name = tendency_of_air_temperature_to_withold_from_sppt + long_name = temp. change from physics that should not be perturbed by sppt + units = K s-1 dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 62efa00d5..3ae660f81 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -85,7 +85,7 @@ end subroutine GFS_suite_interstitial_1_finalize !! \htmlinclude GFS_suite_interstitial_1_run.html !! subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, dtf, dtp, slmsk, area, dxmin, dxinv, pgr, & - islmsk, work1, work2, psurf, dudt, dvdt, dtdt, dtdtc, dqdt, errmsg, errflg) + islmsk, work1, work2, psurf, dudt, dvdt, dtdt, dqdt, errmsg, errflg) use machine, only: kind_phys @@ -98,7 +98,7 @@ subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, dtf, dtp, slmsk, area, integer, intent(out), dimension(im) :: islmsk real(kind=kind_phys), intent(out), dimension(im) :: work1, work2, psurf - real(kind=kind_phys), intent(out), dimension(im,levs) :: dudt, dvdt, dtdt, dtdtc + real(kind=kind_phys), intent(out), dimension(im,levs) :: dudt, dvdt, dtdt real(kind=kind_phys), intent(out), dimension(im,levs,ntrac) :: dqdt real(kind=kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys character(len=*), intent(out) :: errmsg @@ -125,7 +125,6 @@ subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, dtf, dtp, slmsk, area, dudt(i,k) = zero dvdt(i,k) = zero dtdt(i,k) = zero - dtdtc(i,k) = zero enddo enddo do n=1,ntrac diff --git a/physics/GFS_suite_interstitial.meta b/physics/GFS_suite_interstitial.meta index fdf1716f1..c09d02434 100644 --- a/physics/GFS_suite_interstitial.meta +++ b/physics/GFS_suite_interstitial.meta @@ -244,15 +244,6 @@ kind = kind_phys intent = out optional = F -[dtdtc] - standard_name = tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky - long_name = clear sky radiative (shortwave + longwave) heating rate at current time - units = K s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F [dqdt] standard_name = tendency_of_tracers_due_to_model_physics long_name = updated tendency of the tracers diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index e7a81b7c4..483eccdf8 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -26,7 +26,7 @@ end subroutine GFS_surface_generic_pre_finalize !! subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, stype, vtype, slope, & prsik_1, prslk_1, tsfc, phil, con_g, & - sigmaf, soiltyp, vegtype, slopetyp, work3, tsurf, zlvl, do_sppt, ca_global,dtdtr,& + sigmaf, soiltyp, vegtype, slopetyp, work3, tsurf, zlvl, & drain_cpl, dsnow_cpl, rain_cpl, snow_cpl, lndp_type, n_var_lndp, sfc_wts, & lndp_var_list, lndp_prt_list, & z01d, zt1d, bexp1d, xlai1d, vegf1d, lndp_vgf, sfc_wts_inv, & @@ -51,8 +51,6 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, real(kind=kind_phys), dimension(im), intent(inout) :: sigmaf, work3, tsurf, zlvl ! Stochastic physics / surface perturbations - logical, intent(in) :: do_sppt, ca_global - real(kind=kind_phys), dimension(im,levs), intent(out) :: dtdtr real(kind=kind_phys), dimension(im), intent(out) :: drain_cpl real(kind=kind_phys), dimension(im), intent(out) :: dsnow_cpl real(kind=kind_phys), dimension(im), intent(in) :: rain_cpl @@ -100,10 +98,6 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, errmsg = '' errflg = 0 - ! Set initial quantities for stochastic physics deltas - if (do_sppt .or. ca_global) then - dtdtr = 0.0 - endif ! Scale random patterns for surface perturbations with perturbation size ! Turn vegetation fraction pattern into percentile pattern diff --git a/physics/GFS_surface_generic.meta b/physics/GFS_surface_generic.meta index 44e4f7f68..d4c8b1bca 100644 --- a/physics/GFS_surface_generic.meta +++ b/physics/GFS_surface_generic.meta @@ -188,31 +188,6 @@ kind = kind_phys intent = inout optional = F -[do_sppt] - standard_name = flag_for_stochastic_physics_perturbations - long_name = flag for stochastic physics perturbations - units = flag - dimensions = () - type = logical - intent = in - optional = F -[ca_global] - standard_name = flag_for_global_cellular_automata - long_name = switch for global ca - units = flag - dimensions = () - type = logical - intent = in - optional = F -[dtdtr] - standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step - long_name = temp. change due to radiative heating per time step - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F [drain_cpl] standard_name = tendency_of_lwe_thickness_of_precipitation_amount_for_coupling long_name = change in rain_cpl (coupling_type) diff --git a/physics/dcyc2.f b/physics/dcyc2.f index 389496d07..c8ef077f8 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -48,7 +48,7 @@ end subroutine dcyc2t3_finalize ! im, levs, deltim, fhswr, ! ! dry, icy, wet ! ! input/output: ! -! dtdt,dtdtc, ! +! dtdt,dtdtnp, ! ! outputs: ! ! adjsfcdsw,adjsfcnsw,adjsfcdlw,adjsfculw, ! ! adjsfculw_lnd,adjsfculw_ice,adjsfculw_wat,xmu,xcosz, ! @@ -100,8 +100,7 @@ end subroutine dcyc2t3_finalize ! input/output: ! ! dtdt(im,levs)- real, model time step adjusted total radiation ! ! heating rates ( k/s ) ! -! dtdtc(im,levs)- real, model time step adjusted clear sky radiation! -! heating rates ( k/s ) ! +! dtdtnp(im,levs)- real, heating rate adjustment for SPPT ! ! ! ! outputs: ! ! adjsfcdsw(im)- real, time step adjusted sfc dn sw flux (w/m**2) ! @@ -181,9 +180,10 @@ subroutine dcyc2t3_run & & im, levs, deltim, fhswr, & & dry, icy, wet, & & use_LW_jacobian, sfculw, sfculw_jac, & + & pert_radtend, do_sppt, & ! & dry, icy, wet, lprnt, ipr, & ! --- input/output: - & dtdt,dtdtc, & + & dtdt,dtdtnp, & ! --- outputs: & adjsfcdsw,adjsfcnsw,adjsfcdlw,adjsfculw, & & adjsfculw_lnd,adjsfculw_ice,adjsfculw_wat,xmu,xcosz, & @@ -212,7 +212,7 @@ subroutine dcyc2t3_run & ! integer, intent(in) :: ipr ! logical lprnt logical, dimension(im), intent(in) :: dry, icy, wet - logical, intent(in) :: use_LW_jacobian + logical, intent(in) :: use_LW_jacobian, pert_radtend,do_sppt real(kind=kind_phys), intent(in) :: solhr, slag, cdec, sdec, & & deltim, fhswr @@ -233,7 +233,7 @@ subroutine dcyc2t3_run & ! --- input/output: real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdt & - &, dtdtc + &, dtdtnp ! --- outputs: real(kind=kind_phys), dimension(im), intent(out) :: & @@ -358,9 +358,25 @@ subroutine dcyc2t3_run & do k = 1, levs do i = 1, im dtdt(i,k) = dtdt(i,k) + swh(i,k)*xmu(i) + hlw(i,k) - dtdtc(i,k) = dtdtc(i,k) + swhc(i,k)*xmu(i) + hlwc(i,k) enddo enddo + if (do_sppt) then + if (pert_radtend) then +! clear sky + do k = 1, levs + do i = 1, im + dtdtnp(i,k) = dtdtnp(i,k) + swhc(i,k)*xmu(i) + hlwc(i,k) + enddo + enddo + else +! all sky + do k = 1, levs + do i = 1, im + dtdtnp(i,k) = dtdtnp(i,k) + swh(i,k)*xmu(i) + hlw(i,k) + enddo + enddo + endif + endif ! return !................................... diff --git a/physics/dcyc2.meta b/physics/dcyc2.meta index efba0a5f5..aa6d2c35a 100644 --- a/physics/dcyc2.meta +++ b/physics/dcyc2.meta @@ -362,9 +362,25 @@ kind = kind_phys intent = inout optional = F -[dtdtc] - standard_name = tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky - long_name = clear sky radiative (shortwave + longwave) heating rate at current time +[pert_radtend] + standard_name = flag_for_stochastic_radiative_heating_perturbations + long_name = flag for stochastic radiative heating perturbations + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_sppt] + standard_name = flag_for_stochastic_physics_perturbations + long_name = flag for stochastic physics perturbations + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dtdtnp] + standard_name = tendency_of_air_temperature_to_withold_from_sppt + long_name = temp. change from physics that should not be perturbed by sppt units = K s-1 dimensions = (horizontal_loop_extent,vertical_dimension) type = real From c148234daf6814c824da55f61e13bb6f64f7241d Mon Sep 17 00:00:00 2001 From: pjpegion Date: Tue, 2 Feb 2021 20:03:29 +0000 Subject: [PATCH 07/11] add ca_global to radiation tendency logic --- physics/GFS_stochastics.F90 | 4 +++- physics/dcyc2.f | 7 ++++--- physics/dcyc2.meta | 8 ++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index a3b4f30cf..759bb20fe 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -219,7 +219,7 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc rain_cpl(:) = rain_cpl(:) + (sppt_wts(:,15) - 1.0)*drain_cpl(:) snow_cpl(:) = snow_cpl(:) + (sppt_wts(:,15) - 1.0)*dsnow_cpl(:) endif -!zero out radiative heating tendency for next physics step + !zero out radiative heating tendency for next physics step dtdtnp(:,:)=0.0 endif @@ -290,6 +290,8 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc rain_cpl(:) = rain_cpl(:) + (ca(:,15) - 1.0)*drain_cpl(:) snow_cpl(:) = snow_cpl(:) + (ca(:,15) - 1.0)*dsnow_cpl(:) endif + !zero out radiative heating tendency for next physics step + dtdtnp(:,:)=0.0 endif diff --git a/physics/dcyc2.f b/physics/dcyc2.f index c8ef077f8..c00234ca2 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -180,7 +180,7 @@ subroutine dcyc2t3_run & & im, levs, deltim, fhswr, & & dry, icy, wet, & & use_LW_jacobian, sfculw, sfculw_jac, & - & pert_radtend, do_sppt, & + & pert_radtend, do_sppt,ca_global, & ! & dry, icy, wet, lprnt, ipr, & ! --- input/output: & dtdt,dtdtnp, & @@ -212,7 +212,8 @@ subroutine dcyc2t3_run & ! integer, intent(in) :: ipr ! logical lprnt logical, dimension(im), intent(in) :: dry, icy, wet - logical, intent(in) :: use_LW_jacobian, pert_radtend,do_sppt + logical, intent(in) :: use_LW_jacobian, pert_radtend + logical, intent(in) :: do_sppt,ca_global real(kind=kind_phys), intent(in) :: solhr, slag, cdec, sdec, & & deltim, fhswr @@ -360,7 +361,7 @@ subroutine dcyc2t3_run & dtdt(i,k) = dtdt(i,k) + swh(i,k)*xmu(i) + hlw(i,k) enddo enddo - if (do_sppt) then + if (do_sppt .or. ca_global) then if (pert_radtend) then ! clear sky do k = 1, levs diff --git a/physics/dcyc2.meta b/physics/dcyc2.meta index aa6d2c35a..e4a22477d 100644 --- a/physics/dcyc2.meta +++ b/physics/dcyc2.meta @@ -378,6 +378,14 @@ type = logical intent = in optional = F +[ca_global] + standard_name = flag_for_global_cellular_automata + long_name = switch for global ca + units = flag + dimensions = () + type = logical + intent = in + optional = F [dtdtnp] standard_name = tendency_of_air_temperature_to_withold_from_sppt long_name = temp. change from physics that should not be perturbed by sppt From f304650eb492c18ad8879476ec42a685b66b429d Mon Sep 17 00:00:00 2001 From: pjpegion Date: Tue, 2 Feb 2021 20:07:21 +0000 Subject: [PATCH 08/11] add MP perturbations to ca_global section --- physics/GFS_stochastics.F90 | 46 +++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index 759bb20fe..ab05afe5f 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -215,10 +215,10 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc totprcpb(:) = totprcpb(:) + (sppt_wts(:,15) - 1 )*rain(:) cnvprcpb(:) = cnvprcpb(:) + (sppt_wts(:,15) - 1 )*rainc(:) - if (cplflx) then + if (cplflx) then rain_cpl(:) = rain_cpl(:) + (sppt_wts(:,15) - 1.0)*drain_cpl(:) snow_cpl(:) = snow_cpl(:) + (sppt_wts(:,15) - 1.0)*dsnow_cpl(:) - endif + endif !zero out radiative heating tendency for next physics step dtdtnp(:,:)=0.0 @@ -274,6 +274,48 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc gq0_wv(i,k) = qnew gt0(i,k) = tgrs(i,k) + tpert + (delt*dtdtnp(i,k)) endif + if (pert_mp) then + if (ntcw>0) then + qpert = (gq0_cw(i,k) - qgrs_cw(i,k)) * ca(i,k) + qnew = qgrs_cw(i,k)+qpert + gq0_cw(i,k) = qnew + if (qnew < 0.0) then + gq0_cw(i,k) = 0.0 + endif + endif + if (ntrw>0) then + qpert = (gq0_rw(i,k) - qgrs_rw(i,k)) * ca(i,k) + qnew = qgrs_rw(i,k)+qpert + gq0_rw(i,k) = qnew + if (qnew < 0.0) then + gq0_rw(i,k) = 0.0 + endif + endif + if (ntsw>0) then + qpert = (gq0_sw(i,k) - qgrs_sw(i,k)) * ca(i,k) + qnew = qgrs_sw(i,k)+qpert + gq0_sw(i,k) = qnew + if (qnew < 0.0) then + gq0_sw(i,k) = 0.0 + endif + endif + if (ntiw>0) then + qpert = (gq0_iw(i,k) - qgrs_iw(i,k)) * ca(i,k) + qnew = qgrs_iw(i,k)+qpert + gq0_iw(i,k) = qnew + if (qnew < 0.0) then + gq0_iw(i,k) = 0.0 + endif + endif + if (ntgl>0) then + qpert = (gq0_gl(i,k) - qgrs_gl(i,k)) * ca(i,k) + qnew = qgrs_gl(i,k)+qpert + gq0_gl(i,k) = qnew + if (qnew < 0.0) then + gq0_gl(i,k) = 0.0 + endif + endif + endif enddo enddo From eaab868187a34adbc42e84a08c3df1bc5fa90e77 Mon Sep 17 00:00:00 2001 From: Philip Pegion Date: Wed, 3 Mar 2021 13:48:56 -0600 Subject: [PATCH 09/11] point to correct branch of rrtmgp --- physics/rte-rrtmgp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/rte-rrtmgp b/physics/rte-rrtmgp index 566bee9cd..33c8a984c 160000 --- a/physics/rte-rrtmgp +++ b/physics/rte-rrtmgp @@ -1 +1 @@ -Subproject commit 566bee9cd6f9977e82d75d9b4964b20b1ff6163d +Subproject commit 33c8a984c17cf41be5d4c2928242e1b4239bfc40 From daca231e7f31a8e8579e9b18596444164607e447 Mon Sep 17 00:00:00 2001 From: pjpegion Date: Mon, 15 Mar 2021 19:44:20 +0000 Subject: [PATCH 10/11] Address Dom code review --- physics/GFS_rrtmg_pre.F90 | 31 +------------------------------ physics/GFS_stochastics.F90 | 20 ++++++++++---------- physics/dcyc2.f | 4 ++-- 3 files changed, 13 insertions(+), 42 deletions(-) diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 351f9004c..4acabd8f4 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -183,7 +183,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & real(kind=kind_phys), dimension(im,lm+LTP) :: & htswc, htlwc, gcice, grain, grime, htsw0, htlw0, & rhly, tvly,qstl, vvel, clw, ciw, prslk1, tem2da, & - dzb, hzb, cldcov, deltaq, cnvc, cnvw, & + dzb, hzb, cldcov, deltaq, cnvc, cnvw, & effrl, effri, effrr, effrs, rho, orho, plyrpa ! for Thompson MP @@ -938,35 +938,6 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & ccnd(1:IM,1:LMK,1) = ccnd(1:IM,1:LMK,1) + cnvw(1:IM,1:LMK) endif -! perturb cld cover - !if (pert_clds) then - ! cldp1d(:) = 0. - ! do i=1,im - ! tmp_wt= -1*log( ( 2.0 / ( sppt_wts(i,38) ) ) - 1 ) - ! call cdfnor(tmp_wt,cdfz) - ! cldp1d(i) = cdfz - ! enddo - ! do i = 1, IM - ! do k = 1, LM - ! ! compute beta distribution parameters - ! m = cldcov(i,k+kd) - ! if (m<0.99 .AND. m > 0.01) then - ! s = sppt_amp*m*(1.-m) - ! alpha0 = m*m*(1.-m)/(s*s)-m - ! beta0 = alpha0*(1.-m)/m - ! ! compute beta distribution value corresponding - ! ! to the given percentile albPpert to use as new albedo - ! call ppfbet(cldp1d(i),alpha0,beta0,iflag,cldtmp) - ! cldcov(i,k+kd) = cldtmp - ! else - ! cldcov(i,k+kd) = m - ! endif - ! enddo ! end_do_i_loop - ! enddo ! end_do_k_loop - !endif - !print*,'after cld perts',minval(cldcov),maxval(cldcov) - - if (imp_physics == imp_physics_zhao_carr .or. imp_physics == imp_physics_mg) then ! zhao/moorthi's prognostic cloud scheme ! or unified cloud and/or with MG microphysics diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index ab05afe5f..267f4b289 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -73,20 +73,20 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs real(kind_phys), dimension(1:im,1:km), intent(in) :: tgrs real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs_wv - real(kind_phys), dimension(:,:), intent(in) :: qgrs_cw - real(kind_phys), dimension(:,:), intent(in) :: qgrs_rw - real(kind_phys), dimension(:,:), intent(in) :: qgrs_sw - real(kind_phys), dimension(:,:), intent(in) :: qgrs_iw - real(kind_phys), dimension(:,:), intent(in) :: qgrs_gl + real(kind_phys), dimension(:,:), intent(in) :: qgrs_cw + real(kind_phys), dimension(:,:), intent(in) :: qgrs_rw + real(kind_phys), dimension(:,:), intent(in) :: qgrs_sw + real(kind_phys), dimension(:,:), intent(in) :: qgrs_iw + real(kind_phys), dimension(:,:), intent(in) :: qgrs_gl real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0_wv - real(kind_phys), dimension(:,:), intent(inout) :: gq0_cw - real(kind_phys), dimension(:,:), intent(inout) :: gq0_rw - real(kind_phys), dimension(:,:), intent(inout) :: gq0_sw - real(kind_phys), dimension(:,:), intent(inout) :: gq0_iw - real(kind_phys), dimension(:,:), intent(inout) :: gq0_gl + real(kind_phys), dimension(:,:), intent(inout) :: gq0_cw + real(kind_phys), dimension(:,:), intent(inout) :: gq0_rw + real(kind_phys), dimension(:,:), intent(inout) :: gq0_sw + real(kind_phys), dimension(:,:), intent(inout) :: gq0_iw + real(kind_phys), dimension(:,:), intent(inout) :: gq0_gl integer, intent(in) :: ntcw integer, intent(in) :: ntrw integer, intent(in) :: ntsw diff --git a/physics/dcyc2.f b/physics/dcyc2.f index c00234ca2..f29d593a3 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -233,8 +233,8 @@ subroutine dcyc2t3_run & &, swhc, hlwc ! --- input/output: - real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdt & - &, dtdtnp + real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdt + real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdtnp ! --- outputs: real(kind=kind_phys), dimension(im), intent(out) :: & From bb0839e0c5db5eb320a599c37de4231c89ce3bda Mon Sep 17 00:00:00 2001 From: pjpegion Date: Thu, 18 Mar 2021 14:12:04 +0000 Subject: [PATCH 11/11] change declaration of dtdtnp in GFS_stochastics --- physics/GFS_stochastics.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index 267f4b289..b3dda08da 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -92,7 +92,7 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc integer, intent(in) :: ntsw integer, intent(in) :: ntiw integer, intent(in) :: ntgl - real(kind_phys), dimension(1:im,1:km), intent(inout) :: dtdtnp + real(kind_phys), dimension(:,:), intent(inout) :: dtdtnp real(kind_phys), dimension(1:im), intent(in) :: rain real(kind_phys), dimension(1:im), intent(in) :: rainc real(kind_phys), dimension(1:im), intent(inout) :: tprcp