Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extended diagnostic output from Thompson MP, includes "Add optional scaling to RRTMGP flux adjustment" (#319), bug fix in several suite definition files #331

Merged
merged 42 commits into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
df7028b
Added more safeguards against out-of-bounds temperature to GP inputs.…
dustinswales May 9, 2021
971dd90
Updated physics.
dustinswales May 11, 2021
86c3050
Add vetical decay to impact of flux adjustment above threshold.
dustinswales May 11, 2021
0c60b67
Update .gitmodules
ericaligo-NOAA May 19, 2021
0c108a7
include upstream changes
ericaligo-NOAA May 24, 2021
3dd3034
Merge remote-tracking branch 'origin/develop' into feature/diag
ericaligo-NOAA May 24, 2021
dca609d
Added logistic function to damp the LW flux adjustment with height
dustinswales May 24, 2021
fe933e9
add 3D diagnostics from Thompson
ericaligo-NOAA May 24, 2021
c323a06
Reorganized RRTMGP aerosol optics.
dustinswales May 24, 2021
4c3d5a2
fixed bugs in aux,naux and vts
ericaligo-NOAA May 25, 2021
338f6ad
Reverted previous changes to ccpp-physics
dustinswales May 25, 2021
ebf76e3
Revert "Reorganized RRTMGP aerosol optics."
dustinswales May 25, 2021
5fca81b
fix comma bug and add cond/evap
ericaligo-NOAA May 25, 2021
58d269c
Bug fix. Add transition to HR adjustment.
dustinswales May 25, 2021
2a46518
push temp tendency diagnostics
ericaligo-NOAA May 27, 2021
3fbb0ab
Omission from previous revert.
dustinswales May 27, 2021
295c53c
Cleanup for PR review
dustinswales May 27, 2021
cf707b2
additional thompson diagnostics added, increased max aux file number …
ericaligo-NOAA May 28, 2021
cfeb0f0
fix bug with some diagnostics
ericaligo-NOAA May 28, 2021
28e9e46
merge with develop
ericaligo-NOAA Jun 4, 2021
23e2034
Merge remote-tracking branch 'origin/develop' into feature/diag
ericaligo-NOAA Jun 5, 2021
854ce51
Merge remote-tracking branch 'origin/develop' into feature/diag
ericaligo-NOAA Jun 5, 2021
1dc9c15
merge sub cycling with diagnostics
ericaligo-NOAA Jun 15, 2021
0034c50
Merge remote-tracking branch 'origin' into feature/diag
ericaligo-NOAA Jun 15, 2021
41e61e7
Update Thompson extended diagnostics code
DomHeinzeller Jun 22, 2021
67cc084
Bugfixes for updated Thompson diagnostics code
climbfuji Jun 22, 2021
d12742b
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into tho…
climbfuji Jun 22, 2021
bb99d0b
Update submodule pointerr for ccpp-physics
climbfuji Jun 22, 2021
fa3eccd
Fix bugs in diagnostics and dimension of aux3d array in meta file
ericaligo-NOAA Jun 23, 2021
ae66139
update ccpp/physics
ericaligo-NOAA Jun 23, 2021
f775413
Merge remote-tracking branch 'origin/develop' into feature/diag
ericaligo-NOAA Jun 23, 2021
ced6b75
Merge branch 'feature/diag' of https://github.com/ericaligo-noaa/fv3a…
climbfuji Jun 23, 2021
b7abc43
Adjust number of 3d diag arrays for Thompson MP, remove reset of aux2…
climbfuji Jun 23, 2021
d41dbc5
Use separate flag for resetting extended diagnostics for Thompson MP,…
climbfuji Jun 23, 2021
4189feb
Update submodule pointer for ccpp-physics
climbfuji Jun 23, 2021
43a54db
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into tho…
climbfuji Jul 1, 2021
048df7f
Update submodule pointer for ccpp-physics
climbfuji Jul 1, 2021
6d5bab8
Comment out extended diagnostics vts1, txri, txrc
climbfuji Jul 2, 2021
dc16869
Merge branch 'hotfix_AddPLimitToLWJacAdj' of https://github.com/dusti…
climbfuji Jul 2, 2021
3a5f306
Add missing calls to GFS_radiation_surface to several suite definitio…
climbfuji Jul 2, 2021
b22eb7e
Update submodule pointer for ccpp-physics
climbfuji Jul 2, 2021
f7f3897
Revert change to .gitmodules and update submodule pointer for ccpp-ph…
climbfuji Jul 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 46 additions & 5 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,13 @@ module GFS_typedefs
logical :: do_GPsw_Glw !< If set to true use rrtmgp for SW calculation, rrtmg for LW.
character(len=128) :: active_gases_array(100) !< character array for each trace gas name
logical :: use_LW_jacobian !< If true, use Jacobian of LW to update radiation tendency.
logical :: damp_LW_fluxadj !< If true, damp the LW flux adjustment using the Jacobian w/ height with logistic function
real(kind_phys) :: lfnc_k !< Logistic function transition depth (Pa)
real(kind_phys) :: lfnc_p0 !< Logistic function transition level (Pa)
logical :: doGP_lwscat !< If true, include scattering in longwave cloud-optics, only compatible w/ GP cloud-optics
real(kind_phys) :: minGPpres !< Minimum pressure allowed in RRTMGP.
real(kind_phys) :: minGPtemp !< Minimum temperature allowed in RRTMGP.
real(kind_phys) :: maxGPtemp !< Maximum temperature allowed in RRTMGP.

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

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

! Extended output diagnostics for Thompson MP
real (kind=kind_phys), pointer :: thompson_ext_diag3d (:,:,:) => null() ! extended diagnostic 3d output arrays from Thompson MP

! Auxiliary output arrays for debugging
real (kind=kind_phys), pointer :: aux2d(:,:) => null() !< auxiliary 2d arrays in output (for debugging)
real (kind=kind_phys), pointer :: aux3d(:,:,:)=> null() !< auxiliary 2d arrays in output (for debugging)
Expand Down Expand Up @@ -1935,7 +1944,8 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: rb_ice(:) => null() !<
real (kind=kind_phys), pointer :: rb_land(:) => null() !<
real (kind=kind_phys), pointer :: rb_water(:) => null() !<
logical :: reset !<
logical :: max_hourly_reset !<
logical :: ext_diag_thompson_reset !<
real (kind=kind_phys), pointer :: rhc(:,:) => null() !<
real (kind=kind_phys), pointer :: rho1(:) => null() !<
real (kind=kind_phys), pointer :: runoff(:) => null() !<
Expand Down Expand Up @@ -3097,6 +3107,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
integer :: rrtmgp_nGauss_ang = 1 !< Number of angles used in Gaussian quadrature
logical :: do_GPsw_Glw = .false.
logical :: use_LW_jacobian = .false. !< Use Jacobian of LW to update LW radiation tendencies.
logical :: damp_LW_fluxadj = .false. !< Damp LW Jacobian flux adjustment with height.
real(kind=kind_phys) :: lfnc_k = -999 !<
real(kind=kind_phys) :: lfnc_p0 = -999 !<
logical :: doGP_lwscat = .false. !< If true, include scattering in longwave cloud-optics, only compatible w/ GP cloud-optics
!--- Z-C microphysical parameters
integer :: ncld = 1 !< choice of cloud scheme
Expand Down Expand Up @@ -3150,6 +3163,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: lradar = .false. !< flag for radar reflectivity
real(kind=kind_phys) :: nsradar_reset = -999.0 !< seconds between resetting radar reflectivity calculation, set to <0 for every time step
real(kind=kind_phys) :: ttendlim = -999.0 !< temperature tendency limiter, set to <0 to deactivate
logical :: ext_diag_thompson = .false. !< flag for extended diagnostic output from Thompson

!--- GFDL microphysical parameters
logical :: lgfdlmprad = .false. !< flag for GFDLMP radiation interaction
Expand Down Expand Up @@ -3487,7 +3501,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
sw_file_gas, sw_file_clouds, rrtmgp_nBandsSW, rrtmgp_nGptsSW,&
doG_cldoptics, doGP_cldoptics_PADE, doGP_cldoptics_LUT, &
rrtmgp_nrghice, rrtmgp_nGauss_ang, do_GPsw_Glw, &
use_LW_jacobian, doGP_lwscat, &
use_LW_jacobian, doGP_lwscat, damp_LW_fluxadj, lfnc_k, &
lfnc_p0, &
! IN CCN forcing
iccn, &
!--- microphysical parameterizations
Expand All @@ -3499,7 +3514,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
mg_ncnst, mg_ninst, mg_ngnst, sed_supersat, do_sb_physics, &
mg_alf, mg_qcmin, mg_do_ice_gmao, mg_do_liq_liu, &
ltaerosol, lradar, nsradar_reset, lrefres, ttendlim, &
lgfdlmprad, &
ext_diag_thompson, lgfdlmprad, &
!--- max hourly
avg_max_length, &
!--- land/surface model control
Expand Down Expand Up @@ -3845,6 +3860,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%doGP_cldoptics_PADE = doGP_cldoptics_PADE
Model%doGP_cldoptics_LUT = doGP_cldoptics_LUT
Model%use_LW_jacobian = use_LW_jacobian
Model%damp_LW_fluxadj = damp_LW_fluxadj
Model%lfnc_k = lfnc_k
Model%lfnc_p0 = lfnc_p0
Model%doGP_lwscat = doGP_lwscat
if (Model%do_RRTMGP) then
! RRTMGP incompatible with levr /= levs
Expand All @@ -3866,6 +3884,12 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
write(0,*) "Logic error, RRTMGP spectral dimensions (bands/gpts) need to be provided."
stop
endif
else
if (Model%use_LW_jacobian) then
write(0,*) "Logic error, RRTMGP LW Jacobian adjustment cannot be used with RRTMG radiation."
Model%use_LW_jacobian = .false.
Model%damp_LW_fluxadj = .false.
endif
endif

! The CCPP versions of the RRTMG lw/sw schemes are configured
Expand Down Expand Up @@ -3926,6 +3950,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%lradar = lradar
Model%nsradar_reset = nsradar_reset
Model%ttendlim = ttendlim
Model%ext_diag_thompson= ext_diag_thompson

!--- F-A MP parameters
Model%rhgrd = rhgrd
Model%spec_adv = spec_adv
Expand Down Expand Up @@ -4744,6 +4770,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
if (Model%me == Model%master) print *,' Using Thompson double moment microphysics', &
' ltaerosol = ',Model%ltaerosol, &
' ttendlim =',Model%ttendlim, &
' ext_diag_thompson =',Model%ext_diag_thompson, &
' effr_in =',Model%effr_in, &
' lradar =',Model%lradar, &
' nsradar_reset =',Model%nsradar_reset, &
Expand Down Expand Up @@ -5127,6 +5154,9 @@ subroutine control_print(Model)
print *, ' doGP_cldoptics_PADE: ', Model%doGP_cldoptics_PADE
print *, ' doGP_cldoptics_LUT : ', Model%doGP_cldoptics_LUT
print *, ' use_LW_jacobian : ', Model%use_LW_jacobian
print *, ' damp_LW_fluxadj : ', Model%damp_LW_fluxadj
print *, ' lfnc_k : ', Model%lfnc_k
print *, ' lfnc_p0 : ', Model%lfnc_p0
print *, ' doGP_lwscat : ', Model%doGP_lwscat
endif
print *, ' '
Expand All @@ -5150,6 +5180,7 @@ subroutine control_print(Model)
print *, ' nsradar_reset : ', Model%nsradar_reset
print *, ' lrefres : ', Model%lrefres
print *, ' ttendlim : ', Model%ttendlim
print *, ' ext_diag_thompson : ', Model%ext_diag_thompson
print *, ' '
endif
if (Model%imp_physics == Model%imp_physics_mg) then
Expand Down Expand Up @@ -6028,6 +6059,12 @@ subroutine diag_create (Diag, IM, Model)
Diag%exch_m = clear_val
endif

! Extended diagnostics for Thompson MP
if (Model%ext_diag_thompson) then
allocate (Diag%thompson_ext_diag3d(IM,Model%levs,Model%thompson_ext_ndiag3d))
Diag%thompson_ext_diag3d = clear_val
endif

! Auxiliary arrays in output for debugging
if (Model%naux2d>0) then
allocate (Diag%aux2d(IM,Model%naux2d))
Expand Down Expand Up @@ -7391,7 +7428,10 @@ subroutine interstitial_phys_reset (Interstitial, Model)
end if
!
! Set flag for resetting maximum hourly output fields
Interstitial%reset = mod(Model%kdt-1, nint(Model%avg_max_length/Model%dtp)) == 0
Interstitial%max_hourly_reset = mod(Model%kdt-1, nint(Model%avg_max_length/Model%dtp)) == 0
! Use same logic in UFS to reset Thompson extended diagnostics
Interstitial%ext_diag_thompson_reset = Interstitial%max_hourly_reset
!
! Set flag for resetting radar reflectivity calculation
if (Model%nsradar_reset<0) then
Interstitial%radar_reset = .true.
Expand Down Expand Up @@ -7598,7 +7638,8 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno)
write (0,*) 'sum(Interstitial%rb_ice ) = ', sum(Interstitial%rb_ice )
write (0,*) 'sum(Interstitial%rb_land ) = ', sum(Interstitial%rb_land )
write (0,*) 'sum(Interstitial%rb_water ) = ', sum(Interstitial%rb_water )
write (0,*) 'Interstitial%reset = ', Interstitial%reset
write (0,*) 'Interstitial%max_hourly_reset = ', Interstitial%max_hourly_reset
write (0,*) 'Interstitial%ext_diag_thompson_reset = ', Interstitial%ext_diag_thompson_reset
write (0,*) 'sum(Interstitial%rhc ) = ', sum(Interstitial%rhc )
write (0,*) 'sum(Interstitial%runoff ) = ', sum(Interstitial%runoff )
write (0,*) 'sum(Interstitial%save_q ) = ', sum(Interstitial%save_q )
Expand Down
55 changes: 54 additions & 1 deletion ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -2931,6 +2931,26 @@
units = flag
dimensions = ()
type = logical
[damp_LW_fluxadj]
standard_name = flag_to_damp_RRTMGP_LW_jacobian_flux_adjustment
long_name = logical flag to control RRTMGP LW calculation
units = flag
dimensions = ()
type = logical
[lfnc_k]
standard_name = transition_pressure_length_scale_for_flux_damping
long_name = depth of transition layer in logistic function for LW flux adjustment damping
units = Pa
dimensions = ()
type = real
kind = kind_phys
[lfnc_p0]
standard_name = transition_pressure_for_flux_damping
long_name = transition pressure for LW flux adjustment damping
units = Pa
dimensions = ()
type = real
kind = kind_phys
[doGP_lwscat]
standard_name = flag_to_include_longwave_scattering_in_cloud_optics
long_name = logical flag to control the addition of LW scattering in RRTMGP
Expand Down Expand Up @@ -2975,6 +2995,13 @@
dimensions = ()
type = real
kind = kind_phys
[maxGPtemp]
standard_name = maximum_temperature_in_RRTMGP
long_name = maximum temperature allowed in RRTMGP
units = K
dimensions = ()
type = real
kind = kind_phys
[ncld]
standard_name = number_of_hydrometeors
long_name = choice of cloud scheme / number of hydrometeors
Expand Down Expand Up @@ -3426,6 +3453,18 @@
dimensions = ()
type = real
kind = kind_phys
[ext_diag_thompson]
standard_name = flag_for_extended_diagnostic_output_from_thompson_microphysics
long_name = flag for extended diagnostic output from thompson microphysics
units = flag
dimensions = ()
type = logical
[thompson_ext_ndiag3d]
standard_name = number_of_3d_diagnostic_output_arrays_from_thompson_microphysics
long_name = number of 3d arrays for extended diagnostic output from thompson microphysics
units = count
dimensions = ()
type = integer
[lgfdlmprad]
standard_name = flag_for_GFDL_microphysics_radiation_interaction
long_name = flag for GFDL microphysics-radiation interaction
Expand Down Expand Up @@ -7451,6 +7490,14 @@
type = real
kind = kind_phys
active = (diag_ugwp_flag)
[thompson_ext_diag3d]
standard_name = extended_diagnostics_output_from_thompson_microphysics
long_name = set of 3d arrays for extended diagnostics output from thompson microphysics
units = none
dimensions = (horizontal_loop_extent,vertical_dimension,number_of_3d_diagnostic_output_arrays_from_thompson_microphysics)
type = real
kind = kind_phys
active = (flag_for_extended_diagnostic_output_from_thompson_microphysics)
[aux2d]
standard_name = auxiliary_2d_arrays
long_name = auxiliary 2d arrays to output (for debugging)
Expand Down Expand Up @@ -9365,12 +9412,18 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
[reset]
[max_hourly_reset]
standard_name = flag_reset_maximum_hourly_fields
long_name = flag for resetting maximum hourly fields
units = flag
dimensions = ()
type = logical
[ext_diag_thompson_reset]
standard_name = flag_reset_extended_diagnostics_output_arrays_from_thompson_microphysics
long_name = flag for resetting extended diagnostics output arrays from thompson microphysics
units = flag
dimensions = ()
type = logical
[rhc]
standard_name = critical_relative_humidity
long_name = critical relative humidity
Expand Down
26 changes: 26 additions & 0 deletions ccpp/driver/GFS_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3676,6 +3676,32 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop
enddo
endif

! Extended diagnostics from Thompson MP
thompson_extended_diagnostics: if (Model%ext_diag_thompson) then
do num=1,Model%thompson_ext_ndiag3d
idx = idx + 1
ExtDiag(idx)%axes = 3
select case (num)
! This is the place to add specific names, descriptions,
! and units if so desired
!case (1)
! ...
case default
write (xtra,'(I2.2)') num
ExtDiag(idx)%name = 'thompson_diag3d_' // trim(xtra)
ExtDiag(idx)%desc = 'Thompson extended diagnostics array ' // trim(xtra)
ExtDiag(idx)%unit = 'unknown'
end select
ExtDiag(idx)%mod_name = 'gfs_phys'
ExtDiag(idx)%intpl_method = 'bilinear'
ExtDiag(idx)%time_avg = .false.
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var3 => IntDiag(nb)%thompson_ext_diag3d(:,:,num)
enddo
enddo
end if thompson_extended_diagnostics

!! Cloud effective radii from Microphysics
!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
! idx = idx + 1
Expand Down
1 change: 1 addition & 0 deletions ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>GFS_rrtmgp_pre</scheme>
<scheme>GFS_radiation_surface</scheme>
<scheme>GFS_rrtmgp_thompsonmp_pre</scheme>
<scheme>GFS_rrtmgp_cloud_overlap_pre</scheme>
<scheme>GFS_cloud_diagnostics</scheme>
Expand Down
1 change: 1 addition & 0 deletions ccpp/suites/suite_FV3_GFS_v16_coupled_noahmp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>GFS_rrtmg_pre</scheme>
<scheme>GFS_radiation_surface</scheme>
<scheme>rrtmg_sw_pre</scheme>
<scheme>rrtmg_sw</scheme>
<scheme>rrtmg_sw_post</scheme>
Expand Down
1 change: 1 addition & 0 deletions ccpp/suites/suite_FV3_GFS_v16_coupled_nsstNoahmp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>GFS_rrtmg_pre</scheme>
<scheme>GFS_radiation_surface</scheme>
<scheme>rrtmg_sw_pre</scheme>
<scheme>rrtmg_sw</scheme>
<scheme>rrtmg_sw_post</scheme>
Expand Down
1 change: 1 addition & 0 deletions ccpp/suites/suite_FV3_RRFS_v1alpha.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>GFS_rrtmg_pre</scheme>
<scheme>GFS_radiation_surface</scheme>
<scheme>rrtmg_sw_pre</scheme>
<scheme>rrtmg_sw</scheme>
<scheme>rrtmg_sw_post</scheme>
Expand Down