Skip to content

Commit

Permalink
Connect CCPP SCM with HR4 physics from hr.v4 tag from ufs-weather-mod…
Browse files Browse the repository at this point in the history
…el repo https://github.com/ufs-community/ufs-weather-model/tree/hr.v4

	new file:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_ccpp_suite_sim_pre.F90
	new file:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_ccpp_suite_sim_pre.meta
	new file:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_photochemistry.F90
	new file:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_photochemistry.meta
	modified:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90
	modified:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta
	modified:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90
	modified:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta
	modified:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.F90
	modified:   physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.meta
	new file:   physics/Interstitials/UFS_SCM_NEPTUNE/ccpp_suite_simulator.F90
	new file:   physics/Interstitials/UFS_SCM_NEPTUNE/ccpp_suite_simulator.meta
	new file:   physics/Interstitials/UFS_SCM_NEPTUNE/module_ccpp_suite_simulator.F90
	new file:   physics/Interstitials/UFS_SCM_NEPTUNE/module_ccpp_suite_simulator.meta
	modified:   physics/Interstitials/UFS_SCM_NEPTUNE/scm_sfc_flux_spec.F90
	new file:   physics/photochem/module_h2ophys.F90
	new file:   physics/photochem/module_h2ophys.meta
	modified:   physics/photochem/module_ozphys.F90
  • Loading branch information
bluefinweiwei committed Jan 12, 2025
1 parent 1d9b076 commit e6f1f93
Show file tree
Hide file tree
Showing 18 changed files with 2,152 additions and 276 deletions.
441 changes: 441 additions & 0 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_ccpp_suite_sim_pre.F90

Large diffs are not rendered by default.

175 changes: 175 additions & 0 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_ccpp_suite_sim_pre.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
[ccpp-table-properties]
name = GFS_ccpp_suite_sim_pre
type = scheme
dependencies = ../../hooks/machine.F,module_ccpp_suite_simulator.F90

########################################################################
[ccpp-arg-table]
name = GFS_ccpp_suite_sim_pre_run
type = scheme
[do_ccpp_suite_sim]
standard_name = flag_for_ccpp_suite_simulator
long_name = flag for ccpp suite simulator
units = flag
dimensions = ()
type = logical
intent = in
[physics_process]
standard_name = physics_process_type_for_CCPP_suite_simulator
long_name = physics process type for CCPP suite simulator
units = mixed
dimensions = (number_of_physics_process_in_CCPP_suite_simulator)
type = base_physics_process
intent = in
[dtend]
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
units = mixed
dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max)
type = real
kind = kind_phys
intent = in
optional = True
[dtidx]
standard_name = cumulative_change_of_state_variables_outer_index
long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index
units = index
dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes)
type = integer
intent = in
[dtp]
standard_name = timestep_for_physics
long_name = physics timestep
units = s
dimensions = ()
type = real
kind = kind_phys
intent = in
[index_of_process_dcnv]
standard_name = index_of_deep_convection_process_process_in_cumulative_change_index
long_name = index of deep convection process in second dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[index_of_process_longwave]
standard_name = index_of_longwave_heating_process_in_cumulative_change_index
long_name = index of longwave heating process in second dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[index_of_process_shortwave]
standard_name = index_of_shortwave_heating_process_in_cumulative_change_index
long_name = index of shortwave heating process in second dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[index_of_process_orographic_gwd]
standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index
long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[index_of_process_scnv]
standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index
long_name = index of shallow convection process in second dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[index_of_process_pbl]
standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index
long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[index_of_process_mp]
standard_name = index_of_microphysics_process_process_in_cumulative_change_index
long_name = index of microphysics transport process in second dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[index_of_temperature]
standard_name = index_of_temperature_in_cumulative_change_index
long_name = index of temperature in first dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[index_of_x_wind]
standard_name = index_of_x_wind_in_cumulative_change_index
long_name = index of x-wind in first dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[index_of_y_wind]
standard_name = index_of_y_wind_in_cumulative_change_index
long_name = index of x-wind in first dimension of array cumulative change index
units = index
dimensions = ()
type = integer
intent = in
[ntqv]
standard_name = index_of_specific_humidity_in_tracer_concentration_array
long_name = tracer index for water vapor (specific humidity)
units = index
dimensions = ()
type = integer
intent = in
[active_phys_tend]
standard_name = tendencies_for_active_process_in_ccpp_suite_simulator
long_name = tendencies for active physics process in ccpp suite simulator
units = mixed
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_prognostics_varaibles_in_CCPP_suite_simulator)
type = real
kind = kind_phys
intent = out
[iactive_T]
standard_name = index_for_active_T_in_CCPP_suite_simulator
long_name = index into active process tracer array for temperature in CCPP suite simulator
units = count
dimensions = ()
type = integer
intent = in
[iactive_u]
standard_name = index_for_active_u_in_CCPP_suite_simulator
long_name = index into active process tracer array for zonal wind in CCPP suite simulator
units = count
dimensions = ()
type = integer
intent = in
[iactive_v]
standard_name = index_for_active_v_in_CCPP_suite_simulator
long_name = index into active process tracer array for meridional wind in CCPP suite simulator
units = count
dimensions = ()
type = integer
intent = in
[iactive_q]
standard_name = index_for_active_q_in_CCPP_suite_simulator
long_name = index into active process tracer array for moisture in CCPP suite simulator
units = count
dimensions = ()
type = integer
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
units = none
dimensions = ()
type = character
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
dimensions = ()
type = integer
intent = out
110 changes: 110 additions & 0 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_photochemistry.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
! #########################################################################################
!> \file GFS_photochemistry.f90
!!
! #########################################################################################
module GFS_photochemistry
use machine, only: kind_phys
use module_ozphys, only: ty_ozphys
use module_h2ophys, only: ty_h2ophys
implicit none
contains

! #########################################################################################
!> \section arg_table_GFS_photochemistry_init Argument Table
!! \htmlinclude GFS_photochemistry_init.html
!!
! #########################################################################################
subroutine GFS_photochemistry_init(oz_phys_2006, oz_phys_2015, h2o_phys, errmsg, errflg)
logical, intent(in) :: &
oz_phys_2015, & ! Do ozone photochemistry? (2015)
oz_phys_2006, & ! Do ozone photochemistry? (2006)
h2o_phys ! Do stratospheric h2o photochemistry?
character(len=*), intent(out) :: &
errmsg ! CCPP Error message.
integer, intent(out) :: &
errflg ! CCPP Error flag.

! Initialize CCPP error handling variables
errmsg = ''
errflg = 0

! If no photchemical scheme is on, but SDF has this module, report an error?
if ((.not. oz_phys_2006) .and. (.not. oz_phys_2015) .and. (.not. h2o_phys)) then
write (errmsg,'(*(a))') 'Logic error: One of [oz_phys_2006, oz_phys_2015, or h2o_phys] must == .true. '
errflg = 1
return
endif

! Only one ozone scheme can be on. Otherwise, return and report error.
if (oz_phys_2006 .and. oz_phys_2015) then
write (errmsg,'(*(a))') 'Logic error: Only one ozone scheme can be enabled at a time'
errflg = 1
return
endif

end subroutine GFS_photochemistry_init

! #########################################################################################
!> \section arg_table_GFS_photochemistry_run Argument Table
!! \htmlinclude GFS_photochemistry_run.html
!!
! #########################################################################################
subroutine GFS_photochemistry_run (dtp, ozphys, oz_phys_2015, oz_phys_2006, con_1ovg, &
prsl, dp, ozpl, h2o_phys, h2ophys, h2opl, h2o0, oz0, gt0, do3_dt_prd, do3_dt_ozmx, &
do3_dt_temp, do3_dt_ohoz, errmsg, errflg)

! Inputs
real(kind=kind_phys), intent(in) :: &
dtp, & ! Model timestep
con_1ovg ! Physical constant (1./gravity)
real(kind=kind_phys), intent(in), dimension(:,:) :: &
prsl, & ! Air pressure (Pa)
dp, & ! Pressure thickness (Pa)
gt0 ! Air temperature (K)
real(kind=kind_phys), intent(in), dimension(:,:,:) :: &
ozpl, & ! Ozone data for current model timestep.
h2opl ! h2o data for curent model timestep.
logical, intent(in) :: &
oz_phys_2015, & ! Do ozone photochemistry? (2015)
oz_phys_2006, & ! Do ozone photochemistry? (2006)
h2o_phys ! Do stratospheric h2o photochemistry?
type(ty_ozphys), intent(in) :: &
ozphys ! DDT with ozone photochemistry scheme/data.
type(ty_h2ophys), intent(in) :: &
h2ophys ! DDT with h2o photochemistry scheme/data.

! Outputs (optional)
real(kind=kind_phys), intent(inout), dimension(:,:), optional :: &
do3_dt_prd, & ! Physics tendency: production and loss effect
do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect
do3_dt_temp, & ! Physics tendency: temperature effect
do3_dt_ohoz ! Physics tendency: overhead ozone effect

! Outputs
real(kind=kind_phys), intent(inout), dimension(:,:) :: &
oz0, & ! Update ozone concentration.
h2o0 ! Updated h2o concentration.
character(len=*), intent(out) :: &
errmsg ! CCPP Error message.
integer, intent(out) :: &
errflg ! CCPP Error flag.

! Initialize CCPP error handling variables
errmsg = ''
errflg = 0

if (oz_phys_2015) then
call ozphys%run_o3prog_2015(con_1ovg, dtp, prsl, gt0, dp, ozpl, oz0, do3_dt_prd, &
do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz)
endif
if (oz_phys_2006) then
call ozphys%run_o3prog_2006(con_1ovg, dtp, prsl, gt0, dp, ozpl, oz0, do3_dt_prd, &
do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz)
endif
if (h2o_phys) then
call h2ophys%run(dtp, prsl, h2opl, h2o0)
endif

end subroutine GFS_photochemistry_run

end module GFS_photochemistry
Loading

0 comments on commit e6f1f93

Please sign in to comment.