Skip to content

Instantly share code, notes, and snippets.

@linktohack
Created April 19, 2013 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linktohack/5423597 to your computer and use it in GitHub Desktop.
Save linktohack/5423597 to your computer and use it in GitHub Desktop.
Load Text Data
subroutine load_txt_data_1d_d(d, f)
implicit none
real*8, intent(out) :: d(:) ! array of text data
character(*), intent(in) :: f ! chanel file name
open(51, file=trim(f), status='old', action='read')
read(51, *) d
close(51)
endsubroutine
subroutine load_txt_data_2d_d(d, f)
implicit none
real*8, intent(out) :: d(:,:) ! array of text data
character(*), intent(in) :: f ! chanel file name
real*8 :: dt(size(d,2),size(d,1))
open(51, file=trim(f), status='old', action='read')
read(51, *) dt
close(51)
d = transpose(dt)
endsubroutine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment