[ncl-talk] Regarding Problem in Correlation Plot in NCL
Toni Klemm
toni-klemm at tamu.edu
Wed Mar 27 07:17:46 MDT 2019
Sir,
Please always reply to ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>, not just to the person who emailed you. That way others can chime in, too, and your question is archived.
Are you sure this all of your code? The error message says the error is in line 421, but you only included 75 lines of code. Also, I don’t see any loops or “begin” and “end” at the front and back end of your code. Could you include all your code, from “begin” to “end”?
Thanks,
Toni
Toni Klemm, Ph.D.
Postdoctoral Research Associate
Department of Ecosystem Science and Management
College of Agriculture and Life Sciences
Texas A&M University, College Station, TX
Contributor to the Early Career Climate Forum <https://www.eccforum.org/>
www.toni-klemm.de <http://www.toni-klemm.de/> | @toniklemm <https://twitter.com/ToniKlemm>
> On Mar 27, 2019, at 5:59 AM, Ashutosh K Sinha <ashutoshsinha at cusb.ac.in> wrote:
>
> lat0=0
> lat1=40
> lon0=20
> lon1=150
> f1=addfile("daily_1.nc <https://urldefense.proofpoint.com/v2/url?u=http-3A__daily-5F1.nc&d=DwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=WsLJ5ywbW3XnTzqo_ETV62H6s1a5bcGgnrpl7xPRfic&m=hhdYutZEmgES2blVqSqB_MtEv5ixmzewdClL37_xzI0&s=Oy4Q6oTBGw-AUYsg0wqI2QibatzuHVHBoD2bUwu3E9w&e=>","r")
> f2=addfile("daily_2.nc <https://urldefense.proofpoint.com/v2/url?u=http-3A__daily-5F2.nc&d=DwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=WsLJ5ywbW3XnTzqo_ETV62H6s1a5bcGgnrpl7xPRfic&m=hhdYutZEmgES2blVqSqB_MtEv5ixmzewdClL37_xzI0&s=f7vZDcv0bvgoO0xxKTh4DalxHLSK1FXgeeOUmANKmNA&e=>","r")
> sst=f1->sst(:,{lat0:lat1},{lon0:lon1})
> latsfc=f1->latitude({lat0:lat1})
> lonsfc=f1->longitude({lon0:lon1})
> timesfc=f1->time
> sstcT=(sst*sst at scale_factor)+sst at add_offset
> sstc=sstcT-273.15
> sstc!0="time"
> sstc!1="lat"
> sstc!2="lon"
> sstc&time=timesfc
> sstc&lat=latsfc
> sstc&lon=lonsfc
> sstc at units=sst at units
> vo=f2->vo(:,{lat0:lat1},{lon0:lon1})
> lathpa=f2->latitude({lat0:lat1})
> lonhpa=f2->longitude({lon0:lon1})
> timehpa=f2->time
> vocT=(vo*vo at scale_factor)+vo at add_offset
> voc=vocT*(10^5)
> voc!0="time"
> voc!1="lat"
> voc!2="lon"
> voc&lat=lathpa
> voc&lon=lonhpa
> voc&time=timehpa
> voc at units=vo at units
> ts1 = sstc(lat|:,lon|:,time|:)
> ts2 = voc(lat|:,lon|:,time|:)
> maxlag = 2
> lag = 0
> ccr = esccr(ts1,ts2,maxlag)
> copy_VarAtts(ts1,ccr)
> copy_VarCoords_1(ts2,ccr)
> wks = gsn_open_wks("png","correlation1")
> res=True
> res at gsnDraw=False
> res at gsnFrame=False
> res at gsnAddCyclic = False
> res at gsnMaximize = False
> res at tiMainString = "Correlation_Surface-850"
> res at tiMainStringOrthogonalPosF=0.5
> res at gsnLeftString = ""
> res at gsnRightString = ""
> res at tmXTOn = False
> res at tmYROn = False
> res at lbLabelBarOn =""
> res at mpMinLatF = lat0
> res at mpMaxLatF = lat1
> res at mpMinLonF = lon0
> res at mpMaxLonF = lon1
> res at mpOutlineOn = True
> res at mpGeophysicalLineThicknessF = 4
> res at mpNationalLineThicknessF = 4
> res at mpFillDrawOrder = "PostDraw"
> res at mpFillOn = False
> res at cnLevelSelectionMode = "ManualLevels"
> res at cnMinLevelValF = -1.
> res at cnMaxLevelValF = 1.
> res at cnLevelSpacingF = 0.1
> res at cnLabelBarEndStyle = "ExcludeOuterBoxes"
> res at pmLabelBarWidthF = 0.8
> res at cnFillDrawOrder = "PreDraw"
> res at cnFillOn = True
> res at cnLinesOn = True
> res at cnLineLabelsOn = True
> map = gsn_csm_contour_map(wks,ccr(:,:,lag),res)
> draw(map)
> frame(wks)
>
> **** sst is for Sea Surface Temperature and vo for Vorticity
>
> Ashutosh K Sinha
> PhD Student - Environmental Sciences
> (Central University of South Bihar, Gaya, India)
>
> Never Give Up
>
> Central University Of South Bihar
> Please enter your username and password to continue.
>
> Username:
> Password:
>
> <x-msg://10/#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> On Wed, Mar 27, 2019 at 3:57 PM Toni Klemm <toni-klemm at tamu.edu <mailto:toni-klemm at tamu.edu>> wrote:
> Sir,
>
> Could you include your code? It looks like something is wrong with an if condition or a do loop, but it‘s hard to pinpoint without seeing your code.
>
> Toni
>
>
> Toni Klemm, Ph.D.
> Postdoctoral Research Associate
> Department of Ecosystem Science and Management
> College of Agriculture and Life Sciences
> Texas A&M University, College Station, TX
> Contributor to the Early Career Climate Forum <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.eccforum.org_&d=DwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=WsLJ5ywbW3XnTzqo_ETV62H6s1a5bcGgnrpl7xPRfic&m=hhdYutZEmgES2blVqSqB_MtEv5ixmzewdClL37_xzI0&s=DdmI6LDEkRhKEwr39FKOFsqPcgaS2kP9iAIx_rvsbWc&e=>
> www.toni-klemm.de <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.toni-2Dklemm.de_&d=DwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=WsLJ5ywbW3XnTzqo_ETV62H6s1a5bcGgnrpl7xPRfic&m=hhdYutZEmgES2blVqSqB_MtEv5ixmzewdClL37_xzI0&s=E33q5sdAzGskdONfaPG5_nqvLX2H_sdH-V677rrSJKk&e=> | @toniklemm <https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_ToniKlemm&d=DwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=WsLJ5ywbW3XnTzqo_ETV62H6s1a5bcGgnrpl7xPRfic&m=hhdYutZEmgES2blVqSqB_MtEv5ixmzewdClL37_xzI0&s=s3h4u2mZUQl9pt-bIidT0hSPWKW4OqlBkv5azinatV8&e=>
>
>
> On Mar 27, 2019, at 4:43 AM, Ashutosh K Sinha <ashutoshsinha at cusb.ac.in <mailto:ashutoshsinha at cusb.ac.in>> wrote:
>
>> Greetings!!
>>
>> I am trying to plot correlation using esccr or escor however I have been getting errors as
>> map = gsn_csm_contour_map(wks,ccr(:,:,lag),res)
>> fatal:Conditional statements (if and do while) require SCALAR logical values, see all and any functions
>> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 7796 in file /home/NCL-6.4.0/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>>
>> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 11285 in file /home/NCL-6.4.0/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>>
>> fatal:["Execute.c":8638]:Execute: Error occurred at or near line 421
>>
>> What should I do?
>>
>> Ashutosh K Sinha
>> PhD Student - Environmental Sciences
>> (Central University of South Bihar, Gaya, India)
>>
>>
>> Never Give Up
>> Central University Of South Bihar
>> Please enter your username and password to continue.
>>
>> Username:
>> Password:
>>
>> <x-msg://10/#m_41330349500631256_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>_______________________________________________
>> 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 <https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.ucar.edu_mailman_listinfo_ncl-2Dtalk&d=DwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=WsLJ5ywbW3XnTzqo_ETV62H6s1a5bcGgnrpl7xPRfic&m=hhdYutZEmgES2blVqSqB_MtEv5ixmzewdClL37_xzI0&s=Mbzq7AkG0gKTtIU8r-BIukGUDNX37orir9Ru3SbQjRg&e=>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190327/126a7d3d/attachment.html>
More information about the ncl-talk
mailing list