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!

Bus error 10

Status
Not open for further replies.

momphy

Programmer
Jul 16, 2012
14
US
HI prgramer

when i run a loop to call subroutine . it stop execution and came out :bus error 10 .

do 96 i=1,row
do 97 j=1,conlum
if(i.eq.datarow(i).AND.(j.eq.dataconlum(j))) then
depth=mindepth+stepdeph*(i-1)
prossio=minpro+steppro*(j-1)

write(modela,200) depth,prossio
write(ofil,200) depth,prossio
200 format(f4.1''f5.3)

call calrespknt (modela,ipors,dt,t,pr,complt,modcnv)


97 continue
96 continue

the subroutine calrespknt have lots of common block .
it seems data can't be reset before every cycle begin .right ?
Is there any advice about this ?

 
You have if..then but where is endif? You have memory protection error but where is datarow and datacolumn arrays dimensions? We know nothing about subroutine calrespknt. We know nothing about row and column values...

It seems your help request is unclear and incomplete...

Use TGML code tag for your snippets - press (?) button on the input form for help.
 
sorry for that
the subroutine is kind of big .so i just give part of them ,i check the main program . it's correct . it should be something wrong with subroutine calrespknt .
the subroutine like :

subroutine calrespknt (modela,ipors,dt,t,pr,complt,modcnv)

.......
common /coff/ pps,pus,puu,pud(twenty varaible)
common /app/ tud,tus,tuu,tts(twenty varaible )
........
command statement

return
end

the command statement should be ok . i think something wrong with common block. the program call subroutine in a loop.
so i think data in the common block is not resetted before cycle . i still not find a way to do this.
 
Why not put your entire common block into a file (including real/integer declarations) and include these files instead of replicating the common blocks. That should get rid of any alignment problems.
 
@xwb

acturally , that's what i do . i put the common block in a file . that use 'include ' in the declaration . it still have this problem . i will try use pointer represent ,try use free () to release the memorary .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top