From 1c86637b49df81ab0990337390ef6fd871569a50 Mon Sep 17 00:00:00 2001 From: Jeff Curtis Date: Wed, 23 Oct 2024 15:20:11 -0500 Subject: [PATCH] change gas_state_set_camp_conc to use partmc env_state instead of camp env_state --- src/camp_interface.F90 | 2 +- src/gas_state.F90 | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/camp_interface.F90 b/src/camp_interface.F90 index 20cb07ad4..59b7e7d20 100644 --- a/src/camp_interface.F90 +++ b/src/camp_interface.F90 @@ -68,7 +68,7 @@ subroutine pmc_camp_interface_solve(camp_core, camp_state, & call env_state_set_camp_env_state(env_state, camp_state) ! Set the CAMP gas-phase species concentrations - call gas_state_set_camp_conc(gas_state, camp_state, gas_data) + call gas_state_set_camp_conc(gas_state, env_state, camp_state, gas_data) ! Recalculate the photolysis rate constants call photolysis%update_rate_constants() diff --git a/src/gas_state.F90 b/src/gas_state.F90 index 9e3a69cf8..f85caede8 100644 --- a/src/gas_state.F90 +++ b/src/gas_state.F90 @@ -192,20 +192,21 @@ end subroutine gas_state_molar_conc_to_ppb #ifdef PMC_USE_CAMP !> Set CAMP gas-phase species concentrations - subroutine gas_state_set_camp_conc(gas_state, camp_state, gas_data) + subroutine gas_state_set_camp_conc(gas_state, env_state, camp_state, & + gas_data) !> Gas state class(gas_state_t), intent(in) :: gas_state + ! Environmental state. + type(env_state_t), intent(in) :: env_state !> CAMP state type(camp_state_t), intent(inout) :: camp_state !> Gas data type(gas_data_t), intent(in) :: gas_data - call assert(590005048, associated(camp_state%env_states(1)%val)) - ! Convert relative humidity (1) to [H2O] (ppb) camp_state%state_var(gas_data%i_camp_water) = & - env_state_rel_humid_to_mix_rat(camp_state%env_states(1)) + env_state_rel_humid_to_mix_rat(env_state) ! Convert from ppb to ppm camp_state%state_var(1:size(gas_state%mix_rat)) = gas_state%mix_rat(:) &