New diagnostics ignores the value of ncheck set in the collisions namelist
Issue #88
new
The collisions namelist provides an input ncheck
which is supposed to set the time step interval between calculating the velocity space error and adjusting the collisionality. Unfortunately the new diagnostic module ignores this value and instead provides its own ncheck
input which has a different (much smaller) default.
The module should use the value given in the collision namelist, as done by the original diagnostics. This will ensure more consistent behaviour and reduce the default cost of enabling adaptive collisionality.
(Notionally assigning to @Joseph Parker as I’m aware he has looked at this diagnostic in the past)
Comments (2)
-
reporter -
reporter - changed milestone to 8.1
- Log in to comment
I think we probably want to revisit this code in both old and new diagnostics.
The write_verr methods call get_verr whenever
mod(istep,nwrite) .or. mod(istep, ncheck) == 0
. For the old diagnostics ncheck is taken from the collisions namelist, whilst in the new diagnostics it uses a value from the diagnostics namelist. Theget_verr
method has two jobs, it first calculates estimates of the vspace error and then if vary_vnew is true it also changes the collision frequencies to try to mitigate the errors. This second task depends on the error estimates but isn’t really a diagnostic so it seems strange that our diagnostics can have a side effect which changes the evolution of the physics.In new diagnostics this writes the verr space diagnostics to netcdf just when
mod(istep,nwrite)==0
. The old diagnostics only write to text file and do this for both nwrite and ncheck conditions.We should have a single input to define the frequency with which we change the collision frequency (collisions:ncheck).
We should probably split
get_verr
into two routines, one to calculate the error and one to adjust the collisionality given the error estimates. We should then probably move the collision frequency adjustment out of diagnostics, perhaps into our main time advance loop or similar. This has the downside that we might have to calculate the error estimates twice on the same step (e.g. if nwrite==ncheck) but I think this is worth it to separate the two tasks properly.