[gradsusr] Control File for Mask

Jeff Duda jeffduda319 at gmail.com
Mon Jun 27 13:31:14 EDT 2016


Justin,
I see your TDEF lines are actually the same, so that definitely should not
be the cause of the problem.

Yes, it is possible that different YDEF lines are causing the issue.
Strange how the difference shows up in the X dimension in the error message
you get, though. You can change the YDEF entry however you want it. As far
as I've ever used it, YDEF only controls how the data can be plotted within
grads. The PDEF entry is what controls the actual projection, and that is
something you don't want to change, although I see you aren't using a PDEF
entry anyway, so I guess that advice is irrelevant.

If you continue to have problems after matching up the YDEF lines, try the
following:
-Do fields plot correctly from the first file when it is the only file open?
-Does your mask field plot correctly when it is the only file open?
-Check 'q dims' when displaying a field in both files when each is the only
one open. If they are different, that might be a clue as to why the command
you want to run is failing.

Jeff

On Mon, Jun 27, 2016 at 12:19 PM, Justin Hicks <jhicks2014 at gmail.com> wrote:

> Jeff,
>
> This is the code:
>
> ga-> open GLDAS_MOS10_M.ctl
> Scanning description file:  GLDAS_MOS10_M.ctl
> Data file
> /data2/gds/GLDAS_V1/GLDAS_MOS10_M/%y4/GLDAS_MOS10_M.A%y4%m2.001.grb is open
> as file 1
> LON set to 0 360
> LAT set to -59.5 89.5
> LEV set to 1 1
> Time values set: 1979:1:1:0 1979:1:1:0
> E set to 1 1
> ga-> open Region15_AFR_maskv3.nc
> Scanning description file:  Region15_AFR_maskv3.nc
> Warning: OPTIONS keyword "template" is used, but the
>    DSET entry contains no substitution templates.
> Data file ~/Downloads/Region15_AFR_maskv3.nc is open as file 2
> ga-> d maskout(evap,data.2(time=00Z01JUN1990)-0.5)
> Data Request Warning:  Request is completely outside file limits
>   Entire grid contents are set to missing data
>   Grid limits of file:     X = 1 360  Y = 1 180  Z = 1 1  T = 1 1  E = 1 1
>   Grid limits of request:  X = 180 541  Y = 31 180  Z = 1 1  T = 138 138
>  E = 1 1
>   Warning issued for variable = data.2
> Cannot contour grid - all undefined values
>
>
> I sent you the control file for the mask before, so here is the control
> file for the GLDAS data:
>
> dset /data2/gds/GLDAS_V1/GLDAS_MOS10_M/%y4/GLDAS_MOS10_M.A%y4%m2.001.grb
> index /data2/control/GLDAS_MOS10_M.idx
> options template
> undef 9.999E+20
> title /data2/gds/GLDAS_V1/GLDAS_MOS10_M/1979/GLDAS_MOS10_M.A197901.001.grb
> *  produced by grib2ctl v0.9.13
> * command line options:
> /data2/gds/GLDAS_V1/GLDAS_MOS10_M/1979/GLDAS_MOS10_M.A197901.001.grb
> dtype grib 0
> ydef 150 linear -59.500000 1
> xdef 360 linear -179.500000 1.000000
> tdef 436 linear 00Z01jan1979 1mo
> zdef 1 linear 1 1
> vars 24
> AvgSurfT 0 138,1,0  ** Average Surface Temperature       K
> Canopint 0 71,1,0  ** Total canopy water storage    kg/m^2
> Evap 0 57,1,0  ** Total Evapotranspiration          kg/m^2/s
> LWdown 0 205,1,0  ** Surface incident longwave radiation W/m^2
> LWnet 0 112,1,0  ** Net Longwave Radiation            W/m^2
> PSurf 0 1,1,0  ** Surface pressure                 Pa
> Qair 0 51,1,0  ** Near surface specific humidity    kg/kg
> Qg 0 155,1,0  ** Ground Heat Flux                  W/m^2
> Qh 0 122,1,0  ** Sensible Heat Flux                W/m^2
> Qle 0 121,1,0  ** Latent Heat Flux                  W/m^2
> Qs 0 235,1,0  ** Surface Runoff                    kg/m^2/s
> Qsb 0 234,1,0  ** Subsurface Runoff                 kg/m^2/s
> Qsm 0 99,1,0  ** Snowmelt                          kg/m^2/s
> Rainf 0 132,1,0  ** Rainfall rate                     kg/m^2/s
> SWE 0 65,1,0  ** Snow Water Equivalent             kg/m^2
> SWdown 0 204,1,0  ** Surface incident shortwave radiation  W/m^2
> SWnet 0 111,1,0  ** Net Shortwave Radiation           W/m^2
> Snowf 0 131,1,0  ** Snowfall rate                     kg/m^2/s
> TSoil 0 85,112,50001 ** Deep Soil Temperature                  K
>
> SoilM1 0 86,112,50001 ** 0-2 cm  Average layer 1 soil moisture     kg/m^2
>
> SoilM2 0 86,112,40002 ** 2-150 cm  Average layer 2 soil moisture     kg/m^2
> SoilM3 0 86,112,30003 ** 150-350 cm  Average layer 3 soil moisture
> kg/m^2
> Tair 0 11,1,0  ** Near surface air temperature      K
> Wind 0 32,1,0  ** Near surface wind magnitude     m/s
> ENDVARS
>
>
> Now that I look at it, would it be the different 'ydef' between the two
> files that is causing this problem? And if so, how could I change this?
>
> -Justin
>
> On Mon, Jun 27, 2016 at 1:03 PM, Jeff Duda <jeffduda319 at gmail.com> wrote:
>
>> Justin,
>> Show me the exact code you're running, including any and all control
>> files opened by the code.
>>
>> Jeff
>>
>> On Mon, Jun 27, 2016 at 12:00 PM, Justin Hicks <jhicks2014 at gmail.com>
>> wrote:
>>
>>> Jeff,
>>>
>>> I tried to use manipulation strings using the following command: 'd
>>> maskout(evap,data.2(time=00Z01JUN1990)-0.5)'.
>>> Note how I changed the variable from 'land' to 'data' just because of
>>> the ncdump contents. I received this error after entering this command:
>>> Data Request Warning:
>>>
>>>  Request is completely outside file limits
>>>   Entire grid contents are set to missing data
>>>   Grid limits of file:     X = 1 360  Y = 1 180  Z = 1 1  T = 1 1  E = 1
>>> 1
>>>   Grid limits of request:  X = 180 541  Y = 31 180  Z = 1 1  T = 138 138
>>>  E = 1 1
>>>   Warning issued for variable = data.2
>>> Cannot contour grid - all undefined values
>>>
>>>
>>> I'll post the contents of ncdump -c below:
>>>
>>> ncdump -c Region15_AFR_maskv3.nc
>>> netcdf Region15_AFR_maskv3 {
>>> dimensions:
>>> Longitude = 360 ;
>>> Latitude = 180 ;
>>> variables:
>>> float Longitude(Longitude) ;
>>> float Latitude(Latitude) ;
>>> float data(Latitude, Longitude) ;
>>> data:
>>>
>>>  Longitude = -179.5, -178.5, -177.5, -176.5, -175.5, -174.5, -173.5,
>>> -172.5,
>>>     -171.5, -170.5, -169.5, -168.5, -167.5, -166.5, -165.5, -164.5,
>>> -163.5,
>>>     -162.5, -161.5, -160.5, -159.5, -158.5, -157.5, -156.5, -155.5,
>>> -154.5,
>>>     -153.5, -152.5, -151.5, -150.5, -149.5, -148.5, -147.5, -146.5,
>>> -145.5,
>>>     -144.5, -143.5, -142.5, -141.5, -140.5, -139.5, -138.5, -137.5,
>>> -136.5,
>>>     -135.5, -134.5, -133.5, -132.5, -131.5, -130.5, -129.5, -128.5,
>>> -127.5,
>>>     -126.5, -125.5, -124.5, -123.5, -122.5, -121.5, -120.5, -119.5,
>>> -118.5,
>>>     -117.5, -116.5, -115.5, -114.5, -113.5, -112.5, -111.5, -110.5,
>>> -109.5,
>>>     -108.5, -107.5, -106.5, -105.5, -104.5, -103.5, -102.5, -101.5,
>>> -100.5,
>>>     -99.5, -98.5, -97.5, -96.5, -95.5, -94.5, -93.5, -92.5, -91.5,
>>> -90.5,
>>>     -89.5, -88.5, -87.5, -86.5, -85.5, -84.5, -83.5, -82.5, -81.5,
>>> -80.5,
>>>     -79.5, -78.5, -77.5, -76.5, -75.5, -74.5, -73.5, -72.5, -71.5,
>>> -70.5,
>>>     -69.5, -68.5, -67.5, -66.5, -65.5, -64.5, -63.5, -62.5, -61.5,
>>> -60.5,
>>>     -59.5, -58.5, -57.5, -56.5, -55.5, -54.5, -53.5, -52.5, -51.5,
>>> -50.5,
>>>     -49.5, -48.5, -47.5, -46.5, -45.5, -44.5, -43.5, -42.5, -41.5,
>>> -40.5,
>>>     -39.5, -38.5, -37.5, -36.5, -35.5, -34.5, -33.5, -32.5, -31.5,
>>> -30.5,
>>>     -29.5, -28.5, -27.5, -26.5, -25.5, -24.5, -23.5, -22.5, -21.5,
>>> -20.5,
>>>     -19.5, -18.5, -17.5, -16.5, -15.5, -14.5, -13.5, -12.5, -11.5,
>>> -10.5,
>>>     -9.5, -8.5, -7.5, -6.5, -5.5, -4.5, -3.5, -2.5, -1.5, -0.5, 0.5,
>>> 1.5,
>>>     2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5,
>>> 14.5,
>>>     15.5, 16.5, 17.5, 18.5, 19.5, 20.5, 21.5, 22.5, 23.5, 24.5, 25.5,
>>> 26.5,
>>>     27.5, 28.5, 29.5, 30.5, 31.5, 32.5, 33.5, 34.5, 35.5, 36.5, 37.5,
>>> 38.5,
>>>     39.5, 40.5, 41.5, 42.5, 43.5, 44.5, 45.5, 46.5, 47.5, 48.5, 49.5,
>>> 50.5,
>>>     51.5, 52.5, 53.5, 54.5, 55.5, 56.5, 57.5, 58.5, 59.5, 60.5, 61.5,
>>> 62.5,
>>>     63.5, 64.5, 65.5, 66.5, 67.5, 68.5, 69.5, 70.5, 71.5, 72.5, 73.5,
>>> 74.5,
>>>     75.5, 76.5, 77.5, 78.5, 79.5, 80.5, 81.5, 82.5, 83.5, 84.5, 85.5,
>>> 86.5,
>>>     87.5, 88.5, 89.5, 90.5, 91.5, 92.5, 93.5, 94.5, 95.5, 96.5, 97.5,
>>> 98.5,
>>>     99.5, 100.5, 101.5, 102.5, 103.5, 104.5, 105.5, 106.5, 107.5, 108.5,
>>>     109.5, 110.5, 111.5, 112.5, 113.5, 114.5, 115.5, 116.5, 117.5,
>>> 118.5,
>>>     119.5, 120.5, 121.5, 122.5, 123.5, 124.5, 125.5, 126.5, 127.5,
>>> 128.5,
>>>     129.5, 130.5, 131.5, 132.5, 133.5, 134.5, 135.5, 136.5, 137.5,
>>> 138.5,
>>>     139.5, 140.5, 141.5, 142.5, 143.5, 144.5, 145.5, 146.5, 147.5,
>>> 148.5,
>>>     149.5, 150.5, 151.5, 152.5, 153.5, 154.5, 155.5, 156.5, 157.5,
>>> 158.5,
>>>     159.5, 160.5, 161.5, 162.5, 163.5, 164.5, 165.5, 166.5, 167.5,
>>> 168.5,
>>>     169.5, 170.5, 171.5, 172.5, 173.5, 174.5, 175.5, 176.5, 177.5,
>>> 178.5,
>>>     179.5 ;
>>>
>>>  Latitude = -89.5, -88.5, -87.5, -86.5, -85.5, -84.5, -83.5, -82.5,
>>> -81.5,
>>>     -80.5, -79.5, -78.5, -77.5, -76.5, -75.5, -74.5, -73.5, -72.5,
>>> -71.5,
>>>     -70.5, -69.5, -68.5, -67.5, -66.5, -65.5, -64.5, -63.5, -62.5,
>>> -61.5,
>>>     -60.5, -59.5, -58.5, -57.5, -56.5, -55.5, -54.5, -53.5, -52.5,
>>> -51.5,
>>>     -50.5, -49.5, -48.5, -47.5, -46.5, -45.5, -44.5, -43.5, -42.5,
>>> -41.5,
>>>     -40.5, -39.5, -38.5, -37.5, -36.5, -35.5, -34.5, -33.5, -32.5,
>>> -31.5,
>>>     -30.5, -29.5, -28.5, -27.5, -26.5, -25.5, -24.5, -23.5, -22.5,
>>> -21.5,
>>>     -20.5, -19.5, -18.5, -17.5, -16.5, -15.5, -14.5, -13.5, -12.5,
>>> -11.5,
>>>     -10.5, -9.5, -8.5, -7.5, -6.5, -5.5, -4.5, -3.5, -2.5, -1.5, -0.5,
>>> 0.5,
>>>     1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5,
>>>     14.5, 15.5, 16.5, 17.5, 18.5, 19.5, 20.5, 21.5, 22.5, 23.5, 24.5,
>>> 25.5,
>>>     26.5, 27.5, 28.5, 29.5, 30.5, 31.5, 32.5, 33.5, 34.5, 35.5, 36.5,
>>> 37.5,
>>>     38.5, 39.5, 40.5, 41.5, 42.5, 43.5, 44.5, 45.5, 46.5, 47.5, 48.5,
>>> 49.5,
>>>     50.5, 51.5, 52.5, 53.5, 54.5, 55.5, 56.5, 57.5, 58.5, 59.5, 60.5,
>>> 61.5,
>>>     62.5, 63.5, 64.5, 65.5, 66.5, 67.5, 68.5, 69.5, 70.5, 71.5, 72.5,
>>> 73.5,
>>>     74.5, 75.5, 76.5, 77.5, 78.5, 79.5, 80.5, 81.5, 82.5, 83.5, 84.5,
>>> 85.5,
>>>     86.5, 87.5, 88.5, 89.5 ;
>>> }
>>>
>>> -Justin
>>>
>>> On Mon, Jun 27, 2016 at 12:00 PM, Jeff Duda <jeffduda319 at gmail.com>
>>> wrote:
>>>
>>>> Justin,
>>>> It very well could be the TDEF line. GrADS is expecting the data in all
>>>> files to be valid at the same time. If it isn't, you have to use
>>>> manipulation strings to get things to plot right. For example, if the time
>>>> of your data is today, 12Z 27 June 2016, then you would have to enter 'd
>>>> maskout(evap,land.2(time=12Z27JUN2016)-0.5)'
>>>>
>>>> You might also want to consider using xdfopen instead of sdfopen. While
>>>> you still have to write a control file to use xdfopen, you don't have to
>>>> put nearly as many details in the control file as you would for just a
>>>> regular open, which requires a full blown control file like you created.
>>>>
>>>> Jeff
>>>>
>>>> On Mon, Jun 27, 2016 at 10:21 AM, Justin Hicks <jhicks2014 at gmail.com>
>>>> wrote:
>>>>
>>>>> GrADS Users,
>>>>>
>>>>> I am trying to open up a netcdf mask file using 'sdfopen', but GrADS
>>>>> is not opening it up. The mask should show values ONLY for Africa. I
>>>>> decided to make a control file instead, but I am confused as how to write
>>>>> one for a mask.
>>>>>
>>>>> For this mask, land is given a value of 1 and ocean value are given a
>>>>> value of 0.
>>>>>
>>>>> The control file I have is below:
>>>>>
>>>>> DSET ~/Downloads/Region15_AFR_maskv3.nc
>>>>> options template
>>>>> undef 0
>>>>> Xdef  360 LINEAR -179.5  1.0
>>>>> Ydef  180 LINEAR  89.5   1.0
>>>>> Zdef   1  LINEAR  1.0    1.0
>>>>> Tdef   1  LINEAR  00Z01jan1979 1mo
>>>>> Vars 1
>>>>> land=>land  0  t,y,x   land_mask
>>>>> endvars
>>>>>
>>>>>
>>>>> I have tried changing the undef value, but I get the same error each
>>>>> time I run the command 'd maskout(evap,land.2-0.5)':
>>>>>
>>>>> "Cannot contour grid - all undefined values"
>>>>>
>>>>> I am not sure why all values are coming up undefined (the land area I
>>>>> want isn't showing up either, instead it's the default world map). Perhaps
>>>>> it is the Tdef? I'm not sure why a mask would need a tdef.
>>>>>
>>>>> -Justin
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> gradsusr mailing list
>>>>> gradsusr at gradsusr.org
>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Jeff Duda
>>>> Post-doctoral research associate
>>>> University of Oklahoma School of Meteorology
>>>>
>>>> _______________________________________________
>>>> 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
>> Post-doctoral research associate
>> University of Oklahoma School of Meteorology
>>
>> _______________________________________________
>> 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
Post-doctoral research associate
University of Oklahoma School of Meteorology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160627/e70fea77/attachment-0001.html 


More information about the gradsusr mailing list