E3SM-Project / ACME-ECP

E3SM MMF for DoE ECP project
Other
9 stars 1 forks source link

Set crm_qrad pointer regardless if updating radiation or not #88

Closed brhillman closed 5 years ago

brhillman commented 5 years ago

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.