[ncl-talk] Error when modifying nc file

Rick Brownrigg brownrig at ucar.edu
Wed Aug 7 21:58:49 MDT 2019


Hi Goriparthi,

Are you able to share your files?  If they are not too large, you can email
them directly to me, otherwise perhaps upload them to our FTP site as per
these instructions:

    http://ncl.ucar.edu/ftp_files.shtml

Rick


On Fri, Aug 2, 2019 at 6:55 AM Goriparthi Pavani via ncl-talk <
ncl-talk at ucar.edu> wrote:

>
>
> ------------------------------
>
> Dear Sir/Madam,
>
> I wan't to replace default landcover class cropland to evergreenbroadleaf
> in lis_input.d01.nc over paticular region.
>
> Landcover variable is 3-D
>
> -----------------------------------------------------------------------------------------------------------------
> Type: float
> Total Size: 53763120 bytes
>             13440780 values
> Number of Dimensions: 3
> Dimensions and sizes:    [sfctypes | 20] x [north_south | 801] x
> [east_west | 839]
> Coordinates:
> Number Of Attributes: 9
>   standard_name :    MODIS-IGBP (NCEP-modified) landcover map
>   units :
>   scale_factor :     1
>   add_offset :     0
>   missing_value :    -9999
>   vmin :     0
>   vmax :     0
>   num_bins :    20
>   _FillValue :    -9999
>
> ----------------------------------------------------------------------------------------------------------------
> I created a new file nc having only landcover variable like this
> ---------------------------------------------------------
> f=addfile("lis_input.d01.nc","r")
> a=f->LANDCOVER(:,:,:)
> a1=new((/20,801,839/),float)
> a1=a(:,:,:)
> do i=341,541
> do j=166,491
> if(a(12,i,j) .eq. 1) then
> a1(2,i,j)=1
> a1(12,i,j)=0
> end if
> end do
> end do
>
> m=addfile("new.nc","c")
> m->t=a1
> ---------------------------------------------------------------------------
>
> Now in order to modify my original lis_input.d01.nc I did
>
> f1=addfile("lis_input.d01.nc","w")
> f2=addfile("new.nc","r")
> f1->LANDCOVER(:,:,:)=(/f2->t(:,:,:)/)
>
> The error is
>
> copyright (C) 1995-2015 - All Rights Reserved
>  University Corporation for Atmospheric Research
>  NCAR Command Language Version 6.3.0
>  The use of this software is governed by a License Agreement.
>  See http://www.ncl.ucar.edu/ for more details.
> Segmentation fault (core dumped)
>
> ncl -x command gives
> f1=addfile("lis_input.d01.nc","w")
> + f2=addfile("new.nc","r")
> + f1->LANDCOVER(:,:,:)=(/f2->t(:,:,:)/)
> Segmentation fault (core dumped)
>
>
> Why this segmentation fault error is coming and there is approximately 200
> GB free space .Kindly help me to solve this issue.
>
> If there is any other way to replace landcover class, please explain me.
>
> Thanks,
> G.Pavani
>
> _______________________________________________
> 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/20190807/37687bd5/attachment.html>


More information about the ncl-talk mailing list