[ncl-talk] Why the res of DstGridMask can not make the destination grid have missing values as defined?

林祥 xianglin72 at icloud.com
Mon Dec 19 20:00:24 MST 2016


Hi, Mary

       Thank for the reply!  I deal with many sea ice concentration(sic) data files, for sometime there are all zero values exists in the tropical ocean and land,  for the other time 

there are all the missing values.  And for the HadISST sic , there are all the missing values in land.

       Of course I can also mask the land grid after regrinding .

       But I just believe that the resource “DstGridMask”  can do the same work, and I don’t understand why it can not work?

      I’m not sure if the resource “SrcGridMask“ affect on the masking of destination  grids,  I care more about the “DstGridMask”.


     Opt at DstGridMask      = where(.not.ismissing(hsic(0,:,:)),1,0)         ; hsic is the HadISST  SIC data, with missing values in land
     Opt at DstGridLat       = hlat
  Opt at DstGridLon       = hlon 


Thank

Lin



> 在 2016年12月20日,06:06,Mary Haley <haley at ucar.edu> 写道:
> 
> Lin,
> 
> I'm confused by the comment on this line:
> 
>     Opt at SrcGridMask      = where(.not.ismissing(thetao(0,:,:)),1,0)      ; thetao is the source grids, with data zero in land, no missing 
> 
> When you say "data zero in land, no missing", do you mean that the "thetao" variable is equal to 0 whenever it is over land, and that it contains no missing values?  If so, then using "ismissing" on a variable that doesn't contain missing values is never going to return True.
> 
> Instead, you want something like this:
> 
>     Opt at SrcGridMask      = where(thetao.ne.0,1,0)
> 
> This creates a mask array that is equal to 1 at locations where thetao is NOT equal to 0, and equal to 0 at locations where thetao is equal to 0. 
> 
> Just as an example, this line should produce the exact same mask array:
> 
>     Opt at SrcGridMask      = where(thetao.eq.0,0,1)
> 
> --Mary
> 
> 
> 
> 
> On Mon, Dec 19, 2016 at 11:53 AM, 林祥 <xianglin72 at icloud.com <mailto:xianglin72 at icloud.com>> wrote:
> Hi, all
> 
>        I have many CMIP5 sea ice concentration data and want to regrid them into the same grid coordinate as HadISST.
> 
>  Since the land area own missing_value (_FillValue) in HadiSST, I also want the regridded data show missing values in land .
> 
> I use the following  scripts:
>    
>    fi   = addfile("HadISST_ice.nc","r")
>   hsic = fi->sic
>   hlon = fi->longitude
>   hlat = fi->latitude({-90.:-50.})
>    …….
>     
>     Opt at SrcGridMask      = where(.not.ismissing(thetao(0,:,:)),1,0)      ; thetao is the source grids, with data zero in land, no missing 
>     Opt at DstGridMask      = where(.not.ismissing(hsic(0,:,:)),1,0)         ; hsic is the HadISST  SIC data, with missing values in land
>   
>     Opt at DstGridLat       = hlat
>   Opt at DstGridLon       = hlon 
> ……..
> 
>      thetao_regrid = ESMF_regrid(thetao,Opt)
> 
> However, I found the regridded data “thetao_regrid" show zero values, not missing values in land.
> 
> 
>        How to make the regridded data have missing values for the same grids as HadISST?
> 
> 
> Thank
> 
> 
> Lin  
> 
>  
> 
> 
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161220/a29e507b/attachment.html 


More information about the ncl-talk mailing list