[Thread Prev][Thread Next][Index]

Re: [ferret_users] Problems with netcdf output and zaxreplace



Thanks Billy and Ansley for your prompt reply, and sorry about my slow reply.

Turned out Billy was right about using REPLACE, it solved the first problem about unused axis. The second problem (about the regridding) was instead due to a NCO command I executed before the analysis, which was messing up with the time variable of the input files; basically, nothing related with Ferret. I'm attaching the modified Ferret script.

I have another problem though: I'd ike to run that script on many models, so I'm including it in a bash script (see attached). I wrote that bash script according to what I read here (https://ferret.pmel.noaa.gov/Ferret/faq/batch-mode-usage), and adapted the REPEAT command according to this (https://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2002/msg00184.html). However, everytime I execute the bash script I obtain this error:

!-> REPEAT: I=1
**ERROR: command syntax: II = ???
define symbol ii
Command file, command group, or REPEAT execution aborted

The weird thing is that the relevant commands work if run inside Ferret, so the error should be somewhere esle in the bash script. Can you please give me some advice?

Thanks a lot.

Giorgio
----Messaggio originale----
Da: william.s.kessler@xxxxxxxx
Data: 16-apr-2020 17.52
A: "Giorgio Graffino"<g.graffino@xxxxxx>
Cc: "Ferret"<ferret_users@xxxxxxxx>
Ogg: Re: [ferret_users] Problems with netcdf output and zaxreplace

Hi Giorgio -

Without having looked at your files, here's a guess:

If some or all of your files include an unused axis (perhaps a single-point axis, either y=LAT or t=a calendar), then that is being carried through the calculation and possibly conflicting with the regridding of ZAXREPLACE.

One way to avoid this is to RESHAPE the original files to get rid of the unused axes.

Suppose you have a time series that includes the position encoded in the grid, perhaps with single-point x,y axes (try SHOW GRID).

Then:
let omit_xy = RESHAPE(varname,t[gt=time_axis]+z[gz=depth_axis])

The new variable omit_xy will have just the z,t axes you want.

Since RESHAPE "wraps" the variable onto the new axes, first be sure that the omitted axes are in fact single points.

This is just a guess!

Billy

> On Apr 16, 2020, at 7:19 AM, Giorgio Graffino <g.graffino@xxxxxx> wrote:
>
> Dear Ferreters,
> hope you can help me with this.
>
> I'm using Ferret (v6.842) on a cluster machine. My purpose is to regrid the meridional mass transport (time depth lat lon) into density space (time density lat lon) to compute the transport between some density layers. I'm writing a script based on this (https://github.com/NOAA-PMEL/Ferret/blob/master/jnls/examples/depth_to_density_demo.jnl), which is using zaxreplace. I also found something about auxiliary regridding (https://ferret.pmel.noaa.gov/Ferret/faq/depth-axis-to-density-axis), but it requires a newer version of Ferret.
>
> I'm using the script on several CMIP6 models, and saving the resulting time series as netcdf files for further analysis. I'm including as attachments the script and one of the output files, not the input files being too big. I'm facing two problems, and I can't find anything useful on the archives.
>
> 1) First problem: for most models Ferret isn't producing any useful output files, because of error messages like this one:
>
> TMAP ERR: error in line definition
>              file coords dont match variable coords on axis LAT153_153
>
> As a result, I'm left with empty files. The point is that no LAT153_153 should exist, the variable being a time series. There is nothing special about 153, since other models produce different errors (LAT122_122, LAT124_124, LAT156_156, and so on). What is even more puzzling is that the computed variables are alright, because I can plot them with Ferret. I'm just not able to attach them as netcdf variables, and the resulting file is empty. Why is Ferret defining such axis for a time series?
>
> 2) Second problem: for other models Ferret is complaining about the axis transformation. The error in this case is:
>
> **ERROR: regridding: only @ASN regridding between calendar and
>           non-calendar axes: DENS
>
> No variable is produced after using zaxreplace. I'm puzzled here because I'm defining a vertical axis, and I don't understand why calendars should matter. Is it a problem with zaxreplace? In case, could you provide me the relevant code?
>
> Thanks in advance.
>
> Giorgio
>
>
> <STC_rho_historical_EC-Earth3_pacific.nc><generate_STC_rho_CMIP6.jnl>



Attachment: generate_STC_rho_CMIP6.sh
Description: application/shellscript

Attachment: generate_STC_rho_CMIP6.jnl
Description: Binary data


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

Privacy Policy | Disclaimer | Accessibility Statement