[Thread Prev][Thread Next][Index]

Re: [ferret_users] vertical levels shifts after apply @DIN



Hi,

The calculations for any of these transformations start at the lower edge of the first grid cell and ends with the upper edge of the last grid cell. However you can specify a start and end for any transformation,

   let transformed_var = var[z=10:1000@DIN]



NetCDF files can have *bounds specified <https://cfconventions.org/cf-conventions/cf-conventions.html#cell-boundaries>* and the coordinate points do not have to be centered in the grid cell -- for instance a surface value would normally not have a grid cell that extends below the surface for atmospheric data or above the surface for ocean data.

If the file does not contain cell bounds, Ferret assumes that grid points lie in the center of the grid cell.  So, if a file has coordinate values

z= 10, 20, 50, 100

and if it does not give specification for bounds, then the grid-cell bounds would be at locations half-way between the coordiates, and at each end, the cell edge is placed so as to put the coordinate mid-way between the edges.  So the edges would be at:

5, 15, 35, 75, 125


In PyFerret/Ferret you can define an axis with /EDGES to say you're specifying the grid cell edges, or with /BOUNDS to give both the coordinates and the bounds.


Ansley

On 6/25/2020 3:14 PM, Xiaoyu Bai wrote:
Dear Ansley,

I think I got it. Looks like to me, ferret "puts" an extra layer between my vertical levels and gave two extra layers to both ends (top and surface of the atmosphere) to do the integration. Say a 550 hPa between 500 and 600 hPa. Thus, the K=1 @DIN starts from 5 hPa instead of 10 hPa and K=17 @DIN became 1032.5 hPa instead of 1000 hPa.

Thank you very much and stay healthy,

Xiaoyu

On Thu, Jun 11, 2020 at 5:15 PM Ansley C. Manke <ansley.b.manke@xxxxxxxx <mailto:ansley.b.manke@xxxxxxxx>> wrote:

    Hi,
    Sometimes defining a very simple variable and applying the
    transformation to it is helpful.  Do the integration operations on a
    variable like this

       let constant_var = 1 + 0*test

    to see if it helps you understand what may be happening.  Also
    looking
    at the indefinite integral of both your original variables and this
    simple one might be useful.

    As you may know, transformations such as the definite integral always
    take the grid-cell sizes into account.  This is described in detail
    here, "General Information about Transformations",
    https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/variables-xpressions/XPRESSIONS#GeneralInfo

    I wonder if there is something particular in the definition of the
    grid
    cells in Z that makes the computations inconsistent.

    Ansley

    On 6/10/2020 6:48 PM, Xiaoyu Bai wrote:
    > Dear ferreters,
    >
    > I have 17 levels of v-wind data.
    >
    > list/j=82/l=6 va_4CO2_MPAS_monthly_ave
    >              VARIABLE : VA_4CO2_MPAS_MONTHLY[X=@AVE]
    >              SUBSET   : 17 points (Z (Pa))
    >              LONGITUDE: 1.2W(-1.2) to 1.2W
    >              LATITUDE : 63.5N
    >              TIME     : 16-JUN 00:00 NOLEAP
    >  1000     /  1: -0.0394
    >  2000     /  2: -0.0227
    >  3000     /  3: -0.0209
    >  5000     /  4: -0.0252
    >  7000     /  5: -0.0219
    >  10000    /  6: -0.0125
    >  15000    /  7:  0.0496
    >  20000    /  8:  0.1512
    >  25000    /  9:  0.1367
    >  30000    / 10:  0.0665
    >  40000    / 11:  0.0014
    >  50000    / 12: -0.0065
    >  60000    / 13: -0.0048
    >  70000    / 14: -0.0037
    >  85000    / 15: -0.0020
    >  92500    / 16:  0.0645
    >  100000   / 17:  0.2435
    > I corrected the noise of it first and then applied @DIN for the
    > vertical levels.
    > list/j=82/l=6 test
    >              VARIABLE : VA_4CO2_MPAS_MONTHLY_AVE-0.03951
    >              SUBSET   : 17 points (Z (Pa))
    >              LONGITUDE: 1.2W(-1.2) to 1.2W
    >              LATITUDE : 63.5N
    >              TIME     : 16-JUN 00:00 NOLEAP
    >  1000     /  1: -0.0789
    >  2000     /  2: -0.0622
    >  3000     /  3: -0.0605
    >  5000     /  4: -0.0647
    >  7000     /  5: -0.0614
    >  10000    /  6: -0.0520
    >  15000    /  7:  0.0101
    >  20000    /  8:  0.1117
    >  25000    /  9:  0.0971
    >  30000    / 10:  0.0270
    >  40000    / 11: -0.0381
    >  50000    / 12: -0.0460
    >  60000    / 13: -0.0443
    >  70000    / 14: -0.0433
    >  85000    / 15: -0.0415
    >  92500    / 16:  0.0250
    >  100000   / 17:  0.2040
    > When I listed out the results I found that the vertical levels
    shifted
    > 50 Pa comparing to the original data:
    > list/j=82/l=6 test_re, test_up, test_down2
    >              LONGITUDE: 1.2W(-1.2) to 1.2W
    >              LATITUDE: 63.5N
    >              TIME: 16-JUN 00:00 NOLEAP
    >  Column  1: TEST_RE[Z=500:103750] is TEST[K=1:17@DIN]/9.8
    >  Column  2: TEST_UP[Z=500:55000] is TEST[K=1:12@DIN]/9.8
    >  Column  3: TEST_DOWN2[Z=55000:103750] is TEST[K=13:17@DIN]/9.8
    >           TEST_RE  TEST_UP TEST_DOWN2
    > I / *:     0.04177  -27.18   27.22
    > Is there a reason for it?
    >
    > Thank you in advance.
    > --
    > Xiaoyu

-- Ansley Manke
    Science Data Integration Group
    NOAA Pacific Marine Environmental Laboratory
    7600 Sand Point Way NE
    Seattle WA 98115

    I am currently teleworking and am available Tue-Wed-Thu.



--
Xiaoyu

--
Ansley Manke
Science Data Integration Group
NOAA Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115

I am currently teleworking and am available Tue-Wed-Thu.


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement