[ncl-talk] potential vorticity, error of " division by 0"
Dennis Shea
shea at ucar.edu
Wed Jun 17 21:05:18 MDT 2015
[1]
Why did you do the following?
P_00 = (P_00)*100
P_00 at units = "Pa"
[2]
The 1st rule of data processing is "look at your data". If you had looked
you would have see the units are already "Pa".
float lv_ISBL8 ( lv_ISBL8 )
long_name : Isobaric surface
units : Pa <=======================
The units are already "Pa". You should not multiply by 100. Only if the
units were "hPa"
[3]
That attached code ran correctly under NCL 6.3.0. Output attached.
[4]
Please look at the printed output.
Note the coordinate information Specifically the order of the lat and
pressure arrays.
On Sat, Jun 13, 2015 at 3:09 AM, Nafiseh Pegahfar <pegahfar at alumni.ut.ac.ir>
wrote:
>
> I write a ncl code to calculate PV(potential vorticity) at 300 mb using
> gfs data.
> after running I recievd the error of
> """"""""""""""""""""""""""""""""""""""""""""""""""""""""
> fatal:divide: Division by 0, Can't continue
> fatal:Div: operator failed, can't continue
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 3892 in
> file /usr/share/ncarg/nclscripts/csm/shea_util.ncl
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 3909 in
> file /usr/share/ncarg/nclscripts/csm/shea_util.ncl
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 133 in
> file PVcode_version6_3.ncl
> """""""""""""""""""""""""""""""""""""""""""""""""""""""'''
>
> I checked 3892 line in shea_util.ncl it was "con = R/(s*conform(t,p,npr))"
> while s= -(t/theta)*dthdp. I checked "s","t","theta","dthdp" and
> "conform(t,p,npr)". non of them was zero.
>
> please help me what to do.
> some of my code is :
>
> U_00 = a->UGRD_P0_L100_GLL0(:,::-1,:) ; (time,lev,lat,lon) or
> (lev,lat,lon) V_00 = a->VGRD_P0_L100_GLL0(:,::-1,:) ;
> (time,lev,lat,lon) or
> (lev,lat,lon)
> T_00 = a->TMP_P0_L100_GLL0(:,::-1,:) ; K
> P_00 = (a->lv_ISBL0)
> P_00 = (P_00)*100
> P_00 at units = "Pa"
> m=dimsizes(P_00)
> print ("dimsizes(P_00)="+dimsizes(P_00))
>
> L = T_00&lat_0
>
> ;"""""""""""""""""""""""""""""""""""""""""""""
> ;check "conform(T_00,P_00,0)"
> ;""""""""""""""""""""""""""""""""""""""""""'
> conform_00=conform(T_00,P_00,0)
> test=0.0
> conform_00_zero_test = where(conform_00.eq.0, test+5, test)
> print("test="+test)
>
> ;"""""""""""""""""""""""""""""""""""""""""""""
> ;check "s= -(t/theta)*dthdp"
> ;""""""""""""""""""""""""""""""""""""""""""'
> theta_test=0.0
> theta_00= T_00*(100000./conform(T_00,P_00,0))^0.286
> ;print("theta_00="+theta_00)
> theta00_zero_test = where(theta_00.eq.0, theta_test+5, theta_test)
> print("theta_test="+theta_test)
>
> T_test=0
> T00_zero_test = where(T_00.eq.0, T_test+5, T_test)
> print(" T_test="+ T_test)
> ;print("T_00="+T_00)
>
> dthdp_test=0
> dthdp_00 = center_finite_diff_n (theta_00,P_00,False,0,0)
> dthdp_00_zero_test = where(dthdp_00.eq.0, dthdp_test+5, dthdp_test)
> print("dthdp_test="+dthdp_test)
> ;print("dthdp_00="+dthdp_00)
> ;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""'
>
> PV_00 = pot_vort_isobaric(P_00 ,U_00 ,V_00 ,T_00 ,L , 1, 0)
> printVarSummary (PV_00)
> PV_00_300 = PV_00 ({3000000},:,:)
> print ("PV_00_300"+PV_00_300)
>
>
> =================================
> Best Regards
> Nafiseh Pegahfar
> Assistant Professor
> Iranian National Institute for Oceanography and Atmospheric Science
> (http://www.inio.ac.ir)
> Phone: (0098)21- 66944873-5 Ext. 315
> Fax: (0098)21- 66944869
> Email: (pegahfar at ut.ac.ir)
> (pegahfar at inio.ac.ir)
> =================================
>
>
>
> =================================
> Best Regards
> Nafiseh Pegahfar
> Assistant Professor
> Iranian National Institute for Oceanography and Atmospheric Science
> (http://www.inio.ac.ir)
> Phone: (0098)21- 66944873-5 Ext. 315
> Fax: (0098)21- 66944869
> Email: (pegahfar at ut.ac.ir)
> (pegahfar at inio.ac.ir)
> =================================
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150617/a4658585/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ncltalk.gfsanl_4.ncl
Type: application/octet-stream
Size: 1334 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150617/a4658585/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: out.pehahfar
Type: application/octet-stream
Size: 61529 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150617/a4658585/attachment-0001.obj
More information about the ncl-talk
mailing list