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 2 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
3 changes: 1 addition & 2 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
'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',
'data/CCPP_typedefs.F90',
'data/GFS_typedefs.F90',
Expand Down Expand Up @@ -164,7 +163,7 @@
'physics/physics/mp_thompson_post.F90',
'physics/physics/mp_nssl.F90' ,
'physics/physics/ozphys.f',
'physics/physics/ozphys_2015.f',
'physics/physics/ozphys_2015.F90',
'physics/physics/zhaocarr_precpd.f',
'physics/physics/phys_tend.F90',
'physics/physics/radlw_main.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
79 changes: 60 additions & 19 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module GFS_typedefs

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

implicit none
Expand Down Expand Up @@ -1561,6 +1560,21 @@ module GFS_typedefs
!--- lightning threat and diagsnostics
logical :: lightning_threat !< report lightning threat indices

!--- NRL Ozone physics
integer :: kozpl = 28 !<
integer :: kozc = 48 !<
integer :: latsozp !<
integer :: levozp !< number of vertical layers in ozone forcing data
integer :: timeoz !<
integer :: oz_coeff !< number of coefficients in ozone forcing data
real (kind=kind_phys) :: blatc !<
real (kind=kind_phys) :: dphiozc !<
real (kind=kind_phys), pointer :: oz_lat(:) => null() !<
real (kind=kind_phys), pointer :: oz_pres(:) => null() !< natural log of ozone forcing data pressure levels
real (kind=kind_phys), pointer :: po3(:) => null() !<
real (kind=kind_phys), pointer :: oz_time(:) => null() !<
real (kind=kind_phys), pointer :: ozplin(:,:,:,:) => null() !<

contains
procedure :: init => control_initialize
procedure :: init_chemistry => control_chemistry_initialize
Expand Down Expand Up @@ -3996,6 +4010,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
character(len=20) :: namestr
character(len=44) :: descstr

!--- ozone physics
integer :: i1, i2, i3
real(kind=4), dimension(:), allocatable :: oz_lat4, oz_pres4, oz_time4, tempin

! dtend selection: default is to match all variables:
dtend_select(1)='*'
do ipat=2,pat_count
Expand Down Expand Up @@ -5370,28 +5388,51 @@ 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
! Get dimensions from data file
open(unit=Model%kozpl,file='global_o3prdlos.f77', form='unformatted', convert='big_endian')
dustinswales marked this conversation as resolved.
Show resolved Hide resolved
read (Model%kozpl) Model%oz_coeff, Model%latsozp, Model%levozp, Model%timeoz
rewind(Model%kozpl)
if (Model%me == Model%master) then
write(*,*) 'Reading in o3data from global_o3prdlos.f77 '
write(*,*) ' oz_coeff = ', Model%oz_coeff
write(*,*) ' latsozp = ', Model%latsozp
write(*,*) ' levozp = ', Model%levozp
write(*,*) ' timeoz = ', Model%timeoz
endif
! Allocate space
allocate (Model%oz_lat(Model%latsozp))
allocate (Model%oz_pres(Model%levozp))
allocate (Model%po3(Model%levozp))
allocate (Model%oz_time(Model%timeoz+1))
allocate (Model%ozplin(Model%latsozp,Model%levozp,Model%oz_coeff,Model%timeoz))
!
allocate(oz_lat4(Model%latsozp), oz_pres4(Model%levozp), oz_time4(Model%timeoz+1), tempin(Model%latsozp))
read (Model%kozpl) Model%oz_coeff, Model%latsozp, Model%levozp, Model%timeoz, oz_lat4, oz_pres4, oz_time4

! Store
Model%oz_pres(:) = oz_pres4(:)
Model%po3(:) = log(100.0*Model%oz_pres(:)) ! from mb to ln(Pa)
Model%oz_lat(:) = oz_lat4(:)
Model%oz_time(:) = oz_time4(:)
!
do i1=1,Model%timeoz
do i2=1,Model%oz_coeff
do i3=1,Model%levozp
READ(Model%kozpl) tempin
Model%ozplin(:,i3,i2,i1) = tempin(:)
enddo
enddo
enddo
close(Model%kozpl)
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
Model%levozp = 1
Model%oz_coeff = 1
end if
end if
dustinswales marked this conversation as resolved.
Show resolved Hide resolved

Expand Down Expand Up @@ -6881,7 +6922,7 @@ 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
Expand Down
95 changes: 93 additions & 2 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -6634,6 +6634,97 @@
units = flag
dimensions = ()
type = logical
[levozp]
standard_name = number_of_levels_in_ozone_data
dustinswales marked this conversation as resolved.
Show resolved Hide resolved
long_name = number of vertical layers in ozone forcing data
units = count
dimensions = ()
type = integer
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[oz_coeff]
standard_name = number_of_coefficients_in_ozone_data
long_name = number of coefficients in ozone forcing data
units = count
dimensions = ()
type = integer
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[dphiozc]
standard_name = ozone_data_parameter_1
long_name = ozone data parameter 1
units = none
dimensions = ()
type = real
kind = kind_phys
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[blatc]
standard_name = ozone_data_parameter_2
long_name = ozone data parameter 2
units = none
dimensions = ()
type = real
kind = kind_phys
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[kozpl]
standard_name = file_indicator_for_ozone_data
long_name = file indicator for ozone data
units = none
dimensions = ()
type = integer
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[latsozp]
standard_name = number_of_latitudes_in_ozone_data
long_name = number of latitude in ozone data
units = count
dimensions = ()
type = integer
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[timeoz]
standard_name = number_of_times_in_ozone_data
long_name = number of times in ozone data
units = count
dimensions = ()
type = integer
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[oz_lat]
standard_name = ozone_data_latitude
long_name = ozone data latitude
units = deg
dimensions = (number_of_latitudes_in_ozone_data)
type = real
kind = kind_phys
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[oz_pres]
standard_name = ozone_data_level_pressure
long_name = ozone data level pressure
units = Pa
dimensions = (number_of_levels_in_ozone_data)
type = real
kind = kind_phys
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[po3]
standard_name = natural_log_of_ozone_data_pressure_levels
long_name = natural log of ozone forcing data pressure levels in Pa
units = 1
dimensions = (number_of_levels_in_ozone_data)
type = real
kind = kind_phys
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[oz_time]
standard_name = ozone_data_time
long_name = ozone data time
units = none
dimensions = (13)
type = real
kind = kind_phys
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[ozplin]
standard_name = ozone_data
long_name = ozone data
units = 1
dimensions = (number_of_latitudes_in_ozone_data,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data,number_of_times_in_ozone_data)
type = real
kind = kind_phys
active = (flag_for_nrl_2006_ozone_scheme .or. flag_for_nrl_2015_ozone_scheme)
[ipt]
standard_name = index_of_horizontal_gridpoint_for_debug_output
long_name = horizontal index for point used for diagnostic printout
Expand Down Expand Up @@ -7387,7 +7478,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,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data)
type = real
kind = kind_phys
[h2opl]
Expand Down Expand Up @@ -9593,7 +9684,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

[ccpp-arg-table]
name = GFS_typedefs
Expand Down