After I got hadvppm.f03 compiled in the fortran 2003 standard, I'm trying to do the same with xyadvec.f03 (check out my branch).
Somehwere around line 170 in xyadvec.f03, the code reads:
IF( lipr ) THEN
!-----Change from X-direction horizontal advection
l = 1
DO i=i1+1,i2-1
l = l+1
IF( ipa_cel(i,j,k) .GT. 0 ) THEN
ipa_idx = ipa_cel(i,j,k)
!-----Flux at west boundary
cipr(IPR_WADV, ipa_idx, ispc) = cipr(IPR_WADV, ipa_idx, ispc) + fc1(l)/dy/depth(i,j,k)
!-----Flux at east boundary
cipr(IPR_EADV, ipa_idx, ispc) = cipr(IPR_EADV, ipa_idx, ispc) + fc2(l)/dy/depth(i,j,k)
!-----Average volume
cipr(IPR_VOL, ipa_idx, ispc) = cipr(IPR_VOL, ipa_idx, ispc) + dx(j)*dy*depth(i,j,k)
npastep(ipa_idx,ispc) = npastep(ipa_idx,ispc) + 1
END IF
END DO
END IF
the compiler gives this output message as an error:
gfortran -std=f2003 -c -g -o build/Debug/GNU-Linux-x86/xyadvec.o xyadvec.f03
xyadvec.f03:177.42:
cipr(IPR_WADV, ipa_idx, ispc) = cipr(IPR_WADV, ipa_idx, ispc) + fc1(l
1
Error: Statement function at (1) is recursive
to be honest, I've never seen such a sloppy definition of a recursive function. I really don't understand what this code is supposed to achieve and why it's written like that. can you help me out?
After I got hadvppm.f03 compiled in the fortran 2003 standard, I'm trying to do the same with xyadvec.f03 (check out my branch).
Somehwere around line 170 in xyadvec.f03, the code reads:
the compiler gives this output message as an error:
to be honest, I've never seen such a sloppy definition of a recursive function. I really don't understand what this code is supposed to achieve and why it's written like that. can you help me out?