! ! This work (Common Community Physics Package Framework), identified by ! NOAA, NCAR, CU/CIRES, is free of known copyright restrictions and is ! placed in the public domain. ! ! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ! THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER ! IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ! CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. !> !! @brief Auto-generated cap module for the CCPP suite !! ! module ccpp_MusicBox_suite_cap use ccpp_kinds implicit none private ! Suite interfaces character(len=16) :: ccpp_suite_state = 'uninitialized' public :: MusicBox_suite_initialize public :: MusicBox_suite_timestep_initial public :: MusicBox_suite_physics public :: MusicBox_suite_timestep_final public :: MusicBox_suite_finalize ! Private suite variables integer :: tuv_n_wavelen contains subroutine MusicBox_suite_initialize(errflg, errmsg, nSpecies, nkRxt, njRxt, TimeStart, & TimeEnd, dt, cnst_info, realkind, nlyr, jnames) use relhum_mod, only: relhum_mod_init use tuv_photolysis, only: tuv_photolysis_init use tuv_radiation_transfer, only: tuv_radiation_transfer_init use photolysis_interstitial, only: photolysis_interstitial_init use molec_ox_xsect, only: molec_ox_xsect_init use chemistry_driver, only: chemistry_driver_init use calc_mbar, only: calc_mbar_init use const_props_mod, only: const_props_type ! Dummy arguments integer, intent(out) :: errflg character(len=512), intent(out) :: errmsg integer, intent(in) :: nSpecies integer, intent(in) :: nkRxt integer, intent(in) :: njRxt real(kind_phys), intent(in) :: TimeStart real(kind_phys), intent(in) :: TimeEnd real(kind_phys), intent(in) :: dt type(const_props_type),intent(in) :: cnst_info(:) integer, intent(in) :: realkind integer, intent(in) :: nlyr character(len=*), intent(in) :: jnames(:) if (trim(ccpp_suite_state) /= 'uninitialized') then errflg = 1 write(errmsg, '(3a)') "Invalid initial CCPP state, '", trim(ccpp_suite_state), & "' in MusicBox_suite_initialize" return end if if (errflg == 0) then call molec_ox_xsect_init(errmsg, errflg) end if if (errflg == 0) then call chemistry_driver_init(nSpecies, nkRxt, njRxt, TimeStart, TimeEnd, dt, errmsg, & errflg) end if if (errflg == 0) then call photolysis_interstitial_init(errmsg, errflg) end if if (errflg == 0) then call calc_mbar_init(cnst_info, nSpecies, errmsg, errflg) end if if (errflg == 0) then call relhum_mod_init() end if if (errflg == 0) then call tuv_photolysis_init(realkind, nlyr, jnames, tuv_n_wavelen, errmsg, errflg) end if if (errflg == 0) then call tuv_radiation_transfer_init(realkind, errmsg, errflg) end if ccpp_suite_state = 'initialized' end subroutine MusicBox_suite_initialize subroutine MusicBox_suite_timestep_initial(errflg, errmsg) ! Dummy arguments integer, intent(out) :: errflg character(len=512), intent(out) :: errmsg if (trim(ccpp_suite_state) /= 'initialized') then errflg = 1 write(errmsg, '(3a)') "Invalid initial CCPP state, '", trim(ccpp_suite_state), & "' in MusicBox_suite_timestep_initial" return end if ccpp_suite_state = 'in_time_step' end subroutine MusicBox_suite_timestep_initial subroutine MusicBox_suite_physics(errflg, errmsg, boxtemp, boxpress, boxh2ovmr, boxrelhum, & density, vmr, mbar, nkRxt, njRxt, nlyr, zen, alt, temp, press_mid, press_top, o2vmr, & albedo, o3vmr, so2vmr, no2vmr, cldfrc, cldwat, photo_lev, TimeStart, TimeEnd) use relhum_mod, only: relhum_mod_run use tuv_photolysis, only: tuv_photolysis_run use k_rateConst, only: k_rateConst_run use molec_ox_xsect, only: molec_ox_xsect_run use tuv_radiation_transfer, only: tuv_radiation_transfer_run use calc_density, only: calc_density_run use calc_mbar, only: calc_mbar_run use photolysis_interstitial, only: photolysis_interstitial_run use chemistry_driver, only: chemistry_driver_run ! Dummy arguments integer, intent(out) :: errflg character(len=512), intent(out) :: errmsg real(kind_phys), intent(in) :: boxtemp real(kind_phys), intent(in) :: boxpress real(kind_phys), intent(in) :: boxh2ovmr real(kind_phys), intent(out) :: boxrelhum real(kind_phys), intent(out) :: density real(kind_phys), intent(inout) :: vmr(:) real(kind_phys), intent(out) :: mbar integer, intent(in) :: nkRxt integer, intent(in) :: njRxt integer, intent(in) :: nlyr real(kind_phys), intent(in) :: zen real(kind_phys), intent(in) :: alt(:) real(kind_phys), intent(in) :: temp(:) real(kind_phys), intent(in) :: press_mid(:) real(kind_phys), intent(in) :: press_top real(kind_phys), intent(in) :: o2vmr(:) real(kind_phys), intent(in) :: albedo real(kind_phys), intent(in) :: o3vmr(:) real(kind_phys), intent(in) :: so2vmr(:) real(kind_phys), intent(in) :: no2vmr(:) real(kind_phys), intent(in) :: cldfrc(:) real(kind_phys), intent(in) :: cldwat(:) integer, intent(in) :: photo_lev real(kind_phys), intent(in) :: TimeStart real(kind_phys), intent(in) :: TimeEnd ! Local Variables real(kind_phys), allocatable :: k_rateConst(:) real(kind_phys), allocatable :: dto2(:,:) real(kind_phys), allocatable :: radfld(:,:) real(kind_phys), allocatable :: j_rateConst(:) real(kind_phys), allocatable :: srb_o2_xs(:,:) real(kind_phys), allocatable :: tuv_prates(:,:) if (trim(ccpp_suite_state) /= 'in_time_step') then errflg = 1 write(errmsg, '(3a)') "Invalid initial CCPP state, '", trim(ccpp_suite_state), & "' in MusicBox_suite_physics" return end if allocate(k_rateConst(1:nkRxt)) allocate(dto2(1:nlyr, 1:tuv_n_wavelen)) allocate(radfld(1:tuv_n_wavelen, 1:nlyr)) allocate(j_rateConst(1:njRxt)) allocate(srb_o2_xs(1:tuv_n_wavelen, 1:nlyr)) allocate(tuv_prates(1:nlyr, 1:njRxt)) if (errflg == 0) then call relhum_mod_run(boxtemp, boxpress, boxh2ovmr, boxrelhum) end if if (errflg == 0) then call calc_density_run(boxpress, boxtemp, density, errmsg, errflg) end if if (errflg == 0) then call calc_mbar_run(vmr, mbar, errmsg, errflg) end if if (errflg == 0) then call k_rateConst_run(nkRxt, njRxt, k_rateConst, density, boxrelhum, boxh2ovmr, boxtemp, & errmsg, errflg) end if if (errflg == 0) then call molec_ox_xsect_run(nlyr, zen, alt, temp, press_mid, press_top, o2vmr, dto2, & srb_o2_xs, errmsg, errflg) end if if (errflg == 0) then call tuv_radiation_transfer_run(nlyr, tuv_n_wavelen, zen, albedo, press_mid, press_top, & alt, temp, o3vmr, so2vmr, no2vmr, cldfrc, cldwat, dto2, radfld, errmsg, errflg) end if if (errflg == 0) then call tuv_photolysis_run(nlyr, temp, press_mid, radfld, srb_o2_xs, tuv_prates, errmsg, & errflg) end if if (errflg == 0) then call photolysis_interstitial_run(photo_lev, tuv_prates, j_rateConst, errmsg, errflg) end if if (errflg == 0) then call chemistry_driver_run(vmr, TimeStart, TimeEnd, j_rateConst, k_rateConst, density, & errmsg, errflg) end if deallocate(k_rateConst) deallocate(dto2) deallocate(radfld) deallocate(j_rateConst) deallocate(srb_o2_xs) deallocate(tuv_prates) ccpp_suite_state = 'in_time_step' end subroutine MusicBox_suite_physics subroutine MusicBox_suite_timestep_final(errflg, errmsg) ! Dummy arguments integer, intent(out) :: errflg character(len=512), intent(out) :: errmsg if (trim(ccpp_suite_state) /= 'in_time_step') then errflg = 1 write(errmsg, '(3a)') "Invalid initial CCPP state, '", trim(ccpp_suite_state), & "' in MusicBox_suite_timestep_final" return end if ccpp_suite_state = 'initialized' end subroutine MusicBox_suite_timestep_final subroutine MusicBox_suite_finalize(errflg, errmsg) use calc_mbar, only: calc_mbar_finalize use relhum_mod, only: relhum_mod_final use chemistry_driver, only: chemistry_driver_finalize ! Dummy arguments integer, intent(out) :: errflg character(len=512), intent(out) :: errmsg if (trim(ccpp_suite_state) /= 'initialized') then errflg = 1 write(errmsg, '(3a)') "Invalid initial CCPP state, '", trim(ccpp_suite_state), & "' in MusicBox_suite_finalize" return end if if (errflg == 0) then call chemistry_driver_finalize(errmsg, errflg) end if if (errflg == 0) then call calc_mbar_finalize(errmsg, errflg) end if if (errflg == 0) then call relhum_mod_final() end if ccpp_suite_state = 'uninitialized' end subroutine MusicBox_suite_finalize end module ccpp_MusicBox_suite_cap