CliMT / climt

The official home of climt, a Python based climate modelling toolkit.
https://climt.readthedocs.io
Other
160 stars 46 forks source link

RRTMG extra dimension handling #40

Closed mcgibbon closed 5 years ago

mcgibbon commented 6 years ago

Two main points here:

In rrtmg_sw_rad.f90, the comments say the following:

! This call to RRTMG_SW must be preceeded by a call to the module
!     mcica_subcol_gen_sw.f90 to run the McICA sub-column cloud generator,
!     which will provide the cloud physical or cloud optical properties
!     on the RRTMG quadrature point (ngptsw) dimension.

However, we never call mcica_subcol_gen_sw. That file produces all arrays that are meant to be of dimension ngptsw. Whatever we're doing is something quite weird.

For example, tracking cloud fraction, at the component interface we have 'cloud_area_fraction_in_atmosphere_layer' which becomes cloud_fraction in the cython wrapper, of dimension [mid_levels, lat, lon] at that point in Fortran ordering. That is passed to the parameter cldfmcl in the Fortran code, which is supposed to be of dimension [ngptsw, ncol, nlay]. We've told the Fortran code that ncol is 1 and nlay is the number of vertical levels, so we can pass a column at a time. So through this we pass in an array that doesn't even have a ngptsw dimension to the Fortran code that wants such a dimension. I feel like I'm missing something here, since that seems like the code shouldn't run at all.

I'll continue digging through this.

mcgibbon commented 6 years ago

@JoyMonteiro is it that we're actually using rrtmg_sw_rad.nomcica.f90? It seems like if that's the case, we're only allowed to use the "clear only" overlap method, and cloud fractions other than 0 and 1 aren't allowed. That would seem undesirable.

mcgibbon commented 6 years ago

OK for now I'll move forward with the Sympl 0.4.0 refactors leaving these as they are, but after that we should maybe think about enabling MCICA. The cloud fraction limitations seem big. What do you think? I may also add some code to make sure num_shortwave_bands is of the correct length.

JoyMonteiro commented 5 years ago

Closed by https://github.com/CliMT/climt/pull/83