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 #81935 is a reply to message #81932] Thu, 08 November 2012 06:30 Go to previous messageGo to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
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
[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: Thu Oct 09 22:33:36 PDT 2025

Total time taken to generate the page: 0.31887 seconds