As of ctsm5.4.047, I think there's a problem here:
|
factors(:maxveg) = comp_factors_table( ndx )%eff(:maxveg) |
|
! If fire emissions factor file only includes natural PFT's, but this is a crop case |
|
! Copy the generic crop factors to the crop CFT's from generic crop |
|
if ( size(factors) > nc3crop )then |
|
factors(nc3crop+1:) = comp_factors_table( ndx )%eff(nc3crop) |
|
end if |
- This
if() will evaluate to true even if the fire emissions factor file DOES include crop PFTs, since there is no condition in the if() checking for that. factors is of dimension maxveg; the condition should instead check the size of the eff array.
- Indeed, this code will error if the fire emissions factor file DOESN'T include crop PFTs, because of the reference to index
nc3crop of the eff array.
Unless I'm misinterpreting something... @ekluzek, I think you implemented this. Am I off-base?
(Note: After #4112 comes in, this will be replaced with a call to handle_too_short_fire_emis_factor_file(), which you will be able to find in src/main/pftconMod.F90. If all this turns out to be the intended behavior, the description in that subroutine should be updated.)
As of ctsm5.4.047, I think there's a problem here:
CTSM/src/biogeochem/FireEmisFactorsMod.F90
Lines 76 to 81 in 7409d32
if()will evaluate to true even if the fire emissions factor file DOES include crop PFTs, since there is no condition in theif()checking for that.factorsis of dimensionmaxveg; the condition should instead check the size of theeffarray.nc3cropof theeffarray.Unless I'm misinterpreting something... @ekluzek, I think you implemented this. Am I off-base?
(Note: After #4112 comes in, this will be replaced with a call to
handle_too_short_fire_emis_factor_file(), which you will be able to find insrc/main/pftconMod.F90. If all this turns out to be the intended behavior, the description in that subroutine should be updated.)