[gradsusr] GrADS Loop Help

Martin V. Mathew vmartinmathew at gmail.com
Fri Jul 19 01:50:16 EDT 2013


Hi Emily

The script was missing one line to increment the variable 'yrs'. Now i
have included that in the script.
I have attached two scripts with this mail. Of these, I have tested the
second one and it is found to yield the desired result. I think you can fix
any other potential error by cross checking both the scripts. You can use
file 'taux_tropflux_1d_1979_2012.nc' from the following URL to run the
second script.
http://www.locean-ipsl.upmc.fr/~tropflux/data/daily/

On 18 July 2013 23:54, Emily Wilson <wilson.emily.parker at gmail.com> wrote:

> Hi Martin,
>
> I put in my lat lon coors in the new file and ran the script but the
> message "Opening input file air.sig995.1948.nc" is repeated until I
> manually close GrADS.  It seems as if the script is not looping to open the
> other 63 files and just keeps looping and opening the file for 1948.  How
> could I fix this?
>
> Thanks again for all your help,
>
> *Emily P. Wilson, Intern*
> Research and Conservation Department
> Denver Botanic Gardens
> 1007 York St.
> Denver, CO 80206
> 720-865-3593
>
>
> On Thu, Jul 18, 2013 at 6:17 AM, Martin V. Mathew <vmartinmathew at gmail.com
> > wrote:
>
>>
>> Hi Emily
>>
>> I have tested the script and fixed all the problems, it can now do all
>> required calculations. This program uses output of "q dim" command to
>> identify start point and end point of each month. The program uses a
>> compound variable to store the calculated data. Right now I don't know a
>> method to write values in a compound variable to a text file. Hence I am
>> only displaying the data to the terminal using say command. If you find a
>> means to write the data to text file, kindly convey it me. Please find
>> the attached script.
>>
>>
>> (1)  I would like to get max/min temps for multiple specific lat/long
>>> coordinates.  To do that would I just change the set lat and set lon
>>> lines?  Should I change then the x= and y= that come after the set lat and
>>> set lon definitions or leave those as is?
>>>
>> Commands 'set lon' and 'set x' do the same thing. Hence there is no need
>> to use both the commands.  In order to do the calculation for multiple
>> lat/lon coordinates you can either insert an additional while loop in the
>> script or otherwise change the set lat and set lon lines and run the script
>> again.
>>
>>> (2)  As of now when I run the script it says "Opening input file
>>> air.sig995.1948.nc" 63 times with the corresponding years but no
>>> numerical data is provided.  I haven't specified where to write the data to
>>> a table but shouldn't it still be displayed?
>>>
>> The modified script will display output data in the terminal. Please find
>> a means to write the data to an output file.
>> --
>> Martin V. Mathew
>> Research scholar
>> Centre for Oceans, Rivers, Atmosphere and Land Sciences (CORAL)
>> IIT Kharagpur
>> India.
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Martin V. Mathew
Research scholar
Centre for Oceans, Rivers, Atmosphere and Land Sciences (CORAL)
IIT Kharagpur
India.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130719/7ca7af1a/attachment-0003.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pck_max_min_new.gs
Type: application/octet-stream
Size: 4434 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20130719/7ca7af1a/attachment-0006.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pck_max_min_tropflux.gs
Type: application/octet-stream
Size: 4135 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20130719/7ca7af1a/attachment-0007.obj 


More information about the gradsusr mailing list