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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

logical true. false. issue

Status
Not open for further replies.

milenko76

Technical User
Mar 26, 2010
100
PT
I have array and want to use intrinsic pack functions.The problem is that my array is quite a big one so creating mask can be done by repeating true and false.Is there any simple way how I can write witout repeating 80 falses while creating mask?
 
If everything holds the same value, you can do it in a single assignment
Code:
logical, dimension(80):: truth
truth = .false.
 
you can also do it by ranges:

truth(15:23) = .truth.

I am not familiar with masks, but I think there is a way to retrieve indeces in a conditional manner depending on the value of the entries in the other array and create a mask based on that...I left my fortran 90 book somewhere else, but I am sure you can find something about it on-line
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top