Jump to content

Vorticon

Members
  • Content Count

    4,690
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Vorticon

  1. Does anyone know how to read a binary file with Fortran 99? I keep getting a bad open attribute error any time I try to access a binary file despite using the internal option. Also the READ command assumes an ASCII input and there is nothing in the manual about this.
  2. You have to use the utility menu to create an EA executable. The process is detailed in the Errata section 9.4.2
  3. Here you go 99-9640 FORTRAN Version 4 by LGMA Products.pdf 99-9640 FORTRAN Manual Errata Sheet (14-Feb-90 Rev.7).pdf
  4. Unfortunately, I feel this is an area of weakness with this package. The compiler is not very good at catching all errors, and to date all the run time errors I have encountered only give the address of the error in the compiled code and not a pointer to the source code line causing the error, which makes debugging slow and painful.
  5. It compares very favorably to assembly. Probably vey close to the speed of compiled XB, but with major advantage of direct bitmap access, access to the VDP (memory and registers), and double precision floating point operations when needed. There is even a sound facility! With the exception of speech, it's pretty much complete. An impressive feat and a very under-appreciated package.
  6. So this appears to be read-only. Are we supposed to self-populate?
  7. Good to know! The problem is that even after 14 billion+ iterations, that 4th decimal was still stuck at 0, outside of the theoretical range... I would assume then that the XB RND function has the full TI precision and should give a better result, although it would take months to get a decent number of iterations...
  8. As I read the manual Errata, I was very pleasantly surprised to find that bitmap support had been added to the package, including the ability to draw lines and circles as well as place text anywhere on the bitmap screen and individual pixel plot routines. This made Fortran 99 quite a powerful package! As an exercise, I coded the chaotic logistic equation and plotted it on the bitmap screen. Requires the GL, ML and FL libraries. Fun:) PROGRAM LOGISTIC INTEGER X, Y CALL FILES(1) CALL CLEAR CALL SETMOD(4) CALL SCREEN(2, 16) WRITE(6, 20) P = 0.4 R = 2.5 DO WHILE (X .LE. 250) P = P * R * (1 - P) Y = IFIX(191 - (P * 191)) X = IFIX((R - 2.5) * 170) CALL SETPIX(X, Y) R = R + 0.0001 REPEAT 10 CALL KEY(0, KEYC, ISTATUS) IF (ISTATUS .EQ. 0) GOTO 10 20 FORMAT('+', M24.1, 'Logistic equation') STOP END
  9. Here you go It's based on Moulinaie's XB program. PROGRAM RANDTEST INTEGER IRAND, X INTEGER *4 T(10) REAL S, S2, SD CALL RANDOM PRINT ,'Number of data points?' ACCEPT ,N DO 10 I = 1, N X = IRAND(10) 10 T(X + 1) = T(X + 1) + 1 S = 0 S2 = 0 DO 20 I = 0, 9 S = S + (T(I + 1) * I) 20 S2 = S2 + (T(I + 1) * I * I) S = S / N S2 = S2 / N SD = SQRT(S2 - S * S) PRINT , 'MEAN = ', S PRINT , 'STANDARD DEVIATION = ', SD STOP END
  10. Incidentally, I wasn't too happy about the value of PI I was getting, so I checked the random number generator function in Fortran 99 and got this: The expected values are: MEAN = 4.5 STANDARD DEVIATION = 2.87 What still trips me on occasion is the range of variables. For example, if an operation brings a simple integer variable out of range (32767), it goes negative but no overflow error is generated. This is not something we had to worry about in loosely typed languages like Basic or Python...
  11. Again, the mortality rate for COVID-19 is around 10x that of H1N1, with a higher transmission rate. Using your numbers, the death rate from H1N1 is 0.21%, and from COVID-19 1.7%... That's 1,020,000 death in the US if we assume the same total number of infections as H1N1, which is very optimistic. Put that into perspective...
  12. We do know that about 40% of patients with severe COVID-19 are <=55 years of age.
  13. It was still in the Recycle bin. Here you go FORTWORK.dsk
  14. Well it seems that the random shot method has its limits. After 14.3 billion iterations, PI has converged to 3.141076. I guess we're not going to get that 4th decimal after all. Interesting...
  15. Not that I could tell. So on a hunch, I deleted the disk image I was using for DSK3 and created a new one, and now everything works as it should. I must have had a bad image for some reason. Sorry about the fuss! Should have done that from the get go.
  16. I got the C12 trick from the sample program in Beard's introduction Incidentally, I did end up needing to add the following types to the program in order to allow for an iteration number > 32767, and the compiler complained but still complied INTEGER *4 N, I REAL *8 TOTAL I must say, Fortran is a beast to use... But I'm starting to warm up to it he he...
  17. OK I figured out what the problem was: The FORMAT statement for the initial READ statement was incorrect. This really takes some getting used to... I also optimized the program a bit as I got more familiar with the language. Here's the new listing: PROGRAM PICALCFT C GET NUMBER OF ITERATIONS WRITE(6, 10) READ(6, 15) N C MAIN PROGRAM LOOP WRITE(6, 20) I = 1 DO 1 I = 1, N X = IRAND(10) Y = IRAND(10) D = (X / 10)**2 + (Y / 10)**2 IF (D .LE. 1.0) TOTAL = TOTAL + 1 1 WRITE(6, 25) I C FINALIZE RESULT AND DISPLAY PI = (TOTAL / N) * 4 WRITE(6, 30) PI WRITE(6, 35) 10 FORMAT('+', C12, M5.1, 'Number of iterations? ', M5.23) 15 FORMAT(I8) 20 FORMAT('+', M12.1, 'Iteration # ') 25 FORMAT('+', M12.13, I8) 30 FORMAT('+', M20.1, 'Approximate PI = ', F8.6) 35 FORMAT('0 ') STOP END And here it is running. It's pretty fast! This also proves that the library files are not corrupted.
  18. If you use TI99Dir to view the file, you should be able to cut and paste without issues. Here's the compiler output for the PICALCFT program 1 PICALCFT Version 4.42 Page 0001 . 0 0001 PROGRAM PICALCFT 0002 0003 INTEGER *4 N, I, TOTAL 0004 REAL *8 X, Y, D, PI 0005 0006 C GET NUMBER OF ITERATIONS 0007 READ(6, 10, END=9999, ERR=9999) N 0008 0009 C MAIN PROGRAM LOOP 0010 I = 1 0011 DO WHILE(I .LE. N) 0012 X = IRAND(10) / 10 0013 Y = IRAND(10) / 10 0014 D = X**2 + Y**2 0015 IF (D .LE. 1) THEN **Warning- Mixed Mode Arithmetic 0016 TOTAL = TOTAL + 1 **Warning- Mixed Mode Arithmetic 0017 ENDIF 0018 WRITE(6, 20) I 0019 I = I + 1 **Warning- Mixed Mode Arithmetic 0020 REPEAT 0021 0022 C FINALIZE RESULT AND DISPLAY 0023 PI = TOTAL / N * 4 **Warning- Mixed Mode Arithmetic 0024 WRITE(6, 30) PI 0025 0026 10 FORMAT('+', C12, M1.1, 'Number of iterations? ', I8) 0027 20 FORMAT('+', M12.1, 'Iteration # ', I8) 0028 30 FORMAT('+', M23.1, 'Approximate PI = ', F1.6) 0029 9999 STOP 0030 END 1 PICALCFT Allocation Version 4.42 Page 0002 . 0 Statement Labels: 0010 01DC 0020 0208 0030 0228 9999 024C 0 Subprogram References: IRAND DI$ DADD$ DCMP$ J4DIV$ J4MUL$ STOP$ CALL$ IDCVT$ JDCVT$ 0 Local Data Area: 000C j TOTAL 0010 j I 0014 j N 0018 d PI 0020 d D 0028 d Y 0030 d X 0 Logic Size: 0254 Data Size: 0038 0 Module Size: 028C 0004 Warning(s) 0000 Error(s) I should also mention that 80 column works perfectly fine with Classic99 and on real iron with the F18A. Just set it up from the Fortran 99 Utilities menu.
  19. Yup, I am using version 399.018 and the DSK Image option for all the drives 1-3. Below is a video of the issue. Note that the source file is truncated at the end when I reload it. Weird that you are not able to duplicate the issue...
  20. COVID-19 has a much higher infectivity rate than influenza, and up to 10x the mortality rate. And it continues to mutate, with the current strain already different from the original Wuhan virus. The silver lining here is that this novel strain appears to be slightly less dangerous than the original strain, so fingers crossed that this trend will continue. If on the other hand a more virulent strain appears, well all bets are off then. So while a vaccine will help, it all depends on whether we can keep up with the mutation rate. This is uncharted territory for all of us, and we all need to take it seriously and do our small part to fight this. The alternative is unthinkable...
  21. Here you go. I should mention that I merged the 2 library disks into a single one called FORTLIB. The original disks are SSSD, so I just dumped them into a DSSD disk using TI99Dir. That way I don't need to swap disks when linking. FORTLIB.dsk
  22. Yes I believe that's how it works.
×
×
  • Create New...