Skip to content

Commit

Permalink
change gas_state_set_camp_conc to use partmc env_state instead of cam…
Browse files Browse the repository at this point in the history
…p env_state
  • Loading branch information
jcurtis2 committed Oct 23, 2024
1 parent 4864270 commit 1c86637
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/camp_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 5 additions & 4 deletions src/gas_state.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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(:) &
Expand Down

0 comments on commit 1c86637

Please sign in to comment.