Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pack and reshape array of zeros

Status
Not open for further replies.

Rob321

Programmer
Feb 20, 2017
3
US
Hi,

I am trying to use the pack and reshape commands on an array equal to zero. For some reason the size intrinsic of each array changes in the process. I am doing the same for arrays not equal to zero and this problem does not exist. Here is the code that I currently have. Any thoughts would be appreciated.

xfinalIC(FAindIC, QindIC)= 0.0d0
x0p= pack(xfinalIC, xfinalIC == xfinalIC(FAindIC, QindIC))
x0pp= reshape(x0p, (/size(x0p), pnull/))

I suspect there is something going on with the specificity that the array is equal to zero...

Thanks!
 
It would be a lot more helpful if you provided a minimal yet complete program that show what you are doing, including type declarations and everything. On top of that, it would also be very helpful if you illustrated, say, with a 3x3 or 2x2 matrix what the initial state of things is, what you want as an outcome, and what you are actually getting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top