r-devel / rdevguide

A guide for contributing to R core development
https://contributor.r-project.org/rdevguide/
Other
60 stars 19 forks source link

Translations in FORTRAN #155

Closed SaranjeetKaur closed 1 year ago

SaranjeetKaur commented 1 year ago

I don't think R is doing any translations in Fortran. There are only a handful of eligible strings anyway:

src/library/stats/src/ppr.f:660:      if(br.gt.n) call rexit('br is too large')
src/library/stats/src/ppr.f:1370:      iparms(2) = 0   ! ispar := 0 <==> estimate `spar'
src/library/stats/src/ppr.f:1384:      if(ier .gt. 0) call intpr('spline(.) TROUBLE:', 18, ier, 1)
src/library/stats/src/loessf.f:301:         call ehg184('at ',q(1),dd,1)
src/library/stats/src/loessf.f:302:         call ehg184('radius ',rho,1,1)
src/library/stats/src/loessf.f:390:            call ehg184('pseudoinverse used at',q(1),d,1)
src/library/stats/src/loessf.f:391:            call ehg184('neighborhood radius',dsqrt(rho),1,1)
src/library/stats/src/loessf.f:392:            call ehg184('reciprocal condition number ',rcond,1,1)
src/library/stats/src/loessf.f:395:               call ehg184('There are other near singularities as well.'
src/library/stats/src/loessf.f:533:         call ehg184('Chernobyl! trL<k',trl,1,1)
src/library/stats/src/loessf.f:535:         call ehg184('Chernobyl! trL>n',trl,1,1)
src/library/stats/src/loessf.f:920:            call ehg184('eval ',z(1),d,1)
src/library/stats/src/loessf.f:921:            call ehg184('lowerlimit ',v(ll,1),d,nvmax)
src/library/stats/src/loessf.f:924:               call ehg184('eval ',z(1),d,1)
src/library/stats/src/loessf.f:925:               call ehg184('upperlimit ',v(ur,1),d,nvmax)
src/library/stats/src/loessf.f:1541:         call ehg183('k-d tree limited by memory; nvmax=',
src/library/stats/src/loessf.f:1545:            call ehg183('k-d tree limited by memory. ncmax=',
src/library/stats/src/portsrc.f:3556:      DATA CNGD(1),CNGD(2),CNGD(3)/'---C','HANG','ED V'/,
src/library/stats/src/portsrc.f:3557:     1     DFLT(1),DFLT(2),DFLT(3)/'NOND','EFAU','LT V'/
src/library/stats/src/bvalue.f:91:            call rwarn('bvalue()  mflag != 0: should never happen!')
src/library/stats/src/hclust.f:65:      IF (iOpt .eq. 8) THEN ! Ward "D2" ---> using *squared* distances
src/library/stats/src/kmns.f:368:        if(iTrace .gt. 0 .and. ISTEP .ge. 1 .and. I .eq. 1) ! only from second "round" on

via grep -Enr "[\"\']" --include=*.{f,f90} | grep -Ev "\.f(90)?:[0-9]+:[cC*\!#]" | grep -Ev "'[A-Za-z]'"

In turn, the ehg18{3,4} routines are defined here:

https://github.com/r-devel/r-svn/blob/99a0f1629970d856fe4e871636f15cb57fdccbf8/src/library/stats/src/loessc.c#L411-L445

They don't appear to be doing translation, but I suppose they could.

_Originally posted by @MichaelChirico in https://github.com/r-devel/rdevguide/pull/154#discussion_r1233353814_

SaranjeetKaur commented 1 year ago

@MichaelChirico - we were discussing today about the above conversation you had on PR#154 (merged now) and @hturner suggested that it would be nice to make a note about this in the dev guide. Could you please add a note about this in the dev guide for future readers?