|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Prognostic cloud fraction diagnosis from relative humidity and cloud water. More...
#include <AMReX_GpuControl.H>#include <AMReX_Math.H>#include <AMReX_FArrayBox.H>#include <cmath>

Go to the source code of this file.
Functions | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | compute_relative_humidity (amrex::Real qv, amrex::Real T, amrex::Real P) |
| Compute relative humidity from water vapor mixing ratio. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | diagnose_cloud_fraction_from_rh_qc (amrex::Real rh, amrex::Real qc, amrex::Real rh_min, amrex::Real rh_max, amrex::Real qc_scale) |
| Diagnose cloud fraction from relative humidity and cloud water. More... | |
Prognostic cloud fraction diagnosis from relative humidity and cloud water.
Implements RH/qc-based cloud fraction diagnosis for use in TwoStream radiation.
Cloud fraction diagnosis formula: cf_rh(k) = max(0, min(1, (rh(k) - rh_min) / (rh_max - rh_min))) [linear ramp] cf_qc(k) = min(1, qc / qc_scale(k)) [qc contribution] cf_diag(k) = min(1, cf_rh(k) + cf_qc(k)) [combined with saturation]
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real compute_relative_humidity | ( | amrex::Real | qv, |
| amrex::Real | T, | ||
| amrex::Real | P | ||
| ) |
Compute relative humidity from water vapor mixing ratio.
Approximate RH from qv and temperature using saturation mixing ratio. The saturation vapour pressure over liquid water is the Magnus formula with the WMO (2008) coefficients, applied to the temperature in Celsius.
| [in] | qv | Water vapor mixing ratio [kg/kg] |
| [in] | T | Temperature [K] |
| [in] | P | Pressure [Pa] |
Referenced by diagnose_cloud_fraction_prognostic(), and ParallelFor().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real diagnose_cloud_fraction_from_rh_qc | ( | amrex::Real | rh, |
| amrex::Real | qc, | ||
| amrex::Real | rh_min, | ||
| amrex::Real | rh_max, | ||
| amrex::Real | qc_scale | ||
| ) |
Diagnose cloud fraction from relative humidity and cloud water.
Computes diagnosed cloud fraction from RH and qc:
This is a GPU-safe inline function for device-side kernels.
| [in] | rh | Relative humidity [0, 1] |
| [in] | qc | Cloud liquid water mixing ratio [kg/kg] |
| [in] | rh_min | Minimum RH threshold [0, 1] |
| [in] | rh_max | Maximum RH threshold [0, 1] |
| [in] | qc_scale | Scaling coefficient for qc contribution |
Referenced by diagnose_cloud_fraction_prognostic().
