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!

Help! The following simple one is unable to give reasonable results

Status
Not open for further replies.

johnma

Programmer
Aug 23, 2005
1
CA
integer I,I1,I2,I3,NROWS,RBIN,VRBIN,VPHIBIN
real VR,VPHI,RR,NUMBER
REAL DISTRIB (11,11,11)

OPEN(1000,FILE='bin0d3new.DAT',STATUS = 'OLD')
OPEN(1001,FILE='DISTRIB.DAT')

NROWS = 121

DO 20 I = 1, NROWS

READ (1000, '(4g14.6)' ) VR, VPHI, RR, NUMBER

VRBIN = INT (VR/0.3) + 6

IF (VRBIN < 1) THEN
VRBIN = 1
ELSE IF (VRBIN > 11) THEN
VRBIN = 11
END IF

VPHIBIN = INT (VPHI/0.3) + 6

IF (VPHIBIN < 1) THEN
VRBIN = 1
ELSE IF (VPHIBIN > 11) THEN
VRBIN = 11
END IF

RBIN = INT (RR/0.8) + 1

IF (RBIN < 1) THEN
RBIN = 1
ELSE IF (RBIN > 11) THEN
RBIN = 11
END IF


DO 10 I1 = 1, 11
DO 10 I2 = 1, 11
DO 10 I3 = 1, 11

DISTRIB (I1,I2,I3) = 0

DISTRIB (RBIN, VRBIN, VPHIBIN) = DISTRIB (RBIN, VRBIN, VPHIBIN) +
$NUMBER

write ( 1001, '(3g14.6)' ) DISTRIB (RBIN, VRBIN, VPHIBIN)

10 CONTINUE

20 CONTINUE

end

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top