LoginSignup
0
0

More than 5 years have passed since last update.

NCL > 実行時引数の指定がない時に実行を中止する

Posted at
動作環境
Xeon E5-2620 v4 (8コア) x 2
32GB RAM
GeForce GT 730 1GB GDDR5
CentOS 6.9 (64bit)
NCAR Command Language Version 6.3.0
for WRF3.7.1, WPS3.7.1
  openmpi-1.8.x86_64 とその-devel
  mpich.x86_64 3.1-5.el6とその-devel
  gcc version 4.4.7 (とgfortran)
for WRF3.9, WPS3.9
  Open MPI v2.1.1
  gcc version 4.9.2 (とgfortran; devtoolset-3使用)
 NetCDF v4.4.1.1, NetCDF (Fortran API) v4.4.4
Python 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) 
Python 3.6.0 on virtualenv
GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu)
date (GNU coreutils) 8.4 
tmux 1.6-3.el6

NCL(NCAR Command Language)関連。
WRF(Weather Research and Forecasting Model)関連。

関連

概要

  • 実行時引数の指定がなければ実行を中止する

実装

if (.not.isdefined("pi")) then
    print("ERROR: pi is not specified")
    print("")
    print("Execute as follows")
    print("[cmd] pi=3.141592")
    exit()
end if

print("pi is")
print(pi)

実行例

関連: NetCDF / NCL > ncl実行時にcopyrightなどを表示しない > -Qオプション

run
$ ncl -Q no_arg_180806.ncl 
(0)     ERROR: pi is not specified
(0)
(0)     Execute as follows
(0)     [cmd] pi=3.141592
run
$ ncl -Q no_arg_180806.ncl pi=3.1415
(0)     pi is


Variable: pi
Type: float
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:   [1]
Coordinates: 
(0)     3.1415
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