issues with auto Demange filter
There are several options to deal with barotropic time filtering:
- use boxcar averages (nn_bt_flt = 1 or 2)
- use Demange filter (nn_bt_flt = 3) => one has to set in addition: rn_bt_alpha
On top of that, there are 2 options to deal with the barotropic time step:
- ln_bt_auto=F => set in the namelist (nn_e)
- ln_bt_auto=T => set it automatically depending on CFL (rn_bt_cmax)
==> The problem is: we can use the combination of options: ln_bt_auto=T, nn_bt_flt=3 and rn_bt_alpha=0. But this combination fails. We have to ensure that rn_bt_alpha/=0 when nn_bt_flt=3
==> Another issue (unlikely) could be: the coefficients a0, a1, a2, a3 below do not converge to the same value when rn_bt_alpha is 0 and very small. But it is probably OK
IF( rn_bt_alpha == 0._wp ) THEN ! Time diffusion
za0 = 0.614_wp ! za0 = 1/2 + gam + 2*eps
za1 = 0.285_wp ! za1 = 1/2 - 2*gam - 3*eps
za2 = 0.088_wp ! za2 = gam
za3 = 0.013_wp ! za3 = eps
ELSE ! no time diffusion
zepsilon = 0.00976186_wp - 0.13451357_wp * rn_bt_alpha
zgamma = 0.08344500_wp - 0.51358400_wp * rn_bt_alpha
za0 = 0.5_wp + zgamma + 2._wp * rn_bt_alpha + 2._wp * zepsilon
za1 = 1._wp - za0 - zgamma - zepsilon
za2 = zgamma
za3 = zepsilon
ENDIF