From c332b82c0ddea144132a04a617579e4a10bccdc1 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 4 Jan 2021 23:56:59 +0000 Subject: [PATCH 01/24] remove all d*3dt variables and switch to dtend (these changes are totally untested) --- physics/GFS_DCNV_generic.F90 | 50 ++-- physics/GFS_DCNV_generic.meta | 65 ++++- physics/GFS_GWD_generic.F90 | 63 +++-- physics/GFS_GWD_generic.meta | 128 ++++++---- physics/GFS_MP_generic.F90 | 80 ++++--- physics/GFS_MP_generic.meta | 126 +++++----- physics/GFS_PBL_generic.F90 | 58 +++-- physics/GFS_PBL_generic.meta | 99 ++++++++ physics/GFS_SCNV_generic.F90 | 46 ++-- physics/GFS_SCNV_generic.meta | 79 ++++--- physics/GFS_debug.F90 | 28 +-- physics/GFS_suite_interstitial.F90 | 69 ++++-- physics/GFS_suite_interstitial.meta | 101 ++++---- physics/cires_ugwp.F90 | 53 +++-- physics/cires_ugwp.meta | 94 ++++---- physics/cu_gf_driver.F90 | 88 +++++-- physics/cu_gf_driver.meta | 125 +++++----- physics/gwdc.f | 21 +- physics/gwdc.meta | 50 +++- physics/h2ophys.f | 3 +- physics/h2ophys.meta | 8 - physics/module_MYJPBL_wrapper.F90 | 38 +-- physics/module_MYJPBL_wrapper.meta | 83 ++++--- physics/module_MYNNPBL_wrapper.F90 | 42 ++-- physics/module_MYNNPBL_wrapper.meta | 102 ++++---- physics/moninedmf.f | 71 ++++-- physics/moninedmf.meta | 98 ++++---- physics/ozphys.f | 64 +++-- physics/ozphys.meta | 88 ++++--- physics/ozphys_2015.f | 51 ++-- physics/ozphys_2015.meta | 88 ++++--- physics/phys_tend.F90 | 107 ++++----- physics/phys_tend.meta | 352 +++------------------------- physics/rayleigh_damp.f | 40 +++- physics/rayleigh_damp.meta | 65 +++-- physics/shinhongvdif.F90 | 71 +++--- physics/shinhongvdif.meta | 91 ++++--- physics/unified_ugwp.F90 | 55 +++-- physics/unified_ugwp.meta | 103 ++++---- physics/ysuvdif.F90 | 58 +++-- 40 files changed, 1683 insertions(+), 1418 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index bfe97bc70..fbadc38f5 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -91,10 +91,11 @@ end subroutine GFS_DCNV_generic_post_finalize !> \section arg_table_GFS_DCNV_generic_post_run Argument Table !! \htmlinclude GFS_DCNV_generic_post_run.html !! - subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, cscnv, & + subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & frain, rain1, dtf, cld1d, save_u, save_v, save_t, save_qv, gu0, gv0, gt0, & gq0_water_vapor, ud_mf, dd_mf, dt_mf, con_g, npdf3d, num_p3d, ncnvcld3d, & - rainc, cldwrk, dt3dt, dq3dt, du3dt, dv3dt, upd_mf, dwn_mf, det_mf, & + rainc, cldwrk, upd_mf, dwn_mf, det_mf, dtend, dtidx, index_for_cause_dcnv, & + index_for_temperature, index_for_x_wind, index_for_y_wind, ntqv, & cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, flag_for_dcnv_generic_tend, errmsg, errflg) @@ -103,7 +104,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, cs implicit none integer, intent(in) :: im, levs - logical, intent(in) :: lssav, ldiag3d, qdiag3d, ras, cscnv + logical, intent(in) :: lssav, ldiag3d, ras, cscnv logical, intent(in) :: flag_for_dcnv_generic_tend real(kind=kind_phys), intent(in) :: frain, dtf @@ -115,10 +116,14 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, cs integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cldwrk - ! dt3dt, dq3dt, du3dt, dv3dt upd_mf, dwn_mf, det_mf only allocated if ldiag3d == .true. - real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, dq3dt, du3dt, dv3dt + ! dtend, upd_mf, dwn_mf, det_mf only allocated if ldiag3d == .true. real(kind=kind_phys), dimension(:,:), intent(inout) :: upd_mf, dwn_mf, det_mf real(kind=kind_phys), dimension(im,levs), intent(inout) :: cnvw, cnvc + + real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend + integer, intent(in) :: dtidx(:,:), index_for_cause_dcnv, index_for_temperature, & + index_for_x_wind, index_for_y_wind, ntqv + ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays @@ -128,7 +133,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, cs character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k + integer :: i, k, idtend ! Initialize CCPP error handling variables errmsg = '' @@ -164,23 +169,24 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, cs enddo if (ldiag3d .and. flag_for_dcnv_generic_tend) then - do k=1,levs - do i=1,im - dt3dt(i,k) = dt3dt(i,k) + (gt0(i,k)-save_t(i,k)) * frain - du3dt(i,k) = du3dt(i,k) + (gu0(i,k)-save_u(i,k)) * frain - dv3dt(i,k) = dv3dt(i,k) + (gv0(i,k)-save_v(i,k)) * frain + idtend=dtidx(index_for_temperature,index_for_cause_dcnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gt0-save_t)*frain + endif -! upd_mf(i,k) = upd_mf(i,k) + ud_mf(i,k) * (con_g*frain) -! dwn_mf(i,k) = dwn_mf(i,k) + dd_mf(i,k) * (con_g*frain) -! det_mf(i,k) = det_mf(i,k) + dt_mf(i,k) * (con_g*frain) - enddo - enddo - if(qdiag3d) then - do k=1,levs - do i=1,im - dq3dt(i,k) = dq3dt(i,k) + (gq0_water_vapor(i,k)-save_qv(i,k)) * frain - enddo - enddo + idtend=dtidx(index_for_x_wind,index_for_cause_dcnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gu0-save_u)*frain + endif + + idtend=dtidx(index_for_y_wind,index_for_cause_dcnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0-save_v)*frain + endif + + idtend=dtidx(100+ntqv,index_for_cause_dcnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0_water_vapor-save_qv)*frain endif endif ! if (ldiag3d) diff --git a/physics/GFS_DCNV_generic.meta b/physics/GFS_DCNV_generic.meta index ff7933f07..95b79976b 100644 --- a/physics/GFS_DCNV_generic.meta +++ b/physics/GFS_DCNV_generic.meta @@ -196,14 +196,6 @@ type = logical intent = in optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = in - optional = F [ras] standard_name = flag_for_ras_deep_convection long_name = flag for ras convection scheme @@ -355,6 +347,63 @@ kind = kind_phys intent = in optional = F +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + type = real + kind = kind_phys + intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F +[index_for_cause_dcnv] + standard_name = index_for_cause_dcnv + long_name = tracer changes caused by deep convection scheme + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in + optional = F [con_g] standard_name = gravitational_acceleration long_name = gravitational acceleration diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index 2ab0fb37a..33c61384b 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -20,7 +20,9 @@ subroutine GFS_GWD_generic_pre_run( & & oc, oa4, clx, theta, & & varss, ocss, oa4ss, clxss, & & sigma, gamma, elvmax, lssav, ldiag3d, & - & dudt, dvdt, dtdt, du3dt, dv3dt, dt3dt, dtf, & + & dtend, dtidx, index_for_temperature, index_for_x_wind, & + & index_for_y_wind, index_for_cause_orographic_gwd, & + & dudt, dvdt, dtdt, dtf, & & flag_for_gwd_generic_tend, errmsg, errflg) use machine, only : kind_phys @@ -36,14 +38,16 @@ subroutine GFS_GWD_generic_pre_run( & logical, intent(in) :: lssav, ldiag3d, flag_for_gwd_generic_tend real(kind=kind_phys), intent(in) :: dtdt(im,levs), dudt(im,levs), dvdt(im,levs) - ! dt3dt only allocated only if ldiag3d is .true. - real(kind=kind_phys), intent(inout) :: dt3dt(:,:), du3dt(:,:), dv3dt(:,:) + ! dtend only allocated only if ldiag3d is .true. + real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), index_for_temperature, & + & index_for_x_wind, index_for_y_wind, index_for_cause_orographic_gwd real(kind=kind_phys), intent(in) :: dtf character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k + integer :: i, k, idtend ! Initialize CCPP error handling variables errmsg = '' @@ -117,15 +121,20 @@ subroutine GFS_GWD_generic_pre_run( & elvmax = 0 endif ! end if_nmtvr - if (lssav) then - if (ldiag3d .and. flag_for_gwd_generic_tend) then - do k=1,levs - do i=1,im - dt3dt(i,k) = dt3dt(i,k) - dtdt(i,k)*dtf - du3dt(i,k) = du3dt(i,k) - dudt(i,k)*dtf - dv3dt(i,k) = dv3dt(i,k) - dvdt(i,k)*dtf - enddo - enddo + if (lssav .and. ldiag3d .and. flag_for_gwd_generic_tend) then + idtend = dtidx(index_for_temperature, index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) - dtdt*dtf + endif + + idtend = dtidx(index_for_x_wind, index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) - dudt*dtf + endif + + idtend = dtidx(index_for_y_wind, index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) - dvdt*dtf endif endif @@ -154,7 +163,8 @@ end subroutine GFS_GWD_generic_post_init !! \section detailed Detailed Algorithm !! @{ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, dvdt, dtdt, & - & dugwd, dvgwd, du3dt, dv3dt, dt3dt, flag_for_gwd_generic_tend, errmsg, errflg) + & dugwd, dvgwd, flag_for_gwd_generic_tend, dtend, dtidx, index_for_temperature, index_for_x_wind, & + & index_for_y_wind, index_for_cause_orographic_gwd, errmsg, errflg use machine, only : kind_phys implicit none @@ -166,11 +176,17 @@ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, d real(kind=kind_phys), intent(in) :: dtf real(kind=kind_phys), intent(inout) :: dugwd(:), dvgwd(:) - real(kind=kind_phys), intent(inout) :: du3dt(:,:), dv3dt(:,:), dt3dt(:,:) + + ! dtend only allocated only if ldiag3d is .true. + real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), index_for_temperature, & + & index_for_x_wind, index_for_y_wind, index_for_cause_orographic_gwd character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + integer :: idtend + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -180,9 +196,20 @@ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, d dvgwd(:) = dvgwd(:) + dvsfcg(:)*dtf if (ldiag3d .and. flag_for_gwd_generic_tend) then - du3dt(:,:) = du3dt(:,:) + dudt(:,:) * dtf - dv3dt(:,:) = dv3dt(:,:) + dvdt(:,:) * dtf - dt3dt(:,:) = dt3dt(:,:) + dtdt(:,:) * dtf + idtend = dtidx(index_for_temperature, index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtdt*dtf + endif + + idtend = dtidx(index_for_x_wind, index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dudt*dtf + endif + + idtend = dtidx(index_for_y_wind, index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dvdt*dtf + endif endif endif diff --git a/physics/GFS_GWD_generic.meta b/physics/GFS_GWD_generic.meta index dc7ed7a70..2de649338 100644 --- a/physics/GFS_GWD_generic.meta +++ b/physics/GFS_GWD_generic.meta @@ -182,32 +182,54 @@ kind = kind_phys intent = in optional = F -[du3dt] - standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in x wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dv3dt] - standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in y wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt] - standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag - long_name = cumulative change in temperature due to orographic gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_orographic_gwd] + standard_name = index_for_cause_orographic_gwd + long_name = tracer changes caused by orographic gravity wave drag + units = index + dimensions = () + type = integer + intent = in optional = F [dtf] standard_name = time_step_for_dynamics @@ -342,32 +364,54 @@ kind = kind_phys intent = inout optional = F -[du3dt] - standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in zonal wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dv3dt] - standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in meridional wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt] - standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag - long_name = cumulative change in temperature due to orographic gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_orographic_gwd] + standard_name = index_for_cause_orographic_gwd + long_name = tracer changes caused by orographic gravity wave drag + units = index + dimensions = () + type = integer + intent = in optional = F [flag_for_gwd_generic_tend] standard_name = flag_for_generic_gravity_wave_drag_tendency diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 435a80509..50e8407bf 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -12,7 +12,7 @@ end subroutine GFS_MP_generic_pre_init !> \section arg_table_GFS_MP_generic_pre_run Argument Table !! \htmlinclude GFS_MP_generic_pre_run.html !! - subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, ntrac, gt0, gq0, save_t, save_qv, save_q, errmsg, errflg) + subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, ntrac, gt0, gq0, save_t, save_q, errmsg, errflg) ! use machine, only: kind_phys @@ -22,7 +22,7 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 - real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t, save_qv + real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: save_q character(len=*), intent(out) :: errmsg @@ -41,16 +41,15 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, enddo enddo if(qdiag3d) then - do k=1,levs - do i=1,im - ! Here, gq0(...,1) is used instead of gq0_water_vapor - ! to be consistent with the GFS_MP_generic_post_run - ! code. - save_qv(i,k) = gq0(i,k,1) + do n=1,ntrac + do k=1,levs + do i=1,im + save_q(i,k,n) = gq0(i,k,n) + enddo enddo enddo - endif - if(do_aw) then + else if(do_aw) then + ! if qdiag3d, all q are save already save_q(1:im,:,1) = gq0(1:im,:,1) do n=ntcw,ntcw+nncl-1 save_q(1:im,:,n) = gq0(1:im,:,n) @@ -85,12 +84,14 @@ end subroutine GFS_MP_generic_post_init !> \section gfs_mp_gen GFS MP Generic Post General Algorithm !> @{ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, & - imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires, cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, & - rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_qv, rain0, ice0, snow0, & + imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, & + rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, 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, & + totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, 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, & - graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, errmsg, errflg) + graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, & + dtend, dtidx, ncause, index_for_temperature, index_for_cause_mp,ldiag3d, qdiag3d, lssav, & + errmsg, errflg) ! use machine, only: kind_phys @@ -99,15 +100,16 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, integer, intent(in) :: im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm + integer, intent(in) :: index_for_temperature,index_for_cause_mp,ncause real(kind=kind_phys), intent(in) :: dtf, frain, con_g real(kind=kind_phys), dimension(im), intent(in) :: rain1, xlat, xlon, tsfc real(kind=kind_phys), dimension(im), intent(inout) :: ice, snow, graupel, rainc real(kind=kind_phys), dimension(im), intent(in) :: rain0, ice0, snow0, graupel0 real(kind=kind_phys), dimension(im,nrcm), intent(in) :: rann - real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, prsl, save_t, save_qv, del + real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, prsl, save_t, del real(kind=kind_phys), dimension(im,levs+1), intent(in) :: prsi, phii - real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0 + real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0, save_q real(kind=kind_phys), dimension(im), intent(in ) :: sr real(kind=kind_phys), dimension(im), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & @@ -115,8 +117,8 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, & snow_cpl, pwat - real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt ! only if ldiag3d - real(kind=kind_phys), dimension(:,:), intent(inout) :: dq3dt ! only if ldiag3d and qdiag3d + real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend ! only if ldiag3d + integer, dimension(ntrac,ncause), intent(in) :: dtidx ! Stochastic physics / surface perturbations logical, intent(in) :: do_sppt, ca_global @@ -151,7 +153,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, real(kind=kind_phys), parameter :: p850 = 85000.0_kind_phys ! *DH - integer :: i, k, ic + integer :: i, k, ic, itrac, idtend real(kind=kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys real(kind=kind_phys) :: crain, csnow, onebg, tem, total_precip, tem1, tem2 @@ -322,7 +324,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, endif endif - if (lssav) then + if_save_fields: if (lssav) then ! if (Model%me == 0) print *,'in phys drive, kdt=',Model%kdt, & ! 'totprcpb=', Diag%totprcpb(1),'totprcp=',Diag%totprcp(1), & ! 'rain=',Diag%rain(1) @@ -340,21 +342,29 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, totgrpb (i) = totgrpb (i) + graupel(i) enddo - if (ldiag3d) then - do k=1,levs - do i=1,im - dt3dt(i,k) = dt3dt(i,k) + (gt0(i,k)-save_t(i,k)) * frain - enddo - enddo - if (qdiag3d) then - do k=1,levs - do i=1,im - dq3dt(i,k) = dq3dt(i,k) + (gq0(i,k,1)-save_qv(i,k)) * frain - enddo - enddo - endif - endif - endif + if_tendency_diagnostics: if (ldiag3d) then + idtend = dtidx(index_for_temperature,index_for_cause_mp) + if(idtend>1) then + do k=1,levs + do i=1,im + dtend(i,k,idtend) = dtend(i,k,idtend) + (gt0(i,k)-save_t(i,k)) * frain + enddo + enddo + endif + if_tracer_diagnostics: if (qdiag3d) then + dtend_q: do itrac=1,ntrac + idtend = dtidx(itrac+100,index_for_cause_mp) + if(idtend>1) then + do k=1,levs + do i=1,im + dtend(i,k,idtend) = dtend(i,k,idtend) + (gq0(i,k,itrac)-save_q(i,k,itrac)) * frain + enddo + enddo + endif + enddo dtend_q + endif if_tracer_diagnostics + endif if_tendency_diagnostics + endif if_save_fields if (cplflx .or. cplchm) then do i = 1, im diff --git a/physics/GFS_MP_generic.meta b/physics/GFS_MP_generic.meta index 981f5478d..3added996 100644 --- a/physics/GFS_MP_generic.meta +++ b/physics/GFS_MP_generic.meta @@ -98,15 +98,6 @@ kind = kind_phys intent = inout optional = F -[save_qv] - standard_name = water_vapor_specific_humidity_save - long_name = water vapor specific humidity before entering a physics scheme - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F [save_q] standard_name = tracer_concentration_save long_name = tracer concentration before entering a physics scheme @@ -256,30 +247,6 @@ type = logical intent = in optional = F -[lssav] - standard_name = flag_diagnostics - long_name = logical flag for storing diagnostics - units = flag - dimensions = () - type = logical - intent = in - optional = F -[ldiag3d] - standard_name = flag_diagnostics_3D - long_name = flag for 3d diagnostic fields - units = flag - dimensions = () - type = logical - intent = in - optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = logical flag for 3D tracer diagnostics - units = flag - dimensions = () - type = logical - intent = in - optional = F [cplflx] standard_name = flag_for_flux_coupling long_name = flag controlling cplflx collection (default off) @@ -458,14 +425,14 @@ kind = kind_phys intent = in optional = F -[save_qv] - standard_name = water_vapor_specific_humidity_save - long_name = water vapor specific humidity before entering a physics scheme +[save_q] + standard_name = tracer_concentration_save + long_name = tracer concentration before entering a physics scheme units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) type = real kind = kind_phys - intent = in + intent = inout optional = F [rain0] standard_name = lwe_thickness_of_explicit_rain_amount @@ -674,24 +641,6 @@ kind = kind_phys intent = inout optional = F -[dt3dt] - standard_name = cumulative_change_in_temperature_due_to_microphysics - long_name = cumulative change in temperature due to microphysics - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[dq3dt] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_microphysics - long_name = cumulative change in water vapor specific humidity due to microphysics - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F [rain_cpl] standard_name = lwe_thickness_of_precipitation_amount_for_coupling long_name = total rain precipitation @@ -903,6 +852,71 @@ kind = kind_phys intent = in optional = F +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + type = real + kind = kind_phys + intent = inout + optional = F +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_causes) + type = integer + intent = in + optional = F +[ncause] + standard_name = number_of_possible_causes_of_tracer_changes + long_name = number of possible causes of tracer changes + units = count + dimensions = () + type = integer + intent = in + optional = F +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_mp] + standard_name = index_for_cause_mp + long_name = tracer changes caused by microphysics scheme + units = index + dimensions = () + type = integer + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[qdiag3d] + standard_name = flag_tracer_diagnostics_3D + long_name = logical flag for 3D tracer diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 357309b2a..d65b019b5 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -311,12 +311,12 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, trans_aero, ntchs, ntchm, & imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, imp_physics_mg, & imp_physics_fer_hires, & - ltaerosol, cplflx, cplchm, lssav, flag_for_pbl_generic_tend, ldiag3d, qdiag3d, lsidea, hybedmf, do_shoc, satmedmf, & + ltaerosol, cplflx, cplchm, lssav, flag_for_pbl_generic_tend, ldiag3d, lsidea, hybedmf, do_shoc, satmedmf, & shinhong, do_ysu, dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, dudt, dvdt, dtdt, htrsw, htrlw, xmu, & - dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, & - dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, & - dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag, dt3dt, du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, dq3dt, & - dq3dt_ozone, rd, cp, fvirt, hvap, t1, q1, prsl, hflx, ushfsfci, oceanfrac, flag_cice, dusfc_cice, dvsfc_cice, & + dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dtend, dtidx, index_for_temperature, index_for_x_wind, index_for_y_wind, & + index_for_cause_pbl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, & + dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag, + rd, cp, fvirt, hvap, t1, q1, prsl, hflx, ushfsfci, oceanfrac, flag_cice, dusfc_cice, dvsfc_cice, & dtsfc_cice, dqsfc_cice, wet, dry, icy, wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1, dkt_cpl, dkt, hffac, hefac, & ugrs, vgrs, tgrs, qgrs, save_u, save_v, save_t, save_q, errmsg, errflg) @@ -331,7 +331,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, logical, intent(in) :: trans_aero integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires - logical, intent(in) :: ltaerosol, cplflx, cplchm, lssav, ldiag3d, qdiag3d, lsidea + logical, intent(in) :: ltaerosol, cplflx, cplchm, lssav, ldiag3d, lsidea logical, intent(in) :: hybedmf, do_shoc, satmedmf, shinhong, do_ysu logical, dimension(:), intent(in) :: flag_cice @@ -359,9 +359,11 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays ! as long as these do not get used when not allocated. - real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, dq3dt, dq3dt_ozone real(kind=kind_phys), dimension(:), intent(inout) :: dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, & dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: index_for_temperature, index_for_x_wind, index_for_y_wind, index_for_cause_pbl logical, dimension(:),intent(in) :: wet, dry, icy real(kind=kind_phys), dimension(:), intent(out) :: ushfsfci @@ -609,27 +611,31 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, if (ldiag3d .and. flag_for_pbl_generic_tend .and. lssav) then if (lsidea) then - dt3dt(1:im,:) = dt3dt(1:im,:) + dtdt(1:im,:)*dtf + idtend = dtidx(index_for_temperature, index_for_cause_pbl) + if(idtend>1) then + dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + dtdt(1:im,1:levs)*dtf + endif else - do k=1,levs - do i=1,im - dt3dt(i,k) = dt3dt(i,k) + (tgrs(i,k) - save_t(i,k)) - enddo - enddo + idtend = dtidx(index_for_temperature, index_for_cause_pbl) + if(idtend>1) then + dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (tgrs(1:im,1:levs) - save_t(1:im,1:levs)) + endif endif - do k=1,levs - do i=1,im - du3dt_PBL(i,k) = du3dt_PBL(i,k) + (ugrs(i,k) - save_u(i,k)) - dv3dt_PBL(i,k) = dv3dt_PBL(i,k) + (vgrs(i,k) - save_v(i,k)) - enddo - enddo - if(qdiag3d) then - do k=1,levs - do i=1,im - dq3dt (i,k) = dq3dt (i,k) + (qgrs(i,k,ntqv)-save_q(i,k,ntqv)) - dq3dt_ozone(i,k) = dq3dt_ozone(i,k) + (qgrs(i,k,ntoz)-save_q(i,k,ntoz)) - enddo - enddo + idtend = dtidx(index_for_x_wind, index_for_cause_pbl) + if(idtend>1) then + dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (ugrs(1:im,1:levs) - save_u(1:im,1:levs) + endif + idtend = dtidx(index_for_y_wind, index_for_cause_pbl) + if(idtend>1) then + dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (vgrs(1:im,1:levs) - save_v(1:im,1:levs) + endif + idtend = dtidx(100+ntqv, index_for_cause_pbl) + if(idtend>1) then + dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + qgrs(1:im,1:levs,ntqv) - save_q(1:im,1:levs,ntqv) + endif + idtend = dtidx(100+ntoz, index_for_cause_pbl) + if(idtend>1) then + dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + qgrs(1:im,1:levs,ntoz) - save_q(1:im,1:levs,ntoz) endif endif diff --git a/physics/GFS_PBL_generic.meta b/physics/GFS_PBL_generic.meta index 5e83b8ad4..e4bae0939 100644 --- a/physics/GFS_PBL_generic.meta +++ b/physics/GFS_PBL_generic.meta @@ -676,6 +676,56 @@ type = integer intent = in optional = F +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + type = real + kind = kind_phys + intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in + optional = F + [ltaerosol] standard_name = flag_for_aerosol_physics long_name = flag for aerosol physics @@ -816,6 +866,55 @@ kind = kind_phys intent = in optional = F +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + type = real + kind = kind_phys + intent = inout + optional = F +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in + optional = F [dqsfc1] standard_name = instantaneous_surface_upward_latent_heat_flux long_name = surface upward latent heat flux valid for current call diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index ae8fac5f9..8dd73a07a 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -71,25 +71,28 @@ end subroutine GFS_SCNV_generic_post_finalize !! \htmlinclude GFS_SCNV_generic_post_run.html !! subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cplchm, & - frain, gu0, gv0, gt0, gq0_water_vapor, save_u, save_v, save_t, save_qv, dqdti, du3dt, dv3dt, dt3dt, dq3dt, clw, & + frain, gu0, gv0, gt0, gq0_water_vapor, save_u, save_v, save_t, save_qv, dqdti, clw, & shcnvcw, rain1, npdf3d, num_p3d, ncnvcld3d, cnvc, cnvw, & rainc, cnvprcp, cnvprcpb, cnvw_phy_f3d, cnvc_phy_f3d, & - flag_for_scnv_generic_tend, & + dtend, dtidx, index_for_temperature, index_for_x_wind, index_for_y_wind, & + index_for_cause_scnv, ntqv, flag_for_scnv_generic_tend, & imfshalcnv, imfshalcnv_sas, imfshalcnv_samf, errmsg, errflg) use machine, only: kind_phys implicit none - integer, intent(in) :: im, levs, nn + integer, intent(in) :: im, levs, nn, ntqv logical, intent(in) :: lssav, ldiag3d, qdiag3d, cplchm, flag_for_scnv_generic_tend real(kind=kind_phys), intent(in) :: frain real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t, save_qv - ! dqdti, dt3dt, dq3dt, only allocated if ldiag3d == .true. + ! dtend only allocated if ldiag3d == .true. real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti - real(kind=kind_phys), dimension(:,:), intent(inout) :: du3dt, dv3dt, dt3dt, dq3dt + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: index_for_temperature, index_for_x_wind, index_for_y_wind, index_for_cause_scnv real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw ! Post code for SAS/SAMF @@ -108,7 +111,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k + integer :: i, k, idtend real(kind=kind_phys) :: tem ! Initialize CCPP error handling variables @@ -138,19 +141,24 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl if (lssav .and. flag_for_scnv_generic_tend) then if (ldiag3d) then - do k=1,levs - do i=1,im - du3dt(i,k) = du3dt(i,k) + (gu0(i,k) - save_u(i,k)) * frain - dv3dt(i,k) = dv3dt(i,k) + (gv0(i,k) - save_v(i,k)) * frain - dt3dt(i,k) = dt3dt(i,k) + (gt0(i,k) - save_t(i,k)) * frain - enddo - enddo - if (qdiag3d) then - do k=1,levs - do i=1,im - dq3dt(i,k) = dq3dt(i,k) + (gq0_water_vapor(i,k) - save_qv(i,k)) * frain - enddo - enddo + idtend = dtidx(index_for_temperature, index_for_cause_scnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gt0(i,k) - save_t(i,k)) * frain + endif + + idtend = dtidx(index_for_x_wind, index_for_cause_scnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gu0(i,k) - save_u(i,k)) * frain + endif + + idtend = dtidx(index_for_y_wind, index_for_cause_scnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0(i,k) - save_v(i,k)) * frain + endif + + idtend = dtidx(100+ntqv, index_for_cause_scnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0_water_vapor(i,k) - save_qv(i,k)) * frain endif endif endif diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta index a3122da71..94b006016 100644 --- a/physics/GFS_SCNV_generic.meta +++ b/physics/GFS_SCNV_generic.meta @@ -293,41 +293,62 @@ kind = kind_phys intent = inout optional = F -[du3dt] - standard_name = cumulative_change_in_x_wind_due_to_shallow_convection - long_name = cumulative change in x wind due to shallow convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dv3dt] - standard_name = cumulative_change_in_y_wind_due_to_shallow_convection - long_name = cumulative change in y wind due to shallow convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt] - standard_name = cumulative_change_in_temperature_due_to_shallow_convection - long_name = cumulative change in temperature due to shal conv. - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[dq3dt] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_shallow_convection - long_name = cumulative change in water vapor specific humidity due to shal conv. - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_scnv] + standard_name = index_for_cause_scnv + long_name = tracer changes caused by shallow convection scheme + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in optional = F [clw] standard_name = convective_transportable_tracers diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index 4680f8de7..14ee241dd 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -387,7 +387,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, integer, intent(out) :: errflg !--- local variables - integer :: impi, iomp, ierr, n + integer :: impi, iomp, ierr, n, idtend, icause, itracer integer :: mpirank, mpisize, mpicomm integer :: omprank, ompsize @@ -631,22 +631,16 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%shum_wts ', Diag%shum_wts) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%zmtnblck ', Diag%zmtnblck) if (Model%ldiag3d) then - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%du3dt ', Diag%du3dt) - do n=1,size(Diag%du3dt(1,1,:)) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%du3dt_n ', Diag%du3dt(:,:,n)) - end do - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dv3dt ', Diag%dv3dt) - do n=1,size(Diag%dv3dt(1,1,:)) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dv3dt_n ', Diag%dv3dt(:,:,n)) - end do - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dt3dt ', Diag%dt3dt) - do n=1,size(Diag%dt3dt(1,1,:)) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dt3dt_n ', Diag%dt3dt(:,:,n)) - end do - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dq3dt ', Diag%dq3dt) - do n=1,size(Diag%dq3dt(1,1,:)) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dq3dt_n ', Diag%dq3dt(:,:,n)) - end do + do itracer=2,Model%ntracp100 + do icause=1,Model%ncause + idtend = Model%dtidx(itracer,icause) + if(idtend>1) then + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, & + 'dtend_'//Model%dtend_tracer_labels(itracer)//'_' & + //Model%dtend_cause_labels(icause), Diag%dtend(1,1,idtend)) + endif + enddo + enddo call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%upd_mf ', Diag%upd_mf) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dwn_mf ', Diag%dwn_mf) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%det_mf ', Diag%det_mf) diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 551f0e600..d32106874 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -162,7 +162,8 @@ end subroutine GFS_suite_interstitial_2_finalize subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplflx, flag_cice, shal_cnv, old_monin, mstrat, & do_shoc, frac_grid, imfshalcnv, dtf, xcosz, adjsfcdsw, adjsfcdlw, cice, pgr, ulwsfc_cice, lwhd, htrsw, htrlw, xmu, ctei_rm, & work1, work2, prsi, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, cp, hvap, prslk, suntim, adjsfculw, adjsfculw_lnd, & - adjsfculw_ice, adjsfculw_wat, dlwsfc, ulwsfc, psmean, dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_dcnv, dt3dt_scnv, dt3dt_mp, & + adjsfculw_ice, adjsfculw_wat, dlwsfc, ulwsfc, psmean, dtend, dtidx, index_for_cause_longwave, index_for_cause_shortwave, & + index_for_cause_pbl, index_for_cause_dcnv, index_for_cause_scnv, index_for_cause_mp, index_for_temperature, & ctei_rml, ctei_r, kinver, dry, icy, wet, frland, huge, use_GP_jacobian, skt, sktp1r, fluxlwUP, fluxlwUP_jac, errmsg, errflg) implicit none @@ -196,8 +197,12 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl fluxlwUP, & ! Upwelling LW flux (W/m2) fluxlwUP_jac ! Jacobian of upwelling LW flux (W/m2/K) - ! These arrays are only allocated if ldiag3d is .true. - real(kind=kind_phys), intent(inout), dimension(:,:) :: dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_dcnv, dt3dt_scnv, dt3dt_mp + ! dtend is only allocated if ldiag3d is .true. + real(kind=kind_phys), optional, intent(inout), dimension(:,:,:) :: dtend + integer, intent(in), dimension(:,:) :: dtidx + integer, intent(in) :: index_for_cause_longwave, index_for_cause_shortwave, & + index_for_cause_pbl, index_for_cause_dcnv, index_for_cause_scnv, & + index_for_cause_mp, index_for_temperature logical, intent(in ), dimension(im) :: dry, icy, wet real(kind=kind_phys), intent(in ), dimension(im) :: frland @@ -208,7 +213,7 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl ! local variables real(kind=kind_phys), parameter :: czmin = 0.0001_kind_phys ! cos(89.994) - integer :: i, k + integer :: i, k, idtend real(kind=kind_phys) :: tem1, tem2, tem, hocp logical, dimension(im) :: invrsn real(kind=kind_phys), dimension(im) :: tx1, tx2, dT @@ -302,23 +307,47 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl if (ldiag3d) then if (lsidea) then - do k=1,levs - do i=1,im - dt3dt_lw(i,k) = dt3dt_lw(i,k) + lwhd(i,k,1)*dtf - dt3dt_sw(i,k) = dt3dt_sw(i,k) + lwhd(i,k,2)*dtf - dt3dt_pbl(i,k) = dt3dt_pbl(i,k) + lwhd(i,k,3)*dtf - dt3dt_dcnv(i,k) = dt3dt_dcnv(i,k) + lwhd(i,k,4)*dtf - dt3dt_scnv(i,k) = dt3dt_scnv(i,k) + lwhd(i,k,5)*dtf - dt3dt_mp(i,k) = dt3dt_mp(i,k) + lwhd(i,k,6)*dtf - enddo - enddo + idtend = dtidx(index_for_temperature,index_for_cause_lw) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,1)*dtf + endif + + idtend = dtidx(index_for_temperature,index_for_cause_sw) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,2)*dtf + endif + + idtend = dtidx(index_for_temperature,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,3)*dtf + endif + + idtend = dtidx(index_for_temperature,index_for_cause_dcnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,4)*dtf + endif + + idtend = dtidx(index_for_temperature,index_for_cause_scnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,5)*dtf + endif + + idtend = dtidx(index_for_temperature,index_for_cause_mp) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,6)*dtf + endif else - do k=1,levs - do i=1,im - dt3dt_lw(i,k) = dt3dt_lw(i,k) + htrlw(i,k)*dtf - dt3dt_sw(i,k) = dt3dt_sw(i,k) + htrsw(i,k)*dtf*xmu(i) - enddo - enddo + idtend = dtidx(index_for_temperature,index_for_cause_lw) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + htrlw(:,:)*dtf + endif + + idtend = dtidx(index_for_temperature,index_for_cause_sw) + if(idtend>1) then + do k=1,levs + dtend(:,k,idtend) = dtend(:,k,idtend) + htrlw(:,k)*dtf*xmu(:) + enddo + endif endif endif endif ! end if_lssav_block diff --git a/physics/GFS_suite_interstitial.meta b/physics/GFS_suite_interstitial.meta index b27884f9a..e21e83a26 100644 --- a/physics/GFS_suite_interstitial.meta +++ b/physics/GFS_suite_interstitial.meta @@ -664,59 +664,70 @@ kind = kind_phys intent = inout optional = F -[dt3dt_lw] - standard_name = cumulative_change_in_temperature_due_to_longwave_radiation - long_name = cumulative change in temperature due to longwave radiation - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dt3dt_sw] - standard_name = cumulative_change_in_temperature_due_to_shortwave_radiation - long_name = cumulative change in temperature due to shortwave radiation - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_longwave] + standard_name = index_for_cause_longwave + long_name = tracer changes caused by long wave radiation + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt_pbl] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_shortwave] + standard_name = index_for_cause_shortwave + long_name = tracer changes caused by short wave radiation + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt_dcnv] - standard_name = cumulative_change_in_temperature_due_to_deep_convection - long_name = cumulative change in temperature due to deep conv. - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt_scnv] - standard_name = cumulative_change_in_temperature_due_to_shallow_convection - long_name = cumulative change in temperature due to shal conv. - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_dcnv] + standard_name = index_for_cause_dcnv + long_name = tracer changes caused by deep convection scheme + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt_mp] - standard_name = cumulative_change_in_temperature_due_to_microphysics - long_name = cumulative change in temperature due to microphysics - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_scnv] + standard_name = index_for_cause_scnv + long_name = tracer changes caused by shallow convection scheme + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_mp] + standard_name = index_for_cause_mp + long_name = tracer changes caused by microphysics scheme + units = index + dimensions = () + type = integer + intent = in optional = F [ctei_rml] standard_name = grid_sensitive_critical_cloud_top_entrainment_instability_criteria diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 21b331041..d33466592 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -156,7 +156,9 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr dudt_mtb,dudt_ogw, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & dudt, dvdt, dtdt, rdxzb, con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt, & con_omega, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & - ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw, ldu3dt_cgw, ldv3dt_cgw, ldt3dt_cgw, & +! FIXME: delete ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw, ldu3dt_cgw, ldv3dt_cgw, ldt3dt_cgw, & + dtend, dtidx, index_for_x_wind, index_for_y_wind, index_for_temperature, & + index_for_cause_orographic_gwd, index_for_cause_convective_gwd, & ldiag3d, lssav, flag_for_gwd_generic_tend, errmsg, errflg) implicit none @@ -182,9 +184,12 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr real(kind=kind_phys), intent(out), dimension(im, levs):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis real(kind=kind_phys), intent(out), dimension(im, levs):: dudt_mtb, dudt_ogw, dudt_tms - ! These arrays are only allocated if ldiag=.true. - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_cgw, ldv3dt_cgw, ldt3dt_cgw + ! dtend is only allocated if ldiag=.true. + real(kind=kind_phys), optional, intent(in) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), & + index_for_x_wind, index_for_y_wind, index_for_temperature, & + index_for_cause_orographic_gwd, index_for_cause_convective_gwd + logical, intent(in) :: ldiag3d, lssav ! These arrays only allocated if ldiag_ugwp = .true. @@ -206,7 +211,7 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr integer, intent(out) :: errflg ! local variables - integer :: i, k + integer :: i, k, idtend real(kind=kind_phys), dimension(im) :: sgh30 real(kind=kind_phys), dimension(im, levs) :: Pdvdt, Pdudt real(kind=kind_phys), dimension(im, levs) :: Pdtdt, Pkdis @@ -280,13 +285,18 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - do k=1,levs - do i=1,im - ldu3dt_ogw(i,k) = ldu3dt_ogw(i,k) + Pdudt(i,k)*dtp - ldv3dt_ogw(i,k) = ldv3dt_ogw(i,k) + Pdvdt(i,k)*dtp - ldt3dt_ogw(i,k) = ldt3dt_ogw(i,k) + Pdtdt(i,k)*dtp - enddo - enddo + idtend = dtidx(index_for_x_wind,index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt(i,k)*dtp + endif + idtend = dtidx(index_for_y_wind,index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt(i,k)*dtp + endif + idtend = dtidx(index_for_temperature,index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt(i,k)*dtp + endif endif @@ -387,13 +397,18 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr #endif if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - do k=1,levs - do i=1,im - ldu3dt_cgw(i,k) = ldu3dt_cgw(i,k) + (gw_dudt(i,k) - Pdudt(i,k))*dtp - ldv3dt_cgw(i,k) = ldv3dt_cgw(i,k) + (gw_dvdt(i,k) - Pdvdt(i,k))*dtp - ldt3dt_cgw(i,k) = ldt3dt_cgw(i,k) + (gw_dtdt(i,k) - Pdtdt(i,k))*dtp - enddo - enddo + idtend = dtidx(index_for_x_wind,index_for_cause_convective_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dudt(i,k) - Pdudt(i,k))*dtp + endif + idtend = dtidx(index_for_y_wind,index_for_cause_convective_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dvdt(i,k) - Pdvdt(i,k))*dtp + endif + idtend = dtidx(index_for_temperature,index_for_cause_convective_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dtdt(i,k) - Pdtdt(i,k))*dtp + endif endif end subroutine cires_ugwp_run diff --git a/physics/cires_ugwp.meta b/physics/cires_ugwp.meta index d7d7da286..14bfa9a0b 100644 --- a/physics/cires_ugwp.meta +++ b/physics/cires_ugwp.meta @@ -866,59 +866,63 @@ type = integer intent = in optional = F -[ldu3dt_ogw] - standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in x wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys + active = (flag_diagnostics_3D) intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[ldv3dt_ogw] - standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in y wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[ldt3dt_ogw] - standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag - long_name = cumulative change in temperature due to orographic gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[ldu3dt_cgw] - standard_name = cumulative_change_in_x_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in x wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F -[ldv3dt_cgw] - standard_name = cumulative_change_in_y_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in y wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_orographic_gwd] + standard_name = index_for_cause_orographic_gwd + long_name = tracer changes caused by orographic gravity wave drag + units = index + dimensions = () + type = integer + intent = in optional = F -[ldt3dt_cgw] - standard_name = cumulative_change_in_temperature_due_to_convective_gravity_wave_drag - long_name = cumulative change in temperature due to convective gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_convective_gwd] + standard_name = index_for_cause_convective_gwd + long_name = tracer changes caused by convective gravity wave drag + units = index + dimensions = () + type = integer + intent = in optional = F [ldiag3d] standard_name = flag_diagnostics_3D diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index dcf0d183b..3f9cb131a 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -69,9 +69,11 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & hbot,htop,kcnv,xland,hfx2,qfx2,cliw,clcw, & pbl,ud_mf,dd_mf,dt_mf,cnvw_moist,cnvc,imfshalcnv, & flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend, & - du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & - du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV, & - ldiag3d,qdiag3d,qci_conv,errmsg,errflg) +! fixme: delete ! du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & + ! du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV, & + dtend,dtidx,ntqv,index_for_temperature,index_for_x_wind, & + index_for_y_wind,index_for_cause_scnv,index_for_cause_dcnv, & + ldiag3d,qci_conv,errmsg,errflg) !------------------------------------------------------------- implicit none integer, parameter :: maxiens=1 @@ -94,8 +96,14 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & integer :: its,ite, jts,jte, kts,kte integer, intent(in ) :: im,km,ntracer logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend - logical, intent(in ) :: ldiag3d,qdiag3d - + logical, intent(in ) :: ldiag3d + + ! dtend is only allocated if ldiag=.true. + real(kind=kind_phys), optional, intent(in) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), & + index_for_x_wind, index_for_y_wind, index_for_temperature, & + index_for_cause_scnv, index_for_cause_dcnv, ntqv + real(kind=kind_phys), dimension( im , km ), intent(in ) :: forcet,forceqv_spechum,w,phil real(kind=kind_phys), dimension( im , km ), intent(inout ) :: t,us,vs real(kind=kind_phys), dimension( im , km ), intent(inout ) :: qci_conv @@ -168,7 +176,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & real(kind=kind_phys), dimension (im) :: umean,vmean,pmean real(kind=kind_phys), dimension (im) :: xmbs,xmbs2,xmb,xmbm,xmb_dumm,mconv - integer :: i,j,k,icldck,ipr,jpr,jpr_deep,ipr_deep + integer :: i,j,k,icldck,ipr,jpr,jpr_deep,ipr_deep,uidx,vidx,tidx,qidx integer :: itf,jtf,ktf,iss,jss,nbegin,nend integer :: high_resolution real(kind=kind_phys) :: clwtot,clwtot1,excess,tcrit,tscl_kf,dp,dq,sub_spread,subcenter @@ -861,32 +869,64 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & ! if(ldiag3d) then if(ishallow_g3.eq.1 .and. .not.flag_for_scnv_generic_tend) then - do k=kts,ktf - do i=its,itf - du3dt_SCNV(i,k) = du3dt_SCNV(i,k) + cutens(i)*outus(i,k) * dt - dv3dt_SCNV(i,k) = dv3dt_SCNV(i,k) + cutens(i)*outvs(i,k) * dt - dt3dt_SCNV(i,k) = dt3dt_SCNV(i,k) + cutens(i)*outts(i,k) * dt - if(qdiag3d) then + uidx=dtidx(index_for_x_wind,index_for_cause_scnv) + vidx=dtidx(index_for_v_wind,index_for_cause_scnv) + tidx=dtidx(index_for_temperature,index_for_cause_scnv) + qidx=dtidx(100+ntqv,index_for_cause_scnv) + if(uidx>1) then + do k=kts,ktf + dtend(:,k,uidx) = dtend(:,k,uidx) + cutens(:)*outus(:,k) * dt + enddo + endif + if(vidx>1) then + do k=kts,ktf + dtend(:,k,vidx) = dtend(:,k,vidx) + cutens(:)*outvs(:,k) * dt + enddo + endif + if(tidx>1) then + do k=kts,ktf + dtend(:,k,tidx) = dtend(:,k,tidx) + cutens(i)*outts(i,k) * dt + enddo + endif + if(qidx>1) then + do k=kts,ktf + do i=its,itf tem = cutens(i)*outqs(i,k)* dt tem = tem/(1.0_kind_phys+tem) - dq3dt_SCNV(i,k) = dq3dt_SCNV(i,k) + tem - endif + dtend(i,k,qidx) = dtend(i,k,qidx) + tem + enddo enddo - enddo + endif endif if((ideep.eq.1. .or. imid_gf.eq.1) .and. .not.flag_for_dcnv_generic_tend) then - do k=kts,ktf - do i=its,itf - du3dt_DCNV(i,k) = du3dt_DCNV(i,k) + (cuten(i)*outu(i,k)+cutenm(i)*outum(i,k)) * dt - dv3dt_DCNV(i,k) = dv3dt_DCNV(i,k) + (cuten(i)*outv(i,k)+cutenm(i)*outvm(i,k)) * dt - dt3dt_DCNV(i,k) = dt3dt_DCNV(i,k) + (cuten(i)*outt(i,k)+cutenm(i)*outtm(i,k)) * dt - if(qdiag3d) then + uidx=dtidx(index_for_x_wind,index_for_cause_dcnv) + vidx=dtidx(index_for_v_wind,index_for_cause_dcnv) + tidx=dtidx(index_for_temperature,index_for_cause_dcnv) + qidx=dtidx(100+ntqv,index_for_cause_dcnv) + if(uidx>1) then + do k=kts,ktf + dtend(:,k,uidx) = dtend(:,k,uidx) + (cuten(i)*outu(i,k)+cutenm(i)*outum(i,k)) * dt + enddo + endif + if(vidx>1) then + do k=kts,ktf + dtend(:,k,vidx) = dtend(:,k,vidx) + (cuten(i)*outv(i,k)+cutenm(i)*outvm(i,k)) * dt + enddo + endif + if(tidx>1) then + do k=kts,ktf + dtend(:,k,tidx) = dtend(:,k,tidx) + (cuten(i)*outt(i,k)+cutenm(i)*outtm(i,k)) * dt + enddo + endif + if(qidx>1) then + do k=kts,ktf + do i=its,itf tem = (cuten(i)*outq(i,k) + cutenm(i)*outqm(i,k))* dt tem = tem/(1.0_kind_phys+tem) - dq3dt_DCNV(i,k) = dq3dt_DCNV(i,k) + tem - endif + dtend(i,k,qidx) = dtend(i,k,qidx) + tem + enddo enddo - enddo + endif endif endif end subroutine cu_gf_driver_run diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta index f27b2cc91..32ae324a8 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/cu_gf_driver.meta @@ -367,77 +367,70 @@ type = logical intent = in optional = F -[du3dt_SCNV] - standard_name = cumulative_change_in_x_wind_due_to_shallow_convection - long_name = cumulative change in x wind due to shallow convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[dv3dt_SCNV] - standard_name = cumulative_change_in_y_wind_due_to_shallow_convection - long_name = cumulative change in y wind due to shallow convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dt3dt_SCNV] - standard_name = cumulative_change_in_temperature_due_to_shallow_convection - long_name = cumulative change in temperature due to shallow convection - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in optional = F -[dq3dt_SCNV] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_shallow_convection - long_name = cumulative change in water vapor specific humidity due to shallow convection - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F -[du3dt_DCNV] - standard_name = cumulative_change_in_x_wind_due_to_deep_convection - long_name = cumulative change in x wind due to deep convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[dv3dt_DCNV] - standard_name = cumulative_change_in_y_wind_due_to_deep_convection - long_name = cumulative change in y wind due to deep convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt_DCNV] - standard_name = cumulative_change_in_temperature_due_to_deep_convection - long_name = cumulative change in temperature due to deep convection - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_scnv] + standard_name = index_for_cause_scnv + long_name = tracer changes caused by shallow convection scheme + units = index + dimensions = () + type = integer + intent = in optional = F -[dq3dt_DCNV] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_deep_convection - long_name = cumulative change in water vapor specific humidity due to deep convection - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_dcnv] + standard_name = index_for_cause_dcnv + long_name = tracer changes caused by deep convection scheme + units = index + dimensions = () + type = integer + intent = in optional = F [ldiag3d] standard_name = flag_diagnostics_3D @@ -447,14 +440,6 @@ type = logical intent = in optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = in - optional = F [qci_conv] standard_name = convective_cloud_condesate_after_rainout long_name = convective cloud condesate after rainout diff --git a/physics/gwdc.f b/physics/gwdc.f index fc81373ce..608f6d39e 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -1460,7 +1460,8 @@ end subroutine gwdc_post_init subroutine gwdc_post_run( & & im, levs, lssav, ldiag3d, dtf, dtp, con_cp, & & tauctx, taucty, gwdcu, gwdcv, & - & dugwd, dvgwd, du3dt, dv3dt, gu0, gv0, gt0, & + & dugwd, dvgwd, dtend, dtidx, index_for_x_wind, index_for_y_wind, & + & index_for_cause_convective_gwd, gu0, gv0, gt0, & & errmsg, errflg) use machine, only : kind_phys @@ -1472,14 +1473,16 @@ subroutine gwdc_post_run( & real(kind=kind_phys), intent(in) :: & & tauctx(:), taucty(:), gwdcu(:,:), gwdcv(:,:) - real(kind=kind_phys), intent(inout) :: & - & dugwd(:), dvgwd(:), du3dt(:,:), dv3dt(:,:), & + real(kind=kind_phys), intent(inout) :: dugwd(:,:), dvgwd(:,:), & & gu0(:,:), gv0(:,:), gt0(:,:) + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), index_for_cause_convective_gwd + integer, intent(in) :: index_for_x_wind, index_for_y_wind character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k + integer :: i, k, idtend real(kind=kind_phys) :: eng0, eng1 ! Initialize CCPP error handling variables @@ -1494,8 +1497,14 @@ subroutine gwdc_post_run( & endif ! end if_lssav if (ldiag3d) then - du3dt(:,:) = du3dt(:,:) + gwdcu(:,:) * dtf - dv3dt(:,:) = dv3dt(:,:) + gwdcv(:,:) * dtf + idtend = dtidx(index_for_x_wind,index_for_cause_convective_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + gwdcu(:,:) * dtf + endif + idtend = dtidx(index_for_y_wind,index_for_cause_convective_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + gwdcv(:,:) * dtf + endif endif ! --- ... update the wind components with gwdc tendencies diff --git a/physics/gwdc.meta b/physics/gwdc.meta index 2fde9c2aa..217bb09aa 100644 --- a/physics/gwdc.meta +++ b/physics/gwdc.meta @@ -590,23 +590,47 @@ kind = kind_phys intent = inout optional = F -[du3dt] - standard_name = cumulative_change_in_x_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in zonal wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys + active = (flag_diagnostics_3D) intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dv3dt] - standard_name = cumulative_change_in_y_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in meridional wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_convective_gwd] + standard_name = index_for_cause_convective_gwd + long_name = tracer changes caused by convective gravity wave drag + units = index + dimensions = () + type = integer + intent = in optional = F [gu0] standard_name = x_wind_updated_by_physics diff --git a/physics/h2ophys.f b/physics/h2ophys.f index 8222638ae..d2d84738b 100644 --- a/physics/h2ophys.f +++ b/physics/h2ophys.f @@ -23,7 +23,7 @@ end subroutine h2ophys_init !! \section genal_h2ophys GFS H2O Physics Scheme General Algorithm !> @{ subroutine h2ophys_run(im, levs, kh2o, dt, h2o, ph2o, prsl, & - & h2opltc, h2o_coeff, ldiag3d, me, & + & h2opltc, h2o_coeff, me, & & errmsg, errflg) ! ! May 2015 - Shrinivas Moorthi - Adaptation of NRL H2O physics for @@ -41,7 +41,6 @@ subroutine h2ophys_run(im, levs, kh2o, dt, h2o, ph2o, prsl, & real(kind=kind_phys), intent(in) :: ph2o(kh2o) real(kind=kind_phys), intent(in) :: prsl(im,levs) real(kind=kind_phys), intent(in) :: h2opltc(im,kh2o,h2o_coeff) - logical , intent(in) :: ldiag3d !real(kind=kind_phys), intent(inout) :: h2op(im,levs,h2o_coeff) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/h2ophys.meta b/physics/h2ophys.meta index 62db330f4..3275b89d2 100644 --- a/physics/h2ophys.meta +++ b/physics/h2ophys.meta @@ -84,14 +84,6 @@ type = integer intent = in optional = F -[ldiag3d] - standard_name = flag_diagnostics_3D - long_name = flag for calculating 3-D diagnostic fields - units = flag - dimensions = () - type = logical - intent = in - optional = F [me] standard_name = mpi_rank long_name = rank of the current MPI task diff --git a/physics/module_MYJPBL_wrapper.F90 b/physics/module_MYJPBL_wrapper.F90 index 5924de96f..e7230e90e 100644 --- a/physics/module_MYJPBL_wrapper.F90 +++ b/physics/module_MYJPBL_wrapper.F90 @@ -40,9 +40,10 @@ SUBROUTINE myjpbl_wrapper_run( & & dusfc,dvsfc,dtsfc,dqsfc, & & dkt,xkzm_m, xkzm_h,xkzm_s, gamt,gamq, & & con_cp,con_g,con_rd, & - & me, lprnt, dt3dt_PBL, du3dt_PBL, dv3dt_PBL, & - & dq3dt_PBL, gen_tend, ldiag3d, qdiag3d, & - & errmsg, errflg ) + & me, lprnt, gen_tend, ldiag3d, dtend, dtidx, & + & index_for_temperature, index_for_x_wind, & + & index_for_y_wind, index_for_cause_pbl, & + & ntqv, errmsg, errflg ) ! @@ -77,6 +78,11 @@ SUBROUTINE myjpbl_wrapper_run( & character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: index_for_temperature, index_for_x_wind, & + & index_for_y_wind, index_for_cause_pbl, ntqv + !MYJ-1D integer,intent(in) :: im, levs integer,intent(in) :: kdt, me @@ -113,8 +119,6 @@ SUBROUTINE myjpbl_wrapper_run( & dudt, dvdt, dtdt real(kind=kind_phys),dimension(im,levs-1),intent(out) :: & dkt - real(kind=kind_phys),dimension(:,:),intent(inout) :: & - du3dt_PBL, dv3dt_PBL, dt3dt_PBL, dq3dt_PBL !MYJ-4D real(kind=kind_phys),dimension(im,levs,ntrac),intent(inout) :: & @@ -158,6 +162,7 @@ SUBROUTINE myjpbl_wrapper_run( & ! real(kind=kind_phys), dimension(im,levs,ntrac) :: & ! & qgrs_myj real(kind=kind_phys),dimension(im,levs) :: dkt2 + integer :: uidx, vidx, tidx, qidx ! Initialize CCPP error handling variables errmsg = '' @@ -581,21 +586,18 @@ SUBROUTINE myjpbl_wrapper_run( & end do end do if (ldiag3d .and. .not. gen_tend) then + uidx = dtidx(index_for_x_wind,index_for_cause_pbl) + vidx = dtidx(index_for_y_wind,index_for_cause_pbl) + tidx = dtidx(index_for_temperature,index_for_cause_pbl) + qidx = dtidx(ntqv+100,index_for_cause_pbl) + ! NOTE: The code that was here before was wrong. It replaced the + ! cumulative value with the instantaneous value. do k=1,levs k1=levs+1-k - do i=1,im - du3dt_PBL(i,k) = rublten(i,k1)*dt_phs - dv3dt_PBL(i,k) = rvblten(i,k1)*dt_phs - dt3dt_PBL(i,k) = rthblten(i,k1)*exner(i,k1)*dt_phs - end do - end do - if (qdiag3d) then - do k=1,levs - k1=levs+1-k - do i=1,im - dq3dt_PBL(i,k) = rqvblten(i,k1)*dt_phs - end do - end do + if(uidx>1) dtend(:,k,uidx)=dtend(:,k,uidx)+rublten(:,k1)*dt_phs + if(vidx>1) dtend(:,k,vidx)=dtend(:,k,vidx)+rvblten(:,k1)*dt_phs + if(tidx>1) dtend(:,k,tidx)=dtend(:,k,tidx)+rthblten(:,k1)*exner(:,k1)*dt_phs + if(qidx>1) dtend(:,k,qidx)=dtend(:,k,qidx)+rqvblten(:,k1)*dt_phs end if end if diff --git a/physics/module_MYJPBL_wrapper.meta b/physics/module_MYJPBL_wrapper.meta index 758dfb77b..e25d17893 100644 --- a/physics/module_MYJPBL_wrapper.meta +++ b/physics/module_MYJPBL_wrapper.meta @@ -630,38 +630,63 @@ type = logical intent = in optional = F -[dt3dt_PBL] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[du3dt_PBL] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[dv3dt_PBL] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[dq3dt_PBL] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in + optional = F [gen_tend] standard_name = flag_for_generic_planetary_boundary_layer_tendency long_name = true if GFS_PBL_generic should calculate tendencies diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 6011c203e..268c7e787 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -83,9 +83,9 @@ SUBROUTINE mynnedmf_wrapper_run( & & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & & dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc, & & flag_for_pbl_generic_tend, & - & du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, & - & do3dt_PBL, dq3dt_PBL, dt3dt_PBL, & - & htrsw, htrlw, xmu, & + & ntqv, dtend, dtidx, index_for_temperature, & + & index_for_x_wind, index_for_y_wind, & + & index_for_cause_pbl, htrsw, htrlw, xmu, & & grav_settling, bl_mynn_tkebudget, bl_mynn_tkeadvect, & & bl_mynn_cloudpdf, bl_mynn_mixlength, & & bl_mynn_edmf, bl_mynn_edmf_mom, bl_mynn_edmf_tke, & @@ -209,6 +209,12 @@ SUBROUTINE mynnedmf_wrapper_run( & & imp_physics, imp_physics_wsm6, & & imp_physics_thompson, imp_physics_gfdl +!TENDENCY DIAGNOSTICS + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: index_for_temperature, index_for_x_wind, ntqv, & + index_for_y_wind, index_for_cause_pbl + !MISC CONFIGURATION OPTIONS INTEGER, PARAMETER :: & & spp_pbl=0, & @@ -263,9 +269,6 @@ SUBROUTINE mynnedmf_wrapper_run( & & qgrs_ice_aer_num_conc real(kind=kind_phys), dimension(im,levs), intent(out) :: & & Tsq, Qsq, Cov, exch_h, exch_m - real(kind=kind_phys), dimension(:,:), intent(inout) :: & - & du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, & - & do3dt_PBL, dq3dt_PBL, dt3dt_PBL real(kind=kind_phys), dimension(im), intent(in) :: xmu real(kind=kind_phys), dimension(im, levs), intent(in) :: htrsw, htrlw !LOCAL @@ -317,7 +320,7 @@ SUBROUTINE mynnedmf_wrapper_run( & real, dimension(im) :: & & WSTAR,DELTA,qcg,hfx,qfx,rmol,xland, & & uoce,voce,vdfg,znt,ts - + integer :: idtend real, dimension(im) :: dusfci1,dvsfci1,dtsfci1,dqsfci1 ! Initialize CCPP error handling variables @@ -703,20 +706,16 @@ SUBROUTINE mynnedmf_wrapper_run( & enddo accum_duvt3dt: if(lssav) then if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then - do k = 1, levs - do i = 1, im - du3dt_PBL(i,k) = du3dt_PBL(i,k) + RUBLTEN(i,k)*dtf - dv3dt_PBL(i,k) = dv3dt_PBL(i,k) + RVBLTEN(i,k)*dtf - enddo - enddo + idtend=dtidx(index_for_x_wind,index_for_cause_pbl) + if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RUBLTEN(i,k)*dtf + + idtend=dtidx(index_for_y_wind,index_for_cause_pbl) + if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RVBLTEN(i,k)*dtf endif if (lsidea .or. (ldiag3d .and. .not. flag_for_pbl_generic_tend)) then - do k = 1, levs - do i = 1, im - dt3dt_PBL(i,k) = dt3dt_PBL(i,k) + RTHBLTEN(i,k)*exner(i,k)*dtf - enddo - enddo + idtend=dtidx(index_for_temperature,index_for_cause_pbl) + if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RTHBLTEN(i,k)*exner(i,k)*dtf endif endif accum_duvt3dt !Update T, U and V: @@ -833,11 +832,8 @@ SUBROUTINE mynnedmf_wrapper_run( & endif if(lssav .and. (ldiag3d .and. qdiag3d .and. .not. flag_for_pbl_generic_tend)) then - do k=1,levs - do i=1,im - dq3dt_PBL(i,k) = dq3dt_PBL(i,k) + dqdt_water_vapor(i,k)*dtf - enddo - enddo + idtend=dtidx(100+ntqv,index_for_cause_pbl) + if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + dqdt_water_vapor*dtf endif if (lprnt) then diff --git a/physics/module_MYNNPBL_wrapper.meta b/physics/module_MYNNPBL_wrapper.meta index 9b9d4cb52..5b21ae8c1 100644 --- a/physics/module_MYNNPBL_wrapper.meta +++ b/physics/module_MYNNPBL_wrapper.meta @@ -1011,68 +1011,62 @@ type = logical intent = in optional = F -[du3dt_PBL] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[du3dt_OGWD] - standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in x wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in optional = F -[dv3dt_PBL] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dv3dt_OGWD] - standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in y wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F -[do3dt_PBL] - standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL - long_name = cumulative change in ozone mixing ratio due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[dq3dt_PBL] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt_PBL] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in optional = F [htrsw] standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step diff --git a/physics/moninedmf.f b/physics/moninedmf.f index d5cb2ded3..0ab7b5e37 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -65,8 +65,9 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & & dusfc,dvsfc,dtsfc,dqsfc,hpbl,hgamt,hgamq,dkt, & & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr, & & xkzminv,moninq_fac,hurr_pbl,islimsk,var_ric, & - & coef_ric_l,coef_ric_s,lssav,ldiag3d,qdiag3d,ntoz, & - & du3dt_PBL,dv3dt_PBL,dt3dt_PBL,dq3dt_PBL,do3dt_PBL, & + & coef_ric_l,coef_ric_s,ldiag3d,ntqv,ntoz, & + & dtend,dtidx,index_for_cause_pbl,index_for_x_wind, & + & index_for_y_wind,index_for_temperature, & & flag_for_pbl_generic_tend,errmsg,errflg) ! use machine , only : kind_phys @@ -81,10 +82,10 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! ! arguments ! - logical, intent(in) :: lprnt, hurr_pbl, lssav, ldiag3d, qdiag3d + logical, intent(in) :: lprnt, hurr_pbl, ldiag3d logical, intent(in) :: flag_for_pbl_generic_tend integer, intent(in) :: ipr, islimsk(im) - integer, intent(in) :: im, km, ntrac, ntcw, kinver(im), ntoz + integer, intent(in) :: im, km, ntrac, ntcw, kinver(im) integer, intent(out) :: kpbl(im) ! @@ -93,9 +94,11 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & & coef_ric_l, coef_ric_s real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & & tau(im,km), rtg(im,km,ntrac) - ! Only allocated if ldiag3d or qdiag3d are true - real(kind=kind_phys), intent(inout), dimension(:,:) :: & - & du3dt_PBL,dv3dt_PBL,dt3dt_PBL,dq3dt_PBL,do3dt_PBL + ! dtend is only allocated if ldiag3d or qdiag3d are true + real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: index_for_x_wind, index_for_y_wind, & + index_for_cause_pbl, index_for_temperature, ntqv, ntoz real(kind=kind_phys), intent(in) :: & & u1(im,km), v1(im,km), & & t1(im,km), q1(im,km,ntrac), & @@ -194,6 +197,8 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & real(kind=kind_phys) zstblmax,h1, h2, qlcr, actei, & cldtime real :: ttend_fac + + integer :: idtend1, idtend2 !! for hurricane application real(kind=kind_phys) wspm(im,km-1) @@ -269,6 +274,10 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & rdt = 1. / dt2 km1 = km - 1 kmpbl = km / 2 + + idtend1 = 1 + idtend2 = 1 + !> - Compute physical height of the layer centers and interfaces from the geopotential height (zi and zl) do k=1,km do i=1,im @@ -1273,6 +1282,10 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! recover tendencies of heat and moisture ! !> After returning with the solution, the tendencies for temperature and moisture are recovered. + if(flag_for_pbl_generic_tend) then + idtend1=dtidx(index_for_temperature,index_for_cause_pbl) + idtend2=dtidx(ntqv+100,index_for_cause_pbl) + endif do k = 1,km do i = 1,im ttend = (a1(i,k)-t1(i,k)) * rdt @@ -1281,12 +1294,11 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & rtg(i,k,1) = rtg(i,k,1)+qtend dtsfc(i) = dtsfc(i)+cont*del(i,k)*ttend dqsfc(i) = dqsfc(i)+conq*del(i,k)*qtend - if(lssav .and. ldiag3d .and. .not. & - & flag_for_pbl_generic_tend) then - dt3dt_PBL(i,k) = dt3dt_PBL(i,k) + ttend*delt - if(qdiag3d) then - dq3dt_PBL(i,k) = dq3dt_PBL(i,k) + qtend*delt - endif + if(idtend1>1) then + dtend(i,k,idtend1) = dtend(i,k,idtend1) + ttend*delt + endif + if(idtend2>1) then + dtend(i,k,idtend2) = dtend(i,k,idtend2) + qtend*delt endif enddo enddo @@ -1300,16 +1312,18 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo enddo enddo - if(lssav .and. ldiag3d .and. ntoz>0 .and. qdiag3d .and. & - & .not. flag_for_pbl_generic_tend) then - kk = ntoz - is = (kk-1) * km - do k = 1, km - do i = 1, im - qtend = (a2(i,k+is)-q1(i,k,kk)) - do3dt_PBL(i,k) = do3dt_PBL(i,k)+qtend + if(flag_for_pbl_generic_tend) then + idtend1 = dtidx(100+ntoz,index_for_cause_pbl) + if(idtend1>1) then + kk = ntoz + is = (kk-1) * km + do k = 1, km + do i = 1, im + qtend = (a2(i,k+is)-q1(i,k,kk)) + dtend(i,k,idtend1) = dtend(i,k,idtend1)+qtend + enddo enddo - enddo + endif endif endif ! @@ -1410,6 +1424,10 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! recover tendencies of momentum ! !> Finally, the tendencies are recovered from the tridiagonal solutions. + if(flag_for_pbl_generic_tend) then + idtend1 = dtidx(index_for_x_wind,index_for_cause_pbl) + idtend2 = dtidx(index_for_y_wind,index_for_cause_pbl) + endif do k = 1,km do i = 1,im utend = (a1(i,k)-u1(i,k))*rdt @@ -1418,10 +1436,11 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & dv(i,k) = dv(i,k) + vtend dusfc(i) = dusfc(i) + conw*del(i,k)*utend dvsfc(i) = dvsfc(i) + conw*del(i,k)*vtend - if(lssav .and. ldiag3d .and. .not. & - & flag_for_pbl_generic_tend) then - du3dt_PBL(i,k) = du3dt_PBL(i,k) + utend*delt - dv3dt_PBL(i,k) = dv3dt_PBL(i,k) + vtend*delt + if(idtend1>1) then + dtend(i,k,idtend1) = dtend(i,k,idtend1) + utend*delt + endif + if(idtend2>1) then + dtend(i,k,idtend2) = dtend(i,k,idtend2) + vtend*delt endif ! ! for dissipative heating for ecmwf model diff --git a/physics/moninedmf.meta b/physics/moninedmf.meta index b14dbd2fc..f72e8f2e4 100644 --- a/physics/moninedmf.meta +++ b/physics/moninedmf.meta @@ -538,14 +538,6 @@ dimensions = () type = real kind = kind_phys -[lssav] - standard_name = flag_diagnostics - long_name = logical flag for storing diagnostics - units = flag - dimensions = () - type = logical - intent = in - optional = F [ldiag3d] standard_name = flag_diagnostics_3D long_name = flag for 3d diagnostic fields @@ -554,12 +546,12 @@ type = logical intent = in optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index dimensions = () - type = logical + type = integer intent = in optional = F [ntoz] @@ -570,51 +562,57 @@ type = integer intent = in optional = F -[du3dt_PBL] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys + active = (flag_diagnostics_3D) intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dv3dt_PBL] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt_PBL] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[dq3dt_PBL] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[do3dt_PBL] - standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL - long_name = cumulative change in ozone mixing ratio due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F + [flag_for_pbl_generic_tend] standard_name = flag_for_generic_planetary_boundary_layer_tendency long_name = true if GFS_PBL_generic should calculate tendencies diff --git a/physics/ozphys.f b/physics/ozphys.f index 3d3c1d004..113f6bc42 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -46,8 +46,10 @@ end subroutine ozphys_finalize !> @{ subroutine ozphys_run ( & & im, levs, ko3, dt, oz, tin, po3, & - & prsl, prdout, oz_coeff, delp, ldiag3d, qdiag3d, & - & ozp1, ozp2, ozp3, ozp4, con_g, me, errmsg, errflg) + & prsl, prdout, oz_coeff, delp, ldiag3d, & + & ntoz, index_for_cause_prod_loss, & + & index_for_cause_ozmix, index_for_cause_temp, & + & index_for_cause_overhead_ozone, con_g, me, errmsg, errflg) ! ! this code assumes that both prsl and po3 are from bottom to top ! as are all other variables @@ -59,21 +61,23 @@ subroutine ozphys_run ( & integer, intent(in) :: im, levs, ko3, oz_coeff, me real(kind=kind_phys), intent(inout) :: & & oz(im,levs) - ! These arrays may not be allocated and need assumed array sizes - real(kind=kind_phys), intent(inout) :: & - & ozp1(:,:), ozp2(:,:), ozp3(:,:), ozp4(:,:) + ! The dtend array may not be allocated and needs an assumed array size + real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), ntoz, & + & index_for_cause_prod_loss, index_for_cause_ozmix, & + & index_for_cause_temp, index_for_cause_overhead_ozone real(kind=kind_phys), intent(in) :: & & dt, po3(ko3), prdout(im,ko3,oz_coeff), & & prsl(im,levs), tin(im,levs), delp(im,levs), & & con_g real :: gravi - logical, intent(in) :: ldiag3d, qdiag3d + logical, intent(in) :: ldiag3d character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! ! Local variables - integer k,kmax,kmin,l,i,j + integer k,kmax,kmin,l,i,j, idtend(4) logical flg(im) real(kind=kind_phys) pmax, pmin, tem, temp real(kind=kind_phys) wk1(im), wk2(im), wk3(im), prod(im,oz_coeff), @@ -86,6 +90,17 @@ subroutine ozphys_run ( & ! save input oz in ozi ozi = oz gravi=1.0/con_g + + + if(ldiag3d) then + idtend(1) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp1 + idtend(2) = dtidx(100+ntoz,index_for_cause_ozmix) ! was ozp2 + idtend(3) = dtidx(100+ntoz,index_for_cause_temp) ! was ozp3 + idtend(4) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp4 + else + idtend=1 + endif + ! !> - Calculate vertical integrated column ozone values. if (oz_coeff > 2) then @@ -152,11 +167,13 @@ subroutine ozphys_run ( & oz(i,l) = (ozib(i) + prod(i,1)*dt) / (1.0 + prod(i,2)*dt) enddo ! - if (ldiag3d .and. qdiag3d) then ! ozone change diagnostics - do i=1,im - ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt - ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) - enddo + if(idtend(1)>1) then + dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 + & prod(:,1)*dt + endif + if(idtend(2)>1) then + dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 + & (oz(:,l) - ozib(:)) endif endif !> - Calculate the 4 terms of prognostic ozone change during time \a dt: @@ -173,16 +190,23 @@ subroutine ozphys_run ( & ! &,' ozib=',ozib(i),' l=',l,' tin=',tin(i,l),'colo3=',colo3(i,l+1) oz(i,l) = (ozib(i) + tem*dt) / (1.0 + prod(i,2)*dt) enddo - if(ldiag3d .and. qdiag3d) then - do i=1,im - ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt - ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) - ozp3(i,l) = ozp3(i,l) + prod(i,3)*tin(i,l)*dt - ozp4(i,l) = ozp4(i,l) + prod(i,4)*colo3(i,l+1)*dt - enddo + if(idtend(1)>1) then + dtend(:,l,idtend(1)) = idtend(:,l,idtend(1)) + ! was ozp1 + & prod(:,1)*dt + endif + if(idtend(2)>1) then + dtend(:,l,idtend(2)) = idtend(:,l,idtend(2)) + ! was ozp2 + & (oz(:,l)-ozib(:)) + endif + if(idtend(3)>1) then + dtend(:,l,idtend(3)) = idtend(:,l,idtend(3)) + ! was ozp3 + & prod(:,3)*tin(:,l)*dt + endif + if(idtend(4)>1) then + dtend(:,l,idtend(4)) = idtend(:,l,idtend(4)) + ! was ozp4 + & prod(:,4)*colo3(:,l+1)*dt endif endif - enddo ! vertical loop ! return diff --git a/physics/ozphys.meta b/physics/ozphys.meta index 2edfc04e8..c832f9457 100644 --- a/physics/ozphys.meta +++ b/physics/ozphys.meta @@ -140,49 +140,63 @@ type = logical intent = in optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = in - optional = F -[ozp1] - standard_name = cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate - long_name = cumulative change in ozone concentration due to production and loss rate - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys + active = (flag_diagnostics_3D) intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[ozp2] - standard_name = cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio - long_name = cumulative change in ozone concentration due to ozone mixing ratio - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[ntoz] + standard_name = index_for_ozone + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in optional = F -[ozp3] - standard_name = cumulative_change_in_ozone_concentration_due_to_temperature - long_name = cumulative change in ozone concentration due to temperature - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_prod_loss] + standard_name = index_for_cause_prod_loss + long_name = tracer changes caused by ozone production and loss + units = index + dimensions = () + type = integer + intent = in optional = F -[ozp4] - standard_name = cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column - long_name = cumulative change in ozone concentration due to overhead ozone column - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_ozmix] + standard_name = index_for_cause_ozmix + long_name = tracer changes caused by ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_temp] + standard_name = index_for_cause_temp + long_name = tracer changes caused by temperature + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_overhead_ozone] + standard_name = index_for_cause_overhead_ozone + long_name = tracer changes caused by overhead ozone column + units = index + dimensions = () + type = integer + intent = in optional = F [con_g] standard_name = gravitational_acceleration diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index cc60ed2b4..5bec3c9cd 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -49,11 +49,10 @@ end subroutine ozphys_2015_finalize !! climatological T and O3 are in location 5 and 6 of prdout array !!\author June 2015 - Shrinivas Moorthi subroutine ozphys_2015_run ( & - & im, levs, ko3, dt, oz, tin, po3, & - & prsl, prdout, pl_coeff, delp, & - & ldiag3d, qdiag3d, & - & ozp1,ozp2,ozp3,ozp4,con_g, & - & me, errmsg, errflg) + & im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_coeff, & + & delp, ldiag3d, dtend, dtidx, ntoz, index_for_cause_prod_loss,& + & index_for_cause_ozmix, index_for_cause_temp, & + & index_for_cause_overhead_ozone, con_g, me, errmsg, errflg) ! ! use machine , only : kind_phys @@ -66,16 +65,18 @@ subroutine ozphys_2015_run ( & & prsl(im,levs), tin(im,levs), & & delp(im,levs), & & prdout(im,ko3,pl_coeff), dt - ! These arrays may not be allocated and need assumed array sizes - real(kind=kind_phys), intent(inout) :: & - & ozp1(:,:), ozp2(:,:), ozp3(:,:),ozp4(:,:) + ! dtend may not be allocated and needs an assumed array size + real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), ntoz, & + & index_for_cause_prod_loss, index_for_cause_ozmix, & + & index_for_cause_temp, index_for_cause_overhead_ozone real(kind=kind_phys), intent(inout) :: oz(im,levs) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer k,kmax,kmin,l,i,j + integer k,kmax,kmin,l,i,j, idtend(4) logical ldiag3d, flg(im), qdiag3d real(kind=kind_phys) pmax, pmin, tem, temp real(kind=kind_phys) wk1(im), wk2(im), wk3(im),prod(im,pl_coeff), & @@ -86,6 +87,15 @@ subroutine ozphys_2015_run ( & errmsg = '' errflg = 0 + if(ldiag3d) then + idtend(1) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp1 + idtend(2) = dtidx(100+ntoz,index_for_cause_ozmix) ! was ozp2 + idtend(3) = dtidx(100+ntoz,index_for_cause_temp) ! was ozp3 + idtend(4) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp4 + else + idtend=1 + endif + !ccpp: save input oz in ozi ozi = oz gravi=1.0/con_g @@ -159,14 +169,21 @@ subroutine ozphys_2015_run ( & !ccpp ozo(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) oz(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) enddo - if (ldiag3d .and. qdiag3d) then ! ozone change diagnostics - do i=1,im - ozp1(i,l) = ozp1(i,l) + (prod(i,1)-prod(i,2)*prod(i,6))*dt - ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) - ozp3(i,l) = ozp3(i,l) + prod(i,3)*(tin(i,l)-prod(i,5))*dt - ozp4(i,l) = ozp4(i,l) + prod(i,4) - & * (colo3(i,l)-coloz(i,l))*dt - enddo + if(idtend(1)>1) then + dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 + & (prod(i,1)-prod(i,2)*prod(i,6))*dt + endif + if(idtend(2)>1) then + dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 + & (oz(i,l) - ozib(i)) + endif + if(idtend(3)>1) then + dtend(:,l,idtend(3)) = dtend(:,l,idtend(3)) + ! was ozp3 + & prod(i,3)*(tin(i,l)-prod(i,5))*dt + endif + if(idtend(4)>1) then + dtend(:,l,idtend(4)) = dtend(:,l,idtend(4)) + ! was ozp4 + & prod(i,4) * (colo3(i,l)-coloz(i,l))*dt endif enddo ! vertical loop ! diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index 11f1dfa0c..931d16532 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -140,49 +140,63 @@ type = logical intent = in optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = in - optional = F -[ozp1] - standard_name = cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate - long_name = cumulative change in ozone concentration due to production and loss rate - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys + active = (flag_diagnostics_3D) intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[ozp2] - standard_name = cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio - long_name = cumulative change in ozone concentration due to ozone mixing ratio - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[ntoz] + standard_name = index_for_ozone + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in optional = F -[ozp3] - standard_name = cumulative_change_in_ozone_concentration_due_to_temperature - long_name = cumulative change in ozone concentration due to temperature - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_prod_loss] + standard_name = index_for_cause_prod_loss + long_name = tracer changes caused by ozone production and loss + units = index + dimensions = () + type = integer + intent = in optional = F -[ozp4] - standard_name = cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column - long_name = cumulative change in ozone concentration due to overhead ozone column - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_ozmix] + standard_name = index_for_cause_ozmix + long_name = tracer changes caused by ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_temp] + standard_name = index_for_cause_temp + long_name = tracer changes caused by temperature + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_overhead_ozone] + standard_name = index_for_cause_overhead_ozone + long_name = tracer changes caused by overhead ozone column + units = index + dimensions = () + type = integer + intent = in optional = F [con_g] standard_name = gravitational_acceleration diff --git a/physics/phys_tend.F90 b/physics/phys_tend.F90 index 333c22e2a..98d76e104 100644 --- a/physics/phys_tend.F90 +++ b/physics/phys_tend.F90 @@ -19,80 +19,57 @@ end subroutine phys_tend_finalize !> \section arg_table_phys_tend_run Argument Table !! \htmlinclude phys_tend_run.html !! - subroutine phys_tend_run(ldiag3d, qdiag3d, & - du3dt_pbl, du3dt_orogwd, du3dt_deepcnv, du3dt_congwd, & - du3dt_rdamp, du3dt_shalcnv, du3dt_phys, & - dv3dt_pbl, dv3dt_orogwd, dv3dt_deepcnv, dv3dt_congwd, & - dv3dt_rdamp, dv3dt_shalcnv, dv3dt_phys, & - dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_deepcnv, & - dt3dt_shalcnv, dt3dt_mp, dt3dt_orogwd, dt3dt_rdamp, & - dt3dt_congwd, dt3dt_phys, & - dq3dt_pbl, dq3dt_deepcnv, dq3dt_shalcnv, dq3dt_mp, & - dq3dt_o3pbl, dq3dt_o3prodloss, dq3dt_o3mix, & - dq3dt_o3tmp, dq3dt_o3column, dq3dt_phys, dq3dt_o3phys, & - errmsg, errflg) + subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & + index_for_cause_physics, index_for_cause_non_physics, & + ncause, errmsg, errflg) ! Interface variables - logical, intent(in) :: ldiag3d, qdiag3d - real(kind=kind_phys), intent(in ) :: du3dt_pbl(:,:) - real(kind=kind_phys), intent(in ) :: du3dt_orogwd(:,:) - real(kind=kind_phys), intent(in ) :: du3dt_deepcnv(:,:) - real(kind=kind_phys), intent(in ) :: du3dt_congwd(:,:) - real(kind=kind_phys), intent(in ) :: du3dt_rdamp(:,:) - real(kind=kind_phys), intent(in ) :: du3dt_shalcnv(:,:) - real(kind=kind_phys), intent( out) :: du3dt_phys(:,:) - real(kind=kind_phys), intent(in ) :: dv3dt_pbl(:,:) - real(kind=kind_phys), intent(in ) :: dv3dt_orogwd(:,:) - real(kind=kind_phys), intent(in ) :: dv3dt_deepcnv(:,:) - real(kind=kind_phys), intent(in ) :: dv3dt_congwd(:,:) - real(kind=kind_phys), intent(in ) :: dv3dt_rdamp(:,:) - real(kind=kind_phys), intent(in ) :: dv3dt_shalcnv(:,:) - real(kind=kind_phys), intent( out) :: dv3dt_phys(:,:) - real(kind=kind_phys), intent(in ) :: dt3dt_lw(:,:) - real(kind=kind_phys), intent(in ) :: dt3dt_sw(:,:) - real(kind=kind_phys), intent(in ) :: dt3dt_pbl(:,:) - real(kind=kind_phys), intent(in ) :: dt3dt_deepcnv(:,:) - real(kind=kind_phys), intent(in ) :: dt3dt_shalcnv(:,:) - real(kind=kind_phys), intent(in ) :: dt3dt_mp(:,:) - real(kind=kind_phys), intent(in ) :: dt3dt_orogwd(:,:) - real(kind=kind_phys), intent(in ) :: dt3dt_rdamp(:,:) - real(kind=kind_phys), intent(in ) :: dt3dt_congwd(:,:) - real(kind=kind_phys), intent( out) :: dt3dt_phys(:,:) - real(kind=kind_phys), intent(in ) :: dq3dt_pbl(:,:) - real(kind=kind_phys), intent(in ) :: dq3dt_deepcnv(:,:) - real(kind=kind_phys), intent(in ) :: dq3dt_shalcnv(:,:) - real(kind=kind_phys), intent(in ) :: dq3dt_mp(:,:) - real(kind=kind_phys), intent(in ) :: dq3dt_o3pbl(:,:) - real(kind=kind_phys), intent(in ) :: dq3dt_o3prodloss(:,:) - real(kind=kind_phys), intent(in ) :: dq3dt_o3mix(:,:) - real(kind=kind_phys), intent(in ) :: dq3dt_o3tmp(:,:) - real(kind=kind_phys), intent(in ) :: dq3dt_o3column(:,:) - real(kind=kind_phys), intent( out) :: dq3dt_phys(:,:) - real(kind=kind_phys), intent( out) :: dq3dt_o3phys(:,:) + logical, intent(in) :: ldiag3d + real(kind=kind_phys), optional, intent(inout) :: dtend + integer, intent(in) :: dtidx(:,:), index_for_cause_physics, index_for_cause_non_physics, ntracp100 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + integer :: itrac, iphys, icause, idtend + logical :: first + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - if (.not.ldiag3d .and. .not.qdiag3d) return - - du3dt_phys = du3dt_pbl + du3dt_orogwd + du3dt_deepcnv + & - du3dt_congwd + du3dt_rdamp + du3dt_shalcnv - - dv3dt_phys = dv3dt_pbl + dv3dt_orogwd + dv3dt_deepcnv + & - dv3dt_congwd + dv3dt_rdamp + dv3dt_shalcnv - - dt3dt_phys = dt3dt_lw + dt3dt_sw + dt3dt_pbl + & - dt3dt_deepcnv + dt3dt_shalcnv + dt3dt_mp + & - dt3dt_orogwd + dt3dt_rdamp + dt3dt_congwd - - dq3dt_phys = dq3dt_pbl + dq3dt_deepcnv + & - dq3dt_shalcnv + dq3dt_mp - - dq3dt_o3phys = dq3dt_o3pbl + dq3dt_o3prodloss & - + dq3dt_o3mix + dq3dt_o3tmp + dq3dt_o3column + if(.not.ldiag3d) then + return + endif + + do itrac=2,ntracp100 + first=.true. + iphys = dtidx(itrac,index_for_cause_physics) + if(iphys<2) then + cycle ! No physics tendency requested for this tracer + endif + do icause=1,ncause + if(icause==index_for_cause_physics .or. & + icuase==index_for_cause_non_physics) then + cycle ! Don't sum up the sums. + endif + idtend = dtidx(itrac,icause) + if(idtend>1) then + ! This tendency was calculated for this tracer, so + ! accumulate it into the total physics tendency. + if(first) then + dtend(:,:,iphys) = dtend(:,:,idtend) + first=.false. + else + dtend(:,:,iphys) = dtend(:,:,iphys) + dtend(:,:,idtend) + endif + endif + enddo + if(first) then + ! No physics tendencies were calculated for this tracer, + ! so total physics tendency is 0. + dtend(:,:,iphys) = 0 + endif + enddo end subroutine phys_tend_run diff --git a/physics/phys_tend.meta b/physics/phys_tend.meta index 3af255148..31acfab86 100644 --- a/physics/phys_tend.meta +++ b/physics/phys_tend.meta @@ -15,329 +15,55 @@ type = logical intent = in optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = in - optional = F -[du3dt_pbl] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[du3dt_orogwd] - standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in x wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[du3dt_deepcnv] - standard_name = cumulative_change_in_x_wind_due_to_deep_convection - long_name = cumulative change in x wind due to deep convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[du3dt_congwd] - standard_name = cumulative_change_in_x_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in x wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[du3dt_rdamp] - standard_name = cumulative_change_in_x_wind_due_to_rayleigh_damping - long_name = cumulative change in x wind due to Rayleigh damping - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[du3dt_shalcnv] - standard_name = cumulative_change_in_x_wind_due_to_shallow_convection - long_name = cumulative change in x wind due to shallow convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[du3dt_phys] - standard_name = cumulative_change_in_x_wind_due_to_physics - long_name = cumulative change in x wind due to physics - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F -[dv3dt_pbl] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dv3dt_orogwd] - standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in y wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dv3dt_deepcnv] - standard_name = cumulative_change_in_y_wind_due_to_deep_convection - long_name = cumulative change in y wind due to deep convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dv3dt_congwd] - standard_name = cumulative_change_in_y_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in y wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dv3dt_rdamp] - standard_name = cumulative_change_in_y_wind_due_to_rayleigh_damping - long_name = cumulative change in y wind due to Rayleigh damping - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dv3dt_shalcnv] - standard_name = cumulative_change_in_y_wind_due_to_shallow_convection - long_name = cumulative change in y wind due to shallow convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dv3dt_phys] - standard_name = cumulative_change_in_y_wind_due_to_physics - long_name = cumulative change in y wind due to physics - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F -[dt3dt_lw] - standard_name = cumulative_change_in_temperature_due_to_longwave_radiation - long_name = cumulative change in temperature due to longwave radiation - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dt3dt_sw] - standard_name = cumulative_change_in_temperature_due_to_shortwave_radiation - long_name = cumulative change in temperature due to shortwave radiation - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dt3dt_pbl] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dt3dt_deepcnv] - standard_name = cumulative_change_in_temperature_due_to_deep_convection - long_name = cumulative change in temperature due to deep convection - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dt3dt_shalcnv] - standard_name = cumulative_change_in_temperature_due_to_shallow_convection - long_name = cumulative change in temperature due to shallow convection - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dt3dt_mp] - standard_name = cumulative_change_in_temperature_due_to_microphysics - long_name = cumulative change in temperature due to microphysics - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dt3dt_orogwd] - standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag - long_name = cumulative change in temperature due to orographic gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dt3dt_rdamp] - standard_name = cumulative_change_in_temperature_due_to_rayleigh_damping - long_name = cumulative change in temperature due to Rayleigh damping - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dt3dt_congwd] - standard_name = cumulative_change_in_temperature_due_to_convective_gravity_wave_drag - long_name = cumulative change in temperature due to convective gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dt3dt_phys] - standard_name = cumulative_change_in_temperature_due_to_physics - long_name = cumulative change in temperature due to physics - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F -[dq3dt_pbl] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dq3dt_deepcnv] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_deep_convection - long_name = cumulative change in water vapor specific humidity due to deep convection - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dq3dt_shalcnv] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_shallow_convection - long_name = cumulative change in water vapor specific humidity due to shallow convection - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dq3dt_mp] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_microphysics - long_name = cumulative change in water vapor specific humidity due to microphysics - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[dq3dt_o3pbl] - standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL - long_name = cumulative change in ozone mixing ratio due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + type = real + kind = kind_phys + intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer intent = in optional = F -[dq3dt_o3prodloss] - standard_name = cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate - long_name = cumulative change in ozone concentration due to production and loss rate - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys +[ntracp100] + standard_name = number_of_tracers_plus_one_hundred + long_name = number of tracers plus one_hundred + units = count + dimensions = () + type = integer intent = in optional = F -[dq3dt_o3mix] - standard_name = cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio - long_name = cumulative change in ozone concentration due to ozone mixing ratio - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys +[index_for_cause_physics] + standard_name = index_for_cause_physics + long_name = tracer changes caused by physics schemes + units = index + dimensions = () + type = integer intent = in optional = F -[dq3dt_o3tmp] - standard_name = cumulative_change_in_ozone_concentration_due_to_temperature - long_name = cumulative change in ozone concentration due to temperature - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys +[index_for_cause_non_physics] + standard_name = index_for_cause_non_physics + long_name = tracer changes caused by everything except physics schemes + units = index + dimensions = () + type = integer intent = in optional = F -[dq3dt_o3column] - standard_name = cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column - long_name = cumulative change in ozone concentration due to overhead ozone column - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys +[ncause] + standard_name = number_of_possible_causes_of_tracer_changes + long_name = number of possible causes of tracer changes + units = count + dimensions = () + type = integer intent = in optional = F -[dq3dt_phys] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_physics - long_name = cumulative change in water vapor specific humidity due to physics - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F -[dq3dt_o3phys] - standard_name = cumulative_change_in_ozone_concentration_due_to_physics - long_name = cumulative change in ozone concentration due to physics - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f index 8d05f8b0b..730915c6d 100644 --- a/physics/rayleigh_damp.f +++ b/physics/rayleigh_damp.f @@ -22,10 +22,10 @@ end subroutine rayleigh_damp_init !>\section gen_ray_damp_run GFS rayleigh_damp_runGeneral Algorithm !> @{ subroutine rayleigh_damp_run ( & - & lsidea,IM,KM,A,B,C,U1,V1,DT,CP, & - & LEVR,pgr,PRSL,PRSLRD0,ral_ts, & - & ldiag3d,du3dt,dv3dt,dt3dt, & - & errmsg,errflg) + & lsidea,IM,KM,A,B,C,U1,V1,DT,CP,LEVR,pgr,PRSL,PRSLRD0,ral_ts, & + & ldiag3d,dtend,dtidx,index_for_cause_rayleigh_damping, & + & index_for_temperature,index_for_x_wind,index_for_y_wind, & + & errmsg,errflg) ! ! ******************************************************************** ! -----> I M P L E M E N T A T I O N V E R S I O N <---------- @@ -72,9 +72,10 @@ subroutine rayleigh_damp_run ( & real(kind=kind_phys),intent(in) :: pgr(im), PRSL(IM,KM) real(kind=kind_phys),intent(in) :: U1(IM,KM), V1(IM,KM) real(kind=kind_phys),intent(inout) :: A(IM,KM), B(IM,KM), C(IM,KM) - real(kind=kind_phys),intent(inout) :: du3dt(:,:) - real(kind=kind_phys),intent(inout) :: dv3dt(:,:) - real(kind=kind_phys),intent(inout) :: dt3dt(:,:) + real(kind=kind_phys),optional, intent(inout) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), & + & index_for_cause_rayleigh_damping, index_for_temperature, & + & index_for_x_wind, index_for_y_wind character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -83,7 +84,18 @@ subroutine rayleigh_damp_run ( & real(kind=kind_phys) DTAUX, DTAUY, wrk1, rtrd1, rfactrd, wrk2 &, ENG0, ENG1, tem1, tem2, dti, hfbcpdt, rtrd real(kind=kind_phys) tx1(im), deltaA, deltaB, deltaC - integer i, k + integer i, k, uidx,vidx,tidx + + if(ldiag3d) then + uidx=dtidx(index_for_x_wind,index_for_cause_rayleigh_damping) + vidx=dtidx(index_for_y_wind,index_for_cause_rayleigh_damping) + tidx=dtidx(index_for_temperature, & + & index_for_cause_rayleigh_damping) + else + uidx=1 + vidx=1 + tidx=1 + endif ! ! Initialize CCPP error handling variables errmsg = '' @@ -121,10 +133,14 @@ subroutine rayleigh_damp_run ( & A(I,K) = A(I,K) + deltaA B(I,K) = B(I,K) + deltaB C(I,K) = C(I,K) + deltaC - IF(ldiag3d) THEN - dv3dt(I,K) = dv3dt(I,K) + deltaA - du3dt(I,K) = du3dt(I,K) + deltaB - dt3dt(I,K) = dt3dt(I,K) + deltaC + IF(vidx>1) THEN + dtend(i,k,vidx) = dtend(i,k,vidx) + deltaA + ENDIF + IF(uidx>1) THEN + dtend(i,k,uidx) = dtend(i,k,uidx) + deltaB + ENDIF + IF(tidx>1) THEN + dtend(i,k,tidx) = dtend(i,k,tidx) + deltaC ENDIF ENDDO ENDDO diff --git a/physics/rayleigh_damp.meta b/physics/rayleigh_damp.meta index e53cfa75d..45205323e 100644 --- a/physics/rayleigh_damp.meta +++ b/physics/rayleigh_damp.meta @@ -146,32 +146,55 @@ type = logical intent = in optional = F -[du3dt] - standard_name = cumulative_change_in_x_wind_due_to_rayleigh_damping - long_name = cumulative change in zonal wind due to Rayleigh damping - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys + active = (flag_diagnostics_3D) intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dv3dt] - standard_name = cumulative_change_in_y_wind_due_to_rayleigh_damping - long_name = cumulative change in meridional wind due to Rayleigh damping - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_rayleigh_damping] + standard_name = index_for_cause_rayleigh_damping + long_name = tracer changes caused by Rayleigh damping + units = index + dimensions = () + type = integer + intent = in optional = F -[dt3dt] - standard_name = cumulative_change_in_temperature_due_to_rayleigh_damping - long_name = cumulative change in temperature due to Rayleigh damping - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F [errmsg] standard_name = ccpp_error_message diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index 4032f1828..a50a5747a 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -34,9 +34,10 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & dusfc,dvsfc,dtsfc,dqsfc, & dt,kpbl1d, & u10,v10, & - dx,lssav,ldiag3d,qdiag3d, & - flag_for_pbl_generic_tend,ntoz,du3dt_PBL,dv3dt_PBL, & - dt3dt_PBL,dq3dt_PBL,do3dt_PBL,errmsg,errflg ) + dx,lssav,ldiag3d, & + flag_for_pbl_generic_tend,ntoz,ntqv,dtend,dtidx, & + index_for_cause_pbl,index_for_temperature,index_for_x_wind, & + index_for_y_wind,errmsg,errflg ) use machine , only : kind_phys ! @@ -108,7 +109,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & ! 1D in integer, intent(in ) :: im,km,ntrac,ndiff,ntcw,ntiw,ntoz real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt - logical, intent(in ) :: lssav, ldiag3d, qdiag3d, & + logical, intent(in ) :: lssav, ldiag3d, & flag_for_pbl_generic_tend ! 3D in real(kind=kind_phys), dimension(im, km) , & @@ -131,8 +132,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & ttnp real(kind=kind_phys), dimension(im, km, ntrac ) , & intent(inout) :: qtnp - real(kind=kind_phys), dimension(im,km) , & - intent(inout) :: du3dt_PBL, dv3dt_PBL, dt3dt_PBL, dq3dt_PBL, do3dt_PBL + ! 2D in integer, dimension(im) , & intent(in ) :: landmask @@ -161,6 +161,14 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & dtsfc, & dqsfc + ! 3D diagnostic tendencies; dtend is only allocated if ldiag3d=.true. + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), index_for_cause_pbl, ntqv, & + index_for_x_wind, index_for_y_wind, index_for_temperature + + ! Index within dtend third dimension for tendency of interest: + integer :: idtend + ! error messages character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -963,12 +971,10 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then - do k = kte,kts,-1 - do i = its,ite - ttend = (f1(i,k)-thx(i,k)+300.)*rdt*pi2d(i,k) - dt3dt_PBL(i,k) = dt3dt_PBL(i,k) + ttend*dtstep - enddo - enddo + idtend = dtidx(index_for_temperature,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f1-thx+300.)*rdt*pi2d + endif endif ! ! compute tridiagonal matrix elements for moisture, clouds, and gases @@ -1094,13 +1100,11 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & tvflux_e(i,k) = tflux_e(i,k) + qflux_e(i,k)*ep1*thx(i,k) enddo enddo - if(lssav .and. ldiag3d .and. qdiag3d .and. .not. flag_for_pbl_generic_tend) then - do k = kte,kts,-1 - do i = its,ite - qtend = (f3(i,k,1)-qx(i,k,1))*rdt - dq3dt_PBL(i,k) = dq3dt_PBL(i,k) + qtend*dtstep - enddo - enddo + if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then + idtend = dtidx(ntqv+100,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*rdt*(f3(:,:,1)-qx(:,:,1)) + endif endif ! print*,"qtnp:",maxval(qtnp(:,:,1)),minval(qtnp(:,:,1)) ! @@ -1131,15 +1135,12 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo endif enddo - if(lssav .and. ldiag3d .and. ntoz>0 .and. qdiag3d .and. & + if(lssav .and. ldiag3d .and. ntoz>0 .and. & & .not. flag_for_pbl_generic_tend) then - ic = ntoz - do k = kte,kts,-1 - do i = its,ite - qtend = f3(i,k,ic)-qx(i,k,ic) - do3dt_PBL(i,k) = do3dt_PBL(i,k)+qtend - enddo - enddo + idtend=dtidx(ntoz+100,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + qtend*(f3(:,:,ntoz)-qx(:,:,ntoz)) + endif endif endif ! @@ -1233,14 +1234,14 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then - do k = kte,kts,-1 - do i = its,ite - utend = (f1(i,k)-ux(i,k))*rdt - vtend = (f2(i,k)-vx(i,k))*rdt - du3dt_PBL(i,k) = du3dt_PBL(i,k) + utend*dtstep - dv3dt_PBL(i,k) = dv3dt_PBL(i,k) + vtend*dtstep - enddo - enddo + idtend=dtidx(index_for_x_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*rdt*(f1-ux) + endif + idtend=dtidx(index_for_y_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*rdt*(f2-vx) + endif endif ! do i = its,ite diff --git a/physics/shinhongvdif.meta b/physics/shinhongvdif.meta index 8c850ff37..9046c5982 100644 --- a/physics/shinhongvdif.meta +++ b/physics/shinhongvdif.meta @@ -449,46 +449,63 @@ type = integer intent = in optional = F -[du3dt_PBL] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[dv3dt_PBL] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[dt3dt_PBL] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[dq3dt_PBL] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[do3dt_PBL] - standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL - long_name = cumulative change in ozone mixing ratio due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in + optional = F +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index fda887f3e..34faf7e42 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -232,7 +232,8 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, dudt_mtb,dudt_ogw, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & dudt, dvdt, dtdt, rdxzb, con_g, con_omega, con_pi, con_cp, con_rd, con_rv, & con_rerth, con_fvirt, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & - ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw, ldu3dt_cgw, ldv3dt_cgw, ldt3dt_cgw, & + dtend, dtidx, index_for_temperature, index_for_x_wind, index_for_y_indw, & + index_for_cause_orographic_gwd, index_for_cause_convective_gwd, & ldiag3d, lssav, flag_for_gwd_generic_tend, do_ugwp_v0, do_ugwp_v0_orog_only, & do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, do_ugwp_v1, & do_ugwp_v1_orog_only, gwd_opt, errmsg, errflg) @@ -279,9 +280,11 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, real(kind=kind_phys), intent(out), dimension(im, levs):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis real(kind=kind_phys), intent(out), dimension(im, levs):: dudt_mtb, dudt_ogw, dudt_tms - ! These arrays are only allocated if ldiag=.true. - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_cgw, ldv3dt_cgw, ldt3dt_cgw + ! The dtend array is are only allocated if ldiag=.true. + real(kind=kind_phys), intent(inout), optional :: dtend + integer, intent(in) :: dtidx, index_for_temperature, index_for_x_wind, & + index_for_y_wind, index_for_cause_convective_gwd, & + index_for_cause_orographic_gwd logical, intent(in) :: ldiag3d, lssav ! These arrays only allocated if ldiag_ugwp = .true. @@ -333,7 +336,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, ! ugwp_v1 local variables integer :: y4, month, day, ddd_ugwp, curdate, curday - integer :: hour + integer :: hour, idtend real(kind=kind_phys) :: hcurdate, hcurday, fhour, fhrday integer :: kdtrest integer :: curday_ugwp @@ -445,13 +448,20 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - do k=1,levs - do i=1,im - ldu3dt_ogw(i,k) = ldu3dt_ogw(i,k) + Pdudt(i,k)*dtp - ldv3dt_ogw(i,k) = ldv3dt_ogw(i,k) + Pdvdt(i,k)*dtp - ldt3dt_ogw(i,k) = ldt3dt_ogw(i,k) + Pdtdt(i,k)*dtp - enddo - enddo + idtend = dtidx(index_for_cause_x_wind,index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp + endif + + idtend = dtidx(index_for_cause_y_wind,index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp + endif + + idtend = dtidx(index_for_cause_temperature,index_for_cause_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp + endif endif end if @@ -564,13 +574,20 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, #endif if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - do k=1,levs - do i=1,im - ldu3dt_cgw(i,k) = ldu3dt_cgw(i,k) + (gw_dudt(i,k) - Pdudt(i,k))*dtp - ldv3dt_cgw(i,k) = ldv3dt_cgw(i,k) + (gw_dvdt(i,k) - Pdvdt(i,k))*dtp - ldt3dt_cgw(i,k) = ldt3dt_cgw(i,k) + (gw_dtdt(i,k) - Pdtdt(i,k))*dtp - enddo - enddo + idtend = dtidx(index_for_cause_x_wind,index_for_cause_convective_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp + endif + + idtend = dtidx(index_for_cause_y_wind,index_for_cause_convective_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp + endif + + idtend = dtidx(index_for_cause_temperature,index_for_cause_convective_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp + endif endif end if ! do_ugwp_v0 diff --git a/physics/unified_ugwp.meta b/physics/unified_ugwp.meta index 675a68edd..0f260726d 100644 --- a/physics/unified_ugwp.meta +++ b/physics/unified_ugwp.meta @@ -1199,66 +1199,69 @@ type = integer intent = in optional = F -[ldu3dt_ogw] - standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in x wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in optional = F -[ldv3dt_ogw] - standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in y wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys intent = inout + optional = T +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[ldt3dt_ogw] - standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag - long_name = cumulative change in temperature due to orographic gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F -[ldu3dt_cgw] - standard_name = cumulative_change_in_x_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in x wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[ldv3dt_cgw] - standard_name = cumulative_change_in_y_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in y wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[ldt3dt_cgw] - standard_name = cumulative_change_in_temperature_due_to_convective_gravity_wave_drag - long_name = cumulative change in temperature due to convective gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_orographic_gwd] + standard_name = index_for_cause_orographic_gwd + long_name = tracer changes caused by orographic gravity wave drag + units = index + dimensions = () + type = integer + intent = in optional = F -[ldiag3d] - standard_name = flag_diagnostics_3D - long_name = flag for 3d diagnostic fields - units = flag +[index_for_cause_convective_gwd] + standard_name = index_for_cause_convective_gwd + long_name = tracer changes caused by convective gravity wave drag + units = index dimensions = () - type = logical + type = integer intent = in optional = F [lssav] diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index 75c0b31d3..4ccc37a41 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -34,8 +34,9 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & g,rd,cp,rv,ep1,ep2,xlv, & dusfc,dvsfc,dtsfc,dqsfc, & dt,kpbl1d,u10,v10,lssav,ldiag3d,qdiag3d, & - flag_for_pbl_generic_tend,ntoz,du3dt_PBL,dv3dt_PBL, & - dt3dt_PBL,dq3dt_PBL,do3dt_PBL,errmsg,errflg ) + flag_for_pbl_generic_tend,ntoz,ntqv,dtend,dtidx, & + index_for_temperature,index_for_x_wind,index_for_y_wind, & + index_for_cause_pbl,errmsg,errflg ) use machine , only : kind_phys ! @@ -88,8 +89,9 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & intent(inout) :: utnp,vtnp,ttnp real(kind=kind_phys), dimension( im,km,ntrac ) , & intent(inout) :: qtnp - real(kind=kind_phys), dimension(im,km) , & - intent(inout) :: du3dt_PBL, dv3dt_PBL, dt3dt_PBL, dq3dt_PBL, do3dt_PBL + real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), ntqv, index_for_temperature, & + index_for_x_wind, index_for_y_wind, index_for_cause_pbl ! !--------------------------------------------------------------------------------- ! output variables @@ -854,12 +856,10 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then - do k = km,1,-1 - do i = 1,im - ttend = (f1(i,k)-thx(i,k)+300.)*rdt*pi2d(i,k) - dt3dt_PBL(i,k) = dt3dt_PBL(i,k) + ttend*dtstep - enddo - enddo + idtend = dtidx(index_for_temperature,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f1-thx+300.)*rdt*pi2d + endif endif ! ! compute tridiagonal matrix elements for moisture, clouds, and gases @@ -970,12 +970,10 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. qdiag3d .and. .not. flag_for_pbl_generic_tend) then - do k = km,1,-1 - do i = 1,im - qtend = (f3(i,k,1)-qx(i,k,1))*rdt - dq3dt_PBL(i,k) = dq3dt_PBL(i,k) + qtend*dtstep - enddo - enddo + idtend = dtidx(ntqv+100,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f3(:,:,1)-qx(:,:,1))*rdt + endif endif ! if(ndiff.ge.2) then @@ -989,13 +987,10 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo if(lssav .and. ldiag3d .and. ntoz>0 .and. qdiag3d .and. & & .not. flag_for_pbl_generic_tend) then - ic = ntoz - do k = km,1,-1 - do i = 1,im - qtend = f3(i,k,ic)-qx(i,k,ic) - do3dt_PBL(i,k) = do3dt_PBL(i,k)+qtend - enddo - enddo + idtend = dtidx(100+ntoz,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + f3(:,:,ntoz)-qx(:,:,ntoz) + endif endif endif ! @@ -1079,14 +1074,15 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then - do k = km,1,-1 - do i = 1,im - utend = (f1(i,k)-ux(i,k))*rdt - vtend = (f2(i,k)-vx(i,k))*rdt - du3dt_PBL(i,k) = du3dt_PBL(i,k) + utend*dtstep - dv3dt_PBL(i,k) = dv3dt_PBL(i,k) + vtend*dtstep - enddo - enddo + idtend = dtidx(index_for_x_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f1-ux)*rdt + endif + + idtend = dtidx(index_for_y_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f2-vx)*rdt + endif endif ! !---- end of vertical diffusion From aac67fbcd7db2976736c335b369029a5c2d7818e Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Tue, 12 Jan 2021 16:08:33 +0000 Subject: [PATCH 02/24] Changes to make the first test case run to completion in debug mode. --- physics/GFS_DCNV_generic.meta | 38 +-------- physics/GFS_GWD_generic.F90 | 2 +- physics/GFS_GWD_generic.meta | 4 +- physics/GFS_MP_generic.F90 | 2 +- physics/GFS_PBL_generic.F90 | 9 ++- physics/GFS_PBL_generic.meta | 121 ---------------------------- physics/GFS_SCNV_generic.F90 | 8 +- physics/GFS_SCNV_generic.meta | 2 +- physics/GFS_suite_interstitial.F90 | 8 +- physics/GFS_suite_interstitial.meta | 10 ++- physics/cires_ugwp.F90 | 2 +- physics/cires_ugwp.meta | 2 +- physics/cu_gf_driver.meta | 2 +- physics/gwdc.meta | 2 +- physics/module_MYJPBL_wrapper.meta | 2 +- physics/module_MYNNPBL_wrapper.meta | 2 +- physics/moninedmf.f | 2 +- physics/moninedmf.meta | 3 +- physics/moninshoc.f | 73 ++++++++--------- physics/moninshoc.meta | 95 ++++++++++++---------- physics/ozphys.f | 10 +-- physics/ozphys.meta | 2 +- physics/ozphys_2015.meta | 2 +- physics/phys_tend.meta | 2 +- physics/rayleigh_damp.meta | 2 +- physics/satmedmfvdif.F | 47 +++++------ physics/satmedmfvdif.meta | 91 ++++++++++----------- physics/shinhongvdif.meta | 2 +- physics/unified_ugwp.meta | 2 +- 29 files changed, 201 insertions(+), 348 deletions(-) diff --git a/physics/GFS_DCNV_generic.meta b/physics/GFS_DCNV_generic.meta index 95b79976b..7da6d659f 100644 --- a/physics/GFS_DCNV_generic.meta +++ b/physics/GFS_DCNV_generic.meta @@ -355,7 +355,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair @@ -455,42 +455,6 @@ kind = kind_phys intent = inout optional = F -[dt3dt] - standard_name = cumulative_change_in_temperature_due_to_deep_convection - long_name = cumulative change in temperature due to deep conv. - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[dq3dt] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_deep_convection - long_name = cumulative change in water vapor specific humidity due to deep conv. - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[du3dt] - standard_name = cumulative_change_in_x_wind_due_to_deep_convection - long_name = cumulative change in x wind due to deep convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[dv3dt] - standard_name = cumulative_change_in_y_wind_due_to_deep_convection - long_name = cumulative change in y wind due to deep convection - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F [upd_mf] standard_name = cumulative_atmosphere_updraft_convective_mass_flux long_name = cumulative updraft mass flux diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index 33c61384b..40fdd6198 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -164,7 +164,7 @@ end subroutine GFS_GWD_generic_post_init !! @{ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, dvdt, dtdt, & & dugwd, dvgwd, flag_for_gwd_generic_tend, dtend, dtidx, index_for_temperature, index_for_x_wind, & - & index_for_y_wind, index_for_cause_orographic_gwd, errmsg, errflg + & index_for_y_wind, index_for_cause_orographic_gwd, errmsg, errflg) use machine, only : kind_phys implicit none diff --git a/physics/GFS_GWD_generic.meta b/physics/GFS_GWD_generic.meta index 2de649338..27297ff36 100644 --- a/physics/GFS_GWD_generic.meta +++ b/physics/GFS_GWD_generic.meta @@ -190,7 +190,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair @@ -372,7 +372,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 50e8407bf..38e6d3feb 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -118,7 +118,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, snow_cpl, pwat real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend ! only if ldiag3d - integer, dimension(ntrac,ncause), intent(in) :: dtidx + integer, dimension(:,:), intent(in) :: dtidx ! Stochastic physics / surface perturbations logical, intent(in) :: do_sppt, ca_global diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index d65b019b5..82efda4e3 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -315,7 +315,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, shinhong, do_ysu, dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, dudt, dvdt, dtdt, htrsw, htrlw, xmu, & dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dtend, dtidx, index_for_temperature, index_for_x_wind, index_for_y_wind, & index_for_cause_pbl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, & - dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag, + dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag, & rd, cp, fvirt, hvap, t1, q1, prsl, hflx, ushfsfci, oceanfrac, flag_cice, dusfc_cice, dvsfc_cice, & dtsfc_cice, dqsfc_cice, wet, dry, icy, wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1, dkt_cpl, dkt, hffac, hefac, & ugrs, vgrs, tgrs, qgrs, save_u, save_v, save_t, save_q, errmsg, errflg) @@ -382,7 +382,8 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, real(kind=kind_phys), parameter :: qmin = 1.0e-8_kp integer :: i, k, kk, k1, n real(kind=kind_phys) :: tem, rho - + integer :: idtend + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -623,11 +624,11 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, endif idtend = dtidx(index_for_x_wind, index_for_cause_pbl) if(idtend>1) then - dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (ugrs(1:im,1:levs) - save_u(1:im,1:levs) + dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (ugrs(1:im,1:levs) - save_u(1:im,1:levs)) endif idtend = dtidx(index_for_y_wind, index_for_cause_pbl) if(idtend>1) then - dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (vgrs(1:im,1:levs) - save_v(1:im,1:levs) + dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (vgrs(1:im,1:levs) - save_v(1:im,1:levs)) endif idtend = dtidx(100+ntqv, index_for_cause_pbl) if(idtend>1) then diff --git a/physics/GFS_PBL_generic.meta b/physics/GFS_PBL_generic.meta index e4bae0939..d65508f37 100644 --- a/physics/GFS_PBL_generic.meta +++ b/physics/GFS_PBL_generic.meta @@ -676,56 +676,6 @@ type = integer intent = in optional = F -[dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields - units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) - type = real - kind = kind_phys - intent = inout - optional = T -[dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair - units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) - type = integer - intent = in - optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field - units = index - dimensions = () - type = integer - intent = in - optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field - units = index - dimensions = () - type = integer - intent = in - optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field - units = index - dimensions = () - type = integer - intent = in - optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme - units = index - dimensions = () - type = integer - intent = in - optional = F - [ltaerosol] standard_name = flag_for_aerosol_physics long_name = flag for aerosol physics @@ -774,14 +724,6 @@ type = logical intent = in optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = in - optional = F [lsidea] standard_name = flag_idealized_physics long_name = flag for idealized physics @@ -1140,69 +1082,6 @@ kind = kind_phys intent = inout optional = F -[dt3dt] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[du3dt_PBL] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[du3dt_OGWD] - standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in x wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[dv3dt_PBL] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[dv3dt_OGWD] - standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in y wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[dq3dt] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[dq3dt_ozone] - standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL - long_name = cumulative change in ozone mixing ratio due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F [rd] standard_name = gas_constant_dry_air long_name = ideal gas constant for dry air diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index 8dd73a07a..b60ade9bc 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -143,22 +143,22 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl if (ldiag3d) then idtend = dtidx(index_for_temperature, index_for_cause_scnv) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gt0(i,k) - save_t(i,k)) * frain + dtend(:,:,idtend) = dtend(:,:,idtend) + (gt0 - save_t) * frain endif idtend = dtidx(index_for_x_wind, index_for_cause_scnv) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gu0(i,k) - save_u(i,k)) * frain + dtend(:,:,idtend) = dtend(:,:,idtend) + (gu0 - save_u) * frain endif idtend = dtidx(index_for_y_wind, index_for_cause_scnv) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0(i,k) - save_v(i,k)) * frain + dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0 - save_v) * frain endif idtend = dtidx(100+ntqv, index_for_cause_scnv) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0_water_vapor(i,k) - save_qv(i,k)) * frain + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0_water_vapor - save_qv) * frain endif endif endif diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta index 94b006016..5fec5247b 100644 --- a/physics/GFS_SCNV_generic.meta +++ b/physics/GFS_SCNV_generic.meta @@ -301,7 +301,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index d32106874..2d5efd6ad 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -307,12 +307,12 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl if (ldiag3d) then if (lsidea) then - idtend = dtidx(index_for_temperature,index_for_cause_lw) + idtend = dtidx(index_for_temperature,index_for_cause_longwave) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,1)*dtf endif - idtend = dtidx(index_for_temperature,index_for_cause_sw) + idtend = dtidx(index_for_temperature,index_for_cause_shortwave) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,2)*dtf endif @@ -337,12 +337,12 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,6)*dtf endif else - idtend = dtidx(index_for_temperature,index_for_cause_lw) + idtend = dtidx(index_for_temperature,index_for_cause_longwave) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + htrlw(:,:)*dtf endif - idtend = dtidx(index_for_temperature,index_for_cause_sw) + idtend = dtidx(index_for_temperature,index_for_cause_shortwave) if(idtend>1) then do k=1,levs dtend(:,k,idtend) = dtend(:,k,idtend) + htrlw(:,k)*dtf*xmu(:) diff --git a/physics/GFS_suite_interstitial.meta b/physics/GFS_suite_interstitial.meta index e21e83a26..d30283b96 100644 --- a/physics/GFS_suite_interstitial.meta +++ b/physics/GFS_suite_interstitial.meta @@ -672,7 +672,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair @@ -729,6 +729,14 @@ type = integer intent = in optional = F +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in + optional = F [ctei_rml] standard_name = grid_sensitive_critical_cloud_top_entrainment_instability_criteria long_name = grid sensitive critical cloud top entrainment instability criteria diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index d33466592..0dbbaf4da 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -185,7 +185,7 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr real(kind=kind_phys), intent(out), dimension(im, levs):: dudt_mtb, dudt_ogw, dudt_tms ! dtend is only allocated if ldiag=.true. - real(kind=kind_phys), optional, intent(in) :: dtend(:,:,:) + real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), & index_for_x_wind, index_for_y_wind, index_for_temperature, & index_for_cause_orographic_gwd, index_for_cause_convective_gwd diff --git a/physics/cires_ugwp.meta b/physics/cires_ugwp.meta index 14bfa9a0b..f230e2189 100644 --- a/physics/cires_ugwp.meta +++ b/physics/cires_ugwp.meta @@ -875,7 +875,7 @@ kind = kind_phys active = (flag_diagnostics_3D) intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta index 32ae324a8..32ed8c38c 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/cu_gf_driver.meta @@ -375,7 +375,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/gwdc.meta b/physics/gwdc.meta index 217bb09aa..e9b4eaa4f 100644 --- a/physics/gwdc.meta +++ b/physics/gwdc.meta @@ -599,7 +599,7 @@ kind = kind_phys active = (flag_diagnostics_3D) intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/module_MYJPBL_wrapper.meta b/physics/module_MYJPBL_wrapper.meta index e25d17893..bc998c136 100644 --- a/physics/module_MYJPBL_wrapper.meta +++ b/physics/module_MYJPBL_wrapper.meta @@ -638,7 +638,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/module_MYNNPBL_wrapper.meta b/physics/module_MYNNPBL_wrapper.meta index 5b21ae8c1..8b3c742a4 100644 --- a/physics/module_MYNNPBL_wrapper.meta +++ b/physics/module_MYNNPBL_wrapper.meta @@ -1027,7 +1027,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 0ab7b5e37..8622eb3c1 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -98,7 +98,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) integer, intent(in) :: index_for_x_wind, index_for_y_wind, & - index_for_cause_pbl, index_for_temperature, ntqv, ntoz + & index_for_cause_pbl, index_for_temperature, ntqv, ntoz real(kind=kind_phys), intent(in) :: & & u1(im,km), v1(im,km), & & t1(im,km), q1(im,km,ntrac), & diff --git a/physics/moninedmf.meta b/physics/moninedmf.meta index f72e8f2e4..fd2247d20 100644 --- a/physics/moninedmf.meta +++ b/physics/moninedmf.meta @@ -571,7 +571,7 @@ kind = kind_phys active = (flag_diagnostics_3D) intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair @@ -612,7 +612,6 @@ type = integer intent = in optional = F - [flag_for_pbl_generic_tend] standard_name = flag_for_generic_planetary_boundary_layer_tendency long_name = true if GFS_PBL_generic should calculate tendencies diff --git a/physics/moninshoc.f b/physics/moninshoc.f index eb9a5d963..b0d3f51a7 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -31,10 +31,10 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, & prsi,del,prsl,prslk,phii,phil,delt, & dusfc,dvsfc,dtsfc,dqsfc,dkt,hpbl, & kinver,xkzm_m,xkzm_h,xkzm_s,xkzminv, - & grav,rd,cp,hvap,fv,ntoz,dt3dt_PBL, - & du3dt_PBL,dv3dt_PBL,dq3dt_PBL,do3dt_PBL, - & gen_tend,ldiag3d,qdiag3d, - & errmsg,errflg) + & grav,rd,cp,hvap,fv,ntoz,dtend,dtidx, + & index_for_temperature,index_for_x_wind, + & index_for_y_wind,index_for_cause_pbl, + & gen_tend,ldiag3d,ntqv,errmsg,errflg) ! use machine , only : kind_phys use funcphys , only : fpvs @@ -62,10 +62,13 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, & tau real(kind=kind_phys), dimension(im,km,ntrac), intent(inout) :: rtg - real(kind=kind_phys), dimension(:,:), intent(inout) :: - & du3dt_PBL, dv3dt_PBL, dt3dt_PBL, dq3dt_PBL, do3dt_PBL + real(kind=kind_phys), intent(inout) :: + real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend + integer, dimension(:,:,:), intent(in) :: dtidx + integer, intent(in) :: index_for_temperature, index_for_x_wind, + & index_for_y_wind, index_for_cause_pbl, ntqv logical, intent(in) :: ldiag3d, - & qdiag3d, gen_tend + & gen_tend integer, dimension(im), intent(out) :: kpbl real(kind=kind_phys), dimension(im), intent(out) :: dusfc, @@ -110,6 +113,7 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, &, prmin=0.25_kp, prmax=4.0_kp, vk=0.4_kp, & cfac=6.5_kp real(kind=kind_phys) :: gravi, cont, conq, gocp, go2 + integer :: idtend gravi = one / grav cont = cp * gravi @@ -449,19 +453,13 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, enddo enddo if(ldiag3d .and. .not. gen_tend) then - do k = 1,km - do i = 1,im - ttend = (a1(i,k)-t1(i,k)) - dt3dt_PBL(i,k) = dt3dt_PBL(i,k) + ttend - enddo - enddo - if(qdiag3d) then - do k = 1,km - do i = 1,im - qtend = (a2(i,k)-q1(i,k,1)) - dq3dt_PBL(i,k) = dq3dt_PBL(i,k) + qtend - enddo - enddo + idtend = dtidx(index_for_temperature,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (a1-t1) + endif + idtend = dtidx(ntqv+100,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + a2-q1(:,:,1) endif endif do i = 1,im @@ -481,15 +479,18 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, enddo endif enddo - if(ldiag3d .and. ntoz>0 .and. qdiag3d .and. .not. gen_tend) then - kk = ntoz - is = (kk-1) * km - do k = 1, km - do i = 1, im - qtend = (a2(i,k+is)-q1(i,k,kk)) - do3dt_PBL(i,k) = do3dt_PBL(i,k)+qtend + if(ldiag3d .and. ntoz>0 .and. .not. gen_tend) then + idtend=dtidx(100+ntoz,index_for_cause_pbl) + if(idtend>0) then + kk = ntoz + is = (kk-1) * km + do k = 1, km + do i = 1, im + qtend = (a2(i,k+is)-q1(i,k,kk)) + dtend(i,k,idtend) = dtend(i,k,idtend) + qtend + enddo enddo - enddo + endif endif endif ! @@ -537,14 +538,14 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, enddo enddo if (ldiag3d .and. .not. gen_tend) then - do k = 1,km - do i = 1,im - utend = (a1(i,k)-u1(i,k)) - vtend = (a2(i,k)-v1(i,k)) - du3dt_PBL(i,k) = du3dt_PBL(i,k) + utend - dv3dt_PBL(i,k) = dv3dt_PBL(i,k) + vtend - enddo - enddo + idtend = dtidx(index_for_x_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + a1-u1 + endif + idtend = dtidx(index_for_y_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + a1-v1 + endif endif ! if (ntke > 0) then ! solve tridiagonal problem for momentum and tke diff --git a/physics/moninshoc.meta b/physics/moninshoc.meta index f550c5b59..2cc53ebd5 100644 --- a/physics/moninshoc.meta +++ b/physics/moninshoc.meta @@ -475,46 +475,54 @@ type = integer intent = in optional = F -[dt3dt_PBL] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[du3dt_PBL] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys - intent = inout -[dv3dt_PBL] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[dq3dt_PBL] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[do3dt_PBL] - standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL - long_name = cumulative change in ozone mixing ratio due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout + intent = in + optional = F +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in optional = F [gen_tend] standard_name = flag_for_generic_planetary_boundary_layer_tendency @@ -530,13 +538,14 @@ dimensions = () type = logical intent = in -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index dimensions = () - type = logical + type = integer intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/ozphys.f b/physics/ozphys.f index 113f6bc42..708358efe 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -47,7 +47,7 @@ end subroutine ozphys_finalize subroutine ozphys_run ( & & im, levs, ko3, dt, oz, tin, po3, & & prsl, prdout, oz_coeff, delp, ldiag3d, & - & ntoz, index_for_cause_prod_loss, & + & ntoz, dtend, dtidx, index_for_cause_prod_loss, & & index_for_cause_ozmix, index_for_cause_temp, & & index_for_cause_overhead_ozone, con_g, me, errmsg, errflg) ! @@ -191,19 +191,19 @@ subroutine ozphys_run ( & oz(i,l) = (ozib(i) + tem*dt) / (1.0 + prod(i,2)*dt) enddo if(idtend(1)>1) then - dtend(:,l,idtend(1)) = idtend(:,l,idtend(1)) + ! was ozp1 + dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 & prod(:,1)*dt endif if(idtend(2)>1) then - dtend(:,l,idtend(2)) = idtend(:,l,idtend(2)) + ! was ozp2 + dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 & (oz(:,l)-ozib(:)) endif if(idtend(3)>1) then - dtend(:,l,idtend(3)) = idtend(:,l,idtend(3)) + ! was ozp3 + dtend(:,l,idtend(3)) = dtend(:,l,idtend(3)) + ! was ozp3 & prod(:,3)*tin(:,l)*dt endif if(idtend(4)>1) then - dtend(:,l,idtend(4)) = idtend(:,l,idtend(4)) + ! was ozp4 + dtend(:,l,idtend(4)) = dtend(:,l,idtend(4)) + ! was ozp4 & prod(:,4)*colo3(:,l+1)*dt endif endif diff --git a/physics/ozphys.meta b/physics/ozphys.meta index c832f9457..aee1a8622 100644 --- a/physics/ozphys.meta +++ b/physics/ozphys.meta @@ -149,7 +149,7 @@ kind = kind_phys active = (flag_diagnostics_3D) intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index 931d16532..8dc9ee994 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -149,7 +149,7 @@ kind = kind_phys active = (flag_diagnostics_3D) intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/phys_tend.meta b/physics/phys_tend.meta index 31acfab86..bf3ff536c 100644 --- a/physics/phys_tend.meta +++ b/physics/phys_tend.meta @@ -23,7 +23,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/rayleigh_damp.meta b/physics/rayleigh_damp.meta index 45205323e..8300b7e07 100644 --- a/physics/rayleigh_damp.meta +++ b/physics/rayleigh_damp.meta @@ -155,7 +155,7 @@ kind = kind_phys active = (flag_diagnostics_3D) intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index ec6add8a5..812984b68 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -61,8 +61,9 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & & prsi,del,prsl,prslk,phii,phil,delt, & & dspheat,dusfc,dvsfc,dtsfc,dqsfc,hpbl, & & kinver,xkzm_m,xkzm_h,xkzm_s, & - & dt3dt_PBL,du3dt_PBL,dv3dt_PBL,dq3dt_PBL,do3dt_PBL, & - & gen_tend,ldiag3d,qdiag3d,errmsg,errflg) + & index_for_temperature,index_for_x_wind,index_for_y_wind, & + & index_for_cause_pbl,ntqv,ntoz,dtidx, & + & gen_tend,ldiag3d,errmsg,errflg) ! use machine , only : kind_phys use funcphys , only : fpvs @@ -75,8 +76,9 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & integer, intent(out) :: kpbl(im) ! logical, intent(in) :: gen_tend, ldiag3d, qdiag3d - real(kind=kind_phys), intent(inout), dimension(:,:) :: & - & dt3dt_PBL,du3dt_PBL,dv3dt_PBL,dq3dt_PBL,do3dt_PBL + real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend & + integer, intent(in) :: index_for_temperature,index_for_x_wind, & + & index_for_y_wind, ntqv, ntoz, dtidx(:,:), index_for_cause_pbl ! real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, & & eps,epsm1 @@ -206,6 +208,7 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & real(kind=kind_phys) qlcr, zstblmax ! real(kind=kind_phys) h1 + integer :: idtend !! parameter(wfac=7.0,cfac=4.5) parameter(gamcrt=3.,gamcrq=0.,sfcfrac=0.1) @@ -1400,19 +1403,13 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if (ldiag3d .and. .not. gen_tend) then - do k = 1,km - do i = 1,im - ttend = (f1(i,k)-t1(i,k))*rdt - dt3dt_PBL(i,k) = dt3dt_PBL(i,k) + ttend*delt - enddo - enddo - if (qdiag3d) then - do k = 1,km - do i = 1,im - qtend = (f2(i,k)-q1(i,k,1))*rdt - dq3dt_PBL(i,k) = dq3dt_PBL(i,k) + qtend*delt - enddo - enddo + idtend = dtidx(index_for_temperature,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f1-t1) + endif + idtend = dtidx(100+ntqv,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f2-q1(:,:,1)) endif endif ! @@ -1516,14 +1513,14 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if (ldiag3d .and. .not. gen_tend) then - do k = 1,km - do i = 1,im - utend = (f1(i,k)-u1(i,k))*rdt - vtend = (f2(i,k)-v1(i,k))*rdt - du3dt_PBL(i,k) = du3dt_PBL(i,k) + utend*delt - dv3dt_PBL(i,k) = dv3dt_PBL(i,k) + vtend*delt - enddo - enddo + idtend=dtidx(index_for_x_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f1-u1) + endif + idtend=dtidx(index_for_y_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f2-v1) + endif endif ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/physics/satmedmfvdif.meta b/physics/satmedmfvdif.meta index d860e3310..88a6f7fe9 100644 --- a/physics/satmedmfvdif.meta +++ b/physics/satmedmfvdif.meta @@ -549,50 +549,53 @@ kind = kind_phys intent = in optional = F -[dt3dt_PBL] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F -[du3dt_PBL] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[dv3dt_PBL] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in optional = F -[dq3dt_PBL] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in optional = F -[do3dt_PBL] - standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL - long_name = cumulative change in ozone mixing ratio due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntoz] + standard_name = index_for_ozone + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in optional = F [gen_tend] standard_name = flag_for_generic_planetary_boundary_layer_tendency @@ -610,14 +613,6 @@ type = logical intent = in optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = in - optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/shinhongvdif.meta b/physics/shinhongvdif.meta index 9046c5982..34a18d52d 100644 --- a/physics/shinhongvdif.meta +++ b/physics/shinhongvdif.meta @@ -465,7 +465,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair diff --git a/physics/unified_ugwp.meta b/physics/unified_ugwp.meta index 0f260726d..c39d99ca3 100644 --- a/physics/unified_ugwp.meta +++ b/physics/unified_ugwp.meta @@ -1215,7 +1215,7 @@ type = real kind = kind_phys intent = inout - optional = T + optional = F [dtidx] standard_name = dtend_outer_index long_name = index in outer dimension of dtend of a tracer-cause pair From 3e8d727ce7195029742b06bbc8c9b2c4b219c214 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Thu, 14 Jan 2021 17:36:11 +0000 Subject: [PATCH 03/24] Changes needed to get identical output in debug mode for these tests, with diagnostics turned on: fv3_ccpp_control_prod fv3_ccpp_gfs_v15p2_prod fv3_ccpp_gfs_v16beta_prod fv3_ccpp_gsd_prod --- physics/GFS_suite_interstitial.F90 | 4 +- physics/cires_ugwp.F90 | 12 ++-- physics/cu_gf_driver.F90 | 10 +--- physics/moninedmf.f | 6 +- physics/moninshoc.f | 3 +- physics/ozphys.f | 2 +- physics/phys_tend.F90 | 7 ++- physics/satmedmfvdif.F | 8 +-- physics/satmedmfvdif.meta | 17 ++++++ physics/satmedmfvdifq.F | 82 ++++++++++++------------- physics/satmedmfvdifq.meta | 96 ++++++++++++++++-------------- 11 files changed, 131 insertions(+), 116 deletions(-) diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 2d5efd6ad..c38902595 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -345,7 +345,9 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl idtend = dtidx(index_for_temperature,index_for_cause_shortwave) if(idtend>1) then do k=1,levs - dtend(:,k,idtend) = dtend(:,k,idtend) + htrlw(:,k)*dtf*xmu(:) + do i=1,im + dtend(i,k,idtend) = dtend(i,k,idtend) + htrsw(i,k)*dtf*xmu(i) + enddo enddo endif endif diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 0dbbaf4da..df1e99579 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -287,15 +287,15 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then idtend = dtidx(index_for_x_wind,index_for_cause_orographic_gwd) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt(i,k)*dtp + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif idtend = dtidx(index_for_y_wind,index_for_cause_orographic_gwd) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt(i,k)*dtp + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif idtend = dtidx(index_for_temperature,index_for_cause_orographic_gwd) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt(i,k)*dtp + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif endif @@ -399,15 +399,15 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then idtend = dtidx(index_for_x_wind,index_for_cause_convective_gwd) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dudt(i,k) - Pdudt(i,k))*dtp + dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dudt - Pdudt)*dtp endif idtend = dtidx(index_for_y_wind,index_for_cause_convective_gwd) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dvdt(i,k) - Pdvdt(i,k))*dtp + dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dvdt - Pdvdt)*dtp endif idtend = dtidx(index_for_temperature,index_for_cause_convective_gwd) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dtdt(i,k) - Pdtdt(i,k))*dtp + dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dtdt - Pdtdt)*dtp endif endif diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 3f9cb131a..4bfe0cbcd 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -99,7 +99,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & logical, intent(in ) :: ldiag3d ! dtend is only allocated if ldiag=.true. - real(kind=kind_phys), optional, intent(in) :: dtend(:,:,:) + real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), & index_for_x_wind, index_for_y_wind, index_for_temperature, & index_for_cause_scnv, index_for_cause_dcnv, ntqv @@ -113,10 +113,6 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & real(kind=kind_phys), dimension( im , km ), intent(out ) :: cnvw_moist,cnvc real(kind=kind_phys), dimension( im , km ), intent(inout ) :: cliw, clcw - real(kind=kind_phys), dimension( : , : ), intent(inout ) :: & - du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & - du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV - integer, dimension (im), intent(inout) :: hbot,htop,kcnv integer, dimension (im), intent(in) :: xland real(kind=kind_phys), dimension (im), intent(in) :: pbl @@ -870,7 +866,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & if(ldiag3d) then if(ishallow_g3.eq.1 .and. .not.flag_for_scnv_generic_tend) then uidx=dtidx(index_for_x_wind,index_for_cause_scnv) - vidx=dtidx(index_for_v_wind,index_for_cause_scnv) + vidx=dtidx(index_for_y_wind,index_for_cause_scnv) tidx=dtidx(index_for_temperature,index_for_cause_scnv) qidx=dtidx(100+ntqv,index_for_cause_scnv) if(uidx>1) then @@ -900,7 +896,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & endif if((ideep.eq.1. .or. imid_gf.eq.1) .and. .not.flag_for_dcnv_generic_tend) then uidx=dtidx(index_for_x_wind,index_for_cause_dcnv) - vidx=dtidx(index_for_v_wind,index_for_cause_dcnv) + vidx=dtidx(index_for_y_wind,index_for_cause_dcnv) tidx=dtidx(index_for_temperature,index_for_cause_dcnv) qidx=dtidx(100+ntqv,index_for_cause_dcnv) if(uidx>1) then diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 8622eb3c1..bd52544ba 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -1282,7 +1282,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! recover tendencies of heat and moisture ! !> After returning with the solution, the tendencies for temperature and moisture are recovered. - if(flag_for_pbl_generic_tend) then + if(.not.flag_for_pbl_generic_tend) then idtend1=dtidx(index_for_temperature,index_for_cause_pbl) idtend2=dtidx(ntqv+100,index_for_cause_pbl) endif @@ -1312,7 +1312,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo enddo enddo - if(flag_for_pbl_generic_tend) then + if(.not.flag_for_pbl_generic_tend) then idtend1 = dtidx(100+ntoz,index_for_cause_pbl) if(idtend1>1) then kk = ntoz @@ -1424,7 +1424,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! recover tendencies of momentum ! !> Finally, the tendencies are recovered from the tridiagonal solutions. - if(flag_for_pbl_generic_tend) then + if(.not.flag_for_pbl_generic_tend) then idtend1 = dtidx(index_for_x_wind,index_for_cause_pbl) idtend2 = dtidx(index_for_y_wind,index_for_cause_pbl) endif diff --git a/physics/moninshoc.f b/physics/moninshoc.f index b0d3f51a7..c92dc460f 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -62,9 +62,8 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, & tau real(kind=kind_phys), dimension(im,km,ntrac), intent(inout) :: rtg - real(kind=kind_phys), intent(inout) :: real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend - integer, dimension(:,:,:), intent(in) :: dtidx + integer, dimension(:,:), intent(in) :: dtidx integer, intent(in) :: index_for_temperature, index_for_x_wind, & index_for_y_wind, index_for_cause_pbl, ntqv logical, intent(in) :: ldiag3d, diff --git a/physics/ozphys.f b/physics/ozphys.f index 708358efe..551b89da0 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -93,7 +93,7 @@ subroutine ozphys_run ( & if(ldiag3d) then - idtend(1) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp1 + idtend(1) = dtidx(100+ntoz,index_for_cause_prod_loss) ! was ozp1 idtend(2) = dtidx(100+ntoz,index_for_cause_ozmix) ! was ozp2 idtend(3) = dtidx(100+ntoz,index_for_cause_temp) ! was ozp3 idtend(4) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp4 diff --git a/physics/phys_tend.F90 b/physics/phys_tend.F90 index 98d76e104..e05b52416 100644 --- a/physics/phys_tend.F90 +++ b/physics/phys_tend.F90 @@ -25,8 +25,9 @@ subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & ! Interface variables logical, intent(in) :: ldiag3d - real(kind=kind_phys), optional, intent(inout) :: dtend - integer, intent(in) :: dtidx(:,:), index_for_cause_physics, index_for_cause_non_physics, ntracp100 + real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), index_for_cause_physics, & + index_for_cause_non_physics, ntracp100, ncause character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -49,7 +50,7 @@ subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & endif do icause=1,ncause if(icause==index_for_cause_physics .or. & - icuase==index_for_cause_non_physics) then + icause==index_for_cause_non_physics) then cycle ! Don't sum up the sums. endif idtend = dtidx(itrac,icause) diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index 812984b68..c7acf9553 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -62,7 +62,7 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & & dspheat,dusfc,dvsfc,dtsfc,dqsfc,hpbl, & & kinver,xkzm_m,xkzm_h,xkzm_s, & & index_for_temperature,index_for_x_wind,index_for_y_wind, & - & index_for_cause_pbl,ntqv,ntoz,dtidx, & + & index_for_cause_pbl,ntqv,ntoz,dtend,dtidx, & & gen_tend,ldiag3d,errmsg,errflg) ! use machine , only : kind_phys @@ -75,8 +75,8 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & integer, intent(in) :: kinver(im) integer, intent(out) :: kpbl(im) ! - logical, intent(in) :: gen_tend, ldiag3d, qdiag3d - real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend & + logical, intent(in) :: gen_tend, ldiag3d + real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend integer, intent(in) :: index_for_temperature,index_for_x_wind, & & index_for_y_wind, ntqv, ntoz, dtidx(:,:), index_for_cause_pbl ! @@ -1409,7 +1409,7 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & endif idtend = dtidx(100+ntqv,index_for_cause_pbl) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f2-q1(:,:,1)) + dtend(:,:,idtend) = dtend(:,:,idtend) +delt*rdt*(f2-q1(:,:,1)) endif endif ! diff --git a/physics/satmedmfvdif.meta b/physics/satmedmfvdif.meta index 88a6f7fe9..52ea8c4ff 100644 --- a/physics/satmedmfvdif.meta +++ b/physics/satmedmfvdif.meta @@ -549,6 +549,23 @@ kind = kind_phys intent = in optional = F +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + type = real + kind = kind_phys + intent = in + optional = F +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F [index_for_temperature] standard_name = index_for_temperature long_name = index in dtidx first dimension of temperature field diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 63a67c810..ae4f04c8e 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -65,7 +65,8 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & & prsi,del,prsl,prslk,phii,phil,delt, & & dspheat,dusfc,dvsfc,dtsfc,dqsfc,hpbl, & & kinver,xkzm_m,xkzm_h,xkzm_s,dspfac,bl_upfr,bl_dnfr, & - & ntoz,du3dt,dv3dt,dt3dt,dq3dt,do3dt,gen_tend,ldiag3d,qdiag3d, & + & ntoz,ntqv,dtend,dtidx,index_for_temperature,index_for_x_wind,& + & index_for_y_wind,index_for_cause_pbl,gen_tend,ldiag3d, & & errmsg,errflg) ! use machine , only : kind_phys @@ -74,11 +75,11 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & implicit none ! !---------------------------------------------------------------------- - integer, intent(in) :: im, km, ntrac, ntcw, ntiw, ntke, ntoz + integer, intent(in) :: im, km, ntrac, ntcw, ntiw, ntke, ntoz,ntqv integer, intent(in) :: kinver(im) integer, intent(in) :: islimsk(im) integer, intent(out) :: kpbl(im) - logical, intent(in) :: gen_tend,ldiag3d,qdiag3d + logical, intent(in) :: gen_tend,ldiag3d ! real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, & & eps,epsm1 @@ -101,10 +102,10 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & & prsi(im,km+1), del(im,km), & & prsl(im,km), prslk(im,km), & & phii(im,km+1), phil(im,km) - real(kind=kind_phys), intent(inout), dimension(:,:) :: & - & du3dt(:,:), dv3dt(:,:), & - & dt3dt(:,:), dq3dt(:,:), & - & do3dt(:,:) + real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend + integer, intent(in) :: dtidx(:,:), index_for_temperature, index_f & + & or_x_wind, index_for_y_wind, index_for_cause & + & _pbl real(kind=kind_phys), intent(out) :: & & dusfc(im), dvsfc(im), & & dtsfc(im), dqsfc(im), & @@ -120,7 +121,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & !*** !*** local variables !*** - integer i,is,k,kk,n,ndt,km1,kmpbl,kmscu,ntrac1 + integer i,is,k,kk,n,ndt,km1,kmpbl,kmscu,ntrac1,idtend integer lcld(im),kcld(im),krad(im),mrad(im) integer kx1(im), kpblx(im) ! @@ -1422,19 +1423,13 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if(ldiag3d .and. .not. gen_tend) then - do k = 1,km - do i = 1,im - ttend = (f1(i,k)-t1(i,k))*rdt - dt3dt(i,k) = dt3dt(i,k)+ttend*delt - enddo - enddo - if(qdiag3d) then - do k = 1,km - do i = 1,im - qtend = (f2(i,k)-q1(i,k,1))*rdt - dq3dt(i,k) = dq3dt(i,k)+qtend*delt - enddo - enddo + idtend=dtidx(index_for_temperature,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f1-t1) + endif + idtend=dtidx(100+ntqv,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) +delt*rdt*(f2-q1(:,:,1)) endif endif ! @@ -1448,15 +1443,18 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo enddo - if(ldiag3d .and. .not. gen_tend .and. qdiag3d .and. ntoz>0) then - kk=ntoz - is = (kk-1) * km - do k = 1, km - do i = 1, im - qtend = (f2(i,k+is)-q1(i,k,kk))*rdt - do3dt(i,k) = do3dt(i,k)+qtend*delt + if(ldiag3d .and. .not. gen_tend .and. ntoz>0) then + idtend=dtidx(ntoz+100,index_for_cause_pbl) + if(idtend>1) then + kk=ntoz + is = (kk-1) * km + do k = 1, km + do i = 1, im + qtend = (f2(i,k+is)-q1(i,k,kk))*rdt + dtend(i,k,idtend) = dtend(i,k,idtend)+qtend*delt + enddo enddo - enddo + endif endif endif ! @@ -1472,12 +1470,10 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if(ldiag3d .and. .not. gen_tend) then - do k = 1,km1 - do i = 1,im - ttend = diss(i,k) / cp - dt3dt(i,k) = dt3dt(i,k)+dspfac * ttend*delt - enddo - enddo + idtend=dtidx(ntqv+100,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + delt*dspfac*diss/cp + endif endif endif c @@ -1556,14 +1552,14 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if(ldiag3d .and. .not. gen_tend) then - do k = 1,km - do i = 1,im - utend = (f1(i,k)-u1(i,k))*rdt - vtend = (f2(i,k)-v1(i,k))*rdt - du3dt(i,k) = du3dt(i,k) + utend*delt - dv3dt(i,k) = dv3dt(i,k) + vtend*delt - enddo - enddo + idtend=dtidx(index_for_x_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend)=dtend(:,:,idtend)+delt*rdt*(f1-u1) + endif + idtend=dtidx(index_for_y_wind,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend)=dtend(:,:,idtend)+delt*rdt*(f2-v1) + endif endif ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/physics/satmedmfvdifq.meta b/physics/satmedmfvdifq.meta index a57ce3839..ee98d6494 100644 --- a/physics/satmedmfvdifq.meta +++ b/physics/satmedmfvdifq.meta @@ -601,50 +601,62 @@ type = integer intent = in optional = F -[du3dt] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in optional = F -[dv3dt] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) type = real kind = kind_phys - intent = inout + intent = in optional = F -[dt3dt] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in optional = F -[dq3dt] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_temperature] + standard_name = index_for_temperature + long_name = index in dtidx first dimension of temperature field + units = index + dimensions = () + type = integer + intent = in optional = F -[do3dt] - standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL - long_name = cumulative change in ozone mixing ratio due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_for_x_wind] + standard_name = index_for_x_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_y_wind] + standard_name = index_for_y_wind + long_name = index in dtidx first dimension of x wind field + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_for_cause_pbl] + standard_name = index_for_cause_pbl + long_name = tracer changes caused by PBL scheme + units = index + dimensions = () + type = integer + intent = in optional = F [gen_tend] standard_name = flag_for_generic_planetary_boundary_layer_tendency @@ -662,14 +674,6 @@ type = logical intent = inout optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = inout - optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 5c3a521913b37f3c2ff9fd0565dba879816eabe4 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Fri, 15 Jan 2021 17:37:45 +0000 Subject: [PATCH 04/24] Changes needed for new 3d diagnostic tendency arrays in some schemes. --- physics/cu_gf_driver.F90 | 8 +++---- physics/module_MYNNPBL_wrapper.F90 | 6 ++--- physics/ozphys_2015.f | 10 ++++---- physics/satmedmfvdifq.F | 38 +++++++++++++++++++++++++----- 4 files changed, 44 insertions(+), 18 deletions(-) diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 4bfe0cbcd..1b323c553 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -881,7 +881,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & endif if(tidx>1) then do k=kts,ktf - dtend(:,k,tidx) = dtend(:,k,tidx) + cutens(i)*outts(i,k) * dt + dtend(:,k,tidx) = dtend(:,k,tidx) + cutens(:)*outts(:,k) * dt enddo endif if(qidx>1) then @@ -901,17 +901,17 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & qidx=dtidx(100+ntqv,index_for_cause_dcnv) if(uidx>1) then do k=kts,ktf - dtend(:,k,uidx) = dtend(:,k,uidx) + (cuten(i)*outu(i,k)+cutenm(i)*outum(i,k)) * dt + dtend(:,k,uidx) = dtend(:,k,uidx) + (cuten*outu(:,k)+cutenm*outum(:,k)) * dt enddo endif if(vidx>1) then do k=kts,ktf - dtend(:,k,vidx) = dtend(:,k,vidx) + (cuten(i)*outv(i,k)+cutenm(i)*outvm(i,k)) * dt + dtend(:,k,vidx) = dtend(:,k,vidx) + (cuten*outv(:,k)+cutenm*outvm(:,k)) * dt enddo endif if(tidx>1) then do k=kts,ktf - dtend(:,k,tidx) = dtend(:,k,tidx) + (cuten(i)*outt(i,k)+cutenm(i)*outtm(i,k)) * dt + dtend(:,k,tidx) = dtend(:,k,tidx) + (cuten*outt(:,k)+cutenm*outtm(:,k)) * dt enddo endif if(qidx>1) then diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 268c7e787..538274249 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -707,15 +707,15 @@ SUBROUTINE mynnedmf_wrapper_run( & accum_duvt3dt: if(lssav) then if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then idtend=dtidx(index_for_x_wind,index_for_cause_pbl) - if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RUBLTEN(i,k)*dtf + if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RUBLTEN*dtf idtend=dtidx(index_for_y_wind,index_for_cause_pbl) - if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RVBLTEN(i,k)*dtf + if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RVBLTEN*dtf endif if (lsidea .or. (ldiag3d .and. .not. flag_for_pbl_generic_tend)) then idtend=dtidx(index_for_temperature,index_for_cause_pbl) - if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RTHBLTEN(i,k)*exner(i,k)*dtf + if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RTHBLTEN*exner*dtf endif endif accum_duvt3dt !Update T, U and V: diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index 5bec3c9cd..f4561c769 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -88,7 +88,7 @@ subroutine ozphys_2015_run ( & errflg = 0 if(ldiag3d) then - idtend(1) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp1 + idtend(1) = dtidx(100+ntoz,index_for_cause_prod_loss) ! was ozp1 idtend(2) = dtidx(100+ntoz,index_for_cause_ozmix) ! was ozp2 idtend(3) = dtidx(100+ntoz,index_for_cause_temp) ! was ozp3 idtend(4) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp4 @@ -171,19 +171,19 @@ subroutine ozphys_2015_run ( & enddo if(idtend(1)>1) then dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 - & (prod(i,1)-prod(i,2)*prod(i,6))*dt + & (prod(:,1)-prod(:,2)*prod(:,6))*dt endif if(idtend(2)>1) then dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 - & (oz(i,l) - ozib(i)) + & (oz(:,l) - ozib(:)) endif if(idtend(3)>1) then dtend(:,l,idtend(3)) = dtend(:,l,idtend(3)) + ! was ozp3 - & prod(i,3)*(tin(i,l)-prod(i,5))*dt + & prod(:,3)*(tin(:,l)-prod(:,5))*dt endif if(idtend(4)>1) then dtend(:,l,idtend(4)) = dtend(:,l,idtend(4)) + ! was ozp4 - & prod(i,4) * (colo3(i,l)-coloz(i,l))*dt + & prod(:,4) * (colo3(:,l)-coloz(:,l))*dt endif enddo ! vertical loop ! diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index ae4f04c8e..8092a0df4 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -1425,11 +1425,21 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & if(ldiag3d .and. .not. gen_tend) then idtend=dtidx(index_for_temperature,index_for_cause_pbl) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f1-t1) + do k = 1,km + do i = 1,im + ttend = (f1(i,k)-t1(i,k))*rdt + dtend(i,k,idtend) = dtend(i,k,idtend)+ttend*delt + enddo + enddo endif idtend=dtidx(100+ntqv,index_for_cause_pbl) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) +delt*rdt*(f2-q1(:,:,1)) + do k = 1,km + do i = 1,im + qtend = (f2(i,k)-q1(i,k,1))*rdt + dtend(i,k,idtend) = dtend(i,k,idtend)+qtend*delt + enddo + enddo endif endif ! @@ -1470,9 +1480,14 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if(ldiag3d .and. .not. gen_tend) then - idtend=dtidx(ntqv+100,index_for_cause_pbl) + idtend=dtidx(index_for_temperature,index_for_cause_pbl) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + delt*dspfac*diss/cp + do k = 1,km1 + do i = 1,im + ttend = diss(i,k) / cp + dtend(i,k,idtend) = dtend(i,k,idtend)+dspfac*ttend*delt + enddo + enddo endif endif endif @@ -1554,11 +1569,22 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & if(ldiag3d .and. .not. gen_tend) then idtend=dtidx(index_for_x_wind,index_for_cause_pbl) if(idtend>1) then - dtend(:,:,idtend)=dtend(:,:,idtend)+delt*rdt*(f1-u1) + do k = 1,km + do i = 1,im + utend = (f1(i,k)-u1(i,k))*rdt + dtend(i,k,idtend) = dtend(i,k,idtend) + utend*delt + enddo + enddo endif + idtend=dtidx(index_for_y_wind,index_for_cause_pbl) if(idtend>1) then - dtend(:,:,idtend)=dtend(:,:,idtend)+delt*rdt*(f2-v1) + do k = 1,km + do i = 1,im + vtend = (f2(i,k)-v1(i,k))*rdt + dtend(i,k,idtend) = dtend(i,k,idtend) + vtend*delt + enddo + enddo endif endif ! From 127d7e4eececd8c5a795f048b8a26ec2b1138fcb Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 22 Jan 2021 17:33:31 +0000 Subject: [PATCH 05/24] Five suites output nearly all of the tendencies for convection, PBL, microphysics, total physics, and total non-physics, along with all other variables that previously worked. The TKE is being stubborn and the fv3_control does not want to report total physics tendency for liq_wat tracer. --- physics/GFS_DCNV_generic.F90 | 62 +++++++++++------- physics/GFS_DCNV_generic.meta | 94 +++++++++++++++++++-------- physics/GFS_SCNV_generic.F90 | 60 ++++++++++------- physics/GFS_SCNV_generic.meta | 74 ++++++++++++++++----- physics/cu_gf_driver.F90 | 72 +++++++++++++++++++-- physics/cu_gf_driver.meta | 16 +++++ physics/module_MYNNPBL_wrapper.F90 | 99 +++++++++++++++++++++-------- physics/module_MYNNPBL_wrapper.meta | 80 ++++++++++++++++++++--- physics/moninedmf.f | 11 ++-- physics/satmedmfvdifq.F | 11 ++-- 10 files changed, 443 insertions(+), 136 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index fbadc38f5..7b9ff1a9a 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -15,32 +15,32 @@ end subroutine GFS_DCNV_generic_pre_finalize !! \section arg_table_GFS_DCNV_generic_pre_run Argument Table !! \htmlinclude GFS_DCNV_generic_pre_run.html !! - subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplchm,& - gu0, gv0, gt0, gq0_water_vapor, & - save_u, save_v, save_t, save_qv, dqdti, & - errmsg, errflg) + subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplchm, & + gu0, gv0, gt0, gq0, nsamftrac, ntqv, & + save_u, save_v, save_t, save_q, dqdti, & + dtidx, index_for_cause_dcnv, errmsg, errflg) use machine, only: kind_phys implicit none - integer, intent(in) :: im, levs + integer, intent(in) :: im, levs, nsamftrac, ntqv, index_for_cause_dcnv, dtidx(:,:) logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0 real(kind=kind_phys), dimension(im,levs), intent(in) :: gv0 real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0 - real(kind=kind_phys), dimension(im,levs), intent(inout) :: gq0_water_vapor + real(kind=kind_phys), dimension(:,:,:), intent(inout) :: gq0 real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_v real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_t - real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_qv + real(kind=kind_phys), dimension(:,:,:), intent(inout) :: save_q ! dqdti only allocated if cplchm is .true. real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg real(kind=kind_phys), parameter :: zero = 0.0d0 - integer :: i, k + integer :: i, k, n ! Initialize CCPP error handling variables errmsg = '' @@ -63,11 +63,19 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc endif if ((ldiag3d.and.qdiag3d) .or. cplchm) then - do k=1,levs - do i=1,im - save_qv(i,k) = gq0_water_vapor(i,k) + if(nsamftrac>0) then + do n=1,nsamftrac + if(n==ntqv .or. dtidx(n+100,index_for_cause_dcnv)) then + save_q(:,:,n) = gq0(:,:,n) + endif enddo - enddo + else + do k=1,levs + do i=1,im + save_q(i,k,ntqv) = gq0(i,k,ntqv) + enddo + enddo + endif endif if (cplchm) then @@ -92,10 +100,10 @@ end subroutine GFS_DCNV_generic_post_finalize !! \htmlinclude GFS_DCNV_generic_post_run.html !! subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & - frain, rain1, dtf, cld1d, save_u, save_v, save_t, save_qv, gu0, gv0, gt0, & - gq0_water_vapor, ud_mf, dd_mf, dt_mf, con_g, npdf3d, num_p3d, ncnvcld3d, & + frain, rain1, dtf, cld1d, save_u, save_v, save_t, gu0, gv0, gt0, & + ud_mf, dd_mf, dt_mf, con_g, npdf3d, num_p3d, ncnvcld3d, nsamftrac, & rainc, cldwrk, upd_mf, dwn_mf, det_mf, dtend, dtidx, index_for_cause_dcnv, & - index_for_temperature, index_for_x_wind, index_for_y_wind, ntqv, & + index_for_temperature, index_for_x_wind, index_for_y_wind, ntqv, gq0, save_q, & cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, flag_for_dcnv_generic_tend, errmsg, errflg) @@ -103,14 +111,15 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & implicit none - integer, intent(in) :: im, levs + integer, intent(in) :: im, levs, nsamftrac logical, intent(in) :: lssav, ldiag3d, ras, cscnv logical, intent(in) :: flag_for_dcnv_generic_tend real(kind=kind_phys), intent(in) :: frain, dtf real(kind=kind_phys), dimension(im), intent(in) :: rain1, cld1d - real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t, save_qv - real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor + real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t + real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0 + real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0, save_q real(kind=kind_phys), dimension(im,levs), intent(in) :: ud_mf, dd_mf, dt_mf real(kind=kind_phys), intent(in) :: con_g integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d @@ -133,7 +142,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k, idtend + integer :: i, k, n, idtend ! Initialize CCPP error handling variables errmsg = '' @@ -184,9 +193,18 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0-save_v)*frain endif - idtend=dtidx(100+ntqv,index_for_cause_dcnv) - if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0_water_vapor-save_qv)*frain + if(nsamftrac>0) then + do n=1,nsamftrac + idtend=dtidx(100+n,index_for_cause_dcnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n)-save_q(:,:,n))*frain + endif + enddo + else + idtend=dtidx(100+ntqv,index_for_cause_dcnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv)-save_q(:,:,ntqv))*frain + endif endif endif ! if (ldiag3d) diff --git a/physics/GFS_DCNV_generic.meta b/physics/GFS_DCNV_generic.meta index 7da6d659f..e49c8ff73 100644 --- a/physics/GFS_DCNV_generic.meta +++ b/physics/GFS_DCNV_generic.meta @@ -82,15 +82,31 @@ kind = kind_phys intent = in optional = F -[gq0_water_vapor] - standard_name = water_vapor_specific_humidity_updated_by_physics - long_name = water vapor specific humidity updated by physics +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) type = real kind = kind_phys intent = inout optional = F +[nsamftrac] + standard_name = number_of_tracers_for_samf + long_name = number of tracers for scale-aware mass flux schemes + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in + optional = F [save_u] standard_name = x_wind_save long_name = x-wind before entering a physics scheme @@ -118,14 +134,14 @@ kind = kind_phys intent = inout optional = F -[save_qv] - standard_name = water_vapor_specific_humidity_save - long_name = water vapor specific humidity before entering a physics scheme +[save_q] + standard_name = tracer_concentration_save + long_name = tracer concentration before entering a physics scheme units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) type = real kind = kind_phys - intent = inout + intent = in optional = F [dqdti] standard_name = instantaneous_water_vapor_specific_humidity_tendency_due_to_convection @@ -136,6 +152,22 @@ kind = kind_phys intent = inout optional = F +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F +[index_for_cause_dcnv] + standard_name = index_for_cause_dcnv + long_name = tracer changes caused by deep convection scheme + units = index + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -275,15 +307,6 @@ kind = kind_phys intent = in optional = F -[save_qv] - standard_name = water_vapor_specific_humidity_save - long_name = water vapor specific humidity before entering a physics scheme - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F [gu0] standard_name = x_wind_updated_by_physics long_name = zonal wind updated by physics @@ -311,15 +334,6 @@ kind = kind_phys intent = in optional = F -[gq0_water_vapor] - standard_name = water_vapor_specific_humidity_updated_by_physics - long_name = water vapor specific humidity updated by physics - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt @@ -404,6 +418,24 @@ type = integer intent = in optional = F +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[save_q] + standard_name = tracer_concentration_save + long_name = tracer concentration before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F [con_g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -437,6 +469,14 @@ type = integer intent = in optional = F +[nsamftrac] + standard_name = number_of_tracers_for_samf + long_name = number of tracers for scale-aware mass flux schemes + units = count + dimensions = () + type = integer + intent = in + optional = F [rainc] standard_name = lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep long_name = convective rain at this time step diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index b60ade9bc..22897c1c4 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -14,22 +14,24 @@ end subroutine GFS_SCNV_generic_pre_finalize !> \section arg_table_GFS_SCNV_generic_pre_run Argument Table !! \htmlinclude GFS_SCNV_generic_pre_run.html !! - subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, gq0_water_vapor, & - save_u, save_v, save_t, save_qv, flag_for_scnv_generic_tend, errmsg, errflg) + subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, gq0, & + save_u, save_v, save_t, save_q, ntqv, nsamftrac, flag_for_scnv_generic_tend, & + dtidx, index_for_cause_scnv, errmsg, errflg) use machine, only: kind_phys implicit none - integer, intent(in) :: im, levs + integer, intent(in) :: im, levs, ntqv, nsamftrac, index_for_cause_scnv, dtidx(:,:) logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend - real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor - - real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u, save_v, save_t, save_qv + real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0 + real(kind=kind_phys), intent(in) :: gq0(:,:,:) + real(kind=kind_phys), intent(inout) :: save_q(:,:,:) + real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u, save_v, save_t character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k + integer :: i, k, n ! Initialize CCPP error handling variables errmsg = '' @@ -44,11 +46,15 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, enddo enddo if (qdiag3d) then - do k=1,levs - do i=1,im - save_qv(i,k) = gq0_water_vapor(i,k) - enddo - enddo + if(nsamftrac>0) then + do n=1,nsamftrac + if(n==ntqv .or. dtidx(ntqv,index_for_cause_scnv)>1) then + save_q(:,:,n) = gq0(:,:,n) + endif + enddo + else + save_q(:,:,ntqv) = gq0(:,:,ntqv) + endif endif endif @@ -71,8 +77,8 @@ end subroutine GFS_SCNV_generic_post_finalize !! \htmlinclude GFS_SCNV_generic_post_run.html !! subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cplchm, & - frain, gu0, gv0, gt0, gq0_water_vapor, save_u, save_v, save_t, save_qv, dqdti, clw, & - shcnvcw, rain1, npdf3d, num_p3d, ncnvcld3d, cnvc, cnvw, & + frain, gu0, gv0, gt0, gq0, save_u, save_v, save_t, save_q, dqdti, clw, & + shcnvcw, rain1, npdf3d, num_p3d, ncnvcld3d, cnvc, cnvw, nsamftrac, & rainc, cnvprcp, cnvprcpb, cnvw_phy_f3d, cnvc_phy_f3d, & dtend, dtidx, index_for_temperature, index_for_x_wind, index_for_y_wind, & index_for_cause_scnv, ntqv, flag_for_scnv_generic_tend, & @@ -82,11 +88,12 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl implicit none - integer, intent(in) :: im, levs, nn, ntqv + integer, intent(in) :: im, levs, nn, ntqv, nsamftrac logical, intent(in) :: lssav, ldiag3d, qdiag3d, cplchm, flag_for_scnv_generic_tend real(kind=kind_phys), intent(in) :: frain - real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor - real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t, save_qv + real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0 + real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t + real(kind=kind_phys), dimension(:,:,:), intent(in) :: save_q, gq0 ! dtend only allocated if ldiag3d == .true. real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti @@ -111,7 +118,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k, idtend + integer :: i, k, n, idtend real(kind=kind_phys) :: tem ! Initialize CCPP error handling variables @@ -156,9 +163,18 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0 - save_v) * frain endif - idtend = dtidx(100+ntqv, index_for_cause_scnv) - if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0_water_vapor - save_qv) * frain + if(nsamftrac>0) then + do n=1,nsamftrac + idtend = dtidx(100+n, index_for_cause_scnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n) - save_q(:,:,n)) * frain + endif + enddo + else + idtend = dtidx(100+ntqv, index_for_cause_scnv) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv) - save_q(:,:,ntqv)) * frain + endif endif endif endif @@ -166,7 +182,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl if (cplchm) then do k=1,levs do i=1,im - tem = (gq0_water_vapor(i,k)-save_qv(i,k)) * frain + tem = (gq0(i,k,ntqv)-save_q(i,k,ntqv)) * frain dqdti(i,k) = dqdti(i,k) + tem enddo enddo diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta index 5fec5247b..9076e6050 100644 --- a/physics/GFS_SCNV_generic.meta +++ b/physics/GFS_SCNV_generic.meta @@ -66,11 +66,11 @@ kind = kind_phys intent = in optional = F -[gq0_water_vapor] - standard_name = water_vapor_specific_humidity_updated_by_physics - long_name = water vapor specific humidity updated by physics +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) type = real kind = kind_phys intent = in @@ -102,14 +102,30 @@ kind = kind_phys intent = out optional = F -[save_qv] - standard_name = water_vapor_specific_humidity_save - long_name = water vapor specific humidity before entering a physics scheme +[save_q] + standard_name = tracer_concentration_save + long_name = tracer concentration before entering a physics scheme units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) type = real kind = kind_phys - intent = out + intent = in + optional = F +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in + optional = F +[nsamftrac] + standard_name = number_of_tracers_for_samf + long_name = number of tracers for scale-aware mass flux schemes + units = count + dimensions = () + type = integer + intent = in optional = F [flag_for_scnv_generic_tend] standard_name = flag_for_generic_shallow_convection_tendency @@ -119,6 +135,22 @@ type = logical intent = in optional = F +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F +[index_for_cause_scnv] + standard_name = index_for_cause_scnv + long_name = tracer changes caused by shallow convection scheme + units = index + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -239,11 +271,11 @@ kind = kind_phys intent = in optional = F -[gq0_water_vapor] - standard_name = water_vapor_specific_humidity_updated_by_physics - long_name = water vapor specific humidity updated by physics +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) type = real kind = kind_phys intent = in @@ -275,11 +307,11 @@ kind = kind_phys intent = in optional = F -[save_qv] - standard_name = water_vapor_specific_humidity_save - long_name = water vapor specific humidity before entering a physics scheme +[save_q] + standard_name = tracer_concentration_save + long_name = tracer concentration before entering a physics scheme units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) type = real kind = kind_phys intent = in @@ -418,6 +450,14 @@ kind = kind_phys intent = in optional = F +[nsamftrac] + standard_name = number_of_tracers_for_samf + long_name = number of tracers for scale-aware mass flux schemes + units = count + dimensions = () + type = integer + intent = in + optional = F [rainc] standard_name = lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep long_name = convective rain at this time step diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 1b323c553..5d34a8bc0 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -71,7 +71,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend, & ! fixme: delete ! du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & ! du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV, & - dtend,dtidx,ntqv,index_for_temperature,index_for_x_wind, & + dtend,dtidx,ntqv,ntiw,ntcw,index_for_temperature,index_for_x_wind,& index_for_y_wind,index_for_cause_scnv,index_for_cause_dcnv, & ldiag3d,qci_conv,errmsg,errflg) !------------------------------------------------------------- @@ -102,7 +102,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), & index_for_x_wind, index_for_y_wind, index_for_temperature, & - index_for_cause_scnv, index_for_cause_dcnv, ntqv + index_for_cause_scnv, index_for_cause_dcnv, ntqv, ntcw, ntiw real(kind=kind_phys), dimension( im , km ), intent(in ) :: forcet,forceqv_spechum,w,phil real(kind=kind_phys), dimension( im , km ), intent(inout ) :: t,us,vs @@ -113,6 +113,8 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & real(kind=kind_phys), dimension( im , km ), intent(out ) :: cnvw_moist,cnvc real(kind=kind_phys), dimension( im , km ), intent(inout ) :: cliw, clcw + real(kind=kind_phys), allocatable :: clcw_save(:,:), cliw_save(:,:) + integer, dimension (im), intent(inout) :: hbot,htop,kcnv integer, dimension (im), intent(in) :: xland real(kind=kind_phys), dimension (im), intent(in) :: pbl @@ -173,7 +175,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & real(kind=kind_phys), dimension (im) :: xmbs,xmbs2,xmb,xmbm,xmb_dumm,mconv integer :: i,j,k,icldck,ipr,jpr,jpr_deep,ipr_deep,uidx,vidx,tidx,qidx - integer :: itf,jtf,ktf,iss,jss,nbegin,nend + integer :: itf,jtf,ktf,iss,jss,nbegin,nend,cliw_idx,clcw_idx integer :: high_resolution real(kind=kind_phys) :: clwtot,clwtot1,excess,tcrit,tscl_kf,dp,dq,sub_spread,subcenter real(kind=kind_phys) :: dsubclw,dsubclws,dsubclwm,dtime_max,ztm,ztq,hfm,qfm,rkbcon,rktop @@ -188,6 +190,9 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & ! gf needs them in w/m2. define hfx and qfx after simple unit conversion real(kind=kind_phys), dimension (im) :: hfx,qfx real(kind=kind_phys) tem,tem1,tf,tcr,tcrf + real(kind=kind_phys) :: cliw_shal,clcw_shal,tem_shal, cliw_both, weight_sum + real(kind=kind_phys) :: cliw_deep,clcw_deep,tem_deep, clcw_both + integer :: cliw_deep_idx, clcw_deep_idx, cliw_shal_idx, clcw_shal_idx !parameter (tf=243.16, tcr=270.16, tcrf=1.0/(tcr-tf)) ! FV3 original !parameter (tf=263.16, tcr=273.16, tcrf=1.0/(tcr-tf)) @@ -196,6 +201,30 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & ! initialize ccpp error handling variables errmsg = '' errflg = 0 + + if(ldiag3d) then + if(flag_for_dcnv_generic_tend) then + cliw_deep_idx=1 + clcw_deep_idx=1 + else + cliw_deep_idx=dtidx(100+ntiw,index_for_cause_dcnv) + clcw_deep_idx=dtidx(100+ntcw,index_for_cause_dcnv) + endif + if(flag_for_scnv_generic_tend) then + cliw_shal_idx=1 + clcw_shal_idx=1 + else + cliw_shal_idx=dtidx(100+ntiw,index_for_cause_scnv) + clcw_shal_idx=dtidx(100+ntcw,index_for_cause_scnv) + endif + if(cliw_deep_idx>1 .or. clcw_deep_idx>1 .or. & + cliw_shal_idx>1 .or. clcw_shal_idx>1) then + allocate(clcw_save(im,km), cliw_save(im,km)) + clcw_save=clcw + cliw_save=cliw + endif + endif + ! ! Scale specific humidity to dry mixing ratio ! @@ -898,7 +927,6 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & uidx=dtidx(index_for_x_wind,index_for_cause_dcnv) vidx=dtidx(index_for_y_wind,index_for_cause_dcnv) tidx=dtidx(index_for_temperature,index_for_cause_dcnv) - qidx=dtidx(100+ntqv,index_for_cause_dcnv) if(uidx>1) then do k=kts,ktf dtend(:,k,uidx) = dtend(:,k,uidx) + (cuten*outu(:,k)+cutenm*outum(:,k)) * dt @@ -914,6 +942,8 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & dtend(:,k,tidx) = dtend(:,k,tidx) + (cuten*outt(:,k)+cutenm*outtm(:,k)) * dt enddo endif + + qidx=dtidx(100+ntqv,index_for_cause_dcnv) if(qidx>1) then do k=kts,ktf do i=its,itf @@ -924,6 +954,40 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & enddo endif endif + if(allocated(clcw_save)) then + do k=kts,ktf + do i=its,itf + tem_shal = dt*(outqcs(i,k)*cutens(i)+outqcm(i,k)*cutenm(i)) + tem_deep = dt*(outqc(i,k)*cuten(i)+clw_ten1(k)) + tem = tem_shal+tem_deep + tem1 = max(0.0, min(1.0, (tcr-t(i,k))*tcrf)) + weight_sum = abs(tem_shal)+abs(tem_deep) + if(weight_sum<1e-12) then + cycle + endif + + if (clcw_save(i,k) .gt. -999.0) then + cliw_both = max(0.,cliw_save(i,k) + tem * tem1) - cliw_save(i,k) + clcw_both = max(0.,clcw_save(i,k) + tem) - clcw_save(i,k) + else if(cliw_idx>1) then + cliw_both = max(0.,cliw_save(i,k) + tem) - cliw_save(i,k) + clcw_both = 0 + endif + if(cliw_deep_idx>1) then + dtend(i,k,cliw_deep_idx) = dtend(i,k,cliw_deep_idx) + abs(tem_deep)/weight_sum*cliw_both + endif + if(clcw_deep_idx>1) then + dtend(i,k,clcw_deep_idx) = dtend(i,k,clcw_deep_idx) + abs(tem_deep)/weight_sum*clcw_both + endif + if(cliw_shal_idx>1) then + dtend(i,k,cliw_shal_idx) = dtend(i,k,cliw_shal_idx) + abs(tem_shal)/weight_sum*cliw_both + endif + if(clcw_shal_idx>1) then + dtend(i,k,clcw_shal_idx) = dtend(i,k,clcw_shal_idx) + abs(tem_shal)/weight_sum*clcw_both + endif + enddo + enddo + endif endif end subroutine cu_gf_driver_run !> @} diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta index 32ed8c38c..e8abd6797 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/cu_gf_driver.meta @@ -392,6 +392,22 @@ 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 = () + type = integer + intent = in + optional = F [index_for_temperature] standard_name = index_for_temperature long_name = index in dtidx first dimension of temperature field diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 538274249..d0ace8e9e 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -78,13 +78,14 @@ SUBROUTINE mynnedmf_wrapper_run( & & sub_thl,sub_sqv,det_thl,det_sqv,& & nupdraft,maxMF,ktop_plume, & & dudt, dvdt, dtdt, & - & dqdt_water_vapor, dqdt_liquid_cloud, & - & dqdt_ice_cloud, dqdt_ozone, & - & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & - & dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc, & + & dqdt_water_vapor, dqdt_liquid_cloud, & ! <=== ntqv, ntcw + & dqdt_ice_cloud, dqdt_ozone, & ! <=== ntiw, ntoz + & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & ! <=== ntlnc, ntinc + & dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc, & ! <=== ntwa, ntia & flag_for_pbl_generic_tend, & - & ntqv, dtend, dtidx, index_for_temperature, & - & index_for_x_wind, index_for_y_wind, & + & dtend, dtidx, index_for_temperature, & + & index_for_x_wind, index_for_y_wind, ntke, & + & ntqv, ntcw, ntiw, ntoz, ntlnc, ntinc, ntwa, ntia, & & index_for_cause_pbl, htrsw, htrlw, xmu, & & grav_settling, bl_mynn_tkebudget, bl_mynn_tkeadvect, & & bl_mynn_cloudpdf, bl_mynn_mixlength, & @@ -212,8 +213,9 @@ SUBROUTINE mynnedmf_wrapper_run( & !TENDENCY DIAGNOSTICS real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) - integer, intent(in) :: index_for_temperature, index_for_x_wind, ntqv, & + integer, intent(in) :: index_for_temperature, index_for_x_wind, & index_for_y_wind, index_for_cause_pbl + integer, intent(in) :: ntoz, ntqv, ntcw, ntiw, ntlnc, ntinc, ntwa, ntia, ntke !MISC CONFIGURATION OPTIONS INTEGER, PARAMETER :: & @@ -322,6 +324,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & uoce,voce,vdfg,znt,ts integer :: idtend real, dimension(im) :: dusfci1,dvsfci1,dtsfci1,dqsfci1 + real(kind=kind_phys), allocatable :: save_qke_adv(:,:) ! Initialize CCPP error handling variables errmsg = '' @@ -334,6 +337,14 @@ SUBROUTINE mynnedmf_wrapper_run( & write(0,*)"flag_restart=",flag_restart endif + if(flag_for_pbl_generic_tend .and. ldiag3d) then + idtend = dtidx(ntke+100,index_for_cause_pbl) + if(idtend>1) then + allocate(save_qke_adv(im,levs)) + save_qke_adv=qke_adv + endif + endif + ! DH* TODO: Use flag_restart to distinguish which fields need ! to be initialized and which are read from restart files if (flag_init) then @@ -704,19 +715,11 @@ SUBROUTINE mynnedmf_wrapper_run( & dvdt(i,k) = dvdt(i,k) + RVBLTEN(i,k) enddo enddo - accum_duvt3dt: if(lssav) then - if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then - idtend=dtidx(index_for_x_wind,index_for_cause_pbl) - if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RUBLTEN*dtf - - idtend=dtidx(index_for_y_wind,index_for_cause_pbl) - if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RVBLTEN*dtf - endif - - if (lsidea .or. (ldiag3d .and. .not. flag_for_pbl_generic_tend)) then - idtend=dtidx(index_for_temperature,index_for_cause_pbl) - if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + RTHBLTEN*exner*dtf - endif + accum_duvt3dt: if(ldiag3d .or. lsidea) then + call dtend_helper(index_for_x_wind,RUBLTEN) + call dtend_helper(index_for_y_wind,RVBLTEN) + call dtend_helper(index_for_temperature,RTHBLTEN,exner) + call dtend_helper(100+ntoz,dqdt_ozone) endif accum_duvt3dt !Update T, U and V: !do k = 1, levs @@ -738,6 +741,11 @@ SUBROUTINE mynnedmf_wrapper_run( & !dqdt_ozone(i,k) = 0.0 enddo enddo + if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then + call dtend_helper(100+ntqv,RQVBLTEN) + call dtend_helper(100+ntcw,RQCBLTEN) + call dtend_helper(100+ntiw,RQIBLTEN) + endif !Update moist species: !do k=1,levs ! do i=1,im @@ -762,6 +770,15 @@ SUBROUTINE mynnedmf_wrapper_run( & dqdt_ice_aer_num_conc(i,k) = RQNIFABLTEN(i,k) enddo enddo + if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then + call dtend_helper(100+ntqv,RQVBLTEN) + call dtend_helper(100+ntcw,RQCBLTEN) + call dtend_helper(100+ntlnc,RQNCBLTEN) + call dtend_helper(100+ntiw,RQIBLTEN) + call dtend_helper(100+ntinc,RQNIBLTEN) + call dtend_helper(100+ntwa,RQNWFABLTEN) + call dtend_helper(100+ntia,RQNIFABLTEN) + endif !do k=1,levs ! do i=1,im ! qgrs_water_vapor(i,k) = qgrs_water_vapor(i,k) + (RQVBLTEN(i,k)/(1.0+RQVBLTEN(i,k)))*delt @@ -785,6 +802,12 @@ SUBROUTINE mynnedmf_wrapper_run( & !dqdt_ozone(i,k) = 0.0 enddo enddo + if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then + call dtend_helper(100+ntqv,RQVBLTEN) + call dtend_helper(100+ntcw,RQCBLTEN) + call dtend_helper(100+ntiw,RQIBLTEN) + call dtend_helper(100+ntinc,RQNIBLTEN) + endif !do k=1,levs ! do i=1,im ! qgrs_water_vapor(i,k) = qgrs_water_vapor(i,k) + (RQVBLTEN(i,k)/(1.0+RQVBLTEN(i,k)))*delt @@ -808,6 +831,11 @@ SUBROUTINE mynnedmf_wrapper_run( & !dqdt_ozone(i,k) = 0.0 enddo enddo + if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then + call dtend_helper(100+ntqv,RQVBLTEN) + call dtend_helper(100+ntcw,RQCBLTEN) + call dtend_helper(100+ntiw,RQIBLTEN) + endif !do k=1,levs ! do i=1,im ! qgrs_water_vapor(i,k) = qgrs_water_vapor(i,k) + (RQVBLTEN(i,k)/(1.0+RQVBLTEN(i,k)))*delt @@ -829,13 +857,13 @@ SUBROUTINE mynnedmf_wrapper_run( & !dqdt_ozone(i,k) = 0.0 enddo enddo + if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then + call dtend_helper(100+ntqv,RQVBLTEN) + call dtend_helper(100+ntcw,RQCBLTEN) + call dtend_helper(100+ntiw,RQIBLTEN) + endif endif - if(lssav .and. (ldiag3d .and. qdiag3d .and. .not. flag_for_pbl_generic_tend)) then - idtend=dtidx(100+ntqv,index_for_cause_pbl) - if(idtend>1) dtend(:,:,idtend) = dtend(:,:,idtend) + dqdt_water_vapor*dtf - endif - if (lprnt) then print* print*,"===Finished with mynn_bl_driver; output:" @@ -877,6 +905,27 @@ SUBROUTINE mynnedmf_wrapper_run( & print* endif + if(allocated(save_qke_adv)) then + deallocate(save_qke_adv) + endif + + CONTAINS + + SUBROUTINE dtend_helper(itracer,field,mult) + real(kind=kind_phys), intent(in) :: field(im,levs) + real(kind=kind_phys), intent(in), optional :: mult(im,levs) + integer, intent(in) :: itracer + integer :: idtend + + idtend=dtidx(itracer,index_for_cause_pbl) + if(idtend>1) then + if(present(mult)) then + dtend(:,:,idtend) = dtend(:,:,idtend) + field*dtf*mult + else + dtend(:,:,idtend) = dtend(:,:,idtend) + field*dtf + endif + endif + END SUBROUTINE dtend_helper END SUBROUTINE mynnedmf_wrapper_run diff --git a/physics/module_MYNNPBL_wrapper.meta b/physics/module_MYNNPBL_wrapper.meta index 8b3c742a4..99f911b03 100644 --- a/physics/module_MYNNPBL_wrapper.meta +++ b/physics/module_MYNNPBL_wrapper.meta @@ -1011,14 +1011,6 @@ type = logical intent = in optional = F -[ntqv] - standard_name = index_for_water_vapor - long_name = tracer index for water vapor (specific humidity) - units = index - dimensions = () - type = integer - intent = in - optional = F [dtend] standard_name = diagnostic_3d_tendencies long_name = diagnostic 3d tendencies for tracers and other fields @@ -1060,6 +1052,78 @@ type = integer intent = in optional = F +[ntke] + standard_name = index_for_turbulent_kinetic_energy + long_name = tracer index for turbulent kinetic energy + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntoz] + standard_name = index_for_ozone + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + 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 = () + type = integer + intent = in + optional = F +[ntlnc] + standard_name = index_for_liquid_cloud_number_concentration + long_name = tracer index for liquid number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntinc] + standard_name = index_for_ice_cloud_number_concentration + long_name = tracer index for ice number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntwa] + standard_name = index_for_water_friendly_aerosols + long_name = tracer index for water friendly aerosol + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntia] + standard_name = index_for_ice_friendly_aerosols + long_name = tracer index for ice friendly aerosol + units = index + dimensions = () + type = integer + intent = in + optional = F [index_for_cause_pbl] standard_name = index_for_cause_pbl long_name = tracer changes caused by PBL scheme diff --git a/physics/moninedmf.f b/physics/moninedmf.f index bd52544ba..818ce4a41 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -1312,18 +1312,17 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo enddo enddo - if(.not.flag_for_pbl_generic_tend) then - idtend1 = dtidx(100+ntoz,index_for_cause_pbl) - if(idtend1>1) then - kk = ntoz + if(.not.flag_for_pbl_generic_tend .and. ldiag3d) then + do kk = 2, ntrac + idtend1 = dtidx(100+kk,index_for_cause_pbl) is = (kk-1) * km do k = 1, km do i = 1, im - qtend = (a2(i,k+is)-q1(i,k,kk)) + qtend = (a2(i,k+is)-q1(i,k,kk))*rdt dtend(i,k,idtend1) = dtend(i,k,idtend1)+qtend enddo enddo - endif + enddo endif endif ! diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 8092a0df4..9360fdc14 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -1432,6 +1432,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo endif + ! Send tendencies just for QV; other tracers are below. idtend=dtidx(100+ntqv,index_for_cause_pbl) if(idtend>1) then do k = 1,km @@ -1453,18 +1454,18 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo enddo - if(ldiag3d .and. .not. gen_tend .and. ntoz>0) then - idtend=dtidx(ntoz+100,index_for_cause_pbl) - if(idtend>1) then - kk=ntoz + if(ldiag3d .and. .not. gen_tend) then + ! Send tendencies for all tracers that were selected. + do kk = 2, ntrac1 is = (kk-1) * km + idtend = dtidx(kk+100,index_for_cause_pbl) do k = 1, km do i = 1, im qtend = (f2(i,k+is)-q1(i,k,kk))*rdt dtend(i,k,idtend) = dtend(i,k,idtend)+qtend*delt enddo enddo - endif + enddo endif endif ! From 520f97f070a9403ed2ee85cf7eb73f5950587293 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 1 Feb 2021 17:41:56 +0000 Subject: [PATCH 06/24] Revert a change mistakenly applied --- physics/GFS_debug.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index 2d3bad477..d3966ebb4 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -642,10 +642,9 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, endif enddo enddo - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%upd_mf ', Diag%upd_mf) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dwn_mf ', Diag%dwn_mf) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%det_mf ', Diag%det_mf) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%cldcov ', Diag%cldcov) +- !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%upd_mf ', Diag%upd_mf) +- !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dwn_mf ', Diag%dwn_mf) +- !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%det_mf ', Diag%det_mf) end if if(Model%lradar) then call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%refl_10cm ', Diag%refl_10cm) From 4333db090badbd4cd6779d1c290ca1d2c18af7d3 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Tue, 2 Mar 2021 21:56:19 +0000 Subject: [PATCH 07/24] Diagnostics match dX3dt version for all five targeted suites. --- physics/GFS_PBL_generic.F90 | 23 ++++++-- physics/GFS_PBL_generic.meta | 16 ++++++ physics/GFS_suite_interstitial.F90 | 3 +- physics/module_MYNNPBL_wrapper.F90 | 14 ++++- physics/moninedmf.f | 91 +++++++++++++++++++----------- physics/moninedmf.meta | 8 +++ 6 files changed, 112 insertions(+), 43 deletions(-) diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 82efda4e3..d0c1d41ad 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -79,27 +79,28 @@ end subroutine GFS_PBL_generic_pre_finalize !! \section arg_table_GFS_PBL_generic_pre_run Argument Table !! \htmlinclude GFS_PBL_generic_pre_run.html !! - subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, & + subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index, & ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, & ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef, trans_aero, ntchs, ntchm, & imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, & imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires, cplchm, ltaerosol, & hybedmf, do_shoc, satmedmf, qgrs, vdftra, save_u, save_v, save_t, save_q, & - ldiag3d, qdiag3d, lssav, ugrs, vgrs, tgrs, errmsg, errflg) - + flag_for_pbl_generic_tend, ldiag3d, qdiag3d, lssav, ugrs, vgrs, tgrs, errmsg, errflg) + use machine, only : kind_phys use GFS_PBL_generic_common, only : set_aerosol_tracer_index implicit none integer, parameter :: kp = kind_phys + integer, intent(out) :: rtg_ozone_index integer, intent(in) :: im, levs, nvdiff, ntrac integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef,ntchs, ntchm logical, intent(in) :: trans_aero, ldiag3d, qdiag3d, lssav integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires - logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf + logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf, flag_for_pbl_generic_tend real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs real(kind=kind_phys), dimension(im, levs), intent(in) :: ugrs, vgrs, tgrs @@ -120,9 +121,11 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, errmsg = '' errflg = 0 + rtg_ozone_index=-1 !DH: dvdftra is only used if nvdiff != ntrac or (nvdiff == ntrac .and. ) if (nvdiff == ntrac .and. (hybedmf .or. do_shoc .or. satmedmf)) then vdftra = qgrs + rtg_ozone_index = ntoz else if (imp_physics == imp_physics_wsm6) then ! WSM6 @@ -134,6 +137,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,4) = qgrs(i,k,ntoz) enddo enddo + rtg_ozone_index = 4 ! Ferrier-Aligo elseif (imp_physics == imp_physics_fer_hires) then @@ -147,6 +151,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,6) = qgrs(i,k,ntoz) enddo enddo + rtg_ozone_index = 6 elseif (imp_physics == imp_physics_thompson) then ! Thompson @@ -167,6 +172,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,12) = qgrs(i,k,ntia) enddo enddo + rtg_ozone_index = 10 else do k=1,levs do i=1,im @@ -181,6 +187,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,9) = qgrs(i,k,ntoz) enddo enddo + rtg_ozone_index = 9 endif ! MG elseif (imp_physics == imp_physics_mg) then ! MG3/2 @@ -201,6 +208,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,12) = qgrs(i,k,ntoz) enddo enddo + rtg_ozone_index = 12 else ! MG2 do k=1,levs do i=1,im @@ -216,6 +224,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,10) = qgrs(i,k,ntoz) enddo enddo + rtg_ozone_index = 10 endif elseif (imp_physics == imp_physics_gfdl) then ! GFDL MP @@ -230,6 +239,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,7) = qgrs(i,k,ntoz) enddo enddo + rtg_ozone_index = 7 elseif (imp_physics == imp_physics_zhao_carr) then ! Zhao/Carr/Sundqvist do k=1,levs @@ -239,6 +249,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,3) = qgrs(i,k,ntoz) enddo enddo + rtg_ozone_index = 3 endif ! if (trans_aero) then @@ -270,7 +281,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, ! endif - if(ldiag3d .and. lssav) then + if(ldiag3d .and. lssav .and. flag_for_pbl_generic_tend) then do k=1,levs do i=1,im save_t(i,k) = tgrs(i,k) @@ -610,7 +621,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dqsfc_diag (i) = dqsfc_diag(i) + dqsfci_diag(i) * dtf enddo - if (ldiag3d .and. flag_for_pbl_generic_tend .and. lssav) then + if (ldiag3d .and. flag_for_pbl_generic_tend) then if (lsidea) then idtend = dtidx(index_for_temperature, index_for_cause_pbl) if(idtend>1) then diff --git a/physics/GFS_PBL_generic.meta b/physics/GFS_PBL_generic.meta index d65508f37..5a7678c63 100644 --- a/physics/GFS_PBL_generic.meta +++ b/physics/GFS_PBL_generic.meta @@ -39,6 +39,14 @@ type = integer intent = in optional = F +[rtg_ozone_index] + standard_name = vertically_diffused_tracer_index_of_ozone + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = out + optional = F [ntqv] standard_name = index_for_water_vapor long_name = tracer index for water vapor (specific humidity) @@ -349,6 +357,14 @@ kind = kind_phys intent = out optional = F +[flag_for_pbl_generic_tend] + standard_name = flag_for_generic_planetary_boundary_layer_tendency + long_name = true if GFS_PBL_generic should calculate tendencies + units = flag + dimensions = () + type = logical + intent = in + optional = F [ldiag3d] standard_name = flag_diagnostics_3D long_name = flag for 3d diagnostic fields diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index dcdce44d6..e55c8deef 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -161,12 +161,13 @@ end subroutine GFS_suite_interstitial_2_finalize !! \htmlinclude GFS_suite_interstitial_2_run.html !! #endif + subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplflx, flag_cice, shal_cnv, old_monin, mstrat, & do_shoc, frac_grid, imfshalcnv, dtf, xcosz, adjsfcdsw, adjsfcdlw, cice, pgr, ulwsfc_cice, lwhd, htrsw, htrlw, xmu, ctei_rm, & work1, work2, prsi, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, cp, hvap, prslk, suntim, adjsfculw, adjsfculw_lnd, & adjsfculw_ice, adjsfculw_wat, dlwsfc, ulwsfc, psmean, dtend, dtidx, index_for_cause_longwave, index_for_cause_shortwave, & index_for_cause_pbl, index_for_cause_dcnv, index_for_cause_scnv, index_for_cause_mp, index_for_temperature, & - ctei_rml, ctei_r, kinver, dry, icy, wet, frland, huge, use_GP_jacobian, skt, sktp1r, fluxlwUP, fluxlwUP_jac, errmsg, errflg) + ctei_rml, ctei_r, kinver, dry, icy, wet, frland, huge, use_LW_jacobian, errmsg, errflg) implicit none diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index d0ace8e9e..70818d69d 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -282,6 +282,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & RQNWFABLTEN, RQNIFABLTEN, & & dqke,qWT,qSHEAR,qBUOY,qDISS, & & pattern_spp_pbl + real(kind=kind_phys), allocatable :: oldzone(:,:) !MYNN-CHEM arrays real(kind=kind_phys), dimension(im,nchem) :: chem3d @@ -494,7 +495,10 @@ SUBROUTINE mynnedmf_wrapper_run( & enddo enddo endif - + if(ldiag3d .and. dtidx(100+ntoz,index_for_cause_pbl)>1) then + allocate(oldzone(im,levs)) + oldzone = ozone + endif if (lprnt)write(0,*)"prepping MYNN-EDMF variables..." do k=1,levs @@ -719,7 +723,13 @@ SUBROUTINE mynnedmf_wrapper_run( & call dtend_helper(index_for_x_wind,RUBLTEN) call dtend_helper(index_for_y_wind,RVBLTEN) call dtend_helper(index_for_temperature,RTHBLTEN,exner) - call dtend_helper(100+ntoz,dqdt_ozone) + if(ldiag3d) then + idtend = dtidx(100+ntoz,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (ozone-oldzone) + deallocate(oldzone) + endif + endif endif accum_duvt3dt !Update T, U and V: !do k = 1, levs diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 818ce4a41..148f2210f 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -65,7 +65,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & & dusfc,dvsfc,dtsfc,dqsfc,hpbl,hgamt,hgamq,dkt, & & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr, & & xkzminv,moninq_fac,hurr_pbl,islimsk,var_ric, & - & coef_ric_l,coef_ric_s,ldiag3d,ntqv,ntoz, & + & coef_ric_l,coef_ric_s,ldiag3d,ntqv,rtg_ozone_index,ntoz, & & dtend,dtidx,index_for_cause_pbl,index_for_x_wind, & & index_for_y_wind,index_for_temperature, & & flag_for_pbl_generic_tend,errmsg,errflg) @@ -84,7 +84,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! logical, intent(in) :: lprnt, hurr_pbl, ldiag3d logical, intent(in) :: flag_for_pbl_generic_tend - integer, intent(in) :: ipr, islimsk(im) + integer, intent(in) :: ipr, islimsk(im), ntoz integer, intent(in) :: im, km, ntrac, ntcw, kinver(im) integer, intent(out) :: kpbl(im) @@ -98,7 +98,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) integer, intent(in) :: index_for_x_wind, index_for_y_wind, & - & index_for_cause_pbl, index_for_temperature, ntqv, ntoz + & index_for_cause_pbl, index_for_temperature, ntqv, rtg_ozone_index real(kind=kind_phys), intent(in) :: & & u1(im,km), v1(im,km), & & t1(im,km), q1(im,km,ntrac), & @@ -1282,10 +1282,6 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! recover tendencies of heat and moisture ! !> After returning with the solution, the tendencies for temperature and moisture are recovered. - if(.not.flag_for_pbl_generic_tend) then - idtend1=dtidx(index_for_temperature,index_for_cause_pbl) - idtend2=dtidx(ntqv+100,index_for_cause_pbl) - endif do k = 1,km do i = 1,im ttend = (a1(i,k)-t1(i,k)) * rdt @@ -1294,14 +1290,28 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & rtg(i,k,1) = rtg(i,k,1)+qtend dtsfc(i) = dtsfc(i)+cont*del(i,k)*ttend dqsfc(i) = dqsfc(i)+conq*del(i,k)*qtend - if(idtend1>1) then - dtend(i,k,idtend1) = dtend(i,k,idtend1) + ttend*delt - endif - if(idtend2>1) then - dtend(i,k,idtend2) = dtend(i,k,idtend2) + qtend*delt - endif enddo enddo + if(.not.flag_for_pbl_generic_tend) then + idtend1=dtidx(index_for_temperature,index_for_cause_pbl) + idtend2=dtidx(ntqv+100,index_for_cause_pbl) + if(idtend1>1) then + do k = 1,km + do i = 1,im + ttend = (a1(i,k)-t1(i,k)) * rdt + dtend(i,k,idtend1) = dtend(i,k,idtend1) + ttend*delt + enddo + enddo + endif + if(idtend2>1) then + do k = 1,km + do i = 1,im + qtend = (a2(i,k)-q1(i,k,1))*rdt + dtend(i,k,idtend2) = dtend(i,k,idtend2) + qtend*delt + enddo + enddo + endif + endif if(ntrac >= 2) then do kk = 2, ntrac is = (kk-1) * km @@ -1312,17 +1322,19 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo enddo enddo - if(.not.flag_for_pbl_generic_tend .and. ldiag3d) then - do kk = 2, ntrac - idtend1 = dtidx(100+kk,index_for_cause_pbl) - is = (kk-1) * km - do k = 1, km - do i = 1, im - qtend = (a2(i,k+is)-q1(i,k,kk))*rdt - dtend(i,k,idtend1) = dtend(i,k,idtend1)+qtend - enddo - enddo - enddo + if(.not.flag_for_pbl_generic_tend .and. ldiag3d .and. & + & rtg_ozone_index>0) then + idtend1 = dtidx(100+ntoz,index_for_cause_pbl) + if(idtend1>1) then + kk = rtg_ozone_index + is = (kk-1) * km + do k = 1, km + do i = 1, im + qtend = (a2(i,k+is)-q1(i,k,kk)) + dtend(i,k,idtend1) = dtend(i,k,idtend1)+qtend + enddo + enddo + endif endif endif ! @@ -1423,10 +1435,6 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! recover tendencies of momentum ! !> Finally, the tendencies are recovered from the tridiagonal solutions. - if(.not.flag_for_pbl_generic_tend) then - idtend1 = dtidx(index_for_x_wind,index_for_cause_pbl) - idtend2 = dtidx(index_for_y_wind,index_for_cause_pbl) - endif do k = 1,km do i = 1,im utend = (a1(i,k)-u1(i,k))*rdt @@ -1435,12 +1443,6 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & dv(i,k) = dv(i,k) + vtend dusfc(i) = dusfc(i) + conw*del(i,k)*utend dvsfc(i) = dvsfc(i) + conw*del(i,k)*vtend - if(idtend1>1) then - dtend(i,k,idtend1) = dtend(i,k,idtend1) + utend*delt - endif - if(idtend2>1) then - dtend(i,k,idtend2) = dtend(i,k,idtend2) + vtend*delt - endif ! ! for dissipative heating for ecmwf model ! @@ -1453,6 +1455,27 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! enddo enddo + if(.not.flag_for_pbl_generic_tend) then + idtend1 = dtidx(index_for_x_wind,index_for_cause_pbl) + if(idtend1>1) then + do k = 1,km + do i = 1,im + utend = (a1(i,k)-u1(i,k))*rdt + dtend(i,k,idtend1) = dtend(i,k,idtend1) + utend*delt + enddo + enddo + endif + + idtend2 = dtidx(index_for_y_wind,index_for_cause_pbl) + if(idtend2>1) then + do k = 1,km + do i = 1,im + vtend = (a2(i,k)-v1(i,k))*rdt + dtend(i,k,idtend2) = dtend(i,k,idtend2) + vtend*delt + enddo + enddo + endif + endif ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! diff --git a/physics/moninedmf.meta b/physics/moninedmf.meta index fd2247d20..16abc742b 100644 --- a/physics/moninedmf.meta +++ b/physics/moninedmf.meta @@ -554,6 +554,14 @@ type = integer intent = in optional = F +[rtg_ozone_index] + standard_name = vertically_diffused_tracer_index_of_ozone + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F [ntoz] standard_name = index_for_ozone long_name = tracer index for ozone mixing ratio From ca076e5f9e261332c941a0458f666451528722ba Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Thu, 4 Mar 2021 16:25:41 +0000 Subject: [PATCH 08/24] New tendencies work, except maybe TKE and CLD_AMT --- physics/GFS_PBL_generic.F90 | 11 +++++++ physics/GFS_suite_interstitial.F90 | 33 +++++++++++++++++-- physics/GFS_suite_interstitial.meta | 49 +++++++++++++++++++++++++++++ physics/module_MYNNPBL_wrapper.F90 | 8 ++++- physics/satmedmfvdifq.F | 23 ++++++++++---- 5 files changed, 115 insertions(+), 9 deletions(-) diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index d0c1d41ad..097ff0b58 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -296,6 +296,13 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index, save_q(i,k,ntoz) = qgrs(i,k,ntoz) enddo enddo + if(ntke>0) then + do k=1,levs + do i=1,im + save_q(i,k,ntke) = qgrs(i,k,ntke) + enddo + enddo + endif endif endif @@ -649,6 +656,10 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, if(idtend>1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + qgrs(1:im,1:levs,ntoz) - save_q(1:im,1:levs,ntoz) endif + idtend = dtidx(100+ntke, index_for_cause_pbl) + if(idtend>1) then + dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (qgrs(1:im,1:levs,ntke) - save_q(1:im,1:levs,ntke)) + endif endif endif ! end if_lssav diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index e55c8deef..3181aaeaf 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -686,7 +686,8 @@ end subroutine GFS_suite_interstitial_4_finalize subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_total, ntrac, ntcw, ntiw, ntclamt, & ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, & imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, dtf, save_qc, save_qi, con_pi, & - gq0, clw, prsl, save_tcp, con_rd, nwfa, spechum, dqdti, errmsg, errflg) + gq0, clw, prsl, save_tcp, con_rd, nwfa, spechum, dqdti, dtidx, dtend, ntk, ntke, ldiag3d, & + index_for_cause_conv_trans, errmsg, errflg) use machine, only: kind_phys use module_mp_thompson_make_number_concentrations, only: make_IceNumber, make_DropletNumber @@ -706,6 +707,12 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to ! save_qi is not allocated for Zhao-Carr MP real(kind=kind_phys), dimension(:, :), intent(in) :: save_qi + ! dtend and dtidx are only allocated if ldiag3d + logical, intent(in) :: ldiag3d + real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend + integer, dimension(:,:), intent(in) :: dtidx + integer, intent(in) :: index_for_cause_conv_trans,ntk,ntke + real(kind=kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0 real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw real(kind=kind_phys), dimension(im,levs), intent(in) :: prsl @@ -722,7 +729,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to integer, intent(out) :: errflg ! local variables - integer :: i,k,n,tracers + integer :: i,k,n,tracers,idtend real(kind=kind_phys), dimension(im,levs) :: rho_dryair real(kind=kind_phys), dimension(im,levs) :: qv_mp !< kg kg-1 (dry mixing ratio) @@ -735,6 +742,28 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to errmsg = '' errflg = 0 + if(ldiag3d) then + if(ntk>0 .and. ntk<=size(clw,3)) then + idtend=dtidx(100+ntke,index_for_cause_conv_trans) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntk) + endif + endif + if(ntclamt<=size(clw,3) .and. ntclamt>0) then + idtend=dtidx(100+ntclamt,index_for_cause_conv_trans) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntclamt) + endif + endif + endif + + if(ldiag3d .and. ntk>0) then + idtend=dtidx(100+ntke,index_for_cause_conv_trans) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntk) + endif + endif + ! --- update the tracers due to deep & shallow cumulus convective transport ! (except for suspended water and ice) diff --git a/physics/GFS_suite_interstitial.meta b/physics/GFS_suite_interstitial.meta index 59570d407..91aa9f6f7 100644 --- a/physics/GFS_suite_interstitial.meta +++ b/physics/GFS_suite_interstitial.meta @@ -1905,6 +1905,55 @@ kind = kind_phys intent = inout optional = F +[dtidx] + standard_name = dtend_outer_index + long_name = index in outer dimension of dtend of a tracer-cause pair + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + type = integer + intent = in + optional = F +[dtend] + standard_name = diagnostic_3d_tendencies + long_name = diagnostic 3d tendencies for tracers and other fields + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + type = real + kind = kind_phys + intent = inout + optional = F +[ntk] + standard_name = index_for_turbulent_kinetic_energy_convective_transport_tracer + long_name = index for turbulent kinetic energy in the convectively transported tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntke] + standard_name = index_for_turbulent_kinetic_energy + long_name = tracer index for turbulent kinetic energy + units = index + dimensions = () + type = integer + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[index_for_cause_conv_trans] + standard_name = index_for_cause_conv_trans + long_name = tracer changes caused by convective transport of tracers + units = index + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 70818d69d..5d317d23b 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -338,7 +338,7 @@ SUBROUTINE mynnedmf_wrapper_run( & write(0,*)"flag_restart=",flag_restart endif - if(flag_for_pbl_generic_tend .and. ldiag3d) then + if(.not. flag_for_pbl_generic_tend .and. ldiag3d) then idtend = dtidx(ntke+100,index_for_cause_pbl) if(idtend>1) then allocate(save_qke_adv(im,levs)) @@ -916,6 +916,12 @@ SUBROUTINE mynnedmf_wrapper_run( & endif if(allocated(save_qke_adv)) then + if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then + idtend = dtidx(100+ntke,index_for_cause_pbl) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + qke_adv-save_qke_adv + endif + endif deallocate(save_qke_adv) endif diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 9360fdc14..f0ef9e890 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -1459,12 +1459,23 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & do kk = 2, ntrac1 is = (kk-1) * km idtend = dtidx(kk+100,index_for_cause_pbl) - do k = 1, km - do i = 1, im - qtend = (f2(i,k+is)-q1(i,k,kk))*rdt - dtend(i,k,idtend) = dtend(i,k,idtend)+qtend*delt - enddo - enddo + if(idtend>1) then + if(kk==ntke) then + do k = 1, km + do i = 1, im + qtend = (f1(i,k)-q1(i,k,kk))*rdt + dtend(i,k,idtend) = dtend(i,k,idtend)+qtend*delt + enddo + enddo + else + do k = 1, km + do i = 1, im + qtend = (f2(i,k+is)-q1(i,k,kk))*rdt + dtend(i,k,idtend) = dtend(i,k,idtend)+qtend*delt + enddo + enddo + endif + endif enddo endif endif From 5e169e8f185039844cd908c8f060244bcdddf4da Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Wed, 24 Mar 2021 19:17:35 +0000 Subject: [PATCH 09/24] Rename many variables --- physics/GFS_DCNV_generic.F90 | 24 +++++----- physics/GFS_DCNV_generic.meta | 48 +++++++++---------- physics/GFS_GWD_generic.F90 | 28 +++++------ physics/GFS_GWD_generic.meta | 72 ++++++++++++++--------------- physics/GFS_MP_generic.F90 | 8 ++-- physics/GFS_MP_generic.meta | 26 +++++------ physics/GFS_PBL_generic.F90 | 20 ++++---- physics/GFS_PBL_generic.meta | 36 +++++++-------- physics/GFS_SCNV_generic.F90 | 22 ++++----- physics/GFS_SCNV_generic.meta | 48 +++++++++---------- physics/GFS_suite_interstitial.F90 | 36 +++++++-------- physics/GFS_suite_interstitial.meta | 72 ++++++++++++++--------------- physics/cires_ugwp.F90 | 20 ++++---- physics/cires_ugwp.meta | 42 ++++++++--------- physics/cu_gf_driver.F90 | 32 ++++++------- physics/cu_gf_driver.meta | 42 ++++++++--------- physics/gwdc.f | 12 ++--- physics/gwdc.meta | 30 ++++++------ physics/module_MYJPBL_wrapper.F90 | 16 +++---- physics/module_MYJPBL_wrapper.meta | 36 +++++++-------- physics/module_MYNNPBL_wrapper.F90 | 26 +++++------ physics/module_MYNNPBL_wrapper.meta | 36 +++++++-------- physics/moninedmf.f | 18 ++++---- physics/moninedmf.meta | 36 +++++++-------- physics/moninshoc.f | 18 ++++---- physics/moninshoc.meta | 36 +++++++-------- physics/ozphys.f | 18 ++++---- physics/ozphys.meta | 36 +++++++-------- physics/ozphys_2015.f | 18 ++++---- physics/ozphys_2015.meta | 36 +++++++-------- physics/phys_tend.F90 | 12 ++--- physics/phys_tend.meta | 30 ++++++------ physics/rayleigh_damp.f | 16 +++---- physics/rayleigh_damp.meta | 36 +++++++-------- physics/satmedmfvdif.F | 16 +++---- physics/satmedmfvdif.meta | 36 +++++++-------- physics/satmedmfvdifq.F | 21 ++++----- physics/satmedmfvdifq.meta | 36 +++++++-------- physics/shinhongvdif.F90 | 18 ++++---- physics/shinhongvdif.meta | 36 +++++++-------- physics/unified_ugwp.F90 | 22 ++++----- physics/unified_ugwp.meta | 42 ++++++++--------- physics/ysuvdif.F90 | 18 ++++---- 43 files changed, 643 insertions(+), 644 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index 7b9ff1a9a..c5043e6a1 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -18,13 +18,13 @@ end subroutine GFS_DCNV_generic_pre_finalize subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplchm, & gu0, gv0, gt0, gq0, nsamftrac, ntqv, & save_u, save_v, save_t, save_q, dqdti, & - dtidx, index_for_cause_dcnv, errmsg, errflg) + dtidx, index_of_process_dcnv, errmsg, errflg) use machine, only: kind_phys implicit none - integer, intent(in) :: im, levs, nsamftrac, ntqv, index_for_cause_dcnv, dtidx(:,:) + integer, intent(in) :: im, levs, nsamftrac, ntqv, index_of_process_dcnv, dtidx(:,:) logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0 real(kind=kind_phys), dimension(im,levs), intent(in) :: gv0 @@ -65,7 +65,7 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc if ((ldiag3d.and.qdiag3d) .or. cplchm) then if(nsamftrac>0) then do n=1,nsamftrac - if(n==ntqv .or. dtidx(n+100,index_for_cause_dcnv)) then + if(n==ntqv .or. dtidx(n+100,index_of_process_dcnv)) then save_q(:,:,n) = gq0(:,:,n) endif enddo @@ -102,8 +102,8 @@ end subroutine GFS_DCNV_generic_post_finalize subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & frain, rain1, dtf, cld1d, save_u, save_v, save_t, gu0, gv0, gt0, & ud_mf, dd_mf, dt_mf, con_g, npdf3d, num_p3d, ncnvcld3d, nsamftrac, & - rainc, cldwrk, upd_mf, dwn_mf, det_mf, dtend, dtidx, index_for_cause_dcnv, & - index_for_temperature, index_for_x_wind, index_for_y_wind, ntqv, gq0, save_q, & + rainc, cldwrk, upd_mf, dwn_mf, det_mf, dtend, dtidx, index_of_process_dcnv, & + index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gq0, save_q, & cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, flag_for_dcnv_generic_tend, errmsg, errflg) @@ -130,8 +130,8 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & real(kind=kind_phys), dimension(im,levs), intent(inout) :: cnvw, cnvc real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend - integer, intent(in) :: dtidx(:,:), index_for_cause_dcnv, index_for_temperature, & - index_for_x_wind, index_for_y_wind, ntqv + integer, intent(in) :: dtidx(:,:), index_of_process_dcnv, index_of_temperature, & + index_of_x_wind, index_of_y_wind, ntqv ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, @@ -178,30 +178,30 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & enddo if (ldiag3d .and. flag_for_dcnv_generic_tend) then - idtend=dtidx(index_for_temperature,index_for_cause_dcnv) + idtend=dtidx(index_of_temperature,index_of_process_dcnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gt0-save_t)*frain endif - idtend=dtidx(index_for_x_wind,index_for_cause_dcnv) + idtend=dtidx(index_of_x_wind,index_of_process_dcnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gu0-save_u)*frain endif - idtend=dtidx(index_for_y_wind,index_for_cause_dcnv) + idtend=dtidx(index_of_y_wind,index_of_process_dcnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0-save_v)*frain endif if(nsamftrac>0) then do n=1,nsamftrac - idtend=dtidx(100+n,index_for_cause_dcnv) + idtend=dtidx(100+n,index_of_process_dcnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n)-save_q(:,:,n))*frain endif enddo else - idtend=dtidx(100+ntqv,index_for_cause_dcnv) + idtend=dtidx(100+ntqv,index_of_process_dcnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv)-save_q(:,:,ntqv))*frain endif diff --git a/physics/GFS_DCNV_generic.meta b/physics/GFS_DCNV_generic.meta index e49c8ff73..8ddace1cc 100644 --- a/physics/GFS_DCNV_generic.meta +++ b/physics/GFS_DCNV_generic.meta @@ -153,16 +153,16 @@ intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_cause_dcnv] - standard_name = index_for_cause_dcnv - long_name = tracer changes caused by deep convection scheme +[index_of_process_dcnv] + standard_name = index_of_deep_convection_process_process_in_cumulative_change_index + long_name = index of deep convection process in second dimension of array cumulative change index units = index dimensions = () type = integer @@ -362,49 +362,49 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_cause_dcnv] - standard_name = index_for_cause_dcnv - long_name = tracer changes caused by deep convection scheme +[index_of_process_dcnv] + standard_name = index_of_deep_convection_process_process_in_cumulative_change_index + long_name = index of deep convection process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index 40fdd6198..b89f54610 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -20,8 +20,8 @@ subroutine GFS_GWD_generic_pre_run( & & oc, oa4, clx, theta, & & varss, ocss, oa4ss, clxss, & & sigma, gamma, elvmax, lssav, ldiag3d, & - & dtend, dtidx, index_for_temperature, index_for_x_wind, & - & index_for_y_wind, index_for_cause_orographic_gwd, & + & dtend, dtidx, index_of_temperature, index_of_x_wind, & + & index_of_y_wind, index_of_process_orographic_gwd, & & dudt, dvdt, dtdt, dtf, & & flag_for_gwd_generic_tend, errmsg, errflg) @@ -40,8 +40,8 @@ subroutine GFS_GWD_generic_pre_run( & real(kind=kind_phys), intent(in) :: dtdt(im,levs), dudt(im,levs), dvdt(im,levs) ! dtend only allocated only if ldiag3d is .true. real(kind=kind_phys), intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_for_temperature, & - & index_for_x_wind, index_for_y_wind, index_for_cause_orographic_gwd + integer, intent(in) :: dtidx(:,:), index_of_temperature, & + & index_of_x_wind, index_of_y_wind, index_of_process_orographic_gwd real(kind=kind_phys), intent(in) :: dtf character(len=*), intent(out) :: errmsg @@ -122,17 +122,17 @@ subroutine GFS_GWD_generic_pre_run( & endif ! end if_nmtvr if (lssav .and. ldiag3d .and. flag_for_gwd_generic_tend) then - idtend = dtidx(index_for_temperature, index_for_cause_orographic_gwd) + idtend = dtidx(index_of_temperature, index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) - dtdt*dtf endif - idtend = dtidx(index_for_x_wind, index_for_cause_orographic_gwd) + idtend = dtidx(index_of_x_wind, index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) - dudt*dtf endif - idtend = dtidx(index_for_y_wind, index_for_cause_orographic_gwd) + idtend = dtidx(index_of_y_wind, index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) - dvdt*dtf endif @@ -163,8 +163,8 @@ end subroutine GFS_GWD_generic_post_init !! \section detailed Detailed Algorithm !! @{ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, dvdt, dtdt, & - & dugwd, dvgwd, flag_for_gwd_generic_tend, dtend, dtidx, index_for_temperature, index_for_x_wind, & - & index_for_y_wind, index_for_cause_orographic_gwd, errmsg, errflg) + & dugwd, dvgwd, flag_for_gwd_generic_tend, dtend, dtidx, index_of_temperature, index_of_x_wind, & + & index_of_y_wind, index_of_process_orographic_gwd, errmsg, errflg) use machine, only : kind_phys implicit none @@ -179,8 +179,8 @@ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, d ! dtend only allocated only if ldiag3d is .true. real(kind=kind_phys), intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_for_temperature, & - & index_for_x_wind, index_for_y_wind, index_for_cause_orographic_gwd + integer, intent(in) :: dtidx(:,:), index_of_temperature, & + & index_of_x_wind, index_of_y_wind, index_of_process_orographic_gwd character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -196,17 +196,17 @@ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, d dvgwd(:) = dvgwd(:) + dvsfcg(:)*dtf if (ldiag3d .and. flag_for_gwd_generic_tend) then - idtend = dtidx(index_for_temperature, index_for_cause_orographic_gwd) + idtend = dtidx(index_of_temperature, index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtdt*dtf endif - idtend = dtidx(index_for_x_wind, index_for_cause_orographic_gwd) + idtend = dtidx(index_of_x_wind, index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dudt*dtf endif - idtend = dtidx(index_for_y_wind, index_for_cause_orographic_gwd) + idtend = dtidx(index_of_y_wind, index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dvdt*dtf endif diff --git a/physics/GFS_GWD_generic.meta b/physics/GFS_GWD_generic.meta index 27297ff36..0920a9504 100644 --- a/physics/GFS_GWD_generic.meta +++ b/physics/GFS_GWD_generic.meta @@ -183,49 +183,49 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_orographic_gwd] - standard_name = index_for_cause_orographic_gwd - long_name = tracer changes caused by orographic gravity wave drag +[index_of_process_orographic_gwd] + standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index units = index dimensions = () type = integer @@ -365,49 +365,49 @@ intent = inout optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_orographic_gwd] - standard_name = index_for_cause_orographic_gwd - long_name = tracer changes caused by orographic gravity wave drag +[index_of_process_orographic_gwd] + standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 38e6d3feb..977d0342c 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -90,7 +90,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, 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, & graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, & - dtend, dtidx, ncause, index_for_temperature, index_for_cause_mp,ldiag3d, qdiag3d, lssav, & + dtend, dtidx, ncause, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, & errmsg, errflg) ! use machine, only: kind_phys @@ -100,7 +100,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, integer, intent(in) :: im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm - integer, intent(in) :: index_for_temperature,index_for_cause_mp,ncause + integer, intent(in) :: index_of_temperature,index_of_process_mp,ncause real(kind=kind_phys), intent(in) :: dtf, frain, con_g real(kind=kind_phys), dimension(im), intent(in) :: rain1, xlat, xlon, tsfc @@ -343,7 +343,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, enddo if_tendency_diagnostics: if (ldiag3d) then - idtend = dtidx(index_for_temperature,index_for_cause_mp) + idtend = dtidx(index_of_temperature,index_of_process_mp) if(idtend>1) then do k=1,levs do i=1,im @@ -353,7 +353,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, endif if_tracer_diagnostics: if (qdiag3d) then dtend_q: do itrac=1,ntrac - idtend = dtidx(itrac+100,index_for_cause_mp) + idtend = dtidx(itrac+100,index_of_process_mp) if(idtend>1) then do k=1,levs do i=1,im diff --git a/physics/GFS_MP_generic.meta b/physics/GFS_MP_generic.meta index 3added996..c3f611366 100644 --- a/physics/GFS_MP_generic.meta +++ b/physics/GFS_MP_generic.meta @@ -853,41 +853,41 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index dimensions = (number_of_tracers_plus_one_hundred,number_of_causes) type = integer intent = in optional = F [ncause] - standard_name = number_of_possible_causes_of_tracer_changes - long_name = number of possible causes of tracer changes + standard_name = number_of_cumulative_change_processes + long_name = number of processes that cause changes in state variables units = count dimensions = () type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_mp] - standard_name = index_for_cause_mp - long_name = tracer changes caused by microphysics scheme +[index_of_process_mp] + standard_name = index_of_microphysics_process_process_in_cumulative_change_index + long_name = index of microphysics transport process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 097ff0b58..65e8ff4fa 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -331,8 +331,8 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, imp_physics_fer_hires, & ltaerosol, cplflx, cplchm, lssav, flag_for_pbl_generic_tend, ldiag3d, lsidea, hybedmf, do_shoc, satmedmf, & shinhong, do_ysu, dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, dudt, dvdt, dtdt, htrsw, htrlw, xmu, & - dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dtend, dtidx, index_for_temperature, index_for_x_wind, index_for_y_wind, & - index_for_cause_pbl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, & + dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, & + index_of_process_pbl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, & dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag, & rd, cp, fvirt, hvap, t1, q1, prsl, hflx, ushfsfci, oceanfrac, flag_cice, dusfc_cice, dvsfc_cice, & dtsfc_cice, dqsfc_cice, wet, dry, icy, wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1, dkt_cpl, dkt, hffac, hefac, & @@ -381,7 +381,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) - integer, intent(in) :: index_for_temperature, index_for_x_wind, index_for_y_wind, index_for_cause_pbl + integer, intent(in) :: index_of_temperature, index_of_x_wind, index_of_y_wind, index_of_process_pbl logical, dimension(:),intent(in) :: wet, dry, icy real(kind=kind_phys), dimension(:), intent(out) :: ushfsfci @@ -630,33 +630,33 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, if (ldiag3d .and. flag_for_pbl_generic_tend) then if (lsidea) then - idtend = dtidx(index_for_temperature, index_for_cause_pbl) + idtend = dtidx(index_of_temperature, index_of_process_pbl) if(idtend>1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + dtdt(1:im,1:levs)*dtf endif else - idtend = dtidx(index_for_temperature, index_for_cause_pbl) + idtend = dtidx(index_of_temperature, index_of_process_pbl) if(idtend>1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (tgrs(1:im,1:levs) - save_t(1:im,1:levs)) endif endif - idtend = dtidx(index_for_x_wind, index_for_cause_pbl) + idtend = dtidx(index_of_x_wind, index_of_process_pbl) if(idtend>1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (ugrs(1:im,1:levs) - save_u(1:im,1:levs)) endif - idtend = dtidx(index_for_y_wind, index_for_cause_pbl) + idtend = dtidx(index_of_y_wind, index_of_process_pbl) if(idtend>1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (vgrs(1:im,1:levs) - save_v(1:im,1:levs)) endif - idtend = dtidx(100+ntqv, index_for_cause_pbl) + idtend = dtidx(100+ntqv, index_of_process_pbl) if(idtend>1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + qgrs(1:im,1:levs,ntqv) - save_q(1:im,1:levs,ntqv) endif - idtend = dtidx(100+ntoz, index_for_cause_pbl) + idtend = dtidx(100+ntoz, index_of_process_pbl) if(idtend>1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + qgrs(1:im,1:levs,ntoz) - save_q(1:im,1:levs,ntoz) endif - idtend = dtidx(100+ntke, index_for_cause_pbl) + idtend = dtidx(100+ntke, index_of_process_pbl) if(idtend>1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (qgrs(1:im,1:levs,ntke) - save_q(1:im,1:levs,ntke)) endif diff --git a/physics/GFS_PBL_generic.meta b/physics/GFS_PBL_generic.meta index 5a7678c63..6d00aabd0 100644 --- a/physics/GFS_PBL_generic.meta +++ b/physics/GFS_PBL_generic.meta @@ -825,49 +825,49 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index 22897c1c4..23351e99e 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -16,13 +16,13 @@ end subroutine GFS_SCNV_generic_pre_finalize !! subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, gq0, & save_u, save_v, save_t, save_q, ntqv, nsamftrac, flag_for_scnv_generic_tend, & - dtidx, index_for_cause_scnv, errmsg, errflg) + dtidx, index_of_process_scnv, errmsg, errflg) use machine, only: kind_phys implicit none - integer, intent(in) :: im, levs, ntqv, nsamftrac, index_for_cause_scnv, dtidx(:,:) + integer, intent(in) :: im, levs, ntqv, nsamftrac, index_of_process_scnv, dtidx(:,:) logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0 real(kind=kind_phys), intent(in) :: gq0(:,:,:) @@ -48,7 +48,7 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, if (qdiag3d) then if(nsamftrac>0) then do n=1,nsamftrac - if(n==ntqv .or. dtidx(ntqv,index_for_cause_scnv)>1) then + if(n==ntqv .or. dtidx(ntqv,index_of_process_scnv)>1) then save_q(:,:,n) = gq0(:,:,n) endif enddo @@ -80,8 +80,8 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl frain, gu0, gv0, gt0, gq0, save_u, save_v, save_t, save_q, dqdti, clw, & shcnvcw, rain1, npdf3d, num_p3d, ncnvcld3d, cnvc, cnvw, nsamftrac, & rainc, cnvprcp, cnvprcpb, cnvw_phy_f3d, cnvc_phy_f3d, & - dtend, dtidx, index_for_temperature, index_for_x_wind, index_for_y_wind, & - index_for_cause_scnv, ntqv, flag_for_scnv_generic_tend, & + dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, & + index_of_process_scnv, ntqv, flag_for_scnv_generic_tend, & imfshalcnv, imfshalcnv_sas, imfshalcnv_samf, errmsg, errflg) use machine, only: kind_phys @@ -99,7 +99,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) - integer, intent(in) :: index_for_temperature, index_for_x_wind, index_for_y_wind, index_for_cause_scnv + integer, intent(in) :: index_of_temperature, index_of_x_wind, index_of_y_wind, index_of_process_scnv real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw ! Post code for SAS/SAMF @@ -148,30 +148,30 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl if (lssav .and. flag_for_scnv_generic_tend) then if (ldiag3d) then - idtend = dtidx(index_for_temperature, index_for_cause_scnv) + idtend = dtidx(index_of_temperature, index_of_process_scnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gt0 - save_t) * frain endif - idtend = dtidx(index_for_x_wind, index_for_cause_scnv) + idtend = dtidx(index_of_x_wind, index_of_process_scnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gu0 - save_u) * frain endif - idtend = dtidx(index_for_y_wind, index_for_cause_scnv) + idtend = dtidx(index_of_y_wind, index_of_process_scnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0 - save_v) * frain endif if(nsamftrac>0) then do n=1,nsamftrac - idtend = dtidx(100+n, index_for_cause_scnv) + idtend = dtidx(100+n, index_of_process_scnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n) - save_q(:,:,n)) * frain endif enddo else - idtend = dtidx(100+ntqv, index_for_cause_scnv) + idtend = dtidx(100+ntqv, index_of_process_scnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv) - save_q(:,:,ntqv)) * frain endif diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta index 9076e6050..c56ec9aa3 100644 --- a/physics/GFS_SCNV_generic.meta +++ b/physics/GFS_SCNV_generic.meta @@ -136,16 +136,16 @@ intent = in optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_cause_scnv] - standard_name = index_for_cause_scnv - long_name = tracer changes caused by shallow convection scheme +[index_of_process_scnv] + standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index + long_name = index of shallow convection process in second dimension of array cumulative change index units = index dimensions = () type = integer @@ -326,49 +326,49 @@ intent = inout optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_scnv] - standard_name = index_for_cause_scnv - long_name = tracer changes caused by shallow convection scheme +[index_of_process_scnv] + standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index + long_name = index of shallow convection process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 3181aaeaf..04cbf01f4 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -165,8 +165,8 @@ end subroutine GFS_suite_interstitial_2_finalize subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplflx, flag_cice, shal_cnv, old_monin, mstrat, & do_shoc, frac_grid, imfshalcnv, dtf, xcosz, adjsfcdsw, adjsfcdlw, cice, pgr, ulwsfc_cice, lwhd, htrsw, htrlw, xmu, ctei_rm, & work1, work2, prsi, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, cp, hvap, prslk, suntim, adjsfculw, adjsfculw_lnd, & - adjsfculw_ice, adjsfculw_wat, dlwsfc, ulwsfc, psmean, dtend, dtidx, index_for_cause_longwave, index_for_cause_shortwave, & - index_for_cause_pbl, index_for_cause_dcnv, index_for_cause_scnv, index_for_cause_mp, index_for_temperature, & + adjsfculw_ice, adjsfculw_wat, dlwsfc, ulwsfc, psmean, dtend, dtidx, index_of_process_longwave, index_of_process_shortwave, & + index_of_process_pbl, index_of_process_dcnv, index_of_process_scnv, index_of_process_mp, index_of_temperature, & ctei_rml, ctei_r, kinver, dry, icy, wet, frland, huge, use_LW_jacobian, errmsg, errflg) implicit none @@ -192,9 +192,9 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl ! dtend is only allocated if ldiag3d is .true. real(kind=kind_phys), optional, intent(inout), dimension(:,:,:) :: dtend integer, intent(in), dimension(:,:) :: dtidx - integer, intent(in) :: index_for_cause_longwave, index_for_cause_shortwave, & - index_for_cause_pbl, index_for_cause_dcnv, index_for_cause_scnv, & - index_for_cause_mp, index_for_temperature + integer, intent(in) :: index_of_process_longwave, index_of_process_shortwave, & + index_of_process_pbl, index_of_process_dcnv, index_of_process_scnv, & + index_of_process_mp, index_of_temperature logical, intent(in ), dimension(im) :: dry, icy, wet real(kind=kind_phys), intent(in ), dimension(im) :: frland @@ -283,42 +283,42 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl if (ldiag3d) then if (lsidea) then - idtend = dtidx(index_for_temperature,index_for_cause_longwave) + idtend = dtidx(index_of_temperature,index_of_process_longwave) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,1)*dtf endif - idtend = dtidx(index_for_temperature,index_for_cause_shortwave) + idtend = dtidx(index_of_temperature,index_of_process_shortwave) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,2)*dtf endif - idtend = dtidx(index_for_temperature,index_for_cause_pbl) + idtend = dtidx(index_of_temperature,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,3)*dtf endif - idtend = dtidx(index_for_temperature,index_for_cause_dcnv) + idtend = dtidx(index_of_temperature,index_of_process_dcnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,4)*dtf endif - idtend = dtidx(index_for_temperature,index_for_cause_scnv) + idtend = dtidx(index_of_temperature,index_of_process_scnv) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,5)*dtf endif - idtend = dtidx(index_for_temperature,index_for_cause_mp) + idtend = dtidx(index_of_temperature,index_of_process_mp) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,6)*dtf endif else - idtend = dtidx(index_for_temperature,index_for_cause_longwave) + idtend = dtidx(index_of_temperature,index_of_process_longwave) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + htrlw(:,:)*dtf endif - idtend = dtidx(index_for_temperature,index_for_cause_shortwave) + idtend = dtidx(index_of_temperature,index_of_process_shortwave) if(idtend>1) then do k=1,levs do i=1,im @@ -687,7 +687,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, & imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, dtf, save_qc, save_qi, con_pi, & gq0, clw, prsl, save_tcp, con_rd, nwfa, spechum, dqdti, dtidx, dtend, ntk, ntke, ldiag3d, & - index_for_cause_conv_trans, errmsg, errflg) + index_of_process_conv_trans, errmsg, errflg) use machine, only: kind_phys use module_mp_thompson_make_number_concentrations, only: make_IceNumber, make_DropletNumber @@ -711,7 +711,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to logical, intent(in) :: ldiag3d real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend integer, dimension(:,:), intent(in) :: dtidx - integer, intent(in) :: index_for_cause_conv_trans,ntk,ntke + integer, intent(in) :: index_of_process_conv_trans,ntk,ntke real(kind=kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0 real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw @@ -744,13 +744,13 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to if(ldiag3d) then if(ntk>0 .and. ntk<=size(clw,3)) then - idtend=dtidx(100+ntke,index_for_cause_conv_trans) + idtend=dtidx(100+ntke,index_of_process_conv_trans) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntk) endif endif if(ntclamt<=size(clw,3) .and. ntclamt>0) then - idtend=dtidx(100+ntclamt,index_for_cause_conv_trans) + idtend=dtidx(100+ntclamt,index_of_process_conv_trans) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntclamt) endif @@ -758,7 +758,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to endif if(ldiag3d .and. ntk>0) then - idtend=dtidx(100+ntke,index_for_cause_conv_trans) + idtend=dtidx(100+ntke,index_of_process_conv_trans) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntk) endif diff --git a/physics/GFS_suite_interstitial.meta b/physics/GFS_suite_interstitial.meta index 91aa9f6f7..bbe5d4828 100644 --- a/physics/GFS_suite_interstitial.meta +++ b/physics/GFS_suite_interstitial.meta @@ -673,73 +673,73 @@ intent = inout optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_cause_longwave] - standard_name = index_for_cause_longwave - long_name = tracer changes caused by long wave radiation +[index_of_process_longwave] + standard_name = index_of_longwave_heating_process_in_cumulative_change_index + long_name = index of longwave heating process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_shortwave] - standard_name = index_for_cause_shortwave - long_name = tracer changes caused by short wave radiation +[index_of_process_shortwave] + standard_name = index_of_shortwave_heating_process_in_cumulative_change_index + long_name = index of shortwave heating process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_dcnv] - standard_name = index_for_cause_dcnv - long_name = tracer changes caused by deep convection scheme +[index_of_process_dcnv] + standard_name = index_of_deep_convection_process_process_in_cumulative_change_index + long_name = index of deep convection process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_scnv] - standard_name = index_for_cause_scnv - long_name = tracer changes caused by shallow convection scheme +[index_of_process_scnv] + standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index + long_name = index of shallow convection process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_mp] - standard_name = index_for_cause_mp - long_name = tracer changes caused by microphysics scheme +[index_of_process_mp] + standard_name = index_of_microphysics_process_process_in_cumulative_change_index + long_name = index of microphysics transport process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer @@ -1906,18 +1906,18 @@ intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout @@ -1946,9 +1946,9 @@ type = logical intent = in optional = F -[index_for_cause_conv_trans] - standard_name = index_for_cause_conv_trans - long_name = tracer changes caused by convective transport of tracers +[index_of_process_conv_trans] + standard_name = index_of_convective_transport_process_in_cumulative_change_index + long_name = index of convective transport process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 12ab27ac7..5689d5a63 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -157,8 +157,8 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr dudt, dvdt, dtdt, rdxzb, con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt, & con_omega, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & ! FIXME: delete ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw, ldu3dt_cgw, ldv3dt_cgw, ldt3dt_cgw, & - dtend, dtidx, index_for_x_wind, index_for_y_wind, index_for_temperature, & - index_for_cause_orographic_gwd, index_for_cause_convective_gwd, & + dtend, dtidx, index_of_x_wind, index_of_y_wind, index_of_temperature, & + index_of_process_orographic_gwd, index_of_process_nonorographic_gwd, & ldiag3d, lssav, flag_for_gwd_generic_tend, errmsg, errflg) implicit none @@ -187,8 +187,8 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr ! dtend is only allocated if ldiag=.true. real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), & - index_for_x_wind, index_for_y_wind, index_for_temperature, & - index_for_cause_orographic_gwd, index_for_cause_convective_gwd + index_of_x_wind, index_of_y_wind, index_of_temperature, & + index_of_process_orographic_gwd, index_of_process_nonorographic_gwd logical, intent(in) :: ldiag3d, lssav @@ -285,15 +285,15 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - idtend = dtidx(index_for_x_wind,index_for_cause_orographic_gwd) + idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif - idtend = dtidx(index_for_y_wind,index_for_cause_orographic_gwd) + idtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif - idtend = dtidx(index_for_temperature,index_for_cause_orographic_gwd) + idtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif @@ -376,15 +376,15 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr endif if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - idtend = dtidx(index_for_x_wind,index_for_cause_convective_gwd) + idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dudt - Pdudt)*dtp endif - idtend = dtidx(index_for_y_wind,index_for_cause_convective_gwd) + idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dvdt - Pdvdt)*dtp endif - idtend = dtidx(index_for_temperature,index_for_cause_convective_gwd) + idtend = dtidx(index_of_temperature,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dtdt - Pdtdt)*dtp endif diff --git a/physics/cires_ugwp.meta b/physics/cires_ugwp.meta index 3dfc91b41..643ea3f18 100644 --- a/physics/cires_ugwp.meta +++ b/physics/cires_ugwp.meta @@ -868,58 +868,58 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys active = (flag_diagnostics_3D) intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_orographic_gwd] - standard_name = index_for_cause_orographic_gwd - long_name = tracer changes caused by orographic gravity wave drag +[index_of_process_orographic_gwd] + standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_convective_gwd] - standard_name = index_for_cause_convective_gwd - long_name = tracer changes caused by convective gravity wave drag +[index_of_process_nonorographic_gwd] + standard_name = index_of_nonorographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of nonorographic gravity wave drag process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 5d34a8bc0..6a2d75e24 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -71,8 +71,8 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend, & ! fixme: delete ! du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & ! du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV, & - dtend,dtidx,ntqv,ntiw,ntcw,index_for_temperature,index_for_x_wind,& - index_for_y_wind,index_for_cause_scnv,index_for_cause_dcnv, & + dtend,dtidx,ntqv,ntiw,ntcw,index_of_temperature,index_of_x_wind,& + index_of_y_wind,index_of_process_scnv,index_of_process_dcnv, & ldiag3d,qci_conv,errmsg,errflg) !------------------------------------------------------------- implicit none @@ -101,8 +101,8 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & ! dtend is only allocated if ldiag=.true. real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), & - index_for_x_wind, index_for_y_wind, index_for_temperature, & - index_for_cause_scnv, index_for_cause_dcnv, ntqv, ntcw, ntiw + index_of_x_wind, index_of_y_wind, index_of_temperature, & + index_of_process_scnv, index_of_process_dcnv, ntqv, ntcw, ntiw real(kind=kind_phys), dimension( im , km ), intent(in ) :: forcet,forceqv_spechum,w,phil real(kind=kind_phys), dimension( im , km ), intent(inout ) :: t,us,vs @@ -207,15 +207,15 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & cliw_deep_idx=1 clcw_deep_idx=1 else - cliw_deep_idx=dtidx(100+ntiw,index_for_cause_dcnv) - clcw_deep_idx=dtidx(100+ntcw,index_for_cause_dcnv) + cliw_deep_idx=dtidx(100+ntiw,index_of_process_dcnv) + clcw_deep_idx=dtidx(100+ntcw,index_of_process_dcnv) endif if(flag_for_scnv_generic_tend) then cliw_shal_idx=1 clcw_shal_idx=1 else - cliw_shal_idx=dtidx(100+ntiw,index_for_cause_scnv) - clcw_shal_idx=dtidx(100+ntcw,index_for_cause_scnv) + cliw_shal_idx=dtidx(100+ntiw,index_of_process_scnv) + clcw_shal_idx=dtidx(100+ntcw,index_of_process_scnv) endif if(cliw_deep_idx>1 .or. clcw_deep_idx>1 .or. & cliw_shal_idx>1 .or. clcw_shal_idx>1) then @@ -894,10 +894,10 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & ! if(ldiag3d) then if(ishallow_g3.eq.1 .and. .not.flag_for_scnv_generic_tend) then - uidx=dtidx(index_for_x_wind,index_for_cause_scnv) - vidx=dtidx(index_for_y_wind,index_for_cause_scnv) - tidx=dtidx(index_for_temperature,index_for_cause_scnv) - qidx=dtidx(100+ntqv,index_for_cause_scnv) + uidx=dtidx(index_of_x_wind,index_of_process_scnv) + vidx=dtidx(index_of_y_wind,index_of_process_scnv) + tidx=dtidx(index_of_temperature,index_of_process_scnv) + qidx=dtidx(100+ntqv,index_of_process_scnv) if(uidx>1) then do k=kts,ktf dtend(:,k,uidx) = dtend(:,k,uidx) + cutens(:)*outus(:,k) * dt @@ -924,9 +924,9 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & endif endif if((ideep.eq.1. .or. imid_gf.eq.1) .and. .not.flag_for_dcnv_generic_tend) then - uidx=dtidx(index_for_x_wind,index_for_cause_dcnv) - vidx=dtidx(index_for_y_wind,index_for_cause_dcnv) - tidx=dtidx(index_for_temperature,index_for_cause_dcnv) + uidx=dtidx(index_of_x_wind,index_of_process_dcnv) + vidx=dtidx(index_of_y_wind,index_of_process_dcnv) + tidx=dtidx(index_of_temperature,index_of_process_dcnv) if(uidx>1) then do k=kts,ktf dtend(:,k,uidx) = dtend(:,k,uidx) + (cuten*outu(:,k)+cutenm*outum(:,k)) * dt @@ -943,7 +943,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & enddo endif - qidx=dtidx(100+ntqv,index_for_cause_dcnv) + qidx=dtidx(100+ntqv,index_of_process_dcnv) if(qidx>1) then do k=kts,ktf do i=its,itf diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta index e8abd6797..c6dcd1a33 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/cu_gf_driver.meta @@ -368,19 +368,19 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F @@ -408,41 +408,41 @@ type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_scnv] - standard_name = index_for_cause_scnv - long_name = tracer changes caused by shallow convection scheme +[index_of_process_scnv] + standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index + long_name = index of shallow convection process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_dcnv] - standard_name = index_for_cause_dcnv - long_name = tracer changes caused by deep convection scheme +[index_of_process_dcnv] + standard_name = index_of_deep_convection_process_process_in_cumulative_change_index + long_name = index of deep convection process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/gwdc.f b/physics/gwdc.f index 608f6d39e..c43fbe481 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -1460,8 +1460,8 @@ end subroutine gwdc_post_init subroutine gwdc_post_run( & & im, levs, lssav, ldiag3d, dtf, dtp, con_cp, & & tauctx, taucty, gwdcu, gwdcv, & - & dugwd, dvgwd, dtend, dtidx, index_for_x_wind, index_for_y_wind, & - & index_for_cause_convective_gwd, gu0, gv0, gt0, & + & dugwd, dvgwd, dtend, dtidx, index_of_x_wind, index_of_y_wind, & + & index_of_process_nonorographic_gwd, gu0, gv0, gt0, & & errmsg, errflg) use machine, only : kind_phys @@ -1476,8 +1476,8 @@ subroutine gwdc_post_run( & real(kind=kind_phys), intent(inout) :: dugwd(:,:), dvgwd(:,:), & & gu0(:,:), gv0(:,:), gt0(:,:) real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_for_cause_convective_gwd - integer, intent(in) :: index_for_x_wind, index_for_y_wind + integer, intent(in) :: dtidx(:,:), index_of_process_nonorographic_gwd + integer, intent(in) :: index_of_x_wind, index_of_y_wind character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -1497,11 +1497,11 @@ subroutine gwdc_post_run( & endif ! end if_lssav if (ldiag3d) then - idtend = dtidx(index_for_x_wind,index_for_cause_convective_gwd) + idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + gwdcu(:,:) * dtf endif - idtend = dtidx(index_for_y_wind,index_for_cause_convective_gwd) + idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + gwdcv(:,:) * dtf endif diff --git a/physics/gwdc.meta b/physics/gwdc.meta index e9b4eaa4f..2298ed2c0 100644 --- a/physics/gwdc.meta +++ b/physics/gwdc.meta @@ -591,42 +591,42 @@ intent = inout optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys active = (flag_diagnostics_3D) intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_convective_gwd] - standard_name = index_for_cause_convective_gwd - long_name = tracer changes caused by convective gravity wave drag +[index_of_process_nonorographic_gwd] + standard_name = index_of_nonorographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of nonorographic gravity wave drag process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/module_MYJPBL_wrapper.F90 b/physics/module_MYJPBL_wrapper.F90 index e7230e90e..4db49cb5b 100644 --- a/physics/module_MYJPBL_wrapper.F90 +++ b/physics/module_MYJPBL_wrapper.F90 @@ -41,8 +41,8 @@ SUBROUTINE myjpbl_wrapper_run( & & dkt,xkzm_m, xkzm_h,xkzm_s, gamt,gamq, & & con_cp,con_g,con_rd, & & me, lprnt, gen_tend, ldiag3d, dtend, dtidx, & - & index_for_temperature, index_for_x_wind, & - & index_for_y_wind, index_for_cause_pbl, & + & index_of_temperature, index_of_x_wind, & + & index_of_y_wind, index_of_process_pbl, & & ntqv, errmsg, errflg ) ! @@ -80,8 +80,8 @@ SUBROUTINE myjpbl_wrapper_run( & real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) - integer, intent(in) :: index_for_temperature, index_for_x_wind, & - & index_for_y_wind, index_for_cause_pbl, ntqv + integer, intent(in) :: index_of_temperature, index_of_x_wind, & + & index_of_y_wind, index_of_process_pbl, ntqv !MYJ-1D integer,intent(in) :: im, levs @@ -586,10 +586,10 @@ SUBROUTINE myjpbl_wrapper_run( & end do end do if (ldiag3d .and. .not. gen_tend) then - uidx = dtidx(index_for_x_wind,index_for_cause_pbl) - vidx = dtidx(index_for_y_wind,index_for_cause_pbl) - tidx = dtidx(index_for_temperature,index_for_cause_pbl) - qidx = dtidx(ntqv+100,index_for_cause_pbl) + uidx = dtidx(index_of_x_wind,index_of_process_pbl) + vidx = dtidx(index_of_y_wind,index_of_process_pbl) + tidx = dtidx(index_of_temperature,index_of_process_pbl) + qidx = dtidx(ntqv+100,index_of_process_pbl) ! NOTE: The code that was here before was wrong. It replaced the ! cumulative value with the instantaneous value. do k=1,levs diff --git a/physics/module_MYJPBL_wrapper.meta b/physics/module_MYJPBL_wrapper.meta index bc998c136..5dae227ed 100644 --- a/physics/module_MYJPBL_wrapper.meta +++ b/physics/module_MYJPBL_wrapper.meta @@ -631,49 +631,49 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 5d317d23b..353ce77bc 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -83,10 +83,10 @@ SUBROUTINE mynnedmf_wrapper_run( & & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & ! <=== ntlnc, ntinc & dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc, & ! <=== ntwa, ntia & flag_for_pbl_generic_tend, & - & dtend, dtidx, index_for_temperature, & - & index_for_x_wind, index_for_y_wind, ntke, & + & dtend, dtidx, index_of_temperature, & + & index_of_x_wind, index_of_y_wind, ntke, & & ntqv, ntcw, ntiw, ntoz, ntlnc, ntinc, ntwa, ntia, & - & index_for_cause_pbl, htrsw, htrlw, xmu, & + & index_of_process_pbl, htrsw, htrlw, xmu, & & grav_settling, bl_mynn_tkebudget, bl_mynn_tkeadvect, & & bl_mynn_cloudpdf, bl_mynn_mixlength, & & bl_mynn_edmf, bl_mynn_edmf_mom, bl_mynn_edmf_tke, & @@ -213,8 +213,8 @@ SUBROUTINE mynnedmf_wrapper_run( & !TENDENCY DIAGNOSTICS real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) - integer, intent(in) :: index_for_temperature, index_for_x_wind, & - index_for_y_wind, index_for_cause_pbl + integer, intent(in) :: index_of_temperature, index_of_x_wind, & + index_of_y_wind, index_of_process_pbl integer, intent(in) :: ntoz, ntqv, ntcw, ntiw, ntlnc, ntinc, ntwa, ntia, ntke !MISC CONFIGURATION OPTIONS @@ -339,7 +339,7 @@ SUBROUTINE mynnedmf_wrapper_run( & endif if(.not. flag_for_pbl_generic_tend .and. ldiag3d) then - idtend = dtidx(ntke+100,index_for_cause_pbl) + idtend = dtidx(ntke+100,index_of_process_pbl) if(idtend>1) then allocate(save_qke_adv(im,levs)) save_qke_adv=qke_adv @@ -495,7 +495,7 @@ SUBROUTINE mynnedmf_wrapper_run( & enddo enddo endif - if(ldiag3d .and. dtidx(100+ntoz,index_for_cause_pbl)>1) then + if(ldiag3d .and. dtidx(100+ntoz,index_of_process_pbl)>1) then allocate(oldzone(im,levs)) oldzone = ozone endif @@ -720,11 +720,11 @@ SUBROUTINE mynnedmf_wrapper_run( & enddo enddo accum_duvt3dt: if(ldiag3d .or. lsidea) then - call dtend_helper(index_for_x_wind,RUBLTEN) - call dtend_helper(index_for_y_wind,RVBLTEN) - call dtend_helper(index_for_temperature,RTHBLTEN,exner) + call dtend_helper(index_of_x_wind,RUBLTEN) + call dtend_helper(index_of_y_wind,RVBLTEN) + call dtend_helper(index_of_temperature,RTHBLTEN,exner) if(ldiag3d) then - idtend = dtidx(100+ntoz,index_for_cause_pbl) + idtend = dtidx(100+ntoz,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (ozone-oldzone) deallocate(oldzone) @@ -917,7 +917,7 @@ SUBROUTINE mynnedmf_wrapper_run( & if(allocated(save_qke_adv)) then if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then - idtend = dtidx(100+ntke,index_for_cause_pbl) + idtend = dtidx(100+ntke,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + qke_adv-save_qke_adv endif @@ -933,7 +933,7 @@ SUBROUTINE dtend_helper(itracer,field,mult) integer, intent(in) :: itracer integer :: idtend - idtend=dtidx(itracer,index_for_cause_pbl) + idtend=dtidx(itracer,index_of_process_pbl) if(idtend>1) then if(present(mult)) then dtend(:,:,idtend) = dtend(:,:,idtend) + field*dtf*mult diff --git a/physics/module_MYNNPBL_wrapper.meta b/physics/module_MYNNPBL_wrapper.meta index 99f911b03..4e490ff3d 100644 --- a/physics/module_MYNNPBL_wrapper.meta +++ b/physics/module_MYNNPBL_wrapper.meta @@ -1012,41 +1012,41 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer @@ -1124,9 +1124,9 @@ type = integer intent = in optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 148f2210f..c34120e82 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -66,8 +66,8 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr, & & xkzminv,moninq_fac,hurr_pbl,islimsk,var_ric, & & coef_ric_l,coef_ric_s,ldiag3d,ntqv,rtg_ozone_index,ntoz, & - & dtend,dtidx,index_for_cause_pbl,index_for_x_wind, & - & index_for_y_wind,index_for_temperature, & + & dtend,dtidx,index_of_process_pbl,index_of_x_wind, & + & index_of_y_wind,index_of_temperature, & & flag_for_pbl_generic_tend,errmsg,errflg) ! use machine , only : kind_phys @@ -97,8 +97,8 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! dtend is only allocated if ldiag3d or qdiag3d are true real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) - integer, intent(in) :: index_for_x_wind, index_for_y_wind, & - & index_for_cause_pbl, index_for_temperature, ntqv, rtg_ozone_index + integer, intent(in) :: index_of_x_wind, index_of_y_wind, & + & index_of_process_pbl, index_of_temperature, ntqv, rtg_ozone_index real(kind=kind_phys), intent(in) :: & & u1(im,km), v1(im,km), & & t1(im,km), q1(im,km,ntrac), & @@ -1293,8 +1293,8 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo enddo if(.not.flag_for_pbl_generic_tend) then - idtend1=dtidx(index_for_temperature,index_for_cause_pbl) - idtend2=dtidx(ntqv+100,index_for_cause_pbl) + idtend1=dtidx(index_of_temperature,index_of_process_pbl) + idtend2=dtidx(ntqv+100,index_of_process_pbl) if(idtend1>1) then do k = 1,km do i = 1,im @@ -1324,7 +1324,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo if(.not.flag_for_pbl_generic_tend .and. ldiag3d .and. & & rtg_ozone_index>0) then - idtend1 = dtidx(100+ntoz,index_for_cause_pbl) + idtend1 = dtidx(100+ntoz,index_of_process_pbl) if(idtend1>1) then kk = rtg_ozone_index is = (kk-1) * km @@ -1456,7 +1456,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo enddo if(.not.flag_for_pbl_generic_tend) then - idtend1 = dtidx(index_for_x_wind,index_for_cause_pbl) + idtend1 = dtidx(index_of_x_wind,index_of_process_pbl) if(idtend1>1) then do k = 1,km do i = 1,im @@ -1466,7 +1466,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo endif - idtend2 = dtidx(index_for_y_wind,index_for_cause_pbl) + idtend2 = dtidx(index_of_y_wind,index_of_process_pbl) if(idtend2>1) then do k = 1,km do i = 1,im diff --git a/physics/moninedmf.meta b/physics/moninedmf.meta index 16abc742b..445dc99d9 100644 --- a/physics/moninedmf.meta +++ b/physics/moninedmf.meta @@ -571,50 +571,50 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys active = (flag_diagnostics_3D) intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/moninshoc.f b/physics/moninshoc.f index c92dc460f..a78bfb25a 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -32,8 +32,8 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, & dusfc,dvsfc,dtsfc,dqsfc,dkt,hpbl, & kinver,xkzm_m,xkzm_h,xkzm_s,xkzminv, & grav,rd,cp,hvap,fv,ntoz,dtend,dtidx, - & index_for_temperature,index_for_x_wind, - & index_for_y_wind,index_for_cause_pbl, + & index_of_temperature,index_of_x_wind, + & index_of_y_wind,index_of_process_pbl, & gen_tend,ldiag3d,ntqv,errmsg,errflg) ! use machine , only : kind_phys @@ -64,8 +64,8 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend integer, dimension(:,:), intent(in) :: dtidx - integer, intent(in) :: index_for_temperature, index_for_x_wind, - & index_for_y_wind, index_for_cause_pbl, ntqv + integer, intent(in) :: index_of_temperature, index_of_x_wind, + & index_of_y_wind, index_of_process_pbl, ntqv logical, intent(in) :: ldiag3d, & gen_tend @@ -452,11 +452,11 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, enddo enddo if(ldiag3d .and. .not. gen_tend) then - idtend = dtidx(index_for_temperature,index_for_cause_pbl) + idtend = dtidx(index_of_temperature,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (a1-t1) endif - idtend = dtidx(ntqv+100,index_for_cause_pbl) + idtend = dtidx(ntqv+100,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + a2-q1(:,:,1) endif @@ -479,7 +479,7 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, endif enddo if(ldiag3d .and. ntoz>0 .and. .not. gen_tend) then - idtend=dtidx(100+ntoz,index_for_cause_pbl) + idtend=dtidx(100+ntoz,index_of_process_pbl) if(idtend>0) then kk = ntoz is = (kk-1) * km @@ -537,11 +537,11 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, enddo enddo if (ldiag3d .and. .not. gen_tend) then - idtend = dtidx(index_for_x_wind,index_for_cause_pbl) + idtend = dtidx(index_of_x_wind,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + a1-u1 endif - idtend = dtidx(index_for_y_wind,index_for_cause_pbl) + idtend = dtidx(index_of_y_wind,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + a1-v1 endif diff --git a/physics/moninshoc.meta b/physics/moninshoc.meta index 2cc53ebd5..c5849fc39 100644 --- a/physics/moninshoc.meta +++ b/physics/moninshoc.meta @@ -476,49 +476,49 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = in optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/ozphys.f b/physics/ozphys.f index 551b89da0..7b03d8d84 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -47,9 +47,9 @@ end subroutine ozphys_finalize subroutine ozphys_run ( & & im, levs, ko3, dt, oz, tin, po3, & & prsl, prdout, oz_coeff, delp, ldiag3d, & - & ntoz, dtend, dtidx, index_for_cause_prod_loss, & - & index_for_cause_ozmix, index_for_cause_temp, & - & index_for_cause_overhead_ozone, con_g, me, errmsg, errflg) + & ntoz, dtend, dtidx, index_of_process_prod_loss, & + & index_of_process_ozmix, index_of_process_temp, & + & index_of_process_overhead_ozone, con_g, me, errmsg, errflg) ! ! this code assumes that both prsl and po3 are from bottom to top ! as are all other variables @@ -64,8 +64,8 @@ subroutine ozphys_run ( & ! The dtend array may not be allocated and needs an assumed array size real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), ntoz, & - & index_for_cause_prod_loss, index_for_cause_ozmix, & - & index_for_cause_temp, index_for_cause_overhead_ozone + & index_of_process_prod_loss, index_of_process_ozmix, & + & index_of_process_temp, index_of_process_overhead_ozone real(kind=kind_phys), intent(in) :: & & dt, po3(ko3), prdout(im,ko3,oz_coeff), & & prsl(im,levs), tin(im,levs), delp(im,levs), & @@ -93,10 +93,10 @@ subroutine ozphys_run ( & if(ldiag3d) then - idtend(1) = dtidx(100+ntoz,index_for_cause_prod_loss) ! was ozp1 - idtend(2) = dtidx(100+ntoz,index_for_cause_ozmix) ! was ozp2 - idtend(3) = dtidx(100+ntoz,index_for_cause_temp) ! was ozp3 - idtend(4) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp4 + idtend(1) = dtidx(100+ntoz,index_of_process_prod_loss) ! was ozp1 + idtend(2) = dtidx(100+ntoz,index_of_process_ozmix) ! was ozp2 + idtend(3) = dtidx(100+ntoz,index_of_process_temp) ! was ozp3 + idtend(4) = dtidx(100+ntoz,index_of_process_overhead_ozone) ! was ozp4 else idtend=1 endif diff --git a/physics/ozphys.meta b/physics/ozphys.meta index aee1a8622..274c50210 100644 --- a/physics/ozphys.meta +++ b/physics/ozphys.meta @@ -141,20 +141,20 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys active = (flag_diagnostics_3D) intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F @@ -166,33 +166,33 @@ type = integer intent = in optional = F -[index_for_cause_prod_loss] - standard_name = index_for_cause_prod_loss - long_name = tracer changes caused by ozone production and loss +[index_of_process_prod_loss] + standard_name = index_of_production_and_loss_process_in_cumulative_change_index + long_name = index of production and loss effect in photochemistry process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_ozmix] - standard_name = index_for_cause_ozmix - long_name = tracer changes caused by ozone mixing ratio +[index_of_process_ozmix] + standard_name = index_of_ozone_mixing_ratio_process_in_cumulative_change_index + long_name = index of ozone mixing ratio effect in photochemistry process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_temp] - standard_name = index_for_cause_temp - long_name = tracer changes caused by temperature +[index_of_process_temp] + standard_name = index_of_temperature_process_in_cumulative_change_index + long_name = index of temperature effect in photochemistry process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_overhead_ozone] - standard_name = index_for_cause_overhead_ozone - long_name = tracer changes caused by overhead ozone column +[index_of_process_overhead_ozone] + standard_name = index_of_overhead_process_in_cumulative_change_index + long_name = index of overhead ozone effect in photochemistry process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index f4561c769..3d44a4f92 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -50,9 +50,9 @@ end subroutine ozphys_2015_finalize !!\author June 2015 - Shrinivas Moorthi subroutine ozphys_2015_run ( & & im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_coeff, & - & delp, ldiag3d, dtend, dtidx, ntoz, index_for_cause_prod_loss,& - & index_for_cause_ozmix, index_for_cause_temp, & - & index_for_cause_overhead_ozone, con_g, me, errmsg, errflg) + & delp, ldiag3d, dtend, dtidx, ntoz, index_of_process_prod_loss& + & , index_of_process_ozmix, index_of_process_temp, & + & index_of_process_overhead_ozone, con_g, me, errmsg, errflg) ! ! use machine , only : kind_phys @@ -68,8 +68,8 @@ subroutine ozphys_2015_run ( & ! dtend may not be allocated and needs an assumed array size real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), ntoz, & - & index_for_cause_prod_loss, index_for_cause_ozmix, & - & index_for_cause_temp, index_for_cause_overhead_ozone + & index_of_process_prod_loss, index_of_process_ozmix, & + & index_of_process_temp, index_of_process_overhead_ozone real(kind=kind_phys), intent(inout) :: oz(im,levs) @@ -88,10 +88,10 @@ subroutine ozphys_2015_run ( & errflg = 0 if(ldiag3d) then - idtend(1) = dtidx(100+ntoz,index_for_cause_prod_loss) ! was ozp1 - idtend(2) = dtidx(100+ntoz,index_for_cause_ozmix) ! was ozp2 - idtend(3) = dtidx(100+ntoz,index_for_cause_temp) ! was ozp3 - idtend(4) = dtidx(100+ntoz,index_for_cause_overhead_ozone) ! was ozp4 + idtend(1) = dtidx(100+ntoz,index_of_process_prod_loss) ! was ozp1 + idtend(2) = dtidx(100+ntoz,index_of_process_ozmix) ! was ozp2 + idtend(3) = dtidx(100+ntoz,index_of_process_temp) ! was ozp3 + idtend(4) = dtidx(100+ntoz,index_of_process_overhead_ozone) ! was ozp4 else idtend=1 endif diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index 8dc9ee994..5e59a13eb 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -141,20 +141,20 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys active = (flag_diagnostics_3D) intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F @@ -166,33 +166,33 @@ type = integer intent = in optional = F -[index_for_cause_prod_loss] - standard_name = index_for_cause_prod_loss - long_name = tracer changes caused by ozone production and loss +[index_of_process_prod_loss] + standard_name = index_of_production_and_loss_process_in_cumulative_change_index + long_name = index of production and loss effect in photochemistry process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_ozmix] - standard_name = index_for_cause_ozmix - long_name = tracer changes caused by ozone mixing ratio +[index_of_process_ozmix] + standard_name = index_of_ozone_mixing_ratio_process_in_cumulative_change_index + long_name = index of ozone mixing ratio effect in photochemistry process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_temp] - standard_name = index_for_cause_temp - long_name = tracer changes caused by temperature +[index_of_process_temp] + standard_name = index_of_temperature_process_in_cumulative_change_index + long_name = index of temperature effect in photochemistry process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_overhead_ozone] - standard_name = index_for_cause_overhead_ozone - long_name = tracer changes caused by overhead ozone column +[index_of_process_overhead_ozone] + standard_name = index_of_overhead_process_in_cumulative_change_index + long_name = index of overhead ozone effect in photochemistry process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/phys_tend.F90 b/physics/phys_tend.F90 index e05b52416..5b0272caa 100644 --- a/physics/phys_tend.F90 +++ b/physics/phys_tend.F90 @@ -20,14 +20,14 @@ end subroutine phys_tend_finalize !! \htmlinclude phys_tend_run.html !! subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & - index_for_cause_physics, index_for_cause_non_physics, & + index_of_process_physics, index_of_process_non_physics, & ncause, errmsg, errflg) ! Interface variables logical, intent(in) :: ldiag3d real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_for_cause_physics, & - index_for_cause_non_physics, ntracp100, ncause + integer, intent(in) :: dtidx(:,:), index_of_process_physics, & + index_of_process_non_physics, ntracp100, ncause character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -44,13 +44,13 @@ subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & do itrac=2,ntracp100 first=.true. - iphys = dtidx(itrac,index_for_cause_physics) + iphys = dtidx(itrac,index_of_process_physics) if(iphys<2) then cycle ! No physics tendency requested for this tracer endif do icause=1,ncause - if(icause==index_for_cause_physics .or. & - icause==index_for_cause_non_physics) then + if(icause==index_of_process_physics .or. & + icause==index_of_process_non_physics) then cycle ! Don't sum up the sums. endif idtend = dtidx(itrac,icause) diff --git a/physics/phys_tend.meta b/physics/phys_tend.meta index bf3ff536c..fa11ba23c 100644 --- a/physics/phys_tend.meta +++ b/physics/phys_tend.meta @@ -16,49 +16,49 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F [ntracp100] standard_name = number_of_tracers_plus_one_hundred - long_name = number of tracers plus one_hundred + long_name = number of tracers plus one hundred units = count dimensions = () type = integer intent = in optional = F -[index_for_cause_physics] - standard_name = index_for_cause_physics - long_name = tracer changes caused by physics schemes +[index_of_process_physics] + standard_name = index_of_all_physics_process_in_cumulative_change_index + long_name = index of all physics transport process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_non_physics] - standard_name = index_for_cause_non_physics - long_name = tracer changes caused by everything except physics schemes +[index_of_process_non_physics] + standard_name = index_of_non_physics_process_in_cumulative_change_index + long_name = index of non-physics transport process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F [ncause] - standard_name = number_of_possible_causes_of_tracer_changes - long_name = number of possible causes of tracer changes + standard_name = number_of_cumulative_change_processes + long_name = number of processes that cause changes in state variables units = count dimensions = () type = integer diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f index 730915c6d..d44c1b6cb 100644 --- a/physics/rayleigh_damp.f +++ b/physics/rayleigh_damp.f @@ -23,8 +23,8 @@ end subroutine rayleigh_damp_init !> @{ subroutine rayleigh_damp_run ( & & lsidea,IM,KM,A,B,C,U1,V1,DT,CP,LEVR,pgr,PRSL,PRSLRD0,ral_ts, & - & ldiag3d,dtend,dtidx,index_for_cause_rayleigh_damping, & - & index_for_temperature,index_for_x_wind,index_for_y_wind, & + & ldiag3d,dtend,dtidx,index_of_process_rayleigh_damping, & + & index_of_temperature,index_of_x_wind,index_of_y_wind, & & errmsg,errflg) ! ! ******************************************************************** @@ -74,8 +74,8 @@ subroutine rayleigh_damp_run ( & real(kind=kind_phys),intent(inout) :: A(IM,KM), B(IM,KM), C(IM,KM) real(kind=kind_phys),optional, intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), & - & index_for_cause_rayleigh_damping, index_for_temperature, & - & index_for_x_wind, index_for_y_wind + & index_of_process_rayleigh_damping, index_of_temperature, & + & index_of_x_wind, index_of_y_wind character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -87,10 +87,10 @@ subroutine rayleigh_damp_run ( & integer i, k, uidx,vidx,tidx if(ldiag3d) then - uidx=dtidx(index_for_x_wind,index_for_cause_rayleigh_damping) - vidx=dtidx(index_for_y_wind,index_for_cause_rayleigh_damping) - tidx=dtidx(index_for_temperature, & - & index_for_cause_rayleigh_damping) + uidx=dtidx(index_of_x_wind,index_of_process_rayleigh_damping) + vidx=dtidx(index_of_y_wind,index_of_process_rayleigh_damping) + tidx=dtidx(index_of_temperature, & + & index_of_process_rayleigh_damping) else uidx=1 vidx=1 diff --git a/physics/rayleigh_damp.meta b/physics/rayleigh_damp.meta index 8300b7e07..059f8e08b 100644 --- a/physics/rayleigh_damp.meta +++ b/physics/rayleigh_damp.meta @@ -147,50 +147,50 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys active = (flag_diagnostics_3D) intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_cause_rayleigh_damping] - standard_name = index_for_cause_rayleigh_damping - long_name = tracer changes caused by Rayleigh damping +[index_of_process_rayleigh_damping] + standard_name = index_of_rayleigh_damping_process_in_cumulative_change_index + long_name = index of rayleigh damping process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index c7acf9553..fdfa49e3e 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -61,8 +61,8 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & & prsi,del,prsl,prslk,phii,phil,delt, & & dspheat,dusfc,dvsfc,dtsfc,dqsfc,hpbl, & & kinver,xkzm_m,xkzm_h,xkzm_s, & - & index_for_temperature,index_for_x_wind,index_for_y_wind, & - & index_for_cause_pbl,ntqv,ntoz,dtend,dtidx, & + & index_of_temperature,index_of_x_wind,index_of_y_wind, & + & index_of_process_pbl,ntqv,ntoz,dtend,dtidx, & & gen_tend,ldiag3d,errmsg,errflg) ! use machine , only : kind_phys @@ -77,8 +77,8 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & ! logical, intent(in) :: gen_tend, ldiag3d real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend - integer, intent(in) :: index_for_temperature,index_for_x_wind, & - & index_for_y_wind, ntqv, ntoz, dtidx(:,:), index_for_cause_pbl + integer, intent(in) :: index_of_temperature,index_of_x_wind, & + & index_of_y_wind, ntqv, ntoz, dtidx(:,:), index_of_process_pbl ! real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, & & eps,epsm1 @@ -1403,11 +1403,11 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if (ldiag3d .and. .not. gen_tend) then - idtend = dtidx(index_for_temperature,index_for_cause_pbl) + idtend = dtidx(index_of_temperature,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f1-t1) endif - idtend = dtidx(100+ntqv,index_for_cause_pbl) + idtend = dtidx(100+ntqv,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) +delt*rdt*(f2-q1(:,:,1)) endif @@ -1513,11 +1513,11 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if (ldiag3d .and. .not. gen_tend) then - idtend=dtidx(index_for_x_wind,index_for_cause_pbl) + idtend=dtidx(index_of_x_wind,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f1-u1) endif - idtend=dtidx(index_for_y_wind,index_for_cause_pbl) + idtend=dtidx(index_of_y_wind,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f2-v1) endif diff --git a/physics/satmedmfvdif.meta b/physics/satmedmfvdif.meta index 52ea8c4ff..612ec0601 100644 --- a/physics/satmedmfvdif.meta +++ b/physics/satmedmfvdif.meta @@ -550,49 +550,49 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = in optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index f0ef9e890..ae70a3227 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -65,8 +65,8 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & & prsi,del,prsl,prslk,phii,phil,delt, & & dspheat,dusfc,dvsfc,dtsfc,dqsfc,hpbl, & & kinver,xkzm_m,xkzm_h,xkzm_s,dspfac,bl_upfr,bl_dnfr, & - & ntoz,ntqv,dtend,dtidx,index_for_temperature,index_for_x_wind,& - & index_for_y_wind,index_for_cause_pbl,gen_tend,ldiag3d, & + & ntoz,ntqv,dtend,dtidx,index_of_temperature,index_of_x_wind, & + & index_of_y_wind,index_of_process_pbl,gen_tend,ldiag3d, & & errmsg,errflg) ! use machine , only : kind_phys @@ -103,9 +103,8 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & & prsl(im,km), prslk(im,km), & & phii(im,km+1), phil(im,km) real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend - integer, intent(in) :: dtidx(:,:), index_for_temperature, index_f & - & or_x_wind, index_for_y_wind, index_for_cause & - & _pbl + integer, intent(in) :: dtidx(:,:), index_of_temperature, & + & index_of_x_wind, index_of_y_wind, index_of_process_pbl real(kind=kind_phys), intent(out) :: & & dusfc(im), dvsfc(im), & & dtsfc(im), dqsfc(im), & @@ -1423,7 +1422,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if(ldiag3d .and. .not. gen_tend) then - idtend=dtidx(index_for_temperature,index_for_cause_pbl) + idtend=dtidx(index_of_temperature,index_of_process_pbl) if(idtend>1) then do k = 1,km do i = 1,im @@ -1433,7 +1432,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo endif ! Send tendencies just for QV; other tracers are below. - idtend=dtidx(100+ntqv,index_for_cause_pbl) + idtend=dtidx(100+ntqv,index_of_process_pbl) if(idtend>1) then do k = 1,km do i = 1,im @@ -1458,7 +1457,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & ! Send tendencies for all tracers that were selected. do kk = 2, ntrac1 is = (kk-1) * km - idtend = dtidx(kk+100,index_for_cause_pbl) + idtend = dtidx(kk+100,index_of_process_pbl) if(idtend>1) then if(kk==ntke) then do k = 1, km @@ -1492,7 +1491,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if(ldiag3d .and. .not. gen_tend) then - idtend=dtidx(index_for_temperature,index_for_cause_pbl) + idtend=dtidx(index_of_temperature,index_of_process_pbl) if(idtend>1) then do k = 1,km1 do i = 1,im @@ -1579,7 +1578,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo if(ldiag3d .and. .not. gen_tend) then - idtend=dtidx(index_for_x_wind,index_for_cause_pbl) + idtend=dtidx(index_of_x_wind,index_of_process_pbl) if(idtend>1) then do k = 1,km do i = 1,im @@ -1589,7 +1588,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo endif - idtend=dtidx(index_for_y_wind,index_for_cause_pbl) + idtend=dtidx(index_of_y_wind,index_of_process_pbl) if(idtend>1) then do k = 1,km do i = 1,im diff --git a/physics/satmedmfvdifq.meta b/physics/satmedmfvdifq.meta index ee98d6494..3251071d9 100644 --- a/physics/satmedmfvdifq.meta +++ b/physics/satmedmfvdifq.meta @@ -610,49 +610,49 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = in optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index a50a5747a..52b2f4ba4 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -36,8 +36,8 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & u10,v10, & dx,lssav,ldiag3d, & flag_for_pbl_generic_tend,ntoz,ntqv,dtend,dtidx, & - index_for_cause_pbl,index_for_temperature,index_for_x_wind, & - index_for_y_wind,errmsg,errflg ) + index_of_process_pbl,index_of_temperature,index_of_x_wind, & + index_of_y_wind,errmsg,errflg ) use machine , only : kind_phys ! @@ -163,8 +163,8 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & ! 3D diagnostic tendencies; dtend is only allocated if ldiag3d=.true. real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_for_cause_pbl, ntqv, & - index_for_x_wind, index_for_y_wind, index_for_temperature + integer, intent(in) :: dtidx(:,:), index_of_process_pbl, ntqv, & + index_of_x_wind, index_of_y_wind, index_of_temperature ! Index within dtend third dimension for tendency of interest: integer :: idtend @@ -971,7 +971,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then - idtend = dtidx(index_for_temperature,index_for_cause_pbl) + idtend = dtidx(index_of_temperature,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f1-thx+300.)*rdt*pi2d endif @@ -1101,7 +1101,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then - idtend = dtidx(ntqv+100,index_for_cause_pbl) + idtend = dtidx(ntqv+100,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*rdt*(f3(:,:,1)-qx(:,:,1)) endif @@ -1137,7 +1137,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo if(lssav .and. ldiag3d .and. ntoz>0 .and. & & .not. flag_for_pbl_generic_tend) then - idtend=dtidx(ntoz+100,index_for_cause_pbl) + idtend=dtidx(ntoz+100,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + qtend*(f3(:,:,ntoz)-qx(:,:,ntoz)) endif @@ -1234,11 +1234,11 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then - idtend=dtidx(index_for_x_wind,index_for_cause_pbl) + idtend=dtidx(index_of_x_wind,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*rdt*(f1-ux) endif - idtend=dtidx(index_for_y_wind,index_for_cause_pbl) + idtend=dtidx(index_of_y_wind,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*rdt*(f2-vx) endif diff --git a/physics/shinhongvdif.meta b/physics/shinhongvdif.meta index 34a18d52d..9adacaa9c 100644 --- a/physics/shinhongvdif.meta +++ b/physics/shinhongvdif.meta @@ -458,49 +458,49 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_cause_pbl] - standard_name = index_for_cause_pbl - long_name = tracer changes caused by PBL scheme +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index fd086a10c..af3204e90 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -206,8 +206,8 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, dudt_mtb, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & dudt, dvdt, dtdt, rdxzb, con_g, con_omega, con_pi, con_cp, con_rd, con_rv, & con_rerth, con_fvirt, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & - dtend, dtidx, index_for_temperature, index_for_x_wind, index_for_y_indw, & - index_for_cause_orographic_gwd, index_for_cause_convective_gwd, & + dtend, dtidx, index_of_temperature, index_of_x_wind, index_for_y_indw, & + index_of_process_orographic_gwd, index_of_process_nonorographic_gwd, & ldiag3d, lssav, flag_for_gwd_generic_tend, do_ugwp_v0, do_ugwp_v0_orog_only, & do_ugwp_v0_nst_only, do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, & gwd_opt, errmsg, errflg) @@ -262,9 +262,9 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, ! The dtend array is are only allocated if ldiag=.true. real(kind=kind_phys), intent(inout), optional :: dtend - integer, intent(in) :: dtidx, index_for_temperature, index_for_x_wind, & - index_for_y_wind, index_for_cause_convective_gwd, & - index_for_cause_orographic_gwd + integer, intent(in) :: dtidx, index_of_temperature, index_of_x_wind, & + index_of_y_wind, index_of_process_nonorographic_gwd, & + index_of_process_orographic_gwd logical, intent(in) :: ldiag3d, lssav ! These arrays only allocated if ldiag_ugwp = .true. @@ -385,17 +385,17 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - idtend = dtidx(index_for_cause_x_wind,index_for_cause_orographic_gwd) + idtend = dtidx(index_for_cause_x_wind,index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif - idtend = dtidx(index_for_cause_y_wind,index_for_cause_orographic_gwd) + idtend = dtidx(index_for_cause_y_wind,index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif - idtend = dtidx(index_for_cause_temperature,index_for_cause_orographic_gwd) + idtend = dtidx(index_of_process_temperature,index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif @@ -485,17 +485,17 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, endif ! cdmbgwd(3) > 0.0 if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - idtend = dtidx(index_for_cause_x_wind,index_for_cause_convective_gwd) + idtend = dtidx(index_for_cause_x_wind,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif - idtend = dtidx(index_for_cause_y_wind,index_for_cause_convective_gwd) + idtend = dtidx(index_for_cause_y_wind,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif - idtend = dtidx(index_for_cause_temperature,index_for_cause_convective_gwd) + idtend = dtidx(index_of_process_temperature,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif diff --git a/physics/unified_ugwp.meta b/physics/unified_ugwp.meta index 2fa8a7a9c..a953acc7d 100644 --- a/physics/unified_ugwp.meta +++ b/physics/unified_ugwp.meta @@ -1188,57 +1188,57 @@ intent = in optional = F [dtend] - standard_name = diagnostic_3d_tendencies - long_name = diagnostic 3d tendencies for tracers and other fields + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables units = various - dimensions = (horizontal_loop_extent,vertical_dimension,dtend_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout optional = F [dtidx] - standard_name = dtend_outer_index - long_name = index in outer dimension of dtend of a tracer-cause pair + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_possible_causes_of_tracer_changes) + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in optional = F -[index_for_temperature] - standard_name = index_for_temperature - long_name = index in dtidx first dimension of temperature field +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_x_wind] - standard_name = index_for_x_wind - long_name = index in dtidx first dimension of x wind field +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_y_wind] - standard_name = index_for_y_wind - long_name = index in dtidx first dimension of x wind field +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_orographic_gwd] - standard_name = index_for_cause_orographic_gwd - long_name = tracer changes caused by orographic gravity wave drag +[index_of_process_orographic_gwd] + standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index units = index dimensions = () type = integer intent = in optional = F -[index_for_cause_convective_gwd] - standard_name = index_for_cause_convective_gwd - long_name = tracer changes caused by convective gravity wave drag +[index_of_process_nonorographic_gwd] + standard_name = index_of_nonorographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of nonorographic gravity wave drag process in second dimension of array cumulative change index units = index dimensions = () type = integer diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index 4ccc37a41..8f71bc56f 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -35,8 +35,8 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & dusfc,dvsfc,dtsfc,dqsfc, & dt,kpbl1d,u10,v10,lssav,ldiag3d,qdiag3d, & flag_for_pbl_generic_tend,ntoz,ntqv,dtend,dtidx, & - index_for_temperature,index_for_x_wind,index_for_y_wind, & - index_for_cause_pbl,errmsg,errflg ) + index_of_temperature,index_of_x_wind,index_of_y_wind, & + index_of_process_pbl,errmsg,errflg ) use machine , only : kind_phys ! @@ -90,8 +90,8 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & real(kind=kind_phys), dimension( im,km,ntrac ) , & intent(inout) :: qtnp real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), ntqv, index_for_temperature, & - index_for_x_wind, index_for_y_wind, index_for_cause_pbl + integer, intent(in) :: dtidx(:,:), ntqv, index_of_temperature, & + index_of_x_wind, index_of_y_wind, index_of_process_pbl ! !--------------------------------------------------------------------------------- ! output variables @@ -856,7 +856,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then - idtend = dtidx(index_for_temperature,index_for_cause_pbl) + idtend = dtidx(index_of_temperature,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f1-thx+300.)*rdt*pi2d endif @@ -970,7 +970,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. qdiag3d .and. .not. flag_for_pbl_generic_tend) then - idtend = dtidx(ntqv+100,index_for_cause_pbl) + idtend = dtidx(ntqv+100,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f3(:,:,1)-qx(:,:,1))*rdt endif @@ -987,7 +987,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo if(lssav .and. ldiag3d .and. ntoz>0 .and. qdiag3d .and. & & .not. flag_for_pbl_generic_tend) then - idtend = dtidx(100+ntoz,index_for_cause_pbl) + idtend = dtidx(100+ntoz,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + f3(:,:,ntoz)-qx(:,:,ntoz) endif @@ -1074,12 +1074,12 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then - idtend = dtidx(index_for_x_wind,index_for_cause_pbl) + idtend = dtidx(index_of_x_wind,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f1-ux)*rdt endif - idtend = dtidx(index_for_y_wind,index_for_cause_pbl) + idtend = dtidx(index_of_y_wind,index_of_process_pbl) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f2-vx)*rdt endif From 9c509c4be344f7aa970c66badb91dd8b3f9f9f94 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 29 Mar 2021 19:56:20 +0000 Subject: [PATCH 10/24] Fix syntax errors, indentation errors, and variable names. --- physics/GFS_GWD_generic.F90 | 6 +- physics/GFS_MP_generic.F90 | 6 +- physics/GFS_MP_generic.meta | 8 --- physics/GFS_debug.F90 | 8 +-- physics/cires_ugwp.F90 | 5 +- physics/cu_gf_driver.F90 | 6 +- physics/gwdc.f | 15 +++-- physics/module_MYJPBL_wrapper.F90 | 8 +-- physics/module_MYJPBL_wrapper.meta | 7 --- physics/module_MYNNPBL_wrapper.F90 | 16 ++--- physics/ozphys_2015.meta | 1 - physics/phys_tend.F90 | 14 ++--- physics/phys_tend.meta | 10 +++- physics/shinhongvdif.meta | 7 --- physics/ugwpv1_gsldrag.F90 | 66 +++++++++++---------- physics/ugwpv1_gsldrag.meta | 94 ++++++++++++++++-------------- physics/unified_ugwp.F90 | 24 ++++---- physics/ysuvdif.F90 | 3 +- physics/ysuvdif.meta | 93 +++++++++++++++++------------ 19 files changed, 203 insertions(+), 194 deletions(-) diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index b89f54610..84d7e4059 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -20,7 +20,7 @@ subroutine GFS_GWD_generic_pre_run( & & oc, oa4, clx, theta, & & varss, ocss, oa4ss, clxss, & & sigma, gamma, elvmax, lssav, ldiag3d, & - & dtend, dtidx, index_of_temperature, index_of_x_wind, & + & dtend, dtidx, index_of_temperature, index_of_x_wind, & & index_of_y_wind, index_of_process_orographic_gwd, & & dudt, dvdt, dtdt, dtf, & & flag_for_gwd_generic_tend, errmsg, errflg) @@ -40,7 +40,7 @@ subroutine GFS_GWD_generic_pre_run( & real(kind=kind_phys), intent(in) :: dtdt(im,levs), dudt(im,levs), dvdt(im,levs) ! dtend only allocated only if ldiag3d is .true. real(kind=kind_phys), intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_of_temperature, & + integer, intent(in) :: dtidx(:,:), index_of_temperature, & & index_of_x_wind, index_of_y_wind, index_of_process_orographic_gwd real(kind=kind_phys), intent(in) :: dtf @@ -179,7 +179,7 @@ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, d ! dtend only allocated only if ldiag3d is .true. real(kind=kind_phys), intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_of_temperature, & + integer, intent(in) :: dtidx(:,:), index_of_temperature, & & index_of_x_wind, index_of_y_wind, index_of_process_orographic_gwd character(len=*), intent(out) :: errmsg diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 977d0342c..2f77f7681 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -49,7 +49,7 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, enddo enddo else if(do_aw) then - ! if qdiag3d, all q are save already + ! if qdiag3d, all q are saved already save_q(1:im,:,1) = gq0(1:im,:,1) do n=ntcw,ntcw+nncl-1 save_q(1:im,:,n) = gq0(1:im,:,n) @@ -90,7 +90,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, 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, & graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, & - dtend, dtidx, ncause, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, & + dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, & errmsg, errflg) ! use machine, only: kind_phys @@ -100,7 +100,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, integer, intent(in) :: im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm - integer, intent(in) :: index_of_temperature,index_of_process_mp,ncause + integer, intent(in) :: index_of_temperature,index_of_process_mp real(kind=kind_phys), intent(in) :: dtf, frain, con_g real(kind=kind_phys), dimension(im), intent(in) :: rain1, xlat, xlon, tsfc diff --git a/physics/GFS_MP_generic.meta b/physics/GFS_MP_generic.meta index c3f611366..6e75005a3 100644 --- a/physics/GFS_MP_generic.meta +++ b/physics/GFS_MP_generic.meta @@ -869,14 +869,6 @@ type = integer intent = in optional = F -[ncause] - standard_name = number_of_cumulative_change_processes - long_name = number of processes that cause changes in state variables - units = count - dimensions = () - type = integer - intent = in - optional = F [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index 3b25f6567..34cb77b4f 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -387,7 +387,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, integer, intent(out) :: errflg !--- local variables - integer :: impi, iomp, ierr, n, idtend, icause, itracer + integer :: impi, iomp, ierr, n, idtend, iprocess, itracer integer :: mpirank, mpisize, mpicomm integer :: omprank, ompsize @@ -633,12 +633,12 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%zmtnblck ', Diag%zmtnblck) if (Model%ldiag3d) then do itracer=2,Model%ntracp100 - do icause=1,Model%ncause - idtend = Model%dtidx(itracer,icause) + do iprocess=1,Model%nprocess + idtend = Model%dtidx(itracer,iprocess) if(idtend>1) then call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, & 'dtend_'//Model%dtend_tracer_labels(itracer)//'_' & - //Model%dtend_cause_labels(icause), Diag%dtend(1,1,idtend)) + //Model%dtend_cause_labels(iprocess), Diag%dtend(1,1,idtend)) endif enddo enddo diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 5689d5a63..900d3d2f5 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -156,9 +156,8 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr dudt_mtb,dudt_ogw, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & dudt, dvdt, dtdt, rdxzb, con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt, & con_omega, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & -! FIXME: delete ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw, ldu3dt_cgw, ldv3dt_cgw, ldt3dt_cgw, & - dtend, dtidx, index_of_x_wind, index_of_y_wind, index_of_temperature, & - index_of_process_orographic_gwd, index_of_process_nonorographic_gwd, & + dtend, dtidx, index_of_x_wind, index_of_y_wind, index_of_temperature, & + index_of_process_orographic_gwd, index_of_process_nonorographic_gwd, & ldiag3d, lssav, flag_for_gwd_generic_tend, errmsg, errflg) implicit none diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 6a2d75e24..8936d16de 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -69,10 +69,8 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & hbot,htop,kcnv,xland,hfx2,qfx2,cliw,clcw, & pbl,ud_mf,dd_mf,dt_mf,cnvw_moist,cnvc,imfshalcnv, & flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend, & -! fixme: delete ! du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & - ! du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV, & - dtend,dtidx,ntqv,ntiw,ntcw,index_of_temperature,index_of_x_wind,& - index_of_y_wind,index_of_process_scnv,index_of_process_dcnv, & + dtend,dtidx,ntqv,ntiw,ntcw,index_of_temperature,index_of_x_wind, & + index_of_y_wind,index_of_process_scnv,index_of_process_dcnv, & ldiag3d,qci_conv,errmsg,errflg) !------------------------------------------------------------- implicit none diff --git a/physics/gwdc.f b/physics/gwdc.f index c43fbe481..e2403fb23 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -1460,8 +1460,8 @@ end subroutine gwdc_post_init subroutine gwdc_post_run( & & im, levs, lssav, ldiag3d, dtf, dtp, con_cp, & & tauctx, taucty, gwdcu, gwdcv, & - & dugwd, dvgwd, dtend, dtidx, index_of_x_wind, index_of_y_wind, & - & index_of_process_nonorographic_gwd, gu0, gv0, gt0, & + & dugwd, dvgwd, dtend, dtidx, index_of_x_wind, index_of_y_wind, & + & index_of_process_nonorographic_gwd, gu0, gv0, gt0, & & errmsg, errflg) use machine, only : kind_phys @@ -1473,10 +1473,11 @@ subroutine gwdc_post_run( & real(kind=kind_phys), intent(in) :: & & tauctx(:), taucty(:), gwdcu(:,:), gwdcv(:,:) - real(kind=kind_phys), intent(inout) :: dugwd(:,:), dvgwd(:,:), & + real(kind=kind_phys), intent(inout) :: dugwd(:), dvgwd(:), & & gu0(:,:), gv0(:,:), gt0(:,:) real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_of_process_nonorographic_gwd + integer, intent(in) :: dtidx(:,:), index_of_process_nonorographic_& + & gwd integer, intent(in) :: index_of_x_wind, index_of_y_wind character(len=*), intent(out) :: errmsg @@ -1497,11 +1498,13 @@ subroutine gwdc_post_run( & endif ! end if_lssav if (ldiag3d) then - idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_gwd) + idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_g& + & wd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + gwdcu(:,:) * dtf endif - idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_gwd) + idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_g& + & wd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + gwdcv(:,:) * dtf endif diff --git a/physics/module_MYJPBL_wrapper.F90 b/physics/module_MYJPBL_wrapper.F90 index 4db49cb5b..2338aaa19 100644 --- a/physics/module_MYJPBL_wrapper.F90 +++ b/physics/module_MYJPBL_wrapper.F90 @@ -41,7 +41,7 @@ SUBROUTINE myjpbl_wrapper_run( & & dkt,xkzm_m, xkzm_h,xkzm_s, gamt,gamq, & & con_cp,con_g,con_rd, & & me, lprnt, gen_tend, ldiag3d, dtend, dtidx, & - & index_of_temperature, index_of_x_wind, & + & index_of_temperature, index_of_x_wind, & & index_of_y_wind, index_of_process_pbl, & & ntqv, errmsg, errflg ) @@ -87,7 +87,7 @@ SUBROUTINE myjpbl_wrapper_run( & integer,intent(in) :: im, levs integer,intent(in) :: kdt, me integer,intent(in) :: ntrac,ntke,ntcw,ntiw,ntrw,ntsw,ntgl - logical,intent(in) :: restart,do_myjsfc,lprnt,ldiag3d,qdiag3d,gen_tend + logical,intent(in) :: restart,do_myjsfc,lprnt,ldiag3d,gen_tend real(kind=kind_phys),intent(in) :: con_cp, con_g, con_rd real(kind=kind_phys),intent(in) :: dt_phs, xkzm_m, xkzm_h, xkzm_s @@ -113,8 +113,6 @@ SUBROUTINE myjpbl_wrapper_run( & phii, prsi real(kind=kind_phys),dimension(im,levs),intent(in) :: & & ugrs, vgrs, tgrs, prsl -! real(kind=kind_phys),dimension(im,levs),intent(inout) :: & -! dudt, dvdt, dtdt, dkt real(kind=kind_phys),dimension(im,levs),intent(inout) :: & dudt, dvdt, dtdt real(kind=kind_phys),dimension(im,levs-1),intent(out) :: & @@ -598,7 +596,7 @@ SUBROUTINE myjpbl_wrapper_run( & if(vidx>1) dtend(:,k,vidx)=dtend(:,k,vidx)+rvblten(:,k1)*dt_phs if(tidx>1) dtend(:,k,tidx)=dtend(:,k,tidx)+rthblten(:,k1)*exner(:,k1)*dt_phs if(qidx>1) dtend(:,k,qidx)=dtend(:,k,qidx)+rqvblten(:,k1)*dt_phs - end if + end do end if if (lprnt1) then diff --git a/physics/module_MYJPBL_wrapper.meta b/physics/module_MYJPBL_wrapper.meta index 5dae227ed..e428b3a2e 100644 --- a/physics/module_MYJPBL_wrapper.meta +++ b/physics/module_MYJPBL_wrapper.meta @@ -701,13 +701,6 @@ dimensions = () type = logical intent = in -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 353ce77bc..f4ecdb970 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -83,10 +83,10 @@ SUBROUTINE mynnedmf_wrapper_run( & & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & ! <=== ntlnc, ntinc & dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc, & ! <=== ntwa, ntia & flag_for_pbl_generic_tend, & - & dtend, dtidx, index_of_temperature, & - & index_of_x_wind, index_of_y_wind, ntke, & + & dtend, dtidx, index_of_temperature, & + & index_of_x_wind, index_of_y_wind, ntke, & & ntqv, ntcw, ntiw, ntoz, ntlnc, ntinc, ntwa, ntia, & - & index_of_process_pbl, htrsw, htrlw, xmu, & + & index_of_process_pbl, htrsw, htrlw, xmu, & & grav_settling, bl_mynn_tkebudget, bl_mynn_tkeadvect, & & bl_mynn_cloudpdf, bl_mynn_mixlength, & & bl_mynn_edmf, bl_mynn_edmf_mom, bl_mynn_edmf_tke, & @@ -282,7 +282,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & RQNWFABLTEN, RQNIFABLTEN, & & dqke,qWT,qSHEAR,qBUOY,qDISS, & & pattern_spp_pbl - real(kind=kind_phys), allocatable :: oldzone(:,:) + real(kind=kind_phys), allocatable :: old_ozone(:,:) !MYNN-CHEM arrays real(kind=kind_phys), dimension(im,nchem) :: chem3d @@ -496,8 +496,8 @@ SUBROUTINE mynnedmf_wrapper_run( & enddo endif if(ldiag3d .and. dtidx(100+ntoz,index_of_process_pbl)>1) then - allocate(oldzone(im,levs)) - oldzone = ozone + allocate(old_ozone(im,levs)) + old_ozone = ozone endif if (lprnt)write(0,*)"prepping MYNN-EDMF variables..." @@ -726,8 +726,8 @@ SUBROUTINE mynnedmf_wrapper_run( & if(ldiag3d) then idtend = dtidx(100+ntoz,index_of_process_pbl) if(idtend>1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (ozone-oldzone) - deallocate(oldzone) + dtend(:,:,idtend) = dtend(:,:,idtend) + (ozone-old_ozone) + deallocate(old_ozone) endif endif endif accum_duvt3dt diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index 5e59a13eb..639917b85 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -147,7 +147,6 @@ dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys - active = (flag_diagnostics_3D) intent = inout optional = F [dtidx] diff --git a/physics/phys_tend.F90 b/physics/phys_tend.F90 index 5b0272caa..300a4e9a9 100644 --- a/physics/phys_tend.F90 +++ b/physics/phys_tend.F90 @@ -21,17 +21,17 @@ end subroutine phys_tend_finalize !! subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & index_of_process_physics, index_of_process_non_physics, & - ncause, errmsg, errflg) + nprocess, nprocess_summed, errmsg, errflg) ! Interface variables logical, intent(in) :: ldiag3d real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), index_of_process_physics, & - index_of_process_non_physics, ntracp100, ncause + index_of_process_non_physics, ntracp100, nprocess, nprocess_summed character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: itrac, iphys, icause, idtend + integer :: itrac, iphys, iprocess, idtend logical :: first ! Initialize CCPP error handling variables @@ -48,12 +48,12 @@ subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & if(iphys<2) then cycle ! No physics tendency requested for this tracer endif - do icause=1,ncause - if(icause==index_of_process_physics .or. & - icause==index_of_process_non_physics) then + do iprocess=1,nprocess + if(iprocess>nprocess_summed .or. iprocess==index_of_process_physics .or. & + iprocess==index_of_process_non_physics) then cycle ! Don't sum up the sums. endif - idtend = dtidx(itrac,icause) + idtend = dtidx(itrac,iprocess) if(idtend>1) then ! This tendency was calculated for this tracer, so ! accumulate it into the total physics tendency. diff --git a/physics/phys_tend.meta b/physics/phys_tend.meta index fa11ba23c..b792ad238 100644 --- a/physics/phys_tend.meta +++ b/physics/phys_tend.meta @@ -56,7 +56,7 @@ type = integer intent = in optional = F -[ncause] +[nprocess] standard_name = number_of_cumulative_change_processes long_name = number of processes that cause changes in state variables units = count @@ -64,6 +64,14 @@ type = integer intent = in optional = F +[nprocess_summed] + standard_name = number_of_physics_causes_of_tracer_changes + long_name = number of causes in dtidx per tracer summed for total physics tendency + units = count + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/shinhongvdif.meta b/physics/shinhongvdif.meta index 9adacaa9c..ad0d23665 100644 --- a/physics/shinhongvdif.meta +++ b/physics/shinhongvdif.meta @@ -427,13 +427,6 @@ dimensions = () type = logical intent = in -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields - units = flag - dimensions = () - type = logical - intent = in [flag_for_pbl_generic_tend] standard_name = flag_for_generic_planetary_boundary_layer_tendency long_name = true if GFS_PBL_generic should calculate tendencies diff --git a/physics/ugwpv1_gsldrag.F90 b/physics/ugwpv1_gsldrag.F90 index 00fd42dbd..98e31f27b 100644 --- a/physics/ugwpv1_gsldrag.F90 +++ b/physics/ugwpv1_gsldrag.F90 @@ -319,8 +319,9 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd dudt_ngw, dvdt_ngw, dtdt_ngw, kdis_ngw, dudt_gw, dvdt_gw, dtdt_gw, kdis_gw, & tau_ogw, tau_ngw, tau_oss, & zogw, zlwb, zobl, zngw, dusfcg, dvsfcg, dudt, dvdt, dtdt, rdxzb, & - ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw, ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw, & - lprnt, ipr, errmsg, errflg) + dtend, dtidx, index_of_x_wind, index_of_y_wind, index_of_temperature, & + index_of_process_orographic_gwd, index_of_process_nonorographic_gwd, & + lprnt, ipr, errmsg, errflg) ! !######################################################################## ! Attention New Arrays and Names must be ADDED inside @@ -428,15 +429,11 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd ! real(kind=kind_phys), intent(inout), dimension(im, levs) :: dudt, dvdt, dtdt -! -! These arrays are only allocated if ldiag=.true. -! -! Version of COORDE updated by CCPP-dev for time-aver -! - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw - - + ! dtend is only allocated if ldiag=.true. + real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), & + index_of_x_wind, index_of_y_wind, index_of_temperature, & + index_of_process_orographic_gwd, index_of_process_nonorographic_gwd real(kind=kind_phys), intent(out), dimension(im) :: rdxzb ! for stoch phys. mtb-level @@ -467,7 +464,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd ! ugwp_v1 local variables - integer :: y4, month, day, ddd_ugwp, curdate, curday + integer :: y4, month, day, ddd_ugwp, curdate, curday, idtend ! ugwp_v1 temporary (local) diagnostic variables from cires_ugwp_solv2_v1 ! diagnostics for wind and temp rms to compare with space-borne data and metrics @@ -624,15 +621,20 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd ! ! for old-fashioned GFS-style diag-cs like dt3dt(:.:, 1:14) collections ! - if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - do k=1,levs - do i=1,im - ldu3dt_ogw(i,k) = ldu3dt_ogw(i,k) + Pdudt(i,k)*dtp - ldv3dt_ogw(i,k) = ldv3dt_ogw(i,k) + Pdvdt(i,k)*dtp - ldt3dt_ogw(i,k) = ldt3dt_ogw(i,k) + Pdtdt(i,k)*dtp - enddo - enddo + if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then + idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp + endif + idtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp + endif + idtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif + endif ENDIF ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -686,18 +688,20 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd end if ! do_ugwp_v1 -! -! GFS-style diag dt3dt(:.:, 1:14) time-averaged -! - if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - do k=1,levs - do i=1,im - ldu3dt_ngw(i,k) = ldu3dt_ngw(i,k) + dudt_ngw(i,k)*dtp - ldv3dt_ngw(i,k) = ldv3dt_ngw(i,k) + dvdt_ngw(i,k)*dtp - ldt3dt_ngw(i,k) = ldt3dt_ngw(i,k) + dtdt_ngw(i,k)*dtp - enddo - enddo + if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then + idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dudt_ngw(i,k)*dtp endif + idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dvdt_ngw(i,k)*dtp + endif + idtend = dtidx(index_of_temperature,index_of_process_nonorographic_gwd) + if(idtend>1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + dtdt_ngw(i,k)*dtp + endif + endif ! ! get total sso-OGW + NGW diff --git a/physics/ugwpv1_gsldrag.meta b/physics/ugwpv1_gsldrag.meta index 2eac9a321..c751b901c 100644 --- a/physics/ugwpv1_gsldrag.meta +++ b/physics/ugwpv1_gsldrag.meta @@ -1149,59 +1149,63 @@ kind = kind_phys intent = out optional = F -[ldu3dt_ogw] - standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in x wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys + active = (flag_diagnostics_3D) intent = inout optional = F -[ldv3dt_ogw] - standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag - long_name = cumulative change in y wind due to orographic gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[dtidx] + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) + type = integer + intent = in optional = F -[ldt3dt_ogw] - standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag - long_name = cumulative change in temperature due to orographic gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in optional = F -[ldu3dt_ngw] - standard_name = cumulative_change_in_x_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in x wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in optional = F -[ldv3dt_ngw] - standard_name = cumulative_change_in_y_wind_due_to_convective_gravity_wave_drag - long_name = cumulative change in y wind due to convective gravity wave drag - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in optional = F -[ldt3dt_ngw] - standard_name = cumulative_change_in_temperature_due_to_convective_gravity_wave_drag - long_name = cumulative change in temperature due to convective gravity wave drag - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout +[index_of_process_orographic_gwd] + standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_of_process_nonorographic_gwd] + standard_name = index_of_nonorographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of nonorographic gravity wave drag process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in optional = F [lprnt] standard_name = flag_print diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index af3204e90..76c7d2fa5 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -203,11 +203,11 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, & del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, & - dudt_mtb, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & + dudt_mtb, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & dudt, dvdt, dtdt, rdxzb, con_g, con_omega, con_pi, con_cp, con_rd, con_rv, & con_rerth, con_fvirt, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & - dtend, dtidx, index_of_temperature, index_of_x_wind, index_for_y_indw, & - index_of_process_orographic_gwd, index_of_process_nonorographic_gwd, & + dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, & + index_of_process_orographic_gwd, index_of_process_nonorographic_gwd, & ldiag3d, lssav, flag_for_gwd_generic_tend, do_ugwp_v0, do_ugwp_v0_orog_only, & do_ugwp_v0_nst_only, do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, & gwd_opt, errmsg, errflg) @@ -261,8 +261,8 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, real(kind=kind_phys), intent(out), dimension(:,:) :: dtaux2d_ls, dtauy2d_ls ! The dtend array is are only allocated if ldiag=.true. - real(kind=kind_phys), intent(inout), optional :: dtend - integer, intent(in) :: dtidx, index_of_temperature, index_of_x_wind, & + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:), index_of_temperature, index_of_x_wind, & index_of_y_wind, index_of_process_nonorographic_gwd, & index_of_process_orographic_gwd logical, intent(in) :: ldiag3d, lssav @@ -300,7 +300,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, real(kind=kind_phys), parameter :: tamp_mpa=30.e-3 - integer :: nmtvr_temp + integer :: nmtvr_temp, idtend real(kind=kind_phys), dimension(:,:), allocatable :: tke real(kind=kind_phys), dimension(:), allocatable :: turb_fac, tem @@ -385,17 +385,17 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - idtend = dtidx(index_for_cause_x_wind,index_of_process_orographic_gwd) + idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif - idtend = dtidx(index_for_cause_y_wind,index_of_process_orographic_gwd) + idtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif - idtend = dtidx(index_of_process_temperature,index_of_process_orographic_gwd) + idtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif @@ -485,17 +485,17 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, endif ! cdmbgwd(3) > 0.0 if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then - idtend = dtidx(index_for_cause_x_wind,index_of_process_nonorographic_gwd) + idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif - idtend = dtidx(index_for_cause_y_wind,index_of_process_nonorographic_gwd) + idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif - idtend = dtidx(index_of_process_temperature,index_of_process_nonorographic_gwd) + idtend = dtidx(index_of_temperature,index_of_process_nonorographic_gwd) if(idtend>1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index 8f71bc56f..be452a154 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -35,7 +35,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & dusfc,dvsfc,dtsfc,dqsfc, & dt,kpbl1d,u10,v10,lssav,ldiag3d,qdiag3d, & flag_for_pbl_generic_tend,ntoz,ntqv,dtend,dtidx, & - index_of_temperature,index_of_x_wind,index_of_y_wind, & + index_of_temperature,index_of_x_wind,index_of_y_wind, & index_of_process_pbl,errmsg,errflg ) use machine , only : kind_phys @@ -197,6 +197,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & dsdzu,dsdzv,wm3,dthx,dqx,wspd10,ross,tem1,dsig,tvcon,conpr, & prfac,prfac2,phim8z,radsum,tmp1,templ,rvls,temps,ent_eff, & rcldb,bruptmp,radflux + integer :: idtend ! !------------------------------------------------------------------------------- ! diff --git a/physics/ysuvdif.meta b/physics/ysuvdif.meta index 9ba31ed27..1faa3ec15 100644 --- a/physics/ysuvdif.meta +++ b/physics/ysuvdif.meta @@ -467,46 +467,63 @@ type = integer intent = in optional = F -[du3dt_PBL] - standard_name = cumulative_change_in_x_wind_due_to_PBL - long_name = cumulative change in x wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[dv3dt_PBL] - standard_name = cumulative_change_in_y_wind_due_to_PBL - long_name = cumulative change in y wind due to PBL - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[dt3dt_PBL] - standard_name = cumulative_change_in_temperature_due_to_PBL - long_name = cumulative change in temperature due to PBL - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[dq3dt_PBL] - standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL - long_name = cumulative change in water vapor specific humidity due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout -[do3dt_PBL] - standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL - long_name = cumulative change in ozone mixing ratio due to PBL - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in + optional = F +[dtend] + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys - intent = inout + intent = in + optional = F +[dtidx] + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) + type = integer + intent = in + optional = F +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From ff49546d849f2ed3e69b794a1e465816e0410022 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 29 Mar 2021 23:34:54 +0000 Subject: [PATCH 11/24] dtend(:,:,1) is used, dtend_o3_photochem sums all four ozphys values, rename variables, use nprocess_summed to avoid summing sums --- physics/GFS_DCNV_generic.F90 | 12 ++--- physics/GFS_GWD_generic.F90 | 12 ++--- physics/GFS_MP_generic.F90 | 4 +- physics/GFS_PBL_generic.F90 | 14 ++--- physics/GFS_SCNV_generic.F90 | 12 ++--- physics/GFS_debug.F90 | 2 +- physics/GFS_suite_interstitial.F90 | 22 ++++---- physics/cires_ugwp.F90 | 12 ++--- physics/cu_gf_driver.F90 | 38 ++++++------- physics/gwdc.f | 4 +- physics/module_MYJPBL_wrapper.F90 | 8 +-- physics/module_MYNNPBL_wrapper.F90 | 8 +-- physics/moninedmf.f | 14 ++--- physics/moninshoc.f | 10 ++-- physics/ozphys.f | 14 ++--- physics/ozphys_2015.f | 10 ++-- physics/phys_tend.F90 | 87 +++++++++++++++++++----------- physics/phys_tend.meta | 22 ++++++-- physics/rayleigh_damp.f | 12 ++--- physics/satmedmfvdif.F | 8 +-- physics/satmedmfvdifq.F | 12 ++--- physics/shinhongvdif.F90 | 10 ++-- physics/ugwpv1_gsldrag.F90 | 12 ++--- physics/unified_ugwp.F90 | 12 ++--- physics/ysuvdif.F90 | 10 ++-- 25 files changed, 210 insertions(+), 171 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index c5043e6a1..dd7374ca9 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -65,7 +65,7 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc if ((ldiag3d.and.qdiag3d) .or. cplchm) then if(nsamftrac>0) then do n=1,nsamftrac - if(n==ntqv .or. dtidx(n+100,index_of_process_dcnv)) then + if(n==ntqv .or. dtidx(n+100,index_of_process_dcnv)>=1) then save_q(:,:,n) = gq0(:,:,n) endif enddo @@ -179,30 +179,30 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & if (ldiag3d .and. flag_for_dcnv_generic_tend) then idtend=dtidx(index_of_temperature,index_of_process_dcnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gt0-save_t)*frain endif idtend=dtidx(index_of_x_wind,index_of_process_dcnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gu0-save_u)*frain endif idtend=dtidx(index_of_y_wind,index_of_process_dcnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0-save_v)*frain endif if(nsamftrac>0) then do n=1,nsamftrac idtend=dtidx(100+n,index_of_process_dcnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n)-save_q(:,:,n))*frain endif enddo else idtend=dtidx(100+ntqv,index_of_process_dcnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv)-save_q(:,:,ntqv))*frain endif endif diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index 84d7e4059..e2d81fcb3 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -123,17 +123,17 @@ subroutine GFS_GWD_generic_pre_run( & if (lssav .and. ldiag3d .and. flag_for_gwd_generic_tend) then idtend = dtidx(index_of_temperature, index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) - dtdt*dtf endif idtend = dtidx(index_of_x_wind, index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) - dudt*dtf endif idtend = dtidx(index_of_y_wind, index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) - dvdt*dtf endif endif @@ -197,17 +197,17 @@ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, d if (ldiag3d .and. flag_for_gwd_generic_tend) then idtend = dtidx(index_of_temperature, index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtdt*dtf endif idtend = dtidx(index_of_x_wind, index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dudt*dtf endif idtend = dtidx(index_of_y_wind, index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dvdt*dtf endif endif diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 2f77f7681..c90e64bf4 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -344,7 +344,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, if_tendency_diagnostics: if (ldiag3d) then idtend = dtidx(index_of_temperature,index_of_process_mp) - if(idtend>1) then + if(idtend>=1) then do k=1,levs do i=1,im dtend(i,k,idtend) = dtend(i,k,idtend) + (gt0(i,k)-save_t(i,k)) * frain @@ -354,7 +354,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, if_tracer_diagnostics: if (qdiag3d) then dtend_q: do itrac=1,ntrac idtend = dtidx(itrac+100,index_of_process_mp) - if(idtend>1) then + if(idtend>=1) then do k=1,levs do i=1,im dtend(i,k,idtend) = dtend(i,k,idtend) + (gq0(i,k,itrac)-save_q(i,k,itrac)) * frain diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 65e8ff4fa..99be58509 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -631,33 +631,33 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, if (ldiag3d .and. flag_for_pbl_generic_tend) then if (lsidea) then idtend = dtidx(index_of_temperature, index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + dtdt(1:im,1:levs)*dtf endif else idtend = dtidx(index_of_temperature, index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (tgrs(1:im,1:levs) - save_t(1:im,1:levs)) endif endif idtend = dtidx(index_of_x_wind, index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (ugrs(1:im,1:levs) - save_u(1:im,1:levs)) endif idtend = dtidx(index_of_y_wind, index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (vgrs(1:im,1:levs) - save_v(1:im,1:levs)) endif idtend = dtidx(100+ntqv, index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + qgrs(1:im,1:levs,ntqv) - save_q(1:im,1:levs,ntqv) endif idtend = dtidx(100+ntoz, index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + qgrs(1:im,1:levs,ntoz) - save_q(1:im,1:levs,ntoz) endif idtend = dtidx(100+ntke, index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(1:im,1:levs,idtend) = dtend(1:im,1:levs,idtend) + (qgrs(1:im,1:levs,ntke) - save_q(1:im,1:levs,ntke)) endif endif diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index 23351e99e..205495529 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -48,7 +48,7 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, if (qdiag3d) then if(nsamftrac>0) then do n=1,nsamftrac - if(n==ntqv .or. dtidx(ntqv,index_of_process_scnv)>1) then + if(n==ntqv .or. dtidx(ntqv,index_of_process_scnv)>=1) then save_q(:,:,n) = gq0(:,:,n) endif enddo @@ -149,30 +149,30 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl if (lssav .and. flag_for_scnv_generic_tend) then if (ldiag3d) then idtend = dtidx(index_of_temperature, index_of_process_scnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gt0 - save_t) * frain endif idtend = dtidx(index_of_x_wind, index_of_process_scnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gu0 - save_u) * frain endif idtend = dtidx(index_of_y_wind, index_of_process_scnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0 - save_v) * frain endif if(nsamftrac>0) then do n=1,nsamftrac idtend = dtidx(100+n, index_of_process_scnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n) - save_q(:,:,n)) * frain endif enddo else idtend = dtidx(100+ntqv, index_of_process_scnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv) - save_q(:,:,ntqv)) * frain endif endif diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index 34cb77b4f..02d60a093 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -635,7 +635,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, do itracer=2,Model%ntracp100 do iprocess=1,Model%nprocess idtend = Model%dtidx(itracer,iprocess) - if(idtend>1) then + if(idtend>=1) then call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, & 'dtend_'//Model%dtend_tracer_labels(itracer)//'_' & //Model%dtend_cause_labels(iprocess), Diag%dtend(1,1,idtend)) diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 04cbf01f4..791926388 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -284,42 +284,42 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl if (ldiag3d) then if (lsidea) then idtend = dtidx(index_of_temperature,index_of_process_longwave) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,1)*dtf endif idtend = dtidx(index_of_temperature,index_of_process_shortwave) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,2)*dtf endif idtend = dtidx(index_of_temperature,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,3)*dtf endif idtend = dtidx(index_of_temperature,index_of_process_dcnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,4)*dtf endif idtend = dtidx(index_of_temperature,index_of_process_scnv) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,5)*dtf endif idtend = dtidx(index_of_temperature,index_of_process_mp) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + lwhd(:,:,6)*dtf endif else idtend = dtidx(index_of_temperature,index_of_process_longwave) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + htrlw(:,:)*dtf endif idtend = dtidx(index_of_temperature,index_of_process_shortwave) - if(idtend>1) then + if(idtend>=1) then do k=1,levs do i=1,im dtend(i,k,idtend) = dtend(i,k,idtend) + htrsw(i,k)*dtf*xmu(i) @@ -745,13 +745,13 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to if(ldiag3d) then if(ntk>0 .and. ntk<=size(clw,3)) then idtend=dtidx(100+ntke,index_of_process_conv_trans) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntk) endif endif if(ntclamt<=size(clw,3) .and. ntclamt>0) then idtend=dtidx(100+ntclamt,index_of_process_conv_trans) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntclamt) endif endif @@ -759,7 +759,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to if(ldiag3d .and. ntk>0) then idtend=dtidx(100+ntke,index_of_process_conv_trans) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntk) endif endif diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 900d3d2f5..f8ade39a9 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -285,15 +285,15 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif idtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif idtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif endif @@ -376,15 +376,15 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dudt - Pdudt)*dtp endif idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dvdt - Pdvdt)*dtp endif idtend = dtidx(index_of_temperature,index_of_process_nonorographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (gw_dtdt - Pdtdt)*dtp endif endif diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 8936d16de..85c523ed5 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -202,21 +202,21 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & if(ldiag3d) then if(flag_for_dcnv_generic_tend) then - cliw_deep_idx=1 - clcw_deep_idx=1 + cliw_deep_idx=0 + clcw_deep_idx=0 else cliw_deep_idx=dtidx(100+ntiw,index_of_process_dcnv) clcw_deep_idx=dtidx(100+ntcw,index_of_process_dcnv) endif if(flag_for_scnv_generic_tend) then - cliw_shal_idx=1 - clcw_shal_idx=1 + cliw_shal_idx=0 + clcw_shal_idx=0 else cliw_shal_idx=dtidx(100+ntiw,index_of_process_scnv) clcw_shal_idx=dtidx(100+ntcw,index_of_process_scnv) endif - if(cliw_deep_idx>1 .or. clcw_deep_idx>1 .or. & - cliw_shal_idx>1 .or. clcw_shal_idx>1) then + if(cliw_deep_idx>=1 .or. clcw_deep_idx>=1 .or. & + cliw_shal_idx>=1 .or. clcw_shal_idx>=1) then allocate(clcw_save(im,km), cliw_save(im,km)) clcw_save=clcw cliw_save=cliw @@ -896,22 +896,22 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & vidx=dtidx(index_of_y_wind,index_of_process_scnv) tidx=dtidx(index_of_temperature,index_of_process_scnv) qidx=dtidx(100+ntqv,index_of_process_scnv) - if(uidx>1) then + if(uidx>=1) then do k=kts,ktf dtend(:,k,uidx) = dtend(:,k,uidx) + cutens(:)*outus(:,k) * dt enddo endif - if(vidx>1) then + if(vidx>=1) then do k=kts,ktf dtend(:,k,vidx) = dtend(:,k,vidx) + cutens(:)*outvs(:,k) * dt enddo endif - if(tidx>1) then + if(tidx>=1) then do k=kts,ktf dtend(:,k,tidx) = dtend(:,k,tidx) + cutens(:)*outts(:,k) * dt enddo endif - if(qidx>1) then + if(qidx>=1) then do k=kts,ktf do i=its,itf tem = cutens(i)*outqs(i,k)* dt @@ -925,24 +925,24 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & uidx=dtidx(index_of_x_wind,index_of_process_dcnv) vidx=dtidx(index_of_y_wind,index_of_process_dcnv) tidx=dtidx(index_of_temperature,index_of_process_dcnv) - if(uidx>1) then + if(uidx>=1) then do k=kts,ktf dtend(:,k,uidx) = dtend(:,k,uidx) + (cuten*outu(:,k)+cutenm*outum(:,k)) * dt enddo endif - if(vidx>1) then + if(vidx>=1) then do k=kts,ktf dtend(:,k,vidx) = dtend(:,k,vidx) + (cuten*outv(:,k)+cutenm*outvm(:,k)) * dt enddo endif - if(tidx>1) then + if(tidx>=1) then do k=kts,ktf dtend(:,k,tidx) = dtend(:,k,tidx) + (cuten*outt(:,k)+cutenm*outtm(:,k)) * dt enddo endif qidx=dtidx(100+ntqv,index_of_process_dcnv) - if(qidx>1) then + if(qidx>=1) then do k=kts,ktf do i=its,itf tem = (cuten(i)*outq(i,k) + cutenm(i)*outqm(i,k))* dt @@ -967,20 +967,20 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & if (clcw_save(i,k) .gt. -999.0) then cliw_both = max(0.,cliw_save(i,k) + tem * tem1) - cliw_save(i,k) clcw_both = max(0.,clcw_save(i,k) + tem) - clcw_save(i,k) - else if(cliw_idx>1) then + else if(cliw_idx>=1) then cliw_both = max(0.,cliw_save(i,k) + tem) - cliw_save(i,k) clcw_both = 0 endif - if(cliw_deep_idx>1) then + if(cliw_deep_idx>=1) then dtend(i,k,cliw_deep_idx) = dtend(i,k,cliw_deep_idx) + abs(tem_deep)/weight_sum*cliw_both endif - if(clcw_deep_idx>1) then + if(clcw_deep_idx>=1) then dtend(i,k,clcw_deep_idx) = dtend(i,k,clcw_deep_idx) + abs(tem_deep)/weight_sum*clcw_both endif - if(cliw_shal_idx>1) then + if(cliw_shal_idx>=1) then dtend(i,k,cliw_shal_idx) = dtend(i,k,cliw_shal_idx) + abs(tem_shal)/weight_sum*cliw_both endif - if(clcw_shal_idx>1) then + if(clcw_shal_idx>=1) then dtend(i,k,clcw_shal_idx) = dtend(i,k,clcw_shal_idx) + abs(tem_shal)/weight_sum*clcw_both endif enddo diff --git a/physics/gwdc.f b/physics/gwdc.f index e2403fb23..6a4863055 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -1500,12 +1500,12 @@ subroutine gwdc_post_run( & if (ldiag3d) then idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_g& & wd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + gwdcu(:,:) * dtf endif idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_g& & wd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + gwdcv(:,:) * dtf endif endif diff --git a/physics/module_MYJPBL_wrapper.F90 b/physics/module_MYJPBL_wrapper.F90 index 2338aaa19..026ea1b64 100644 --- a/physics/module_MYJPBL_wrapper.F90 +++ b/physics/module_MYJPBL_wrapper.F90 @@ -592,10 +592,10 @@ SUBROUTINE myjpbl_wrapper_run( & ! cumulative value with the instantaneous value. do k=1,levs k1=levs+1-k - if(uidx>1) dtend(:,k,uidx)=dtend(:,k,uidx)+rublten(:,k1)*dt_phs - if(vidx>1) dtend(:,k,vidx)=dtend(:,k,vidx)+rvblten(:,k1)*dt_phs - if(tidx>1) dtend(:,k,tidx)=dtend(:,k,tidx)+rthblten(:,k1)*exner(:,k1)*dt_phs - if(qidx>1) dtend(:,k,qidx)=dtend(:,k,qidx)+rqvblten(:,k1)*dt_phs + if(uidx>=1) dtend(:,k,uidx)=dtend(:,k,uidx)+rublten(:,k1)*dt_phs + if(vidx>=1) dtend(:,k,vidx)=dtend(:,k,vidx)+rvblten(:,k1)*dt_phs + if(tidx>=1) dtend(:,k,tidx)=dtend(:,k,tidx)+rthblten(:,k1)*exner(:,k1)*dt_phs + if(qidx>=1) dtend(:,k,qidx)=dtend(:,k,qidx)+rqvblten(:,k1)*dt_phs end do end if diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index f4ecdb970..bbaed874f 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -340,7 +340,7 @@ SUBROUTINE mynnedmf_wrapper_run( & if(.not. flag_for_pbl_generic_tend .and. ldiag3d) then idtend = dtidx(ntke+100,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then allocate(save_qke_adv(im,levs)) save_qke_adv=qke_adv endif @@ -725,7 +725,7 @@ SUBROUTINE mynnedmf_wrapper_run( & call dtend_helper(index_of_temperature,RTHBLTEN,exner) if(ldiag3d) then idtend = dtidx(100+ntoz,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (ozone-old_ozone) deallocate(old_ozone) endif @@ -918,7 +918,7 @@ SUBROUTINE mynnedmf_wrapper_run( & if(allocated(save_qke_adv)) then if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then idtend = dtidx(100+ntke,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + qke_adv-save_qke_adv endif endif @@ -934,7 +934,7 @@ SUBROUTINE dtend_helper(itracer,field,mult) integer :: idtend idtend=dtidx(itracer,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then if(present(mult)) then dtend(:,:,idtend) = dtend(:,:,idtend) + field*dtf*mult else diff --git a/physics/moninedmf.f b/physics/moninedmf.f index c34120e82..e9db1ba77 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -275,8 +275,8 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & km1 = km - 1 kmpbl = km / 2 - idtend1 = 1 - idtend2 = 1 + idtend1 = 0 + idtend2 = 0 !> - Compute physical height of the layer centers and interfaces from the geopotential height (zi and zl) do k=1,km @@ -1295,7 +1295,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & if(.not.flag_for_pbl_generic_tend) then idtend1=dtidx(index_of_temperature,index_of_process_pbl) idtend2=dtidx(ntqv+100,index_of_process_pbl) - if(idtend1>1) then + if(idtend1>=1) then do k = 1,km do i = 1,im ttend = (a1(i,k)-t1(i,k)) * rdt @@ -1303,7 +1303,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo enddo endif - if(idtend2>1) then + if(idtend2>=1) then do k = 1,km do i = 1,im qtend = (a2(i,k)-q1(i,k,1))*rdt @@ -1325,7 +1325,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & if(.not.flag_for_pbl_generic_tend .and. ldiag3d .and. & & rtg_ozone_index>0) then idtend1 = dtidx(100+ntoz,index_of_process_pbl) - if(idtend1>1) then + if(idtend1>=1) then kk = rtg_ozone_index is = (kk-1) * km do k = 1, km @@ -1457,7 +1457,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo if(.not.flag_for_pbl_generic_tend) then idtend1 = dtidx(index_of_x_wind,index_of_process_pbl) - if(idtend1>1) then + if(idtend1>=1) then do k = 1,km do i = 1,im utend = (a1(i,k)-u1(i,k))*rdt @@ -1467,7 +1467,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & endif idtend2 = dtidx(index_of_y_wind,index_of_process_pbl) - if(idtend2>1) then + if(idtend2>=1) then do k = 1,km do i = 1,im vtend = (a2(i,k)-v1(i,k))*rdt diff --git a/physics/moninshoc.f b/physics/moninshoc.f index a78bfb25a..b22a59daa 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -453,11 +453,11 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, enddo if(ldiag3d .and. .not. gen_tend) then idtend = dtidx(index_of_temperature,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + (a1-t1) endif idtend = dtidx(ntqv+100,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + a2-q1(:,:,1) endif endif @@ -480,7 +480,7 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, enddo if(ldiag3d .and. ntoz>0 .and. .not. gen_tend) then idtend=dtidx(100+ntoz,index_of_process_pbl) - if(idtend>0) then + if(idtend>=1) then kk = ntoz is = (kk-1) * km do k = 1, km @@ -538,11 +538,11 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, enddo if (ldiag3d .and. .not. gen_tend) then idtend = dtidx(index_of_x_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + a1-u1 endif idtend = dtidx(index_of_y_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + a1-v1 endif endif diff --git a/physics/ozphys.f b/physics/ozphys.f index 7b03d8d84..26916a459 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -98,7 +98,7 @@ subroutine ozphys_run ( & idtend(3) = dtidx(100+ntoz,index_of_process_temp) ! was ozp3 idtend(4) = dtidx(100+ntoz,index_of_process_overhead_ozone) ! was ozp4 else - idtend=1 + idtend=0 endif ! @@ -167,11 +167,11 @@ subroutine ozphys_run ( & oz(i,l) = (ozib(i) + prod(i,1)*dt) / (1.0 + prod(i,2)*dt) enddo ! - if(idtend(1)>1) then + if(idtend(1)>=1) then dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 & prod(:,1)*dt endif - if(idtend(2)>1) then + if(idtend(2)>=1) then dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 & (oz(:,l) - ozib(:)) endif @@ -190,19 +190,19 @@ subroutine ozphys_run ( & ! &,' ozib=',ozib(i),' l=',l,' tin=',tin(i,l),'colo3=',colo3(i,l+1) oz(i,l) = (ozib(i) + tem*dt) / (1.0 + prod(i,2)*dt) enddo - if(idtend(1)>1) then + if(idtend(1)>=1) then dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 & prod(:,1)*dt endif - if(idtend(2)>1) then + if(idtend(2)>=1) then dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 & (oz(:,l)-ozib(:)) endif - if(idtend(3)>1) then + if(idtend(3)>=1) then dtend(:,l,idtend(3)) = dtend(:,l,idtend(3)) + ! was ozp3 & prod(:,3)*tin(:,l)*dt endif - if(idtend(4)>1) then + if(idtend(4)>=1) then dtend(:,l,idtend(4)) = dtend(:,l,idtend(4)) + ! was ozp4 & prod(:,4)*colo3(:,l+1)*dt endif diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index 3d44a4f92..fac917c95 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -93,7 +93,7 @@ subroutine ozphys_2015_run ( & idtend(3) = dtidx(100+ntoz,index_of_process_temp) ! was ozp3 idtend(4) = dtidx(100+ntoz,index_of_process_overhead_ozone) ! was ozp4 else - idtend=1 + idtend=0 endif !ccpp: save input oz in ozi @@ -169,19 +169,19 @@ subroutine ozphys_2015_run ( & !ccpp ozo(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) oz(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) enddo - if(idtend(1)>1) then + if(idtend(1)>=1) then dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 & (prod(:,1)-prod(:,2)*prod(:,6))*dt endif - if(idtend(2)>1) then + if(idtend(2)>=1) then dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 & (oz(:,l) - ozib(:)) endif - if(idtend(3)>1) then + if(idtend(3)>=1) then dtend(:,l,idtend(3)) = dtend(:,l,idtend(3)) + ! was ozp3 & prod(:,3)*(tin(:,l)-prod(:,5))*dt endif - if(idtend(4)>1) then + if(idtend(4)>=1) then dtend(:,l,idtend(4)) = dtend(:,l,idtend(4)) + ! was ozp4 & prod(:,4) * (colo3(:,l)-coloz(:,l))*dt endif diff --git a/physics/phys_tend.F90 b/physics/phys_tend.F90 index 300a4e9a9..b444f2d97 100644 --- a/physics/phys_tend.F90 +++ b/physics/phys_tend.F90 @@ -20,19 +20,19 @@ end subroutine phys_tend_finalize !! \htmlinclude phys_tend_run.html !! subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & - index_of_process_physics, index_of_process_non_physics, & - nprocess, nprocess_summed, errmsg, errflg) + index_of_process_physics, index_of_process_photochem, & + nprocess, nprocess_summed, is_photochem, ntoz, errmsg, errflg) ! Interface variables - logical, intent(in) :: ldiag3d + logical, intent(in) :: ldiag3d, is_photochem(:) real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_of_process_physics, & - index_of_process_non_physics, ntracp100, nprocess, nprocess_summed + integer, intent(in) :: dtidx(:,:), index_of_process_physics, ntoz, & + ntracp100, nprocess, nprocess_summed, index_of_process_photochem character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: itrac, iphys, iprocess, idtend - logical :: first + integer :: ichem, iphys, itrac + logical :: all_true(nprocess) ! Initialize CCPP error handling variables errmsg = '' @@ -42,36 +42,59 @@ subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & return endif + all_true = .true. + + ! Total photochemical tendencies + itrac=ntoz+100 + ichem = dtidx(itrac,index_of_process_photochem) + if(ichem>=1) then + call sum_it(ichem,itrac,is_photochem) + endif + + do itrac=2,ntracp100 - first=.true. + ! Total physics tendencies iphys = dtidx(itrac,index_of_process_physics) - if(iphys<2) then - cycle ! No physics tendency requested for this tracer - endif - do iprocess=1,nprocess - if(iprocess>nprocess_summed .or. iprocess==index_of_process_physics .or. & - iprocess==index_of_process_non_physics) then - cycle ! Don't sum up the sums. - endif - idtend = dtidx(itrac,iprocess) - if(idtend>1) then - ! This tendency was calculated for this tracer, so - ! accumulate it into the total physics tendency. - if(first) then - dtend(:,:,iphys) = dtend(:,:,idtend) - first=.false. - else - dtend(:,:,iphys) = dtend(:,:,iphys) + dtend(:,:,idtend) - endif - endif - enddo - if(first) then - ! No physics tendencies were calculated for this tracer, - ! so total physics tendency is 0. - dtend(:,:,iphys) = 0 + if(iphys>=1) then + call sum_it(iphys,itrac,all_true) endif enddo + contains + + subroutine sum_it(isum,itrac,sum_me) + implicit none + integer, intent(in) :: isum ! third index of dtend of summary process + integer, intent(in) :: itrac ! tracer or state variable being summed + logical, intent(in) :: sum_me(nprocess) ! false = skip this process + logical :: first + integer :: idtend, iprocess + + first=.true. + do iprocess=1,nprocess + if(iprocess>nprocess_summed) then + exit ! Don't sum up the sums. + else if(.not.sum_me(iprocess)) then + cycle ! We were asked to skip this one. + endif + idtend = dtidx(itrac,iprocess) + if(idtend>=1) then + ! This tendency was calculated for this tracer, so + ! accumulate it into the total tendency. + if(first) then + dtend(:,:,isum) = dtend(:,:,idtend) + first=.false. + else + dtend(:,:,isum) = dtend(:,:,isum) + dtend(:,:,idtend) + endif + endif + enddo + if(first) then + ! No tendencies were calculated, so sum is 0: + dtend(:,:,isum) = 0 + endif + end subroutine sum_it + end subroutine phys_tend_run end module phys_tend diff --git a/physics/phys_tend.meta b/physics/phys_tend.meta index b792ad238..d9331c4f1 100644 --- a/physics/phys_tend.meta +++ b/physics/phys_tend.meta @@ -48,9 +48,9 @@ type = integer intent = in optional = F -[index_of_process_non_physics] - standard_name = index_of_non_physics_process_in_cumulative_change_index - long_name = index of non-physics transport process in second dimension of array cumulative change index +[index_of_process_photochem] + standard_name = index_of_photochemistry_process_in_cumulative_change_index + long_name = index of photochemistry process in second dimension of array cumulative change index units = index dimensions = () type = integer @@ -72,6 +72,22 @@ type = integer intent = in optional = F +[is_photochem] + standard_name = flags_for_photochemistry_processes_to_sum + long_name = flags for photochemistry processes to sum as the total photochemistry process cumulative change + units = flag + dimensions = (number_of_cumulative_change_processes) + type = logical + intent = in + optional = F +[ntoz] + standard_name = index_for_ozone + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f index d44c1b6cb..76d15777b 100644 --- a/physics/rayleigh_damp.f +++ b/physics/rayleigh_damp.f @@ -92,9 +92,9 @@ subroutine rayleigh_damp_run ( & tidx=dtidx(index_of_temperature, & & index_of_process_rayleigh_damping) else - uidx=1 - vidx=1 - tidx=1 + uidx=0 + vidx=0 + tidx=0 endif ! ! Initialize CCPP error handling variables @@ -133,13 +133,13 @@ subroutine rayleigh_damp_run ( & A(I,K) = A(I,K) + deltaA B(I,K) = B(I,K) + deltaB C(I,K) = C(I,K) + deltaC - IF(vidx>1) THEN + IF(vidx>=1) THEN dtend(i,k,vidx) = dtend(i,k,vidx) + deltaA ENDIF - IF(uidx>1) THEN + IF(uidx>=1) THEN dtend(i,k,uidx) = dtend(i,k,uidx) + deltaB ENDIF - IF(tidx>1) THEN + IF(tidx>=1) THEN dtend(i,k,tidx) = dtend(i,k,tidx) + deltaC ENDIF ENDDO diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index fdfa49e3e..a74e15f19 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -1404,11 +1404,11 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo if (ldiag3d .and. .not. gen_tend) then idtend = dtidx(index_of_temperature,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f1-t1) endif idtend = dtidx(100+ntqv,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) +delt*rdt*(f2-q1(:,:,1)) endif endif @@ -1514,11 +1514,11 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo if (ldiag3d .and. .not. gen_tend) then idtend=dtidx(index_of_x_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f1-u1) endif idtend=dtidx(index_of_y_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + delt*rdt*(f2-v1) endif endif diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index ae70a3227..dddbae0d6 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -1423,7 +1423,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo if(ldiag3d .and. .not. gen_tend) then idtend=dtidx(index_of_temperature,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then do k = 1,km do i = 1,im ttend = (f1(i,k)-t1(i,k))*rdt @@ -1433,7 +1433,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & endif ! Send tendencies just for QV; other tracers are below. idtend=dtidx(100+ntqv,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then do k = 1,km do i = 1,im qtend = (f2(i,k)-q1(i,k,1))*rdt @@ -1458,7 +1458,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & do kk = 2, ntrac1 is = (kk-1) * km idtend = dtidx(kk+100,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then if(kk==ntke) then do k = 1, km do i = 1, im @@ -1492,7 +1492,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo if(ldiag3d .and. .not. gen_tend) then idtend=dtidx(index_of_temperature,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then do k = 1,km1 do i = 1,im ttend = diss(i,k) / cp @@ -1579,7 +1579,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & enddo if(ldiag3d .and. .not. gen_tend) then idtend=dtidx(index_of_x_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then do k = 1,km do i = 1,im utend = (f1(i,k)-u1(i,k))*rdt @@ -1589,7 +1589,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & endif idtend=dtidx(index_of_y_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then do k = 1,km do i = 1,im vtend = (f2(i,k)-v1(i,k))*rdt diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index 52b2f4ba4..108169e24 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -972,7 +972,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then idtend = dtidx(index_of_temperature,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f1-thx+300.)*rdt*pi2d endif endif @@ -1102,7 +1102,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then idtend = dtidx(ntqv+100,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*rdt*(f3(:,:,1)-qx(:,:,1)) endif endif @@ -1138,7 +1138,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & if(lssav .and. ldiag3d .and. ntoz>0 .and. & & .not. flag_for_pbl_generic_tend) then idtend=dtidx(ntoz+100,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + qtend*(f3(:,:,ntoz)-qx(:,:,ntoz)) endif endif @@ -1235,11 +1235,11 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then idtend=dtidx(index_of_x_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*rdt*(f1-ux) endif idtend=dtidx(index_of_y_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*rdt*(f2-vx) endif endif diff --git a/physics/ugwpv1_gsldrag.F90 b/physics/ugwpv1_gsldrag.F90 index 98e31f27b..fbe871f42 100644 --- a/physics/ugwpv1_gsldrag.F90 +++ b/physics/ugwpv1_gsldrag.F90 @@ -623,15 +623,15 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd ! if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif idtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif idtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif endif @@ -690,15 +690,15 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dudt_ngw(i,k)*dtp endif idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dvdt_ngw(i,k)*dtp endif idtend = dtidx(index_of_temperature,index_of_process_nonorographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtdt_ngw(i,k)*dtp endif endif diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index 76c7d2fa5..3380c20c2 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -386,17 +386,17 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif idtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif idtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif endif @@ -486,17 +486,17 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdudt*dtp endif idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdvdt*dtp endif idtend = dtidx(index_of_temperature,index_of_process_nonorographic_gwd) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + Pdtdt*dtp endif endif diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index be452a154..ab51819f9 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -858,7 +858,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then idtend = dtidx(index_of_temperature,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f1-thx+300.)*rdt*pi2d endif endif @@ -972,7 +972,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo if(lssav .and. ldiag3d .and. qdiag3d .and. .not. flag_for_pbl_generic_tend) then idtend = dtidx(ntqv+100,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f3(:,:,1)-qx(:,:,1))*rdt endif endif @@ -989,7 +989,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & if(lssav .and. ldiag3d .and. ntoz>0 .and. qdiag3d .and. & & .not. flag_for_pbl_generic_tend) then idtend = dtidx(100+ntoz,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + f3(:,:,ntoz)-qx(:,:,ntoz) endif endif @@ -1076,12 +1076,12 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & enddo if(lssav .and. ldiag3d .and. .not. flag_for_pbl_generic_tend) then idtend = dtidx(index_of_x_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f1-ux)*rdt endif idtend = dtidx(index_of_y_wind,index_of_process_pbl) - if(idtend>1) then + if(idtend>=1) then dtend(:,:,idtend) = dtend(:,:,idtend) + dtstep*(f2-vx)*rdt endif endif From 1057ff427c89e1e1edb7a4c262e491d82d247458 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 5 Apr 2021 16:05:22 +0000 Subject: [PATCH 12/24] Corrections to argument lists after merge --- physics/GFS_MP_generic.F90 | 8 ++++---- physics/GFS_PBL_generic.F90 | 2 +- physics/GFS_suite_interstitial.F90 | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 31a3558b6..9216ead40 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -85,12 +85,12 @@ end subroutine GFS_MP_generic_post_init !> @{ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, & imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, & - rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0, & + rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, 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, 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, & - graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, & - dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, & + drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & + graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, & + dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, & errmsg, errflg) ! use machine, only: kind_phys diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index a397c15b5..76f41df9a 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -334,7 +334,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, & index_of_process_pbl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, & dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag, & - rd, cp, fvirt, hvap, t1, q1, prsl, hflx, ushfsfci, oceanfrac, flag_cice, dusfc_cice, dvsfc_cice, & + rd, cp, fvirt, hvap, t1, q1, prsl, hflx, ushfsfci, oceanfrac, kdt, dusfc_cice, dvsfc_cice, & dtsfc_cice, dqsfc_cice, wet, dry, icy, wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1, dkt_cpl, dkt, hffac, hefac, & ugrs, vgrs, tgrs, qgrs, save_u, save_v, save_t, save_q, errmsg, errflg) diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 85b58f3c4..76b18e95f 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -680,9 +680,9 @@ end subroutine GFS_suite_interstitial_4_finalize !! subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_total, ntrac, ntcw, ntiw, ntclamt, & ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, & - imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, dtf, save_qc, save_qi, con_pi, & - gq0, clw, prsl, save_tcp, con_rd, nwfa, spechum, dqdti, dtidx, dtend, ntk, ntke, ldiag3d, & - index_of_process_conv_trans, errmsg, errflg) + imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, convert_dry_rho, dtf, save_qc, save_qi, con_pi, dtidx, dtend,& + index_of_process_conv_trans, gq0, clw, prsl, save_tcp, con_rd, con_eps, nwfa, spechum, dqdti, ldiag3d, & + ntk, ntke, errmsg, errflg) use machine, only: kind_phys use module_mp_thompson_make_number_concentrations, only: make_IceNumber, make_DropletNumber From 4043ea9b9d8753644549f20d6b96eae2bf82769a Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 7 Apr 2021 11:57:50 +0000 Subject: [PATCH 13/24] Revert an accidental change to GFS_debug.F90 --- physics/GFS_debug.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index e0de4b225..f4a290884 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -642,9 +642,9 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, endif enddo enddo -- !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%upd_mf ', Diag%upd_mf) -- !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dwn_mf ', Diag%dwn_mf) -- !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%det_mf ', Diag%det_mf) + !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%upd_mf ', Diag%upd_mf) + !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dwn_mf ', Diag%dwn_mf) + !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%det_mf ', Diag%det_mf) end if if(Model%lradar) then call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%refl_10cm ', Diag%refl_10cm) From 959e76bf1023838b1e25658944b14e9d8f08ec2f Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 7 Apr 2021 12:01:30 +0000 Subject: [PATCH 14/24] Point to the correct hash of rte-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 2aa3ce20dfd136381e5eef216585f29366c3011b Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 12 Apr 2021 16:38:02 +0000 Subject: [PATCH 15/24] Fix whitespace issues. --- physics/GFS_DCNV_generic.F90 | 13 +++++++------ physics/GFS_MP_generic.F90 | 6 +++--- physics/GFS_SCNV_generic.F90 | 10 +++++----- physics/GFS_suite_interstitial.F90 | 4 ++-- physics/gwdc.f | 4 ++-- physics/ozphys.f | 9 ++++----- physics/ozphys_2015.f | 2 +- physics/shinhongvdif.F90 | 5 ++--- physics/ugwpv1_gsldrag.F90 | 6 +++--- 9 files changed, 29 insertions(+), 30 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index 40f42561a..12a8e961d 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -99,12 +99,13 @@ end subroutine GFS_DCNV_generic_post_finalize !> \section arg_table_GFS_DCNV_generic_post_run Argument Table !! \htmlinclude GFS_DCNV_generic_post_run.html !! - subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & - frain, rain1, dtf, cld1d, save_u, save_v, save_t, gu0, gv0, gt0, & - ud_mf, dd_mf, dt_mf, con_g, npdf3d, num_p3d, ncnvcld3d, nsamftrac, & - rainc, cldwrk, upd_mf, dwn_mf, det_mf, dtend, dtidx, index_of_process_dcnv, & - index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gq0, save_q, & - cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, flag_for_dcnv_generic_tend, errmsg, errflg) + subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & + frain, rain1, dtf, cld1d, save_u, save_v, save_t, gu0, gv0, gt0, & + ud_mf, dd_mf, dt_mf, con_g, npdf3d, num_p3d, ncnvcld3d, nsamftrac, & + rainc, cldwrk, upd_mf, dwn_mf, det_mf, dtend, dtidx, index_of_process_dcnv, & + index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gq0, save_q, & + cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, flag_for_dcnv_generic_tend, & + errmsg, errflg) use machine, only: kind_phys diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 9216ead40..db24ee452 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -84,10 +84,10 @@ end subroutine GFS_MP_generic_post_init !> \section gfs_mp_gen GFS MP Generic Post General Algorithm !> @{ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, & - imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, & - rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0, & + imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, con_g, dtf, frain, rainc, & + rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, 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, rain_cpl, rainc_cpl, snow_cpl, pwat, & + totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat, & drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, & dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, & diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index 205495529..d37d96d71 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -76,11 +76,11 @@ end subroutine GFS_SCNV_generic_post_finalize !> \section arg_table_GFS_SCNV_generic_post_run Argument Table !! \htmlinclude GFS_SCNV_generic_post_run.html !! - subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cplchm, & - frain, gu0, gv0, gt0, gq0, save_u, save_v, save_t, save_q, dqdti, clw, & - shcnvcw, rain1, npdf3d, num_p3d, ncnvcld3d, cnvc, cnvw, nsamftrac, & - rainc, cnvprcp, cnvprcpb, cnvw_phy_f3d, cnvc_phy_f3d, & - dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, & + subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & + cplchm, frain, gu0, gv0, gt0, gq0, save_u, save_v, save_t, save_q, dqdti, & + clw, shcnvcw, rain1, npdf3d, num_p3d, ncnvcld3d, cnvc, cnvw, nsamftrac, & + rainc, cnvprcp, cnvprcpb, cnvw_phy_f3d, cnvc_phy_f3d, & + dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, & index_of_process_scnv, ntqv, flag_for_scnv_generic_tend, & imfshalcnv, imfshalcnv_sas, imfshalcnv_samf, errmsg, errflg) diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 76b18e95f..771c346b6 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -162,8 +162,8 @@ end subroutine GFS_suite_interstitial_2_finalize subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplflx, flag_cice, shal_cnv, old_monin, mstrat, & do_shoc, frac_grid, imfshalcnv, dtf, xcosz, adjsfcdsw, adjsfcdlw, cice, pgr, ulwsfc_cice, lwhd, htrsw, htrlw, xmu, ctei_rm, & work1, work2, prsi, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, cp, hvap, prslk, suntim, adjsfculw, adjsfculw_lnd, & - adjsfculw_ice, adjsfculw_wat, dlwsfc, ulwsfc, psmean, dtend, dtidx, index_of_process_longwave, index_of_process_shortwave, & - index_of_process_pbl, index_of_process_dcnv, index_of_process_scnv, index_of_process_mp, index_of_temperature, & + adjsfculw_ice, adjsfculw_wat, dlwsfc, ulwsfc, psmean, dtend, dtidx, index_of_process_longwave, index_of_process_shortwave, & + index_of_process_pbl, index_of_process_dcnv, index_of_process_scnv, index_of_process_mp, index_of_temperature, & ctei_rml, ctei_r, kinver, dry, icy, wet, frland, huge, use_LW_jacobian, errmsg, errflg) implicit none diff --git a/physics/gwdc.f b/physics/gwdc.f index 6a4863055..f286f5ecb 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -1476,8 +1476,8 @@ subroutine gwdc_post_run( & real(kind=kind_phys), intent(inout) :: dugwd(:), dvgwd(:), & & gu0(:,:), gv0(:,:), gt0(:,:) real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_of_process_nonorographic_& - & gwd + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: index_of_process_nonorographic_gwd integer, intent(in) :: index_of_x_wind, index_of_y_wind character(len=*), intent(out) :: errmsg diff --git a/physics/ozphys.f b/physics/ozphys.f index 26916a459..011b63fac 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -47,8 +47,8 @@ end subroutine ozphys_finalize subroutine ozphys_run ( & & im, levs, ko3, dt, oz, tin, po3, & & prsl, prdout, oz_coeff, delp, ldiag3d, & - & ntoz, dtend, dtidx, index_of_process_prod_loss, & - & index_of_process_ozmix, index_of_process_temp, & + & ntoz, dtend, dtidx, index_of_process_prod_loss, & + & index_of_process_ozmix, index_of_process_temp, & & index_of_process_overhead_ozone, con_g, me, errmsg, errflg) ! ! this code assumes that both prsl and po3 are from bottom to top @@ -59,12 +59,11 @@ subroutine ozphys_run ( & ! ! Interface variables integer, intent(in) :: im, levs, ko3, oz_coeff, me - real(kind=kind_phys), intent(inout) :: & - & oz(im,levs) + real(kind=kind_phys), intent(inout) :: oz(im,levs) ! The dtend array may not be allocated and needs an assumed array size real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), ntoz, & - & index_of_process_prod_loss, index_of_process_ozmix, & + & index_of_process_prod_loss, index_of_process_ozmix, & & index_of_process_temp, index_of_process_overhead_ozone real(kind=kind_phys), intent(in) :: & & dt, po3(ko3), prdout(im,ko3,oz_coeff), & diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index fac917c95..2499f3218 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -68,7 +68,7 @@ subroutine ozphys_2015_run ( & ! dtend may not be allocated and needs an assumed array size real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), ntoz, & - & index_of_process_prod_loss, index_of_process_ozmix, & + & index_of_process_prod_loss, index_of_process_ozmix, & & index_of_process_temp, index_of_process_overhead_ozone real(kind=kind_phys), intent(inout) :: oz(im,levs) diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index 108169e24..0b88f2978 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -36,7 +36,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & u10,v10, & dx,lssav,ldiag3d, & flag_for_pbl_generic_tend,ntoz,ntqv,dtend,dtidx, & - index_of_process_pbl,index_of_temperature,index_of_x_wind, & + index_of_process_pbl,index_of_temperature,index_of_x_wind, & index_of_y_wind,errmsg,errflg ) use machine , only : kind_phys @@ -109,8 +109,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & ! 1D in integer, intent(in ) :: im,km,ntrac,ndiff,ntcw,ntiw,ntoz real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt - logical, intent(in ) :: lssav, ldiag3d, & - flag_for_pbl_generic_tend + logical, intent(in ) :: lssav, ldiag3d, flag_for_pbl_generic_tend ! 3D in real(kind=kind_phys), dimension(im, km) , & intent(in ) :: phil, & diff --git a/physics/ugwpv1_gsldrag.F90 b/physics/ugwpv1_gsldrag.F90 index 62f482021..b9828ccb4 100644 --- a/physics/ugwpv1_gsldrag.F90 +++ b/physics/ugwpv1_gsldrag.F90 @@ -318,7 +318,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd dudt_oss, dvdt_oss, du_osscol, dv_osscol, & dudt_ofd, dvdt_ofd, du_ofdcol, dv_ofdcol, & dudt_ngw, dvdt_ngw, dtdt_ngw, kdis_ngw, dudt_gw, dvdt_gw, dtdt_gw, kdis_gw, & - tau_ogw, tau_ngw, tau_oss, & + tau_ogw, tau_ngw, tau_oss, & zogw, zlwb, zobl, zngw, dusfcg, dvsfcg, dudt, dvdt, dtdt, rdxzb, & dtend, dtidx, index_of_x_wind, index_of_y_wind, index_of_temperature, & index_of_process_orographic_gwd, index_of_process_nonorographic_gwd, & @@ -432,8 +432,8 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd ! dtend is only allocated if ldiag=.true. real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), & - index_of_x_wind, index_of_y_wind, index_of_temperature, & + integer, intent(in) :: dtidx(:,:), & + index_of_x_wind, index_of_y_wind, index_of_temperature, & index_of_process_orographic_gwd, index_of_process_nonorographic_gwd real(kind=kind_phys), intent(out), dimension(im) :: rdxzb ! for stoch phys. mtb-level From 1da87101a430202cc5daa24ae4968ac49d42ef40 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 21 May 2021 07:01:57 -0600 Subject: [PATCH 16/24] Bug fixes from merge of main into gsl/develop --- physics/GFS_DCNV_generic.F90 | 22 ++++++++++------------ physics/GFS_DCNV_generic.meta | 8 ++++++++ physics/GFS_suite_interstitial.F90 | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index 2db3f13a7..bc0c823f4 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -99,8 +99,8 @@ end subroutine GFS_DCNV_generic_post_finalize !> \section arg_table_GFS_DCNV_generic_post_run Argument Table !! \htmlinclude GFS_DCNV_generic_post_run.html !! - subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & - frain, rain1, dtf, cld1d, save_u, save_v, save_t, gu0, gv0, gt0, & + subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, & + cscnv, frain, rain1, dtf, cld1d, save_u, save_v, save_t, gu0, gv0, gt0, & ud_mf, dd_mf, dt_mf, con_g, npdf3d, num_p3d, ncnvcld3d, nsamftrac, & rainc, cldwrk, upd_mf, dwn_mf, det_mf, dtend, dtidx, index_of_process_dcnv, & index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gq0, save_q, & @@ -113,7 +113,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & implicit none integer, intent(in) :: im, levs, nsamftrac - logical, intent(in) :: lssav, ldiag3d, ras, cscnv + logical, intent(in) :: lssav, ldiag3d, qdiag3d, ras, cscnv logical, intent(in) :: flag_for_dcnv_generic_tend real(kind=kind_phys), intent(in) :: frain, dtf @@ -205,15 +205,13 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & ! convective mass fluxes if(qdiag3d) then - do k=1,levs - do i=1,im - dq3dt(i,k) = dq3dt(i,k) + (gq0_water_vapor(i,k)-save_qv(i,k)) * frain - ! convective mass fluxes - upd_mf(i,k) = upd_mf(i,k) + ud_mf(i,k) * (con_g*frain) - dwn_mf(i,k) = dwn_mf(i,k) + dd_mf(i,k) * (con_g*frain) - det_mf(i,k) = det_mf(i,k) + dt_mf(i,k) * (con_g*frain) - enddo - enddo + do k=1,levs + do i=1,im + upd_mf(i,k) = upd_mf(i,k) + ud_mf(i,k) * (con_g*frain) + dwn_mf(i,k) = dwn_mf(i,k) + dd_mf(i,k) * (con_g*frain) + det_mf(i,k) = det_mf(i,k) + dt_mf(i,k) * (con_g*frain) + enddo + enddo endif endif ! if (ldiag3d) diff --git a/physics/GFS_DCNV_generic.meta b/physics/GFS_DCNV_generic.meta index 8ddace1cc..e14820044 100644 --- a/physics/GFS_DCNV_generic.meta +++ b/physics/GFS_DCNV_generic.meta @@ -228,6 +228,14 @@ type = logical intent = in optional = F +[qdiag3d] + standard_name = flag_tracer_diagnostics_3D + long_name = flag for 3d tracer diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F [ras] standard_name = flag_for_ras_deep_convection long_name = flag for ras convection scheme diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 8a58212e7..e68927cb1 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -315,7 +315,7 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, flag_ idtend = dtidx(index_of_temperature,index_of_process_longwave) if(idtend>=1) then if (use_LW_jacobian) then - dtend(:,:,idtend)) = dtend(:,:,idtend) + htrlwu(:,:)*dtf + dtend(:,:,idtend) = dtend(:,:,idtend) + htrlwu(:,:)*dtf else dtend(:,:,idtend) = dtend(:,:,idtend) + htrlw(:,:)*dtf endif From 2f38f276e2f807b3d5656ff08640f170299ead0b Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 24 May 2021 15:20:12 +0000 Subject: [PATCH 17/24] Bug fixes to dtend support: 1. Store rtg (AKA clw AKA qtr) instead of gq0 in DCNV and SCNV pre/post for schemes that use convective transport. Tracers handled solely by convective transport (ones not in rtg) are reported as convective transport tendencies. Tendencies for variables in rtg are reported as dcnv and scnv tendencies. 2. Report TKE tendencies from gfs v16 PBL. 3. Add diagnostic tendencies to drag_suite --- physics/GFS_DCNV_generic.F90 | 91 +++++++---- physics/GFS_DCNV_generic.meta | 242 +++++++++++++++++++++++++++- physics/GFS_SCNV_generic.F90 | 85 +++++++--- physics/GFS_SCNV_generic.meta | 233 ++++++++++++++++++++++++++ physics/GFS_suite_interstitial.F90 | 80 ++++++--- physics/GFS_suite_interstitial.meta | 92 +++++++++++ physics/drag_suite.F90 | 49 +++++- physics/drag_suite.meta | 58 +++++++ physics/module_MYNNPBL_wrapper.F90 | 11 +- physics/rayleigh_damp.f | 7 +- physics/satmedmfvdifq.F | 16 +- 11 files changed, 866 insertions(+), 98 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index 12a8e961d..420aca498 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -17,14 +17,17 @@ end subroutine GFS_DCNV_generic_pre_finalize !! subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplchm, & gu0, gv0, gt0, gq0, nsamftrac, ntqv, & - save_u, save_v, save_t, save_q, dqdti, & + save_u, save_v, save_t, save_q, dqdti, clw, & + ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, & + ntgnc, cscnv, satmedmf, trans_trac, ras, ntrac, & dtidx, index_of_process_dcnv, errmsg, errflg) use machine, only: kind_phys implicit none - integer, intent(in) :: im, levs, nsamftrac, ntqv, index_of_process_dcnv, dtidx(:,:) + integer, intent(in) :: im, levs, nsamftrac, ntqv, index_of_process_dcnv, dtidx(:,:), & + ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntrac,ntgnc logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0 real(kind=kind_phys), dimension(im,levs), intent(in) :: gv0 @@ -38,9 +41,11 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - + logical, intent(in) :: cscnv, satmedmf, trans_trac, ras real(kind=kind_phys), parameter :: zero = 0.0d0 - integer :: i, k, n + real(kind=kind_phys), dimension(:,:,:), intent(in) :: clw + + integer :: i, k, n, tracers ! Initialize CCPP error handling variables errmsg = '' @@ -63,19 +68,28 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc endif if ((ldiag3d.and.qdiag3d) .or. cplchm) then - if(nsamftrac>0) then - do n=1,nsamftrac - if(n==ntqv .or. dtidx(n+100,index_of_process_dcnv)>=1) then - save_q(:,:,n) = gq0(:,:,n) - endif - enddo - else - do k=1,levs - do i=1,im - save_q(i,k,ntqv) = gq0(i,k,ntqv) + if (cscnv .or. satmedmf .or. trans_trac .or. ras) then + print *,'dcnv store clw' + tracers = 2 + do n=2,ntrac + if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. & + n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. & + n /= ntsnc .and. n /= ntgl .and. n /= ntgnc) then + tracers = tracers + 1 + if(dtidx(100+n,index_of_process_dcnv)>0) then + save_q(:,:,n) = clw(:,:,tracers) + endif + endif enddo - enddo - endif + else + print *,'dcnv store gq0' + do n=2,ntrac + if(dtidx(100+n,index_of_process_dcnv)>0) then + save_q(:,:,n) = gq0(:,:,n) + endif + enddo + endif ! end if_ras or cfscnv or samf + save_q(:,:,ntqv) = gq0(:,:,ntqv) endif if (cplchm) then @@ -105,7 +119,8 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & rainc, cldwrk, upd_mf, dwn_mf, det_mf, dtend, dtidx, index_of_process_dcnv, & index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gq0, save_q, & cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, flag_for_dcnv_generic_tend, & - errmsg, errflg) + ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc, ntrac,clw, & + satmedmf, trans_trac, errmsg, errflg) use machine, only: kind_phys @@ -124,6 +139,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & real(kind=kind_phys), dimension(im,levs), intent(in) :: ud_mf, dd_mf, dt_mf real(kind=kind_phys), intent(in) :: con_g integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d + logical, intent(in) :: satmedmf, trans_trac real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cldwrk ! dtend, upd_mf, dwn_mf, det_mf only allocated if ldiag3d == .true. @@ -133,6 +149,9 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend integer, intent(in) :: dtidx(:,:), index_of_process_dcnv, index_of_temperature, & index_of_x_wind, index_of_y_wind, ntqv + integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntrac,ntgnc + real(kind=kind_phys), dimension(:,:,:), intent(in) :: clw + ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, @@ -143,7 +162,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k, n, idtend + integer :: i, k, n, idtend, tracers ! Initialize CCPP error handling variables errmsg = '' @@ -194,18 +213,32 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, ras, cscnv, & dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0-save_v)*frain endif - if(nsamftrac>0) then - do n=1,nsamftrac - idtend=dtidx(100+n,index_of_process_dcnv) - if(idtend>=1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n)-save_q(:,:,n))*frain - endif - enddo + if (cscnv .or. satmedmf .or. trans_trac .or. ras) then + print *,'dcnv accum clw' + tracers = 2 + do n=2,ntrac + if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. & + n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. & + n /= ntsnc .and. n /= ntgl .and. n /= ntgnc) then + tracers = tracers + 1 + idtend = dtidx(100+n,index_of_process_dcnv) + if(idtend>0) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,tracers)-save_q(:,:,n) * frain + endif + endif + enddo else - idtend=dtidx(100+ntqv,index_of_process_dcnv) - if(idtend>=1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv)-save_q(:,:,ntqv))*frain - endif + print *,'dcnv accume gq0' + do n=2,ntrac + idtend = dtidx(100+n,index_of_process_dcnv) + if(idtend>0) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n)-save_q(:,:,n))*frain + endif + enddo + endif + idtend = dtidx(100+ntqv, index_of_process_dcnv) + if(idtend>=1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv) - save_q(:,:,ntqv)) * frain endif ! convective mass fluxes diff --git a/physics/GFS_DCNV_generic.meta b/physics/GFS_DCNV_generic.meta index 8ddace1cc..08e015427 100644 --- a/physics/GFS_DCNV_generic.meta +++ b/physics/GFS_DCNV_generic.meta @@ -168,6 +168,127 @@ type = integer intent = in optional = F +[cscnv] + standard_name = flag_for_Chikira_Sugiyama_deep_convection + long_name = flag for Chikira-Sugiyama convection + units = flag + dimensions = () + type = logical + intent = in + optional = F +[satmedmf] + standard_name = flag_for_scale_aware_TKE_moist_EDMF_PBL + long_name = flag for scale-aware TKE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[trans_trac] + standard_name = flag_for_convective_transport_of_tracers + long_name = flag for convective transport of tracers + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ras] + standard_name = flag_for_ras_deep_convection + long_name = flag for ras convection scheme + units = flag + dimensions = () + type = logical + 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 = () + type = integer + intent = in + optional = F +[ntclamt] + standard_name = index_for_cloud_amount + long_name = tracer index for cloud amount integer + units = index + dimensions = () + type = integer + intent = in + optional = F +[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 +[ntrnc] + standard_name = index_for_rain_number_concentration + long_name = tracer index for rain number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsnc] + standard_name = index_for_snow_number_concentration + long_name = tracer index for snow number concentration + 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 +[ntgnc] + standard_name = index_for_graupel_number_concentration + long_name = tracer index for graupel number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[clw] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other convective trans. tracers + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -236,14 +357,6 @@ type = logical intent = in optional = F -[cscnv] - standard_name = flag_for_Chikira_Sugiyama_deep_convection - long_name = flag for Chikira-Sugiyama convection - units = flag - dimensions = () - type = logical - intent = in - optional = F [frain] standard_name = dynamics_to_physics_timestep_ratio long_name = ratio of dynamics timestep to physics timestep @@ -566,6 +679,119 @@ type = logical intent = in optional = F +[cscnv] + standard_name = flag_for_Chikira_Sugiyama_deep_convection + long_name = flag for Chikira-Sugiyama convection + units = flag + dimensions = () + type = logical + intent = in + optional = F +[satmedmf] + standard_name = flag_for_scale_aware_TKE_moist_EDMF_PBL + long_name = flag for scale-aware TKE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[trans_trac] + standard_name = flag_for_convective_transport_of_tracers + long_name = flag for convective transport of tracers + units = flag + dimensions = () + type = logical + 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 = () + type = integer + intent = in + optional = F +[ntclamt] + standard_name = index_for_cloud_amount + long_name = tracer index for cloud amount integer + units = index + dimensions = () + type = integer + intent = in + optional = F +[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 +[ntrnc] + standard_name = index_for_rain_number_concentration + long_name = tracer index for rain number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsnc] + standard_name = index_for_snow_number_concentration + long_name = tracer index for snow number concentration + 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 +[ntgnc] + standard_name = index_for_graupel_number_concentration + long_name = tracer index for graupel number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[clw] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other convective trans. tracers + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index d37d96d71..352273b06 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -16,13 +16,15 @@ end subroutine GFS_SCNV_generic_pre_finalize !! subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, gq0, & save_u, save_v, save_t, save_q, ntqv, nsamftrac, flag_for_scnv_generic_tend, & - dtidx, index_of_process_scnv, errmsg, errflg) + dtidx, index_of_process_scnv, ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc, & + cscnv, satmedmf, trans_trac, ras, ntrac, clw, errmsg, errflg) use machine, only: kind_phys implicit none integer, intent(in) :: im, levs, ntqv, nsamftrac, index_of_process_scnv, dtidx(:,:) + integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc,ntrac logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0 real(kind=kind_phys), intent(in) :: gq0(:,:,:) @@ -30,8 +32,10 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u, save_v, save_t character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + logical, intent(in) :: cscnv, satmedmf, trans_trac, ras + real(kind=kind_phys), dimension(:,:,:), intent(in) :: clw - integer :: i, k, n + integer :: i, k, n, tracers ! Initialize CCPP error handling variables errmsg = '' @@ -46,17 +50,30 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, enddo enddo if (qdiag3d) then - if(nsamftrac>0) then - do n=1,nsamftrac - if(n==ntqv .or. dtidx(ntqv,index_of_process_scnv)>=1) then - save_q(:,:,n) = gq0(:,:,n) - endif - enddo - else - save_q(:,:,ntqv) = gq0(:,:,ntqv) - endif + if (cscnv .or. satmedmf .or. trans_trac .or. ras) then + print *,'scnv store clw' + tracers = 2 + do n=2,ntrac + if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. & + n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. & + n /= ntsnc .and. n /= ntgl .and. n /= ntgnc) then + tracers = tracers + 1 + if(dtidx(100+n,index_of_process_scnv)>0) then + save_q(:,:,n) = clw(:,:,tracers) + endif + endif + enddo + else + print *,'scnv store gq0' + do n=2,ntrac + if(dtidx(100+n,index_of_process_scnv)>0) then + save_q(:,:,n) = gq0(:,:,n) + endif + enddo + endif ! end if_ras or cfscnv or samf + save_q(:,:,ntqv) = gq0(:,:,ntqv) endif - endif + endif end subroutine GFS_SCNV_generic_pre_run @@ -82,13 +99,16 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & rainc, cnvprcp, cnvprcpb, cnvw_phy_f3d, cnvc_phy_f3d, & dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, & index_of_process_scnv, ntqv, flag_for_scnv_generic_tend, & - imfshalcnv, imfshalcnv_sas, imfshalcnv_samf, errmsg, errflg) + ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc, & + imfshalcnv, imfshalcnv_sas, imfshalcnv_samf, ntrac, & + cscnv, satmedmf, trans_trac, ras, errmsg, errflg) use machine, only: kind_phys implicit none integer, intent(in) :: im, levs, nn, ntqv, nsamftrac + integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc,ntrac logical, intent(in) :: lssav, ldiag3d, qdiag3d, cplchm, flag_for_scnv_generic_tend real(kind=kind_phys), intent(in) :: frain real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0 @@ -114,11 +134,12 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & ! as long as these do not get used when not allocated. real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw_phy_f3d, cnvc_phy_f3d integer, intent(in) :: imfshalcnv, imfshalcnv_sas, imfshalcnv_samf + logical, intent(in) :: cscnv, satmedmf, trans_trac, ras character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k, n, idtend + integer :: i, k, n, idtend, tracers real(kind=kind_phys) :: tem ! Initialize CCPP error handling variables @@ -163,18 +184,32 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & dtend(:,:,idtend) = dtend(:,:,idtend) + (gv0 - save_v) * frain endif - if(nsamftrac>0) then - do n=1,nsamftrac - idtend = dtidx(100+n, index_of_process_scnv) - if(idtend>=1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n) - save_q(:,:,n)) * frain - endif - enddo + if (cscnv .or. satmedmf .or. trans_trac .or. ras) then + print *,'scnv accum clw' + tracers = 2 + do n=2,ntrac + if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. & + n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. & + n /= ntsnc .and. n /= ntgl .and. n /= ntgnc) then + tracers = tracers + 1 + idtend = dtidx(100+n,index_of_process_scnv) + if(idtend>0) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,tracers)-save_q(:,:,n) * frain + endif + endif + enddo else - idtend = dtidx(100+ntqv, index_of_process_scnv) - if(idtend>=1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv) - save_q(:,:,ntqv)) * frain - endif + print *,'scnv accum gq0' + do n=2,ntrac + idtend = dtidx(100+n,index_of_process_scnv) + if(idtend>0) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,n)-save_q(:,:,n))*frain + endif + enddo + endif + idtend = dtidx(100+ntqv, index_of_process_scnv) + if(idtend>=1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + (gq0(:,:,ntqv) - save_q(:,:,ntqv)) * frain endif endif endif diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta index c56ec9aa3..25140aaba 100644 --- a/physics/GFS_SCNV_generic.meta +++ b/physics/GFS_SCNV_generic.meta @@ -151,6 +151,127 @@ type = integer intent = in optional = F +[cscnv] + standard_name = flag_for_Chikira_Sugiyama_deep_convection + long_name = flag for Chikira-Sugiyama convection + units = flag + dimensions = () + type = logical + intent = in + optional = F +[satmedmf] + standard_name = flag_for_scale_aware_TKE_moist_EDMF_PBL + long_name = flag for scale-aware TKE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[trans_trac] + standard_name = flag_for_convective_transport_of_tracers + long_name = flag for convective transport of tracers + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ras] + standard_name = flag_for_ras_deep_convection + long_name = flag for ras convection scheme + units = flag + dimensions = () + type = logical + 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 = () + type = integer + intent = in + optional = F +[ntclamt] + standard_name = index_for_cloud_amount + long_name = tracer index for cloud amount integer + units = index + dimensions = () + type = integer + intent = in + optional = F +[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 +[ntrnc] + standard_name = index_for_rain_number_concentration + long_name = tracer index for rain number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsnc] + standard_name = index_for_snow_number_concentration + long_name = tracer index for snow number concentration + 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 +[ntgnc] + standard_name = index_for_graupel_number_concentration + long_name = tracer index for graupel number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[clw] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other convective trans. tracers + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -535,6 +656,118 @@ type = integer intent = in optional = F +[cscnv] + standard_name = flag_for_Chikira_Sugiyama_deep_convection + long_name = flag for Chikira-Sugiyama convection + units = flag + dimensions = () + type = logical + intent = in + optional = F +[satmedmf] + standard_name = flag_for_scale_aware_TKE_moist_EDMF_PBL + long_name = flag for scale-aware TKE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[trans_trac] + standard_name = flag_for_convective_transport_of_tracers + long_name = flag for convective transport of tracers + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ras] + standard_name = flag_for_ras_deep_convection + long_name = flag for ras convection scheme + units = flag + dimensions = () + type = logical + 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 = () + type = integer + intent = in + optional = F +[ntclamt] + standard_name = index_for_cloud_amount + long_name = tracer index for cloud amount integer + units = index + dimensions = () + type = integer + intent = in + optional = F +[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 +[ntrnc] + standard_name = index_for_rain_number_concentration + long_name = tracer index for rain number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsnc] + standard_name = index_for_snow_number_concentration + long_name = tracer index for snow number concentration + 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 +[ntgnc] + standard_name = index_for_graupel_number_concentration + long_name = tracer index for graupel number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 771c346b6..fed0bec01 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -513,10 +513,11 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, & ntiw, ntclamt, ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, & xlon, xlat, gt0, gq0, imp_physics, imp_physics_mg, & imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, & - imp_physics_gfdl, imp_physics_thompson, & - imp_physics_wsm6, imp_physics_fer_hires, prsi, & + imp_physics_gfdl, imp_physics_thompson, dtidx, ntlnc, & + imp_physics_wsm6, imp_physics_fer_hires, prsi, ntinc, & prsl, prslk, rhcbot,rhcpbl, rhctop, rhcmax, islmsk, & - work1, work2, kpbl, kinver, ras, me, & + work1, work2, kpbl, kinver, ras, me, save_lnc, save_inc, & + ldiag3d, qdiag3d, index_of_process_conv_trans, & clw, rhc, save_qc, save_qi, save_tcp, errmsg, errflg) use machine, only: kind_phys @@ -526,9 +527,12 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, & ! interface variables integer, intent(in) :: im, levs, nn, ntrac, ntcw, ntiw, ntclamt, ntrw, & ntsw, ntrnc, ntsnc, ntgl, ntgnc, imp_physics, imp_physics_mg, imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, & - imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6,imp_physics_fer_hires, me + imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6,imp_physics_fer_hires, me, index_of_process_conv_trans integer, dimension(im), intent(in) :: islmsk, kpbl, kinver logical, intent(in) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ras + integer, intent(in) :: ntinc, ntlnc + logical, intent(in) :: ldiag3d, qdiag3d + integer, dimension(:,:), intent(in) :: dtidx real(kind=kind_phys), intent(in) :: rhcbot, rhcmax, rhcpbl, rhctop real(kind=kind_phys), dimension(im), intent(in) :: work1, work2 @@ -540,7 +544,7 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, & real(kind=kind_phys), dimension(im, levs), intent(inout) :: rhc, save_qc ! save_qi is not allocated for Zhao-Carr MP - real(kind=kind_phys), dimension(:, :), intent(inout) :: save_qi + real(kind=kind_phys), dimension(:, :), intent(inout) :: save_qi, save_lnc, save_inc real(kind=kind_phys), dimension(:, :), intent(inout) :: save_tcp real(kind=kind_phys), dimension(im, levs, nn), intent(inout) :: clw @@ -661,6 +665,15 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, & enddo endif + if(imp_physics == imp_physics_thompson .and. ldiag3d .and. qdiag3d) then + if(dtidx(100+ntlnc,index_of_process_conv_trans)>0) then + save_lnc = gq0(:,:,ntlnc) + endif + if(dtidx(100+ntinc,index_of_process_conv_trans)>0) then + save_inc = gq0(:,:,ntinc) + endif + endif + end subroutine GFS_suite_interstitial_3_run end module GFS_suite_interstitial_3 @@ -682,7 +695,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, & imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, convert_dry_rho, dtf, save_qc, save_qi, con_pi, dtidx, dtend,& index_of_process_conv_trans, gq0, clw, prsl, save_tcp, con_rd, con_eps, nwfa, spechum, dqdti, ldiag3d, & - ntk, ntke, errmsg, errflg) + qdiag3d, save_lnc, save_inc, ntk, ntke, errmsg, errflg) use machine, only: kind_phys use module_mp_thompson_make_number_concentrations, only: make_IceNumber, make_DropletNumber @@ -700,10 +713,10 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to real(kind=kind_phys), intent(in) :: con_pi, dtf real(kind=kind_phys), dimension(im,levs), intent(in) :: save_qc ! save_qi is not allocated for Zhao-Carr MP - real(kind=kind_phys), dimension(:, :), intent(in) :: save_qi + real(kind=kind_phys), dimension(:, :), intent(in) :: save_qi, save_lnc, save_inc ! dtend and dtidx are only allocated if ldiag3d - logical, intent(in) :: ldiag3d + logical, intent(in) :: ldiag3d, qdiag3d real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend integer, dimension(:,:), intent(in) :: dtidx integer, intent(in) :: index_of_process_conv_trans,ntk,ntke @@ -741,24 +754,35 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to if(ntk>0 .and. ntk<=size(clw,3)) then idtend=dtidx(100+ntke,index_of_process_conv_trans) if(idtend>=1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntk) + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntk)-gq0(:,:,ntk) endif endif - if(ntclamt<=size(clw,3) .and. ntclamt>0) then - idtend=dtidx(100+ntclamt,index_of_process_conv_trans) - if(idtend>=1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntclamt) + if(ntcw>0) then + if (imp_physics == imp_physics_zhao_carr .or. & + imp_physics == imp_physics_zhao_carr_pdf .or. & + imp_physics == imp_physics_gfdl) then + idtend=dtidx(100+ntcw,index_of_process_conv_trans) + if(idtend>=1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,1)+clw(:,:,2) - gq0(:,:,ntcw) + endif + else if(ntiw>0) then + idtend=dtidx(100+ntiw,index_of_process_conv_trans) + if(idtend>=1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,1)-gq0(:,:,ntiw) + endif + idtend=dtidx(100+ntcw,index_of_process_conv_trans) + if(idtend>=1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,2)-gq0(:,:,ntcw) + endif + else + idtend=dtidx(100+ntcw,index_of_process_conv_trans) + if(idtend>=1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,1)+clw(:,:,2) - gq0(:,:,ntcw) + endif endif endif endif - if(ldiag3d .and. ntk>0) then - idtend=dtidx(100+ntke,index_of_process_conv_trans) - if(idtend>=1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,ntk) - endif - endif - ! --- update the tracers due to deep & shallow cumulus convective transport ! (except for suspended water and ice) @@ -770,6 +794,12 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. & n /= ntsnc .and. n /= ntgl .and. n /= ntgnc ) then tracers = tracers + 1 + if(n/=ntk .and. n/=ntlnc .and. n/=ntinc .and. n /= ntcw .and. n /= ntiw) then + idtend=dtidx(100+n,index_of_process_conv_trans) + if(idtend>=1) then + dtend(:,:,idtend) = dtend(:,:,idtend) + clw(:,:,tracers)-gq0(:,:,n) + endif + endif do k=1,levs do i=1,im gq0(i,k,n) = clw(i,k,tracers) @@ -845,6 +875,16 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to enddo enddo end if if_convert_dry_rho + if(ldiag3d .and. qdiag3d) then + idtend = dtidx(100+ntlnc,index_of_process_conv_trans) + if(idtend>0) then + dtend(:,:,idtend) = dtend(:,:,idtend) + gq0(:,:,ntlnc) - save_lnc + endif + idtend = dtidx(100+ntinc,index_of_process_conv_trans) + if(idtend>0) then + dtend(:,:,idtend) = dtend(:,:,idtend) + gq0(:,:,ntinc) - save_inc + endif + endif endif else diff --git a/physics/GFS_suite_interstitial.meta b/physics/GFS_suite_interstitial.meta index cf8629a8b..f1836b54f 100644 --- a/physics/GFS_suite_interstitial.meta +++ b/physics/GFS_suite_interstitial.meta @@ -1576,6 +1576,72 @@ kind = kind_phys intent = inout optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[qdiag3d] + standard_name = flag_tracer_diagnostics_3D + long_name = flag for 3d tracer diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[index_of_process_conv_trans] + standard_name = index_of_convective_transport_process_in_cumulative_change_index + long_name = index of convective transport process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F +[save_lnc] + standard_name = liquid_cloud_number_concentration_save + long_name = liquid cloud number concentration before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_inc] + standard_name = ice_cloud_number_concentration_save + long_name = ice cloud number concentration before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ntlnc] + standard_name = index_for_liquid_cloud_number_concentration + long_name = tracer index for liquid number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntinc] + standard_name = index_for_ice_cloud_number_concentration + long_name = tracer index for ice number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[dtidx] + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -1823,6 +1889,24 @@ kind = kind_phys intent = in optional = F +[save_lnc] + standard_name = liquid_cloud_number_concentration_save + long_name = liquid cloud number concentration before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_inc] + standard_name = ice_cloud_number_concentration_save + long_name = ice cloud number concentration before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F [con_pi] standard_name = pi long_name = ratio of a circle's circumference to its diameter @@ -1954,6 +2038,14 @@ type = logical intent = in optional = F +[qdiag3d] + standard_name = flag_tracer_diagnostics_3D + long_name = flag for 3d tracer diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F [index_of_process_conv_trans] standard_name = index_of_convective_transport_process_in_cumulative_change_index long_name = index of convective transport process in second dimension of array cumulative change index diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 index 2e68ceb12..495f32362 100644 --- a/physics/drag_suite.F90 +++ b/physics/drag_suite.F90 @@ -199,7 +199,9 @@ subroutine drag_suite_run( & & g, cp, rd, rv, fv, pi, imx, cdmbgwd, me, master, & & lprnt, ipr, rdxzb, dx, gwd_opt, & & do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, & - & errmsg, errflg ) + & dtend, dtidx, index_of_process_orographic_gwd, & + & index_of_temperature, index_of_x_wind, & + & index_of_y_wind, ldiag3d, errmsg, errflg ) ! ******************************************************************** ! -----> I M P L E M E N T A T I O N V E R S I O N <---------- @@ -302,7 +304,10 @@ subroutine drag_suite_run( & logical, intent(in) :: lprnt integer, intent(in) :: KPBL(im) real(kind=kind_phys), intent(in) :: deltim, G, CP, RD, RV, cdmbgwd(2) - + real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + logical, intent(in) :: ldiag3d + integer, intent(in) :: dtidx(:,:), index_of_temperature, & + & index_of_process_orographic_gwd, index_of_x_wind, index_of_y_wind integer :: kpblmax integer, parameter :: ims=1, kms=1, its=1, kts=1 real(kind=kind_phys), intent(in) :: fv, pi @@ -473,6 +478,8 @@ subroutine drag_suite_run( & character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + integer :: udtend, vdtend, Tdtend + ! Calculate inverse of gravitational acceleration g_inv = 1./G @@ -482,6 +489,12 @@ subroutine drag_suite_run( & var_temp2 = 0. + if(ldiag3d) then + udtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) + vdtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) + Tdtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) + endif + !-------------------------------------------------------------------- ! SCALE-ADPTIVE PARAMETER FROM GFS GWD SCHEME !-------------------------------------------------------------------- @@ -1015,6 +1028,12 @@ subroutine drag_suite_run( & dvsfc(i) = dvsfc(i) + vtendwave(i,k) * del(i,k) enddo enddo + if(udtend>0) then + dtend(its:im,kts:km,udtend) = dtend(its:im,kts:km,udtend) + utendwave(its:im,kts:km)*deltim + endif + if(vdtend>0) then + dtend(its:im,kts:km,vdtend) = dtend(its:im,kts:km,vdtend) + vtendwave(its:im,kts:km)*deltim + endif if ( (gwd_opt == 33).or.(gwd_opt == 22) ) then do k = kts,km do i = its,im @@ -1073,6 +1092,12 @@ subroutine drag_suite_run( & dvsfc(i) = dvsfc(i) + vtendform(i,k) * del(i,k) enddo enddo + if(udtend>0) then + dtend(its:im,kts:km,udtend) = dtend(its:im,kts:km,udtend) + utendform(its:im,kts:km)*deltim + endif + if(vdtend>0) then + dtend(its:im,kts:km,vdtend) = dtend(its:im,kts:km,vdtend) + vtendform(its:im,kts:km)*deltim + endif if ( (gwd_opt == 33).or.(gwd_opt == 22) ) then do k = kts,km do i = its,im @@ -1266,6 +1291,26 @@ subroutine drag_suite_run( & dusfc(i) = dusfc(i) + taud_ls(i,k)*xn(i)*del(i,k) + taud_bl(i,k)*xn(i)*del(i,k) dvsfc(i) = dvsfc(i) + taud_ls(i,k)*yn(i)*del(i,k) + taud_bl(i,k)*yn(i)*del(i,k) enddo + if(udtend>0) then + dtend(its:im,k,udtend) = dtend(its:im,k,udtend) + (taud_ls(its:im,k) * xn(its:im) + & + taud_bl(its:im,k) * xn(its:im)) * deltim + endif + if(vdtend>0) then + dtend(its:im,k,vdtend) = dtend(its:im,k,vdtend) + (taud_ls(its:im,k) * yn(its:im) + & + taud_bl(its:im,k) * yn(its:im)) * deltim + endif + if(gsd_diss_ht_opt .EQ. 1 .and. Tdtend>0) then + do i=its,im + ! Calculate dissipation heating + ! Initial kinetic energy (at t0-dt) + eng0 = 0.5*( (rcs*u1(i,k))**2. + (rcs*v1(i,k))**2. ) + ! Kinetic energy after wave-breaking/flow-blocking + eng1 = 0.5*( (rcs*(u1(i,k)+(dtaux+dtauxb)*deltim))**2 + & + (rcs*(v1(i,k)+(dtauy+dtauyb)*deltim))**2 ) + ! Modify theta tendency + dtend(i,k,Tdtend) = dtend(i,k,Tdtend) + max((eng0-eng1),0.0)/cp + enddo + endif enddo ! Finalize dusfc and dvsfc diagnostics diff --git a/physics/drag_suite.meta b/physics/drag_suite.meta index 3035a2c95..b1bb7a975 100644 --- a/physics/drag_suite.meta +++ b/physics/drag_suite.meta @@ -615,6 +615,64 @@ type = logical intent = in optional = F +[dtend] + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) + type = real + kind = kind_phys + active = (flag_diagnostics_3D) + intent = inout + optional = F +[dtidx] + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) + type = integer + intent = in + optional = F +[index_of_process_orographic_gwd] + standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index bbaed874f..7516e6d66 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -724,11 +724,12 @@ SUBROUTINE mynnedmf_wrapper_run( & call dtend_helper(index_of_y_wind,RVBLTEN) call dtend_helper(index_of_temperature,RTHBLTEN,exner) if(ldiag3d) then - idtend = dtidx(100+ntoz,index_of_process_pbl) - if(idtend>=1) then - dtend(:,:,idtend) = dtend(:,:,idtend) + (ozone-old_ozone) - deallocate(old_ozone) - endif + call dtend_helper(100+ntoz,dqdt_ozone) + ! idtend = dtidx(100+ntoz,index_of_process_pbl) + ! if(idtend>=1) then + ! dtend(:,:,idtend) = dtend(:,:,idtend) + (ozone-old_ozone) + ! deallocate(old_ozone) + ! endif endif endif accum_duvt3dt !Update T, U and V: diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f index 76d15777b..75ad0789b 100644 --- a/physics/rayleigh_damp.f +++ b/physics/rayleigh_damp.f @@ -85,6 +85,9 @@ subroutine rayleigh_damp_run ( & &, ENG0, ENG1, tem1, tem2, dti, hfbcpdt, rtrd real(kind=kind_phys) tx1(im), deltaA, deltaB, deltaC integer i, k, uidx,vidx,tidx + logical saw_non_zero + + saw_non_zero = .false. if(ldiag3d) then uidx=dtidx(index_of_x_wind,index_of_process_rayleigh_damping) @@ -133,6 +136,8 @@ subroutine rayleigh_damp_run ( & A(I,K) = A(I,K) + deltaA B(I,K) = B(I,K) + deltaB C(I,K) = C(I,K) + deltaC + saw_non_zero = saw_non_zero .or. abs(deltaA)>0 .or. & + & abs(deltaB)>0 .or. abs(deltaC)>0 IF(vidx>=1) THEN dtend(i,k,vidx) = dtend(i,k,vidx) + deltaA ENDIF @@ -144,7 +149,7 @@ subroutine rayleigh_damp_run ( & ENDIF ENDDO ENDDO - + if(saw_non_zero) print *,'Saw non-zero rayleigh_damp changes!' RETURN end subroutine rayleigh_damp_run !> @} diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index dddbae0d6..a20202fea 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -1295,6 +1295,13 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & rtg(i,k,ntke) = rtg(i,k,ntke)+qtend enddo enddo + if(ldiag3d) then + idtend = dtidx(ntke+100,index_of_process_pbl) + if(idtend>0) then + dtend(1:im,1:km,idtend) = dtend(1:im,1:km,idtend) + & + & (f1(1:im,1:km)-q1(1:im,1:km,ntke))*rdt + endif + endif c !> ## Compute tridiagonal matrix elements for heat and moisture c @@ -1459,14 +1466,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & is = (kk-1) * km idtend = dtidx(kk+100,index_of_process_pbl) if(idtend>=1) then - if(kk==ntke) then - do k = 1, km - do i = 1, im - qtend = (f1(i,k)-q1(i,k,kk))*rdt - dtend(i,k,idtend) = dtend(i,k,idtend)+qtend*delt - enddo - enddo - else + if(kk/=ntke) then do k = 1, km do i = 1, im qtend = (f2(i,k+is)-q1(i,k,kk))*rdt From 6d75cde2b9313783bbd9545270ae982270c6de77 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 24 May 2021 21:47:45 +0000 Subject: [PATCH 18/24] Remove some debug prints --- physics/GFS_DCNV_generic.F90 | 4 ---- physics/GFS_SCNV_generic.F90 | 4 ---- physics/GFS_suite_interstitial.F90 | 1 + physics/rayleigh_damp.f | 7 +------ 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index d5f5e240e..f03e1d298 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -69,7 +69,6 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc if ((ldiag3d.and.qdiag3d) .or. cplchm) then if (cscnv .or. satmedmf .or. trans_trac .or. ras) then - print *,'dcnv store clw' tracers = 2 do n=2,ntrac if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. & @@ -82,7 +81,6 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc endif enddo else - print *,'dcnv store gq0' do n=2,ntrac if(dtidx(100+n,index_of_process_dcnv)>0) then save_q(:,:,n) = gq0(:,:,n) @@ -209,7 +207,6 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, & endif if (cscnv .or. satmedmf .or. trans_trac .or. ras) then - print *,'dcnv accum clw' tracers = 2 do n=2,ntrac if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. & @@ -223,7 +220,6 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, & endif enddo else - print *,'dcnv accume gq0' do n=2,ntrac idtend = dtidx(100+n,index_of_process_dcnv) if(idtend>0) then diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index ccc9860c0..ac77eaa68 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -51,7 +51,6 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, enddo if (qdiag3d) then if (cscnv .or. satmedmf .or. trans_trac .or. ras) then - print *,'scnv store clw' tracers = 2 do n=2,ntrac if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. & @@ -64,7 +63,6 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, endif enddo else - print *,'scnv store gq0' do n=2,ntrac if(dtidx(100+n,index_of_process_scnv)>0) then save_q(:,:,n) = gq0(:,:,n) @@ -185,7 +183,6 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & endif if (cscnv .or. satmedmf .or. trans_trac .or. ras) then - print *,'scnv accum clw' tracers = 2 do n=2,ntrac if ( n /= ntcw .and. n /= ntiw .and. n /= ntclamt .and. & @@ -199,7 +196,6 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & endif enddo else - print *,'scnv accum gq0' do n=2,ntrac idtend = dtidx(100+n,index_of_process_scnv) if(idtend>0) then diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 575b13b32..b793c2902 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -540,6 +540,7 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, & integer, intent(in) :: ntinc, ntlnc logical, intent(in) :: ldiag3d, qdiag3d integer, dimension(:,:), intent(in) :: dtidx + real, dimension(:,:), intent(out) :: save_lnc, save_inc real(kind=kind_phys), intent(in ) :: rhcbot, rhcmax, rhcpbl, rhctop real(kind=kind_phys), intent(in ), dimension(:) :: work1, work2 diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f index 82deb83eb..70ed997a2 100644 --- a/physics/rayleigh_damp.f +++ b/physics/rayleigh_damp.f @@ -85,9 +85,6 @@ subroutine rayleigh_damp_run ( & &, ENG0, ENG1, tem1, tem2, dti, hfbcpdt, rtrd real(kind=kind_phys) tx1(im), deltaA, deltaB, deltaC integer i, k, uidx,vidx,tidx - logical saw_non_zero - - saw_non_zero = .false. if(ldiag3d) then uidx=dtidx(index_of_x_wind,index_of_process_rayleigh_damping) @@ -136,8 +133,6 @@ subroutine rayleigh_damp_run ( & A(I,K) = A(I,K) + deltaA B(I,K) = B(I,K) + deltaB C(I,K) = C(I,K) + deltaC - saw_non_zero = saw_non_zero .or. abs(deltaA)>0 .or. & - & abs(deltaB)>0 .or. abs(deltaC)>0 IF(vidx>=1) THEN dtend(i,k,vidx) = dtend(i,k,vidx) + deltaA ENDIF @@ -149,7 +144,7 @@ subroutine rayleigh_damp_run ( & ENDIF ENDDO ENDDO - if(saw_non_zero) print *,'Saw non-zero rayleigh_damp changes!' + RETURN end subroutine rayleigh_damp_run !> @} From 09494e6132acba744085a96243c66a4a3c164701 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 1 Jun 2021 08:24:46 -0600 Subject: [PATCH 19/24] Several bug fixes to UGWP v1 and GSL drag suite related to updated tendencies code --- physics/drag_suite.F90 | 8 ++++++-- physics/ugwpv1_gsldrag.F90 | 17 +++++++++-------- physics/ugwpv1_gsldrag.meta | 1 - physics/unified_ugwp.F90 | 4 +++- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 index 7f9da6f4f..9b110d689 100644 --- a/physics/drag_suite.F90 +++ b/physics/drag_suite.F90 @@ -218,7 +218,7 @@ subroutine drag_suite_run( & & do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, & & dtend, dtidx, index_of_process_orographic_gwd, & & index_of_temperature, index_of_x_wind, & - & index_of_y_wind, ldiag3d, errmsg, errflg ) + & index_of_y_wind, ldiag3d, errmsg, errflg) ! ******************************************************************** ! -----> I M P L E M E N T A T I O N V E R S I O N <---------- @@ -504,8 +504,12 @@ subroutine drag_suite_run( & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - var_temp2 = 0. + ! Initialize local variables + var_temp2 = 0. + udtend = -1 + vdtend = -1 + Tdtend = -1 if(ldiag3d) then udtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) diff --git a/physics/ugwpv1_gsldrag.F90 b/physics/ugwpv1_gsldrag.F90 index 518aefab4..104fc8e3f 100644 --- a/physics/ugwpv1_gsldrag.F90 +++ b/physics/ugwpv1_gsldrag.F90 @@ -429,8 +429,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd ! real(kind=kind_phys), intent(inout), dimension(:,:) :: dudt, dvdt, dtdt - ! dtend is only allocated if ldiag=.true. - real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), & index_of_x_wind, index_of_y_wind, index_of_temperature, & index_of_process_orographic_gwd, index_of_process_nonorographic_gwd @@ -548,16 +547,18 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd kpbl,prsi,del,prsl,prslk,phii,phil,dtp, & kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, & ol4ss,theta,sigma,gamma,elvmax, & - dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, & - dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd, & - dusfcg, dvsfcg, & - du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, & - du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, & + dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, & + dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd, & + dusfcg, dvsfcg, & + du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, & + du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, & slmsk,br1,hpbl, con_g,con_cp,con_rd,con_rv, & con_fv, con_pi, lonr, & cdmbgwd(1:2),me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & - errmsg,errflg) + dtend, dtidx, index_of_process_orographic_gwd, & + index_of_temperature, index_of_x_wind, & + index_of_y_wind, ldiag3d, errmsg, errflg) ! ! dusfcg = du_ogwcol + du_oblcol + du_osscol + du_ofdcol ! diff --git a/physics/ugwpv1_gsldrag.meta b/physics/ugwpv1_gsldrag.meta index c751b901c..5cfae9dd1 100644 --- a/physics/ugwpv1_gsldrag.meta +++ b/physics/ugwpv1_gsldrag.meta @@ -1156,7 +1156,6 @@ dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys - active = (flag_diagnostics_3D) intent = inout optional = F [dtidx] diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index 587885cc6..def7ba141 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -342,7 +342,9 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, con_fvirt,con_pi,lonr, & cdmbgwd(1:2),me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & - errmsg,errflg) + dtend, dtidx, index_of_process_orographic_gwd, & + index_of_temperature, index_of_x_wind, & + index_of_y_wind, ldiag3d, errmsg, errflg) ! ! put zeros due to xy GSL-drag style: dtaux2d_bl,dtauy2d_bl,dtaux2d_ss.......dusfc_ls,dvsfc_ls ! From df632d81c8f5c3f2e8199953bb86bebf59cad6c7 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 2 Jun 2021 13:01:02 -0600 Subject: [PATCH 20/24] Add missing variables to physics/GFS_debug.F90, comment out erroneous tendencies code --- physics/GFS_debug.F90 | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index 0218affa0..567cbbd32 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -667,6 +667,16 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%v1 ', Diag%v1) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%chh ', Diag%chh) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%cmm ', Diag%cmm) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dlwsfci ', Diag%dlwsfci) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%ulwsfci ', Diag%ulwsfci) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dswsfci ', Diag%dswsfci) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%nswsfci ', Diag%nswsfci) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%uswsfci ', Diag%uswsfci) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dusfci ', Diag%dusfci) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dvsfci ', Diag%dvsfci) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dtsfci ', Diag%dtsfci) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dqsfci ', Diag%dqsfci) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%gfluxi ', Diag%gfluxi) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%epi ', Diag%epi) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%smcwlt2 ', Diag%smcwlt2) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%smcref2 ', Diag%smcref2) @@ -687,19 +697,21 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%shum_wts ', Diag%shum_wts) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%zmtnblck ', Diag%zmtnblck) if (Model%ldiag3d) then - do itracer=2,Model%ntracp100 - do iprocess=1,Model%nprocess - idtend = Model%dtidx(itracer,iprocess) - if(idtend>=1) then - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, & - 'dtend_'//Model%dtend_tracer_labels(itracer)//'_' & - //Model%dtend_cause_labels(iprocess), Diag%dtend(1,1,idtend)) - endif - enddo - enddo - !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%upd_mf ', Diag%upd_mf) - !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dwn_mf ', Diag%dwn_mf) - !call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%det_mf ', Diag%det_mf) + !do itracer=2,Model%ntracp100 + ! do iprocess=1,Model%nprocess + ! idtend = Model%dtidx(itracer,iprocess) + ! if(idtend>=1) then + ! call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, & + ! 'dtend_'//Model%dtend_tracer_labels(itracer)//'_' & + ! //Model%dtend_cause_labels(iprocess), Diag%dtend(1,1,idtend)) + ! endif + ! enddo + !enddo + if (Model%qdiag3d) then + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%upd_mf ', Diag%upd_mf) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dwn_mf ', Diag%dwn_mf) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%det_mf ', Diag%det_mf) + end if end if if(Model%lradar) then call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%refl_10cm ', Diag%refl_10cm) From 10ab813d658c288e2b872406a5f15d991d3cb6d6 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 2 Jun 2021 13:02:06 -0600 Subject: [PATCH 21/24] Fix b4b issue for restart runs with RUC LSM --- physics/GFS_surface_composites.F90 | 6 +++--- physics/GFS_surface_composites.meta | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 index ee99e0f85..48a4b7808 100644 --- a/physics/GFS_surface_composites.F90 +++ b/physics/GFS_surface_composites.F90 @@ -27,7 +27,7 @@ end subroutine GFS_surface_composites_pre_finalize !> \section arg_table_GFS_surface_composites_pre_run Argument Table !! \htmlinclude GFS_surface_composites_pre_run.html !! - subroutine GFS_surface_composites_pre_run (im, flag_init, lkm, lsm, lsm_noahmp, lsm_ruc, frac_grid, & + subroutine GFS_surface_composites_pre_run (im, flag_init, flag_restart, lkm, lsm, lsm_noahmp, lsm_ruc, frac_grid, & flag_cice, cplflx, cplwav2atm, landfrac, lakefrac, lakedepth, oceanfrac, frland, & dry, icy, use_flake, ocean, wet, hice, cice, zorlo, zorll, zorli, & snowd, snowd_wat, snowd_lnd, snowd_ice, tprcp, tprcp_wat, & @@ -43,7 +43,7 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, lkm, lsm, lsm_noahmp, ! Interface variables integer, intent(in ) :: im, lkm integer, intent(in ) :: lsm, lsm_noahmp, lsm_ruc - logical, intent(in ) :: flag_init, frac_grid, cplflx, cplwav2atm + logical, intent(in ) :: flag_init, flag_restart, frac_grid, cplflx, cplwav2atm logical, dimension(:), intent(inout) :: flag_cice logical, dimension(:), intent(inout) :: dry, icy, use_flake, ocean, wet real(kind=kind_phys), dimension(:), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac @@ -231,7 +231,7 @@ subroutine GFS_surface_composites_pre_run (im, flag_init, lkm, lsm, lsm_noahmp, snowd_ice(i) = snowd(i) ep1d_ice(i) = zero gflx_ice(i) = zero - if (iemsflg == 2 .and. .not. flag_init .and. lsm == lsm_ruc) then + if (iemsflg == 2 .and. (.not.flag_init .or. flag_restart) .and. lsm == lsm_ruc) then !-- use emis_ice from RUC LSM with snow effect semis_ice(i) = emis_ice(i) else diff --git a/physics/GFS_surface_composites.meta b/physics/GFS_surface_composites.meta index 95f2c6e4e..9caf9db04 100644 --- a/physics/GFS_surface_composites.meta +++ b/physics/GFS_surface_composites.meta @@ -23,6 +23,14 @@ type = logical intent = in optional = F +[flag_restart] + standard_name = flag_for_restart + long_name = flag for restart (warmstart) or coldstart + units = flag + dimensions = () + type = logical + intent = in + optional = F [lkm] standard_name = flag_for_lake_surface_scheme long_name = flag for lake surface model From ef5db3119c2f924dfe2c1da180b92f388b1a82f7 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 3 Jun 2021 10:19:07 -0600 Subject: [PATCH 22/24] More bug fixes related to tendencies in physics/unified_ugwp.F90 --- physics/unified_ugwp.F90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index def7ba141..da79ecde8 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -268,8 +268,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, real(kind=kind_phys), intent(out), dimension(:,:) :: dudt_mtb, dudt_tms real(kind=kind_phys), intent(out), dimension(:,:) :: dtaux2d_ls, dtauy2d_ls - ! The dtend array is are only allocated if ldiag=.true. - real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), index_of_temperature, index_of_x_wind, & index_of_y_wind, index_of_process_nonorographic_gwd, & index_of_process_orographic_gwd @@ -340,7 +339,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, & slmsk,br1,hpbl,con_g,con_cp,con_rd,con_rv, & con_fvirt,con_pi,lonr, & - cdmbgwd(1:2),me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & + cdmbgwd,me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & dtend, dtidx, index_of_process_orographic_gwd, & index_of_temperature, index_of_x_wind, & From 69b8c2ec39c7deaaa7a6fdc076830c26a1a80ab6 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 19 Jul 2021 21:17:58 +0000 Subject: [PATCH 23/24] Revert unintended changes after merge --- physics/GFS_MP_generic.F90 | 2 +- physics/GFS_PBL_generic.F90 | 2 +- physics/GFS_SCNV_generic.F90 | 5 ++--- physics/GFS_SCNV_generic.meta | 18 +++++------------- physics/GFS_suite_interstitial.F90 | 2 +- physics/GFS_suite_interstitial.meta | 9 --------- 6 files changed, 10 insertions(+), 28 deletions(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 6967ad80c..239aded39 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -84,7 +84,7 @@ end subroutine GFS_MP_generic_post_init !! !> \section gfs_mp_gen GFS MP Generic Post General Algorithm !> @{ - subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, & + subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, & imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, con_g, dtf, frain, rainc, & rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0,& graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, & diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 6bd385eb5..63e622204 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -335,7 +335,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, index_of_process_pbl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, & dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag, & rd, cp, fvirt, hvap, t1, q1, prsl, hflx, ushfsfci, oceanfrac, kdt, dusfc_cice, dvsfc_cice, & - dtsfc_cice, dqsfc_cice, wet, dry, icy, wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1, dkt_cpl, dkt, hffac, hefac, & + dtsfc_cice, dqsfc_cice, wet, dry, icy, wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1, hffac, & ugrs, vgrs, tgrs, qgrs, save_u, save_v, save_t, save_q, errmsg, errflg) use machine, only : kind_phys diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index 88f7fc8c7..2440d9bc7 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -92,7 +92,7 @@ end subroutine GFS_SCNV_generic_post_finalize !! \htmlinclude GFS_SCNV_generic_post_run.html !! subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & - frain, gu0, gv0, gt0, gq0, save_u, save_v, save_t, save_q, dqdti, & + frain, gu0, gv0, gt0, gq0, save_u, save_v, save_t, save_q, & clw, shcnvcw, rain1, npdf3d, num_p3d, ncnvcld3d, cnvc, cnvw, nsamftrac, & rainc, cnvprcp, cnvprcpb, cnvw_phy_f3d, cnvc_phy_f3d, & dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, & @@ -107,14 +107,13 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & integer, intent(in) :: im, levs, nn, ntqv, nsamftrac integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntgnc,ntrac - logical, intent(in) :: lssav, ldiag3d, qdiag3d, cplchm, flag_for_scnv_generic_tend + logical, intent(in) :: lssav, ldiag3d, qdiag3d, flag_for_scnv_generic_tend real(kind=kind_phys), intent(in) :: frain real(kind=kind_phys), dimension(:,:), intent(in) :: gu0, gv0, gt0 real(kind=kind_phys), dimension(:,:), intent(in) :: save_u, save_v, save_t real(kind=kind_phys), dimension(:,:,:), intent(in) :: save_q, gq0 ! dtend only allocated if ldiag3d == .true. - real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti real(kind=kind_phys), intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) integer, intent(in) :: index_of_temperature, index_of_x_wind, index_of_y_wind, index_of_process_scnv diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta index 039ef42e6..92b732ba9 100644 --- a/physics/GFS_SCNV_generic.meta +++ b/physics/GFS_SCNV_generic.meta @@ -348,14 +348,6 @@ type = logical intent = in optional = F -[cplchm] - standard_name = flag_for_chemistry_coupling - long_name = flag controlling cplchm collection (default off) - units = flag - dimensions = () - type = logical - intent = in - optional = F [frain] standard_name = dynamics_to_physics_timestep_ratio long_name = ratio of dynamics timestep to physics timestep @@ -437,11 +429,11 @@ kind = kind_phys intent = in optional = F -[dqdti] - standard_name = instantaneous_water_vapor_specific_humidity_tendency_due_to_convection - long_name = instantaneous moisture tendency due to convection - units = kg kg-1 s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) +[dtend] + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables + units = various + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_cumulative_change_processes) type = real kind = kind_phys intent = inout diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 8fc428ffc..6bc702216 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -702,7 +702,7 @@ end subroutine GFS_suite_interstitial_4_finalize subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntrac, ntcw, ntiw, ntclamt, & ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, & imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, convert_dry_rho, dtf, save_qc, save_qi, con_pi, dtidx, dtend,& - index_of_process_conv_trans, gq0, clw, prsl, save_tcp, con_rd, con_eps, nwfa, spechum, dqdti, ldiag3d, & + index_of_process_conv_trans, gq0, clw, prsl, save_tcp, con_rd, con_eps, nwfa, spechum, ldiag3d, & qdiag3d, save_lnc, save_inc, ntk, ntke, errmsg, errflg) use machine, only: kind_phys diff --git a/physics/GFS_suite_interstitial.meta b/physics/GFS_suite_interstitial.meta index e46007d97..fe13b3452 100644 --- a/physics/GFS_suite_interstitial.meta +++ b/physics/GFS_suite_interstitial.meta @@ -1981,15 +1981,6 @@ kind = kind_phys intent = inout optional = F -[dqdti] - standard_name = instantaneous_water_vapor_specific_humidity_tendency_due_to_convection - long_name = instantaneous moisture tendency due to convection - units = kg kg-1 s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index From 8474f91607f36dbe9f47e43b0410f35f37642d5b Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 19 Jul 2021 21:24:31 +0000 Subject: [PATCH 24/24] Revert CODEOWNERS to community version --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index b6c597371..0d5230f89 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,7 +3,7 @@ # These owners will be the default owners for everything in the repo. #* @defunkt -* @DomHeinzeller +* @climbfuji @llpcarson @grantfirl @JulieSchramm # Order is important. The last matching pattern has the most precedence. # So if a pull request only touches javascript files, only these owners