0
$\begingroup$

I am new to Fortran and I am trying to write a code using random data instead of binned data in x, y, z as shown in my sample code.

implicit real*8(a-h,o-z)
dimension rm(4),rp1(4),rip1(4),rp2(4),rip2(4),rp3(4),rip3(4),
d   rn(4),u1(4),u2(4),u3(4)


do ix= 1000,25000,1000
    x = ix/1000000.
    do iy = 1000,25000,1000
        y = iy/100000.
        do iz= 1,1000,25
            z = iz/10000.
            a = (x**2+y**2)/z
            b = x*y*z
            c = x*y**2+y*z**2+z*x**2
            fr = (a*b)/c
            if(fr.ge.0.05.and.fr.le.23)then
                write(40,*) x, y, x, fr
            else
            endif
        end do
    end do
end do

stop

How to convert such code having binned data to a code using random draws.

$\endgroup$
3
  • $\begingroup$ Why use Fortran these days? $\endgroup$ Jan 20 at 16:42
  • $\begingroup$ Separately, please indent your code so that it is easier to read. $\endgroup$ Jan 20 at 16:42
  • $\begingroup$ Your question reads more as a programming question than a computational science one. As such, it is off-topic in this site. $\endgroup$
    – nicoguaro
    Jan 25 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.