Plot variables from WRF-NetCDF

14 次查看(过去 30 天)
Emanuel Valdes
Emanuel Valdes 2019-3-18
I'm trying to plot the variable T2 (temperature at 2meters) from my netCDF file, made in Weather Research and Forecasting (WRF) Model. I was following the example of this video: https://www.youtube.com/watch?v=PJurb-IPKM8
Here is my code:
filename = 'wrfout_d03_2018-06-01_00';
ncdisp(filename);
temp = ncread (filename,'T2');
lat = ncread (filename,'XLAT');
lon = ncread (filename,'XLONG');
mapin = pcolor(lon,lat,temp')
load coast
hold on
plot(long,lat,'k','LineWidth',1.5)
plot(long+360,lat,'k','LineWidth',1.5)
The problem is that my variables have 3 dimensions instead of 2. Is there any way of get latitude and longitude from variables XLAT and XLONG?
  2 个评论
KSSV
KSSV 2019-3-18
What is the depth variable in meters which defines depth in the file? I assume it to be ZS..if I am no tmistaken. There is no 4 meters values in that.
Emanuel Valdes
Emanuel Valdes 2019-3-18
编辑:Emanuel Valdes 2019-3-18
Sorry, I'm not getting your question. T2 it's temperature at 2 meters of height. I guess this is my problem:

请先登录,再进行评论。

回答(1 个)

Werner Barros
Werner Barros 2019-10-22
You can use the function squeeze(variable)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by