Closed khufkens closed 3 years ago
As long as par_shape_tempstress
is zero, this takes no effect and values of tau_acclim_tempstress
.
I cannot reproduce this. My R session crashes when running the above code after merging the pull request from your fork.
Instability of Jmax. This should not happen. Is it the only variable that is unstable? Jmax is not tested separately in the benchmarking.
Just checked the unit tests, seems that segfault in mac and windows. I only changed the CFLAG and _Bool to Int to avoid errors as commented in the code.
This may be a problem: In sofun_r.f90
:
logical(kind=c_bool), intent(in) :: soilmstress
and in wrappersc.c
:
int *soilmstress,
Should probably be received in Fortran as a integer (integer(kind=c_int)
) if passed on in wrappers as integer. And what about R? Now we have
as.logical(params_siml$soilmstress)
Shouldn't it be converted to integer (0 or 1) already here?
Not sure how if()
statements are dealt with in Fortran and if 0 / 1 i accepted as identical to .TRUE. / .FALSE.
as.logical(TRUE)
is TRUE
as.integer(TRUE)
1
See the note on Boleans in this post
Basically it is asking for trouble, depending on the compiler and platform used.
Although I doubt that this is the issue here.
The runs on my old setup worked on both MacOS and Windows.
https://github.com/bluegreen-labs/rsofun_reference/runs/3132618063?check_suite_focus=true
Missing tmin and tmax here:
Need to update the driver file as well it seems.
Fixed as per https://github.com/stineb/rsofun/pull/27
When calling the p-model with the same input parameters several times the returned results are not the same.
@stineb are there any non-deterministic parts in the p-model (optimized), relying on internal optimization? I'm not sure which parameter set to use with the additions of
tau_acclim_tempstress
etc. However, even if parameters are nonsensical the output should be stable (if deterministic).Worked example returning jmax25