# NOT RUN {
! Example of a Fortran file to define functions
include 'forcings.f95' ! include generated forcings file in compilation
module functions
use forcings ! make forcings available as functions
implicit none
contains
! ... any non-forcing functions go here ...
end module
# }
# NOT RUN {
# }
# NOT RUN {
! Definition of 'rexit' and 'rwarn' for testing of the generated code
! outside of R
subroutine rexit (x)
character(len=*), intent(in):: x
write(*,*) "ERROR: ",trim(adjustl(x))
stop 1
end subroutine
subroutine rwarn (x)
character(len=*), intent(in):: x
write(*,*) "WARNING: ",trim(adjustl(x))
end subroutine
# }
Run the code above in your browser using DataLab