Skip to content

Commit

Permalink
Fix uninitialized min_rand variable in Thompson MP when using SPP (NC…
Browse files Browse the repository at this point in the history
…AR#516)

* Pass SPP namelist entries outside of stochastic physics routines.

* Fixes to SPP metadata

* Add active attribute to spp_prt_list

* Add active metadata flag to spp_stddev_cutoff

* Add active metadata flag for spp_var_list
  • Loading branch information
JeffBeck-NOAA committed Apr 20, 2022
1 parent bffbeeb commit 70cafa6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@ module GFS_typedefs
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
real(kind=kind_phys), pointer :: spp_stddev_cutoff(:) ! 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
Expand Down Expand Up @@ -4150,8 +4151,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
if (Model%do_spp) then
allocate(Model%spp_var_list(Model%n_var_spp))
allocate(Model%spp_prt_list(Model%n_var_spp))
allocate(Model%spp_stddev_cutoff(Model%n_var_spp))
Model%spp_var_list(:) = ''
Model%spp_prt_list(:) = clear_val
Model%spp_stddev_cutoff(:) = clear_val
end if

!--- cellular automata options
Expand Down
16 changes: 13 additions & 3 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -4858,19 +4858,29 @@
dimensions = ()
type = integer
[spp_prt_list]
standard_name =magnitude_of_spp_perturbations
standard_name = magnitude_of_spp_perturbations
long_name = magnitude of spp perturbations
units = 1
dimensions = (number_of_spp_schemes_perturbed)
dimensions = (number_of_perturbed_spp_schemes)
type = real
kind = kind_phys
active = (do_stochastically_perturbed_parameterizations)
[spp_stddev_cutoff]
standard_name = magnitude_of_spp_standard_deviation_cutoff
long_name = magnitude of spp standard deviation cutoff
units = 1
dimensions = (number_of_perturbed_spp_schemes)
type = real
kind = kind_phys
active = (do_stochastically_perturbed_parameterizations)
[spp_var_list]
standard_name = perturbed_spp_schemes
long_name = perturbed spp schemes
units = none
dimensions = (number_of_spp_schemes_perturbed)
dimensions = (number_of_perturbed_spp_schemes)
type = character
kind = len=3
active = (do_stochastically_perturbed_parameterizations)
[spp_pbl]
standard_name = control_for_pbl_spp_perturbations
long_name = control for pbl spp perturbations
Expand Down
2 changes: 1 addition & 1 deletion ccpp/physics
2 changes: 1 addition & 1 deletion stochastic_physics/stochastic_physics_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ subroutine stochastic_physics_wrapper (GFS_Control, GFS_Data, Atm_block, ierr)
GFS_Control%input_nml_file, GFS_Control%fn_nml, GFS_Control%nlunit, xlon, xlat, GFS_Control%do_sppt, GFS_Control%do_shum, &
GFS_Control%do_skeb, GFS_Control%lndp_type, GFS_Control%n_var_lndp, GFS_Control%use_zmtnblck, GFS_Control%skeb_npass, &
GFS_Control%lndp_var_list, GFS_Control%lndp_prt_list, &
GFS_Control%n_var_spp, GFS_Control%spp_var_list, GFS_Control%spp_prt_list, GFS_Control%do_spp, &
GFS_Control%n_var_spp, GFS_Control%spp_var_list, GFS_Control%spp_prt_list, GFS_Control%spp_stddev_cutoff, GFS_Control%do_spp, &
GFS_Control%ak, GFS_Control%bk, nthreads, GFS_Control%master, GFS_Control%communicator, ierr)
if (ierr/=0) then
write(6,*) 'call to init_stochastic_physics failed'
Expand Down

0 comments on commit 70cafa6

Please sign in to comment.