[ncl-talk] Interpolation to specific height levels

Dennis Shea shea at ucar.edu
Mon Jun 21 14:54:52 MDT 2021


the return from:

ta_interp        = *wrf_user_vert_interp(*a,ta_mean,vert_coord,lev,opts)

is

[Time | 755] x *[interp_levels | 7] *x [south_north | 129]   x [west_east |
210]

The print statement

(0)     it=0  nlt=1  nln=80 nlev=6
(0)     it=0  nlt=85  nln=154 *nlev=27      <=======nlev=27*

This exceeds the dimension size

          alist = [/times(it),lat1,lon1,ta_interp(it,nlev,nlt,nln)/]
<---- nclev can have values 0->6 only [ 7 values ]

===
As ncl-talk has noted numerous times, NCL developers provided interfaces to
fortran code created by the WRF project.



On Sat, Jun 19, 2021 at 1:05 AM ali mughal <mughalali655 at gmail.com> wrote:

> Dear Dennis
>
> Thank you for the response. Please see the following output from the
> statement print("it="+it+"  nlt="+nlt+"  nln="+nln+" nlev="+nlev)
>
> (0)     it=0  nlt=1  nln=80 nlev=6
> (0)     it=0  nlt=85  nln=154 nlev=27
>
> which is correct according to what is required, however, not sure why "it"
> remains 0.
>
> The following is the output of prinVarSummary for ta_interp which is also
> correct.
>
> Variable: ta_interp
> Type: float
> Total Size: 572682600 bytes
>             143170650 values
> Number of Dimensions: 4
> Dimensions and sizes:   [Time | 755] x [interp_levels | 7] x [south_north
> | 129]                     x [west_east | 210]
> Coordinates:
>             interp_levels: [6..15]
> Number Of Attributes: 8
>   _FillValue :  9.96921e+36
>   FieldType :   104
>   MemoryOrder : XYZ
>   description : T Abs. Mean
>   units :       K
>   stagger :
>   coordinates : XLONG XLAT XTIME
>   vert_interp_type :    theta
>
> The total number of the eta levels (vertical levels) in the wrfout file
> were 51. I needed to interpolate the values to exact heights of the seven
> stations as I mentioned before as some of the stations lie above the height
> of 1st vertical level. The first level is at 5.5 m height.
>
>
>
>
>
>
> On Sat, Jun 19, 2021 at 3:03 AM Dennis Shea <shea at ucar.edu> wrote:
>
>> 120       alist = [/times(it),lat1,lon1,ta_interp(it,nlev,nlt,nln)/]   ;
>> Store data to be written in a list.
>> =============
>> fatal:Subscript out of range, error in subscript #1
>>
>> Subscript #1 of ta_interp(it,*nlev*,nlt,nln) is "nlev"    [ subscript
>> numbers: (0,1,2,3) ]
>>
>> When you get this type of error, use print statements prior to the
>> offending statement:
>>
>> print("it="+it+"  nlt="+nlt+"  nln="+nln+" nlev="+nlev)
>> alist = [/times(it),lat1,lon1,ta_interp(it,nlev,nlt,nln)/]
>> =====
>>
>> After the computation of 'ta_interp' add a printVarSummary:
>>
>>    ta_interp = wrf_user_vert_interp(a,ta_mean,vert_coord,lev,opts)
>>    printVarSummary(ta_interp)
>>
>> This will give you the variable dimension information.
>>
>>
>>
>>
>>
>>
>>
>>
>> On Thu, Jun 17, 2021 at 11:53 PM ali mughal via ncl-talk <
>> ncl-talk at mailman.ucar.edu> wrote:
>>
>>> Dear All
>>>
>>> I am trying to obtain values of temperature at seven specific station
>>> locations and their respective heights. To do so, I have modified the
>>> script write_csv 5.ncl according to my usage.
>>> But I am getting the following error at line
>>> fatal:Subscript out of range, error in subscript #1
>>> fatal:An error occurred reading ta_interp
>>> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 120 in
>>> file write_TA_MEAN_intrp.ncl
>>>
>>> Can someone kindly guide me on what I can correct so that I can get the
>>> required values at respective heights and location of the stations ?
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at mailman.ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210621/03b97752/attachment.html>


More information about the ncl-talk mailing list