initialisation.f90 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. program initialisation
  2. ! This program creates the file inputfile.dat which is used in
  3. ! CMRH (sequential) or PCMRH (parallel) test suite.
  4. !
  5. ! - output choice (no prints/ all iterations & results / only final results)
  6. ! - size of matrix A.
  7. ! - choice between 5 types of matrices A
  8. ! - choice between 3 types of solution vectors
  9. ! - tolerance input.
  10. use randvectors
  11. integer :: iprint,n,choix,choixsol
  12. real*8 ::choixtol
  13. print*,'Would you print results ? : 1-No / 2-All / 3-Time and final residual norm'
  14. read*,iprint
  15. print*,'Enter matrix size : '
  16. read*,n
  17. print*,'Enter matrix choice : (more details in README.txt) '
  18. print*,'1- A(i,j)=2j-1 / n-i+j for j=1,k '
  19. print*,' 2i-1 / n-i+j for j=i+1,n '
  20. print*,'2- A(i,j)=i for j=1,i '
  21. print*,' j for j=i+1,n '
  22. print*,'3-helsing.f90'
  23. print*,'4-rbf.f90 (Radial basis function matrix - see rbf.f90 - )'
  24. print*,'5- Matrix File (put your matrixfile.dat in current directory) '
  25. read*,choix
  26. if (choix==3) then
  27. call rand0(n)
  28. call vecrand(n)
  29. call helsing(n)
  30. end if
  31. if (choix==4) then
  32. call rand0(n)
  33. call vecrand(n)
  34. call rbf(n)
  35. end if
  36. print*,'Enter solution choice : 1- [1,...,1]^T / 2- [n,...,1]^T '
  37. print*,'3-rand vector'
  38. read*,choixsol
  39. print*,'Enter tolerance:'
  40. read*,choixtol
  41. open(unit=10,file='inputfile.dat',status='unknown')
  42. write(10,*) iprint,n,choix,choixsol,choixtol
  43. close(10)
  44. end program initialisation