Help us understand the problem. What is going on with this article?

Fortran90覚え書き (超基本)

とても基本的なことなのだが、他の言語と混ざっていつまで経っても覚えられない(覚える気がない)のでメモ。

比較演算子

演算子 意味
.lt. <
.le. <=
.eq. ==
.ne. /=
.gt. >
.ge. >=

論理演算子

演算子 意味
.not. ノットイコール
.and. &
.or. もしくは
.eqv. 論理値が等しい
.neqv. 論理値が等しくない

引数の取得

文字列としての取得になるので、数値の場合はreadし直す必要がある。

sample.f90
program sample
    implicit none
    integer         :: nmax
    character(256)  :: arg

    if( iargc() == 2 ) then
        call getarg(1,arg)
        read(arg,*) nmax
            call getarg(2,arg)
        open(90,file=trim(arg))
    else 
        !---引数が2つでなければ、適当な値/文字列を使用
        nmax=1000
        open(90,file="tmp.dat")
    end if
end program
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした