[ncl-talk] Interpolate WRF eta levels to pressure levels

Dennis Shea shea at ucar.edu
Wed Jan 8 11:31:25 MST 2020


re: "The max size is much smaller than original pm10. "

How carefully did you look to see why this may occur?
Are the larger pm10 values outside the 1000 and 100 hPa Levels?

Pick a grid point

nt = 7
nl = 45
ml = 60

print(pm10(nt,:,nl,ml)+"  "+pp(nt,:,nl,ml))   ; original values
 print("-----")

============

To = int2p_n_Wrap (pp,pm10,po,1,1)
     ;
     :
 print(To(nt,:,nl,ml)+"  "+po)        ; interpolated values at specified
pressure levels

Do the values look correct?

On Wed, Jan 8, 2020 at 9:08 AM Anahita Amiri Farahani <aamir003 at ucr.edu>
wrote:

> So you mean this:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
> ana=addfile("wrfout_d01_2015-08-13","r")
> ;ana=addfile("wrfout_d01_2015-08-13_00:00:00","r")
> lat1=ana->XLAT(0,:,0)
> lon1=ana->XLONG(0,0,:)
> P=ana->P
> pm10=ana->PM10
> pp = wrf_user_getvar(ana, "pressure",-1)
> delete(ana)
>
> printVarSummary(pm10)
>   printMinMax(pm10,0)
>   print("====")
>   printVarSummary(P)
>   printMinMax(P,0)
>   print("====")
>
>
> po=(/1000,925,850,700,600,500,400,300,250,200,150,100/);*100.0
> po!0  = "po"
> po at long_name = "Pressure Level"
> po at units     = "hPa"
>
> To = int2p_n_Wrap (pp,pm10,po,1,1)
>    printVarSummary(To)
>    printMinMax(To,0)
> print("====")
>
>
> and I have this:
>
> Variable: To
>
> Type: float
>
> Total Size: 4678560 bytes
>
>             1169640 values
>
> Number of Dimensions: 4
>
> Dimensions and sizes: [Time | 9] x [po | 12] x [south_north | 95] x
> [west_east | 114]
>
> Coordinates:
>
>             po: [1000..100]
>
> Number Of Attributes: 7
>
>   _FillValue : 9.96921e+36
>
>   FieldType : 104
>
>   MemoryOrder : XYZ
>
>   description : pm10 dry mass
>
>   units : ug m^-3
>
>   stagger :
>
>   coordinates : XLONG XLAT XTIME
>
> ncl 32>    printMinMax(To,0)
>
> (0)     pm10 dry mass (ug m^-3) : min=0   max=32.0972
>
> ncl 33> print("====")
>
> (0)     ====
>
>
>
> The max size is much smaller than original pm10.
>
>
> Thanks,
>
> Ana
>
> On Wed, Jan 8, 2020 at 10:59 AM Dennis Shea <shea at ucar.edu> wrote:
>
>> Yes.
>>
>> Sent from my iPhone
>>
>> On Jan 8, 2020, at 8:32 AM, Anahita Amiri Farahani <aamir003 at ucr.edu>
>> wrote:
>>
>> 
>> Hi Dennis,
>>
>> I tried this, but it gives me missing values:
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>>
>> ana=addfile("wrfout_d01_2015-08-13","r")
>>
>> lat1=ana->XLAT(0,:,0)
>> lon1=ana->XLONG(0,0,:)
>> P=ana->P
>> pm10=ana->PM10
>> delete(ana)
>>
>> printVarSummary(pm10)
>>   printMinMax(pm10,0)
>>   print("====")
>>   printVarSummary(P)
>>   printMinMax(P,0)
>>   print("====")
>>
>>
>> po=(/1000,925,850,700,600,500,400,300,250,200,150,100/)*100.0
>> po!0  = "po"
>> po at long_name = "Pressure Level"
>> po at units     = "Pa"
>>
>> To = int2p_n_Wrap (P,pm10,po,1,1)
>>    printVarSummary(To)
>>    printMinMax(To,0)
>> print("====")
>>
>>
>>
>>
>>
>> Variable: pm10
>>
>> Type: float
>>
>> Total Size: 13255920 bytes
>>
>>             3313980 values
>>
>> Number of Dimensions: 4
>>
>> Dimensions and sizes: [Time | 9] x [bottom_top | 34] x [south_north |
>> 95] x [west_east | 114]
>>
>> Coordinates:
>>
>> Number Of Attributes: 6
>>
>>   FieldType : 104
>>
>>   MemoryOrder : XYZ
>>
>>   description : pm10 dry mass
>>
>>   units : ug m^-3
>>
>>   stagger :
>>
>>   coordinates : XLONG XLAT XTIME
>>
>> (0) pm10 dry mass (ug m^-3) : min=0   max=183.558
>>
>> (0) ====
>>
>>
>> Variable: P
>>
>> Type: float
>>
>> Total Size: 13255920 bytes
>>
>>             3313980 values
>>
>> Number of Dimensions: 4
>>
>> Dimensions and sizes: [Time | 9] x [bottom_top | 34] x [south_north |
>> 95] x [west_east | 114]
>>
>> Coordinates:
>>
>> Number Of Attributes: 6
>>
>>   FieldType : 104
>>
>>   MemoryOrder : XYZ
>>
>>   description : perturbation pressure
>>
>>   units : Pa
>>
>>   stagger :
>>
>>   coordinates : XLONG XLAT XTIME
>>
>> (0) perturbation pressure (Pa) : min=0.702637   max=2079.95
>>
>> (0) ====
>>
>>
>> Variable: To
>>
>> Type: float
>>
>> Total Size: 4678560 bytes
>>
>>             1169640 values
>>
>> Number of Dimensions: 4
>>
>> Dimensions and sizes: [Time | 9] x [po | 12] x [south_north | 95] x
>> [west_east | 114]
>>
>> Coordinates:
>>
>>             po: [100000..10000]
>>
>> Number Of Attributes: 7
>>
>>   _FillValue : 9.96921e+36
>>
>>   FieldType : 104
>>
>>   MemoryOrder : XYZ
>>
>>   description : pm10 dry mass
>>
>>   units : ug m^-3
>>
>>   stagger :
>>
>>   coordinates : XLONG XLAT XTIME
>>
>> (0) pm10 dry mass (ug m^-3) : min=9.96921e+36   max=9.96921e+36
>>
>> (0) ====
>>
>>
>> P is the perturbation pressure, should I use pressure instead?
>>
>> Thanks,
>> Ana
>>
>>
>>
>> On Tue, Jan 7, 2020 at 11:14 PM Dennis Shea <shea at ucar.edu> wrote:
>>
>>> ***If*** the WRF file has a variable
>>>       P(Time,bottom_top,south_north,west_east)
>>> then those are the pressure levels at each 'eta' coordinate at each grid
>>> point and time.
>>>
>>> If say you want to interpolate the variable
>>> T(Time,bottom_top,south_north,west_east)
>>>  then something like:
>>>   T       = f->T
>>>   P       = f->P
>>>   printVarSummary(T)
>>>   printMinMax(T,0)
>>>   print("====")
>>>   printVarSummary(P)
>>>   printMinMax(P,0)
>>>   print("====")
>>>
>>>   po    = (/1000,900,850,700,600,500,400,300,200,100,50,10,5/)*100.0
>>>   po!0  = "po"
>>>   po at long_name = "Pressure Level"
>>>   po at units     = "Pa"
>>>
>>>   To =* int2p_n_Wrap*
>>> <http://www.ncl.ucar.edu/Document/Functions/Contributed/int2p_n_Wrap.shtml>
>>> (P,T,po,1,1)
>>>    printVarSummary(To)
>>>    printMinMax(To,0)
>>>    print("====")
>>> ====
>>> If P is not on the WRF file, then you will have to get help from WRF
>>> support.
>>>
>>>
>>>
>>> On Tue, Jan 7, 2020 at 9:12 AM Anahita Amiri Farahani via ncl-talk <
>>> ncl-talk at ucar.edu> wrote:
>>>
>>>> Hi all,
>>>>
>>>> Is there any function/command in NCL to convert WRF eta levels to
>>>> pressure levels?
>>>>
>>>> Thanks,
>>>> Ana
>>>> _______________________________________________
>>>> 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/20200108/a8ebd567/attachment.html>


More information about the ncl-talk mailing list