Skip to content

Commit 20883ed

Browse files
climbfujidustinswalesericaligo-NOAADomHeinzeller
authored
Add extended diagnostic output from Thompson MP, includes "Add optional scaling to RRTMGP flux adjustment" (#319), bug fix in several suite definition files (#331)
Adds a set of dedicated 3d arrays for extended diagnostic output from Thompon MP, and a logical flag that controls allocating, outputting and resetting these arrays. This work is based on @ericaligo-NOAA 's code changes. The flag to reset the extended diagnostics from Thompson MP is - for the UFS - currently tied to avg_max_length, which is used to reset maximum hourly fields (the corresponding reset variable is renamed to make its purpose clear). Include the changes in #319, "Add optional scaling to RRTMGP flux adjustment". Important: Fixed bugs in several suite definition files that were missing the call to GFS_radiation_surface: * suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml * suite_FV3_GFS_v16_coupled_noahmp.xml * suite_FV3_GFS_v16_coupled_nsstNoahmp.xml * suite_FV3_RRFS_v1alpha.xml Co-authored-by: Dustin Swales <dustin.swales@noaa.gov> Co-authored-by: Eric Aligo <eric.aligo@noaa.gov> Co-authored-by: Dom Heinzeller <dom.heinzeller@noaa.gov>
1 parent ad7bddc commit 20883ed

8 files changed

+131
-7
lines changed

ccpp/data/GFS_typedefs.F90

+46-5
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,13 @@ module GFS_typedefs
706706
logical :: do_GPsw_Glw !< If set to true use rrtmgp for SW calculation, rrtmg for LW.
707707
character(len=128) :: active_gases_array(100) !< character array for each trace gas name
708708
logical :: use_LW_jacobian !< If true, use Jacobian of LW to update radiation tendency.
709+
logical :: damp_LW_fluxadj !< If true, damp the LW flux adjustment using the Jacobian w/ height with logistic function
710+
real(kind_phys) :: lfnc_k !< Logistic function transition depth (Pa)
711+
real(kind_phys) :: lfnc_p0 !< Logistic function transition level (Pa)
709712
logical :: doGP_lwscat !< If true, include scattering in longwave cloud-optics, only compatible w/ GP cloud-optics
710713
real(kind_phys) :: minGPpres !< Minimum pressure allowed in RRTMGP.
711714
real(kind_phys) :: minGPtemp !< Minimum temperature allowed in RRTMGP.
715+
real(kind_phys) :: maxGPtemp !< Maximum temperature allowed in RRTMGP.
712716

713717
!--- microphysical switch
714718
integer :: ncld !< choice of cloud scheme
@@ -785,6 +789,8 @@ module GFS_typedefs
785789
logical :: lradar !< flag for radar reflectivity
786790
real(kind=kind_phys) :: nsradar_reset !< seconds between resetting radar reflectivity calculation
787791
real(kind=kind_phys) :: ttendlim !< temperature tendency limiter per time step in K/s
792+
logical :: ext_diag_thompson !< flag for extended diagnostic output from Thompson
793+
integer :: thompson_ext_ndiag3d=37 !< number of 3d arrays for extended diagnostic output from Thompson
788794

789795
!--- GFDL microphysical paramters
790796
logical :: lgfdlmprad !< flag for GFDL mp scheme and radiation consistency
@@ -1698,6 +1704,9 @@ module GFS_typedefs
16981704
real (kind=kind_phys), pointer :: tau_tofd(:) => null() !
16991705
!---vay-2018 UGWP-diagnostics
17001706

1707+
! Extended output diagnostics for Thompson MP
1708+
real (kind=kind_phys), pointer :: thompson_ext_diag3d (:,:,:) => null() ! extended diagnostic 3d output arrays from Thompson MP
1709+
17011710
! Auxiliary output arrays for debugging
17021711
real (kind=kind_phys), pointer :: aux2d(:,:) => null() !< auxiliary 2d arrays in output (for debugging)
17031712
real (kind=kind_phys), pointer :: aux3d(:,:,:)=> null() !< auxiliary 2d arrays in output (for debugging)
@@ -1935,7 +1944,8 @@ module GFS_typedefs
19351944
real (kind=kind_phys), pointer :: rb_ice(:) => null() !<
19361945
real (kind=kind_phys), pointer :: rb_land(:) => null() !<
19371946
real (kind=kind_phys), pointer :: rb_water(:) => null() !<
1938-
logical :: reset !<
1947+
logical :: max_hourly_reset !<
1948+
logical :: ext_diag_thompson_reset !<
19391949
real (kind=kind_phys), pointer :: rhc(:,:) => null() !<
19401950
real (kind=kind_phys), pointer :: rho1(:) => null() !<
19411951
real (kind=kind_phys), pointer :: runoff(:) => null() !<
@@ -3097,6 +3107,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
30973107
integer :: rrtmgp_nGauss_ang = 1 !< Number of angles used in Gaussian quadrature
30983108
logical :: do_GPsw_Glw = .false.
30993109
logical :: use_LW_jacobian = .false. !< Use Jacobian of LW to update LW radiation tendencies.
3110+
logical :: damp_LW_fluxadj = .false. !< Damp LW Jacobian flux adjustment with height.
3111+
real(kind=kind_phys) :: lfnc_k = -999 !<
3112+
real(kind=kind_phys) :: lfnc_p0 = -999 !<
31003113
logical :: doGP_lwscat = .false. !< If true, include scattering in longwave cloud-optics, only compatible w/ GP cloud-optics
31013114
!--- Z-C microphysical parameters
31023115
integer :: ncld = 1 !< choice of cloud scheme
@@ -3150,6 +3163,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
31503163
logical :: lradar = .false. !< flag for radar reflectivity
31513164
real(kind=kind_phys) :: nsradar_reset = -999.0 !< seconds between resetting radar reflectivity calculation, set to <0 for every time step
31523165
real(kind=kind_phys) :: ttendlim = -999.0 !< temperature tendency limiter, set to <0 to deactivate
3166+
logical :: ext_diag_thompson = .false. !< flag for extended diagnostic output from Thompson
31533167

31543168
!--- GFDL microphysical parameters
31553169
logical :: lgfdlmprad = .false. !< flag for GFDLMP radiation interaction
@@ -3487,7 +3501,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
34873501
sw_file_gas, sw_file_clouds, rrtmgp_nBandsSW, rrtmgp_nGptsSW,&
34883502
doG_cldoptics, doGP_cldoptics_PADE, doGP_cldoptics_LUT, &
34893503
rrtmgp_nrghice, rrtmgp_nGauss_ang, do_GPsw_Glw, &
3490-
use_LW_jacobian, doGP_lwscat, &
3504+
use_LW_jacobian, doGP_lwscat, damp_LW_fluxadj, lfnc_k, &
3505+
lfnc_p0, &
34913506
! IN CCN forcing
34923507
iccn, &
34933508
!--- microphysical parameterizations
@@ -3499,7 +3514,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
34993514
mg_ncnst, mg_ninst, mg_ngnst, sed_supersat, do_sb_physics, &
35003515
mg_alf, mg_qcmin, mg_do_ice_gmao, mg_do_liq_liu, &
35013516
ltaerosol, lradar, nsradar_reset, lrefres, ttendlim, &
3502-
lgfdlmprad, &
3517+
ext_diag_thompson, lgfdlmprad, &
35033518
!--- max hourly
35043519
avg_max_length, &
35053520
!--- land/surface model control
@@ -3845,6 +3860,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
38453860
Model%doGP_cldoptics_PADE = doGP_cldoptics_PADE
38463861
Model%doGP_cldoptics_LUT = doGP_cldoptics_LUT
38473862
Model%use_LW_jacobian = use_LW_jacobian
3863+
Model%damp_LW_fluxadj = damp_LW_fluxadj
3864+
Model%lfnc_k = lfnc_k
3865+
Model%lfnc_p0 = lfnc_p0
38483866
Model%doGP_lwscat = doGP_lwscat
38493867
if (Model%do_RRTMGP) then
38503868
! RRTMGP incompatible with levr /= levs
@@ -3866,6 +3884,12 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
38663884
write(0,*) "Logic error, RRTMGP spectral dimensions (bands/gpts) need to be provided."
38673885
stop
38683886
endif
3887+
else
3888+
if (Model%use_LW_jacobian) then
3889+
write(0,*) "Logic error, RRTMGP LW Jacobian adjustment cannot be used with RRTMG radiation."
3890+
Model%use_LW_jacobian = .false.
3891+
Model%damp_LW_fluxadj = .false.
3892+
endif
38693893
endif
38703894

38713895
! The CCPP versions of the RRTMG lw/sw schemes are configured
@@ -3926,6 +3950,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
39263950
Model%lradar = lradar
39273951
Model%nsradar_reset = nsradar_reset
39283952
Model%ttendlim = ttendlim
3953+
Model%ext_diag_thompson= ext_diag_thompson
3954+
39293955
!--- F-A MP parameters
39303956
Model%rhgrd = rhgrd
39313957
Model%spec_adv = spec_adv
@@ -4744,6 +4770,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
47444770
if (Model%me == Model%master) print *,' Using Thompson double moment microphysics', &
47454771
' ltaerosol = ',Model%ltaerosol, &
47464772
' ttendlim =',Model%ttendlim, &
4773+
' ext_diag_thompson =',Model%ext_diag_thompson, &
47474774
' effr_in =',Model%effr_in, &
47484775
' lradar =',Model%lradar, &
47494776
' nsradar_reset =',Model%nsradar_reset, &
@@ -5127,6 +5154,9 @@ subroutine control_print(Model)
51275154
print *, ' doGP_cldoptics_PADE: ', Model%doGP_cldoptics_PADE
51285155
print *, ' doGP_cldoptics_LUT : ', Model%doGP_cldoptics_LUT
51295156
print *, ' use_LW_jacobian : ', Model%use_LW_jacobian
5157+
print *, ' damp_LW_fluxadj : ', Model%damp_LW_fluxadj
5158+
print *, ' lfnc_k : ', Model%lfnc_k
5159+
print *, ' lfnc_p0 : ', Model%lfnc_p0
51305160
print *, ' doGP_lwscat : ', Model%doGP_lwscat
51315161
endif
51325162
print *, ' '
@@ -5150,6 +5180,7 @@ subroutine control_print(Model)
51505180
print *, ' nsradar_reset : ', Model%nsradar_reset
51515181
print *, ' lrefres : ', Model%lrefres
51525182
print *, ' ttendlim : ', Model%ttendlim
5183+
print *, ' ext_diag_thompson : ', Model%ext_diag_thompson
51535184
print *, ' '
51545185
endif
51555186
if (Model%imp_physics == Model%imp_physics_mg) then
@@ -6028,6 +6059,12 @@ subroutine diag_create (Diag, IM, Model)
60286059
Diag%exch_m = clear_val
60296060
endif
60306061

6062+
! Extended diagnostics for Thompson MP
6063+
if (Model%ext_diag_thompson) then
6064+
allocate (Diag%thompson_ext_diag3d(IM,Model%levs,Model%thompson_ext_ndiag3d))
6065+
Diag%thompson_ext_diag3d = clear_val
6066+
endif
6067+
60316068
! Auxiliary arrays in output for debugging
60326069
if (Model%naux2d>0) then
60336070
allocate (Diag%aux2d(IM,Model%naux2d))
@@ -7391,7 +7428,10 @@ subroutine interstitial_phys_reset (Interstitial, Model)
73917428
end if
73927429
!
73937430
! Set flag for resetting maximum hourly output fields
7394-
Interstitial%reset = mod(Model%kdt-1, nint(Model%avg_max_length/Model%dtp)) == 0
7431+
Interstitial%max_hourly_reset = mod(Model%kdt-1, nint(Model%avg_max_length/Model%dtp)) == 0
7432+
! Use same logic in UFS to reset Thompson extended diagnostics
7433+
Interstitial%ext_diag_thompson_reset = Interstitial%max_hourly_reset
7434+
!
73957435
! Set flag for resetting radar reflectivity calculation
73967436
if (Model%nsradar_reset<0) then
73977437
Interstitial%radar_reset = .true.
@@ -7598,7 +7638,8 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno)
75987638
write (0,*) 'sum(Interstitial%rb_ice ) = ', sum(Interstitial%rb_ice )
75997639
write (0,*) 'sum(Interstitial%rb_land ) = ', sum(Interstitial%rb_land )
76007640
write (0,*) 'sum(Interstitial%rb_water ) = ', sum(Interstitial%rb_water )
7601-
write (0,*) 'Interstitial%reset = ', Interstitial%reset
7641+
write (0,*) 'Interstitial%max_hourly_reset = ', Interstitial%max_hourly_reset
7642+
write (0,*) 'Interstitial%ext_diag_thompson_reset = ', Interstitial%ext_diag_thompson_reset
76027643
write (0,*) 'sum(Interstitial%rhc ) = ', sum(Interstitial%rhc )
76037644
write (0,*) 'sum(Interstitial%runoff ) = ', sum(Interstitial%runoff )
76047645
write (0,*) 'sum(Interstitial%save_q ) = ', sum(Interstitial%save_q )

ccpp/data/GFS_typedefs.meta

+54-1
Original file line numberDiff line numberDiff line change
@@ -2931,6 +2931,26 @@
29312931
units = flag
29322932
dimensions = ()
29332933
type = logical
2934+
[damp_LW_fluxadj]
2935+
standard_name = flag_to_damp_RRTMGP_LW_jacobian_flux_adjustment
2936+
long_name = logical flag to control RRTMGP LW calculation
2937+
units = flag
2938+
dimensions = ()
2939+
type = logical
2940+
[lfnc_k]
2941+
standard_name = transition_pressure_length_scale_for_flux_damping
2942+
long_name = depth of transition layer in logistic function for LW flux adjustment damping
2943+
units = Pa
2944+
dimensions = ()
2945+
type = real
2946+
kind = kind_phys
2947+
[lfnc_p0]
2948+
standard_name = transition_pressure_for_flux_damping
2949+
long_name = transition pressure for LW flux adjustment damping
2950+
units = Pa
2951+
dimensions = ()
2952+
type = real
2953+
kind = kind_phys
29342954
[doGP_lwscat]
29352955
standard_name = flag_to_include_longwave_scattering_in_cloud_optics
29362956
long_name = logical flag to control the addition of LW scattering in RRTMGP
@@ -2975,6 +2995,13 @@
29752995
dimensions = ()
29762996
type = real
29772997
kind = kind_phys
2998+
[maxGPtemp]
2999+
standard_name = maximum_temperature_in_RRTMGP
3000+
long_name = maximum temperature allowed in RRTMGP
3001+
units = K
3002+
dimensions = ()
3003+
type = real
3004+
kind = kind_phys
29783005
[ncld]
29793006
standard_name = number_of_hydrometeors
29803007
long_name = choice of cloud scheme / number of hydrometeors
@@ -3426,6 +3453,18 @@
34263453
dimensions = ()
34273454
type = real
34283455
kind = kind_phys
3456+
[ext_diag_thompson]
3457+
standard_name = flag_for_extended_diagnostic_output_from_thompson_microphysics
3458+
long_name = flag for extended diagnostic output from thompson microphysics
3459+
units = flag
3460+
dimensions = ()
3461+
type = logical
3462+
[thompson_ext_ndiag3d]
3463+
standard_name = number_of_3d_diagnostic_output_arrays_from_thompson_microphysics
3464+
long_name = number of 3d arrays for extended diagnostic output from thompson microphysics
3465+
units = count
3466+
dimensions = ()
3467+
type = integer
34293468
[lgfdlmprad]
34303469
standard_name = flag_for_GFDL_microphysics_radiation_interaction
34313470
long_name = flag for GFDL microphysics-radiation interaction
@@ -7451,6 +7490,14 @@
74517490
type = real
74527491
kind = kind_phys
74537492
active = (diag_ugwp_flag)
7493+
[thompson_ext_diag3d]
7494+
standard_name = extended_diagnostics_output_from_thompson_microphysics
7495+
long_name = set of 3d arrays for extended diagnostics output from thompson microphysics
7496+
units = none
7497+
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_3d_diagnostic_output_arrays_from_thompson_microphysics)
7498+
type = real
7499+
kind = kind_phys
7500+
active = (flag_for_extended_diagnostic_output_from_thompson_microphysics)
74547501
[aux2d]
74557502
standard_name = auxiliary_2d_arrays
74567503
long_name = auxiliary 2d arrays to output (for debugging)
@@ -9365,12 +9412,18 @@
93659412
dimensions = (horizontal_loop_extent)
93669413
type = real
93679414
kind = kind_phys
9368-
[reset]
9415+
[max_hourly_reset]
93699416
standard_name = flag_reset_maximum_hourly_fields
93709417
long_name = flag for resetting maximum hourly fields
93719418
units = flag
93729419
dimensions = ()
93739420
type = logical
9421+
[ext_diag_thompson_reset]
9422+
standard_name = flag_reset_extended_diagnostics_output_arrays_from_thompson_microphysics
9423+
long_name = flag for resetting extended diagnostics output arrays from thompson microphysics
9424+
units = flag
9425+
dimensions = ()
9426+
type = logical
93749427
[rhc]
93759428
standard_name = critical_relative_humidity
93769429
long_name = critical relative humidity

ccpp/driver/GFS_diagnostics.F90

+26
Original file line numberDiff line numberDiff line change
@@ -3676,6 +3676,32 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop
36763676
enddo
36773677
endif
36783678

3679+
! Extended diagnostics from Thompson MP
3680+
thompson_extended_diagnostics: if (Model%ext_diag_thompson) then
3681+
do num=1,Model%thompson_ext_ndiag3d
3682+
idx = idx + 1
3683+
ExtDiag(idx)%axes = 3
3684+
select case (num)
3685+
! This is the place to add specific names, descriptions,
3686+
! and units if so desired
3687+
!case (1)
3688+
! ...
3689+
case default
3690+
write (xtra,'(I2.2)') num
3691+
ExtDiag(idx)%name = 'thompson_diag3d_' // trim(xtra)
3692+
ExtDiag(idx)%desc = 'Thompson extended diagnostics array ' // trim(xtra)
3693+
ExtDiag(idx)%unit = 'unknown'
3694+
end select
3695+
ExtDiag(idx)%mod_name = 'gfs_phys'
3696+
ExtDiag(idx)%intpl_method = 'bilinear'
3697+
ExtDiag(idx)%time_avg = .false.
3698+
allocate (ExtDiag(idx)%data(nblks))
3699+
do nb = 1,nblks
3700+
ExtDiag(idx)%data(nb)%var3 => IntDiag(nb)%thompson_ext_diag3d(:,:,num)
3701+
enddo
3702+
enddo
3703+
end if thompson_extended_diagnostics
3704+
36793705
!! Cloud effective radii from Microphysics
36803706
!if (Model%imp_physics == Model%imp_physics_thompson .or. Model%imp_physics == Model%imp_physics_wsm6 .or. Model%imp_physics == Model%imp_physics_fer_hires) then
36813707
! idx = idx + 1

ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<scheme>GFS_suite_interstitial_rad_reset</scheme>
1616
<scheme>sgscloud_radpre</scheme>
1717
<scheme>GFS_rrtmgp_pre</scheme>
18+
<scheme>GFS_radiation_surface</scheme>
1819
<scheme>GFS_rrtmgp_thompsonmp_pre</scheme>
1920
<scheme>GFS_rrtmgp_cloud_overlap_pre</scheme>
2021
<scheme>GFS_cloud_diagnostics</scheme>

ccpp/suites/suite_FV3_GFS_v16_coupled_noahmp.xml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<subcycle loop="1">
2020
<scheme>GFS_suite_interstitial_rad_reset</scheme>
2121
<scheme>GFS_rrtmg_pre</scheme>
22+
<scheme>GFS_radiation_surface</scheme>
2223
<scheme>rrtmg_sw_pre</scheme>
2324
<scheme>rrtmg_sw</scheme>
2425
<scheme>rrtmg_sw_post</scheme>

ccpp/suites/suite_FV3_GFS_v16_coupled_nsstNoahmp.xml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<subcycle loop="1">
2020
<scheme>GFS_suite_interstitial_rad_reset</scheme>
2121
<scheme>GFS_rrtmg_pre</scheme>
22+
<scheme>GFS_radiation_surface</scheme>
2223
<scheme>rrtmg_sw_pre</scheme>
2324
<scheme>rrtmg_sw</scheme>
2425
<scheme>rrtmg_sw_post</scheme>

ccpp/suites/suite_FV3_RRFS_v1alpha.xml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<scheme>GFS_suite_interstitial_rad_reset</scheme>
1616
<scheme>sgscloud_radpre</scheme>
1717
<scheme>GFS_rrtmg_pre</scheme>
18+
<scheme>GFS_radiation_surface</scheme>
1819
<scheme>rrtmg_sw_pre</scheme>
1920
<scheme>rrtmg_sw</scheme>
2021
<scheme>rrtmg_sw_post</scheme>

0 commit comments

Comments
 (0)