<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I wrote a simple script (attached below) to concatenate among different files. </span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<pre style="overflow-wrap: break-word">But I got error message in a simple line: <pre style="background-color: rgb(255, 255, 255); overflow-wrap: break-word">fout->latitude= latitude_pre </pre><pre style="background-color: rgb(255, 255, 255); overflow-wrap: break-word">see my screen output:</pre><pre style="background-color: rgb(255, 255, 255); overflow-wrap: break-word">"</pre><pre style="background-color: rgb(255, 255, 255); overflow-wrap: break-word"><span>Variable: latitude_pre<br></span><div>Type: float<br></div><div>Total Size: 2415220 bytes<br></div><div> 603805 values<br></div><div>Number of Dimensions: 1<br></div><div>Dimensions and sizes: [sounding_id | 603805]<br></div><div>Coordinates: <br></div><div> sounding_id: [2014091900023702..2014092123542735]<br></div><div>Number Of Attributes: 5<br></div><div> comment : center latitude of the measurement<br></div><div> long_name : latitude<br></div><div> units : degrees_north<br></div><div> missing_value : -999999<br></div><div> _FillValue : -999999<br></div><div>fatal:["NclFile.c":432]:FileAddVar: an error occurred while adding a variable to a file, check to make sure data type is supported by the output format<br></div><div>fatal:["Execute.c":8578]:Execute: Error occurred at or near line 65 in file extract_overChina.ncl<br></div><div><br></div><div>(0) finish outputing the 1st var<br></div><div>fatal:["NclFile.c":432]:FileAddVar: an error occurred while adding a variable to a file, check to make sure data type is supported by the output format<br></div><div>fatal:["Execute.c":8578]:Execute: Error occurred at or near line 67 in file extract_overChina.ncl<br></div><div><br></div><div>fatal:["NclFile.c":432]:FileAddVar: an error occurred while adding a variable to a file, check to make sure data type is supported by the output format<br></div><div>fatal:["Execute.c":8578]:Execute: Error occurred at or near line 68 in file extract_overChina.ncl<br></div><div><br></div><div>fatal:["NclFile.c":432]:FileAddVar: an error occurred while adding a variable to a file, check to make sure data type is supported by the output format<br></div><div>fatal:["Execute.c":8578]:Execute: Error occurred at or near line 69 in file extract_overChina.ncl<br></div><div><br></div><div>fatal:["NclFile.c":432]:FileAddVar: an error occurred while adding a variable to a file, check to make sure data type is supported by the output format<br></div><div>fatal:["Execute.c":8578]:Execute: Error occurred at or near line 70 in file extract_overChina.ncl<br></div><div><br></div><div>fatal:["NclFile.c":432]:FileAddVar: an error occurred while adding a variable to a file, check to make sure data type is supported by the output format<br></div><div>fatal:["Execute.c":8578]:Execute: Error occurred at or near line 71 in file extract_overChina.ncl</div></pre><pre style="background-color: rgb(255, 255, 255); overflow-wrap: break-word">"</pre></pre>
<pre style="overflow-wrap: break-word">Any idea what is happening? </pre>
<pre style="overflow-wrap: break-word">Thanks a lot</pre>
<pre style="overflow-wrap: break-word">Xiaoming </pre>
<pre style="overflow-wrap: break-word">My NCl script: </pre>
<pre style="overflow-wrap: break-word">
files= systemfunc("ls *.nc4")
do ifile = 0 , dimsizes(files)-1
f= addfile(files(ifile),"r")
print("start working on "+files(ifile))
latitude=f->latitude
xco2=f->xco2
date=f->date
longitude=f->longitude
time=f->time
xco2_quality_flag=f->xco2_quality_flag
print("having record "+dimsizes(xco2))
if (ifile.eq.0)
latitude_total =latitude
xco2_total =xco2
date_total =date
longitude_total =longitude
time_total =time
xco2_quality_flag_total=xco2_quality_flag
else
latitude_total =array_append_record (latitude_pre, latitude, 0 )
xco2_total =array_append_record (xco2_pre, xco2, 0 )
date_total =array_append_record (date_pre, date, 0 )
longitude_total =array_append_record (longitude_pre, longitude, 0 )
time_total =array_append_record (time_pre, time, 0 )
xco2_quality_flag_total =array_append_record (xco2_quality_flag_pre, xco2_quality_flag, 0 )
end if
if (ifile.gt.0) then
delete(latitude_pre); =array_append_record (latitude_pre, latitude, 0 )
delete(xco2_pre ); =array_append_record (xco2_pre, xco2, 0 )
delete(date_pre ); =array_append_record (date_pre, date, 0 )
delete(longitude_pre); =array_append_record (longitude_pre, longitude, 0 )
delete(time_pre ); =array_append_record (time_pre, time, 0 )
delete(xco2_quality_flag_pre); =array_append_record (xco2_quality_flag_pre, xco2_quality_flag, 0 )
end if
latitude_pre= latitude_total
xco2_pre= xco2_total
date_pre= date_total
longitude_pre= longitude_total
time_pre= time_total
xco2_quality_flag_pre= xco2_quality_flag_total
delete(latitude_total); =array_append_record (latitude_pre, latitude, 0 )
delete(xco2_total ); =array_append_record (xco2_pre, xco2, 0 )
delete(date_total ); =array_append_record (date_pre, date, 0 )
delete(longitude_total); =array_append_record (longitude_pre, longitude, 0 )
delete(time_total ); =array_append_record (time_pre, time, 0 )
delete(xco2_quality_flag_total); =array_append_record (xco2_quality_flag_pre, xco2_quality_flag, 0 )
delete(latitude); =array_append_record (latitude_pre, latitude, 0 )
delete(xco2 ); =array_append_record (xco2_pre, xco2, 0 )
delete(date ); =array_append_record (date_pre, date, 0 )
delete(longitude); =array_append_record (longitude_pre, longitude, 0 )
delete(time ); =array_append_record (time_pre, time, 0 )
delete(xco2_quality_flag); =array_append_record (xco2_quality_flag_pre, xco2_quality_flag, 0 )
print("finish working on "+files(ifile))
end do
system("rm OCO-2_9_LITE_LEVEL2_all.nc")
fout=addfile("OCO-2_9_LITE_LEVEL2_all.nc","c")
printVarSummary(latitude_pre)
fout->latitude= latitude_pre
print("finish outputing the 1st var")
fout->xco2= xco2_pre
fout->date= date_pre
fout->longitude= longitude_pre
fout->time= time_pre
fout->xco2_quality_flag= xco2_quality_flag_pre
</pre>
<br>
<br>
</div>
</body>
</html>