LoginSignup
0
0

More than 1 year has passed since last update.

ちょっとしたFortranのひな型

Posted at

ちょっとしたコードを書いて動作確認をしたいとき用のひな型コード.

sample.f90
module subprogs
implicit none
contains
    subroutine hoge()
    endsubroutine hoge

    function hage(a)
        integer hage
        integer ::a
        return
    endfunction hage
endmodule subprogs
program main
    use subprogs
    implicit none
    integer :: i,j,k,l
    integer :: imax,jmax,kamx,lmax
    integer :: Nx,Ny,Nz
    real    :: Lx,Ly,Lz
    real,allocatable :: A(:)

read(*,*) Nx, Lx
read(*,*) K
allocate (A(Nx))
read(*,*) A

write(*,*) "input"
write(*,*) Nx, Lx
write(*,*) K
write(*,*) A(:)

end program

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0