[Thread Prev][Thread Next][Index]
Re: [ferret_users] Problems with netcdf output and zaxreplace
- To: <ansley.b.manke@xxxxxxxx>
- Subject: Re: [ferret_users] Problems with netcdf output and zaxreplace
- From: Giorgio Graffino <g.graffino@xxxxxx>
- Date: Thu, 4 Jun 2020 17:22:45 +0200 (CEST)
- Arc-authentication-results: i=3; mx.google.com; arc=pass (i=2); spf=softfail (google.com: domain of transitioning g.graffino@xxxxxx does not designate 209.85.160.200 as permitted sender) smtp.mailfrom=g.graffino@xxxxxx
- Arc-authentication-results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=tim.it); spf=softfail (google.com: domain of transitioning g.graffino@xxxxxx does not designate 65.153.203.170 as permitted sender) smtp.mailfrom=g.graffino@xxxxxx
- Arc-authentication-results: i=1; mx.google.com; spf=pass (google.com: domain of g.graffino@xxxxxx designates 82.57.200.118 as permitted sender) smtp.mailfrom=g.graffino@xxxxxx
- Arc-message-signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:mime-version:cc:subject:to:reply-to:from:date; bh=ZUkUMAYLND9DV55qDXdvcg5eqpfPXcxPGDs2PRAWPSo=; b=L3kfki/Ql2gDJXG4EhC5mL9j/Wq3BgaL8XwqgFXhcrItZJROoNtriFnTTmi19hci4n qwTKUvdPpg4q9szVZA1MHKengiDKqtKuZCC4nC8VvvPBMJ1II3lcVkcWDn+Jg4Ytsw6P D64paKkiXWKnR9Ru1c60KhRPQbX+BcutGlAkjO+dId5O72LdWSDKU9s+KFn/UvPdbwwp 848dPL/cY9oQQUAgg4+Hz79eV2ng2PsTbHWZmD44ba1t17HA7YvNUMEEp5PHNoA3hkgQ XBnLv6bYd76tJG95fcDZhBCxKg+Ezj8UuCJcbrlWA7CHr1ZBKJrQXPqHeOFsSY9e8upy smdg==
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:cc:subject:to:reply-to:from:date:message-id; bh=ZUkUMAYLND9DV55qDXdvcg5eqpfPXcxPGDs2PRAWPSo=; b=Ukp1j+kJvr//q/ydds0Fkbcp0Ezby17VepLPlmVsJVP61JUkZcloNDsEFVrH642Aux oXGtgRksI75zqA5OW1n/M/dsIag3+JQk0NnEYSt037iT675QPdwnRvNfaJ5N59N8adZh jqCQu+Qqi/bXZGjUsBJ9TJLFfLjWRGygcTPG8hTxdK1sdwnOIUm20doInyKEDivmWX4e 5b548pc2uti9sLNDvCVnhNeaEq+8eoZ05X2BwUhbK1S5gWd8zk9XqJ4hzeRdlfyn7bqS 8tBldM5qoVQPw2JZzRwthQtCh3pt/6ZpIose3peahdZvSJzEQdH4u8zBhasTuzUa9XTz 7dmg==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:cc:subject:to:reply-to:from:date:message-id; bh=ZUkUMAYLND9DV55qDXdvcg5eqpfPXcxPGDs2PRAWPSo=; b=aQddkFP3xpXXgNy7hmKx4tSXS0jYOEQYzBW1Kuw8nez0PRPHyefngJ5toeqJx9kJ1S OZqXvhefsTBQBKEBkh6wo0Q3ldjqjbYNGIiAycRsV2/vd8a5HlYJ6fop7+/XOZ+QUDS5 VUKQQIsVFqbyl116LvAZiYukBAfbGBuSrvshY0PhfRG3GbvPFnSgpd3/N0JEtWyl53YD 4wogFKPP5iLdZEEVnxOGfEOt3efx5JmBNQ1yOhhSpM1ECTvlM0Yy8sg969RzhavUYz4l 3Dx2vKQ+TDHc+qLaHEg00v+zaQ+v+iUnDezQ/6TIELE0w3msd0SwdjRP8VEQbxcOE27O il9g==
- Arc-seal: i=3; a=rsa-sha256; t=1591284179; cv=pass; d=google.com; s=arc-20160816; b=Nr4OqFRl4/KAj7tjcsfcOH3byEb01LLf44LdnXUH8emzWPV4yw3eWIietCP45isvNy O+DViKe+Or3eGO+jO1QPldi2KEUS7jPliPfalfI/bSUjjyvm0fkknxLLhN6Xaa1uVjsl r2umfklTQTZ1GrickjjH0coyMv6uGhIUhxpL8wMiMmBlWSHMIhjcYeo3p/rxx6OcZrCL h8DRvgIU/Kb4+3ByB68/CynYhL568UEpR12X7opyS25JmplWbrjHFTxOhFRb36PF0Kul UbVNOkjdJMAJHWuyO9IOJmGAEAWSSqJECV4rCI3sD2FRTlN/l5FuIp+vXQqF1OwmQj6X iQGA==
- Arc-seal: i=2; a=rsa-sha256; t=1591284170; cv=pass; d=google.com; s=arc-20160816; b=VEkdUSUF1C5gju+c0ylEGX4hnD2OOdyn2rtbYsPsTcoTrE4Lamak+6u8VWQDRy6mok 7jfsz+EolePucD21Lmlr+7HbPc3W1Re5IQ05mdklYJmc0uYCDjecZnLpakNMSs1l9JaF 9kj3GbpVaLEDmqwwV2amuXWanK8INRb3dtmCcH9HRsVouqx+9G4tyu+n8PlkiMNZg3hI Ht9piWMRT66dU3k623LJIfVElg+b9iR23aJyPHmNoaTT4NFCM/XZcyciVi+62g4dfu8P K3nYwjH6OWdEr876uQKQRDTBu/d1vmmaOfdcKhWPYXUPHWhVTawWqTNfTLPPOEU72jrp WdyQ==
- Arc-seal: i=1; a=rsa-sha256; t=1591284167; cv=none; d=google.com; s=arc-20160816; b=jMZYo8B3OQwGlo1lxKRlJyf3lwtq0nj/EtmHQlWum7CUWX9SRkEg/DLXKmWWHlfA9H 8+rj7UOPQPtCNpKL5TXZvgfjolWAY2nghzMA7QmOAMBpYtJY8J6pKf6siJmuVX+KQ8oe LmRJo3gxYZQpqAMZ1YpPXFkE9qYBMyoWvI3C1IRnON1CWZVNsRhJRllGmJpKRA/NnAxD ur0SRpNnDZQRLJ+Mt121g8BoaL9lpDVnvQpS8891dUsTb0QPS4g6F3U1S1/7FRCkUSBH R+/6VcJaU9zZ282rm+DCMUxWWHpZYGGM2lxSD2255y1sQ5SjyZHf+mwWT1zB4Qmhc8B5 x+3Q==
- Cc: <ferret_users@xxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa.gov; s=google; h=sender:date:from:reply-to:to:subject:cc:mime-version:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive; bh=ZUkUMAYLND9DV55qDXdvcg5eqpfPXcxPGDs2PRAWPSo=; b=XFiWzVs9Nh93QCF1ns0BfJHQYBr5dlp+ycJu6nOPjHf5+dBx3kT/fkDk5I9CyN8Gtg X33cuvsMs0GvELbUO6EkqiLFNlv7K2ysvAnVjwstzfYSXAD6YdjIfRpSIlXi8+5bGZ3n hx1VIo6bDoVYsw71Deexx5DgGGwYbdnx+m3e51GWn3DNoBGLOguQCVSBgDAt3+5NupvJ wClZszQgfQtEnrQWkcWHnDC/fhHS396UMX47sPGpPHgPnOfKTS7hpzhLVTDzbk03eZFS /6oEklHM9X6posTjBtGyiTmkw0nmJW3aZxd4YjnaXv3zpZMDrR0xijAzVHw+GJ2jj9Sy 4w8g==
- List-archive: <https://groups.google.com/a/noaa.gov/group/ferret_users/>
- List-help: <https://support.google.com/a/noaa.gov/bin/topic.py?topic=25838>, <mailto:ferret_users+help@noaa.gov>
- List-id: <ferret_users.noaa.gov>
- List-post: <https://groups.google.com/a/noaa.gov/group/ferret_users/post>, <mailto:ferret_users@noaa.gov>
- Mailing-list: list ferret_users@xxxxxxxx; contact ferret_users+owners@xxxxxxxx
- Reply-to: Giorgio Graffino <g.graffino@xxxxxx>
- Sender: owner-ferret_users@xxxxxxxx
Thanks Ansley for your suggestions.
Unfortunately I'm running Ferret on a cluster, because data are too big to be saved on my local computer, so I don't know whether I miht install a newer version of Ferret by myself. I'll ask to my cluster support. Meanwhile, I tried to increase the amount of allocated memory and removed all subsetting, but the process got killed by the system.
Sorry, the script I sent also included other operations. I'm resuming here the most relevant lines:
!----- MERIDIONAL TRANSPORT ON DENSITY ------------
define axis/z=1020:1030:0.5/unit="density"/depth dens_lev
let ty_trans_pacific_rho = zaxreplace(ty_trans_pacific,dens[g=ty_trans],z[gz=dens_lev])
!--- COMPUTE TIME AVERAGE ON 25 SIGMA LEVEL -------
let ty_trans_pacific_rho_time = ty_trans_pacific_rho[l=@ave]
let ty_trans_pacific_rho_lats = ty_trans_pacific_rho_time[y=35n:35s]
let ty_trans_pacific_rho_lons = ty_trans_pacific_rho_lats[x=110e:70w]
let ty_trans_pacific_rho_1025 = ty_trans_pacific_rho_lons[z=1025]
!---------- RESHAPE OUTPUT FIELDS -----------------
let/title="Meridional transport (Sv) on the 1025 kg/m3 isopycnal surface" stc_trans_rho_1025 = reshape(ty_trans_pacific_rho_1025,x[gx=ty_trans]+y[gy=ty_trans])
!------------ OUTPUT FILE -------------------------
save/file=STC_sigma_1PctTo2X_($model)_pacific.nc/clobber stc_trans_rho_1025
The error can't be related to append, because I'm saving only one variable into that file. Other variables are saved into another file, but I have no problem with that.
Cheers,
Giorgio
----Messaggio originale----
Da: ansley.b.manke@xxxxxxxx
Data: 4-giu-2020 3.11
A: <ferret_users@xxxxxxxx>
Ogg: Re: [ferret_users] Problems with netcdf output and zaxreplace
Hi Giorgio,
When you can, try to update to a newer version of pyferret or ferret.
Starting with Ferret v7.2
<https://ferret.pmel.noaa.gov/Ferret/documentation/release_notes/version-7-2-release-notes>,
there is much better memory management. With your version of Ferret you
can try "set memory/size=" to give it a larger working memory buffer.
For the errors you're seeing when trying to append to a file, the thing
to know is that the grid of the variable you are appending needs to
match what is in the file, except for time when appending in the time
direction. I can't quite see what is happening with the different grids
and datasets in your script. What I would do to see what is happening,
is at the point in your script where the error occurs, instead write
that variable to a second file, and then compare the new file with the
one you were trying to append to. The error message is saying that the
latitude coordinates don't match.
Ansley
On 6/3/2020 10:51 AM, Giorgio Graffino wrote:
> Thanks Ashley about those useful tips.
>
> I'm now adapting my zaxreplace script for other applications (see
> attached), but I have again issues on saving the output. I think the
> problem is that the grid is too large for some models, and Ferret
> complains by saying
>
> **ERROR: request exceeds memory setting: A negative number of words
> were requested.
> *** NOTE: The current grid is most likely too large
>
> So I'm subsetting the variable to select only the region I need, and
> the computation works. But when I'm saving the generated field into
> netcdf at line 52, Ferret comes out with the good ol' error
>
> **TMAP ERR: error in line definition
> file coords dont match variable coords on axis LAT77_203
>
> It doesn't change whether I'm using RESHAPE or not. I also tried to
> adapt my RESHAPE call according to what I read here
> (https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/variables-xpressions/XPRESSIONS),
> but with no luck. Can you please help me again about this?
>
> Cheers,
> Giorgio
>
> ----Messaggio originale----
> Da: ansley.b.manke@xxxxxxxx
> Data: 20-mag-2020 18.52
> A: "Giorgio Graffino"<g.graffino@xxxxxx>
> Cc: <ferret_users@xxxxxxxx>
> Ogg: Re: [ferret_users] Problems with netcdf output and zaxreplace
>
> Hi,
>
> You could pass into the script the number of models
>
> > ferret -script scriptname.jnl 7
>
> The script then does a repeat loop that would start like this.
>
> let nmodel = ($1)
> repeat/range=1:($1)/name=r (\
> use /home/data/model`r`.nc;\
>
> ...
>
> There are details on the grave-accent evaluation
> <https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/variables-xpressions/EMBEDDED-XPRESSIONS#_VPINDEXENTRY_562>that
> give you some flexibility. For instance if the models are named
> model01.nc, model02.nc, ... use the "precision" specifier to ask
> for the value to be replaced with zero-filled numbers, here 2-digits.
>
> let nmodel = ($1)
> repeat/range=1:`nmodel`/name=r (\
> use /home/data/model`r,p=z2`.nc;
>
>
> Or, you could use a unix foreach loop and write your script to
> operate on just one model if that makes sense for what you are
> doing. Here I've made a script myscript.jnl with:
>
> ! myscript.jnl
> echo ($1)
>
>
> This is csh, other shells will have other syntax.
>
> /home/users/ansley> set flist = 'model_run_7.nc
> ocean_model_run5.nc
http://address/climate.nc'
> /home/users/ansley> foreach fname ($flist)
> foreach? ferret -script myscript.jnl $fname
> foreach? end
> model_run_7.nc
> ocean_model_run5.nc
>
http://address/data/climate.nc
>
>
> On 5/18/2020 10:47 AM, Giorgio Graffino wrote:
>> Hi Ashley,
>> thanks for your suggestion.
>>
>> I preferred to implement the other method because it involved a
>> single Ferret call, but I haven't thought about passing all
>> variables in that way. You are suggesting something like
>>
>> ferret -script scriptname.jnl model1 model2 model3
>>
>> which would be great to have, but I should find a way to loop
>> across all models from inside the jnl script. Now my jnl script
>> includes
>>
>> define symbol model = ($01)
>>
>> to read the argument, because I'm parsing only one argument at a
>> time. How can I loop over all models from inside the jnl script?
>>
>> Cheers,
>> Giorgio
>>
>>
>> ----Messaggio originale----
>> Da: ansley.b.manke@xxxxxxxx
>> Data: 12-mag-2020 19.55
>> A: <ferret_users@xxxxxxxx>
>> Ogg: Re: [ferret_users] Problems with netcdf output and
>> zaxreplace
>>
>> Hi Giorgio,
>>
>> Another method for sending Ferret/PyFerret a set of commands
>> is to use the -script option on startup.
>>
>> > pyferret -script my_script.jnl [arguments]
>>
>> This is generally more flexible than piping commands. The
>> startup option -batch for Ferret or -nodisplay for PyFerret
>> are also useful when you don't want to have graphics windows
>> display. Note that -script must appear last among command
>> line switches so that the script arguments will be parsed
>> correctly.
>>
>> Unix command-line switches
>> <https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/introduction/GETTING-STARTED#_VPID_8>
>>
>>
>>
>> On 5/9/2020 3:19 AM, Giorgio Graffino wrote:
>>> Hi Ryo,
>>> thanks to your "quote" suggestion I could successfully run
>>> my bash script.
>>>
>>> Cheers,
>>> Giorgio
>>>
>>> ----Messaggio originale----
>>> Da: furue@xxxxxxxxxx
>>> Data: 28-apr-2020 14.28
>>> A: "Giorgio Graffino" <g.graffino@xxxxxx>
>>> Cc: "Ferret" <ferret_users@xxxxxxxx>
>>> Ogg: Re: [ferret_users] Problems with netcdf output and
>>> zaxreplace
>>>
>>> Hi Giorgio,
>>>
>>> On Tue, Apr 28, 2020 at 7:09 PM Giorgio Graffino <
>>> g.graffino@xxxxxx <invalidurl.gif>> wrote:
>>>
>>>
>>> !-> REPEAT: I=1
>>> **ERROR: command syntax: II = ???
>>> define symbol ii
>>>
>>>
>>> Compare this line with the one in the original shell
>>> script:
>>>
>>> ferret << STOP
>>> . . .
>>> define symbol ii `i`
>>> . . .
>>> STOP
>>>
>>> Where did `i` go?
>>>
>>> In the shell script as well as in the ferret script, the
>>> backquote construct is evaluated. In the above shell
>>> script, the shell tries to run a command named "i". It
>>> fails and is replaced with an empty string. I
>>> suppose you saw this error message on your screen
>>>
>>> . . . i: command not found
>>>
>>> To prevent the shell from interpreting the backquote
>>> construct, you "quote" the here-document by
>>>
>>> ferret <<'STOP'
>>> . . .
>>> STOP
>>>
>>> Ryo
>>> --------------------
>>> To see what's going on, run this kind of test shell script
>>>
>>> echo date
>>> echo `date`
>>> echo "abc `date` def"
>>> echo 'abc `date` def'
>>>
>>> cat <<EOF
>>> date
>>> `date`
>>> EOF
>>>
>>> cat <<'EOF'
>>> date
>>> `date`
>>> EOF
>>>
>>>
>>>
>> --
>> 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.
>>
>>
>>
> --
> 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.
>
>
>
--
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