[ncl-talk] Error when modifying nc file

Goriparthi Pavani goriparthi.sc15b161 at ug.iist.ac.in
Fri Aug 2 06:19:34 MDT 2019



----- Forwarded Message -----




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 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190802/af310731/attachment.html>


More information about the ncl-talk mailing list