atmtools / konrad

Implementation of a radiative-convective equilibrium model.
MIT License
19 stars 18 forks source link

Cloud output #79

Closed SallyDa closed 1 year ago

SallyDa commented 5 years ago

It would be nice to be able to get the cloud properties as output. At the moment it doesn't work to just make the cloud a child of component, because some of the cloud parameters have an extra dimension. We could also think about whether we want all of the output, or just some of it. For liquid_and_ice_clouds, maybe it would be nice to have the optical depths, as calculated by RRTMG, in the output, to compare to runs using direct_input. Or have you decided to only use DirectInputCloud and its children anyway? On the other hand, we definitely don't need eg. ice_particle_size in the DirectInputCloud output.

SallyDa commented 5 years ago

In case you run out of things to do when I'm on holiday @lkluft ;)

lkluft commented 5 years ago

Hey,

I think we have to make some decisions here, but just as a brief outline, we would need to:

  1. Make the cloud class a subclass of Component
  2. Set all required coords (e.g. the mid levels and bands). Currently we are only doing this in the Atmosphere class as time, plev, and phlev are also used by all other components.
  3. At the moment, each variable is an attribute cloud.cloud_asymmetry_parameter. The way the Component class is implemented, those variables should be values in the component.data_vars dictionary that can be accessed using a key cloud['cloud_asymmetry_parameter']. An ad hoc workaround could be to overload the __getattr__ method of the cloud class to also look for entries in the data_vars dictionary.