<div dir="ltr"><div>Hi Muhammad,</div><div><br></div><div>It would help to see the exact wording of the errors you are seeing. The phrase "killed" makes me think perhaps you are running on a shared computing resource, and the job is getting terminated because of over use of memory, processor, etc.? Is this the case? <br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 3, 2019 at 7:12 PM Muhammad Omer Mughal <<a href="mailto:m.mughal1@graduate.curtin.edu.au">m.mughal1@graduate.curtin.edu.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_9049609089107545063divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<div id="gmail-m_9049609089107545063divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p style="margin-top:0px;margin-bottom:0px">Dear Dennis <br>
</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">Thank you again for the reply and suggestions.</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">Using <b>print("nl="+nl+"; nt="+nt)</b> provides</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"></p>
<div>(0) nl=0; nt=0<br>
(0) nl=0; nt=1<br>
(0) nl=0; nt=2<br>
(0) nl=0; nt=3<br>
(0) nl=0; nt=4<br>
:<br>
:<br>
:</div>
<div>(0) nl=0; nt=405<br>
(0) nl=0; nt=406<br>
(0) nl=0; nt=407<br>
(0) nl=0; nt=408<br>
(0) nl=0; nt=409<br>
(0) nl=0; nt=410 and so on</div>
<div><br>
</div>
<div><b>using </b><span><b>print(wrftxt(nl)) </b>yields</span></div>
<div><span><br>
</span></div>
<div><span></span><span>98.57 98.68 98.72 98.81 98.75 98.75 98.75 98.71 98.74 98.57 98.12 97.50 96.66 95.69 94.67 93.80 92.96 92.26 91.93 91.47 91.11 90.95 90.88 90.97 91.38 91.84
92.68 93.84 94.49 94.72 95.09 95.22 95.61 95.84 95.95 95.95 96.13 95.52 94.99 94.28 93.33 92.13 91.21 90.88 90.77 90.92 91.21 91.63 91.78 91.51 91.12 90.74 90.42 90.19 90.09
90.23 90.43 90.52 90.58 90.47 90.46 90.48 90.56 90.62 90.67 90.72 90.71 90.69 90.62 90.60 90.56 98.37 </span><br>
</div>
<br>
<p></p>
<p style="margin-top:0px;margin-bottom:0px"></p>
<div>Even after changing <span>%9.2f" to "%6.2f" or "%5.1f"</span> , I am still getting the "killed" message.
<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Regards <br>
</div>
<br>
<p></p>
<div id="gmail-m_9049609089107545063Signature">
<div id="gmail-m_9049609089107545063divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px"><b><br>
</b></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:11pt">Muhammad Omer Mughal</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:11pt">MSc BSc Mechanical Engineering</span></font><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:8pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">PhD Research Scholar</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Remote Sensing and Satellite Research Group</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Department of Imaging and Applied Physics</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
Curtin University</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:11pt"><br>
</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt">Curtin University</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Tel |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
8 9266 7962</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:7pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Fax |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
8 9266 2377</span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Mobile |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">0470 237 525</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Email |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><a href="mailto:m.lynch@curtin.edu.au" id="gmail-m_9049609089107545063LPNoLP" target="_blank"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">m.mughal1@postgrad.curtin.edu.au</span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Web |</span></font><font size="2" face="Calibri,sans-serif" color="#AB8303"><span style="font-size:9pt"> </span></font><a href="http://curtin.edu.au/" id="gmail-m_9049609089107545063LPNoLP" target="_blank"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">http://curtin.edu.au</span></font></span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:7pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:6pt"></span></font><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt">Curtin University is a trademark of Curtin University of Technology. </span></font><br>
</div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt">CRICOS Provider Code 00301J (WA), 02637B (NSW)</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_9049609089107545063divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>><br>
<b>Sent:</b> Friday, 4 January 2019 3:10:59 AM<br>
<b>To:</b> Muhammad Omer Mughal<br>
<b>Cc:</b> Rick Brownrigg; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] Extracting all values of rh2 from WRF file and writing it to csv file</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>[1] I doubt it is the size of the ascii file. <br>
</div>
<div><br>
</div>
<div>[2] I tried the script on an available wrf file that had only one time dimension.</div>
<div><br>
</div>
<div>Variable: rh2<br>
Dimensions and sizes: [Time | 1] x [south_north | 108] x [west_east | 114]</div>
<div><br>
</div>
<div>and the script worked fine. It put out 108 latiitudes and 1*114 Time/longitudes<br>
</div>
<div>---</div>
<div>You can add a print to <b>provide more information</b>. It will tell you when it failed.
<br>
</div>
<div>Did it fail on the 1st iteration or later? Really, just saying it terminated provides little information.<br>
</div>
<div><br>
</div>
<div> wrftxt = new(nlat, "string")<br>
wrftxt = ""<br>
<br>
do nl=0,nlat-1<br>
</div>
<div> <br>
</div>
<div> do nt=0,ntim-1</div>
<div> <b>print("nl="+nl+"; nt="+nt)</b><br>
</div>
<div> do ml=0,mlon-1<br>
wrftxt(nl) = wrftxt(nl) +sprintf("%9.2f", rh2(nt,nl,ml)) ; append to previous value<br>
end do<br>
end do<br>
<br>
----</div>
<div><b>If </b>it failed on the 1st iteration, I speculate that the underlying C-code has some string length limit.</div>
<div><span class="gmail-m_9049609089107545063x_gmail-im">[Time | 673] x [south_north | 71] x [west_east | 82]</span></div>
<div><br>
</div>
<div>Each single string has 673*82*(nchar) where nchar is the length of each string.</div>
<div>So: "%9.2f" yields string lengths of 673*82*9= 496674 characters. That is a LONG string length.<br>
</div>
<div><br>
</div>
<div>Change "%9.2f" to "%6.2f" or "%5.1f" ... see if it works. Still, they are all LONG.<br>
</div>
<div><br>
</div>
<div> ---</div>
<div>Play with these</div>
<div><br>
</div>
<div> NTIM = 50 ; whatever</div>
<div> MLON = ???<br>
</div>
<div>
<div> do nt=0,NTIM <br>
</div>
<div> <b>print("nl="+nl+"; nt="+nt)</b><br>
</div>
<div> do ml=0,MLON</div>
</div>
<div><br>
</div>
<div>DO various combinations. That will provides some insight into the issue.</div>
<div><br>
</div>
</div>
</div>
</div>
<br>
<div class="gmail-m_9049609089107545063x_gmail_quote">
<div dir="ltr">On Thu, Jan 3, 2019 at 4:53 AM Muhammad Omer Mughal <<a href="mailto:m.mughal1@graduate.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk495276" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.mughal1@graduate.curtin.edu.au</a>> wrote:<br>
</div>
<blockquote class="gmail-m_9049609089107545063x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Dear Dennis and all<br>
<br>
Thank you for reply and sending the code.<br>
<br>
However, the script gets killed by itself without giving an error at the end of do loop. This I suspect might be due the fact that string is getting overflow.
<br>
<br>
Is there a way to fix this ?<br>
<br>
<br>
Muhammad Omer Mughal<br>
MSc BSc Mechanical Engineering<br>
PhD Research Scholar<br>
Remote Sensing and Satellite Research Group<br>
Department of Imaging and Applied Physics<br>
Curtin University<br>
<br>
Curtin University<br>
Tel | +61 8 9266 7962<br>
Fax | +61 8 9266 2377<br>
Mobile | 0470 237 525<br>
<br>
Email | <a href="mailto:m.mughal1@postgrad.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk646427" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
m.mughal1@postgrad.curtin.edu.au</a><br>
Web | <a href="http://curtin.edu.au" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk588984" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
http://curtin.edu.au</a><br>
<br>
Curtin University is a trademark of Curtin University of Technology.<br>
CRICOS Provider Code 00301J (WA), 02637B (NSW)<br>
<br>
<br>
________________________________<br>
From: Dennis Shea <<a href="mailto:shea@ucar.edu" id="gmail-m_9049609089107545063LPlnk488656" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">shea@ucar.edu</a>><br>
Sent: Thursday, 3 January 2019 12:17:16 PM<br>
To: Muhammad Omer Mughal<br>
Cc: Rick Brownrigg; <a href="mailto:ncl-talk@ucar.edu" id="gmail-m_9049609089107545063LPlnk770688" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
ncl-talk@ucar.edu</a><br>
Subject: Re: [ncl-talk] Extracting all values of rh2 from WRF file and writing it to csv file<br>
<br>
This series of questions is a bit frustrating.<br>
<br>
You have used NCL quite a bit and you have sent numerous questions.<br>
As you know, ncl-talk always recommends that users use 'printVarSummary' to look at variables. You should do that.... ALWAYS. I don't have your file but<br>
<br>
rh2 = wrf_user_getvar(a,"rh2",-1) ; [Time | 673] x [south_north | 71] x [west_east | 82]<br>
lat=wrf_user_getvar(a,"XLAT",-1) ; "<br>
lon=wrf_user_getvar(a,"XLONG",-1) ; "<br>
<br>
Your initial question:<br>
<br>
lat and lon are variables with a 'Time' dimension.<br>
You can not use multidimensional variables. The following is not correct syntax.<br>
<br>
allRH = rh2(:, lon, lat) ; ??????????????????<br>
<br>
Please read the User Manual on subscripting and 'do' loops<br>
<a href="http://www.ncl.ucar.edu/Document/Manuals/" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk924371" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
http://www.ncl.ucar.edu/Document/Manuals/</a><br>
<br>
also<br>
<br>
<a href="http://www.ncl.ucar.edu/Applications/write_ascii.shtml" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk330183" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
http://www.ncl.ucar.edu/Applications/write_ascii.shtml</a><<a href="http://www.ncl.ucar.edu/Applications/write_ascii.shtml" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk583557" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">http://www.ncl.ucar.edu/Applications/write_ascii.shtml</a>><br>
<br>
========<br>
rh2 = wrf_user_getvar(a,"rh2",-1)<br>
printVarSummary(rh2)<br>
<br>
lat = wrf_user_getvar(a,"XLAT",-1)<br>
lon = wrf_user_getvar(a,"XLONG",-1)<br>
printVarSummary(lat)<br>
<br>
<br>
dimrh2 = dimsizes(rh2)<br>
ntim = dimrh2(0)<br>
nlat = dimrh2(1)<br>
mlon = dimrh2(2)<br>
<br>
wrftxt = new(nlat, "string")<br>
wrftxt = ""<br>
<br>
do nl=0,nlat-1<br>
<br>
do nt=0,ntim-1<br>
do ml=0,mlon-1<br>
wrftxt(nl) = wrftxt(nl) +sprintf("%9.2f", rh2(nt,nl,ml))<br>
end do<br>
end do<br>
<br>
end do<br>
<br>
<br>
filo = "rh2.csv"<br>
system("/bin/rm -f "+filo)<br>
asciiwrite(filo,wrftxt)<br>
<br>
<br>
On Wed, Jan 2, 2019 at 8:28 PM Muhammad Omer Mughal <<a href="mailto:m.mughal1@graduate.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk978463" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.mughal1@graduate.curtin.edu.au</a><mailto:<a href="mailto:m.mughal1@graduate.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk506291" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.mughal1@graduate.curtin.edu.au</a>>>
wrote:<br>
Hi Rick<br>
<br>
Thank you for the reply.<br>
<br>
Yes , I want to write rh2 to the ascii format. The size of the rh2 in this particular case is [Time|673]*[south_north|81]*[west_east|72]. I want to save the file in the format so that it would have 72 rows and 54513 columns i.e. (673*81) for a particular code
to read it.<br>
<br>
Regards<br>
<br>
Omer<br>
<br>
<br>
Muhammad Omer Mughal<br>
MSc BSc Mechanical Engineering<br>
PhD Research Scholar<br>
Remote Sensing and Satellite Research Group<br>
Department of Imaging and Applied Physics<br>
Curtin University<br>
<br>
Curtin University<br>
Tel | +61 8 9266 7962<br>
Fax | +61 8 9266 2377<br>
Mobile | 0470 237 525<br>
<br>
Email | <a href="mailto:m.mughal1@postgrad.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk531505" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
m.mughal1@postgrad.curtin.edu.au</a><mailto:<a href="mailto:m.lynch@curtin.edu.au" id="gmail-m_9049609089107545063LPlnk641121" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.lynch@curtin.edu.au</a>><br>
Web | <a href="http://curtin.edu.au" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk862185" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
http://curtin.edu.au</a><<a href="http://curtin.edu.au/" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk441130" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">http://curtin.edu.au/</a>><br>
<br>
Curtin University is a trademark of Curtin University of Technology.<br>
CRICOS Provider Code 00301J (WA), 02637B (NSW)<br>
<br>
<br>
________________________________<br>
From: Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" id="gmail-m_9049609089107545063LPlnk494310" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">brownrig@ucar.edu</a><mailto:<a href="mailto:brownrig@ucar.edu" id="gmail-m_9049609089107545063LPlnk399080" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">brownrig@ucar.edu</a>>><br>
Sent: Thursday, 3 January 2019 10:59:30 AM<br>
To: Muhammad Omer Mughal<br>
Cc: <a href="mailto:ncl-talk@ucar.edu" id="gmail-m_9049609089107545063LPlnk183453" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
ncl-talk@ucar.edu</a><mailto:<a href="mailto:ncl-talk@ucar.edu" id="gmail-m_9049609089107545063LPlnk677649" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">ncl-talk@ucar.edu</a>><br>
Subject: Re: [ncl-talk] Extracting all values of rh2 from WRF file and writing it to csv file<br>
<br>
HI,<br>
<br>
That error message makes sense, since in a WRF file, the variables XLAT and XLONG are 2D (curvilinear).<br>
<br>
I guess I'm confused as to what you are trying to do. If you just simply want the variable "rh2" written to an ascii file, instead of this:<br>
<br>
allRH = rh2(:, lon, lat)<br>
asciiwrite("rh2.csv",allRH)<br>
<br>
what about just:<br>
<br>
asciiwrite("rh2.csv",rh2)<br>
<br>
A simple experiment revealed that this will write the 3D array, 1 value per line, in "row major" format. This means to read such a file later, you must have some way of knowing the shape and dimensionality.<br>
<br>
Hope that helps....<br>
Rick<br>
<br>
<br>
On Wed, Jan 2, 2019 at 7:42 PM Muhammad Omer Mughal <<a href="mailto:m.mughal1@graduate.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk536606" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.mughal1@graduate.curtin.edu.au</a><mailto:<a href="mailto:m.mughal1@graduate.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk629435" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.mughal1@graduate.curtin.edu.au</a>>>
wrote:<br>
Dear Rick<br>
Thanks for the reply. I changed the script to remove the SEGV error but now I am getting the following error messages<br>
<br>
<br>
Please see the script below<br>
<br>
a=addfile("wrfout_d03_2017-02-01_00:00:<a href="http://00.nc" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk479351" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">00.nc</a><<a href="http://00.nc" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk223619" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">http://00.nc</a>>","r")<br>
<br>
rh2 = wrf_user_getvar(a,"rh2",-1)<br>
<br>
lat=wrf_user_getvar(a,"XLAT",-1)<br>
lon=wrf_user_getvar(a,"XLONG",-1)<br>
<br>
<br>
allRH = rh2(:, lon, lat)<br>
<br>
asciiwrite("rh2.csv",allRH)<br>
<br>
fatal:Illegal subscript. Subscripts must be scalar or one dimensional vectors<br>
<br>
<br>
<br>
<br>
<br>
Muhammad Omer Mughal<br>
MSc BSc Mechanical Engineering<br>
PhD Research Scholar<br>
Remote Sensing and Satellite Research Group<br>
Department of Imaging and Applied Physics<br>
Curtin University<br>
<br>
Curtin University<br>
Tel | +61 8 9266 7962<br>
Fax | +61 8 9266 2377<br>
Mobile | 0470 237 525<br>
<br>
Email | <a href="mailto:m.mughal1@postgrad.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk489832" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
m.mughal1@postgrad.curtin.edu.au</a><mailto:<a href="mailto:m.lynch@curtin.edu.au" id="gmail-m_9049609089107545063LPlnk158361" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.lynch@curtin.edu.au</a>><br>
Web | <a href="http://curtin.edu.au" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk569022" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
http://curtin.edu.au</a><<a href="http://curtin.edu.au/" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk407618" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">http://curtin.edu.au/</a>><br>
<br>
Curtin University is a trademark of Curtin University of Technology.<br>
CRICOS Provider Code 00301J (WA), 02637B (NSW)<br>
<br>
<br>
________________________________<br>
From: Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" id="gmail-m_9049609089107545063LPlnk764669" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">brownrig@ucar.edu</a><mailto:<a href="mailto:brownrig@ucar.edu" id="gmail-m_9049609089107545063LPlnk260767" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">brownrig@ucar.edu</a>>><br>
Sent: Wednesday, 2 January 2019 10:18:33 PM<br>
To: Muhammad Omer Mughal<br>
Cc: <a href="mailto:ncl-talk@ucar.edu" id="gmail-m_9049609089107545063LPlnk849301" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
ncl-talk@ucar.edu</a><mailto:<a href="mailto:ncl-talk@ucar.edu" id="gmail-m_9049609089107545063LPlnk363576" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">ncl-talk@ucar.edu</a>><br>
Subject: Re: [ncl-talk] Extracting all values of rh2 from WRF file and writing it to csv file<br>
<br>
Hi,<br>
<br>
Can you share your script and dataset with me? I would like to investigate why there's a SEGV.<br>
<br>
Rick<br>
<br>
<br>
On Wed, Jan 2, 2019 at 4:49 AM Muhammad Omer Mughal <<a href="mailto:m.mughal1@graduate.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk434332" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.mughal1@graduate.curtin.edu.au</a><mailto:<a href="mailto:m.mughal1@graduate.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk429392" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.mughal1@graduate.curtin.edu.au</a>>>
wrote:<br>
Dear NCL team<br>
<br>
Is there a way to extract all values from WRF output files from all grind points and write to an ascii file.<br>
In my case grid size is 71x82 and the number of times is 673. I tried to write using a table format but I am getting a segmentation fault.<br>
<br>
I will appreciate help. Kindly note that I have used Lambert conformal projection method.<br>
<br>
Regards<br>
<br>
<br>
<br>
Muhammad Omer Mughal<br>
MSc BSc Mechanical Engineering<br>
PhD Research Scholar<br>
Remote Sensing and Satellite Research Group<br>
Department of Imaging and Applied Physics<br>
Curtin University<br>
<br>
Curtin University<br>
Tel | +61 8 9266 7962<br>
Fax | +61 8 9266 2377<br>
Mobile | 0470 237 525<br>
<br>
Email | <a href="mailto:m.mughal1@postgrad.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk677289" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
m.mughal1@postgrad.curtin.edu.au</a><mailto:<a href="mailto:m.mughal1@postgrad.curtin.edu.au" id="gmail-m_9049609089107545063LPlnk89762" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">m.mughal1@postgrad.curtin.edu.au</a>><br>
Web | <a href="http://curtin.edu.au" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk755908" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">
http://curtin.edu.au</a><br>
<br>
Curtin University is a trademark of Curtin University of Technology.<br>
CRICOS Provider Code 00301J (WA), 02637B (NSW)<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" id="gmail-m_9049609089107545063LPlnk567648" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">ncl-talk@ucar.edu</a><mailto:<a href="mailto:ncl-talk@ucar.edu" id="gmail-m_9049609089107545063LPlnk754922" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">ncl-talk@ucar.edu</a>><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk959302" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" id="gmail-m_9049609089107545063LPlnk702151" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">ncl-talk@ucar.edu</a><mailto:<a href="mailto:ncl-talk@ucar.edu" id="gmail-m_9049609089107545063LPlnk120913" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">ncl-talk@ucar.edu</a>><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" id="gmail-m_9049609089107545063LPlnk145376" class="gmail-m_9049609089107545063OWAAutoLink" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote></div>