RE: [ncl-talk] problems with lat and lon CMIP5 data (regridding)

From: Vanúcia Schumacher <vanucia-schumacher_at_nyahnyahspammersnyahnyah>
Date: Thu Jun 19 2014 - 15:11:41 MDT

Hi Mary,
Thank you for your help and for the explanations. I sending the scripts that I tried to plot the regridding when I using the ferret, so it was like SIT_NEW variable name, sorry. But even so, you could help!

---Vanúcia SchumacherMestranda em Meteorologia - UFVMeteorologista -UFPel
Departamento de Meteorologia Agrícola - DEACel: (31) 9978 2522 DEA: (31) 3899 1890

Date: Thu, 19 Jun 2014 11:09:52 -0600
Subject: Re: [ncl-talk] problems with lat and lon CMIP5 data (regridding)
From: haley@ucar.edu
To: vanucia-schumacher@hotmail.com
CC: ncl-talk@ucar.edu

The problem is that you are using "i" and "j" on the file for the lat/lon input grid, and these are just index values.
If you look at your data with printVarSummary, you will see a "coordinates" attribute equal to "lat lon". This tells you that the file should contain variables "lat" and "lon" on the file. You need to read these and use them in the linint2_Wrap program. See attached.

I also cleaned up your plotting program, because you had this code, which doesn't make any sense:
t!0="TIME"t!1="Y2DEG"t!2="X2DEG"
lat=t!2lon=t!1
Since you are regridding to a rectilinear grid, you shouldn't need to do anything with the named dimensions or coordinate arrays. When you read in the variable, the coordinate arrays will be attached to the variable, and the NCL plotting program will see this and use them.

I created an ESMF version of your regridding so you could compare the different methods. The ESMF script does the regridding and plotting in one script.
--Mary


On Sat, Jun 14, 2014 at 7:42 AM, Vanúcia Schumacher <vanucia-schumacher@hotmail.com> wrote:

Hi users,

I need to change resolution grid data to 2x2, but when the data changes, not plotam nothing in the graphic, or plotam strangely, SST data over the continent, very crazy! I think the problem is in how the data lat and lon are in the original data are not linear, increase and decrease.
Anyone know how to help me solve this problem?
ncview original data:
lat = 76.3555, 76.29813, 76.23743, 76.17345, 76.10631, 76.03609, 75.9629, 75.88685, 75.80793, 75.72632, 75.64211, 75.55537, 75.46625, 75.37481, 75.28114, 75.18538, 75.08758, 74.98788, 74.88635, 74.78318, 74.67834,
    74.57199, 74.46423, 74.35518, 74.24488, 74.13348, 74.021, 73.9076, 73.79334, 73.67832, 73.56266, 73.44637, 73.32957, 73.21239, 73.09487, 72.97706, 72.85907, 72.741, 72.62287, 72.50481, 72.38686, 72.26913,
    72.15161, 72.03442, 71.91764, 71.80134, 71.68554, 71.57033, 71.45573, 71.34185, 71.22874, 71.11639, 71.00497, 70.89444, 70.78489, 70.67636, 70.56889, 70.46255, 70.35738, 70.25343, 70.15072, 70.04929, 69.94922,
    69.85054, 69.75326, 69.65746, 69.56313, 69.47035, 69.37914, 69.28954, 69.20152, 69.11521, 69.03059, 68.94769, 68.86656, 68.78719, 68.70966, 68.63393, 68.56007, 68.48814, 68.41808, 68.34997, 68.2838, 68.2196,
    68.15743, 68.09725, 68.03913, 67.98302, 67.92903, 67.87708, 67.82724, 67.77953, 67.73394, 67.6905, 67.64921, 67.61011, 67.57315, 67.53839, 67.50585, 67.47548, 67.44734, 67.42143, 67.39776, 67.3763, 67.35709,
    67.34013, 67.32541, 67.31296, 67.30275, 67.29481, 67.28914, 67.28571, 67.28455, 67.28564, 67.289, 67.29462, 67.3025, 67.31262, 67.32501, ......
The values ​​of lat and lon start in 76.3555, and decrease and then increase again!
When interpole for new resolution grid, I believe that NCL not do right for these values ​​of lat and lon.

Variable: varType: float
Total Size: 39049920 bytes 9762480 values
Number of Dimensions: 3Dimensions and sizes: [time | 360] x [i | 149] x [j | 182]
Coordinates:
            time: [15.5..10934.5] i: [1..149]
            j: [1..182]Number Of Attributes: 12
  standard_name : sea_ice_thickness long_name : Sea Ice Thickness
  comment : the mean thickness of sea ice in the ocean portion of the grid cell (averaging over the entire ocean portion, including the ice-free fraction). Reported as 0.0 in regions free of sea ice.
  units : m
  original_name : iicethic cell_methods : time: mean (interval: 30 minutes) area: mean where sea
  cell_measures : area: areacello
  history : 2011-11-11T12:43:09Z altered by CMOR: replaced missing value flag (9.96921e+36) with standard missing value (1e+20).
  missing_value : 1e+20 _FillValue : 1e+20
  associated_files : baseURL: http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile: gridspec_seaIce_fx_IPSL-CM5A-LR_decadal1980_r0i0p0.nc areacello: areacello_fx_IPSL-CM5A-LR_decadal1980_r0i0p0.nc
  coordinates : lat lon

Variable: new_var
Type: floatTotal Size: 23328000 bytes
            5832000 valuesNumber of Dimensions: 3
Dimensions and sizes: [time | 360] x [lat | 90] x [lon | 180]
Coordinates: time: [15.5..10934.5]
            lat: [-87.86..87.86] lon: [ 0..358]
Number Of Attributes: 12 standard_name : sea_ice_thickness
  long_name : Sea Ice Thickness
  comment : the mean thickness of sea ice in the ocean portion of the grid cell (averaging over the entire ocean portion, including the ice-free fraction). Reported as 0.0 in regions free of sea ice.
  units : m
  original_name : iicethic cell_methods : time: mean (interval: 30 minutes) area: mean where sea
  cell_measures : area: areacello
  history : 2011-11-11T12:43:09Z altered by CMOR: replaced missing value flag (9.96921e+36) with standard missing value (1e+20).
  missing_value : 1e+20 _FillValue : 1e+20
  associated_files : baseURL: http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile: gridspec_seaIce_fx_IPSL-CM5A-LR_decadal1980_r0i0p0.nc areacello: areacello_fx_IPSL-CM5A-LR_decadal1980_r0i0p0.nc
  coordinates : lat lon

my code:

begin

fils = systemfunc("ls *.nc")

f = addfiles(fils, "r")

ListSetType(f,"join")

var = f[:]->sit

var!0="time"var!1="i"
var!2="j"
newfile = "sit1.nc"

system("rm -f "+newfile)

file_create = addfile(newfile, "c") ;criando arquivo.

new_lon = fspan(0, 358, 180) ; usually no cyclic point
new_lon@units = "degrees_east"new_lon!0 = "lon"

new_lat = fspan(-87.86, 87.86, 90)
new_lat@units = "degrees_north"new_lat!0 = "lat"

new_var = linint2_Wrap(var&j,var&i,var,True,new_lon,new_lat,0)

file_create->media = new_var

end


Vanúcia Schumacher

                                               

_______________________________________________

ncl-talk mailing list

List instructions, subscriber options, unsubscribe:

http://mailman.ucar.edu/mailman/listinfo/ncl-talk



                                               

Received on Thu Jun 19 09:11:43 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT