Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix kitral with clang format #106

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Cell2Fire/FuelModelKitral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,12 @@ rate_of_spread_k(inputs* data,
p1 = -12.86;
p2 = 0.04316;
p3 = 13.8;
ch = (-2.97374 + 0.262 * rh - 0.00982 * tmp);
float midpoint = 57.09;
float steepness = 0.081;
float sigmoid = 1.0 / (1.0 + exp(-steepness * (rh - midpoint)));
ch = 4 + 16 * sigmoid - 0.00982 * tmp;
fmc = fmcs[data->nftype][0] * 60; // factor de propagacion en m/min
fch = (389.1624 + 14.3 * ch + 0.02 * pow(ch, 2.0))
/ (3.559 + 1.6615 * ch + 2.62392 * pow(ch, 2.0)); // es -14.3 segun el libro
fch = min(51.43, 52.3342 * pow(ch, -1.3035));
fv = p1 * exp(-p2 * ws) + p3;
if (ps == 0)
{
Expand Down
1 change: 1 addition & 0 deletions test/container_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ else
fi

rm -rf target_results
rm -rf test_results
exit 0
Binary file modified test/target_results.zip
Binary file not shown.
37 changes: 37 additions & 0 deletions test/target_updater.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# run simulations from model, put them in test_results, compare to target_results

# recreate targets with tests
rm -rf target_results.zip
# execute the for loop

# add to path
PATH=../Cell2Fire:$PATH

# run
set -x # enable debug tracing
for format in asc tif; do
for model in fbp kitral sb; do
echo running $model-$format
output_folder=test_results/$model-$format
mkdir -p $output_folder
rm -rf $output_folder/*
if [ "$model" == "fbp" ]; then
additional_args="--cros"
sim_code="C"
elif [ "$model" == "sb" ]; then
additional_args="--scenario 1"
sim_code="S"
elif [ "$model" == "kitral" ]; then
additional_args=""
sim_code="K"
fi
Cell2Fire$1 --input-instance-folder model/$model-$format --output-folder $output_folder --nsims 113 --output-messages --grids --out-ros --out-intensity --sim ${sim_code} --seed 123 --ignitionsLog $additional_args > test_results/$model-$format/log.txt
done
done
set +x # disable debug tracing

mv test_results target_results
zip -r target_results.zip target_results
rm -rf target_results

1 change: 1 addition & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ else
fi

rm -rf target_results
rm -rf test_results
exit 0
Loading