NGEET / fates

repository for the Functionally Assembled Terrestrial Ecosystem Simulator (FATES)
Other
105 stars 92 forks source link

segmentation fault when writing restart file #1158

Closed yfang-repo closed 9 months ago

yfang-repo commented 9 months ago

FATES-SP: I see negative lb1/ub1 values when adding print statements here for a large size problem: (https://github.com/NGEET/fates/blob/42d804ba54d0cf013a9737018ff9920e0c9808ea/main/FatesRestartVariableType.F90#L92)

It can not be reproduced with a small size problem. Can anyone point to me where the lb and ub set? Thanks!

yfang-repo commented 9 months ago

It is still related to #986

ckoven commented 9 months ago

@yfang-repo seems like it is trying to make too big of an array in the cohort dimension? In SP mode, the size of that vector is determined by num_swb here I think? https://github.com/NGEET/fates/blob/42d804ba54d0cf013a9737018ff9920e0c9808ea/main/FatesInterfaceMod.F90#L874

Is the product of the number of gridcells and num_swb too big for the integer type that is being used?

yfang-repo commented 9 months ago

@ckoven I suspect fates_maxElementsPerSite is too big. Still doing some testing.

yfang-repo commented 9 months ago

I was using an older version. Reducing fates_maxElementsPerPatch helps.