Skip to content

Commit

Permalink
Debugging wsm6 mmm output
Browse files Browse the repository at this point in the history
  • Loading branch information
scrasmussen committed Jul 14, 2024
1 parent 915d2a1 commit 7446f79
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 10 deletions.
56 changes: 54 additions & 2 deletions scm/src/CCPP_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,10 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model)
end if
!
! Allocate arrays that are conditional on physics choices
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson &
if (Model%imp_physics == Model%imp_physics_gfdl &
.or. Model%imp_physics == Model%imp_physics_thompson &
.or. Model%imp_physics == Model%imp_physics_nssl &
.or. Model%imp_physics == Model%imp_physics_wsm6_mmm &
) then
allocate (Interstitial%graupelmp (IM))
allocate (Interstitial%icemp (IM))
Expand Down Expand Up @@ -918,6 +920,12 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model)
elseif (Model%imp_physics == Model%imp_physics_wsm6) then
Interstitial%nvdiff = Model%ntrac -3
if (Model%satmedmf) Interstitial%nvdiff = Interstitial%nvdiff + 1

elseif (Model%imp_physics == Model%imp_physics_wsm6_mmm) then
Interstitial%nvdiff = 7 ! tracers.txt num - 1 ?? TODO: Double check this
! Interstitial%nvdiff = Model%ntrac -3
! if (Model%satmedmf) Interstitial%nvdiff = Interstitial%nvdiff + 1

elseif (Model%ntclamt > 0) then ! for GFDL MP don't diffuse cloud amount
Interstitial%nvdiff = Model%ntrac - 1
endif
Expand All @@ -944,6 +952,48 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model)
if (Model%imp_physics == Model%imp_physics_wsm6) then
Interstitial%ntcwx = 2
Interstitial%ntiwx = 3
elseif (Model%imp_physics == Model%imp_physics_wsm6_mmm) then
! --- TRACER FILE ---
! "sphum","water_vapor_specific_humidity","kg kg-1"
! "liq_wat","cloud_condensed_water_mixing_ratio","kg kg-1"
! "ice_wat","ice_water_mixing_ratio","kg kg-1"
! "rainwat","rain_water_mixing_ratio","kg kg-1"
! "snowwat","snow_water_mixing_ratio","kg kg-1"
! "graupel","graupel_mixing_ratio","kg kg-1"
! "o3mr","ozone_mixing_ratio","kg kg-1"
! "sgs_tke","turbulent_kinetic_energy","m2 s-2"

! TODO: remove after debugging
! "Tracer file variabel","name","units"
! save variable?
! save index name?

! "liq_wat","cloud_condensed_water_mixing_ratio","kg kg-1"
! [save_q(:,:,index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array)]
! index_for_liquid_cloud_condensate_vertical_diffusion_tracer
Interstitial%ntcwx = 2

! "ice_wat","ice_water_mixing_ratio","kg kg-1"
! index_for_ice_cloud_condensate_vertical_diffusion_tracer
Interstitial%ntiwx = 3

! "rainwat","rain_water_mixing_ratio","kg kg-1"
! index_for_rain_water_vertical_diffusion_tracer
Interstitial%ntrwx = 4

! "snowwat","snow_water_mixing_ratio","kg kg-1"
! [save_q(:,:,index_of_snow_mixing_ratio_in_tracer_concentration_array)]
! snow_mixing_ratio_save

! "graupel","graupel_mixing_ratio","kg kg-1"
! ???

! "o3mr","ozone_mixing_ratio","kg kg-1"
! [save_q(:,:,index_of_ozone_mixing_ratio_in_tracer_concentration_array)]

! "sgs_tke","turbulent_kinetic_energy","m2 s-2"
! [save_q(:,:,index_of_turbulent_kinetic_energy_in_tracer_concentration_array)]

elseif (Model%imp_physics == Model%imp_physics_thompson) then
Interstitial%ntcwx = 2
Interstitial%ntiwx = 3
Expand Down Expand Up @@ -1401,8 +1451,10 @@ subroutine gfs_interstitial_phys_reset (Interstitial, Model)
end if
!
! Reset fields that are conditional on physics choices
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson &
if (Model%imp_physics == Model%imp_physics_gfdl &
.or. Model%imp_physics == Model%imp_physics_thompson &
.or. Model%imp_physics == Model%imp_physics_nssl &
.or. Model%imp_physics == Model%imp_physics_wsm6_mmm &
) then
Interstitial%graupelmp = clear_val
Interstitial%icemp = clear_val
Expand Down
59 changes: 59 additions & 0 deletions scm/src/CCPP_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,65 @@
dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
[clouds(:,:,10)]
standard_name = cloud_condensed_water_effective_radius
long_name = cloud condensed water effective radius
units = m
dimensions = (horizontal_begin:horizontal_end,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
[clouds(:,:,11)]
standard_name = ice_water_effective_radius
long_name = ice water effective radius
units = m
dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation)
# (horizontal_begin:horizontal_end,vertical_layer_dimension)
type = real
kind = kind_phys
[clouds(:,:,12)]
standard_name = snow_effective_radius
long_name = snow effective radius
units = m
dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
[re_qc_bg]
standard_name = background_cloud_condensed_water_effective_radius
long_name = background cloud condensed water effective radius
units = m
dimensions = ()
type = real | kind = kind_phys
intent = in
[re_qi_bg]
standard_name = background_ice_water_effective_radius
long_name = background ice water effective radius
units = m
dimensions = ()
type = real | kind = kind_phys
[re_qs_bg]
standard_name = background_snow_effective_radius
long_name = background snow effective radius
units = m
dimensions = ()
type = real | kind = kind_phys
[re_qc_max]
standard_name = maximum_cloud_condensed_water_effective_radius
long_name = maximum cloud condensed water effective radius
units = m
dimensions = ()
type = real | kind = kind_phys
[re_qi_max]
standard_name = maximum_ice_water_effective_radius
long_name = maximum ice water effective radius
units = m
dimensions = ()
type = real | kind = kind_phys
[re_qs_max]
standard_name = maximum_snow_effective_radius
long_name = maximum snow effective radius
units = m
dimensions = ()
type = real | kind = kind_phys
[clw]
standard_name = convective_transportable_tracers
long_name = array to contain cloud water and other convective trans. tracers
Expand Down
27 changes: 25 additions & 2 deletions scm/src/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6100,7 +6100,28 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!if (Model%me == Model%master) print *,' Using wsm6 microphysics'

elseif (Model%imp_physics == Model%imp_physics_wsm6_mmm) then !WSM6 MMM microphysics
if (Model%me == Model%master) print *,' Using WSM6 MMM microphysics'
Model%npdf3d = 0
Model%num_p3d = 3
Model%num_p2d = 1
Model%pdfcld = .false.
Model%shcnvcw = .false.
Model%nleffr = 1
Model%nieffr = 2
Model%nseffr = 3
if (Model%me == Model%master) &
print *,' Using WSM6 MMM microphysics', &
' ltaerosol = ',Model%ltaerosol, &
' mraerosol = ',Model%mraerosol, &
' ttendlim =',Model%ttendlim, &
' ext_diag_thompson =',Model%ext_diag_thompson, &
' dt_inner =',Model%dt_inner, &
' sedi_semi=',Model%sedi_semi, &
' decfl=',decfl, &
' effr_in =',Model%effr_in, &
' lradar =',Model%lradar, &
' nsfullradar_diag =',Model%nsfullradar_diag, &
' num_p3d =',Model%num_p3d, &
' num_p2d =',Model%num_p2d

elseif (Model%imp_physics == Model%imp_physics_nssl) then !NSSL microphysics
Model%npdf3d = 0
Expand Down Expand Up @@ -6690,7 +6711,9 @@ subroutine control_print(Model)
print *, ' wminco : ', Model%wminco
print *, ' '
endif
if (Model%imp_physics == Model%imp_physics_wsm6 .or. Model%imp_physics == Model%imp_physics_thompson) then
if (Model%imp_physics == Model%imp_physics_wsm6 .or. &
Model%imp_physics == Model%imp_physics_thompson .or. &
Model%imp_physics == Model%imp_physics_wsm6_mmm) then
print *, ' Thompson microphysical parameters'
print *, ' ltaerosol : ', Model%ltaerosol
print *, ' mraerosol : ', Model%mraerosol
Expand Down
10 changes: 8 additions & 2 deletions scm/src/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -2883,7 +2883,7 @@
active = (flag_for_surface_flux_coupling .and. do_mediator_atmosphere_ocean_fluxes)
[sncovr1_lnd]
standard_name = surface_snow_area_fraction_over_land_from_land
long_name = surface snow area fraction over land for coupling
long_name = surface snow area fraction over land for coupling
units = frac
dimensions = (horizontal_loop_extent)
type = real
Expand Down Expand Up @@ -4271,6 +4271,12 @@
units = flag
dimensions = ()
type = integer
[imp_physics_wsm6_mmm]
standard_name = identifier_for_wsm6_mmm_microphysics_scheme
long_name = choice of WSM6 MMM microphysics scheme
units = flag
dimensions = ()
type = integer
[imp_physics_zhao_carr]
standard_name = identifier_for_zhao_carr_microphysics_scheme
long_name = choice of Zhao-Carr microphysics scheme
Expand Down Expand Up @@ -6699,7 +6705,7 @@
dimensions = ()
type = integer
[num_p2d]
standard_name = number_of_microphysics_varaibles_in_xy_dimensioned_restart_array
standard_name = number_of_microphysics_variables_in_xy_dimensioned_restart_array
long_name = number of 2D arrays needed for microphysics
units = count
dimensions = ()
Expand Down
17 changes: 15 additions & 2 deletions scm/src/scm_output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,29 @@ subroutine output_append_state(ncid, scm_state, physics)
call NetCDF_put_var(ncid, "v", scm_state%state_v(:,:,1), scm_state%itt_out)
call NetCDF_put_var(ncid, "ql", scm_state%state_tracer(:,:,scm_state%cloud_water_index,1), scm_state%itt_out)
call NetCDF_put_var(ncid, "qi", scm_state%state_tracer(:,:,scm_state%cloud_ice_index,1), scm_state%itt_out)

! print*, "DO MYNNEDMF", physics%model%do_mynnedmf
! ! IT IS TRUE
! print*, "TRACER", scm_state%state_tracer(:,:,scm_state%cloud_water_index,1)
! print*, "WATER INDEX", scm_state%cloud_water_index
! error stop "HIHI"
if (physics%model%do_mynnedmf) then
call NetCDF_put_var(ncid, "qc", scm_state%state_tracer(:,:,scm_state%cloud_water_index,1) + &
print*, "CLOUD WATER INDEX =", scm_state%state_tracer(1:4,1:4,scm_state%cloud_water_index,1)
print*, "CLOUD ICE INDEX =", scm_state%state_tracer(1:4,1:4,scm_state%cloud_ice_index,1)
print *, "--- FOOBAR RUNNING THIS OVER THERE -----------" ! THIS IS BEING RUN
print *, "cloud water index =", scm_state%cloud_water_index
print *, "cloud ice index =", scm_state%cloud_ice_index

call NetCDF_put_var(ncid, "qc", scm_state%state_tracer(:,:,scm_state%cloud_water_index,1) + &
scm_state%state_tracer(:,:,scm_state%cloud_ice_index,1) + &
physics%Tbd%QC_BL(:,:), scm_state%itt_out)
else
print *, "--- RUNNING THIS HERE -----------"
call NetCDF_put_var(ncid, "qc", scm_state%state_tracer(:,:,scm_state%cloud_water_index,1) + &
scm_state%state_tracer(:,:,scm_state%cloud_ice_index,1), &
scm_state%itt_out)
endif

! error stop "STOP AFTERT QC WRITE"
end subroutine output_append_state

subroutine output_append_forcing(ncid, scm_state)
Expand Down
2 changes: 1 addition & 1 deletion scm/src/suite_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def timestep(self, value):
suite_list.append(suite('SCM_GFS_v17_p8', 'tracers_GFS_v17_p8.txt', 'input_GFS_v17_p8.nml', 600.0, 600.0, True ))
suite_list.append(suite('SCM_GFS_v17_HR3', 'tracers_GFS_v17_p8.txt', 'input_GFS_v17_HR3.nml', 600.0, 600.0, True ))
suite_list.append(suite('SCM_RAP', 'tracers_RAP.txt', 'input_RAP.nml', 600.0, 600.0 , True ))
suite_list.append(suite('SCM_RAP_wsm6', 'tracers_RAP.txt', 'input_RAP_wsm6.nml', 600.0, 600.0 , False ))
suite_list.append(suite('SCM_RAP_wsm6', 'tracers_RAP_wsm6.txt', 'input_RAP_wsm6.nml', 600.0, 600.0 , False))
suite_list.append(suite('SCM_RRFS_v1beta', 'tracers_RRFS_v1beta.txt', 'input_RRFS_v1beta.nml', 600.0, 600.0 , True ))
suite_list.append(suite('SCM_WoFS_v0', 'tracers_WoFS_v0.txt', 'input_WoFS_v0.nml', 600.0, 600.0 , True ))
suite_list.append(suite('SCM_HRRR', 'tracers_HRRR.txt', 'input_HRRR.nml', 600.0, 600.0 , True ))
Expand Down

0 comments on commit 7446f79

Please sign in to comment.