What is the purpose of "n = n"?

I read Fortran code, and every so often the previous programmer throws 'n = n' into the expression. What is the purpose of this? Code example:

if (cmult.lt.5.) then
    kx = 0
    do k=ipd(ii),lpd(ii)
       kx = kx + 1
       p1(kx) = epp_rfc(ipp,k)
       epp_rfc(ipp,k) = cmult*epp_rfc(ipp,k) + x   
       zero(ix)
       p2(kx) = epp_rfc(ipp,k)
       n = n
    enddo

if (cmult.gt.0.) then
    n = n
endif

else
    nk = lpd(ii) - ipd(ii) + 1
    do k=ipd(ii),lpd(ii)
       kx = kx + 1
       p1(kx) = epp_rfc(ipp,k)
       epp_rfc(ipp,k) = pp(imem) + zero(ix)
       p2(kx) = epp_rfc(ipp,k)
       n = n
    enddo
endif
+5
source share
2 answers

Similar code is often used to allow a programmer to set a breakpoint in debuggers that do not support conditional breakpoints.

By setting a breakpoint on this line, it will only be deleted if cmult.gt.0.

+14
source

The fact that it is n = nused to validate a value cmult.gt.0.and is used as a “condition breakpoint” is a coincidence in the sense that this is not the reason n = n appears in the above code snippet.

, n = n , , ( , , "" , , 100 ... - , ). , , - , .

enddo ​​ , , (, nop) , enddo. n = n p2(kx) = epp_rfc(ipp,k) reset . n = n p2(kx) = epp_rfc(ipp,k) . , :

if (cmult.gt.0.) then
    n = n
endif

( endif ) , , . n = n , if (cmult.gt.0.) - , - , . , .

. - , : p2(kx) p2(kx) = epp_rfc(ipp,k), check/fetch it - a) p2(kx) b) - ()! c) p2(kx). , - "" ( AI), , Terminator .

+1

All Articles