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 #81941 is a reply to message #81935] Wed, 07 November 2012 20:58 Go to previous messageGo to previous message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
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: Fri Oct 10 05:50:44 PDT 2025

Total time taken to generate the page: 0.48267 seconds