Skip to content

Changing insolation attribute of single-column RRTMG process doesn't work #172

@brian-rose

Description

@brian-rose

The problem

If I create a single-column RRTMG process like this:

import climlab
state = climlab.column_state()
rad1 = climlab.radiation.RRTMG(state=state)
rad1.compute_diagnostics()

and then make a clone and modify the insolation:

rad2 = climlab.process_like(rad1)
rad2.insolation *= 1.1
rad2.compute_diagnostics()

we should find that the insolation actually changes! But that's not the case, e.g. taking

rad2.ASR - rad1.ASR

gives

Field([0.])

The reason is that the modified insolation is not passed down to the shortwave radiation subprocess:

print(rad2.insolation)
print(rad2.subprocess['SW'].insolation)

gives

375.43000000000006
341.3

A not-so-good workaround

A workaround is to define the insolation at model creation, like this:

rad3 = climlab.radiation.RRTMG(state=state, insolation=rad1.insolation * 1.1)
rad3.compute_diagnostics()
rad3.ASR - rad1.ASR

gives

Field([25.15180942])

But this is a bug! Modifying the insolation attribute in place should always result in the correct value being passed to the shortwave subprocess.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions