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!

Writing an equantion in Compaq Visual fortran 6.1

Status
Not open for further replies.

collins-esi

Programmer
Aug 7, 2017
1
DZ
hi guys , i am in trouble , i am in Phd degree and i need to write this equation in Compaq Visual fortran 6.1 but nothing work
i need your help, please
1_1_asecax.png
2_1_fauley.png
3_1_pzbre7.png


thank you very much
 
I suggest you do a few things:
- break down the equation into several lines to make it easier to read and make it look as much as possible to the textbook
- leave the "sign(0.8,-0.2)" operation out of the double loop, its value does not change with the indices...it will always be -0.8
- BECAUSE the exponent "(am-1)" turns out to be negative, I would suggest you move everything to the denominator so that you can raise it to a positive power

Code:
do i = 1, L1
  do j = 1, M1
    A = ( (u(i,j)-u(i-1,j))/xdif(i) )**2 + ( (v(i,j)-v(i,j-1))/ydif(j) )**2
    B = ( (v(i,j)-v(i-1,j))/xdif(i)      +   (u(i,j)-u(i,j-1))/ydif(j) )**2
    
    Viscapp(i,j) = 1.0 / ( ( sqrt( 2*A + B ) )**(1.8) )
  end do
end do
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top