[ncl-talk] question to the NCL latlon_to_SCRIP function

Mary Haley haley at ucar.edu
Fri Oct 16 10:47:11 MDT 2015


It looks like a simple rounding error.

By providing strict corner lat/lon boundary values and a small resolution,
you end up with values like 89.950001 and 179.950001. These are out of
range of the URCorner boundary values that you provided, so you then end up
with the last two values removed.

You can try using slightly a higher values for URCorner:

Opt at URCorner       = (/  89.97d,  179.97d/)

I've created a ticket (NCL-2293) on this to see if this is something we can
improve.

--Mary


On Fri, Oct 16, 2015 at 1:13 AM, chenhuansheng at mail.iap.ac.cn <
chenhuansheng at mail.iap.ac.cn> wrote:

> Dear all,
>
> I used the latlon_to_SCRIP function to generate  lat-lon grid file with
> SCRIP format which will then be used as input files of the ESMF application
> "ESMF_RegridWeightGen".
> When I applied latlon_to_SCRIP to 1x1, 0.5x0.5 and 0.25x0.25 grids, the
> output results were right. However, when I applied latlon_to_SCRIP to
> 0.1x0.1 grids, the output results
> are wrong. Do the latlon_to_SCRIP function support to generate a 0.1x0.1
> grid file? Can you help me to solve this problem?
> Thank you very much.
>
> The code used  to generate the 0.25x0.25 grids are as follows:
> _______________
> Opt                = True
> Opt at LLCorner       = (/ -89.875d, -179.875d/)
> Opt at URCorner       = (/  89.875d,  179.875d/)
> Opt at ForceOverwrite = True
> Opt at PrintTimings   = True
> latlon_to_SCRIP(srcGridName,"0.25x0.25",Opt)
> delete(Opt)
> ________________
>
> The header of the output netcdf file is as follows:
> ________________
> dimensions:
>         grid_size = 1036800 ;
>         grid_corners = 4 ;
>         grid_rank = 2 ;
> variables:
>         int grid_dims(grid_rank) ;
>         double grid_center_lat(grid_size) ;
>                 grid_center_lat:units = "degrees" ;
>         double grid_center_lon(grid_size) ;
>                 grid_center_lon:units = "degrees" ;
>         int grid_imask(grid_size) ;
>                 grid_imask:units = "unitless" ;
>         double grid_corner_lat(grid_size, grid_corners) ;
>                 grid_corner_lat:units = "degrees" ;
>         double grid_corner_lon(grid_size, grid_corners) ;
>                 grid_corner_lon:units = "degrees" ;
>
> // global attributes:
>                 :date_created = "Thu Oct 15 19:49:54 CST 2015" ;
>                 :Createdby = "ESMF_regridding.ncl" ;
>                 :Conventions = "SCRIP" ;
>                 :title = "0.25x0.25 grid" ;
> data:
>
> grid_dims = 1440, 720 ;
> ________________
>
>
> The code used  to generate the 0.1x0.1 grids are as follows:
> _______________
> Opt                = True
> Opt at LLCorner       = (/ -89.95d, -179.95d/)
> Opt at URCorner       = (/  89.95d,  179.95d/)
> Opt at ForceOverwrite = True
> Opt at PrintTimings   = True
> latlon_to_SCRIP(srcGridName,"0.1x0.1",Opt)
> delete(Opt)
> ________________
>
> The header of the output netcdf file is as follows:
> _____________
> dimensions:
>         grid_size = 6474601 ;
>         grid_corners = 4 ;
>         grid_rank = 2 ;
> variables:
>         int grid_dims(grid_rank) ;
>         double grid_center_lat(grid_size) ;
>                 grid_center_lat:units = "degrees" ;
>         double grid_center_lon(grid_size) ;
>                 grid_center_lon:units = "degrees" ;
>         int grid_imask(grid_size) ;
>                 grid_imask:units = "unitless" ;
>         double grid_corner_lat(grid_size, grid_corners) ;
>                 grid_corner_lat:units = "degrees" ;
>         double grid_corner_lon(grid_size, grid_corners) ;
>                 grid_corner_lon:units = "degrees" ;
>
> // global attributes:
>                 :date_created = "Thu Oct 15 20:27:42 CST 2015" ;
>                 :Createdby = "ESMF_regridding.ncl" ;
>                 :Conventions = "SCRIP" ;
>                 :title = "0.1deg grid" ;
> data:
>
> grid_dims = 3599, 1799 ;
> _____________
> Why the grid_dims are 3599x1799?  I think it should be 3600x1800.
>
>
> Yours Sincerely,
> Huansheng Chen
>
> ------------------------------
> 陈焕盛(LAPC/IAP)
> 大气边界层物理和大气化学国家重点实验室
> 中国科学院大气物理研究所
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20151016/ca925900/attachment.html 


More information about the ncl-talk mailing list