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

fire-hydro bug fix #665

Merged
merged 2 commits into from
Jul 2, 2020
Merged
Changes from 1 commit
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
Next Next commit
resolve a bug when relh is zero
  • Loading branch information
xuchongang committed Jun 18, 2020
commit 17e1b2870cea0d91986e4e27197096efc5987033
2 changes: 1 addition & 1 deletion fire/SFMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ subroutine fire_danger_index ( currentSite, bc_in)
d_NI = 0.0_r8
currentSite%acc_NI = 0.0_r8
else
yipsolon = (SF_val_fdi_a* temp_in_C)/(SF_val_fdi_b+ temp_in_C)+log(rh/100.0_r8)
yipsolon = (SF_val_fdi_a* temp_in_C)/(SF_val_fdi_b+ temp_in_C)+log(max(1.0_r8,rh)/100.0_r8)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that this was necessary. RH<1 is incredibly dry, almost impossible. How low are the values seen here?

dewpoint = (SF_val_fdi_b*yipsolon)/(SF_val_fdi_a-yipsolon) !Standard met. formula
d_NI = ( temp_in_C-dewpoint)* temp_in_C !follows Nesterov 1968. Equation 5. Thonicke et al. 2010.
if (d_NI < 0.0_r8) then !Change in NI cannot be negative.
Expand Down