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 support for Stochastically Perturbed Parameterizations (SPP) in FV3 and add the FV3_RRFS_v1alpha SDF. #454

Merged
merged 85 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
f9303aa
submodule pointer for ccpp-physics
Sep 7, 2021
aedc3d4
update submodules
Sep 27, 2021
9165823
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
Sep 27, 2021
68368e2
update submodule atmos_cubed_sphere
Sep 27, 2021
6fb3045
Add SPP option to several physics parameterizations
Nov 11, 2021
1b9a07f
bug fixes
Nov 22, 2021
4879a4e
Merge branch 'develop' of https://github.com/noaa-emc/fv3atm into fea…
Nov 23, 2021
75e1199
update rte/rrtmgp
Nov 23, 2021
9a7d80f
update submodule pointer
Nov 23, 2021
cbb9503
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
Dec 9, 2021
a66ff66
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
Dec 9, 2021
987cbc9
Update pointer for ccpp-physics to JeffBeck-NOAA fork
JeffBeck-NOAA Dec 23, 2021
8436d56
Update submodule pointers
JeffBeck-NOAA Dec 28, 2021
5798d15
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
JeffBeck-NOAA Dec 28, 2021
cf74133
Requested modifications from code review.
JeffBeck-NOAA Dec 28, 2021
0263a28
Remove "flipped" entries for stochastic physics.
JeffBeck-NOAA Dec 28, 2021
eee2d37
Remove print statements.
JeffBeck-NOAA Dec 28, 2021
63250e3
Change "v" to "n" to conform with integer variables.
JeffBeck-NOAA Dec 28, 2021
1fc7543
Remove variable duplications in the Intdiag type.
JeffBeck-NOAA Dec 28, 2021
045d7c8
Remove references to Intdiag variables.
JeffBeck-NOAA Dec 28, 2021
6550555
Add the FV3_RRFS_v1alpha SDF back into fv3atm.
JeffBeck-NOAA Dec 28, 2021
679714e
Update stochastic_physics/stochastic_physics_wrapper.F90
JeffBeck-NOAA Dec 28, 2021
f3d9e6f
Update stochastic_physics/stochastic_physics_wrapper.F90
JeffBeck-NOAA Dec 28, 2021
9ec20cb
Update ccpp/driver/GFS_diagnostics.F90
JeffBeck-NOAA Dec 28, 2021
5fe5c35
Update ccpp/driver/GFS_diagnostics.F90
JeffBeck-NOAA Dec 28, 2021
543efe1
Update ccpp/driver/GFS_diagnostics.F90
JeffBeck-NOAA Dec 28, 2021
d1c3640
Update ccpp/driver/GFS_diagnostics.F90
JeffBeck-NOAA Dec 28, 2021
5029e1f
Update ccpp/driver/GFS_diagnostics.F90
JeffBeck-NOAA Dec 28, 2021
1d2f6f2
Requested changes during code review.
JeffBeck-NOAA Dec 28, 2021
eb7b507
Merge branch 'feature/stoch_spp' of https://github.com/JeffBeck-NOAA/…
JeffBeck-NOAA Dec 28, 2021
40a5a42
Update submodule pointers
JeffBeck-NOAA Dec 28, 2021
2ce7a38
Update UPP submodule pointer
JeffBeck-NOAA Dec 28, 2021
59c9bf2
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
JeffBeck-NOAA Dec 28, 2021
eedae98
Update ccpp-physics submodule pointer
JeffBeck-NOAA Dec 28, 2021
36bfa9d
Set upp submodule pointer to specific hash in fv3atm.
JeffBeck-NOAA Dec 28, 2021
518d6a3
Set UPP submodule pointer to specific hash in fv3atm.
JeffBeck-NOAA Dec 28, 2021
dd0e231
Merge branch 'feature/stoch_spp' of https://github.com/JeffBeck-NOAA/…
JeffBeck-NOAA Dec 28, 2021
3e04637
Update submodule pointer for ccpp/physics
JeffBeck-NOAA Dec 28, 2021
654c192
Changes for PR modifcation requests
JeffBeck-NOAA Jan 12, 2022
4d6597c
Test changes after PR review modifications
JeffBeck-NOAA Jan 12, 2022
0358570
Allocate spp_wts_* arrays in GFS_typedefs.F90 and not in the stochast…
JeffBeck-NOAA Jan 12, 2022
33f9997
Changes for PR modification requests
JeffBeck-NOAA Jan 12, 2022
3f85580
Test changes after PR review modifications
JeffBeck-NOAA Jan 12, 2022
a619064
Allocate spp_wts_* arrays in GFS_typedefs.F90 and not in the stochast…
JeffBeck-NOAA Jan 12, 2022
1a5c99d
Merge branch 'feature/stoch_spp_part2' of https://github.com/JeffBeck…
JeffBeck-NOAA Jan 12, 2022
906c341
Update pointers for ccpp/physics and ccpp/framework
JeffBeck-NOAA Jan 12, 2022
22bd1e7
Update ccpp/physics pointer
JeffBeck-NOAA Jan 13, 2022
e4f8b63
Change pointers and .gitmodule feature branch for ccpp-physics
JeffBeck-NOAA Jan 14, 2022
9551574
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
JeffBeck-NOAA Jan 14, 2022
bf11e2c
Update pointer for ccpp/physics
JeffBeck-NOAA Jan 14, 2022
6bbe037
Update UPP pointer
JeffBeck-NOAA Jan 14, 2022
ffbb736
Update UPP pointer
JeffBeck-NOAA Jan 14, 2022
2b0d373
Don't limit the size of spp_var_list
JeffBeck-NOAA Jan 14, 2022
d977250
Update pointer for ccpp/physics
JeffBeck-NOAA Jan 14, 2022
0e300e2
Update pointer for ccpp/physics
JeffBeck-NOAA Jan 14, 2022
3575581
Update ccpp/physics pointer
JeffBeck-NOAA Jan 14, 2022
b50c0ce
Fix spp_var/prt_list in GFS_typedefs.F90
JeffBeck-NOAA Jan 14, 2022
2fda378
Make SPP variables pointers in GFS_typedefs.F90
JeffBeck-NOAA Jan 14, 2022
a030e43
Updates to standard names and units
JeffBeck-NOAA Jan 16, 2022
75c0c20
Update ccpp/physics pointer
JeffBeck-NOAA Jan 16, 2022
bd13650
Change spp_prt_list to a variable unit
JeffBeck-NOAA Jan 16, 2022
1ddbf09
Update do_spp metadata
JeffBeck-NOAA Jan 16, 2022
15ede90
Update ccpp/physics pointer
JeffBeck-NOAA Jan 18, 2022
ea02e0e
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
JeffBeck-NOAA Jan 20, 2022
4efb22f
Update ccpp/physics pointer
JeffBeck-NOAA Jan 20, 2022
cd453a3
Update ccpp/physics pointer
JeffBeck-NOAA Jan 20, 2022
47f8481
Update ccpp/physics pointer
JeffBeck-NOAA Jan 20, 2022
6360ccd
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
JeffBeck-NOAA Feb 11, 2022
169eeb6
Update ccpp/physics pointer
JeffBeck-NOAA Feb 11, 2022
3128a48
Update ccpp/physics pointer
JeffBeck-NOAA Feb 11, 2022
4108ae2
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
JeffBeck-NOAA Feb 15, 2022
2ccc067
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
JeffBeck-NOAA Feb 16, 2022
bc896a3
Update ccpp/physics pointer
JeffBeck-NOAA Feb 16, 2022
c3c4ca9
Update units for spp_prt_list.
JeffBeck-NOAA Feb 16, 2022
139049f
Update do_spp standard name.
JeffBeck-NOAA Feb 16, 2022
587adba
Update do_spp standard name
JeffBeck-NOAA Feb 17, 2022
51fad10
Revert erroneous do_sppt standard name change.
JeffBeck-NOAA Feb 17, 2022
f12ceea
Change all references of flag_for_stochastic_spp_option to do_stochas…
JeffBeck-NOAA Feb 17, 2022
b939277
Update ccpp/physics pointer
JeffBeck-NOAA Feb 17, 2022
1fff6af
Update ccpp/physics pointer
JeffBeck-NOAA Feb 21, 2022
a624fee
Update ccpp/physics pointer
JeffBeck-NOAA Feb 21, 2022
786a066
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
JeffBeck-NOAA Feb 22, 2022
208e2c4
Update ccpp/physics pointer
JeffBeck-NOAA Feb 22, 2022
8dd5e2a
Update ccpp-physics pointer and .gitmodules file
JeffBeck-NOAA Feb 23, 2022
ff03dc6
Change branch back to main
JeffBeck-NOAA Feb 23, 2022
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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
branch = main
[submodule "ccpp/physics"]
path = ccpp/physics
url = https://github.com/NCAR/ccpp-physics
branch = main
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JeffBeck-NOAA Please change the branch back to the main branch. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! Thank you!

url = https://github.com/JeffBeck-NOAA/ccpp-physics
branch = feature/stoch_spp
[submodule "upp"]
path = upp
url = https://github.com/NOAA-EMC/UPP
Expand Down
6 changes: 3 additions & 3 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ subroutine update_atmos_radiation_physics (Atmos)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP timestep_init step failed')

if (GFS_Control%do_sppt .or. GFS_Control%do_shum .or. GFS_Control%do_skeb .or. &
GFS_Control%lndp_type > 0 .or. GFS_Control%do_ca ) then
GFS_Control%lndp_type > 0 .or. GFS_Control%do_ca .or. GFS_Control%do_spp) then
JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
!--- call stochastic physics pattern generation / cellular automata
call stochastic_physics_wrapper(GFS_control, GFS_data, Atm_block, ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to stochastic_physics_wrapper failed')
Expand Down Expand Up @@ -698,7 +698,7 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP physics_init step failed')

if (GFS_Control%do_sppt .or. GFS_Control%do_shum .or. GFS_Control%do_skeb .or. &
GFS_Control%lndp_type > 0 .or. GFS_Control%do_ca) then
GFS_Control%lndp_type > 0 .or. GFS_Control%do_ca .or. GFS_Control%do_spp) then

!--- Initialize stochastic physics pattern generation / cellular automata for first time step
call stochastic_physics_wrapper(GFS_control, GFS_data, Atm_block, ierr)
Expand Down Expand Up @@ -964,7 +964,7 @@ subroutine atmos_model_end (Atmos)
! call write_stoch_restart_atm('RESTART/atm_stoch.res.nc')
endif
if (GFS_Control%do_sppt .or. GFS_Control%do_shum .or. GFS_Control%do_skeb .or. &
GFS_Control%lndp_type > 0 .or. GFS_Control%do_ca ) then
GFS_Control%lndp_type > 0 .or. GFS_Control%do_ca .or. GFS_Control%do_spp) then
if(restart_endfcst) then
call write_stoch_restart_atm('RESTART/atm_stoch.res.nc')
if (GFS_control%do_ca)then
Expand Down
52 changes: 51 additions & 1 deletion ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,11 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: skebu_wts (:,:) => null() !
real (kind=kind_phys), pointer :: skebv_wts (:,:) => null() !
real (kind=kind_phys), pointer :: sfc_wts (:,:) => null() ! mg, sfc-perts
real (kind=kind_phys), pointer :: spp_wts_pbl (:,:) => null() ! spp-pbl-perts
real (kind=kind_phys), pointer :: spp_wts_sfc (:,:) => null() ! spp-sfc-perts
real (kind=kind_phys), pointer :: spp_wts_mp (:,:) => null() ! spp-mp-perts
real (kind=kind_phys), pointer :: spp_wts_gwd (:,:) => null() ! spp-gwd-perts
real (kind=kind_phys), pointer :: spp_wts_rad (:,:) => null() ! spp-rad-perts

!--- aerosol surface emissions for Thompson microphysics
real (kind=kind_phys), pointer :: nwfa2d (:) => null() !< instantaneous water-friendly sfc aerosol source
Expand Down Expand Up @@ -1174,6 +1179,16 @@ module GFS_typedefs
! multiple patterns. It wasn't fully coded (and wouldn't have worked
! with nlndp>1, so I just dropped it). If we want to code it properly,
! we'd need to make this dim(6,5).
logical :: do_spp ! Overall flag to turn on SPP or not
integer :: spp_pbl
integer :: spp_sfc
integer :: spp_mp
integer :: spp_rad
integer :: spp_gwd
integer :: n_var_spp
character(len=3) , pointer :: spp_var_list(:) ! dimension here must match n_var_spp in stochy_nml_def
real(kind=kind_phys), pointer :: spp_prt_list(:) ! dimension here must match n_var_spp in stochy_nml_def

!--- tracer handling
character(len=32), pointer :: tracer_names(:) !< array of initialized tracers from dynamic core
integer :: ntrac !< number of tracers
Expand Down Expand Up @@ -2990,12 +3005,26 @@ subroutine coupling_create (Coupling, IM, Model)
Coupling%skebu_wts = clear_val
Coupling%skebv_wts = clear_val
endif

!--- stochastic land perturbation option
if (Model%lndp_type /= 0) then
allocate (Coupling%sfc_wts (IM,Model%n_var_lndp))
Coupling%sfc_wts = clear_val
endif

!--- stochastic spp perturbation option
if (Model%do_spp) then
allocate (Coupling%spp_wts_pbl (IM,Model%levs))
Coupling%spp_wts_pbl = clear_val
allocate (Coupling%spp_wts_sfc (IM,Model%levs))
Coupling%spp_wts_sfc = clear_val
allocate (Coupling%spp_wts_mp (IM,Model%levs))
Coupling%spp_wts_mp = clear_val
allocate (Coupling%spp_wts_gwd (IM,Model%levs))
Coupling%spp_wts_gwd = clear_val
allocate (Coupling%spp_wts_rad (IM,Model%levs))
Coupling%spp_wts_rad = clear_val
endif

!--- needed for Thompson's aerosol option
if(Model%imp_physics == Model%imp_physics_thompson .and. Model%ltaerosol) then
Expand Down Expand Up @@ -3558,6 +3587,13 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
integer :: lndp_type = 0
integer :: n_var_lndp = 0
logical :: lndp_each_step = .false.
integer :: n_var_spp = 0
integer :: spp_pbl = 0
integer :: spp_sfc = 0
integer :: spp_mp = 0
integer :: spp_rad = 0
integer :: spp_gwd = 0
logical :: do_spp = .false.

!--- aerosol scavenging factors
integer, parameter :: max_scav_factors = 25
Expand Down Expand Up @@ -3647,6 +3683,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
cs_parm, flgmin, cgwf, ccwf, cdmbgwd, sup, ctei_rm, crtrh, &
dlqf, rbcr, shoc_parm, psauras, prauras, wminras, &
do_sppt, do_shum, do_skeb, &
do_spp, n_var_spp, &
lndp_type, n_var_lndp, lndp_each_step, &
pert_mp,pert_clds,pert_radtend, &
!--- Rayleigh friction
Expand Down Expand Up @@ -4438,12 +4475,23 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%lndp_type = lndp_type
Model%n_var_lndp = n_var_lndp
Model%lndp_each_step = lndp_each_step
Model%do_spp = do_spp
Model%n_var_spp = n_var_spp

if (Model%lndp_type/=0) then
allocate(Model%lndp_var_list(Model%n_var_lndp))
allocate(Model%lndp_prt_list(Model%n_var_lndp))
Model%lndp_var_list(:) = ''
Model%lndp_prt_list(:) = clear_val
end if

if (Model%do_spp) then
allocate(Model%spp_var_list(Model%n_var_spp))
allocate(Model%spp_prt_list(Model%n_var_spp))
Model%spp_var_list(:) = ''
Model%spp_prt_list(:) = clear_val
end if

!--- cellular automata options
! force namelist constsitency
allocate(Model%vfact_ca(levs))
Expand Down Expand Up @@ -5873,6 +5921,8 @@ subroutine control_print(Model)
print *, ' lndp_type : ', Model%lndp_type
print *, ' n_var_lndp : ', Model%n_var_lndp
print *, ' lndp_each_step : ', Model%lndp_each_step
print *, ' do_spp : ', Model%do_spp
print *, ' n_var_spp : ', Model%n_var_spp
print *, ' '
print *, 'cellular automata'
print *, ' nca : ', Model%nca
Expand Down
98 changes: 97 additions & 1 deletion ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -2244,10 +2244,50 @@
type = real
kind = kind_phys
active = (flag_for_stochastic_skeb_option)
[spp_wts_pbl]
standard_name = spp_weights_for_pbl_scheme
long_name = spp weights for pbl scheme
units = 1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (do_stochastically_perturbed_parameterizations)
[spp_wts_sfc]
standard_name = spp_weights_for_surface_layer_scheme
long_name = spp weights for surface layer scheme
units = 1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (do_stochastically_perturbed_parameterizations)
[spp_wts_mp]
standard_name = spp_weights_for_microphysics_scheme
long_name = spp weights for microphysics scheme
units = 1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (do_stochastically_perturbed_parameterizations)
[spp_wts_gwd]
standard_name = spp_weights_for_gravity_wave_drag_scheme
long_name = spp weights for gravity wave drag scheme
units = 1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (do_stochastically_perturbed_parameterizations)
[spp_wts_rad]
standard_name = spp_weights_for_radiation_scheme
long_name = spp weights for radiation scheme
units = 1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (do_stochastically_perturbed_parameterizations)
[sfc_wts]
standard_name = surface_stochastic_weights_from_coupled_process
long_name = weights for stochastic surface physics perturbation
units = none
units = 1
dimensions = (horizontal_loop_extent,number_of_perturbed_land_surface_variables)
type = real
kind = kind_phys
Expand Down Expand Up @@ -4610,6 +4650,12 @@
units = flag
dimensions = ()
type = logical
[do_spp]
standard_name = do_stochastically_perturbed_parameterizations
long_name = flag for stochastic spp option
units = flag
dimensions = ()
type = logical
[lndp_type]
standard_name = control_for_stochastic_land_surface_perturbation
long_name = index for stochastic land surface perturbations type
Expand Down Expand Up @@ -4638,6 +4684,56 @@
type = character
kind = len=3
active = (control_for_stochastic_land_surface_perturbation /= 0)
[n_var_spp]
standard_name = number_of_perturbed_spp_schemes
long_name = number of perturbed spp schemes
units = count
dimensions = ()
type = integer
[spp_prt_list]
standard_name =magnitude_of_spp_perturbations
long_name = magnitude of spp perturbations
units = 1
dimensions = (number_of_spp_schemes_perturbed)
type = real
kind = kind_phys
[spp_var_list]
standard_name = perturbed_spp_schemes
long_name = perturbed spp schemes
units = none
dimensions = (number_of_spp_schemes_perturbed)
type = character
kind = len=3
[spp_pbl]
standard_name = control_for_pbl_spp_perturbations
long_name = control for pbl spp perturbations
units = count
dimensions = ()
type = integer
[spp_sfc]
standard_name = control_for_surface_layer_spp_perturbations
long_name = control for surface layer spp perturbations
units = count
dimensions = ()
type = integer
[spp_mp]
standard_name = control_for_microphysics_spp_perturbations
long_name = control for microphysics spp perturbations
units = count
dimensions = ()
type = integer
[spp_rad]
standard_name = control_for_radiation_spp_perturbations
long_name = control for radiation spp perturbations
units = count
dimensions = ()
type = integer
[spp_gwd]
standard_name = control_for_gravity_wave_drag_spp_perturbations
long_name = control for gravity wave drag spp perturbations
units = count
dimensions = ()
type = integer
[ntrac]
standard_name = number_of_tracers
long_name = number of tracers
Expand Down
65 changes: 65 additions & 0 deletions ccpp/driver/GFS_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2296,6 +2296,71 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop
enddo
endif

if (Model%do_spp) then
idx = idx + 1
ExtDiag(idx)%axes = 3
ExtDiag(idx)%name = 'spp_wts_pbl'
ExtDiag(idx)%desc = 'spp pbl perturbation wts'
ExtDiag(idx)%unit = 'm/s'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%spp_wts_pbl(:,:)
enddo
JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
endif

if (Model%do_spp) then
idx = idx + 1
ExtDiag(idx)%axes = 3
ExtDiag(idx)%name = 'spp_wts_sfc'
ExtDiag(idx)%desc = 'spp sfc perturbation wts'
ExtDiag(idx)%unit = 'm/s'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%spp_wts_sfc(:,:)
enddo
endif

if (Model%do_spp) then
idx = idx + 1
ExtDiag(idx)%axes = 3
ExtDiag(idx)%name = 'spp_wts_mp'
ExtDiag(idx)%desc = 'spp mp perturbation wts'
ExtDiag(idx)%unit = 'm/s'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%spp_wts_mp(:,:)
enddo
endif

if (Model%do_spp) then
idx = idx + 1
ExtDiag(idx)%axes = 3
ExtDiag(idx)%name = 'spp_wts_gwd'
ExtDiag(idx)%desc = 'spp gwd perturbation wts'
ExtDiag(idx)%unit = 'm/s'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%spp_wts_gwd(:,:)
enddo
endif

if (Model%do_spp) then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future cleanup. All these individual if (Model%do_spp) then blocks could be combined into one.

idx = idx + 1
ExtDiag(idx)%axes = 3
ExtDiag(idx)%name = 'spp_wts_rad'
ExtDiag(idx)%desc = 'spp rad perturbation wts'
ExtDiag(idx)%unit = 'm/s'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%spp_wts_rad(:,:)
enddo
endif

if (Model%lndp_type /= 0) then
idx = idx + 1
ExtDiag(idx)%axes = 2
Expand Down
Loading