[Thread Prev][Thread Next][Index]

Re: [ferret_users] error in repeat command...



Hi Mahesh,
This error message is not coming from Ferret itself, but is probably an error in reading the ascii data. Are there header lines that you need to skip when reading the file?  Past messages in the Users List Archives indicate that people saw this message when the first lines of an ascii file contain text.

http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2005/msg01067.html

Ansley

Mahesh Shinde wrote:
Dear mick...

It works fine...but i have another error when i save the itto nc file

let/bad=-99/title="Mediterranean Climatology" psal=a
save/file=mahesh_s.nc psal

 and error is
**TMAP ERR: Host is down
             Last or next-to-last record read:
             VARIABLE : A (Salinity, PSU)
             Data set: ./mahesh_s.ascii
             Data file: ./mahesh_s.ascii

and no nc file created.....why this happens.......any solution



thanks




mahesh

On Mon, Feb 15, 2010 at 8:13 PM, mick spillane <Mick.Spillane@xxxxxxxx> wrote:
Hi Mahesh,
  It may be just a typo on my part in the nested repeat loops.  Looking at the "repeat/k=25:1:-1 ((" part there is no obvious reason for the TWO parentheses, so my guess is that what I intended was:


repeat/k=25:1:-1 (repeat/i=230:1:-1 (list/app/file=MaheshData.ascii/form=(81f9.6)/ord=yx a))

In most cases I think parentheses surrounding a single command in a repeat loop are not necessary; they are needed if more that one command (separated by semi-colons) are inside the loop.

Often it is a good idea to test various constructions with simple examples. For example try:

repeat/k=30:10:-10 (repeat/i=4:1:-1 list/nohead/form=(2f5.0) k,i )      ! Case A
repeat/k=30:10:-10 (repeat/i=4:1:-1 (list/nohead/form=(2f5.0) k,i ))    ! Case B
repeat/k=30:10:-10 ((repeat/i=4:1:-1 list/nohead/form=(2f5.0) k,i ))    ! Case C
repeat/k=30:10:-10 repeat/i=4:1:-1 list/nohead/form=(2f5.0) k,i          ! Case D

Cases A & B work fine, showing that the inner set of parentheses are not necessary. But Case C with the redundant  pair of parentheses causes the same error that you encountered.  Clearly in parsing or decoding a "repeat" loop, Ferret is unhappy with "((" .
Case D works too showing, that when just a single command is run inside a double loop, no parentheses at all are required.

To illustrate a case with multiple commands inside the loop
repeat/k=30:10:-10 repeat/i=4:1:-1  (list/nohead/form=(f5.0) k ; list/nohead/form=(f5.0) i )
will work fine, but if you try it without the parentheses
repeat/k=30:10:-10 repeat/i=4:1:-1  list/nohead/form=(f5.0) k ; list/nohead/form=(f5.0) i
it won't.

Hope this helps; I suspect that if you use either of the styles in Case A or B your problem will go away.
Mick
========


Mahesh Shinde wrote:
Dear mick,

I have following error when i execute the repeate command ....


repeat/k=25:1:-1 ((repeat/i=230:1:-1 list/app/file=MaheshData.ascii/form=(81f9.6)/ord=yx a))

!-> REPEAT: K=25
 **ERROR: command syntax: (repeat/i=230:1:-1 list/app/file=MaheshData.ascii/form=(81f9.6)/ord=yx a)
(repeat/i=230:1:-1 list/app/file=MaheshData.ascii/form=(81f9.6)/ord=yx a)
Command file, command group, or REPEAT execution aborted


I could not understand why this happening....

...




Thanks

mahesh



On Thu, Feb 4, 2010 at 6:39 PM, mick spillane <Mick.Spillane@xxxxxxxx <mailto:Mick.Spillane@xxxxxxxx>> wrote:

   Hi Mahesh,

     When I first looked at the file you sent by shading the K=1 layer
        shade/k=1 a
   it looked strange -- not like what you would expect for SST.  Next
   I did a north to south transect
     shade/i=100 a
   which showed the problem -- the warm temperatures were at the
   bottom. Since the data grid looked reasonable:
     show grid/all a
   it looked like the data had been loaded in upside-down.
   To check this I shaded the K=25 layer
     shade/k=25 a
   which showed up another problem -- the geography was reversed
   east-to-west too!

     The easiest way (for me) to correct this type of problem in a
   file of reasonable size is to write it to an ASCII file then
   reread it in the the proper order on the same grid (which was
   correct) and make a new netCDF file.
     spawn touch MaheshData.ascii
     repeat/k=25:1:-1 (repeat/i=230:1:-1
   list/app/file=MaheshData.ascii/form=(81f9.6)/ord=yx a ))
     spawn vi MaheshData.ascii
   Looking at the file the "nan" values that others referred to were
   evident but easily fixed in vi with ":1,$s/nan/-99/g" -- now "-99"
   is the missing value.

   One final thing is needed in order to read in the ASCII data file
   -- you need to know now to refer to the grid.
   To do this type
     show grid/all a
   when in the first line of the output you will see something like
   "GRID GIF1" which identifies the name ferret has assigned to the
   variable "a" in the original data file.
   Now reread the data
     file/form=free/col=81/ord=yxz/g=GIF1/var=a MaheshData.ascii
   and use
     set var/bad=-99 a
   to set the missing data value. Check that all is well by doing
   some shade plots like "shade/k=1 a".

   Finally save a netCDF version of the data
     save/file=MaheshData.nc a
   One other thing you could do would be to rename "a" to something
   more suitable such as TEMP (for temperature).  Note that you can't
   use "T" as the variable name since ferret reserves T for the Time
   Axis.
   To use TEMP, the last two commands above should be replaced with
   something like:
     let/bad=-99/title="Mediterranean Climatology" temp=a
     save/file=MaheshData.nc temp

   There might be some typos in  the commands above, since I typed
   them from memory having forgotten to save the "ferret.jnl" file
   yesterday.
     Hope it makes sense -- I've been using ferret for about 20 years
   so it has become  very familiar. When working in another project I
   used to access Indian rainfall data as one element of a collection
   of monthly global climate change indices.  Now I work with the
   Tsunami research group here at NOAA/PMEL in Seattle where ferret
   originated.

   Good luck in your research -- I hope ferret becomes a tool of
   choice for you too.
   Mick
   ------
   Mahesh Shinde wrote:

       hello Mick,

       Thanks for the mail...But how you do it.........
       i am thankful if you tell me the steps


       regards
       mahesh


       On Wed, Feb 3, 2010 at 7:48 PM, mick spillane
       <Mick.Spillane@xxxxxxxx <mailto:Mick.Spillane@xxxxxxxx>
       <mailto:Mick.Spillane@xxxxxxxx
       <mailto:Mick.Spillane@xxxxxxxx>>> wrote:

          Hi Mahesh,

            The netCDF file you sent had some problems.  The order of the
          data did not match the definition of the x and z axes so
       that the
          surface layer was read in as being the bottom and Gibraltar
          appeared in the east.

            It was easy though in Ferret to write out the data in the
       proper
          order to an ASCII file, then re-read it and make a new
       netCDF file
          which is attached.  Also attached is an image in which the
       surface
          temperature from the new file is plotted over the topography in
          the region -- it lines up well.

          Good luck,
            Mick
          =======
          Mahesh Shinde wrote:


              Dear Ferret users,

              I am new to ferret. I want to plot clim of metatlas. But it
              does not plot properly.
              here i am sending a clim_temp_medi.nc
       <http://clim_temp_medi.nc>
              <http://clim_temp_medi.nc> <http://clim_temp_medi.nc>



              please help.

              Thanks

              Mahesh

              --               ---------------------------------------------------------------------------------------------------------------------
              (Current Affiliation)
              Mahesh Shinde
              Climate Research Lab(IC3),
              Barcelona Science Park,
              University of Barcelona,
              Barcelona-08028,Spain
              email: mshinde@xxxxxxx <mailto:mshinde@xxxxxxx>
       <mailto:mshinde@xxxxxxx <mailto:mshinde@xxxxxxx>>
              <mailto:mshinde@xxxxxxx <mailto:mshinde@xxxxxxx>
       <mailto:mshinde@xxxxxxx <mailto:mshinde@xxxxxxx>>>


                    ----------------------------------------------------------------------------------------------------------------------
              (Permanent Affiliation)
              Mahesh Shinde
              Climate and Global Modeling Division,
              Indian Institute of Tropical Meteorology,
              (Under the Ministry of Earth Sciences, Govt. Of India)
              NCL POST, Dr. Homi Bhabha Road,
              Pashan,Pune-411008, INDIA  email:
       samurai@xxxxxxxxxxxxxx <mailto:samurai@xxxxxxxxxxxxxx>
              <mailto:samurai@xxxxxxxxxxxxxx
       <mailto:samurai@xxxxxxxxxxxxxx>>
       <mailto:samurai@xxxxxxxxxxxxxx <mailto:samurai@xxxxxxxxxxxxxx>

              <mailto:samurai@xxxxxxxxxxxxxx
       <mailto:samurai@xxxxxxxxxxxxxx>>>
              cell: +91-9822050959
                    ----------------------------------------------------------------------------------------------------------------------





       --        ---------------------------------------------------------------------------------------------------------------------
       (Current Affiliation)
       Mahesh Shinde
       Climate Research Lab(IC3),
       Barcelona Science Park,
       University of Barcelona,
       Barcelona-08028,Spain
       email: mshinde@xxxxxxx <mailto:mshinde@xxxxxxx>
       <mailto:mshinde@xxxxxxx <mailto:mshinde@xxxxxxx>>
       ----------------------------------------------------------------------------------------------------------------------
       (Permanent Affiliation)
       Mahesh Shinde
       Climate and Global Modeling Division,
       Indian Institute of Tropical Meteorology,
       (Under the Ministry of Earth Sciences, Govt. Of India)
       NCL POST, Dr. Homi Bhabha Road,
       Pashan,Pune-411008, INDIA  email: samurai@xxxxxxxxxxxxxx
       <mailto:samurai@xxxxxxxxxxxxxx> <mailto:samurai@xxxxxxxxxxxxxx
       <mailto:samurai@xxxxxxxxxxxxxx>>
       cell: +91-9822050959
       ----------------------------------------------------------------------------------------------------------------------





--
---------------------------------------------------------------------------------------------------------------------
(Current Affiliation)
Mahesh Shinde
Climate Research Lab(IC3),
Barcelona Science Park,
University of Barcelona,
Barcelona-08028,Spain
email: mshinde@xxxxxxx <mailto:mshinde@xxxxxxx>
----------------------------------------------------------------------------------------------------------------------
(Permanent Affiliation)
Mahesh Shinde
Climate and Global Modeling Division,
Indian Institute of Tropical Meteorology,
(Under the Ministry of Earth Sciences, Govt. Of India)
NCL POST, Dr. Homi Bhabha Road,
Pashan,Pune-411008, INDIA  email: samurai@xxxxxxxxxxxxxx <mailto:samurai@xxxxxxxxxxxxxx>
cell: +91-9822050959
----------------------------------------------------------------------------------------------------------------------





--
---------------------------------------------------------------------------------------------------------------------
(Current Affiliation)
Mahesh Shinde
Climate Research Lab(IC3),
Barcelona Science Park,
University of Barcelona,
Barcelona-08028,Spain
email: mshinde@xxxxxxx
----------------------------------------------------------------------------------------------------------------------
(Permanent Affiliation)
Mahesh Shinde
Climate and Global Modeling Division,
Indian Institute of Tropical Meteorology,
(Under the Ministry of Earth Sciences, Govt. Of India)
NCL POST, Dr. Homi Bhabha Road,
Pashan,Pune-411008, INDIA  
email: samurai@xxxxxxxxxxxxxx
cell: +91-9822050959
----------------------------------------------------------------------------------------------------------------------


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement