Re: Variable reassignment problem NCL 6.1.0

From: Kyle Griffin <ksgriffin2_at_nyahnyahspammersnyahnyah>
Date: Sat Mar 08 2014 - 08:41:30 MST

Almost didn't see it, but the same is true of avg. You will need to change
that as well as it is also a function and thus can't be used as a variable
name.

Kyle
On Mar 8, 2014 8:53 AM, "Tabish Ansari" <tabishumaransari@gmail.com> wrote:

> Hello
>
> I am getting syntax error in the following simple NCL code:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
> begin
> a=addfile("../wrfchemi_00z_d01_seac4rs.nc","r")
> b=addfile("../wrfinput_d01.nc","r")
>
> sum=0.0
> do i=0,98,1
> do j=0,108,1
> if (b->XLAND(0,j,i).ne.2)
> sum = sum + (a->E_CO(0,0,j,i))
> end if
> end do
> end do
> printVarSummary(a->E_CO)
> printMinMax(a->E_CO, True)
> print (sum)
> avg=sum/10791.0
> print(avg)
> end
>
> The above code is showing the following error:
>
> fatal:syntax error: line 9 in file minmax.ncl before or near =
> sum=
> ---^
>
> fatal:error in statement
> fatal:syntax error: line 13 in file minmax.ncl before or near =
> sum =
> -------^
>
> fatal:error in statement
> fatal:syntax error: function sum expects 1 arguments, got 0
> fatal:error at line 19 in file minmax.ncl
>
> fatal:syntax error: procedure print expects 1 arguments, got 0
> fatal:error at line 19 in file minmax.ncl
>
> fatal:syntax error: line 20 in file minmax.ncl before or near =
> avg=
> ---^
>
> fatal:error in statement
> fatal:syntax error: function avg expects 1 arguments, got 0
> fatal:error at line 21 in file minmax.ncl
>
> fatal:syntax error: procedure print expects 1 arguments, got 0
> fatal:error at line 21 in file minmax.ncl
>
> fatal:Syntax Error in block, block not executed
> fatal:error at line 22 in file minmax.ncl
> Please help me with this.
>
> --
> Thanks & Regards
> Tabish Umar Ansari
> MS Research Scholar
> Environmental & Water Resources Engineering Division
> Department of Civil Engineering
> IIT Madras
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Mar 8 08:41:39 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2014 - 15:08:52 MDT