PartMC  2.6.1
Data Types | Functions/Subroutines
pmc_env_state Module Reference

The env_state_t structure and associated subroutines. More...

Data Types

type  env_state_t
 Current environment state. More...
 

Functions/Subroutines

subroutine env_state_add (env_state, env_state_delta)
 env_state += env_state_delta More...
 
subroutine env_state_scale (env_state, alpha)
 env_state *= alpha More...
 
subroutine env_state_change_water_volume (env_state, dv)
 Adds the given water volume to the water vapor and updates all environment quantities. More...
 
real(kind=dp) function env_state_sat_vapor_pressure (env_state)
 Computes the current saturation vapor pressure (Pa). More...
 
real(kind=dp) function env_state_air_den (env_state)
 Air density (kg m^{-3}). More...
 
real(kind=dp) function env_state_air_molar_den (env_state)
 Air molar density (mol m^{-3}). More...
 
real(kind=dp) function env_state_a (env_state)
 Condensation $A$ parameter. More...
 
real(kind=dp) function env_state_ppb_to_conc (env_state, ppb)
 Convert (ppb) to (molecules m^{-3}). More...
 
real(kind=dp) function env_state_conc_to_ppb (env_state, conc)
 Convert (molecules m^{-3}) to (ppb). More...
 
subroutine env_state_mix (val)
 Average val over all processes. More...
 
subroutine env_state_reduce_avg (val)
 Average val over all processes, with the result only on the root process. More...
 
integer function pmc_mpi_pack_size_env_state (val)
 Determines the number of bytes required to pack the given value. More...
 
subroutine pmc_mpi_pack_env_state (buffer, position, val)
 Packs the given value into the buffer, advancing position. More...
 
subroutine pmc_mpi_unpack_env_state (buffer, position, val)
 Unpacks the given value from the buffer, advancing position. More...
 
subroutine pmc_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. More...
 
subroutine env_state_input_netcdf (env_state, ncid)
 Read full state. More...
 

Detailed Description

The env_state_t structure and associated subroutines.

Function/Subroutine Documentation

◆ env_state_a()

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

Condensation $A$ parameter.

Parameters
[in]env_stateEnvironment state.

Definition at line 179 of file env_state.F90.

◆ env_state_add()

subroutine pmc_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 59 of file env_state.F90.

◆ env_state_air_den()

real(kind=dp) function pmc_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 153 of file env_state.F90.

◆ env_state_air_molar_den()

real(kind=dp) function pmc_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 166 of file env_state.F90.

◆ env_state_change_water_volume()

subroutine pmc_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 110 of file env_state.F90.

◆ env_state_conc_to_ppb()

real(kind=dp) function pmc_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 207 of file env_state.F90.

◆ env_state_input_netcdf()

subroutine pmc_env_state::env_state_input_netcdf ( type(env_state_t), intent(inout)  env_state,
integer, intent(in)  ncid 
)

Read full state.

Parameters
[in,out]env_stateEnvironment state to read.
[in]ncidNetCDF file ID, in data mode.

Definition at line 503 of file env_state.F90.

◆ env_state_mix()

subroutine pmc_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 290 of file env_state.F90.

◆ env_state_ppb_to_conc()

real(kind=dp) function pmc_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 192 of file env_state.F90.

◆ env_state_reduce_avg()

subroutine pmc_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 312 of file env_state.F90.

◆ env_state_sat_vapor_pressure()

real(kind=dp) function pmc_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 139 of file env_state.F90.

◆ env_state_scale()

subroutine pmc_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 85 of file env_state.F90.

◆ pmc_mpi_pack_env_state()

subroutine pmc_env_state::pmc_mpi_pack_env_state ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
type(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 358 of file env_state.F90.

◆ pmc_mpi_pack_size_env_state()

integer function pmc_env_state::pmc_mpi_pack_size_env_state ( type(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 335 of file env_state.F90.

◆ pmc_mpi_reduce_avg_env_state()

subroutine pmc_env_state::pmc_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 425 of file env_state.F90.

◆ pmc_mpi_unpack_env_state()

subroutine pmc_env_state::pmc_mpi_unpack_env_state ( character, dimension(:), intent(inout)  buffer,
integer, intent(inout)  position,
type(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 391 of file env_state.F90.