Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+(*)Avoid segmentation faults if PEN_SW_NBANDS = 0
Modified three routines in MOM_opacity to avoid segmentation faults if PEN_SW_NBANDS = 0, and hence if the optics type is not being allocated. In the case of optics_nbands(), this involved formally changing an optics_type argument into a pointer to an optics_type. (Pointers to an optics_type were already been used as the argument in all calls to optics_nbands(), but it was not always associated.) In two other routines, the change is simply to add a return call if there are 0 bands of shortwave radiation. With these changes, the single column test cases with no penetrating shortwave radiation now successfully run if PEN_SW_NBANDS = 0 and give answers that are identical to those obtained with PEN_SW_NBANDS = 1. All answers and output in cases that ran previously are bitwise identical, but there is a subtle change in a public interface.
- Loading branch information