Skip to content

Commit

Permalink
do unit conversions in place
Browse files Browse the repository at this point in the history
  • Loading branch information
jcurtis2 committed Oct 23, 2024
1 parent 986c8a2 commit 53018b3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/tchem_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ subroutine tchem_to_partmc(aero_data, aero_state, gas_data, gas_state, &
call TChem_getStateVector(stateVector, 0)

gas_state%mix_rat = 0.0
gas_state%mix_rat = stateVector(4:nSpec+3)
! Convert gas_state from ppm to ppb.
call gas_state_scale(gas_state, 1000.d0)
! Convert from ppm to ppb.
gas_state%mix_rat = stateVector(4:nSpec+3) * 1000.d0

! Map aerosols
do i_part = 1,aero_state_n_part(aero_state)
Expand Down Expand Up @@ -246,10 +245,8 @@ subroutine tchem_from_partmc(aero_data, aero_state, gas_data, gas_state, &
gas_state%mix_rat(i_water) = env_state%rel_humid * water_vp * 1.0e9 &
/ env_state%pressure ! (ppb)

! Convert from ppb to ppm.
call gas_state_scale(gas_state, 1.0d0 / 1000.d0)
! Add gas species to state vector.
stateVector(4:gas_data_n_spec(gas_data)+3) = gas_state%mix_rat
! Add gas species to state vector. Convert from ppb to ppm.
stateVector(4:gas_data_n_spec(gas_data)+3) = gas_state%mix_rat / 1000.d0

! TODO: Map aerosols
do i_part = 1,aero_state_n_part(aero_state)
Expand Down

0 comments on commit 53018b3

Please sign in to comment.