<div dir="ltr"><div><div><div>Hi users I have a problem. This is my script:<br><br><br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;<br>;*****************************************************<br>begin<br><br>inidx = 0<br>inloc = &quot;Huayao&quot;<br>inlat = -12.04<br>inlon = -75.32<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>; Now open station data (observations) and read in<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br><br><br>  delim     = &quot;,&quot; ; these are csv files<br><br>  ; El Nino<br>   ; open the files and read in the data<br>    obs_data_pd_elnino = asciiread(&quot;/media/jesus/TOSHIBA/ncl_alan/datos/estacion_diaria.csv&quot;,-1,&quot;string&quot;)<br>    obs_strs_pd_elnino   = str_split_csv (obs_data_pd_elnino, &quot;,&quot;, 0)<br>    obs_pointdata_pd_elnino=tofloat(obs_strs_pd_elnino(1:27,2::))<br><br>   ; Now compute the length(0) and width(1) of the data matrix<br>    obsdims_pd_elnino = dimsizes(obs_pointdata_pd_elnino)<br><br>   ; Find the data column that corresponds to your station of interest<br>    obs_pointdata_1stn_pd_elnino = obs_pointdata_pd_elnino(:,inidx)<br><br>   ; now compute a daily climatology from the time series (i.e., average all days together)<br>    obs_pointdata_1stn_90d_multiyear_pd_elnino = onedtond(obs_pointdata_1stn_pd_elnino,(/(obsdims_pd_elnino(0)/3),3/))<br>    obs_pointdata_1stn_dayclm_pd_elnino = dim_avg_n(obs_pointdata_1stn_90d_multiyear_pd_elnino,1)<br><br>  <br><br><br><br><br>fname = (&quot;/media/jesus/TOSHIBA/WRF_alan/9km/wrfout_d01_2003-01-29_00:00:00&quot;) ; input precip data <br>  fin = addfile (fname,&quot;r&quot;) <br> ; prc = fin-&gt;pr ; (time,yc, xc) 3 hrly <br>  lat = fin-&gt;XLAT <br>  lon = fin-&gt;XLONG<br><br>  time = fin-&gt;Times <br>  ntimes = dimsizes(time)<br><br><br>  rain_exp = wrf_user_getvar(fin,&quot;RAINNC&quot;,-1)<br>  rain_con = wrf_user_getvar(fin,&quot;RAINC&quot;,-1)<br><br>;rain_exp=fin-&gt;RAINNC(:,:,:)<br>;rain_con=fin-&gt;RAINC(:,:,:)<br><br>   rain_tot = rain_exp + rain_con<br><br>   rain=rain_tot(0:743,:,:)<br><br> do  it=1,743,1 <br><br>  rain(it,:,:)=rain_tot(it,:,:)-rain_tot(it-1,:,:)<br><br> end do<br>  <br> ;x(time,lev,lat,lon) <br><br>         dimx = dimsizes(rain) <br>         ntim = dimx(0) ; number of time steps <br>      ;    printVarSummary(rain) <br><br>         ;nlat = dimx(2) <br>        ; mlon = dimx(3) <br><br>         nday = ntim/24 <br><br><br>     ; print(&quot;nday=&quot;+nday) <br>     ; print(&quot;ntim=&quot;+ntim)<br><br>         xday = rain(::24,:,:) ; &#39;trick&#39; to allocate memory + retain meta data <br>     ; printVarSummary(xday)<br>        <br>         do nt=0,ntim-1,24 <br>            xday(nt/24,:,:) = dim_avg_n_Wrap(rain(nt:nt+23,:,:),0)  ;<br><br>         end do <br><br><br>modvar_pd_elnino = xday(3:29,:,:)<br><br>modvar_pd_elnino!0=&quot;time&quot;<br>modvar_pd_elnino!1=&quot;lat&quot;<br>modvar_pd_elnino!2=&quot;lon&quot;<br><br><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">; Find latitudes and longitudes so that you can interpolate data to specified station<br>    lat  = modvar_pd_elnino&amp;lat<br>    lon  = modvar_pd_elnino&amp;lon </span><br></span><br><br>; El Nino<br>    mod_pointdata_1stn_dayclm_pd_elnino_2d = linint2_points(lon,lat,modvar_pd_elnino,False,inlon,inlat,0)<br>    mod_pointdata_1stn_dayclm_pd_elnino = mod_pointdata_1stn_dayclm_pd_elnino_2d(:,0)<br><br>; now create a single data variable that holds all six           <br>; data arrays that you would like to plot<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br><br>   data = new((/2,27/),&quot;float&quot;)<br>   <br>  ; rank order all of  the data so you can compute percentiles<br>  data(0,:) = obs_pointdata_1stn_dayclm_pd_elnino<br>  data(1,:) = mod_pointdata_1stn_dayclm_pd_elnino<br><br> ;create a dummy time variable (integer days: 1 = Dec 1, 90 = Feb 28)<br>  intday = ispan(1,27,1)<br><br>;**************************************<br>;   Create plot<br>;***************************************<br> ;open the image. Note you can choose pdf, ps, png, ncgm or x11 format. (x11 prints to screen)<br>  wks   = gsn_open_wks (&quot;x11&quot;,&quot;xy_&quot;+inloc+&quot;_tas&quot;)                  ; open workstation<br><br> ;Set the resources for the plot Text<br>  res                   = True                      ; plot mods desired<br><br> ;Text strings for title and axes<br>  res@tiMainString  =  inloc+&quot;: DJF El Nino vs La Nina: tas&quot;      ; Title at top of plot<br>  res@tiYAxisString = &quot;tas (deg_C)&quot;                         ; Y-axis title<br>  res@tiXAxisString =&quot;Day of DJF&quot;     <br><br> ;Line colors/types<br>  res@xyLineThicknesses = (/3.,2./)               ; make 2nd lines thicker<br>  res@xyLineColors      = (/&quot;red&quot;,&quot;blue&quot;/)          ; change line color<br>  res@xyDashPatterns    = (/0,5/)               ; Make curves all solid<br><br> ;Make the plot<br>  plot  = gsn_csm_xy (wks,intday,data,res) ; create plot<br><br><br>end<br><br></div><br><span style="color:rgb(0,0,255)">And when I want to run it, this message appear:</span><br><br><span style="color:rgb(255,0,0)">fatal:No coordinate variable exists for dimension (lat) in variable (modvar_pd_elnino)<br>fatal:[&quot;Execute.c&quot;:8575]:Execute: Error occurred at or near line 131 in file serie_tiempo.ncl</span><br><br></div><span style="background-color:rgb(243,243,243)">would you please give me some advices for this problem?, thank for your time.<br></span></div><span style="background-color:rgb(243,243,243)"><br>Jesus</span><br><br></div>