<jupyter_start><jupyter_text>Climate<jupyter_code>mean = ds.mean(['time', 'x'])
p = mean.p
tm = mean.TABS

tht  = tm * (1000/p)**(2/7)

levels = np.r_[270:350:5]

im = plt.contourf(tht.y, p, tht, levels=levels, extend='both')
plt.colorbar()
plt.clabel(im, colors='black', inline=False, fmt="%.0f")
plt.ylim([1000, 10])
plt.title("Potential Temperature")
plt.xlabel("y")
plt.ylabel("p")
# tht.plot.contourf(levels=levels)
plt.contourf(tm.y, p, tm)
plt.ylim([1000,10])
plt.colorbar()
plt.title("Absolute Temperature")
plt.xlabel("y")
plt.ylabel("p");
im = plt.contourf(mean.y, mean.p, mean.U,
                  levels=np.r_[-40:45:5], cmap='RdBu_r',
                  extend='both')


plt.contour(mean.y, mean.p, mean.U, levels=[-10, -8,-6,-4,-2,0], colors='k')
plt.ylim([1000,10])
plt.colorbar(im)
plt.title("Zonal Velocity")
plt.xlabel("y")
plt.ylabel("p");<jupyter_output><empty_output><jupyter_text>Spin-upNow I plot the temporal evolution of some different fields at a lower atmosphere height as the simulation spins up Here is the zonal velocity<jupyter_code>ds.U[::20, 5].plot(col='time', col_wrap=4)<jupyter_output><empty_output><jupyter_text>and the meridional velocity<jupyter_code>ds.V[::20, 5].plot(col='time', col_wrap=4)<jupyter_output><empty_output><jupyter_text>and the absolute temperature<jupyter_code>ds.TABS[::20, 5].plot(col='time', col_wrap=4)<jupyter_output><empty_output><jupyter_text>We can see that the equilibrium of the coarse-resolution NG-Aqua is very different than the true simulation. The N-S assymetry is especially strange. Why is that happening? Something with the radiation? We can look at the 2D fields to find this out<jupyter_code>d2d = xr.open_mfdataset(f"../OUT_2D/{caseid}*.nc")
d2d.SOLIN[5].plot()<jupyter_output><empty_output><jupyter_text>mmmm. there is no meridional variation in SOLIN. I must have configured the run incorrectly. Is the diurnal cycle there?<jupyter_code>d2d.SOLIN[:,32, 0].plot()<jupyter_output><empty_output><jupyter_text>No. I will have to make sure the radiation matches. How is the SST?<jupyter_code>d2_true = xr.open_dataset(true_path + "2d/all.nc").sortby('time')
d2_true.SST[0,:,0].plot(label='NG-Aqua')
d2d.SST[0,:,0].plot(label='QOBS')
plt.legend()<jupyter_output><empty_output><jupyter_text>That does match either...damn. Maybe I should just initialize it from the netCDF as well? NG-Aqua doesn't look like it's using the QOBS profile weirdly enough. Let's do some reverse engineering.<jupyter_code>y = d2_true.y.values
lat = (y-y.mean()) *2.5e-8 * 2 * np.pi

c = np.cos(lat*1.5)
s = np.sin(lat*1.5)
qobs = 273.15 + 27/2  *( 3 * c**2 - c**4)
# qobs = 273.15 + 27/2 * (2 - s**2 - s**4)
plt.plot(y, qobs, label='QOBS')
plt.plot(y, d2_true.SST[0,:,0], label='NGAqus')
plt.legend()<jupyter_output><empty_output><jupyter_text>I have tried to fix these discrepencies.<jupyter_code>caseid = "NGAqua_ngaqua.dt30.fixRad.fixQOBS"
ds = xr.open_mfdataset(f"{out_2d_path}/{caseid}_*.nc", autoclose=True)
ds.SST[0,:,0].plot(label='Fixed')
d2_true.SST[0,:,0].plot(label='NG-Aqua')<jupyter_output><empty_output><jupyter_text>Nice...the SST patterns line up nicely. What about the insolation?<jupyter_code>y = ds.SOLIN.y
sol_coarse = ds.SOLIN[0,:,0]
sol_true = d2_true.SOLIN[23,:,0]

plt.plot(y, sol_coarse, label='Coarse')
plt.plot(y, sol_true, label='NGAqua')


plt.legend()
float(ds.SOLIN.max())
float(d2_true.SOLIN.max())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17502198768689534, 'fraction_numerical': 0.03576663734975081, 'mean_word_length': 6.006160164271047, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '506015', 'license': 'MIT', 'n_tokens_mistral': 1523, 'n_tokens_neox': 1403, 'n_words': 269, 'path': 'ext/sam/visualization/1.1-init-ng-aqua.ipynb', 'repo_name': 'kbren/uwnet', 'size': '3411'}