<jupyter_start><jupyter_text>header*this is 1st comment<jupyter_code>configuration = 'mom01v5'
#configuration = 'mom025'

#expts = cc.get_experiments(configuration)
# ericmod: changed above to:
expts = cc.querying.get_experiments(configuration)

display(expts)
ncfile = 'ocean.nc'
#expt = 'mom025_jra_ryf9091'
expt = 'KDS75_newbathy_JRA' 
@memory.cache
def load_mld(expt):
    ## Load mld from expt, pick up one year 
    mld = cc.get_variables(expt, 'ocean.nc', 'mld', 
                         time_units = 'days since 1900-01-01')
    #mld = cc.get_nc_variable(expt, 'ocean.nc', 'mld', 
    #                     time_units = 'days since 1900-01-01')
    mean_mld = mld.sel(time=slice('1902-01','1902-12')).mean('time')
    return mean_mld.load();  # force the calculation
mean_mld = load_mld(expt)
obs_filename = '/g/data3/hh5/tmp/cosima/observations/original/mld_DR003_c1m_reg2.0.nc'
obs = xr.open_dataset(obs_filename, decode_times=False)
mean_mld_obs = obs.mld.mean('time')<jupyter_output><empty_output><jupyter_text>MLD should always be positive (right?).  Mask out the negative values in the observations.<jupyter_code>mean_mld_obs.data[mean_mld_obs.data < 0] = np.nan<jupyter_output>/g/data1/v45/jm0634/miniconda3/envs/cosima/lib/python3.6/site-packages/ipykernel_launcher.py:1: RuntimeWarning: invalid value encountered in less
  """Entry point for launching an IPython kernel.<jupyter_text>Shift the grid of the observations so that it starts from -80W<jupyter_code>mean_mld_obs.data, mean_mld_obs.lon.data = shiftgrid(80, mean_mld_obs.data,
                                                 mean_mld_obs.lon.data, 
                                                     cyclic=360, start=True)
mean_mld_obs.lon.data = mean_mld_obs.lon.data - 160
fig, ax = plt.subplots(2,2, figsize=(12,8))

kwargs = {'vmin':0, 'vmax':400}

mean_mld.plot.contourf(ax=ax[0,0], **kwargs)
ax[0,0].set_title(expt)

mean_mld_obs.plot.contourf(ax=ax[0,1], **kwargs)
ax[0,1].set_title('Observation')


fig = plt.figure(figsize=(14,8))

ax1 = fig.add_subplot(2, 2, 1)
#cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
cax1 = ax1.pcolormesh(lon, lat, mld_mom, shading='flat', cmap=plt.cm.jet, vmin=0.0, vmax=400.0)
fig.colorbar(cax1)
#cbar.outline.set_linewidth(1)
plt.title('MOM mean MLD', fontsize=12)

ax2 = fig.add_subplot(2, 2, 2)
#cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
cax2 = ax2.pcolormesh(m_mld_obs.lon, m_mld_obs.lat, m_mld_obs, shading='flat', cmap=plt.cm.jet, vmin=0.0, vmax=400.0)
fig.colorbar(cax1)
#cbar.outline.set_linewidth(1)
plt.title('IFREMER mean MLD', fontsize=12)

ax3 = fig.add_subplot(2, 2, 3)
#cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
cax3 = ax3.pcolormesh(new_lon_mila, lat_mila, mld_mila, shading='flat', cmap=plt.cm.jet, vmin=0.0, vmax=400.0)
fig.colorbar(cax3)
#cbar.outline.set_linewidth(1)
plt.title('MILA GPV mean MLD', fontsize=12)

#ax4 = fig.add_subplot(2, 2, 4)
##cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
#cax4 = ax4.pcolormesh(lon_argo, lat_argo, m_mld_argo, shading='flat', cmap=plt.cm.jet)#, vmin=0.0, vmax=400.0)
#fig.colorbar(cax4)
##cbar.outline.set_linewidth(1)
#plt.title('Argo mean MLD', fontsize=12)

#ax4 = fig.add_subplot(3, 3, 4)
##cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
#cax4 = ax4.pcolormesh(lon, lat, max_mld_mom, shading='flat', cmap=plt.cm.jet, vmin=0.0, vmax=400.0)
#fig.colorbar(cax4)
##cbar.outline.set_linewidth(1)
#plt.title('MOM maximum MLD', fontsize=12)
#
#ax5 = fig.add_subplot(3, 3, 5)
##cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
#cax5 = ax5.pcolormesh(lon_obs, lat_obs, max_mld_obs, shading='flat', cmap=plt.cm.jet, vmin=0.0, vmax=400.0)
#fig.colorbar(cax5)
##cbar.outline.set_linewidth(1)
#plt.title('IFREMER maximum MLD', fontsize=12)
#
#ax6 = fig.add_subplot(3, 3, 6)
##cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
#cax6 = ax6.pcolormesh(new_lon_mila, lat_mila, max_mld_mila, shading='flat', cmap=plt.cm.jet, vmin=0.0, vmax=400.0)
#fig.colorbar(cax6)
##cbar.outline.set_linewidth(1)
#plt.title('MILA GPV maximum MLD', fontsize=12)
#
#ax7 = fig.add_subplot(3, 3, 7)
##cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
#cax7 = ax7.pcolormesh(lon, lat, min_mld_mom, shading='flat', cmap=plt.cm.jet, vmin=0.0, vmax=400.0)
#fig.colorbar(cax7)
##cbar.outline.set_linewidth(1)
#plt.title('MOM minimum MLD', fontsize=12)
#
#ax8 = fig.add_subplot(3, 3, 8)
##cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
#cax8 = ax8.pcolormesh(lon_obs, lat_obs, min_mld_obs, shading='flat', cmap=plt.cm.jet, vmin=0.0, vmax=400.0)
#fig.colorbar(cax8)
##cbar.outline.set_linewidth(1)
#plt.title('IFREMER minimum MLD', fontsize=12)
#
#ax9 = fig.add_subplot(3, 3, 9)
##cax1 = ax1.pcolormesh(x, y, old_m_sst, shading='flat', cmap=plt.cm.jet)
#cax9 = ax9.pcolormesh(new_lon_mila, lat_mila, min_mld_mila, shading='flat', cmap=plt.cm.jet, vmin=0.0, vmax=400.0)
#fig.colorbar(cax9)
##cbar.outline.set_linewidth(1)
#plt.title('MILA GPV minimum MLD', fontsize=12)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17173281703775412, 'fraction_numerical': 0.05304937076476283, 'mean_word_length': 5.231604342581424, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '331009', 'license': 'Apache-2.0', 'n_tokens_mistral': 2514, 'n_tokens_neox': 2367, 'n_words': 371, 'path': 'ContributedExamples/plot_mld.ipynb', 'repo_name': 'ericthemort/cosima-recipes', 'size': '5165'}