[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: Array multiplication: implicit loop query*From*: billb(at)attinet.com (Bill B.)*Date*: 10 Aug 2001 05:53:25 -0700*Newsgroups*: comp.lang.idl-pvwave*Organization*: http://groups.google.com/*References*: <d90c0773.0108100256.6398a693@posting.google.com>*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:26137

george@apg.ph.ucl.ac.uk (george Millward) wrote in message news:<d90c0773.0108100256.6398a693@posting.google.com>... > Hi there > > I was just calculating the following equation: > > DEN_H = MMR_H * Pres * RMT / ( atomic_mass_H * Gas_constant * TN ) > > These numbers are 3D arrays, 1D arrays and constants, i.e., > > MMR_H = fltarr(30,91,40) > Pres = fltarr(30) > RMT = fltarr(30,91,40) > atomic_mass_H = constant > Gas_constant = constant > TN =fltarr(30,91,40) > > The result of this is DEN_H (previously undefined) which ends up being > fltarr(30) - i.e., 1 dimensional. > To my mind DEN_H should be 3D (30,91,40) - shouldn't it ? Doesn't IDL > understand that I am implicity doing a full 3D calculation here ? No. > It > would seem that, to get this to work I need to make > Pres=fltarr(30,91,40). Yes. IDL> a = indgen(20,20) IDL> b = indgen(20) IDL> c = b * a IDL> help, c C INT = Array[20] I believe you need to REPLICATE 'Pres' as needed. -Bill B.

**Follow-Ups**:**Re: Array multiplication: implicit loop query***From:*Richard Younger

**References**:**Array multiplication: implicit loop query***From:*george Millward

- Prev by Date:
**Re: Discussion on global variables in IDL** - Next by Date:
**Re: Array multiplication: implicit loop query** - Prev by thread:
**Array multiplication: implicit loop query** - Next by thread:
**Re: Array multiplication: implicit loop query** - Index(es):