Small changes to baroclinic vorticity calculation in src/cases/derivatives/derivatives.cpp and src/Science/compute_baroclinic_vort.cpp, outlined below.
2D calculation of the baroclinic vorticity in compute_baroclinic_vort.cpp was incorrectly clearly variables from a previous timestep, this has been fixed.
In the old version of compute_baroclinic_vort.cpp
, line 25 was barovort = temp*temp;
. In 3D, the variable 'temp' is calculated by line 21 compute_baroclinic_vort_x(temp, T, gradient_op, grid_type);
. But in 2D, 'temp' is not initialized and in line 25 'temp' was determined by the previous time step (and is never cleared in derivatives.cpp).
I also took the opportunity to add a factor of 1/rho_0 to derivatives.cpp to the baroclinic vorticity calculation. It is included for calculations like vortex stretching/tilting and hence creates an issue when comparing magnitudes (if you forget or are unaware of the missing factor of 1/rho_0). The change below in derivatives.cpp fixes this issue.