mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Updated parameterization in Weather module.
This commit is contained in:
parent
275b0c4300
commit
b1f9e17ab0
@ -9,14 +9,14 @@
|
||||
* 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: density of air - kg * m^(-3) <NUMBER>
|
||||
* density of air - kg * m^(-3) <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_temperature,_pressure,_relativeHumidity);
|
||||
params ["_temperature", "_pressure", "_relativeHumidity"];
|
||||
|
||||
_pressure = _pressure * 100; // hPa to Pa
|
||||
|
||||
|
@ -4,10 +4,10 @@
|
||||
* Calculates the barometric pressure based on altitude and weather
|
||||
*
|
||||
* Arguments:
|
||||
* 0: altitude - meters <NUMBER>
|
||||
* altitude - meters <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: barometric pressure - hPA <NUMBER>
|
||||
* barometric pressure - hPA <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
|
@ -8,7 +8,7 @@
|
||||
* 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: dew point <NUMBER>
|
||||
* dew point <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
@ -18,7 +18,7 @@
|
||||
#define __b 17.67
|
||||
#define __c 243.5
|
||||
|
||||
PARAMS_2(_t,_rh);
|
||||
params ["_t", "_rh"];
|
||||
|
||||
if (_rh == 0) exitWith { CELSIUS(0) };
|
||||
|
||||
|
@ -5,10 +5,10 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: temperature - degrees celcius <NUMBER>
|
||||
* 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER>
|
||||
* 1: relativeHumidity - value between 0.0 and 1.0 <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: heat index <NUMBER>
|
||||
* heat index <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
@ -24,7 +24,7 @@
|
||||
#define __C7 0.000687678
|
||||
#define __C8 0.000274954
|
||||
|
||||
PARAMS_2(_t,_rh);
|
||||
params ["_t", "_rh"];
|
||||
|
||||
// Source: https://en.wikipedia.org/wiki/Heat_index
|
||||
|
||||
|
@ -4,10 +4,10 @@
|
||||
* Calculates the terrain roughness length at a given world position
|
||||
*
|
||||
* Arguments:
|
||||
* 0: _this - world position <posASL>
|
||||
* world position <posASL>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: roughness length <NUMBER>
|
||||
* roughness length <NUMBER>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -4,10 +4,10 @@
|
||||
* Calculates the temperature based on altitude and weather
|
||||
*
|
||||
* Arguments:
|
||||
* 0: height - meters <NUMBER>
|
||||
* height - meters <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: temperature - degrees celsius <NUMBER>
|
||||
* temperature - degrees celsius <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
|
@ -9,7 +9,7 @@
|
||||
* 2: relativeHumidity - value between 0.0 and 1.0 <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: wet bulb <NUMBER>
|
||||
* wet bulb <NUMBER>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
private ["_es", "_e", "_eDiff", "_eGuessPrev", "_cTempDelta", "_twGuess", "_eguess"];
|
||||
|
||||
PARAMS_3(_temperature,_pressure,_relativeHumidity);
|
||||
params ["_temperature", "_pressure", "_relativeHumidity"];
|
||||
|
||||
// Source: http://cosmoquest.org/forum/showthread.php?155366-Calculating-Wet-Bulb-Temperature-from-RH-amp-Dry-Bulb
|
||||
_es = 6.112 * exp((17.67 * _temperature) / (_temperature + 243.5));
|
||||
|
@ -5,16 +5,16 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: temperature - degrees celcius <NUMBER>
|
||||
* 2: wind speed - m/s <NUMBER>
|
||||
* 1: wind speed - m/s <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: wind chill <NUMBER>
|
||||
* wind chill <NUMBER>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_t,_v);
|
||||
params ["_t", "_v"];
|
||||
|
||||
// Source: https://en.wikipedia.org/wiki/Wind_chill
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
* 3: Account for obstacles <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: wind speed - m/s <NUMBER>
|
||||
* wind speed - m/s <NUMBER>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"];
|
||||
|
||||
PARAMS_4(_position,_windGradientEnabled,_terrainEffectEnabled,_obstacleEffectEnabled);
|
||||
params ["_position", "_windGradientEnabled", "_terrainEffectEnabled", "_obstacleEffectEnabled"];
|
||||
|
||||
fnc_polar2vect = {
|
||||
private ["_mag2D"];
|
||||
|
@ -11,11 +11,12 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_periodPercent", "_periodPosition"];
|
||||
|
||||
if (isNil "ACE_WIND_PARAMS") exitWith { [0, 0, 0] };
|
||||
|
||||
EXPLODE_5_PVT(ACE_WIND_PARAMS,_dir,_dirChange,_spd,_spdChange,_period);
|
||||
ACE_WIND_PARAMS params ["_dir", "_dirChange", "_spd", "_spdChange", "_period"];
|
||||
|
||||
private ["_periodPercent", "_periodPosition"];
|
||||
_periodPosition = (ACE_time - GVAR(wind_period_start_time)) min _period;
|
||||
_periodPercent = _periodPosition / _period;
|
||||
|
||||
|
@ -16,9 +16,8 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_logic", "_units", "_activated"];
|
||||
_logic = _this select 0;
|
||||
_units = _this select 1;
|
||||
_activated = _this select 2;
|
||||
|
||||
params ["_logic", "_units", "_activated"];
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
@ -36,4 +35,4 @@ if !(_activated) exitWith {};
|
||||
// Server weather update interval
|
||||
[_logic, QGVAR(serverUpdateInterval), "serverUpdateInterval"] call EFUNC(common,readSettingFromModule);
|
||||
|
||||
GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600;
|
||||
GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600;
|
||||
|
@ -14,8 +14,8 @@
|
||||
if (!GVAR(syncRain)) exitWith {};
|
||||
|
||||
if (!isNil "ACE_RAIN_PARAMS") then {
|
||||
EXPLODE_3_PVT(ACE_RAIN_PARAMS,_oldRain,_newRain,_period);
|
||||
|
||||
ACE_RAIN_PARAMS params ["_oldRain", "_newRain", "_period"];
|
||||
|
||||
private ["_periodPosition", "_periodPercent"];
|
||||
_periodPosition = (ACE_time - GVAR(rain_period_start_time)) min _period;
|
||||
_periodPercent = (_periodPosition / _period) min 1;
|
||||
|
Loading…
Reference in New Issue
Block a user