HI,
Say I have a 50x50 allocatable array and I want to change this to a 100x1 allocatable array. What is the best way to do this? I am using the reshape command but it does not work well with allocatable arrays.
This is a simple question and I suspect there is a simple solution.
My current block of code looks something like this:
do QindIC= 1, NqIC
allocate(q0p(NsFA(QindIC), NqIC))
do FAindIC= 1, NsFA(QindIC)
q0p(FAindIC, QindIC)= qfinalICT(QindIC)%qfinalICvalT(FAindIC, QindIC)
end do
q0pp= reshape(q0p, (/sum(NsFA)), ppnull/))
deallocate(q0p)
end do
This results in a "segmentation fault - invalid memory reference" error. Any help would be much appreciated.
Please let me know what you think.
Thank you,
Robert
Say I have a 50x50 allocatable array and I want to change this to a 100x1 allocatable array. What is the best way to do this? I am using the reshape command but it does not work well with allocatable arrays.
This is a simple question and I suspect there is a simple solution.
My current block of code looks something like this:
do QindIC= 1, NqIC
allocate(q0p(NsFA(QindIC), NqIC))
do FAindIC= 1, NsFA(QindIC)
q0p(FAindIC, QindIC)= qfinalICT(QindIC)%qfinalICvalT(FAindIC, QindIC)
end do
q0pp= reshape(q0p, (/sum(NsFA)), ppnull/))
deallocate(q0p)
end do
This results in a "segmentation fault - invalid memory reference" error. Any help would be much appreciated.
Please let me know what you think.
Thank you,
Robert