AgriculturalModelExchangeInitiative / PyCrop2ML

CropML Python library
Other
17 stars 17 forks source link

Operation translation cyml to fortran #79

Closed cyrillemidingoyi closed 4 years ago

cyrillemidingoyi commented 5 years ago

program test integer ::a=4 integer :: b=5 real c c=a/b ! transform it to c=real(a)/b print *, c end program

We got 0 as result. Need to improve operation translation. The problem is not just brackets

cyrillemidingoyi commented 5 years ago

The solution may be to take into account this kind of operation in cyml expression. If you want to divide two expressions you need to convert one of these in Real type

cyrillemidingoyi commented 5 years ago

In Cyml: cdef int a = 4 cdef int b = 5 cdef float c c = float(a)/b # This will be transformed to c = real(a)/b in fortran print(c)