Re: FillValue attributes

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sat Nov 09 2013 - 07:47:47 MST

[1] What version of NCL are you using?

%> ncl -V

[2] Where have you allocated memory for 'rh'. In your code,
     I would have expected to see:

      rh = new (dimsizes(temp_cfs), typeof(temp_cfs))

[3] Your code could be made more efficient.

[a] Whenever an entire variable is being read don't use (:,:,:,:).
     NCL accesses the data more efficiently without the (:,:,:,:).
     In practice, you will likely not notice any speed difference.

   temp_spcfs = f1->TMP_GDS0_ISBL_10 ; (:,:,:,:)
   sp_spcfs = f2->SPF_H_GDS0_ISBL_10
   temp_cfs = f3->TMP_GDS0_ISBL_10
   sp_cfs = f4->SPF_H_GDS0_ISBL_10

[b] NCL is an interpreted language. Generally, it is better to
     avoid 'do' loops. NCL has 2 functions which can be used to
     replace your do loop

http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/conform_dims.shtml

Replace
   rh = new(dimsizes(temp_cfs),typeof(temp_cfs)) ; added for correctness

   do k = 1,nlevs
     do j = 1, nlon
       do i = 1,nlat
           pPa = levs(k)*100
           rh(i, j, k) = relhum (t_spcfs(i,j,k), sph_spcfs(i,j,k), pPa)
       end do
     end do
   end do

With

    rh = relhum (t_spcfs, sph_spcfs, conform(t_spcfs, levs*100, 1)

There is no need to preallocate space for 'rh'. rh will be created
automatically.

------------

If you are new to NCL, please read the Mini-Language Manual at:

   http://www.ncl.ucar.edu/Document/Manuals/

On 11/9/13 6:59 AM, R Phani wrote:
> Hi NCL users,
>
> I am getting the following error.
>
> fatal:relhum: If one _FillValue attribute is set, then all of them must be set.
> fatal:Execute: Error occurred at or near line 45 in file rel_humid.ncl
>
> What could be the problem in the script?
>
> Phani
>
>
>
> _______________________________________________
> 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 Nov 9 07:47:43 2013

This archive was generated by hypermail 2.1.8 : Mon Nov 11 2013 - 09:45:34 MST