comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: change values of structure variable
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: change values of structure variable [message #81932 is a reply to message #81931] Thu, 08 November 2012 19:56 Go to previous messageGo to previous message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
On Thursday, November 8, 2012 8:00:08 PM UTC+5:30, wlandsman wrote:
> I don't see a common block in your read2datatmos.pro program. --Wayne
>
>
>
> On Wednesday, November 7, 2012 11:58:28 PM UTC-5, sid wrote:
>
>> On Tuesday, November 6, 2012 11:53:57 PM UTC+5:30, wlandsman wrote:
>
>>
>
>>> On Tuesday, November 6, 2012 10:23:40 AM UTC-5, David Fanning wrote:
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>> You can't change anything about a structure once you create
>
>>
>
>>>
>
>>
>
>>>> it in the IDL session.
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> You can't change dimensions or data types, but you should be able to change structure tag values. So I don't know why the code is not working for the OP (we don't see his common block). But the following works
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> pro test1
>
>>
>
>>>
>
>>
>
>>> common var,a
>
>>
>
>>>
>
>>
>
>>> a.b(*,*) = 2500
>
>>
>
>>>
>
>>
>
>>> return
>
>>
>
>>>
>
>>
>
>>> end
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> pro test
>
>>
>
>>>
>
>>
>
>>> common var,a
>
>>
>
>>>
>
>>
>
>>> a = {b:dblarr(3,5)}
>
>>
>
>>>
>
>>
>
>>> test1
>
>>
>
>>>
>
>>
>
>>> print,a.b
>
>>
>
>>>
>
>>
>
>>> return
>
>>
>
>>>
>
>>
>
>>> end
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> IDL> test
>
>>
>
>>>
>
>>
>
>>> 2500.0000 2500.0000 2500.0000
>
>>
>
>>>
>
>>
>
>>> 2500.0000 2500.0000 2500.0000
>
>>
>
>>>
>
>>
>
>>> 2500.0000 2500.0000 2500.0000
>
>>
>
>>>
>
>>
>
>>> 2500.0000 2500.0000 2500.0000
>
>>
>
>>>
>
>>
>
>>> 2500.0000 2500.0000 2500.0000
>
>>
>
>>
>
>>
>
>> Hi sir,
>
>>
>
>> I tried this method but still it is not working,
>
>>
>
>> His common block is,
>
>>
>
>> atom.common(common block)-COMMON atmosCommon, atmos, H, metals, molecules, nHmin
>
>>
>
>>
>
>>
>
>> I have written a program as you said like this,
>
>>
>
>> pro test1
>
>>
>
>> common atmosCommon,atmos
>
>>
>
>> atmos.vturb(*,*)=2500.0000
>
>>
>
>> return
>
>>
>
>> end
>
>>
>
>>
>
>>
>
>> I have called this in the function(read2datmos.pro),
>
>>
>
>>
>
>>
>
>> FUNCTION read2datmos, fileName, BFILE=Bfile
>
>>
>
>> Nx = 0L & Nz = 0L & NHydr = 0L
>
>>
>
>>
>
>>
>
>> openr, unit, fileName, /GET_LUN, /XDR
>
>>
>
>>
>
>>
>
>> readu, unit, Nx, Nz, NHydr
>
>>
>
>> point_lun, unit, 0
>
>>
>
>>
>
>>
>
>> atmos = {Nx: Nx, Nz: Nz, NHydr: NHydr, $
>
>>
>
>> boundary: lonarr(3), dx: dblarr(Nx), z: dblarr(Nz), $
>
>>
>
>> T: dblarr(Nx, Nz), n_elec: dblarr(Nx, Nz), $
>
>>
>
>> vturb: dblarr(Nx, Nz), vx: dblarr(Nx, Nz), $
>
>>
>
>> vz: dblarr(Nx, Nz), $
>
>>
>
>> nH: dblarr(Nx, Nz, NHydr)}
>
>>
>
>>
>
>>
>
>> test1 (I have called the program here).
>
>>
>
>>
>
>>
>
>> But still it is not working.
>
>>
>
>>
>
>>
>
>> Will please let me know if there is any mistake.
>
>>
>
>> thanking you
>
>>
>
>> sid

Sir,
atom.common is the common block program
and this is the content of the common block,
"COMMON atmosCommon, atmos, H, metals, molecules, nHmin"
read2datmos.pro is the function which uses common block variable.
thanking you
Sid
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: attractive base map for animation
Next Topic: Re: Save some plots

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:28:35 PDT 2025

Total time taken to generate the page: 1.59829 seconds