[Thread Prev][Thread Next][Index]

Re: [ferret_users] vertical formula embedded in netcdf file



Hi Al,

No, Ferret/PyFerret doesn't automatically apply formula terms for z-regridding, nor does it automatically handle curvilinear coordinates in the horizontal direction. 

I wonder if we'd do well to alert the user to these elements of the file.  When there are attributes in the file that indicate these grid types, a **NOTE on opening the file pointing to the PyFerret terminology for working with these grids might be helpful.

-Ansley


On 5/8/2020 11:25 AM, Albert Hermann - NOAA Affiliate wrote:
Thanks much Ryo,
I'm familiar with ZAXREPLACE; I guess my question is whether ferret is already doing this replacement internally (since that was the intention of this particular CF standard, to allow software to "automatically" regrid, or at least to calculate the z-array for the user). Any thoughts on this from the ferret developers? As it stands, it is difficult to know whether ferret is presenting me with raw or regridded values. If the former, I could attempt the regridding with ZAXREPLACE, as Ryo suggests.
Best,
Al Hermann

On Thu, May 7, 2020 at 9:09 PM Ryo Furue <furue@xxxxxxxxxx> wrote:
Hi Albert,

I'm not super familiar with the issue, I've seen this discussed on this mailing list, and somebody else must have a better answer, but anyway . . . 

On Fri, May 8, 2020 at 8:58 AM Albert Hermann - NOAA Affiliate <albert.j.hermann@xxxxxxxx> wrote:
Hi group,

I am reading in a file created from one of the CMIP6 models. It appears to have a coordinate transformation embedded as metadata, which one might think would yield different z-levels for the 4D variable (vo) at each horizontal location. However, when I read the file into ferret v7.5, I get vo appearing on a single z-axis (which ferret labels as  "lev"), ranging from 1 to 7250. That axis has the same values as the "zlev" variable in the original file. Now, "zlev" is in fact used in the depth formula, but it is *not* the only term - other terms in the equation suggest that z-levels should vary by location and time (see the formula listed in the ncdump below). Is ferret in fact regridding to a uniform z-axis based on zlev, or is it erroneously assuming all is uniform?

Ferret just shows information contained in your netCDF file.  It doesn't automatically regrid the data for you.

Your 4D variable seems to be defined on the sigma coordinates for levels k = 1, 2, 3, . . . , nsigma
and on the level coordinates for the deeper levels (k = nsigma + 1, . . . ).

for k <= nsigma:
    z(n,k,j,i) = eta(n,j,i) + sigma(k)*(min(depth_c,depth(j,i))+eta(n,j,i)) 
for k > nsigma:
    z(n,k,j,i) = zlev(k)

In the netCDF file, your 4D variable is defined at zlev(k) for all k just for convenience, I guess.   For k <= nsigma, therefore, zlev(k) doesn't indicate the actual depth at which your variable is defined.   (For a model that uses the sigma coordinates for all depth, the vertical coordinate is usually sigma in [0, 1].)

So, to use your data on Ferret, you first construct z(n,k,j,i) as described above for all k, and use it to regrid your variable onto the level coordinates with the ZAXREPLACE function.  There have been discussions about that in this mailing list and I think there is an entry in Ferret's FAQ, in Ferret's official manual, or both.

Hope this helps,

Regards,
Ryo


--
albert.j.hermann@xxxxxxxx
Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115
206-526-6495
-- 
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