n nested for loops in fortran90
问题 i have read some topics on this, but i don't quite think it answers my question. if it does then please direct me to the correct topic and i will definitely look again. here is my problem: i want to write a for loop which will cycle through every possible combination of an array where the array is of length 'n'. that is, if n = 2 then my for loop would be do i1 = 1,2 do i2 = 1,2 ! do stuff here enddo enddo while if n = 3 then my array would look like do i1 = 1,3 do i2 = 1,3 do i3 = 1,3 ! do