Reputation: 11
I am trying to compile a code that hasn't been developed with the newest standards in mind. I am using the gfortran compiler and get a few errors that I can't correct.
A partner of mine uses the Intel Visual Fortran compiler in MS Visual Studio and doesn't get any errors. Below are the relevant sections of code and their errors. Insight into any of these would be greatly appreciated.
Error 1:
flow.for:63.63:
3 *gjmh_old(j)*abs(gjmh_old(j))/2.0d0/dens_fjmh(j) )
1
Error: Expected a right parenthesis in expression at (1)
Corresponding code:
sum_dpjmh_old= 1.0/2.0*(dens_jmh(j)+dens_old(j))*grav*(dzc(j)/2.0d0) !!!!
1 + ( gavg_old(j)*gavg_old(j)/dens_mom(j)
1 -gjmh_old(j)*gjmh_old(j)/dmom_jmh(j) )
3 + 1.0/2.0*
3 ( fric(j)*dzc(j)/2.0/dhyd(j)
3 *gavg_old(j)*abs(gavg_old(j))/2.0d0/dens_fric(j)
3 +fjmh(j)*dzc(j)/2.0/dhyd(j)
3 *gjmh_old(j)*abs(gjmh_old(j))/2.0d0/dens_fjmh(j) )
Error 2:
flow.for:78.13:
1 + ( gavg(j)*gavg(j)/dens_momn(j)
1
Error: Missing exponent in real number at (1)
Corresponding Code:
sum_dpjmh = 1.0/2.0*(dens_jmhn(j)+dens_ch(j))*grav*(dzc(j)/2.0d0) !!!!
1 + ( gavg(j)*gavg(j)/dens_momn(j)
1 -gjmh(j)*gjmh(j)/dmom_jmhn(j) )
3 + 1.0/2.0*
3 ( fric(j)*(dzc(j)/2.0)/dhyd(j)
3 *gavg(j)*abs(gavg(j))/2.0d0/dens_ch(j)
3 + fjmh(j)*(dzc(j)/2.0)/dhyd(j)
3 *gjmh(j)*abs(gjmh(j))/2.0d0/dens_jmhn(j) )
Error 3:
flow.for:684.72:
3 /dens_fjmh(j) )
1
Error: Syntax error in argument list at (1)
Corresponding code:
gjmh(j) = gjmh_old(j) + dt/dzc(j)*(
1 phi*2.0d0*(pjmh(j)-p(j))
1 + (1.0-phi)*2.0d0*(pjmh_old(j)-p_old(j))
1 - 2.0d0*( gavg_old(j)*gavg_old(j)/dens_mom(j)
1 -gjmh_old(j)*gjmh_old(j)/dmom_jmh(j) )
4 - dens_jmh(j)*grav*dzc(j)
3 - fjmh(j)*dzc(j)/2.0d0/dhyd(j)*gjmh_old(j)*abs(gjmh_old(j))
3 /dens_fjmh(j) )
Upvotes: 1
Views: 2201
Reputation: 3109
It seems your code is not well formatted. If you are trying to use fixed format, you should follow the request of fixed format, as http://nf.nci.org.au/training/FortranBasic/slides/slides.005.html. Or following instructions in http://en.wikipedia.org/wiki/Fortran#Fixed_layout_and_punched_cards:
Column 1 contains *, ! or C for comments.
Column 6 for continuation.
Another way is to convert fixed format to free format, but since your code is not well formatted, most converter may be not working well.
Upvotes: 1