[gradsusr] ctl file for irregular lon and lat dimension

Jeff Duda jeffduda319 at gmail.com
Fri Jun 21 17:58:01 EDT 2019


Wendi,
Here is the header of a control file I am using to plot WRF output:

dset
/lfs1/projects/wrfruc/jdduda/WRF_HRRRX/run/wrfout_d01_2019-04-%d2_%h2_00_00

dtype netcdf

undef -9999

options template

title  OUTPUT FROM WRF V3.9pre#2 MODEL - scalar fields - by Jeff Duda

pdef 1799 1059 lcc   21.13812 -122.71953 1 1   38.50000   38.50000  -97.50000
3000.00000 3000.00000

xdef  1799 linear -134.09862 0.04068774

ydef  1059 linear   21.13812 0.02972887

zdef 50 linear 1 1.0

tdef 19 linear 17Z25APR2019 1HR

VARS  252


The domain is on a Lambert conformal projection, as can be determined from
examining the PDEF line. To determine the delta-x and delta-y values, I
dumped out the latitude and longitude values from the output file. Knowing
how a Lambert projection works, I know the minimum longitude value occurs
at the grid point of the topmost row and leftmost column (NW corner of the
domain), and the maximum occurs on the other end of that same row. The
minimum longitude occurs either in the SW or SE corner (depending on what
you set for the standard and center lons/lats), but I knew from my setup
that either the SW or SE corner would suffice. The maximum latitude occurs
halfway through the topmost row.


So I obtained the max and min lat and lon values, took the difference
between them , then divided by either 1799 or 1059, which happens to be nx
and ny, respectively, in my WRF file (but you can technically use any
values you want).


Jeff Duda

On Thu, Jun 20, 2019 at 7:06 PM wendi harjupa <wendiharjupa at gmail.com>
wrote:

> Dear Mr. Jeff,
>
> Thank you very much for your response.
>
> I am very sorry for more question,
> Would you mind to give me an example for your explanation?
> or it ever asked before by other members, would you share me the link?
>
> Best regards,
> wendi
>
> On Fri, Jun 21, 2019 at 2:27 AM Jeff Duda <jeffduda319 at gmail.com> wrote:
>
>> Keep in mind that it's generally a good idea (but is not strictly
>> required) that the following relationship is held in the XDEF and YDEF
>> lines:
>>
>> max_x = min_x + dx*nx
>> max_y = min_y + dy*ny
>>
>> What I usually do is find the maximum and minimum latitudes and
>> longitudes anywhere in the geographic domain and then divide the difference
>> in those by whatever you set for NX or NY. Use that as the step value. XDEF
>> and YDEF are largely cosmetic for irregular grids, though. What is most
>> important for getting your data to show up correctly is having a PDEF entry
>> with the correct values for whatever your projection is. If your data are
>> not projected in a way that Grads can support then I'm not sure you can do
>> this using GrADS.
>>
>> Jeff Duda
>>
>> On Thu, Jun 20, 2019 at 1:46 AM wendi harjupa <wendiharjupa at gmail.com>
>> wrote:
>>
>>> Dear GrADS users,
>>>
>>> I need your help with this problem.
>>> I have two-dimensional data, which have no linear resolution, such below;
>>>
>>> 1. The first, second, third and the last coordinate longitude data are
>>> 21.2887,  121.29860, 121.30840 and 148.76140, respectively.
>>> 2. The first, second, third and the last coordinate latitude data are
>>> 22.70906, 22.70909, 22.70911 and
>>> 46.19549, respectively.
>>>
>>> I want to make the control file for the data to plot it by grads,
>>>
>>> XDEF LEVEL 2800 121.28870  XXXX
>>> YDEF LEVEL 2400 22.70906 YYYY
>>>
>>> What number should I use to change XXXX and YYYY?
>>> and is there special command should I use to handle the irregular
>>> spatial resolution?
>>>
>>> Very appreciate for your help.
>>> Thank you very much.
>>> Best regards,
>>> wendi
>>>
>>>
>>>
>>>
>>> On Wed, Jun 19, 2019 at 9:17 PM wendi harjupa <wendiharjupa at gmail.com>
>>> wrote:
>>>
>>>> Dear GrADS user,
>>>>
>>>> I want to plot the data which has irregular lon and lat...
>>>> I donot want to interpolate the data, so I just want to plot it as the
>>>> original data.
>>>>
>>>> My question is how to make the control file for the irregular lon and
>>>> lat data.
>>>> I attach two data through this email,
>>>> 1. asci data which shows the different of lon and lat of the data.
>>>> 2. Binary format data of the asci data.
>>>>
>>>> Thank you very much for your help.
>>>>
>>>> best regards
>>>> wendi
>>>>  RDCA20150803_0305.bin
>>>> <https://drive.google.com/file/d/1HDCQXO30JwIRCaxTL-H1pf6eibRvhTpp/view?usp=drive_web>
>>>>  RDCA20150803_0305.txt
>>>> <https://drive.google.com/file/d/1l0vSZLO0Z21aBlfuMLF2UJM02m0kXTtC/view?usp=drive_web>
>>>>
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>
>>
>>
>> --
>> Jeff Duda, Research Scientist
>> University of Colorado Boulder
>> Cooperative Institute for Research in Environmental Sciences
>> NOAA/OAR/ESRL/Global Systems Division
>> Boulder, CO
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>


-- 
Jeff Duda, Research Scientist
University of Colorado Boulder
Cooperative Institute for Research in Environmental Sciences
NOAA/OAR/ESRL/Global Systems Division
Boulder, CO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20190621/5dbb411b/attachment.html>


More information about the gradsusr mailing list