Displaying 2 results from an estimated 2 matches for "mmout".
Did you mean:
amout
2005 Apr 21
1
.Fortran() again
...e excuse my poor English. Can someone help me on reading
fortran binary object under R?
I was trying to read mm5 data under R. However, I seem to stuck at
reading fortran binary file storing met. data array. At the beginning,
I used readBin() to read mm5 output directly with the following
command.
#mmout is a mmout file generated with mm5
>mm5file<-file("mmout","rb")
>readBin(mm5file,integer(),n=1,size=1)
This gives output of "0", which is expect for this file. However, when
I started to read the rest of the file, I cannot get the result as
expected. The next...
2005 Apr 23
0
reading fortran binary file
...endif
goto 10
elseif(iflag.eq.2)then
goto 20
endif
20 close(11)
end
2.compile the subroutine as share object file with -byteswapio optin
3."dyn.load" the subroutine in R
4.call the subroutine.
.Fortran("freadmm5", filename = as.character("mmout"),
array(as.single(0), c(157,109))
This gives a array which is nearly half empty when the subroutine can
read the full array. I though it is because of R use double precision
to read single precision data at first. When I passed "as.single" to
it, it still came out the same result....