[ncl-talk] problems with regriding

Mary Haley haley at ucar.edu
Fri Aug 22 16:07:04 MDT 2014


​The problem is that you have those "I" and "J" coordinate arrays attached
to your variable. By default, if ESMF_regrid sees coordinate arrays, it
will try to use them in regridding.

Try deleting them before you do any regridding​:

delete(sit&I)
delete(sit&J)

--Mary


On Fri, Aug 22, 2014 at 2:50 PM, Vanúcia Schumacher <
vanucia-schumacher at hotmail.com> wrote:

> Hi Mary,
>
> I tried with the ESM and the following error appears:
>
>
> Variable: sit
> Type: double
> Total Size: 78099840 bytes
>             9762480 values
> Number of Dimensions: 3
> Dimensions and sizes: [TIME | 360] x [J | 149] x [I | 182]
> Coordinates:
>             TIME: [76.5..11002.5]
>             J: [1..149]
>             I: [1..182]
> Number Of Attributes: 4
>   missing_value : -9.999999999999999e+33
>   _FillValue : -9.999999999999999e+33
>   long_name : TOS[L=3:122]
>   history : From tos_Omon_CMCC-CM_decadal1980_r1i1p1_198011-199012
> warning:Non-monotonic coordinate array generated -- check validity of the
> aggregated (leftmost) dimension
> warning:Non-monotonic coordinate array generated -- check validity of the
> aggregated (leftmost) dimension
>
> Variable: sit
> Type: double
> Total Size: 78099840 bytes
>             9762480 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 360] x [lat | 149] x [lon | 182]
> Coordinates:
>             time: [76.5..11002.5]
>             lat: [1..149]
>             lon: [1..182]
> Number Of Attributes: 6
>   lon2d : <ARRAY of 546 elements>
>   lat2d : <ARRAY of 447 elements>
>   missing_value : -9.999999999999999e+33
>   _FillValue : -9.999999999999999e+33
>   long_name : TOS[L=3:122]
>   history : From tos_Omon_CMCC-CM_decadal1980_r1i1p1_198011-199012
>
> warning:Non-monotonic coordinate array generated -- check validity of the
> aggregated (leftmost) dimension
> warning:Non-monotonic coordinate array generated -- check validity of the
> aggregated (leftmost) dimension
> (0) get_src_grid_info: source lat dims = (447)
> (0) get_src_grid_info: source lon dims = (546)
> (0) get_src_grid_info: SrcGridType and/or SrcGridLat/SrcGridLon were not
> set.
> (0)          Cannot determine the source grid type.
>
>
>
> ---
> Vanúcia Schumacher
> Mestranda em Meteorologia - UFV
> Meteorologista -UFPel
> Departamento de Meteorologia Agrícola - DEA
> Cel: (31) 9978 2522
> DEA: (31) 3899 1890
>
>
> ------------------------------
> Date: Fri, 22 Aug 2014 14:29:44 -0600
>
> Subject: Re: [ncl-talk] problems with regriding
> From: haley at ucar.edu
> To: vanucia-schumacher at hotmail.com
>
>
> D,
>
> My guess is she's missing:
>
> tos at lat2d = f->lat
> tos at lon2d = f->lon
>
> See:
>
> http://www.ncl.ucar.edu/Applications/Scripts/ESMF_regrid_7.ncl
>
> --M
>
>
>
>
> On Fri, Aug 22, 2014 at 6:33 AM, Vanúcia Schumacher <
> vanucia-schumacher at hotmail.com> wrote:
>
> Hi Dennis,
>
> I still do not understand what can I do to solve this problem, because
> when I change the resolution, I choose the option of lat and lon
> (0,358),(-87.86, 87.86), ncview and ferret programs  I can plot the data
> without problems (global), but when I try plot the data without changing
> the resolution they are confused on the map (attached).
>
> print(var&lon)
> print(var&lat)
>
> Variable: lat (coordinate)
> Type: integer
> Total Size: 596 bytes
>             149 values
> Number of Dimensions: 1
> Dimensions and sizes: [lat | 149]
> Coordinates:
> Number Of Attributes: 4
>   units : 1
>   long_name : cell index along second dimension
>   point_spacing : even
>   axis : Y
>
> *ncdump -h*
>
> time = UNLIMITED ; // (122 currently)
>  j = 149 ;
> i = 182 ;
> bnds = 2 ;
>  vertices = 4 ;
> variables:
> double time(time) ;
>  time:bounds = "time_bnds" ;
> time:units = "days since 1980-11-01" ;
>  time:calendar = "standard" ;
> time:axis = "T" ;
>  time:long_name = "time" ;
> time:standard_name = "time" ;
>  double time_bnds(time, bnds) ;
> int j(j) ;
>  j:units = "1" ;
> j:long_name = "cell index along second dimension" ;
>  int i(i) ;
> i:units = "1" ;
>  i:long_name = "cell index along first dimension" ;
> float lat(j, i) ;
>  lat:standard_name = "latitude" ;
> lat:long_name = "latitude coordinate" ;
>  lat:units = "degrees_north" ;
> lat:bounds = "lat_vertices" ;
>  float lon(j, i) ;
> lon:standard_name = "longitude" ;
>  lon:long_name = "longitude coordinate" ;
> lon:units = "degrees_east" ;
>  lon:bounds = "lon_vertices" ;
> float lat_vertices(j, i, vertices) ;
>  lat_vertices:units = "degrees_north" ;
> float lon_vertices(j, i, vertices) ;
>  lon_vertices:units = "degrees_east" ;
> float tos(time, j, i) ;
>  tos:standard_name = "sea_surface_temperature" ;
> tos:long_name = "Sea Surface Temperature" ;
>  tos:comment = "\"this may differ from \"\"surface temperature\"\" in
> regions of sea ice.\"" ;
>  tos:units = "K" ;
> tos:original_name = "sosstsst" ;
>  tos:original_units = "degC" ;
> tos:history = "2012-07-24T13:46:07Z altered by CMOR: Converted units from
> \'degC\' to \'K\'." ;
>  tos:cell_methods = "time: mean (interval: 1 month)" ;
> tos:cell_measures = "area: areacello" ;
>  tos:missing_value = 1.e+20f ;
> tos:_FillValue = 1.e+20f ;
>  tos:associated_files = "baseURL:
> http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile:
> gridspec_ocean_fx_CMCC-CM_decadal1980_r0i0p0.nc areacello:
> areacello_fx_CMCC-CM_decadal1980_r0i0p0.nc" ;
>  tos:coordinates = "lat lon" ;
>
> // global attributes:
>  :institution = "CMCC - Centro Euro-Mediterraneo per i Cambiamenti
> Climatici, Bologna, Italy" ;
> :institute_id = "CMCC" ;
>  :experiment_id = "decadal1980" ;
> :source = "CMCC-CM" ;
>  :model_id = "CMCC-CM" ;
> :forcing = "Nat,Ant,GHG,SA,TO,Sl" ;
>  :parent_experiment_id = "N/A" ;
> :parent_experiment_rip = "N/A" ;
>  :branch_time = 0. ;
> :contact = "Silvio Gualdi (gualdi at bo.ingv.it)" ;
>  :history = "Model output postprocessed with  CDO (
> https://code.zmaw.de/projects) 2012-07-24T13:46:07Z CMOR rewrote data to
> comply with CF standards and CMIP5 requirements." ;
>  :comment = "Decadal hindcasts/predictions, some extended to 30 years" ;
> :references = "model described in the documentation at
> http://www.cmcc.it/data-models/models" ;
>  :initialization_method = 1 ;
> :physics_version = 1 ;
>  :tracking_id = "105250cc-615d-478c-b242-b72f4735fb74" ;
> :product = "output" ;
>  :experiment = "10- or 30-year run initialized in year 1980" ;
> :frequency = "mon" ;
>  :creation_date = "2012-07-24T13:46:07Z" ;
> :Conventions = "CF-1.4" ;
>  :project_id = "CMIP5" ;
> :table_id = "Table Omon (27 April 2011) 340eddd4fd838d90fa9ffe1345ecbd73" ;
>  :title = "CMCC-CM model output prepared for CMIP5 10- or 30-year run
> initialized in year 1980" ;
> :parent_experiment = "N/A" ;
>  :modeling_realm = "ocean" ;
> :realization = 1 ;
>  :cmor_version = "2.7.1" ;
>
>
>
> ---
> Vanúcia Schumacher
> Mestranda em Meteorologia - UFV
> Meteorologista -UFPel
> Departamento de Meteorologia Agrícola - DEA
> Cel: (31) 9978 2522
> DEA: (31) 3899 1890
>
>
> ------------------------------
> Date: Thu, 21 Aug 2014 15:12:20 -0600
> Subject: Re: [ncl-talk] problems with regriding
> From: shea at ucar.edu
> To: vanucia-schumacher at hotmail.com
> CC: ncl-talk at ucar.edu
>
>
> [1]
> I would say it is highly unlikely that "NCL is not correctly plotting the
> data"!
> NCL is plotting what you sent it.
>
> [2]
> Did you examine the output from
>
> printVarSummary(var)
>
> [snip]
>
> Dimensions and sizes: [TIME | 360] x [lat | 149] x [lon | 182]
> Coordinates:
>             TIME: [76.5..3636.5]
>             lat: [1..149]                  <================
>             lon: [1..182]                <====================
>
> The coordinates associated with 'var' are numbers spanning 1-149 and 1-182
> These are *not* latitudes or longitudes. So, when you  use
>
> new_var = linint2_Wrap(var&lon,var&lat,var,True,new_lon,new_lat,0)
> You could do you own 'debugging by printing the input
>
> print(var&lon)
> print(var&lat)
>
> Punch line ... you are inputting number 1 to 149 and 1 to 182
> NCL is interpolating to those values.
>
> Use
>
> ncl_filedump
>
> or
>
> ncdump  -h
>
> on your source file. That should have some lat.lon info
>
>
>
>
>
> On Thu, Aug 21, 2014 at 2:12 PM, Vanúcia Schumacher <
> vanucia-schumacher at hotmail.com> wrote:
>
> Hi users,
>
> I do regridding data for resolution of 2 degrees and the NCL is not
> correctly plotting the data, it is cutting the data to the new resolution
> as opposed to a new lat and lon.
>
> >begin
>
> >var = f[:]->SST
>
> >var!1="lat"
> >var!2="lon"
> >j=var!1
> >i=var!2
>
> newfile = "tos_90x180.nc"
>
> file_create = addfile(newfile, "c")
>
> new_lon = fspan(0,358, 180)
> new_lon at units = "degrees_east"
> new_lon!0 = "lon"
>
> new_lat = fspan(-87.86, 87.86, 90)
> new_lat at units = "degrees_north"
> new_lat!0 = "lat"
>
> new_var = linint2_Wrap(var&lon,var&lat,var,True,new_lon,new_lat,0)
>
> file_create->tos = new_var
>
>
> Variable: var
>  Type: double
> Total Size: 78099840 bytes
>             9762480 values
> Number of Dimensions: 3
> Dimensions and sizes: [TIME | 360] x [lat | 149] x [lon | 182]
> Coordinates:
>             TIME: [76.5..3636.5]
>             lat: [1..149]
>             lon: [1..182]
> Number Of Attributes: 4
>   missing_value : -9.999999999999999e+33
>   _FillValue : -9.999999999999999e+33
>   long_name : TOS[L=3:122]
>   history : From tos_Omon_CMCC-CM_decadal1980_r1i1p1_198011-199012
>
> Variable: new_var
> Type: double
> Total Size: 46656000 bytes
>             5832000 values
> Number of Dimensions: 3
> Dimensions and sizes: [TIME | 360] x [lat | 90] x [lon | 180]
> Coordinates:
>             TIME: [76.5..3636.5]
>             lat: [-87.86..87.86]
>             lon: [ 0..358]
> Number Of Attributes: 4
>   missing_value : -9.999999999999999e+33
>   _FillValue : -9.999999999999999e+33
>   long_name : TOS[L=3:122]
>   history : From tos_Omon_CMCC-CM_decadal1980_r1i1p1_198011-199012
>
>
>
> ---
> Vanúcia Schumacher
> Mestranda em Meteorologia - UFV
> Meteorologista -UFPel
> Departamento de Meteorologia Agrícola - DEA
> Cel: (31) 9978 2522
> DEA: (31) 3899 1890
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140822/c4ce5277/attachment.html 


More information about the ncl-talk mailing list