diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 6be054457..7c55ee701 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -2184,7 +2184,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: cwm (:,:) => null() !< !-- 3D diagnostics - integer :: rtg_ozone_index + integer :: rtg_ozone_index, rtg_tke_index contains procedure :: create => interstitial_create !< allocate array data @@ -3600,7 +3600,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & integer :: ncnvcld3d = 0 !< number of convective 3d clouds fields integer :: itrac, ipat, ichem - logical :: have_pbl, have_dcnv, have_scnv, have_mp, have_oz_phys, have_samf, have_pbl_edmf + logical :: have_pbl, have_dcnv, have_scnv, have_mp, have_oz_phys, have_samf, have_pbl_edmf, have_cnvtrans, have_rdamp character(len=20) :: namestr character(len=44) :: descstr @@ -4450,14 +4450,23 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & if(ldiag3d) then ! Flags used to turn on or off tracer "causes" - have_pbl_edmf = Model%hybedmf .or. Model%satmedmf .or. do_mynnedmf + have_pbl_edmf = Model%hybedmf .or. Model%satmedmf .or. Model%do_mynnedmf have_samf = Model%satmedmf .or. Model%trans_trac .or. Model%ras .or. Model%do_shoc have_pbl = .true. - have_dcnv = Model%imfdeepcnv>=0 !Model%ras .or. Model%cscnv .or. Model%do_deep .or. Model%hwrf_samfdeep - have_scnv = Model%imfshalcnv>=0 !Model%shal_cnv + have_dcnv = Model%imfdeepcnv>0 !Model%ras .or. Model%cscnv .or. Model%do_deep .or. Model%hwrf_samfdeep + have_scnv = Model%imfshalcnv>0 !Model%shal_cnv have_mp = Model%imp_physics>0 have_oz_phys = Model%oz_phys .or. Model%oz_phys_2015 - + + ! Rayleigh damping flag must match logic in rayleigh_damp.f + have_rdamp = .not. (Model%lsidea .or. Model%ral_ts <= 0.0 .or. Model%prslrd0 == 0.0) + + ! have_cnvtrans flag must match logic elsewhere in GFS_typedefs and suite interstitials. + have_cnvtrans = (have_dcnv .or. have_scnv) .and. & + (cscnv .or. satmedmf .or. trans_trac .or. ras) & + .and. Model%flag_for_scnv_generic_tend & + .and. Model%flag_for_dcnv_generic_tend + ! Increment idtend and fill dtidx: allocate(Model%dtend_var_labels(Model%ntracp100)) allocate(Model%dtend_process_labels(Model%nprocess)) @@ -4552,7 +4561,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_scnv,have_scnv) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_mp,have_mp) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_orographic_gwd) - call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_rayleigh_damping) + call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_rayleigh_damping,have_rdamp) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_nonorographic_gwd) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_physics) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_non_physics) @@ -4565,8 +4574,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & call fill_dtidx(Model,dtend_select,Model%index_of_y_wind,Model%index_of_process_dcnv,have_dcnv) call fill_dtidx(Model,dtend_select,Model%index_of_x_wind,Model%index_of_process_nonorographic_gwd) call fill_dtidx(Model,dtend_select,Model%index_of_y_wind,Model%index_of_process_nonorographic_gwd) - call fill_dtidx(Model,dtend_select,Model%index_of_x_wind,Model%index_of_process_rayleigh_damping) - call fill_dtidx(Model,dtend_select,Model%index_of_y_wind,Model%index_of_process_rayleigh_damping) + call fill_dtidx(Model,dtend_select,Model%index_of_x_wind,Model%index_of_process_rayleigh_damping,have_rdamp) + call fill_dtidx(Model,dtend_select,Model%index_of_y_wind,Model%index_of_process_rayleigh_damping,have_rdamp) call fill_dtidx(Model,dtend_select,Model%index_of_x_wind,Model%index_of_process_scnv,have_scnv) call fill_dtidx(Model,dtend_select,Model%index_of_y_wind,Model%index_of_process_scnv,have_scnv) call fill_dtidx(Model,dtend_select,Model%index_of_x_wind,Model%index_of_process_physics) @@ -4575,25 +4584,35 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & call fill_dtidx(Model,dtend_select,Model%index_of_y_wind,Model%index_of_process_non_physics) if(qdiag3d) then - if(have_samf) then - do itrac=1,Model%ntrac - if(itrac==Model%ntchs) exit ! remaining tracers are chemical - if(itrac==Model%ntke) cycle ! TKE is handled by convective transport (see below) - call fill_dtidx(Model,dtend_select,100+itrac,Model%index_of_process_dcnv,have_dcnv) - call fill_dtidx(Model,dtend_select,100+itrac,Model%index_of_process_scnv,have_scnv) - enddo - else - call fill_dtidx(Model,dtend_select,100+Model%ntqv,Model%index_of_process_dcnv,have_dcnv) - call fill_dtidx(Model,dtend_select,100+Model%ntqv,Model%index_of_process_scnv,have_scnv) - call fill_dtidx(Model,dtend_select,100+Model%ntcw,Model%index_of_process_dcnv,have_dcnv) - call fill_dtidx(Model,dtend_select,100+Model%ntcw,Model%index_of_process_scnv,have_scnv) - call fill_dtidx(Model,dtend_select,100+Model%ntiw,Model%index_of_process_dcnv,have_dcnv) - call fill_dtidx(Model,dtend_select,100+Model%ntiw,Model%index_of_process_scnv,have_scnv) + call fill_dtidx(Model,dtend_select,100+Model%ntqv,Model%index_of_process_scnv,have_scnv) + call fill_dtidx(Model,dtend_select,100+Model%ntqv,Model%index_of_process_dcnv,have_dcnv) + + if(have_cnvtrans) then + do itrac=2,Model%ntrac + if(itrac==Model%ntchs) exit ! remaining tracers are chemical + if ( itrac /= Model%ntcw .and. itrac /= Model%ntiw .and. itrac /= Model%ntclamt .and. & + itrac /= Model%ntrw .and. itrac /= Model%ntsw .and. itrac /= Model%ntrnc .and. & + itrac /= Model%ntsnc .and. itrac /= Model%ntgl .and. itrac /= Model%ntgnc) then + call fill_dtidx(Model,dtend_select,100+itrac,Model%index_of_process_scnv,have_scnv) + call fill_dtidx(Model,dtend_select,100+itrac,Model%index_of_process_dcnv,have_dcnv) + else if(Model%ntchs<=0 .or. itrac0 .and. itrac>0) then + if(Model%dtidx(itrac,icause)>0) then + return ! This tendency is already allocated. + endif - if(icause>0 .and. flag2 .and. itrac>0) then name = 'dtend_'//trim(Model%dtend_var_labels(itrac)%name)//'_'//trim(Model%dtend_process_labels(icause)%name) + if(fglob_list(dtend_select,trim(name))) then Model%ndtend = Model%ndtend+1 Model%dtidx(itrac,icause) = Model%ndtend + if(Model%me==Model%master) then + print 308,'selected',trim(Model%dtend_process_labels(icause)%mod_name), trim(name), & + trim(Model%dtend_var_labels(itrac)%desc), trim(Model%dtend_process_labels(icause)%desc), & + trim(Model%dtend_var_labels(itrac)%unit) + endif elseif(Model%me==Model%master) then - print '(A,A,A)','Skipping ',trim(name),' due to mismatch with dtend_select.' + print 308,'disabled',trim(Model%dtend_process_labels(icause)%mod_name), trim(name), & + trim(Model%dtend_var_labels(itrac)%desc), trim(Model%dtend_process_labels(icause)%desc), & + trim(Model%dtend_var_labels(itrac)%unit) endif endif +308 format('dtend ',A,': ',A,' ',A,' = ',A,' ',A,' (',A,')') end subroutine fill_dtidx recursive function fglob(pattern,string) result(match) @@ -6006,7 +6040,7 @@ recursive function fglob(pattern,string) result(match) istr=1 ! First string character not yet matched outer: do while(ipat<=npat) if_glob: if(pattern(ipat:ipat)=='*' .or. pattern(ipat:ipat)=='?') then - ! Collect sequences of * and ? to avoid pathalogical cases. + ! Collect sequences of * and ? to avoid pathological cases. min_match=0 ! Number of "?" which is minimum number of chars to match match_infinity=.false. ! Do we see a "*"? glob_collect: do while(ipat<=npat) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 9adbdbf70..ed9d7ec0b 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -9261,6 +9261,13 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys +[save_q(:,:,index_for_turbulent_kinetic_energy)] + standard_name = turbulent_kinetic_energy_save + long_name = turbulent kinetic energy before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys [save_q(:,:,index_for_liquid_cloud_condensate)] standard_name = cloud_condensed_water_mixing_ratio_save long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) before entering a physics scheme @@ -9282,6 +9289,20 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys +[save_q(:,:,index_for_liquid_cloud_number_concentration)] + 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 +[save_q(:,:,index_for_ice_cloud_number_concentration)] + 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 [save_q] standard_name = tracer_concentration_save long_name = tracer concentration before entering a physics scheme diff --git a/ccpp/driver/GFS_diagnostics.F90 b/ccpp/driver/GFS_diagnostics.F90 index 45985783c..c5ea95eb6 100644 --- a/ccpp/driver/GFS_diagnostics.F90 +++ b/ccpp/driver/GFS_diagnostics.F90 @@ -85,10 +85,6 @@ subroutine add_dtend(Model,ExtDiag,IntDiag,idx,nblks,itrac,iprocess,desc,unit) do nb = 1,nblks ExtDiag(idx)%data(nb)%var3 => IntDiag(nb)%dtend(:,:,idtend) enddo - if(Model%me==Model%master .and. Model%ldiag3d) then -307 format('ExtDiag(',I4,') = dtend(:,:,',I4,') = ',A,' (',A,': ',A,')') - print 307,idx,idtend,trim(ExtDiag(idx)%name),trim(ExtDiag(idx)%mod_name),trim(ExtDiag(idx)%desc) - endif endif end subroutine add_dtend diff --git a/ccpp/physics b/ccpp/physics index 378a905fa..9346bb724 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 378a905fa1552aaaddd57308bd80238131e1951d +Subproject commit 9346bb7244d5469742dda697113a04d94b27d5a0 diff --git a/ccpp/suites/suite_FV3_GSD_SAR.xml b/ccpp/suites/suite_FV3_GSD_SAR.xml index 29f6d3707..20fdd6cca 100644 --- a/ccpp/suites/suite_FV3_GSD_SAR.xml +++ b/ccpp/suites/suite_FV3_GSD_SAR.xml @@ -78,6 +78,7 @@ GFS_stochastics + phys_tend diff --git a/ccpp/suites/suite_FV3_HRRR.xml b/ccpp/suites/suite_FV3_HRRR.xml index c74fe17f8..113462ddd 100644 --- a/ccpp/suites/suite_FV3_HRRR.xml +++ b/ccpp/suites/suite_FV3_HRRR.xml @@ -77,6 +77,7 @@ GFS_stochastics + phys_tend diff --git a/ccpp/suites/suite_FV3_RAP.xml b/ccpp/suites/suite_FV3_RAP.xml index da3fe46bf..f9444802b 100644 --- a/ccpp/suites/suite_FV3_RAP.xml +++ b/ccpp/suites/suite_FV3_RAP.xml @@ -83,6 +83,7 @@ GFS_stochastics + phys_tend