From 7de499dedbd8522618b043f9fbf968e57d42935e Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 19 Apr 2021 14:26:35 +0000 Subject: [PATCH 01/10] Fix incorrect units in dtend metadata --- ccpp/data/GFS_typedefs.F90 | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 29c8cf5a5..bf8616029 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -4421,7 +4421,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & do itrac=1,Model%ntrac write(namestr,'("tracer",I0)') itrac write(descstr,'("tracer ",I0," of ",I0)') itrac, Model%ntrac - call label_dtend_tracer(Model,100+itrac,trim(namestr),trim(descstr)) + call label_dtend_tracer(Model,100+itrac,trim(namestr),trim(descstr),'kg kg-1 s-1') enddo if(Model%ntchs>0) then @@ -4433,7 +4433,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & do ichem=Model%ntchs,Model%ntchs+Model%ntchm-1 write(namestr,'("chem",I0)') ichem write(descstr,'("chemical tracer ",I0," of ",I0)') ichem, Model%ntchm - call label_dtend_tracer(Model,100+ichem,trim(namestr),trim(descstr)) + call label_dtend_tracer(Model,100+ichem,trim(namestr),trim(descstr),'kg kg-1 s-1') enddo endif @@ -4441,15 +4441,15 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & call label_dtend_tracer(Model,100+Model%ntchs,'so2','sulfur dioxide concentration') if(Model%ntchm>0) then ! Need better descriptions of these. - call label_dtend_tracer(Model,100+Model%ntchm+Model%ntchs-1,'pp10','pp10 concentration') + call label_dtend_tracer(Model,100+Model%ntchm+Model%ntchs-1,'pp10','pp10 concentration','kg kg-1 s-1') itrac=get_tracer_index(Model%tracer_names, 'DMS', Model%me, Model%master, Model%debug) if(itrac>0) then - call label_dtend_tracer(Model,100+itrac,'DMS','DMS concentration') + call label_dtend_tracer(Model,100+itrac,'DMS','DMS concentration','kg kg-1 s-1') endif itrac=get_tracer_index(Model%tracer_names, 'msa', Model%me, Model%master, Model%debug) if(itrac>0) then - call label_dtend_tracer(Model,100+itrac,'msa','msa concentration') + call label_dtend_tracer(Model,100+itrac,'msa','msa concentration','kg kg-1 s-1') endif endif endif @@ -4459,25 +4459,25 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & call label_dtend_tracer(Model,Model%index_of_y_wind,'v','y wind','m s-2') ! Other tracer names. These were taken from GFS_typedefs.F90 with descriptions from GFS_typedefs.meta - call label_dtend_tracer(Model,100+Model%ntqv,'qv','water vapor specific humidity') - call label_dtend_tracer(Model,100+Model%ntoz,'o3','ozone concentration') - call label_dtend_tracer(Model,100+Model%ntcw,'liq_wat','cloud condensate (or liquid water)') - call label_dtend_tracer(Model,100+Model%ntiw,'ice_wat','ice water') - call label_dtend_tracer(Model,100+Model%ntrw,'rainwat','rain water') - call label_dtend_tracer(Model,100+Model%ntsw,'snowwat','snow water') - call label_dtend_tracer(Model,100+Model%ntgl,'graupel','graupel') - call label_dtend_tracer(Model,100+Model%ntclamt,'cld_amt','cloud amount integer') - call label_dtend_tracer(Model,100+Model%ntlnc,'water_nc','liquid number concentration') - call label_dtend_tracer(Model,100+Model%ntinc,'ice_nc','ice number concentration') - call label_dtend_tracer(Model,100+Model%ntrnc,'rain_nc','rain number concentration') - call label_dtend_tracer(Model,100+Model%ntsnc,'snow_nc','snow number concentration') - call label_dtend_tracer(Model,100+Model%ntgnc,'graupel_nc','graupel number concentration') - call label_dtend_tracer(Model,100+Model%ntke,'sgs_tke','turbulent kinetic energy') - call label_dtend_tracer(Model,100+Model%nqrimef,'q_rimef','mass weighted rime factor') - call label_dtend_tracer(Model,100+Model%ntwa,'liq_aero','number concentration of water-friendly aerosols') - call label_dtend_tracer(Model,100+Model%ntia,'ice_aero','number concentration of ice-friendly aerosols') - call label_dtend_tracer(Model,100+Model%nto,'o_ion','oxygen ion concentration') - call label_dtend_tracer(Model,100+Model%nto2,'o2','oxygen concentration') + call label_dtend_tracer(Model,100+Model%ntqv,'qv','water vapor specific humidity','kg kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntoz,'o3','ozone concentration','kg kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntcw,'liq_wat','cloud condensate (or liquid water)','kg kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntiw,'ice_wat','ice water','kg kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntrw,'rainwat','rain water','kg kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntsw,'snowwat','snow water','kg kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntgl,'graupel','graupel','kg kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntclamt,'cld_amt','cloud amount integer','kg kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntlnc,'water_nc','liquid number concentration','kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntinc,'ice_nc','ice number concentration','kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntrnc,'rain_nc','rain number concentration','kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntsnc,'snow_nc','snow number concentration','kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntgnc,'graupel_nc','graupel number concentration','kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntke,'sgs_tke','turbulent kinetic energy','J s-1') + call label_dtend_tracer(Model,100+Model%nqrimef,'q_rimef','mass weighted rime factor','kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntwa,'liq_aero','number concentration of water-friendly aerosols','kg-1 s-1') + call label_dtend_tracer(Model,100+Model%ntia,'ice_aero','number concentration of ice-friendly aerosols','kg-1 s-1') + call label_dtend_tracer(Model,100+Model%nto,'o_ion','oxygen ion concentration','kg kg-1 s-1') + call label_dtend_tracer(Model,100+Model%nto2,'o2','oxygen concentration','kg kg-1 s-1') call label_dtend_cause(Model,Model%index_of_process_pbl,'pbl','tendency due to PBL') call label_dtend_cause(Model,Model%index_of_process_dcnv,'deepcnv','tendency due to deep convection') From 6c8d6ce3e66e8bbe8e8f72041b931612803831b1 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 24 May 2021 15:24:49 +0000 Subject: [PATCH 02/10] Point to corresponding ccpp/physics branch --- .gitmodules | 4 ++-- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6d2d19bb4..86c31224d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,5 +8,5 @@ branch = gsl/develop [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/NOAA-GSL/ccpp-physics - branch = gsl/develop + url = https://github.com/SamuelTrahanNOAA/ccpp-physics + branch = bugfix/dtend-man-bugs diff --git a/ccpp/physics b/ccpp/physics index 417ec2d0c..2f38f276e 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 417ec2d0cdb9c89fd745104ee3fcd316168f0977 +Subproject commit 2f38f276e2f807b3d5656ff08640f170299ead0b From 5b2cf848800af5724682bb882c5e182583fb8a35 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 24 May 2021 15:25:05 +0000 Subject: [PATCH 03/10] 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 4. Only report rayleigh damping tendencies if rayleigh damping is enabled 5. List all possible diagnostic tendencies, even if they are not enabled. In the output, label them "selected" or "disabled." 6. Add phys_tend to the fv3_rap suite. --- ccpp/data/GFS_typedefs.F90 | 126 ++++++++++++++++++++++++-------- ccpp/data/GFS_typedefs.meta | 21 ++++++ ccpp/driver/GFS_diagnostics.F90 | 8 +- ccpp/suites/suite_FV3_HRRR.xml | 1 + ccpp/suites/suite_FV3_RAP.xml | 1 + 5 files changed, 122 insertions(+), 35 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index bf8616029..5758ec3c4 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -2183,7 +2183,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 @@ -3588,7 +3588,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 @@ -4403,13 +4403,34 @@ 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_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) + + if(Model%me==Model%master) then + print *,'dtend flags:' + print *,'have_pbl_edmf = ',have_pbl_edmf + print *,'have_samf = ',have_samf + print *,'have_pbl = ',have_pbl + print *,'have_dcnv = ',have_dcnv + print *,'have_scnv = ',have_scnv + print *,'have_mp = ',have_mp + print *,'have_oz_phys = ',have_oz_phys + print *,'have_cnvtrans = ',have_cnvtrans + print *,'have_rdamp = ',have_rdamp + print *,'' + endif ! Increment idtend and fill dtidx: allocate(Model%dtend_var_labels(Model%ntracp100)) @@ -4505,7 +4526,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) @@ -4518,8 +4539,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) @@ -4528,25 +4549,55 @@ 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%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_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_var_labels(itrac)%unit) endif endif +308 format('dtend ',A,': ',A,' ',A,' = ',A,' (',A,')') end subroutine fill_dtidx recursive function fglob(pattern,string) result(match) @@ -5941,7 +6005,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 7d0fb0182..10311697e 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -9215,6 +9215,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 @@ -9236,6 +9243,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 f3d8faf9b..cc31d7ca9 100644 --- a/ccpp/driver/GFS_diagnostics.F90 +++ b/ccpp/driver/GFS_diagnostics.F90 @@ -85,10 +85,10 @@ 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 +! 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/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 From 02fc3d1aefdcff09fa6035faaecd0e7f14fc39f1 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 24 May 2021 15:52:11 +0000 Subject: [PATCH 04/10] Merge gsl/develop into ccpp/physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 2f38f276e..9be7b2edd 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 2f38f276e2f807b3d5656ff08640f170299ead0b +Subproject commit 9be7b2edd6ed5f85c58e20c35b180e6427ce21fe From 7216cc4e800fb5d8aaf860ae65cf0768322d68ed Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Mon, 24 May 2021 21:48:24 +0000 Subject: [PATCH 05/10] Add phys_tend to suite_FV3_GSD_SAR and remove some debug prints --- ccpp/data/GFS_typedefs.F90 | 6 ++++-- ccpp/driver/GFS_diagnostics.F90 | 4 ---- ccpp/physics | 2 +- ccpp/suites/suite_FV3_GSD_SAR.xml | 1 + 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 9b77eb2c0..68e45074e 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -4453,8 +4453,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & 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 @@ -4601,6 +4601,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & 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 @@ -4612,6 +4613,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & enddo else if(have_scnv .or. have_dcnv) then do itrac=2,Model%ntrac + if(itrac==Model%ntchs) exit ! remaining tracers are chemical 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) enddo diff --git a/ccpp/driver/GFS_diagnostics.F90 b/ccpp/driver/GFS_diagnostics.F90 index 3ef973f39..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 9be7b2edd..6d75cde2b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 9be7b2edd6ed5f85c58e20c35b180e6427ce21fe +Subproject commit 6d75cde2b9313783bbd9545270ae982270c6de77 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 From 4c120b27ba659842a701e49315cb0881ef7f17c4 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Tue, 25 May 2021 16:16:53 +0000 Subject: [PATCH 06/10] Remove some debug prints and commented-out code. --- ccpp/data/GFS_typedefs.F90 | 41 -------------------------------------- 1 file changed, 41 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 68e45074e..ea2ad4989 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -4465,20 +4465,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & have_cnvtrans = (have_dcnv .or. have_scnv) .and. & (cscnv .or. satmedmf .or. trans_trac .or. ras) - if(Model%me==Model%master) then - print *,'dtend flags:' - print *,'have_pbl_edmf = ',have_pbl_edmf - print *,'have_samf = ',have_samf - print *,'have_pbl = ',have_pbl - print *,'have_dcnv = ',have_dcnv - print *,'have_scnv = ',have_scnv - print *,'have_mp = ',have_mp - print *,'have_oz_phys = ',have_oz_phys - print *,'have_cnvtrans = ',have_cnvtrans - print *,'have_rdamp = ',have_rdamp - print *,'' - endif - ! Increment idtend and fill dtidx: allocate(Model%dtend_var_labels(Model%ntracp100)) allocate(Model%dtend_process_labels(Model%nprocess)) @@ -4619,33 +4605,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & enddo endif - ! FIXME: Delete this: - ! if(have_cnvtrans) then - ! ! Interstitial 3 & 4 convective transport combines - ! ! shallow and deep convection transport of tracers into - ! ! one thing, losing all information about which process - ! ! moved the tracer. Since that information is lost, we - ! ! need a new "process" for convective transport. - - ! ! This must match the logic in interstitial_setup_tracers and GFS_suite_interstitial - - ! call fill_dtidx(Model,dtend_select,100+Model%ntcw,Model%index_of_process_conv_trans) - ! if (Model%imp_physics /= Model%imp_physics_zhao_carr .and. & - ! Model%imp_physics /= Model%imp_physics_zhao_carr_pdf .and. & - ! Model%imp_physics /= Model%imp_physics_gfdl) then - ! call fill_dtidx(Model,dtend_select,100+Model%ntiw,Model%index_of_process_conv_trans) - ! endif - - ! do itrac=2,Model%ntrac - ! 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 - ! if(itrac==Model%ntke .and. have_samf) cycle ! TKE is handled by scnv & dcnv - ! call fill_dtidx(Model,dtend_select,100+itrac,Model%index_of_process_conv_trans) - ! endif - ! enddo - ! endif - call fill_dtidx(Model,dtend_select,100+Model%ntoz,Model%index_of_process_pbl,have_pbl) call fill_dtidx(Model,dtend_select,100+Model%ntoz,Model%index_of_process_prod_loss,have_oz_phys) call fill_dtidx(Model,dtend_select,100+Model%ntoz,Model%index_of_process_ozmix,have_oz_phys) From c0527f1ada70e68eb445d9578213c7bcbcd8d95c Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Tue, 25 May 2021 16:39:41 +0000 Subject: [PATCH 07/10] Correct error in dtend variable availability list print. --- ccpp/data/GFS_typedefs.F90 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index ea2ad4989..5352c14c4 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -5994,14 +5994,16 @@ subroutine fill_dtidx(Model,dtend_select,itrac,icause,flag) 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_var_labels(itrac)%unit) + 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 308,'disabled',trim(Model%dtend_process_labels(icause)%mod_name), trim(name), & - trim(Model%dtend_var_labels(itrac)%desc), trim(Model%dtend_var_labels(itrac)%unit) + 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,')') +308 format('dtend ',A,': ',A,' ',A,' = ',A,' ',A,' (',A,')') end subroutine fill_dtidx recursive function fglob(pattern,string) result(match) From 9c4655c6059815f7840b8d2272cf37fdfa2cf617 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Thu, 27 May 2021 12:12:36 +0000 Subject: [PATCH 08/10] Enable convtrans diagnostic tendencies for number concentrations and qrimef. --- ccpp/data/GFS_typedefs.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 5352c14c4..aaab73751 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -4596,6 +4596,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & else if(Model%ntchs<=0 .or. itrac Date: Thu, 27 May 2021 14:24:02 +0000 Subject: [PATCH 09/10] Disable cnvtrans diagnostic tendencies for schemes that do their own diagnostic tendency reporting. --- ccpp/data/GFS_typedefs.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index aaab73751..7c55ee701 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -4463,7 +4463,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ! 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) + (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)) @@ -4602,6 +4604,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & endif enddo else if(have_scnv .or. have_dcnv) then + ! Scheme does its own tendency reporting, or does not use convective transport. do itrac=2,Model%ntrac if(itrac==Model%ntchs) exit ! remaining tracers are chemical call fill_dtidx(Model,dtend_select,100+itrac,Model%index_of_process_scnv,have_scnv) From d2f61ef7787cece18daffdd53b837035b712218f Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Fri, 28 May 2021 21:08:24 +0000 Subject: [PATCH 10/10] Point to gsl repositories --- .gitmodules | 4 ++-- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 86c31224d..6d2d19bb4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,5 +8,5 @@ branch = gsl/develop [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/SamuelTrahanNOAA/ccpp-physics - branch = bugfix/dtend-man-bugs + url = https://github.com/NOAA-GSL/ccpp-physics + branch = gsl/develop diff --git a/ccpp/physics b/ccpp/physics index 6d75cde2b..9346bb724 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 6d75cde2b9313783bbd9545270ae982270c6de77 +Subproject commit 9346bb7244d5469742dda697113a04d94b27d5a0