[ncl-talk] question to the NCL latlon_to_SCRIP function

chenhuansheng at mail.iap.ac.cn chenhuansheng at mail.iap.ac.cn
Sun Oct 18 03:50:48 MDT 2015


Hi Mary,

I tried "Opt at URCorner  = (/  89.97d,  179.97d/)", this resulted in "grid_dims = 3600, 1800".
However, the lat-lon intervals are not exactly 0.1 degree. 
For example: "grid_center_lon = -179.95, -179.849994442901, -179.749988885802, "
It should be "grid_center_lon = -179.95, -179.85, -179.75, "

I also tried "Opt at URCorner  = (/  89.95001d,  179.95001d/)", the problem was similar.
"grid_center_lon = -179.95, -179.849999997221, -179.749999994443, "

The results I want are the 0.1x0.1 grids with exactly equal latitude and longtitude intervals (0.1 degree). How can I get it ?
For the 0.25x0.25 grids, the output results are right.

Best Wishes,
Huansheng




陈焕盛(LAPC/IAP)
大气边界层物理和大气化学国家重点实验室
中国科学院大气物理研究所

From: Mary Haley
Date: 2015-10-17 00:47
To: chenhuansheng at mail.iap.ac.cn
CC: ncl-talk
Subject: Re: [ncl-talk] question to the NCL latlon_to_SCRIP function
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/20151018/9dcff7db/attachment.html 


More information about the ncl-talk mailing list