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

FV3 changes for refactored ozone physics scheme #661

Merged
merged 35 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f5b37af
FV3 changes for refactored ozone physics scheme
May 25, 2023
e25b1c7
Remove change to metadata (Not relevant for PR)
May 26, 2023
96542b2
Update physics
Jun 8, 2023
2ca6f33
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into fea…
Jun 8, 2023
8a6eefe
Update physics
Jun 12, 2023
a5ecd38
Merge branch 'feature_reorg_ozphys' of https://github.com/dustinswale…
Jun 12, 2023
f066fd7
Split ozone physics into time_vary and run components
Aug 1, 2023
2f78f32
Change submodule
Aug 1, 2023
3c6308c
Sync physics
dustinswales Aug 2, 2023
db0aa55
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into HEAD
dustinswales Aug 2, 2023
2d352b1
Some cleanup. Now working
dustinswales Aug 2, 2023
b0bd401
Address reviewers comments
dustinswales Aug 2, 2023
f3a5882
More reorganization.
dustinswales Aug 10, 2023
9938c37
Synced physics
Sep 6, 2023
6966159
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into HEAD
Sep 6, 2023
c5b16fc
Merge branch 'feature_reorg_ozphys' of https://github.com/dustinswale…
Sep 6, 2023
05852bd
Renamed file. Update SDFs
Sep 6, 2023
8e8f698
Getting real close...
Sep 27, 2023
4ab16ee
SDF cleanup. physics updates
Sep 27, 2023
ff67b40
Omission from previous commit
Sep 27, 2023
8fd6b28
Some polishing. Merge 2006 ozone into module_ozphys
Sep 28, 2023
5f84695
Update physics wiht ufs-community
dustinswales Sep 28, 2023
7dfee39
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into HEAD
dustinswales Sep 28, 2023
53ee700
Added documentation
dustinswales Sep 28, 2023
fb821e6
Some more cleanup
dustinswales Oct 12, 2023
05f6788
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into HEAD
dustinswales Oct 12, 2023
18206e7
Final cleanup
dustinswales Oct 12, 2023
5f14225
Omission from previous commit
dustinswales Oct 12, 2023
10ce057
Update ccpp-framework hash
dustinswales Oct 27, 2023
dc30cf1
Update ccpp-physics
dustinswales Oct 27, 2023
039eaec
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into HEAD
dustinswales Oct 27, 2023
e045e7e
Reverted standard_name change
dustinswales Oct 27, 2023
1cf4cc5
Merge branch 'develop' of https://github.com/NOAA-EMC/fv3atm into HEAD
dustinswales Nov 1, 2023
1f2eafd
Missed changes needed to SDF.
dustinswales Nov 1, 2023
af844cb
revert submodules
dustinswales Nov 2, 2023
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
12 changes: 7 additions & 5 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
'physics/physics/radsw_param.f',
'physics/physics/radlw_param.f',
'physics/physics/h2o_def.f',
'physics/physics/ozne_def.f',
'physics/physics/radiation_surface.f',
'physics/physics/module_ozphys.F90',
'data/CCPP_typedefs.F90',
'data/GFS_typedefs.F90',
'data/CCPP_data.F90',
Expand All @@ -41,6 +41,10 @@
'module_radlw_parameters' : {
'module_radlw_parameters' : '',
},
'module_ozphys' : {
'module_ozphys' : '',
'ty_ozphys' : '',
},
'CCPP_typedefs' : {
'GFS_interstitial_type' : 'GFS_Interstitial(cdata%thrd_no)',
'GFDL_interstitial_type' : 'GFDL_interstitial',
Expand Down Expand Up @@ -105,6 +109,7 @@
'physics/physics/GFS_surface_loop_control_part1.F90',
'physics/physics/GFS_surface_loop_control_part2.F90',
'physics/physics/GFS_time_vary_pre.fv3.F90',
'physics/physics/GFS_physics_post.F90',
'physics/physics/cires_ugwp.F90',
'physics/physics/cires_ugwp_post.F90',
'physics/physics/unified_ugwp.F90',
Expand Down Expand Up @@ -162,11 +167,8 @@
'physics/physics/mp_thompson_pre.F90',
'physics/physics/mp_thompson.F90',
'physics/physics/mp_thompson_post.F90',
'physics/physics/mp_nssl.F90' ,
'physics/physics/ozphys.f',
'physics/physics/ozphys_2015.f',
'physics/physics/mp_nssl.F90',
'physics/physics/zhaocarr_precpd.f',
'physics/physics/phys_tend.F90',
'physics/physics/radlw_main.F90',
'physics/physics/radsw_main.F90',
'physics/physics/rascnv.F90',
Expand Down
3 changes: 1 addition & 2 deletions ccpp/data/CCPP_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module CCPP_typedefs
use machine, only: kind_grid, kind_dyn, kind_phys

! Constants/dimensions needed for interstitial DDTs
use ozne_def, only: oz_coeff
use GFS_typedefs, only: clear_val, LTP

! Physics type defininitions needed for interstitial DDTs
Expand Down Expand Up @@ -881,7 +880,7 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model)
Interstitial%nf_albd = NF_ALBD
Interstitial%nspc1 = NSPC1
if (Model%oz_phys .or. Model%oz_phys_2015) then
Interstitial%oz_coeffp5 = oz_coeff+5
Interstitial%oz_coeffp5 = Model%oz_coeff+5
else
Interstitial%oz_coeffp5 = 5
endif
Expand Down
2 changes: 1 addition & 1 deletion ccpp/data/CCPP_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -3187,7 +3187,7 @@
name = CCPP_typedefs
type = module
relative_path = ../physics/physics
dependencies = machine.F,ozne_def.f,radlw_param.f,radsw_param.f
dependencies = machine.F,radlw_param.f,radsw_param.f
dependencies = rte-rrtmgp/rrtmgp/mo_gas_optics_rrtmgp.F90,rte-rrtmgp/rte/mo_optical_props.F90
dependencies = rte-rrtmgp/extensions/cloud_optics/mo_cloud_optics.F90
dependencies = rte-rrtmgp/rrtmgp/mo_gas_concentrations.F90,rte-rrtmgp/rte/mo_rte_config.F90
Expand Down
86 changes: 55 additions & 31 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ module GFS_typedefs
con_csol, con_epsqs, con_rocp, con_rog, &
con_omega, con_rerth, con_psat, karman, rainmin,&
con_c, con_plnk, con_boltz, con_solr_2008, &
con_solr_2002, con_thgni
con_solr_2002, con_thgni, con_1ovg

use module_radsw_parameters, only: topfsw_type, sfcfsw_type
use module_radlw_parameters, only: topflw_type, sfcflw_type
use ozne_def, only: levozp, oz_coeff
use h2o_def, only: levh2o, h2o_coeff
use module_ozphys, only: ty_ozphys

implicit none

Expand Down Expand Up @@ -1113,8 +1113,6 @@ module GFS_typedefs
logical :: shocaftcnv !< flag for SHOC
logical :: shoc_cld !< flag for clouds
logical :: uni_cld !< flag for clouds in grrad
logical :: oz_phys !< flag for old (2006) ozone physics
logical :: oz_phys_2015 !< flag for new (2015) ozone physics
logical :: h2o_phys !< flag for stratosphere h2o
logical :: pdfcld !< flag for pdfcld
logical :: shcnvcw !< flag for shallow convective cloud
Expand Down Expand Up @@ -1567,6 +1565,13 @@ module GFS_typedefs
!--- lightning threat and diagsnostics
logical :: lightning_threat !< report lightning threat indices

!--- NRL Ozone physics
logical :: oz_phys !< Flag for old (2006) ozone physics
logical :: oz_phys_2015 !< Flag for new (2015) ozone physics
type(ty_ozphys) :: ozphys !< DDT with data needed by ozone physics
integer :: levozp !< Number of vertical layers in ozone forcing data
integer :: oz_coeff !< Number of coefficients in ozone forcing data

contains
procedure :: init => control_initialize
procedure :: init_chemistry => control_chemistry_initialize
Expand Down Expand Up @@ -1790,7 +1795,7 @@ module GFS_typedefs
!--- In/Out (???) (physics only)
real (kind=kind_phys), pointer :: swhc (:,:) => null() !< clear sky sw heating rates ( k/s )
real (kind=kind_phys), pointer :: lwhc (:,:) => null() !< clear sky lw heating rates ( k/s )
real (kind=kind_phys), pointer :: lwhd (:,:,:) => null() !< idea sky lw heating rates ( k/s )
real (kind=kind_phys), pointer :: lwhd (:,:,:) => null() !< idea sky lw heating rates ( k/s ) !DJS2023 THIS IS NOT USED. IT IS REFERENCED, BUT NEVER SET?

contains
procedure :: create => radtend_create !< allocate array data
Expand Down Expand Up @@ -2098,6 +2103,12 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: ltg2_max(:) => null() !
real (kind=kind_phys), pointer :: ltg3_max(:) => null() !

!--- NRL Ozone physics diagnostics
real (kind=kind_phys), pointer :: do3_dt_prd(:,:) => null()
real (kind=kind_phys), pointer :: do3_dt_ozmx(:,:) => null()
real (kind=kind_phys), pointer :: do3_dt_temp(:,:) => null()
real (kind=kind_phys), pointer :: do3_dt_ohoz(:,:) => null()

contains
procedure :: create => diag_create
procedure :: rad_zero => diag_rad_zero
Expand Down Expand Up @@ -3549,8 +3560,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: do_shoc = .false. !< flag for SHOC
logical :: shocaftcnv = .false. !< flag for SHOC
logical :: shoc_cld = .false. !< flag for SHOC in grrad
logical :: oz_phys = .true. !< flag for old (2006) ozone physics
logical :: oz_phys_2015 = .false. !< flag for new (2015) ozone physics
logical :: h2o_phys = .false. !< flag for stratosphere h2o
logical :: pdfcld = .false. !< flag for pdfcld
logical :: shcnvcw = .false. !< flag for shallow convective cloud
Expand Down Expand Up @@ -3833,6 +3842,12 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!-- Lightning threat index
logical :: lightning_threat = .false.

!--- NRL Ozone physics
logical :: oz_phys = .false. !< Flag for old (2006) ozone physics
logical :: oz_phys_2015 = .true. !< Flag for new (2015) ozone physics
integer :: kozpl = 28 !< File identifier for ozone forcing data
integer :: kozc = 48 !< File identifier for ozone climotology data

!--- aerosol scavenging factors
integer, parameter :: max_scav_factors = 183
character(len=40) :: fscav_aero(max_scav_factors)
Expand Down Expand Up @@ -4007,6 +4022,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
character(len=20) :: namestr
character(len=44) :: descstr

!--- NRL ozone physics
character(len=128) :: err_message

! dtend selection: default is to match all variables:
dtend_select(1)='*'
do ipat=2,pat_count
Expand Down Expand Up @@ -5391,29 +5409,23 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

ENDIF !}

! To ensure that these values match what's in the physics,
! array sizes are compared during model init in GFS_phys_time_vary_init()
!
! from module ozinterp
if (Model%ntoz>0) then
if (Model%oz_phys) then
levozp = 80
oz_coeff = 4
else if (Model%oz_phys_2015) then
levozp = 53
oz_coeff = 6
else
write(*,*) 'Logic error, ntoz>0 but no ozone physics selected'
stop
end if
!--- NRL ozone physics
if (Model%ntoz > 0) then
dustinswales marked this conversation as resolved.
Show resolved Hide resolved
! Load data for ozone physics into DDT ozphys
err_message = Model%ozphys%load_o3prog('global_o3prdlos.f77',kozpl)
Model%levozp = Model%ozphys%nlev
Model%oz_coeff = Model%ozphys%ncf

if (Model%me == Model%master) then
write(*,*) 'Reading in o3data from global_o3prdlos.f77 '
write(*,*) ' oz_coeff = ', Model%ozphys%ncf
write(*,*) ' latsozp = ', Model%ozphys%nlat
write(*,*) ' levozp = ', Model%ozphys%nlev
write(*,*) ' timeoz = ', Model%ozphys%ntime
endif
else
if (Model%oz_phys .or. Model%oz_phys_2015) then
write(*,*) 'Logic error, ozone physics are selected, but ntoz<=0'
stop
else
levozp = 1
oz_coeff = 1
end if
!--- Climatological ozone
err_message = Model%ozphys%load_o3clim('global_o3prdlos.f77',kozc)
end if
dustinswales marked this conversation as resolved.
Show resolved Hide resolved

!--- quantities to be used to derive phy_f*d totals
Expand Down Expand Up @@ -6941,10 +6953,10 @@ subroutine tbd_create (Tbd, IM, Model)
endif

!--- ozone and stratosphere h2o needs
allocate (Tbd%ozpl (IM,levozp,oz_coeff))
allocate (Tbd%ozpl (IM,Model%levozp,Model%oz_coeff))
allocate (Tbd%h2opl (IM,levh2o,h2o_coeff))
Tbd%ozpl = clear_val
Tbd%h2opl = clear_val
Tbd%ozpl = clear_val

!--- ccn and in needs
! DH* allocate only for MG? *DH
Expand Down Expand Up @@ -7559,6 +7571,12 @@ subroutine diag_create (Diag, IM, Model)
allocate (Diag%dwn_mf (IM,Model%levs))
allocate (Diag%det_mf (IM,Model%levs))
endif
if (Model%oz_phys_2015) then
allocate(Diag%do3_dt_prd( IM, Model%levs))
allocate(Diag%do3_dt_ozmx(IM, Model%levs))
allocate(Diag%do3_dt_temp(IM, Model%levs))
allocate(Diag%do3_dt_ohoz(IM, Model%levs))
endif
endif

! UGWP
Expand Down Expand Up @@ -7897,6 +7915,12 @@ subroutine diag_phys_zero (Diag, Model, linit, iauwindow_center)
Diag%dwn_mf = zero
Diag%det_mf = zero
endif
if (Model%oz_phys_2015) then
Diag%do3_dt_prd = zero
Diag%do3_dt_ozmx = zero
Diag%do3_dt_temp = zero
Diag%do3_dt_ohoz = zero
endif
endif

!
Expand Down
61 changes: 59 additions & 2 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -5053,6 +5053,12 @@
units = flag
dimensions = ()
type = logical
[ozphys]
standard_name = dataset_for_ozone_physics
long_name = dataset for NRL ozone physics
units = mixed
dimensions = ()
type = ty_ozphys
[h2o_phys]
standard_name = flag_for_stratospheric_water_vapor_physics
long_name = flag for stratospheric water vapor physics
Expand Down Expand Up @@ -6651,6 +6657,18 @@
units = flag
dimensions = ()
type = logical
[levozp]
standard_name = vertical_dimension_of_ozone_forcing_data
long_name = number of vertical layers in ozone forcing data
units = count
dimensions = ()
type = integer
[oz_coeff]
standard_name = number_of_coefficients_in_ozone_data
long_name = number of coefficients in ozone forcing data
units = count
dimensions = ()
type = integer
[ipt]
standard_name = index_of_horizontal_gridpoint_for_debug_output
long_name = horizontal index for point used for diagnostic printout
Expand Down Expand Up @@ -7410,7 +7428,7 @@
standard_name = ozone_forcing
long_name = ozone forcing data
units = mixed
dimensions = (horizontal_loop_extent,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data)
dimensions = (horizontal_loop_extent,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_data)
type = real
kind = kind_phys
[h2opl]
Expand Down Expand Up @@ -8856,6 +8874,38 @@
type = real
kind = kind_phys
active = (flag_for_tracer_diagnostics_3D)
[do3_dt_prd]
standard_name = ozone_tendency_due_to_production_and_loss_rate
long_name = ozone tendency due to production and loss rate
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (flag_for_tracer_diagnostics_3D .and. flag_for_nrl_2015_ozone_scheme)
[do3_dt_ozmx]
standard_name = ozone_tendency_due_to_ozone_mixing_ratio
long_name = ozone tendency due to ozone mixing ratio
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (flag_for_tracer_diagnostics_3D .and. flag_for_nrl_2015_ozone_scheme)
[do3_dt_temp]
standard_name = ozone_tendency_due_to_temperature
long_name = ozone tendency due to temperature
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (flag_for_tracer_diagnostics_3D .and. flag_for_nrl_2015_ozone_scheme)
[do3_dt_ohoz]
standard_name = ozone_tendency_due_to_overhead_ozone_column
long_name = ozone tendency due to overhead ozone column
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (flag_for_tracer_diagnostics_3D .and. flag_for_nrl_2015_ozone_scheme)
[refl_10cm]
standard_name = radar_reflectivity_10cm
long_name = instantaneous refl_10cm
Expand Down Expand Up @@ -9616,7 +9666,7 @@
type = module
relative_path = ../physics/physics
dependencies = machine.F,physcons.F90,radlw_param.f,radsw_param.f
dependencies = GFDL_parse_tracers.F90,h2o_def.f,ozne_def.f
dependencies = GFDL_parse_tracers.F90,h2o_def.f,module_ozphys.F90

[ccpp-arg-table]
name = GFS_typedefs
Expand Down Expand Up @@ -9784,6 +9834,13 @@
dimensions = ()
type = real
kind = kind_phys
[con_1ovg]
standard_name = one_divided_by_the_gravitational_acceleration
long_name = inverse of gravitational acceleration
units = s2 m-1
dimensions = ()
type = real
kind = kind_phys
[con_hvap]
standard_name = latent_heat_of_vaporization_of_water_at_0C
long_name = latent heat of evaporation/sublimation
Expand Down
3 changes: 1 addition & 2 deletions ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_lam3km.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>ozphys_2015</scheme>
<scheme>h2ophys</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
Expand All @@ -71,7 +70,7 @@
<scheme>mp_thompson_post</scheme>
<scheme>GFS_MP_generic_post</scheme>
<scheme>maximum_hourly_diagnostics</scheme>
<scheme>phys_tend</scheme>
<scheme>GFS_physics_post</scheme>
</subcycle>
</group>
<group name="stochastics">
Expand Down
3 changes: 1 addition & 2 deletions ccpp/suites/suite_FV3_GFS_v15p2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>ozphys_2015</scheme>
<scheme>h2ophys</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
Expand All @@ -82,7 +81,7 @@
<scheme>gfdl_cloud_microphys</scheme>
<scheme>GFS_MP_generic_post</scheme>
<scheme>maximum_hourly_diagnostics</scheme>
<scheme>phys_tend</scheme>
<scheme>GFS_physics_post</scheme>
</subcycle>
</group>
<group name="stochastics">
Expand Down
Loading