Closed MengZhang closed 4 years ago
Thanks @MengZhang. I correct it
def main():
cdef float RLINIT,WTNEW, FRRT, PLTPOP, RFAC1, DEP, RTDEP
RLINIT = WTNEW * FRRT * PLTPOP * RFAC1 * DEP / ( RTDEP * 10000 )
return RLINIT
SUBROUTINE main(RLINIT)
REAL, INTENT(OUT) :: RLINIT
REAL:: WTNEW
REAL:: FRRT
REAL:: PLTPOP
REAL:: RFAC1
REAL:: DEP
REAL:: RTDEP
RLINIT = WTNEW * FRRT * PLTPOP * RFAC1 * DEP / (RTDEP * 10000)
END SUBROUTINE main
I got translation result which improperly removed brackets used in the calculation as below.
pyx code: RLINIT = WTNEW FRRT PLTPOP RFAC1 DEP / ( RTDEP * 10000 )
generated f90 code RLINIT = WTNEW FRRT PLTPOP RFAC1 DEP / RTDEP * 10000
the brackets should be kept if it appears after divided or minus operation.