Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extrapolation of results beyond the heating source #2

Closed
PovedaGerman opened this issue Jun 14, 2022 · 9 comments
Closed

Extrapolation of results beyond the heating source #2

PovedaGerman opened this issue Jun 14, 2022 · 9 comments

Comments

@PovedaGerman
Copy link

Hi, I've run xinvert for the Gill-Matsuno problem over the maritime continent, as shown in your example. The results I've got regarding h1, u1 and v1 are constrained just to the heating source region (see attached figure), but not to the entire Indo-Pacific region as in your figures. I think the problem can be in the plotting of the wind and streamfunction, which I include below. I appreciate any help. Many thanks in advance.

##########################
import os
import matplotlib.pyplot as plt
from netCDF4 import Dataset as netcdf_dataset
import numpy as np

from cartopy import config
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.mpl.ticker import (LongitudeFormatter, LatitudeFormatter,
LatitudeLocator)

plt.figure(figsize=(40,20))

heat = Q1
lats = lat
lons = lon

skip = 1
fontsize = 16

ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines()
ax.add_feature(cfeature.BORDERS)
Results constrained to Heating Source Region

Grid for Heating source - Maritime Continent

ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True,
xlocs=np.arange(-140,100, 80), ylocs=np.arange(-40, 40, 40),
x_inline=False, y_inline=False, linewidth=0.33, color='k',alpha=0.5)

Heat Source Region

cmap = plt.colormaps['jet']
ax.contourf(lons, lats, Q1, 10, transform=ccrs.PlateCarree(), cmap=cmap , levels=np.linspace(-0.05, 0.05, 10))

Contours for h1

ax.contour(lons, lats, h1, transform=ccrs.PlateCarree(), cmap='jet')

windspeed = (u1 ** 2 + v1 ** 2) ** 0.5
windspeed.rename('windspeed')

Plot the wind speed as a contour plot

ax.contour(lons, lats, windspeed, 20, cmap='jet')

Add arrows to show the wind vectors

plt.quiver(lons, lats, u1, v1, pivot='middle', width=0.0015, headwidth=1., headlength=1., minlength=1)

#Limits for Maritime Continent
Results constrained to Heating Source Region

ax.set_ylim([-40, 40])
ax.set_xlim([40, 200])

plt.show()

@miniufo
Copy link
Owner

miniufo commented Jun 15, 2022

Hi thanks for your interests in this. So you don't use xarray? You can install it and load your netcdf file by dset = xarray.open_dataset('data.nc') and then quickly peek the dataset by dset.u.plot(). Also, the results returned by xinvert are also xarray object and can be plotted simply as u_gill.plot()

That is not the key point. Could you please show that if your heating source is a 2D global field? If yes, the returned data will be a 2D global field. Note that do not fill the region where heat source = 0 with nan, because nan is used as land-sea mask by default.

@PovedaGerman
Copy link
Author

Hi, many thanks for your answer. It seems that the problem has to do with the definition of longitudes and latitudes of the heating source and the region for which h1, v1 and u1 are estimated. Can you please clarify what are your:

lat, lon = xr.broadcast(ds.lat, ds.lon) for the heating source, and
lat, lon = xr.broadcast(u1.lat, u1.lon) for the impacted region

Many thanks in advance.

@miniufo
Copy link
Owner

miniufo commented Jun 17, 2022

Hi, I guess you read my notebook about Gill model at here. Now I've change a little of the notebook so that the heat source Q is a global field, and so are the h1, u1 and v1. You can follow this example because this idealized test does not need any data files.

@PovedaGerman
Copy link
Author

PovedaGerman commented Jun 17, 2022 via email

@PovedaGerman
Copy link
Author

PovedaGerman commented Oct 11, 2022 via email

@miniufo
Copy link
Owner

miniufo commented Oct 11, 2022

Sorry, I cannot see your figure. Could you post it as a link?

@PovedaGerman
Copy link
Author

This is the figure:
Amazon Heating

@miniufo
Copy link
Owner

miniufo commented Oct 12, 2022

Well, I see... The original Gill model does not take into account topographic effects. But I guess one can modify it to parameterize their effect into the model. As xinvert support topographic (see oceanic case), maybe you can prescribe the Andes as a patch of NaN and set kwarg undef=np.nan. Then you can get the flow stopped at Andes.

Also, the effects of the cooling over the cold tongue is not clear. You can invert the flow separately for the cooling source only. Generally, the flow pattern is NOT totally unrealistic to me. It still fits Gill's classical pattern in the tropics.

@PovedaGerman
Copy link
Author

Many thanks for your insights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants