andrewdnolan / thermal-structure

Thermomechanically coupled surging experiments with Elmer/Ice
MIT License
0 stars 0 forks source link

Air temperate v.s. Elevation is different for surging and quiesence #13

Closed andrewdnolan closed 1 year ago

andrewdnolan commented 1 year ago

Description:

For the periodic simulations, the air temperature oscillates around the true value during surging (see figure). The oscillation is in either direction (above/below reference) and is nearly symmetric in time. This is obviously nonphysical as the air temperature / elevation relationship shouldn't be affected by surface speed or the timestep.

Here's an alternate view of the problem. This is the surface air temperature at the ELA, which is fixed elevation so it should have a constant air temperature. You can see the asymmetric but equal amplitude oscillations in either direction, which occur at the same interval as the forced surges (30 years). The 1 degree amplitude is huge in the context of our modeling, and too large to really ignore.

Diagnosis:

I'm fairly confident this problem has to do with variable timesteps used for the periodic simulation. To confirm I've run a test case with the a constant during quiescence and surging, for both the dynamic and thermodynamic solvers, of dt=0.05. Oscillation go away, though there is some noise in the mean value it's relatively minor and acceptable for where we are in the timeline.

Proposed solution:

My initial inclination is that this stems from a problem in converting time into day of year to evaluate the air temperature and melt functions. In order to fix this, I will re-parameterize all the code to be a function of time in years, instead of day of year.

andrewdnolan commented 1 year ago

My initial inclination is that this stems from a problem in converting time into day of year to evaluate the air temperature and melt functions. In order to fix this, I will re-parameterize all the code to be a function of time in years, instead of day of year.

Reparameterized air temperature, is not enough to fix this....

Attached is air temperature at ELA for a 75 year test simulation with the reparametrized air temperature functions as implemented in #14. Note the oscillations are still present, but note how they are now properly symmetric. I think the more accurate time resolution in the reparametrization is responsible for that. There's no round off error introduced by converting time in years to day of year.

So, while it alone might not fix the problem it's worth keeping as it's an improvement over the old day of year indexing approach.

andrewdnolan commented 1 year ago

Solution: Average at timestep versus over timestep

The problem arises from aliasing in the air temperature function evaluation. Specifically, difference in the average over the timestep versus the average at the timestep. With a constant timestep, the distinction between average over versus at doesn’t really matter, but with the periodic changes in timestep it does.

Example plot below demonstrates the problem. Backward and Forwards are both averages over the timestep, being backward and forwards timesteps respectively. Centered is the average at the timestep.

A constant $\Delta t=0.1$ is used, expect over the 2-year surge (shaded red region), where $\Delta t=0.5$. Note the phase shift in Backward and Forwards, and the change in the phase during the surge. With a constant timestep (e.g. initialization simulation), having a constant phase shift doesn't affect the results it just results in a slightly different $T_{\rm peak}$. But with the periodic changes in the timestep, and therefore different phase shifts in time, the results are effected.

In the case of Centered (i.e. average at) there is no phase shift, such that the phase properly matches the value set by $T_{\rm peak}$. I will note that the average with the moving window (bottom subpannel) still is not perfect. There is still some bobble around the mean during surging, but it's very small. I think with where we are that's acceptable and it's really more of a post-processing artifact than a numerical error.

test

In summary, the problem is not that the SurfaceBoundary.f90 file returns air temperatures that at $\pm 1 ^{\circ}\rm{C}$ different during surging, but that there is a phase shift in the air temperature sampling. As the timestep switches between surging and quiescence, the phase shift also changes. The $\pm 1 ^{\circ}\rm{C}$ difference is a post processing effect from using the rolling window mean over the time interpolated data.