Previously, the crm_qrad pointer was only being set if either shortwave or longwave radiative fluxes were to be updated, but crm_qrad is still accessed at the bottom of radiation_tend to do the weighting by state%pdel regardless of if radiation was updated or not. Thus, we were trying to access a pointer that may or may not have been set each timestep (if iradsw > 1 or iradlw > 1). The simple fix is to set the pointer (via calling pbuf_get_field) outside of the if (dosw .or. dolw) logical block.
Previously, the
crm_qrad
pointer was only being set if either shortwave or longwave radiative fluxes were to be updated, butcrm_qrad
is still accessed at the bottom of radiation_tend to do the weighting bystate%pdel
regardless of if radiation was updated or not. Thus, we were trying to access a pointer that may or may not have been set each timestep (ifiradsw > 1
oriradlw > 1
). The simple fix is to set the pointer (via callingpbuf_get_field
) outside of theif (dosw .or. dolw)
logical block.