CAMP 1.0.0
Chemistry Across Multiple Phases
Data Types | Functions/Subroutines
camp_env_state Module Reference

The env_state_t structure and associated subroutines. More...

Data Types

type  env_state_ptr
 Pointer for env_state_t. More...
 
type  env_state_t
 Current environment state. More...
 

Functions/Subroutines

subroutine env_state_add (env_state, env_state_delta)
 env_state += env_state_delta
 
subroutine env_state_scale (env_state, alpha)
 env_state *= alpha
 
subroutine env_state_change_water_volume (env_state, dv)
 Adds the given water volume to the water vapor and updates all environment quantities.
 
real(kind=dp) function env_state_sat_vapor_pressure (env_state)
 Computes the current saturation vapor pressure (Pa).
 
real(kind=dp) function env_state_air_den (env_state)
 Air density (kg m^{-3}).
 
real(kind=dp) function env_state_air_molar_den (env_state)
 Air molar density (mol m^{-3}).
 
real(kind=dp) function env_state_a (env_state)
 Condensation \(A\) parameter.
 
real(kind=dp) function env_state_ppb_to_conc (env_state, ppb)
 Convert (ppb) to (molecules m^{-3}).
 
real(kind=dp) function env_state_conc_to_ppb (env_state, conc)
 Convert (molecules m^{-3}) to (ppb).
 
subroutine env_state_mix (val)
 Average val over all processes.
 
subroutine env_state_reduce_avg (val)
 Average val over all processes, with the result only on the root process.
 
integer function camp_mpi_pack_size_env_state (val)
 Determines the number of bytes required to pack the given value.
 
subroutine camp_mpi_pack_env_state (buffer, position, val)
 Packs the given value into the buffer, advancing position.
 
subroutine camp_mpi_unpack_env_state (buffer, position, val)
 Unpacks the given value from the buffer, advancing position.
 
subroutine camp_mpi_reduce_avg_env_state (val, val_avg)
 Computes the average of val across all processes, storing the result in val_avg on the root process.
 
subroutine set_temperature_k (this, temperature)
 Set the temperature (K)
 
subroutine set_pressure_pa (this, pressure)
 Set the pressure (Pa)
 

Detailed Description

The env_state_t structure and associated subroutines.

Function/Subroutine Documentation

◆ camp_mpi_pack_env_state()

subroutine camp_env_state::camp_mpi_pack_env_state ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
class(env_state_t), intent(in)  val 
)

Packs the given value into the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in]valValue to pack.

Definition at line 302 of file env_state.F90.

Here is the call graph for this function:

◆ camp_mpi_pack_size_env_state()

integer function camp_env_state::camp_mpi_pack_size_env_state ( class(env_state_t), intent(in)  val)

Determines the number of bytes required to pack the given value.

Parameters
[in]valValue to pack.

Definition at line 279 of file env_state.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ camp_mpi_reduce_avg_env_state()

subroutine camp_env_state::camp_mpi_reduce_avg_env_state ( type(env_state_t), intent(in)  val,
type(env_state_t), intent(inout)  val_avg 
)

Computes the average of val across all processes, storing the result in val_avg on the root process.

Parameters
[in]valValue to average.
[in,out]val_avgResult.

Definition at line 369 of file env_state.F90.

Here is the call graph for this function:

◆ camp_mpi_unpack_env_state()

subroutine camp_env_state::camp_mpi_unpack_env_state ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
class(env_state_t), intent(inout)  val 
)

Unpacks the given value from the buffer, advancing position.

Parameters
[in,out]bufferMemory buffer.
[in,out]positionCurrent buffer position.
[in,out]valValue to pack.

Definition at line 335 of file env_state.F90.

Here is the call graph for this function:

◆ env_state_a()

real(kind=dp) function camp_env_state::env_state_a ( type(env_state_t), intent(in)  env_state)

Condensation \(A\) parameter.

Parameters
[in]env_stateEnvironment state.

Definition at line 191 of file env_state.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ env_state_add()

subroutine camp_env_state::env_state_add ( type(env_state_t), intent(inout)  env_state,
type(env_state_t), intent(in)  env_state_delta 
)

env_state += env_state_delta

Parameters
[in,out]env_stateEnvironment.
[in]env_state_deltaIncrement.

Definition at line 71 of file env_state.F90.

◆ env_state_air_den()

real(kind=dp) function camp_env_state::env_state_air_den ( type(env_state_t), intent(in)  env_state)

Air density (kg m^{-3}).

Parameters
[in]env_stateEnvironment state.

Definition at line 165 of file env_state.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ env_state_air_molar_den()

real(kind=dp) function camp_env_state::env_state_air_molar_den ( type(env_state_t), intent(in)  env_state)

Air molar density (mol m^{-3}).

Parameters
[in]env_stateEnvironment state.

Definition at line 178 of file env_state.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ env_state_change_water_volume()

subroutine camp_env_state::env_state_change_water_volume ( type(env_state_t), intent(inout)  env_state,
real(kind=dp), intent(in)  dv 
)

Adds the given water volume to the water vapor and updates all environment quantities.

Parameters
[in,out]env_stateEnvironment state to update.
[in]dvVolume concentration of water added (m^3/m^3).

Definition at line 122 of file env_state.F90.

Here is the call graph for this function:

◆ env_state_conc_to_ppb()

real(kind=dp) function camp_env_state::env_state_conc_to_ppb ( type(env_state_t), intent(in)  env_state,
real(kind=dp), intent(in)  conc 
)

Convert (molecules m^{-3}) to (ppb).

Parameters
[in]env_stateEnvironment state.
[in]concConcentration (molecules m^{-3}).

Definition at line 219 of file env_state.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ env_state_mix()

subroutine camp_env_state::env_state_mix ( type(env_state_t), intent(inout)  val)

Average val over all processes.

Parameters
[in,out]valValue to average.

Definition at line 234 of file env_state.F90.

Here is the call graph for this function:

◆ env_state_ppb_to_conc()

real(kind=dp) function camp_env_state::env_state_ppb_to_conc ( type(env_state_t), intent(in)  env_state,
real(kind=dp), intent(in)  ppb 
)

Convert (ppb) to (molecules m^{-3}).

Parameters
[in]env_stateEnvironment state.
[in]ppbMixing ratio (ppb).

Definition at line 204 of file env_state.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ env_state_reduce_avg()

subroutine camp_env_state::env_state_reduce_avg ( type(env_state_t), intent(inout)  val)

Average val over all processes, with the result only on the root process.

Parameters
[in,out]valValue to average.

Definition at line 256 of file env_state.F90.

Here is the call graph for this function:

◆ env_state_sat_vapor_pressure()

real(kind=dp) function camp_env_state::env_state_sat_vapor_pressure ( type(env_state_t), intent(in)  env_state)

Computes the current saturation vapor pressure (Pa).

Parameters
[in]env_stateEnvironment state.

Definition at line 151 of file env_state.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ env_state_scale()

subroutine camp_env_state::env_state_scale ( type(env_state_t), intent(inout)  env_state,
real(kind=dp), intent(in)  alpha 
)

env_state *= alpha

Parameters
[in,out]env_stateEnvironment.
[in]alphaScale factor.

Definition at line 97 of file env_state.F90.

◆ set_pressure_pa()

subroutine camp_env_state::set_pressure_pa ( class(env_state_ptr), intent(inout)  this,
real(kind=dp), intent(in)  pressure 
)

Set the pressure (Pa)

Parameters
[in,out]thisEnvironmental state pointer
[in]pressureNew pressure (Pa)

Definition at line 400 of file env_state.F90.

◆ set_temperature_k()

subroutine camp_env_state::set_temperature_k ( class(env_state_ptr), intent(inout)  this,
real(kind=dp), intent(in)  temperature 
)

Set the temperature (K)

Parameters
[in,out]thisEnvironmental state pointer
[in]temperatureNew temperature (K)

Definition at line 386 of file env_state.F90.