[MITgcm-support] Unexpected behavior when using ALLOW_3D_DIFFKR

Christopher L.P. Wolfe clwolfe at ucsd.edu
Sat Aug 13 18:11:48 EDT 2011


Hi all:

 I'd just like to report some unexpected behavior that people might encounter if they enable the flag ALLOW_3D_DIFFKR in CPP_OPTIONS.h. This causes the diffusivity of *both* heat and salt to described by a single 3D variable diffKr. I wanted a vertically variable diffusivity field with the option of a laterally varying pattern of increased diffusivity. Since I'm running with a single-component equation of state (just heat), the fact the heat and salt diffusivity were no longer independent was not a problem. The unexpected behavior occurred in the initialization of 
diffKr in INI_MIXING, which contains the line

#ifdef ALLOW_3D_DIFFKR
	diffKr(i,j,k,bi,bj) = diffKrNrS(k)
#endif

Thus, if you turn on ALLOW_3D_DIFFKR and don't specify a file describing the diffusivity, diffKr has the same vertical distribution of the *salinity,* not the heat. Since I've been running with temperature-only, I specified diffKrNrT, but I let default to diffKrNrS(k) = 0. So, all this time I've been running with ZERO diffusivity rather than the vertical profile I thought I'd had (the nonlinear advection scheme kept the solution from blowing up). Needless to say, this is not what I expected to happen and I think a lot of people could fall into the same trap. Obviously, we should all read all the relevant code before enabling a feature, but this doesn't always possible (plus it's easy to misread diffKrNrS as dirrKrNrT).

To keep others from falling down this same rabbit hole, I suggest that someone with write-access to the CVS insert a little comment in CPP_OPTIONS explaining that diffKr defaults to the salinity diffusivity. Or perhaps the code should generate a warning when diffKr is initialized to be identically zero.

Now, I'm going to go rerun a lot of numerical experiments … 

Cheers,
Christopher

-----------------------------------------------------------
Dr. Christopher L. Wolfe              	   858-534-4560
Physical Oceanography Research Division    OAR 357
Scripps Institution of Oceanography, UCSD  clwolfe at ucsd.edu
-----------------------------------------------------------






More information about the MITgcm-support mailing list