commit 5960e7ca43d70d6095ce7d4f67e72d534ba23538 Author: Elex Date: Sun Feb 26 01:11:05 2023 +0900 2023-02-26 01:10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..010d9a7 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Fortran Example diff --git a/hello/hello b/hello/hello new file mode 100755 index 0000000..295daba Binary files /dev/null and b/hello/hello differ diff --git a/hello/hello.f90 b/hello/hello.f90 new file mode 100644 index 0000000..d82b3e8 --- /dev/null +++ b/hello/hello.f90 @@ -0,0 +1,18 @@ +program variables + use, intrinsic :: iso_fortran_env, only: sp=>real32, dp=>real64 + ! use, intrinsic :: iso_c_binding, only: sp=>c_float, dp=>c_double + implicit none + + real :: val0 + real(sp) :: val1 ! 단정도 + real(dp) :: val2 ! 배정도 + + val0 = 0. + val1 = 0._sp + val2 = 0._dp + + print *, 'Max = ', huge(val0) + print *, 'Max32 = ', huge(val1) + print *, 'Max64 = ', huge(val2) + +end program variables \ No newline at end of file diff --git a/hello/stdio b/hello/stdio new file mode 100755 index 0000000..b496115 Binary files /dev/null and b/hello/stdio differ diff --git a/hello/stdio.f90 b/hello/stdio.f90 new file mode 100644 index 0000000..c6f5dd4 --- /dev/null +++ b/hello/stdio.f90 @@ -0,0 +1,6 @@ +program stdio + implicit none + character(len=16) :: name + read (*,*) name + print *, 'Hello, ', name +end program stdio \ No newline at end of file