PartMC 2.1.2
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_allocate (env_state)
 Allocate an empty environment.
subroutine env_state_deallocate (env_state)
 Free all storage.
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_copy (env_from, env_to)
 env_to = env_from
subroutine env_state_change_water_volume (env_state, aero_data, dv)
 Adds the given water volume to the water vapor and updates all environment quantities.
real(kind=dp) env_state_sat_vapor_pressure (env_state)
 Computes the current saturation vapor pressure (Pa).
real(kind=dp) aero_particle_kappa_rh (aero_particle, aero_data, env_state)
 Returns the critical relative humidity from the kappa value (1).
real(kind=dp) env_state_air_den (env_state)
 Air density (kg m^{-3}).
real(kind=dp) env_state_air_molar_den (env_state)
 Air molar density (mol m^{-3}).
subroutine gas_state_mole_dens_to_ppb (gas_state, env_state)
 Convert (mol m^{-3}) to (ppb).
real(kind=dp) env_state_ppb_to_conc (env_state, ppb)
 Convert (ppb) to (molecules m^{-3}).
real(kind=dp) env_state_conc_to_ppb (env_state, conc)
 Convert (molecules m^{-3}) to (ppb).
subroutine env_state_update_gas_state (env_state, delta_t, old_env_state, gas_data, gas_state)
 Do emissions and background dilution from the environment.
subroutine env_state_update_aero_state (env_state, delta_t, old_env_state, bin_grid, aero_data, aero_weight, aero_state, n_emit, n_dil_in, n_dil_out)
 Do emissions and background dilution from the environment for a particle aerosol distribution.
subroutine env_state_update_aero_binned (env_state, delta_t, old_env_state, bin_grid, aero_data, aero_binned)
 Do emissions and background dilution from the environment for a binned aerosol distribution.
subroutine spec_file_read_env_state (file, env_state)
 Read environment specification from a spec file.
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 pmc_mpi_pack_size_env_state (val)
 Determines the number of bytes required to pack the given value.
subroutine pmc_mpi_pack_env_state (buffer, position, val)
 Packs the given value into the buffer, advancing position.
subroutine pmc_mpi_unpack_env_state (buffer, position, val)
 Unpacks the given value from the buffer, advancing position.
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.
subroutine env_state_output_netcdf (env_state, ncid)
 Write full state.
subroutine env_state_input_netcdf (env_state, ncid)
 Read full state.

Detailed Description

The env_state_t structure and associated subroutines.


Function/Subroutine Documentation

real(kind=dp) pmc_env_state::aero_particle_kappa_rh ( type(aero_particle_t),intent(in)  aero_particle,
type(aero_data_t),intent(in)  aero_data,
type(env_state_t),intent(in)  env_state 
)

Returns the critical relative humidity from the kappa value (1).

Parameters:
aero_particleAerosol particle.
aero_dataAerosol data.
env_stateEnvironment state.

Definition at line 277 of file env_state.F90.

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:
env_stateEnvironment.
env_state_deltaIncrement.

Definition at line 133 of file env_state.F90.

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

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

Parameters:
env_stateEnvironment state.

Definition at line 301 of file env_state.F90.

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

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

Parameters:
env_stateEnvironment state.

Definition at line 314 of file env_state.F90.

subroutine pmc_env_state::env_state_allocate ( type(env_state_t),intent(out)  env_state)

Allocate an empty environment.

Parameters:
env_stateEnvironment.

Definition at line 87 of file env_state.F90.

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

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

Parameters:
env_stateEnvironment state to update.
aero_dataAero_data constants.
dvVolume concentration of water added (m^3/m^3).

Definition at line 231 of file env_state.F90.

real(kind=dp) 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:
env_stateEnvironment state.
concConcentration (molecules m^{-3}).

Definition at line 357 of file env_state.F90.

subroutine pmc_env_state::env_state_copy ( type(env_state_t),intent(in)  env_from,
type(env_state_t),intent(inout)  env_to 
)

env_to = env_from

Parameters:
env_fromOriginal.
env_toDestination.

Definition at line 198 of file env_state.F90.

subroutine pmc_env_state::env_state_deallocate ( type(env_state_t),intent(inout)  env_state)

Free all storage.

Parameters:
env_stateEnvironment.

Definition at line 118 of file env_state.F90.

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

Read full state.

Parameters:
env_stateEnvironment state to read.
ncidNetCDF file ID, in data mode.

Definition at line 857 of file env_state.F90.

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

Average val over all processes.

Parameters:
valValue to average.

Definition at line 615 of file env_state.F90.

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

Write full state.

Parameters:
env_stateEnvironment state to write.
ncidNetCDF file ID, in data mode.

Definition at line 796 of file env_state.F90.

real(kind=dp) 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:
env_stateEnvironment state.
ppbMixing ratio (ppb).

Definition at line 342 of file env_state.F90.

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:
valValue to average.

Definition at line 639 of file env_state.F90.

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

Computes the current saturation vapor pressure (Pa).

Parameters:
env_stateEnvironment state.

Definition at line 263 of file env_state.F90.

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:
env_stateEnvironment.
alphaScale factor.

Definition at line 170 of file env_state.F90.

subroutine pmc_env_state::env_state_update_aero_binned ( type(env_state_t),intent(in)  env_state,
real(kind=dp),intent(in)  delta_t,
type(env_state_t),intent(in)  old_env_state,
type(bin_grid_t),intent(in)  bin_grid,
type(aero_data_t),intent(in)  aero_data,
type(aero_binned_t),intent(inout)  aero_binned 
)

Do emissions and background dilution from the environment for a binned aerosol distribution.

Parameters:
env_stateCurrent environment.
delta_tTime increment to update over.
old_env_statePrevious environment.
bin_gridBin grid.
aero_dataAero data values.
aero_binnedAero binned to update.

Definition at line 508 of file env_state.F90.

subroutine pmc_env_state::env_state_update_aero_state ( type(env_state_t),intent(in)  env_state,
real(kind=dp),intent(in)  delta_t,
type(env_state_t),intent(in)  old_env_state,
type(bin_grid_t),intent(in)  bin_grid,
type(aero_data_t),intent(in)  aero_data,
type(aero_weight_t),intent(in)  aero_weight,
type(aero_state_t),intent(inout)  aero_state,
integer,intent(out)  n_emit,
integer,intent(out)  n_dil_in,
integer,intent(out)  n_dil_out 
)

Do emissions and background dilution from the environment for a particle aerosol distribution.

Parameters:
env_stateCurrent environment.
delta_tTime increment to update over.
old_env_statePrevious environment.
bin_gridBin grid.
aero_dataAero data values.
aero_weightAero weight.
aero_stateAero state to update.
n_emitNumber of emitted particles.
n_dil_inNumber of diluted-in particles.
n_dil_outNumber of diluted-out particles.

Definition at line 427 of file env_state.F90.

subroutine pmc_env_state::env_state_update_gas_state ( type(env_state_t),intent(in)  env_state,
real(kind=dp),intent(in)  delta_t,
type(env_state_t),intent(in)  old_env_state,
type(gas_data_t),intent(in)  gas_data,
type(gas_state_t),intent(inout)  gas_state 
)

Do emissions and background dilution from the environment.

Parameters:
env_stateCurrent environment.
delta_tTime increment to update over.
old_env_statePrevious environment.
gas_dataGas data values.
gas_stateGas state to update.

Definition at line 372 of file env_state.F90.

subroutine pmc_env_state::gas_state_mole_dens_to_ppb ( type(gas_state_t),intent(inout)  gas_state,
type(env_state_t),intent(in)  env_state 
)

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

Parameters:
gas_stateGas state.
env_stateEnvironment state.

Definition at line 327 of file env_state.F90.

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:
bufferMemory buffer.
positionCurrent buffer position.
valValue to pack.

Definition at line 695 of file env_state.F90.

integer 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:
valValue to pack.

Definition at line 664 of file env_state.F90.

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:
valValue to average.
val_avgResult.

Definition at line 778 of file env_state.F90.

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:
bufferMemory buffer.
positionCurrent buffer position.
valValue to pack.

Definition at line 736 of file env_state.F90.

subroutine pmc_env_state::spec_file_read_env_state ( type(spec_file_t),intent(inout)  file,
type(env_state_t),intent(inout)  env_state 
)

Read environment specification from a spec file.

Parameters:
fileSpec file.
env_stateEnvironment data.

Definition at line 564 of file env_state.F90.