Open mccabete opened 3 years ago
@mccabete Does it run if you set IALLOM=0? In principle IALLOM=3 should change only the functional form of allometric equations for tropical PFTs only, and not affect temperate PFTs. It sound like a bug in any case, but it would help to figure out if this is a general bug or something specific to IALLOM=3 changing more equations than what it should.
Yeah, Looking back at my run logs I also get this if IALLOM is 0
sorry forgot I did that test run
The routine causing the crash is reduced_wind8, and from the message you sent, the error is around here (though the exact line 2029 is just a comment)
Because there is a division for zero and a log, my hunch is that the floating point exception is coming from there. Perhaps you could add a temporary sanity check like the one below and see what it reports.
if ( (height < dheight) .or. rough <= 0.d0 ) then
write(unit=*,fmt='(a)') ' Invalid height scales in reduced_wind8!'
write(unit=*,fmt='(a,1x,es12.5)') 'Height = ',height
write(unit=*,fmt='(a,1x,es12.5)') 'Displacement = ',dheight
write(unit=*,fmt='(a,1x,es12.5)') 'Roughness = ',rough
call fatal_error('Height scales are incorrectly set.','reduced_wind8' &
,'canopy_struct_dynamics.f90')
end if
The default temperate C3 grass allometry make them very short, and we impose minimum vegetation height for calculating many things due to numeric stability. I guess this could create instances where height is less than displacement height. If roughness is the culprit, then I don't know... Also, it may be worth trying to run with different ICANTURB settings, to see if the problem is specific to one implementation or a more general issue.
Thanks for the check code, I'll try it out. I agree, it looks like a height related thing. This was with C4 grasses (PFT 1).
If I run grasses with IS_TROPICAL = 1, then they are able to produce output. If IS_TROPICAL = 0, it will get an error that traces back to here: https://github.com/EDmodel/ED2/blob/fa80dab6a258a69eede77b9e5c46d94173ff6ba1/ED/src/dynamics/canopy_struct_dynamics.f90#L2031
Because it is an issue with logging a height parameter, I suspect that differences in tropical allometries vs non tropical is the culprit. This is under IALLOM = 3 (the beta allometry scheme).