<div dir="ltr">Thanks for the reply everyone. The script is running now but i am getting this error now-<div><br><div><div>Data Request Warning: Request is completely outside file limits</div><div>k=nt</div><div>300 500 200 1 7</div><div><div>Data Request Warning: Request is completely outside file limits</div><div>k=nt</div><div>200 300 200 1 8</div></div><div><br></div><div>I have total of 164 time steps in my file and after putting it at place of k, this error appears. Please tell me where to correct now in my script.</div><div><br></div><div>Thanks</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 19, 2017 at 4:13 PM, Davide Sacchetti <span dir="ltr"><<a href="mailto:davide.sacchetti@arpal.gov.it" target="_blank">davide.sacchetti@arpal.gov.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">no idea ...<br>
but when creating thermo.ctl you forget "append" in:<br>
write (filename, record <, append>)<br>
so I expect thermo.ctl to be overwritten at every write<br>
<br>
When finished, use also close (name)<br>
(see <a href="http://cola.gmu.edu/grads/gadoc/script.html" rel="noreferrer" target="_blank">http://cola.gmu.edu/grads/<wbr>gadoc/script.html</a>)<br>
<br>
Bye<br>
Davide<br>
<br>
Il giorno mer, 19/04/2017 alle 15.38 +0530, praveen rai ha scritto:<br>
> This script runs successfully but the .bin file is getting made<br>
> because of which .ctl file is not opening. Please anyone tell me how<br>
> to made this .bin file and where i am doing wrong.<br>
><br>
> Thanks<br>
><br>
> On Wed, Apr 19, 2017 at 2:04 PM, praveen rai <<a href="mailto:praveenrai583@gmail.com">praveenrai583@gmail.com</a><br>
> > wrote:<br>
> > Hello all,<br>
> ><br>
> > I have made a .ctl file from .nc file using CDO command which shows<br>
> > following description-<br>
> ><br>
> > * Generated by CDO operator gradsdes<br>
> > *<br>
> > DSET ^<a href="http://merge_rf79_05_act_0lag.nc" rel="noreferrer" target="_blank">merge_rf79_05_act_0lag.nc</a><br>
> > DTYPE netCDF<br>
> > XDEF 720 LINEAR 0.000000 0.500000<br>
> > YDEF 361 LINEAR -90.000000 0.500000<br>
> > ZDEF 7 LEVELS 2 3 5 7 8.5 9.25 10 <br>
> > TDEF 164 LINEAR 12:00Z03aug1979 1dy<br>
> > TITLE <a href="http://merge_rf79_05_act_0lag.nc" rel="noreferrer" target="_blank">merge_rf79_05_act_0lag.nc</a> 720x361 grid<br>
> > OPTIONS yrev zrev<br>
> > UNDEF -32767<br>
> > VARS 4<br>
> > v 7 t,z,y,x V component of wind [m s**-1]<br>
> > u 7 t,z,y,x U component of wind [m s**-1]<br>
> > t 7 t,z,y,x Temperature [K]<br>
> > w 7 t,z,y,x Vertical velocity [Pa s**-1]<br>
> > ENDVARS<br>
> ><br>
> > Using this .ctl file, i am trying to write a .ctl file containing<br>
> > variables for my diabatic heating calculation but the new .ctl file<br>
> > is not opening and it gives following error-<br>
> ><br>
> > Scanning description file: thermo.ctl<br>
> > Open Error: Looking for "endvars", found "res 7 99 residuo of<br>
> > diabatic heating (q) [k/dia] " instead.<br>
> > --> The invalid description file record is:<br>
> > --> res 7 99 residuo of diabatic heating (Q) [K/dia]<br>
> > The data file was not opened.<br>
> > I am using the following script to calculate the diabatic heating<br>
> > variable in .ctl file-<br>
> > 'reinit'<br>
> > 'open merge_rf79_05_act_0lag.ctl'<br>
> ><br>
> > ******************************<wbr>*****************************<br>
> > 'q file'<br>
> > rc=sublin(result,5)<br>
> > nt=subwrd(rc,12)<br>
> > nl=subwrd(rc,9)<br>
> > nx=subwrd(rc,3)<br>
> > ny=subwrd(rc,6)<br>
> > rc=sublin(result,6)<br>
> > 'q time'<br>
> > td=subwrd(result,3)<br>
> > ano=substr (td, 9, 4)<br>
> ><br>
> > ******************************<wbr>*****************************<br>
> ><br>
> > 'set fwrite thermo.bin'<br>
> > 'set gxout fwrite'<br>
> > 'set x 1 720 '<br>
> > 'set y 1 361 '<br>
> ><br>
> > * Note: Repeat 1000 and 100 to permit program diferentiate z<br>
> > levels.<br>
> ><br>
> > string=' 10 10 9.25 8.5 7 5 3 2 2 '<br>
> ><br>
> > *aa --> m<br>
> > *Rgas --> 287.05 J/Kg K<br>
> > *Cp --> 1004 J/Kg K<br>
> > *dt --> s<br>
> > *T --> K<br>
> > *u --> m/s<br>
> > *v --> m/s<br>
> > *P --> Pa<br>
> > *W --> Pa/s<br>
> ><br>
> > 'define aa=6.37e6'<br>
> > 'define pi=2*asin(1)'<br>
> > 'define rd=pi/180'<br>
> > 'define clat=cos(lat*rd)'<br>
> > 'define dx=cdiff(lon,x)*rd'<br>
> > 'define dy=cdiff(lat,y)*rd'<br>
> > 'define kp=287.05/1004'<br>
> > 'define dt=3600*6*2'<br>
> ><br>
> > 'k = 1'<br>
> > 'l = 2'<br>
> ><br>
> > while (k <= 164)<br>
> ><br>
> > while (l <= 7+1)<br>
> ><br>
> > 'set t 'k<br>
> ><br>
> > l1=l-1<br>
> > l2=l+1<br>
> ><br>
> > nivel = subwrd(string,l)<br>
> > nivel1 = subwrd(string,11)<br>
> > nivel2 = subwrd(string,l2)<br>
> ><br>
> > * As vertical velocity is in units of Pa/sec and the levels (in CTL<br>
> > and nc data) <br>
> > * are in hPa, we must multiply the levels (hPa) by 100 to convert<br>
> > it in Pa units <br>
> > * (the same unit of vertical velocity)<br>
> ><br>
> > 'define p1='nivel1'*100'<br>
> > 'define p2='nivel2'*100'<br>
> ><br>
> > say nivel' 'nivel1' 'nivel2' 'k' 'l<br>
> ><br>
> > 'set lev 'nivel<br>
> ><br>
> > * Computing Temperature tendency term<br>
> > *_____________ dT/dt _______________*<br>
> > * Units must be in K/s<br>
> ><br>
> > k1=k-1<br>
> > k2=k+1<br>
> ><br>
> ><br>
> > if(k!=1 | k!=nt)<br>
> > 'define ttend = (T(t='k2')-T(t='k1'))/dt'<br>
> > endif<br>
> ><br>
> > if(k=1)<br>
> > 'define ttend = (T(t='k2')-T(t='k'))/(dt/2)'<br>
> > say 'k=1'<br>
> > endif<br>
> ><br>
> ><br>
> > if(k=nt)<br>
> > 'define ttend = (T(t='k')-T(t='k1'))/(dt/2)'<br>
> > say 'k=nt'<br>
> > endif<br>
> ><br>
> > * Computing Temperature horizontal advection<br>
> > * in hespherical coordinates<br>
> > *_____________ V Grad(T) _______________*<br>
> > * Units must be in K/s<br>
> ><br>
> > 'define advh = ((u*cdiff(T,x))/(clat*dx) + (v*cdiff(T,y))/dy)/aa'<br>
> ><br>
> > * Computing Temperature vertical advection<br>
> > * in hespherical coordinates<br>
> > *_________ w Grad(T) or wdT/dp __________*<br>
> > * Units must be in K/s<br>
> ><br>
> > 'define advv = w*(t(lev='nivel2')-t(lev='<wbr>nivel1'))/(p2-p1)'<br>
> ><br>
> > * Computing alfa term<br>
> > * in hespherical coordinates<br>
> > * _____RTW/CpP _____________*<br>
> > * Units must be in K/s<br>
> ><br>
> > 'define qd = -kp * (w*(t))/(lev*100)'<br>
> ><br>
> > * Computing ther esidual term or the diabatic term<br>
> > * in hespherical coordinates<br>
> > * _____ Q _____________*<br>
> > * Units must be in K/s<br>
> ><br>
> > 'define res = ttend + advh + advv + qd'<br>
> ><br>
> > * Recording the diabatic term in units of K/day<br>
> ><br>
> > 'd ttend*86400'<br>
> > 'd advh*86400'<br>
> > 'd advv*86400'<br>
> > 'd qd*86400'<br>
> > 'd res*86400'<br>
> ><br>
> ><br>
> ><br>
> > k = k<br>
> > l = l + 1<br>
> ><br>
> > endwhile<br>
> ><br>
> > l = 2<br>
> > k = k + 1<br>
> ><br>
> > endwhile<br>
> ><br>
> > 'disable fwrite'<br>
> ><br>
> > ******************************<wbr>****************************<br>
> > write (thermo.ctl,'dset thermo.bin')<br>
> > write (thermo.ctl,'undef -32767')<br>
> > write (thermo.ctl,'title <a href="http://merge_rf79_05_act_0lag.nc" rel="noreferrer" target="_blank">merge_rf79_05_act_0lag.nc</a> 720x361 grid')<br>
> > write (thermo.ctl,"xdef "720" linear 0.0 "0.5"")<br>
> > write (thermo.ctl,"ydef "361" linear -90.0 "0.5"")<br>
> > write (thermo.ctl,"zdef "7" levels "2" "3" "5" "7" "8.5" "9.25"<br>
> > "10" ")<br>
> > write (thermo.ctl,"tdef "164" linear "00Z03aug1979" "12hr" " )<br>
> > write (thermo.ctl,'vars 4')<br>
> > write (thermo.ctl,'ttend 7 99 temperature tendency [K/dia] ')<br>
> > write (thermo.ctl,'advh 7 99 horiz. temperature advection<br>
> > [K/dia] ')<br>
> > write (thermo.ctl,'advv 7 99 vertical temperature advection<br>
> > [K/dia] ')<br>
> > write (thermo.ctl,'qd 7 99 <br>
> > [K/dia] ')<br>
> > write (thermo.ctl,"res "7" 99 residuo of diabatic heating (Q)<br>
> > [K/dia] ")<br>
> > write (thermo.ctl,'endvars')<br>
> > ******************************<wbr>****************************<br>
> ><br>
> > Sorry for the long note. Any help will be much appreciated.<br>
> ><br>
> > Thanks<br>
> > Praveen<br>
> ><br>
> ><br>
><br>
> ______________________________<wbr>_________________<br>
> gradsusr mailing list<br>
> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
<br>
</blockquote></div><br></div>