DSSAT / dssat-csm-os

DSSAT Cropping System Model
BSD 3-Clause "New" or "Revised" License
148 stars 170 forks source link

Floating-Point Exception Error #420

Open mehmoodmz opened 4 months ago

mehmoodmz commented 4 months ago

Hi, I am getting a floating-point exception error while running CROPSIM-Wheat. What would be a better way to resolve this issue? Do I need to remove RSWT on Line 1022 or add RSWT on Line 1023?

https://github.com/DSSAT/dssat-csm-os/blob/cb4043a905a27d632c3243ac51caec546d1f0661/Plant/CROPSIM/CRP_Integrate.for#L1021 https://github.com/DSSAT/dssat-csm-os/blob/cb4043a905a27d632c3243ac51caec546d1f0661/Plant/CROPSIM/CRP_Integrate.for#L1022 https://github.com/DSSAT/dssat-csm-os/blob/cb4043a905a27d632c3243ac51caec546d1f0661/Plant/CROPSIM/CRP_Integrate.for#L1023

palderman commented 4 months ago

It seems like these comments indicate a desire to remove reserves from calculation of VNPCM:

https://github.com/DSSAT/dssat-csm-os/blob/cb4043a905a27d632c3243ac51caec546d1f0661/Plant/CROPSIM/CSCRP.for#L102-L106

VNPCM is itself calculated based on VANC:

https://github.com/DSSAT/dssat-csm-os/blob/cb4043a905a27d632c3243ac51caec546d1f0661/Plant/CROPSIM/CRP_Integrate.for#L1556

So presumably the calculation on line 1023 is as intended and it is the if statement on the preceding line that should be corrected:

https://github.com/DSSAT/dssat-csm-os/blob/cb4043a905a27d632c3243ac51caec546d1f0661/Plant/CROPSIM/CRP_Integrate.for#L1021-L1023

If so, then line 1022 would become:

            IF (((LFWT+STWT)*PLTPOP*10.0).GT.0.0)

@lpmorenoc , @GerritHoogenboom, @chporter , what do y'all think?

chporter commented 4 months ago

@palderman Nice detective work! Yes, I agree that this should solve the problem.