As far as I can see, almost all of the relevant code for the calculation of SMWT is contained within the swmt class (with the exception of a few calculations loaded from the compute module). For me, this makes the organization of the code a bit confusing and difficult to follow. It also seems to make testing out different parts of the code challenging (as evidenced by a number of repeated functions in the compute module). Furthermore, I think having things arranged in this way will make further developments harder (for example when requiring a density calculation for 3D WMT, and thus having to repeat it all within a new class).
I'm not sure of the best way to arrange things, and that is open to discussion. In the first instance, I could imagine having separate modules for different aspects of the calculation, in particular the thermodynamic calculations (density, alpha, beta, density tendency), the processing calculations (i.e. deriving hldot given various inputs), and the wmt calculations (where the tendencies are integrated, or the transformation maps derived).
As far as I can see, almost all of the relevant code for the calculation of SMWT is contained within the
swmt
class (with the exception of a few calculations loaded from thecompute
module). For me, this makes the organization of the code a bit confusing and difficult to follow. It also seems to make testing out different parts of the code challenging (as evidenced by a number of repeated functions in thecompute
module). Furthermore, I think having things arranged in this way will make further developments harder (for example when requiring a density calculation for 3D WMT, and thus having to repeat it all within a new class).I'm not sure of the best way to arrange things, and that is open to discussion. In the first instance, I could imagine having separate modules for different aspects of the calculation, in particular the
thermodynamic
calculations (density, alpha, beta, density tendency), theprocessing
calculations (i.e. deriving hldot given various inputs), and thewmt
calculations (where the tendencies are integrated, or the transformation maps derived).