\hypertarget{namespacedc__args}{}\section{dc\+\_\+args Module Reference}
\label{namespacedc__args}\index{dc\+\_\+args@{dc\+\_\+args}}
\subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \hyperlink{structdc__args_1_1args}{args}
\item 
interface \hyperlink{interfacedc__args_1_1close}{close}
\item 
type \hyperlink{structdc__args_1_1cmd__opts__internal}{cmd\+\_\+opts\+\_\+internal}
\item 
interface \hyperlink{interfacedc__args_1_1dcargsclose}{dcargsclose}
\item 
interface \hyperlink{interfacedc__args_1_1dcargsdebug}{dcargsdebug}
\item 
interface \hyperlink{interfacedc__args_1_1dcargsget}{dcargsget}
\item 
interface \hyperlink{interfacedc__args_1_1dcargshelp}{dcargshelp}
\item 
interface \hyperlink{interfacedc__args_1_1dcargshelpmsg}{dcargshelpmsg}
\item 
interface \hyperlink{interfacedc__args_1_1dcargsnumber}{dcargsnumber}
\item 
interface \hyperlink{interfacedc__args_1_1dcargsopen}{dcargsopen}
\item 
interface \hyperlink{interfacedc__args_1_1dcargsoption}{dcargsoption}
\item 
interface \hyperlink{interfacedc__args_1_1dcargsputline}{dcargsputline}
\item 
interface \hyperlink{interfacedc__args_1_1dcargsstrict}{dcargsstrict}
\item 
interface \hyperlink{interfacedc__args_1_1debug}{debug}
\item 
interface \hyperlink{interfacedc__args_1_1get}{get}
\item 
interface \hyperlink{interfacedc__args_1_1help}{help}
\item 
interface \hyperlink{interfacedc__args_1_1helpmsg}{helpmsg}
\item 
interface \hyperlink{interfacedc__args_1_1number}{number}
\item 
interface \hyperlink{interfacedc__args_1_1open}{open}
\item 
type \hyperlink{structdc__args_1_1opt__entry}{opt\+\_\+entry}
\item 
interface \hyperlink{interfacedc__args_1_1option}{option}
\item 
interface \hyperlink{interfacedc__args_1_1putline}{putline}
\item 
interface \hyperlink{interfacedc__args_1_1strict}{strict}
\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{namespacedc__args_a50cfb64e5e32afff6f70afdbc4e26ff0}{dcargsopen0} (arg)
\item 
subroutine \hyperlink{namespacedc__args_ad3d184f9be5d96db7f59c8280ea8f042}{dcargsclose0} (arg)
\item 
subroutine \hyperlink{namespacedc__args_a28f625a55c62aa292ec45fef0078c30f}{dcargsoption0} (arg, options, flag, value, \hyperlink{interfacedc__args_1_1help}{help})
\item 
subroutine \hyperlink{namespacedc__args_ac4e80e644bc0a2ba5ded73bcca8a0c57}{dcargsdebug0} (arg)
\item 
subroutine \hyperlink{namespacedc__args_ad1097d92c304755ae3cd0a340b1ac248}{dcargshelp0} (arg, force)
\item 
subroutine \hyperlink{namespacedc__args_ae5ff752ab4b70bf0dd9206c5864fb344}{dcargshelpmsg0} (arg, category, msg)
\item 
subroutine \hyperlink{namespacedc__args_a85955251b835fbb3762634f80bfadc27}{dcargsstrict0} (arg, severe)
\item 
subroutine \hyperlink{namespacedc__args_ad2d15d67c7ae86cc9311d07e45dd15b0}{dcargsget0} (arg, argv)
\item 
integer function \hyperlink{namespacedc__args_a929a54eeb190a2876ce1c812fec86030}{dcargsnumber0} (arg)
\item 
subroutine \hyperlink{namespacedc__args_a86350e000c60a6806a31fd10a793a3b2}{dcargsputline0} (arg)
\item 
subroutine \hyperlink{namespacedc__args_a6c576d61d454d0d2123a91e7d8de5064}{printautolinefeed} (unit, fmt, length, indent)
\item 
subroutine \hyperlink{namespacedc__args_ac158fcd69d646bcb497abe20736e293c}{sortargtable}
\item 
subroutine \hyperlink{namespacedc__args_a31717121547482396378366ae16a1c02}{buildargtable}
\item 
logical function \hyperlink{namespacedc__args_a6b2308cb2b18d7beb93c01f7b13f1283}{dcoptionformc} (argument, name, value)
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
character(string), dimension(\+:), allocatable, save \hyperlink{namespacedc__args_a197dcdb092658915066c8cb816c7ca0b}{argstr\+\_\+table}
\item 
integer, save \hyperlink{namespacedc__args_af2e57d495bc0230ba6fdce4ec0f96dda}{argind\+\_\+count} = -\/1
\item 
type(\hyperlink{structdc__args_1_1cmd__opts__internal}{cmd\+\_\+opts\+\_\+internal}), dimension(\+:), allocatable, save \hyperlink{namespacedc__args_a8aaa8a8007c7b50b3718e4117550dec4}{cmd\+\_\+opts\+\_\+list}
\item 
character(string), dimension(\+:), allocatable, save \hyperlink{namespacedc__args_a9844e741b62e38fdf80245ec7e9316eb}{cmd\+\_\+argv\+\_\+list}
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacedc__args_a31717121547482396378366ae16a1c02}\label{namespacedc__args_a31717121547482396378366ae16a1c02}} 
\index{dc\+\_\+args@{dc\+\_\+args}!buildargtable@{buildargtable}}
\index{buildargtable@{buildargtable}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{buildargtable()}{buildargtable()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::buildargtable (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Definition at line 1003 of file dc\+\_\+args.\+f90.



References argind\+\_\+count, argstr\+\_\+table, dc\+\_\+types\+::string, sysdepargcount(), and sysdepargget().



Referenced by dcargsopen0().


\begin{DoxyCode}
1003     \textcolor{comment}{!}
1004     \textcolor{comment}{! 内部向けコマンドライン引数処理のサブルーチンです. }
1005     \textcolor{comment}{!}
1006     \textcolor{comment}{! モジュール sysdep の sysdep#SysdepArgCount, sysdep#ArgGet}
1007     \textcolor{comment}{! を呼び出し, その内容を argind\_count と argstr\_table に格納します.}
1008     \textcolor{comment}{!}
1009     \textcolor{comment}{! 既に一度でも呼ばれている場合, 何もせずに終了します.}
1010     \textcolor{comment}{!}
1011     \textcolor{keywordtype}{use }\hyperlink{namespacesysdep}{sysdep}\textcolor{keywordtype}{, only}: \hyperlink{sysdeparg_8f90_a73f7569571f2308370f18694422da02d}{sysdepargcount}, \hyperlink{sysdeparg_8f90_a15dbaab23e370650f4a5e4f1a401b616}{sysdepargget}
1012     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
1013     \textcolor{keywordtype}{implicit none}
1014     \textcolor{keywordtype}{integer}:: i, narg, nargmax
1015     \textcolor{keywordtype}{character(len = STRING)}:: value
1016     \textcolor{keywordtype}{character(len = STRING)}, \textcolor{keywordtype}{allocatable}:: localtab(:)
1017   \textcolor{keywordflow}{continue}
1018     \textcolor{keywordflow}{if} (argind\_count >= 0) \textcolor{keywordflow}{return}
1019     nargmax = \hyperlink{sysdeparg_8f90_a73f7569571f2308370f18694422da02d}{sysdepargcount}()
1020     \textcolor{keyword}{allocate}(localtab(nargmax))
1021     narg = 0
1022     \textcolor{keywordflow}{do}, i = 1, nargmax
1023       \textcolor{keyword}{call }\hyperlink{sysdeparg_8f90_a15dbaab23e370650f4a5e4f1a401b616}{sysdepargget}(i, \textcolor{keywordtype}{value})
1024       narg = narg + 1
1025       localtab(narg) = \textcolor{keywordtype}{value}
1026 \textcolor{keywordflow}{    enddo}
1027     argind\_count = narg
1028     \textcolor{keyword}{allocate}(argstr\_table(narg))
1029     argstr\_table(1: narg) = localtab(1: narg)
1030     \textcolor{keyword}{deallocate}(localtab)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{namespacedc__args_a31717121547482396378366ae16a1c02_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=341pt]{namespacedc__args_a31717121547482396378366ae16a1c02_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_ad3d184f9be5d96db7f59c8280ea8f042}\label{namespacedc__args_ad3d184f9be5d96db7f59c8280ea8f042}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargsclose0@{dcargsclose0}}
\index{dcargsclose0@{dcargsclose0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargsclose0()}{dcargsclose0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::dcargsclose0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(inout)}]{arg }\end{DoxyParamCaption})}



Definition at line 368 of file dc\+\_\+args.\+f90.



References argstr\+\_\+table, cmd\+\_\+argv\+\_\+list, and cmd\+\_\+opts\+\_\+list.


\begin{DoxyCode}
368     \textcolor{comment}{!}
369     \textcolor{comment}{! ARGS 型の変数の終了処理を行います. }
370     \textcolor{comment}{!}
371     \textcolor{keywordtype}{use }\hyperlink{namespacedc__hash}{dc\_hash}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__hash_1_1dchashdelete}{dchashdelete}
372     \textcolor{keywordtype}{implicit none}
373     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(inout)} :: arg
374     \textcolor{keywordtype}{integer} :: i
375   \textcolor{keywordflow}{continue}
376     \textcolor{keywordflow}{if} (arg % initialized) \textcolor{keywordflow}{then}
377       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( arg % opt\_table ) ) \textcolor{keywordflow}{then}
378         \textcolor{keywordflow}{do} i = 1, \textcolor{keyword}{size}(arg % opt\_table)
379           \textcolor{keyword}{deallocate}(arg % opt\_table(i) % options)
380 \textcolor{keywordflow}{        end do}
381 
382         \textcolor{keyword}{deallocate}(arg % opt\_table)
383 \textcolor{keywordflow}{      end if}
384 
385       \textcolor{keyword}{deallocate}(arg % cmd\_opts\_list)
386       \textcolor{keyword}{deallocate}(argstr\_table)
387       \textcolor{keyword}{deallocate}(cmd\_argv\_list)
388       \textcolor{keyword}{deallocate}(cmd\_opts\_list)
389 
390       \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashdelete}{dchashdelete}(arg % helpmsg)
391 \textcolor{keywordflow}{    end if}
\end{DoxyCode}
\mbox{\Hypertarget{namespacedc__args_ac4e80e644bc0a2ba5ded73bcca8a0c57}\label{namespacedc__args_ac4e80e644bc0a2ba5ded73bcca8a0c57}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargsdebug0@{dcargsdebug0}}
\index{dcargsdebug0@{dcargsdebug0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargsdebug0()}{dcargsdebug0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::dcargsdebug0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(inout)}]{arg }\end{DoxyParamCaption})}



Definition at line 521 of file dc\+\_\+args.\+f90.



References dc\+\_\+trace\+::setdebug(), and dc\+\_\+types\+::string.


\begin{DoxyCode}
521     \textcolor{comment}{!}
522     \textcolor{comment}{! デバッグオプションの自動設定を行います. }
523     \textcolor{comment}{!}
524     \textcolor{comment}{! -D もしくは --debug が指定された際, 自動的に}
525     \textcolor{comment}{! dc\_trace#SetDebug を呼び出すよう *arg* を設定します.}
526     \textcolor{comment}{!}
527     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
528     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1stoa}{stoa}, \hyperlink{interfacedc__string_1_1stoi}{stoi}
529     \textcolor{keywordtype}{use }\hyperlink{namespacedc__trace}{dc\_trace}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__trace_a2482de8a6d7c583f851677ed1a17c240}{setdebug}
530     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
531     \textcolor{keywordtype}{implicit none}
532     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(inout)} :: arg
533     \textcolor{keywordtype}{logical} :: opt\_debug
534     \textcolor{keywordtype}{character(STRING)} :: val\_debug
535     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter}  :: subname = \textcolor{stringliteral}{'DCArgsDebug'}
536   \textcolor{keywordflow}{continue}
537     \textcolor{keywordflow}{if} (.not. arg % initialized) \textcolor{keywordflow}{then}
538       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Call Open before Debug in dc\_args.'})
539       \textcolor{keyword}{call }dcargsopen(arg)
540 \textcolor{keywordflow}{    end if}
541     \textcolor{keyword}{call }option(arg, \hyperlink{interfacedc__string_1_1stoa}{stoa}(\textcolor{stringliteral}{'-D'}, \textcolor{stringliteral}{'--debug'}), opt\_debug, val\_debug, &
542       & help=\textcolor{stringliteral}{"call dc\_trace#SetDebug (display a lot of messages for debug). "} // &
543       & \textcolor{stringliteral}{"VAL is unit number (default is standard output)"})
544     \textcolor{keywordflow}{if} (opt\_debug) \textcolor{keywordflow}{then}
545       \textcolor{keywordflow}{if} (trim(val\_debug) == \textcolor{stringliteral}{''}) \textcolor{keywordflow}{then}
546         \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2482de8a6d7c583f851677ed1a17c240}{setdebug}
547       \textcolor{keywordflow}{else}
548         \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2482de8a6d7c583f851677ed1a17c240}{setdebug}(\hyperlink{interfacedc__string_1_1stoi}{stoi}(val\_debug))
549 \textcolor{keywordflow}{      end if}
550 \textcolor{keywordflow}{    end if}
551     \textcolor{keywordflow}{return}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=334pt]{namespacedc__args_ac4e80e644bc0a2ba5ded73bcca8a0c57_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_ad2d15d67c7ae86cc9311d07e45dd15b0}\label{namespacedc__args_ad2d15d67c7ae86cc9311d07e45dd15b0}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargsget0@{dcargsget0}}
\index{dcargsget0@{dcargsget0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargsget0()}{dcargsget0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::dcargsget0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(inout)}]{arg,  }\item[{character($\ast$), dimension(\+:), pointer}]{argv }\end{DoxyParamCaption})}



Definition at line 789 of file dc\+\_\+args.\+f90.



References cmd\+\_\+argv\+\_\+list, dc\+\_\+string\+::joinchar(), dc\+\_\+present\+::present\+\_\+and\+\_\+true(), and dc\+\_\+types\+::string.


\begin{DoxyCode}
789     \textcolor{comment}{!}
790     \textcolor{comment}{! コマンドライン引数のうち, オプションではないものを}
791     \textcolor{comment}{! *argv* に返します.}
792     \textcolor{comment}{!}
793     \textcolor{comment}{! *argv* は文字型配列のポインタです.}
794     \textcolor{comment}{! 引数として与える場合には必ず空状態して与えてください.}
795     \textcolor{comment}{!}
796     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
797     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1stoa}{stoa}, \hyperlink{interfacedc__string_1_1stoi}{stoi}, \hyperlink{interfacedc__string_1_1printf}{printf}, \hyperlink{interfacedc__string_1_1concat}{concat}, 
      \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}
798     \textcolor{keywordtype}{use }\hyperlink{namespacedc__present}{dc\_present}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}
799     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
800     \textcolor{keywordtype}{implicit none}
801     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(inout)} :: arg
802     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{pointer} :: argv(:) \textcolor{comment}{!(out)}
803     \textcolor{keywordtype}{integer} :: i, cmd\_argv\_max
804     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter}  :: subname = \textcolor{stringliteral}{'DCArgsGet'}
805   \textcolor{keywordflow}{continue}
806     \textcolor{keywordflow}{if} (.not. arg % initialized) \textcolor{keywordflow}{then}
807       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Call Open before Help in dc\_args.'})
808       \textcolor{keyword}{call }dcargsopen(arg)
809 \textcolor{keywordflow}{    end if}
810     cmd\_argv\_max = \textcolor{keyword}{size}(cmd\_argv\_list)
811     \textcolor{keyword}{allocate}(argv(cmd\_argv\_max))
812     \textcolor{keywordflow}{do} i = 1, cmd\_argv\_max
813       argv(i) = cmd\_argv\_list(i)
814 \textcolor{keywordflow}{    end do}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=324pt]{namespacedc__args_ad2d15d67c7ae86cc9311d07e45dd15b0_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_ad1097d92c304755ae3cd0a340b1ac248}\label{namespacedc__args_ad1097d92c304755ae3cd0a340b1ac248}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargshelp0@{dcargshelp0}}
\index{dcargshelp0@{dcargshelp0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargshelp0()}{dcargshelp0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::dcargshelp0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(inout)}]{arg,  }\item[{logical, intent(in), optional}]{force }\end{DoxyParamCaption})}



Definition at line 556 of file dc\+\_\+args.\+f90.



References dc\+\_\+string\+::joinchar(), dc\+\_\+present\+::present\+\_\+and\+\_\+true(), printautolinefeed(), dc\+\_\+types\+::stdout, and dc\+\_\+types\+::string.


\begin{DoxyCode}
556     \textcolor{comment}{!}
557     \textcolor{comment}{! ヘルプオプションの自動設定を行います. }
558     \textcolor{comment}{!}
559     \textcolor{comment}{! -h, -H, --help のいづれかが指定された際, 自動的に *arg* 内に設定された}
560     \textcolor{comment}{! 情報をヘルプメッセージとして表示した後, プログラムを終了させます.}
561     \textcolor{comment}{! 原則的に, このサブルーチンよりも前に DCArgsOption, DCArgsDebug }
562     \textcolor{comment}{! のサブルーチンを呼んで下さい.}
563     \textcolor{comment}{!}
564     \textcolor{comment}{! *force* に .true. が指定される場合, -H, --help オプションが与え}
565     \textcolor{comment}{! られない場合でもヘルプメッセージを表示した後, プログラムを終了さ}
566     \textcolor{comment}{! せます.}
567     \textcolor{comment}{!}
568     \textcolor{comment}{! ヘルプメッセージに表示される情報は, DCArgsOption, DCArgsHelpMsg}
569     \textcolor{comment}{! サブルーチンによって付加することが可能です.}
570     \textcolor{comment}{!}
571     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
572     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1stoa}{stoa}, \hyperlink{interfacedc__string_1_1stoi}{stoi}, \hyperlink{interfacedc__string_1_1printf}{printf}, \hyperlink{interfacedc__string_1_1concat}{concat}, 
      \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}, \hyperlink{interfacedc__string_1_1uchar}{uchar}, \hyperlink{interfacedc__string_1_1lchar}{lchar}
573     \textcolor{keywordtype}{use }\hyperlink{namespacedc__present}{dc\_present}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}
574     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
575     \textcolor{keywordtype}{use }\hyperlink{namespacedc__hash}{dc\_hash}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__hash_1_1dchashget}{dchashget}, \hyperlink{interfacedc__hash_1_1dchashdelete}{dchashdelete}, 
      \hyperlink{interfacedc__hash_1_1dchashrewind}{dchashrewind}, \hyperlink{interfacedc__hash_1_1dchashnext}{dchashnext}
576     \textcolor{keywordtype}{implicit none}
577     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(inout)} :: arg
578     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional} :: force
579     \textcolor{keywordtype}{logical} :: opt\_help, found, end
580     \textcolor{keywordtype}{character(STRING)} :: val\_help, options\_msg, help\_msg, category
581     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{pointer} :: localopts(:) => null()
582     \textcolor{keywordtype}{integer} :: unit, i
583     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter}  :: subname = \textcolor{stringliteral}{'DCArgsHelp'}
584   \textcolor{keywordflow}{continue}
585     \textcolor{keywordflow}{if} (.not. arg % initialized) \textcolor{keywordflow}{then}
586       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Call Open before Help in dc\_args.'})
587       \textcolor{keyword}{call }dcargsopen(arg)
588 \textcolor{keywordflow}{    end if}
589     \textcolor{keyword}{call }dcargsoption(arg, \hyperlink{interfacedc__string_1_1stoa}{stoa}(\textcolor{stringliteral}{'-h'}, \textcolor{stringliteral}{'-H'}, \textcolor{stringliteral}{'--help'}), opt\_help, val\_help, &
590       & help=\textcolor{stringliteral}{"display this help and exit. "} // &
591       & \textcolor{stringliteral}{"VAL is unit number (default is standard output)"})
592     \textcolor{keywordflow}{if} (.not. opt\_help .and. .not. \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}(force)) \textcolor{keywordflow}{then}
593       \textcolor{keywordflow}{return}
594 \textcolor{keywordflow}{    end if}
595     \textcolor{keywordflow}{if} (trim(val\_help) == \textcolor{stringliteral}{''}) \textcolor{keywordflow}{then}
596       unit = \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
597     \textcolor{keywordflow}{else}
598       unit = \hyperlink{interfacedc__string_1_1stoi}{stoi}(val\_help)
599 \textcolor{keywordflow}{    end if}
600 
601     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{''})
602 
603     \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashget}{dchashget}(arg % helpmsg, \textcolor{stringliteral}{'TITLE'}, help\_msg, found)
604     \textcolor{keywordflow}{if} (found) \textcolor{keywordflow}{then}
605       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{'%c'}, c1=trim(help\_msg))
606       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{''})
607       \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashdelete}{dchashdelete}(arg % helpmsg, \textcolor{stringliteral}{'TITLE'})
608 \textcolor{keywordflow}{    end if}
609 
610     \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashget}{dchashget}(arg % helpmsg, \textcolor{stringliteral}{'OVERVIEW'}, help\_msg, found)
611     \textcolor{keywordflow}{if} (found) \textcolor{keywordflow}{then}
612       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{'Overview::'})
613       \textcolor{keyword}{call }printautolinefeed(unit, help\_msg, indent=\textcolor{stringliteral}{'     '})
614       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{''})
615       \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashdelete}{dchashdelete}(arg % helpmsg, \textcolor{stringliteral}{'OVERVIEW'})
616 \textcolor{keywordflow}{    end if}
617 
618     \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashget}{dchashget}(arg % helpmsg, \textcolor{stringliteral}{'USAGE'}, help\_msg, found)
619     \textcolor{keywordflow}{if} (found) \textcolor{keywordflow}{then}
620       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{'Usage::'})
621       \textcolor{keyword}{call }printautolinefeed(unit, help\_msg, indent=\textcolor{stringliteral}{'     '})
622       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{''})
623       \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashdelete}{dchashdelete}(arg % helpmsg, \textcolor{stringliteral}{'USAGE'})
624 \textcolor{keywordflow}{    end if}
625 
626     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{'Options::'})
627     \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}(arg % opt\_table) ) \textcolor{keywordflow}{then}
628       \textcolor{keywordflow}{do} i = 1, \textcolor{keyword}{size}(arg % opt\_table)
629         options\_msg = \textcolor{stringliteral}{' '}
630         \textcolor{keywordflow}{if} (arg % opt\_table(i) % optvalue\_flag) \textcolor{keywordflow}{then}
631           \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1concat}{concat}(arg % opt\_table(i) % options, \textcolor{stringliteral}{'=VAL'}, localopts)
632         \textcolor{keywordflow}{else}
633           \textcolor{keyword}{allocate}(localopts(\textcolor{keyword}{size}(arg % opt\_table(i) % options)))
634           localopts = arg % opt\_table(i) % options
635 \textcolor{keywordflow}{        end if}
636         options\_msg = trim(options\_msg) // trim(\hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}(localopts))
637         \textcolor{keyword}{deallocate}(localopts)
638         \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{' %c'}, c1=trim(options\_msg))
639         \textcolor{keyword}{call }printautolinefeed(unit, &
640           & arg % opt\_table(i) % help\_message, indent=\textcolor{stringliteral}{'     '})
641         \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{''})
642 \textcolor{keywordflow}{      end do}
643 \textcolor{keywordflow}{    end if}
644 
645     \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashrewind}{dchashrewind}(arg % helpmsg)
646     \textcolor{keywordflow}{do}
647       \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashnext}{dchashnext}(arg % helpmsg, category, help\_msg, end)
648       \textcolor{keywordflow}{if} (end) \textcolor{keywordflow}{exit}
649 
650       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{'%c%c::'}, &
651         & c1=trim(\hyperlink{interfacedc__string_1_1uchar}{uchar}(category(1:1))), c2=trim(\hyperlink{interfacedc__string_1_1lchar}{lchar}(category(2:))))
652       \textcolor{keyword}{call }printautolinefeed(unit, help\_msg, indent=\textcolor{stringliteral}{'     '})
653       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(unit, \textcolor{stringliteral}{''})
654 
655 \textcolor{keywordflow}{    enddo}
656 
657     \textcolor{keyword}{call }dcargsclose(arg)
658 
659     stop
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{namespacedc__args_ad1097d92c304755ae3cd0a340b1ac248_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_ae5ff752ab4b70bf0dd9206c5864fb344}\label{namespacedc__args_ae5ff752ab4b70bf0dd9206c5864fb344}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargshelpmsg0@{dcargshelpmsg0}}
\index{dcargshelpmsg0@{dcargshelpmsg0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargshelpmsg0()}{dcargshelpmsg0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::dcargshelpmsg0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(inout)}]{arg,  }\item[{character($\ast$), intent(in)}]{category,  }\item[{character($\ast$), intent(in)}]{msg }\end{DoxyParamCaption})}



Definition at line 663 of file dc\+\_\+args.\+f90.


\begin{DoxyCode}
663     \textcolor{comment}{!}
664     \textcolor{comment}{! ヘルプメッセージを追加します. }
665     \textcolor{comment}{!}
666     \textcolor{comment}{! サブルーチン DCArgsHelp を使用した際に出力されるメッセージを}
667     \textcolor{comment}{! 付加します. *category* に +Title+, +Overview+, +Usage+ が}
668     \textcolor{comment}{! 指定されたものは +Options+ よりも上部に,}
669     \textcolor{comment}{! それ以外のものは下部に表示されます.}
670     \textcolor{comment}{! *msg* にはメッセージを与えてください.}
671     \textcolor{comment}{!}
672     \textcolor{comment}{!=== 例}
673     \textcolor{comment}{!}
674     \textcolor{comment}{!     program dc\_args\_sample3}
675     \textcolor{comment}{!       use dc\_types}
676     \textcolor{comment}{!       use dc\_string, only: StoA}
677     \textcolor{comment}{!       use dc\_args}
678     \textcolor{comment}{!       implicit none}
679     \textcolor{comment}{!       type(ARGS) :: arg}
680     \textcolor{comment}{!       logical :: OPT\_namelist}
681     \textcolor{comment}{!       character(STRING) :: VAL\_namelist}
682     \textcolor{comment}{!       character(STRING), pointer :: argv(:) => null()}
683     \textcolor{comment}{!       integer :: i}
684     \textcolor{comment}{!}
685     \textcolor{comment}{!       call DCArgsOpen( arg = arg )   ! (out)}
686     \textcolor{comment}{!       call DCArgsHelpMsg( arg = arg, &              ! (inout)}
687     \textcolor{comment}{!         & category = 'Title', &                     ! (in)}
688     \textcolor{comment}{!         & msg = 'dcargs $Revision: 1.2 $ ' // &}
689     \textcolor{comment}{!         &       ':: Test program of dc\_args' )      ! (in)}
690     \textcolor{comment}{!       call DCArgsHelpMsg( arg = arg, &              ! (inout)}
691     \textcolor{comment}{!         & category = 'Usage', &                     ! (in)}
692     \textcolor{comment}{!         & msg = 'dcargs [Options] arg1, arg2, ...') ! (in)}
693     \textcolor{comment}{!       call DCArgsOption( arg = arg, &           ! (inout)}
694     \textcolor{comment}{!         & options = StoA('-N', '--namelist'), & ! (in)}
695     \textcolor{comment}{!         & flag = OPT\_namelist, &                ! (out)}
696     \textcolor{comment}{!         & value = VAL\_namelist, &               ! (out)}
697     \textcolor{comment}{!         & help = "Namelist filename")           ! (in)}
698     \textcolor{comment}{!       call DCArgsHelpMsg( arg = arg, &          ! (inout)}
699     \textcolor{comment}{!         & category = 'DESCRIPTION', &           ! (in)}
700     \textcolor{comment}{!         & msg = '(1) Define type "HASH". ' // &}
701     \textcolor{comment}{!         &       '(2) Open the variable. ' // &}
702     \textcolor{comment}{!         &       '(3) set HelpMsg. ' // &}
703     \textcolor{comment}{!         &       '(4) set Options. ' // &}
704     \textcolor{comment}{!         &       '(5) call Debug. ' // &}
705     \textcolor{comment}{!         &       '(6) call Help. ' // &}
706     \textcolor{comment}{!         &       '(7) call Strict.')             ! (in)}
707     \textcolor{comment}{!       call DCArgsHelpMsg( arg = arg, &                         ! (inout)}
708     \textcolor{comment}{!         & category = 'Copyright', &                            ! (in)}
709     \textcolor{comment}{!         & msg = 'Copyright (C) ' // &}
710     \textcolor{comment}{!         &       'GFD Dennou Club, 2008. All rights reserved.') ! (in)}
711     \textcolor{comment}{!       call DCArgsDebug( arg = arg )  ! (inout)}
712     \textcolor{comment}{!       call DCArgsHelp( arg = arg )   ! (inout)}
713     \textcolor{comment}{!       call DCArgsStrict( arg = arg ) ! (inout)}
714     \textcolor{comment}{!       call DCArgsGet( arg = arg, &   ! (inout)}
715     \textcolor{comment}{!         & argv = argv )              ! (out)}
716     \textcolor{comment}{!       write(*,*) '--namelist=', trim( VAL\_namelist )}
717     \textcolor{comment}{!       do i = 1, size(argv)}
718     \textcolor{comment}{!         write(*,*) argv(i)}
719     \textcolor{comment}{!       end do}
720     \textcolor{comment}{!       deallocate( argv )}
721     \textcolor{comment}{!       call DCArgsClose( arg = arg )  ! (inout)}
722     \textcolor{comment}{!     program dc\_args\_sample3}
723     \textcolor{comment}{!}
724     \textcolor{comment}{! コマンドライン引数に '-h', '-H', '--help' のいづれかのオプション}
725     \textcolor{comment}{! を指定することで, HelpMsg で与えたメッセージと, オプションの一覧}
726     \textcolor{comment}{! が標準出力に表示されます.}
727     \textcolor{comment}{!}
728     \textcolor{keywordtype}{use }\hyperlink{namespacedc__hash}{dc\_hash}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__hash_1_1dchashput}{dchashput}
729     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1uchar}{uchar}
730     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
731     \textcolor{keywordtype}{implicit none}
732     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(inout)} :: arg
733     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)} :: category
734     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)} :: msg
735     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter}  :: subname = \textcolor{stringliteral}{'DCArgsHelpMsg'}
736   \textcolor{keywordflow}{continue}
737     \textcolor{keywordflow}{if} (.not. arg % initialized) \textcolor{keywordflow}{then}
738       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Call Open before Help in dc\_args.'})
739       \textcolor{keyword}{call }dcargsopen(arg)
740 \textcolor{keywordflow}{    end if}
741     \textcolor{keyword}{call }\hyperlink{interfacedc__hash_1_1dchashput}{dchashput}(arg % helpmsg, key=\hyperlink{interfacedc__string_1_1uchar}{uchar}(category), \textcolor{keywordtype}{value}=msg)
\end{DoxyCode}
\mbox{\Hypertarget{namespacedc__args_a929a54eeb190a2876ce1c812fec86030}\label{namespacedc__args_a929a54eeb190a2876ce1c812fec86030}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargsnumber0@{dcargsnumber0}}
\index{dcargsnumber0@{dcargsnumber0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargsnumber0()}{dcargsnumber0()}}
{\footnotesize\ttfamily integer function dc\+\_\+args\+::dcargsnumber0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(inout)}]{arg }\end{DoxyParamCaption})}



Definition at line 818 of file dc\+\_\+args.\+f90.



References cmd\+\_\+argv\+\_\+list.


\begin{DoxyCode}
818     \textcolor{comment}{!}
819     \textcolor{comment}{! コマンドライン引数として与えられた引数の数を返します.}
820     \textcolor{comment}{!}
821     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
822     \textcolor{keywordtype}{implicit none}
823     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(inout)} :: arg
824     \textcolor{keywordtype}{integer} :: result
825     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter}  :: subname = \textcolor{stringliteral}{'DCArgsNumber'}
826   \textcolor{keywordflow}{continue}
827     \textcolor{keywordflow}{if} (.not. arg % initialized) \textcolor{keywordflow}{then}
828       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Call Open before Help in dc\_args.'})
829       \textcolor{keyword}{call }dcargsopen(arg)
830 \textcolor{keywordflow}{    end if}
831     result = \textcolor{keyword}{size}(cmd\_argv\_list)
\end{DoxyCode}
\mbox{\Hypertarget{namespacedc__args_a50cfb64e5e32afff6f70afdbc4e26ff0}\label{namespacedc__args_a50cfb64e5e32afff6f70afdbc4e26ff0}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargsopen0@{dcargsopen0}}
\index{dcargsopen0@{dcargsopen0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargsopen0()}{dcargsopen0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::dcargsopen0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(out)}]{arg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 337 of file dc\+\_\+args.\+f90.



References buildargtable(), cmd\+\_\+opts\+\_\+list, sortargtable(), and dc\+\_\+types\+::string.


\begin{DoxyCode}
337     \textcolor{comment}{!}
338     \textcolor{comment}{! ARGS 型の変数を初期設定します. }
339     \textcolor{comment}{!}
340     \textcolor{comment}{! ARGS 型の変数を利用する際にはまずこのサブルーチンによって}
341     \textcolor{comment}{! 初期設定を行ってください.}
342     \textcolor{comment}{!}
343     \textcolor{comment}{! このサブルーチンは, より下層のサブルーチン内で IARGC や GETARG}
344     \textcolor{comment}{! を用いて得られたコマンドライン引数の情報を引数 *arg*}
345     \textcolor{comment}{! へと格納します.}
346     \textcolor{comment}{!}
347     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
348     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
349     \textcolor{keywordtype}{implicit none}
350     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(out)} :: arg
351     \textcolor{keywordtype}{integer}:: cmd\_opts\_max
352     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter} :: subname = \textcolor{stringliteral}{'DCArgsOpen'}
353   \textcolor{keywordflow}{continue}
354     \textcolor{keywordflow}{if} (arg % initialized) \textcolor{keywordflow}{then}
355       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'This argument (type ARGS) is already opend.'})
356       \textcolor{keywordflow}{return}
357 \textcolor{keywordflow}{    end if}
358     \textcolor{keyword}{call }buildargtable
359     \textcolor{keyword}{call }sortargtable
360     cmd\_opts\_max = \textcolor{keyword}{size}(cmd\_opts\_list)
361     \textcolor{keyword}{allocate}(arg % cmd\_opts\_list(cmd\_opts\_max))
362     arg % cmd\_opts\_list = cmd\_opts\_list
363     \textcolor{keyword}{nullify}( arg % opt\_table )
364     arg % initialized = .true.
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{namespacedc__args_a50cfb64e5e32afff6f70afdbc4e26ff0_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_a28f625a55c62aa292ec45fef0078c30f}\label{namespacedc__args_a28f625a55c62aa292ec45fef0078c30f}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargsoption0@{dcargsoption0}}
\index{dcargsoption0@{dcargsoption0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargsoption0()}{dcargsoption0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::dcargsoption0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(inout)}]{arg,  }\item[{character(len = $\ast$), dimension(\+:), intent(in)}]{options,  }\item[{logical, intent(out)}]{flag,  }\item[{character(len = $\ast$), intent(out), optional}]{value,  }\item[{character(len = $\ast$), intent(in), optional}]{help }\end{DoxyParamCaption})}



Definition at line 395 of file dc\+\_\+args.\+f90.



References dcoptionformc().


\begin{DoxyCode}
395     \textcolor{comment}{!}
396     \textcolor{comment}{! オプション情報の登録と取得を行います. }
397     \textcolor{comment}{!}
398     \textcolor{comment}{! コマンドライン引数のうち, *options* に与えるオプションに関する情}
399     \textcolor{comment}{! 報を *flag* と *value* に取得します. *options* がコマンドライン}
400     \textcolor{comment}{! 引数に与えられていれば *flag* に .true. が, そうでない場合は }
401     \textcolor{comment}{! .false. が返ります. オプションに値が指定される場合は *value* に}
402     \textcolor{comment}{! その値が返ります. オプション自体が与えられていない場合には}
403     \textcolor{comment}{! *value* には空文字が返ります.}
404     \textcolor{comment}{!}
405     \textcolor{comment}{! *help* には *options* に関するヘルプメッセージを *arg* に}
406     \textcolor{comment}{! 登録します. サブルーチン DCArgsHelp を}
407     \textcolor{comment}{! 用いた際に, このメッセージが出力されます.}
408     \textcolor{comment}{! *value* を与えているかどうかでこのメッセージは変化します.}
409     \textcolor{comment}{!}
410     \textcolor{comment}{!=== オプションの書式}
411     \textcolor{comment}{!}
412     \textcolor{comment}{! コマンドライン引数のうち, オプションと判定されるのは以下の場合です.}
413     \textcolor{comment}{!}
414     \textcolor{comment}{! * 1 文字目が '-' の場合. この場合は短いオプションとなり, '-'}
415     \textcolor{comment}{!   の次の一文字のみがオプションとして有効になります.}
416     \textcolor{comment}{!}
417     \textcolor{comment}{! * 1-2文字目が '--' (ハイフン 2 文字) の場合.}
418     \textcolor{comment}{!   この場合は長いオプションとなり,}
419     \textcolor{comment}{!   '--' 以降の文字列がオプションとして有効になります.}
420     \textcolor{comment}{!}
421     \textcolor{comment}{! オプションの値は, "=" よりも後ろの文字列になります.}
422     \textcolor{comment}{!}
423     \textcolor{comment}{! 例}
424     \textcolor{comment}{!}
425     \textcolor{comment}{! <b>コマンドライン引数</b>  :: <b>オプション名, 値      </b>}
426     \textcolor{comment}{! -h                         ::    -h,           無し}
427     \textcolor{comment}{! --help                     ::    --help,       無し}
428     \textcolor{comment}{! -D=6                       ::    -D,            6}
429     \textcolor{comment}{! -debug=                    ::    -d,           無し}
430     \textcolor{comment}{! --include=/usr             ::    --include,    /usr}
431     \textcolor{comment}{!}
432 
433     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
434     \textcolor{keywordtype}{implicit none}
435     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(inout)} :: arg
436     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)} :: options(:)
437     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)} :: flag
438     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional} :: value
439     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional} :: help
440     \textcolor{keywordtype}{integer} :: i, j, options\_size, table\_size
441     \textcolor{keywordtype}{type}(opt\_entry), \textcolor{keywordtype}{allocatable} :: local\_tables(:)
442     \textcolor{keywordtype}{character(len = STRING)} :: opt\_name, opt\_value, opt\_full
443     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter}  :: subname = \textcolor{stringliteral}{'DCArgsOption'}
444   \textcolor{keywordflow}{continue}
445     flag = .false.
446     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(\textcolor{keywordtype}{value})) \textcolor{keywordtype}{value} = \textcolor{stringliteral}{''}
447     \textcolor{keywordflow}{if} (.not. arg % initialized) \textcolor{keywordflow}{then}
448       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Call Open before Option in dc\_args.'})
449       \textcolor{keyword}{call }dcargsopen(arg)
450 \textcolor{keywordflow}{    end if}
451     options\_size = \textcolor{keyword}{size}(options)
452     \textcolor{keywordflow}{if} (options\_size < 1) \textcolor{keywordflow}{then}
453       \textcolor{keywordflow}{return}
454 \textcolor{keywordflow}{    end if}
455 
456     \textcolor{comment}{!-----------------------------------}
457     \textcolor{comment}{! 構造体 ARGS へのヘルプメッセージ用の情報登録}
458     \textcolor{comment}{! * まずはテーブル arg % opt\_table を一つ広げる.}
459     \textcolor{comment}{!-----------------------------------}
460     \textcolor{keywordflow}{if} ( .not. \textcolor{keyword}{associated}( arg % opt\_table ) ) \textcolor{keywordflow}{then}
461       \textcolor{comment}{! 1 つめのオプション指定}
462       \textcolor{comment}{!}
463       table\_size = 0
464       \textcolor{keyword}{allocate}(arg % opt\_table(table\_size + 1))
465     \textcolor{keywordflow}{else}
466       \textcolor{comment}{! 2 つめ以降のオプション指定}
467       \textcolor{comment}{!}
468       table\_size = \textcolor{keyword}{size}(arg % opt\_table)
469       \textcolor{keyword}{allocate}(local\_tables(table\_size))
470       local\_tables(1:table\_size) = arg % opt\_table(1:table\_size)
471       \textcolor{keyword}{deallocate}(arg % opt\_table)
472       \textcolor{keyword}{allocate}(arg % opt\_table(table\_size + 1))
473       arg % opt\_table(1:table\_size) = local\_tables(1:table\_size)
474       \textcolor{keyword}{deallocate}(local\_tables)
475 \textcolor{keywordflow}{    end if}
476 
477     \textcolor{comment}{!----- 値の代入 -----}
478     \textcolor{keyword}{allocate}(arg % opt\_table(table\_size + 1) % options(options\_size))
479     arg % opt\_table(table\_size + 1) % options = options
480     arg % opt\_table(table\_size + 1) % help\_message = \textcolor{stringliteral}{''}
481     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(help)) \textcolor{keywordflow}{then}
482       arg % opt\_table(table\_size + 1) % help\_message = help
483 \textcolor{keywordflow}{    end if}
484     arg % opt\_table(table\_size + 1) % optvalue\_flag = \textcolor{keyword}{present}(\textcolor{keywordtype}{value})
485 
486 
487     \textcolor{comment}{!----- options の正規化 -----}
488     \textcolor{keywordflow}{do} i = 1, options\_size
489       opt\_full = arg % opt\_table(table\_size + 1) % options(i)
490       \textcolor{keywordflow}{if} (dcoptionformc(opt\_full, opt\_name, opt\_value)) \textcolor{keywordflow}{then}
491         arg % opt\_table(table\_size + 1) % options(i) = opt\_name
492       \textcolor{keywordflow}{else}
493         \textcolor{keywordflow}{if} (len(trim(adjustl(opt\_full))) < 2) \textcolor{keywordflow}{then}
494           arg % opt\_table(table\_size + 1) % options(i) = &
495             & \textcolor{stringliteral}{'-'} // trim(adjustl(opt\_full))
496         \textcolor{keywordflow}{else}
497           arg % opt\_table(table\_size + 1) % options(i) = &
498             & \textcolor{stringliteral}{'--'} // trim(adjustl(opt\_full))
499 \textcolor{keywordflow}{        end if}
500 \textcolor{keywordflow}{      end if}
501 \textcolor{keywordflow}{    end do}
502 
503     \textcolor{comment}{! arg % cmd\_opts\_list 内の探査と flag, value への代入}
504     \textcolor{comment}{! 呼ばれたものに関しては arg % cmd\_opts\_list % flag\_called を}
505     \textcolor{comment}{! .true. に}
506     \textcolor{keywordflow}{do} i = 1, options\_size
507       \textcolor{keywordflow}{do} j = 1, \textcolor{keyword}{size}(arg % cmd\_opts\_list)
508         \textcolor{keywordflow}{if} (trim(arg % opt\_table(table\_size + 1) % options(i)) &
509           &             == trim(arg % cmd\_opts\_list(j) % name)) \textcolor{keywordflow}{then}
510           flag = .true.
511           \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(\textcolor{keywordtype}{value})) \textcolor{keywordflow}{then}
512             \textcolor{keywordtype}{value} = arg % cmd\_opts\_list(j) % value
513 \textcolor{keywordflow}{          end if}
514           arg % cmd\_opts\_list(j) % flag\_called = .true.
515 \textcolor{keywordflow}{        end if}
516 \textcolor{keywordflow}{      end do}
517 \textcolor{keywordflow}{    end do}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{namespacedc__args_a28f625a55c62aa292ec45fef0078c30f_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_a86350e000c60a6806a31fd10a793a3b2}\label{namespacedc__args_a86350e000c60a6806a31fd10a793a3b2}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargsputline0@{dcargsputline0}}
\index{dcargsputline0@{dcargsputline0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargsputline0()}{dcargsputline0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::dcargsputline0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(in)}]{arg }\end{DoxyParamCaption})}



Definition at line 835 of file dc\+\_\+args.\+f90.



References cmd\+\_\+argv\+\_\+list, dc\+\_\+string\+::joinchar(), and dc\+\_\+types\+::stdout.


\begin{DoxyCode}
835     \textcolor{comment}{!}
836     \textcolor{comment}{! *arg* に関する情報を標準出力に表示します.}
837     \textcolor{comment}{!}
838     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
839     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1printf}{printf}, \hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}
840     \textcolor{keywordtype}{implicit none}
841     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(in)} :: arg
842     \textcolor{keywordtype}{integer} :: i
843   \textcolor{keywordflow}{continue}
844     \textcolor{keywordflow}{if} (.not. arg % initialized) \textcolor{keywordflow}{then}
845       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'#<ARGS:: @initialized=%y>'}, l=(/arg % initialized/))
846       \textcolor{keywordflow}{return}
847 \textcolor{keywordflow}{    end if}
848     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'#<ARGS:: @initialized=%y,'}, l=(/arg % initialized/))
849     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'  @opt\_table(:)='})
850     \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}(arg % opt\_table) ) \textcolor{keywordflow}{then}
851       \textcolor{keywordflow}{do} i = 1, \textcolor{keyword}{size}(arg % opt\_table)
852         \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'    #<OPT\_ENTRY:: '})
853         \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'      @options=%c, @help\_message=%c, @optvalue\_flag=%y'}, &
854           & c1=trim(\hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}(arg % opt\_table(i) % options)), &
855           & c2=trim(arg % opt\_table(i) % help\_message), &
856           & l=(/arg % opt\_table(i) % optvalue\_flag/))
857         \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'    >'})
858 \textcolor{keywordflow}{      end do}
859 \textcolor{keywordflow}{    end if}
860     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'  ,'})
861     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'  @cmd\_opts\_list(:)='})
862     \textcolor{keywordflow}{do} i = 1, \textcolor{keyword}{size}(arg % cmd\_opts\_list)
863       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'    #<CMD\_OPTS\_INTERNAL:: '})
864       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'      @name=%c, @value=%c, @flag\_called=%y'}, &
865         & c1=trim(arg % cmd\_opts\_list(i) % name), &
866         & c2=trim(arg % cmd\_opts\_list(i) % value), &
867         & l=(/arg % cmd\_opts\_list(i) % flag\_called/))
868       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'    >'})
869 \textcolor{keywordflow}{    end do}
870     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'  ,'})
871     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'  @cmd\_argv\_list(:)=%c'}, &
872       & c1=trim(\hyperlink{namespacedc__string_a20412554f8f648165d202319119cf628}{joinchar}(cmd\_argv\_list)))
873     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(\hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \textcolor{stringliteral}{'>'})
874 
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=332pt]{namespacedc__args_a86350e000c60a6806a31fd10a793a3b2_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_a85955251b835fbb3762634f80bfadc27}\label{namespacedc__args_a85955251b835fbb3762634f80bfadc27}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcargsstrict0@{dcargsstrict0}}
\index{dcargsstrict0@{dcargsstrict0}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcargsstrict0()}{dcargsstrict0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::dcargsstrict0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__args_1_1args}{args}), intent(inout)}]{arg,  }\item[{logical, intent(in), optional}]{severe }\end{DoxyParamCaption})}



Definition at line 746 of file dc\+\_\+args.\+f90.



References dc\+\_\+present\+::present\+\_\+and\+\_\+true(), and dc\+\_\+types\+::string.


\begin{DoxyCode}
746     \textcolor{comment}{!}
747     \textcolor{comment}{! オプションチェックを行います. }
748     \textcolor{comment}{!}
749     \textcolor{comment}{! コマンドライン引数のオプションとして指定されたものの内,}
750     \textcolor{comment}{! DCArgsOption サブルーチンで設定されていないものが存在する}
751     \textcolor{comment}{! 場合には警告を返します. *severe* に .true. を指定すると}
752     \textcolor{comment}{! エラーを返して終了します.}
753     \textcolor{comment}{! このサブルーチンを呼ぶ前に, DCArgsOption, DCArgsDebug, }
754     \textcolor{comment}{! DCArgsHelp サブルーチンを呼んでください.}
755     \textcolor{comment}{!}
756     \textcolor{comment}{! 構造体 ARGS の変数に対してこのサブルーチンを適用しておく}
757     \textcolor{comment}{! ことで, コマンドライン引数として与えたオプションが正しく}
758     \textcolor{comment}{! プログラムが認識しているかどうかをチェックすることができます.}
759     \textcolor{comment}{!}
760     \textcolor{comment}{!}
761     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
762     \textcolor{keywordtype}{use }\hyperlink{namespacedc__present}{dc\_present}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}
763     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
764     \textcolor{keywordtype}{implicit none}
765     \textcolor{keywordtype}{type}(args), \textcolor{keywordtype}{intent(inout)} :: arg
766     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional} :: severe
767     \textcolor{keywordtype}{character(STRING)} :: err\_mess
768     \textcolor{keywordtype}{integer} :: i
769     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{parameter}  :: subname = \textcolor{stringliteral}{'DCArgsStrict'}
770   \textcolor{keywordflow}{continue}
771     \textcolor{keywordflow}{if} (.not. arg % initialized) \textcolor{keywordflow}{then}
772       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Call Open before Help in dc\_args.'})
773       \textcolor{keyword}{call }dcargsopen(arg)
774 \textcolor{keywordflow}{    end if}
775     \textcolor{keywordflow}{do} i = 1, \textcolor{keyword}{size}(arg % cmd\_opts\_list)
776       err\_mess = trim(arg % cmd\_opts\_list(i) % name) // \textcolor{stringliteral}{' is invalid option.'}
777       \textcolor{keywordflow}{if} (.not. arg % cmd\_opts\_list(i) % flag\_called) \textcolor{keywordflow}{then}
778         \textcolor{keywordflow}{if} (\hyperlink{namespacedc__present_ab280582985ee69fda00e2a0bf09194af}{present\_and\_true}(severe)) \textcolor{keywordflow}{then}
779           \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'E'}, subname, err\_mess)
780         \textcolor{keywordflow}{else}
781           \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, err\_mess)
782 \textcolor{keywordflow}{        end if}
783 \textcolor{keywordflow}{      end if}
784 \textcolor{keywordflow}{    end do}
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=332pt]{namespacedc__args_a85955251b835fbb3762634f80bfadc27_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_a6b2308cb2b18d7beb93c01f7b13f1283}\label{namespacedc__args_a6b2308cb2b18d7beb93c01f7b13f1283}} 
\index{dc\+\_\+args@{dc\+\_\+args}!dcoptionformc@{dcoptionformc}}
\index{dcoptionformc@{dcoptionformc}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{dcoptionformc()}{dcoptionformc()}}
{\footnotesize\ttfamily logical function dc\+\_\+args\+::dcoptionformc (\begin{DoxyParamCaption}\item[{character(len = $\ast$), intent(in)}]{argument,  }\item[{character(len = $\ast$), intent(out)}]{name,  }\item[{character(len = $\ast$), intent(out)}]{value }\end{DoxyParamCaption})}



Definition at line 1034 of file dc\+\_\+args.\+f90.



Referenced by dcargsoption0(), and sortargtable().


\begin{DoxyCode}
1034     \textcolor{comment}{!}
1035     \textcolor{comment}{! 引数としてで得られた文字列を *argument* に渡すことで,}
1036     \textcolor{comment}{! それがオプションなのかそうでないのかを判別し, もしも}
1037     \textcolor{comment}{! オプションと判別した場合には戻り値に .true. を返し,}
1038     \textcolor{comment}{! name にオプション名, *value* にその値を返す.}
1039     \textcolor{comment}{! オプションに値が付加されない場合は *value* には空白を返す.}
1040     \textcolor{comment}{!}
1041     \textcolor{comment}{! オプションではない場合は戻り値に .false. を返し,}
1042     \textcolor{comment}{! *name*, *value* には空白を返す.}
1043     \textcolor{comment}{!}
1044     \textcolor{comment}{! オプションと判定されるのは以下の場合です.}
1045     \textcolor{comment}{!}
1046     \textcolor{comment}{! * 一文字目が '-' の場合. この場合は短いオプションとなり, '-'}
1047     \textcolor{comment}{!   の次の一文字のみがオプションとして有効になります.}
1048     \textcolor{comment}{!}
1049     \textcolor{comment}{! * 1-2文字目が '--' の場合. この場合は長いオプションとなり,}
1050     \textcolor{comment}{!   '--' 以降の文字列がオプションとして有効になります.}
1051     \textcolor{comment}{!}
1052     \textcolor{comment}{! オプションの値は, "=" よりも後ろの文字列になります.}
1053     \textcolor{comment}{!}
1054     \textcolor{comment}{!=== 例}
1055     \textcolor{comment}{!}
1056     \textcolor{comment}{! *argument*    :: <b>name,      value, 返り値</b>}
1057     \textcolor{comment}{! arg           ::    空白,      空白,  .false.}
1058     \textcolor{comment}{! -O            ::    -O,        空白,  .true.}
1059     \textcolor{comment}{! -debug        ::    -d,        空白,  .true.}
1060     \textcolor{comment}{! --debug       ::    --debug,   空白,  .true.}
1061     \textcolor{comment}{! -I=/usr       ::    -I,        /usr,  .true.}
1062     \textcolor{comment}{! --include=/usr::    --include, /usr,  .true.}
1063     \textcolor{comment}{!}
1064     \textcolor{keywordtype}{implicit none}
1065     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: argument
1066     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(out)}:: name, value
1067     \textcolor{keywordtype}{logical} :: result
1068     \textcolor{keywordtype}{integer}:: equal
1069   \textcolor{keywordflow}{continue}
1070     equal = index(argument, \textcolor{stringliteral}{'='})
1071     \textcolor{keywordflow}{if} (argument(1:1) == \textcolor{stringliteral}{'-'} .and. argument(2:2) /= \textcolor{stringliteral}{'-'}) \textcolor{keywordflow}{then}
1072       \textcolor{comment}{! Short Option}
1073       \textcolor{keywordflow}{if} (equal == 0) \textcolor{keywordflow}{then}
1074         name = argument(1:2)
1075         \textcolor{keywordtype}{value} = \textcolor{stringliteral}{""}
1076       \textcolor{keywordflow}{else}
1077         name = argument(1:2)
1078         \textcolor{keywordtype}{value} = argument(equal+1: )
1079 \textcolor{keywordflow}{      endif}
1080       result = .true.
1081     \textcolor{keywordflow}{elseif} (argument(1:2) == \textcolor{stringliteral}{'--'}) \textcolor{keywordflow}{then}
1082       \textcolor{comment}{! Long Option}
1083       \textcolor{keywordflow}{if} (equal == 0) \textcolor{keywordflow}{then}
1084         name = argument
1085         \textcolor{keywordtype}{value} = \textcolor{stringliteral}{""}
1086       \textcolor{keywordflow}{else}
1087         name = argument(1:equal-1)
1088         \textcolor{keywordtype}{value} = argument(equal+1: )
1089 \textcolor{keywordflow}{      endif}
1090       result = .true.
1091 \textcolor{comment}{!    elseif (equal == 0 .and. &}
1092 \textcolor{comment}{!      &     verify(argument(1:equal-1), WORDCHARS) == 0) then}
1093 \textcolor{comment}{!      ! ???}
1094 \textcolor{comment}{!      name = argument(1:equal-1)}
1095 \textcolor{comment}{!      value = argument(equal+1: )}
1096 \textcolor{comment}{!      result = .true.}
1097     \textcolor{keywordflow}{else}
1098       \textcolor{comment}{! No Option (normal arguments)}
1099       name = \textcolor{stringliteral}{""}
1100       \textcolor{keywordtype}{value} = \textcolor{stringliteral}{""}
1101       result = .false.
1102 \textcolor{keywordflow}{    endif}
\end{DoxyCode}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{namespacedc__args_a6b2308cb2b18d7beb93c01f7b13f1283_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_a6c576d61d454d0d2123a91e7d8de5064}\label{namespacedc__args_a6c576d61d454d0d2123a91e7d8de5064}} 
\index{dc\+\_\+args@{dc\+\_\+args}!printautolinefeed@{printautolinefeed}}
\index{printautolinefeed@{printautolinefeed}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{printautolinefeed()}{printautolinefeed()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::printautolinefeed (\begin{DoxyParamCaption}\item[{integer, intent(in), optional}]{unit,  }\item[{character($\ast$), intent(in)}]{fmt,  }\item[{integer, intent(in), optional}]{length,  }\item[{character($\ast$), intent(in), optional}]{indent }\end{DoxyParamCaption})}



Definition at line 878 of file dc\+\_\+args.\+f90.



References dc\+\_\+types\+::stdout, and dc\+\_\+types\+::string.



Referenced by dcargshelp0().


\begin{DoxyCode}
878     \textcolor{comment}{!}
879     \textcolor{comment}{! 文字列を自動改行して出力します. }
880     \textcolor{comment}{! このモジュール内部で用いるためのサブルーチンです.}
881     \textcolor{comment}{!}
882     \textcolor{comment}{! *fmt* に与えられた文章を文字数 *length* (指定されない場合 70)}
883     \textcolor{comment}{! 以内に改行し, 出力します. 出力の際, *indent* が指定されていると}
884     \textcolor{comment}{! その文字列を行頭に挿入して出力を行います.}
885     \textcolor{comment}{! 出力先はデフォルトは標準出力となります. *unit* に出力装置番号}
886     \textcolor{comment}{! を設定することで出力先を変更できます.}
887     \textcolor{comment}{!}
888     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
889     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1split}{split}
890     \textcolor{keywordtype}{implicit none}
891     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)} :: fmt
892     \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional} :: length \textcolor{comment}{! 一行の長さ}
893     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional} :: indent \textcolor{comment}{! 字下げ文字列}
894     \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional} :: unit   \textcolor{comment}{! 出力装置}
895     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{pointer} :: carray\_tmp(:) => null()
896     \textcolor{keywordtype}{character(STRING)} :: store\_str
897     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{parameter} :: default\_len = 70
898     \textcolor{keywordtype}{integer} :: i, split\_len, indent\_len, unit\_num
899     \textcolor{keywordtype}{logical} :: new\_line\_flag
900   \textcolor{keywordflow}{continue}
901     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(unit)) \textcolor{keywordflow}{then}
902       unit\_num = unit
903     \textcolor{keywordflow}{else}
904       unit\_num = \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
905 \textcolor{keywordflow}{    end if}
906 
907     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(indent)) \textcolor{keywordflow}{then}
908       indent\_len = len(indent)
909     \textcolor{keywordflow}{else}
910       indent\_len = 0
911 \textcolor{keywordflow}{    end if}
912 
913     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(length)) \textcolor{keywordflow}{then}
914       split\_len = length - indent\_len
915     \textcolor{keywordflow}{else}
916       split\_len = default\_len - indent\_len
917 \textcolor{keywordflow}{    end if}
918 
919 
920     \textcolor{keyword}{nullify}(carray\_tmp)
921     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1split}{split}(fmt, carray\_tmp, \textcolor{stringliteral}{''})
922     store\_str = \textcolor{stringliteral}{''}
923     new\_line\_flag = .true.
924     i = 1
925     \textcolor{keywordflow}{do}
926       \textcolor{keywordflow}{if} (i > \textcolor{keyword}{size}(carray\_tmp)) \textcolor{keywordflow}{then}
927         \textcolor{keyword}{write}(unit\_num, \textcolor{stringliteral}{'(A)'}) trim(store\_str)
928         \textcolor{keywordflow}{exit}
929 \textcolor{keywordflow}{      end if}
930 
931       \textcolor{keywordflow}{if} (len(trim(store\_str)) + len(trim(carray\_tmp(i))) > split\_len) \textcolor{keywordflow}{then}
932         \textcolor{keywordflow}{if} (new\_line\_flag) \textcolor{keywordflow}{then}
933           \textcolor{keyword}{write}(unit\_num, \textcolor{stringliteral}{'(A)'}) trim(carray\_tmp(i))
934           i = i + 1
935         \textcolor{keywordflow}{else}
936           \textcolor{keyword}{write}(unit\_num, \textcolor{stringliteral}{'(A)'}) trim(store\_str)
937           store\_str = \textcolor{stringliteral}{''}
938           new\_line\_flag = .true.
939 \textcolor{keywordflow}{        end if}
940         cycle
941 \textcolor{keywordflow}{      end if}
942 
943       \textcolor{keywordflow}{if} (new\_line\_flag .and. \textcolor{keyword}{present}(indent)) \textcolor{keywordflow}{then}
944         store\_str = indent // trim(carray\_tmp(i))
945       \textcolor{keywordflow}{else}
946         store\_str = trim(store\_str) // \textcolor{stringliteral}{' '} // trim(carray\_tmp(i))
947 \textcolor{keywordflow}{      end if}
948       new\_line\_flag = .false.
949       i = i + 1
950 \textcolor{keywordflow}{    end do}
951 
\end{DoxyCode}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{namespacedc__args_a6c576d61d454d0d2123a91e7d8de5064_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacedc__args_ac158fcd69d646bcb497abe20736e293c}\label{namespacedc__args_ac158fcd69d646bcb497abe20736e293c}} 
\index{dc\+\_\+args@{dc\+\_\+args}!sortargtable@{sortargtable}}
\index{sortargtable@{sortargtable}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{sortargtable()}{sortargtable()}}
{\footnotesize\ttfamily subroutine dc\+\_\+args\+::sortargtable (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Definition at line 955 of file dc\+\_\+args.\+f90.



References argind\+\_\+count, argstr\+\_\+table, cmd\+\_\+argv\+\_\+list, cmd\+\_\+opts\+\_\+list, dcoptionformc(), and dc\+\_\+types\+::string.



Referenced by dcargsopen0().


\begin{DoxyCode}
955     \textcolor{comment}{!}
956     \textcolor{comment}{! 内部向けの引数振り分けのためのサブルーチンです. }
957     \textcolor{comment}{!}
958     \textcolor{comment}{! BuildArgTable で設定された argind\_count, argstr\_table を}
959     \textcolor{comment}{! 用い, cmd\_argv\_list, cmd\_opts\_list を設定します.}
960     \textcolor{comment}{!}
961     \textcolor{comment}{! 既に一度でも呼ばれている場合, 何もせずに終了します.}
962     \textcolor{comment}{!}
963     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
964     \textcolor{keywordtype}{implicit none}
965     \textcolor{keywordtype}{character(STRING)}:: raw\_arg, name, value
966     \textcolor{keywordtype}{integer}:: i, cmd\_argv\_count, cmd\_opts\_count, cmd\_argv\_max, cmd\_opts\_max
967   \textcolor{keywordflow}{continue}
968     \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cmd\_opts\_list)) \textcolor{keywordflow}{return}
969     cmd\_argv\_count = 0
970     cmd\_opts\_count = 0
971     check\_count: \textcolor{keywordflow}{do}, i = 1, argind\_count
972       raw\_arg = argstr\_table(i)
973       \textcolor{keywordflow}{if} (dcoptionformc(raw\_arg, name, \textcolor{keywordtype}{value})) \textcolor{keywordflow}{then}
974         cmd\_opts\_count = cmd\_opts\_count + 1
975       \textcolor{keywordflow}{else}
976         cmd\_argv\_count = cmd\_argv\_count + 1
977 \textcolor{keywordflow}{      end if}
978 \textcolor{keywordflow}{    end do} check\_count
979 
980     cmd\_argv\_max = cmd\_argv\_count
981     cmd\_opts\_max = cmd\_opts\_count
982 
983     \textcolor{keyword}{allocate}(cmd\_argv\_list(cmd\_argv\_max))
984     \textcolor{keyword}{allocate}(cmd\_opts\_list(cmd\_opts\_max))
985 
986     cmd\_argv\_count = 0
987     cmd\_opts\_count = 0
988     arg\_get : \textcolor{keywordflow}{do}, i = 1, argind\_count
989       raw\_arg = argstr\_table(i)
990       \textcolor{keywordflow}{if} (dcoptionformc(raw\_arg, name, \textcolor{keywordtype}{value})) \textcolor{keywordflow}{then}
991         cmd\_opts\_count = cmd\_opts\_count + 1
992         cmd\_opts\_list(cmd\_opts\_count) % name = name
993         cmd\_opts\_list(cmd\_opts\_count) % value = \textcolor{keywordtype}{value}
994         cmd\_opts\_list(cmd\_opts\_count) % flag\_called = .false.
995       \textcolor{keywordflow}{else}
996         cmd\_argv\_count = cmd\_argv\_count + 1
997         cmd\_argv\_list(cmd\_argv\_count) = raw\_arg
998 \textcolor{keywordflow}{      end if}
999 \textcolor{keywordflow}{    end do} arg\_get
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=343pt]{namespacedc__args_ac158fcd69d646bcb497abe20736e293c_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=337pt]{namespacedc__args_ac158fcd69d646bcb497abe20736e293c_icgraph}
\end{center}
\end{figure}


\subsection{Variable Documentation}
\mbox{\Hypertarget{namespacedc__args_af2e57d495bc0230ba6fdce4ec0f96dda}\label{namespacedc__args_af2e57d495bc0230ba6fdce4ec0f96dda}} 
\index{dc\+\_\+args@{dc\+\_\+args}!argind\+\_\+count@{argind\+\_\+count}}
\index{argind\+\_\+count@{argind\+\_\+count}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{argind\+\_\+count}{argind\_count}}
{\footnotesize\ttfamily integer, save dc\+\_\+args\+::argind\+\_\+count = -\/1\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 318 of file dc\+\_\+args.\+f90.



Referenced by buildargtable(), and sortargtable().


\begin{DoxyCode}
318   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{save}:: argind\_count = -1
\end{DoxyCode}
\mbox{\Hypertarget{namespacedc__args_a197dcdb092658915066c8cb816c7ca0b}\label{namespacedc__args_a197dcdb092658915066c8cb816c7ca0b}} 
\index{dc\+\_\+args@{dc\+\_\+args}!argstr\+\_\+table@{argstr\+\_\+table}}
\index{argstr\+\_\+table@{argstr\+\_\+table}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{argstr\+\_\+table}{argstr\_table}}
{\footnotesize\ttfamily character(string), dimension(\+:), allocatable, save dc\+\_\+args\+::argstr\+\_\+table\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 313 of file dc\+\_\+args.\+f90.



Referenced by buildargtable(), dcargsclose0(), and sortargtable().


\begin{DoxyCode}
313   \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{save}:: argstr\_table(:)
\end{DoxyCode}
\mbox{\Hypertarget{namespacedc__args_a9844e741b62e38fdf80245ec7e9316eb}\label{namespacedc__args_a9844e741b62e38fdf80245ec7e9316eb}} 
\index{dc\+\_\+args@{dc\+\_\+args}!cmd\+\_\+argv\+\_\+list@{cmd\+\_\+argv\+\_\+list}}
\index{cmd\+\_\+argv\+\_\+list@{cmd\+\_\+argv\+\_\+list}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{cmd\+\_\+argv\+\_\+list}{cmd\_argv\_list}}
{\footnotesize\ttfamily character(string), dimension(\+:), allocatable, save dc\+\_\+args\+::cmd\+\_\+argv\+\_\+list\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 329 of file dc\+\_\+args.\+f90.



Referenced by dcargsclose0(), dcargsget0(), dcargsnumber0(), dcargsputline0(), and sortargtable().


\begin{DoxyCode}
329   \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{save}:: cmd\_argv\_list(:)
\end{DoxyCode}
\mbox{\Hypertarget{namespacedc__args_a8aaa8a8007c7b50b3718e4117550dec4}\label{namespacedc__args_a8aaa8a8007c7b50b3718e4117550dec4}} 
\index{dc\+\_\+args@{dc\+\_\+args}!cmd\+\_\+opts\+\_\+list@{cmd\+\_\+opts\+\_\+list}}
\index{cmd\+\_\+opts\+\_\+list@{cmd\+\_\+opts\+\_\+list}!dc\+\_\+args@{dc\+\_\+args}}
\subsubsection{\texorpdfstring{cmd\+\_\+opts\+\_\+list}{cmd\_opts\_list}}
{\footnotesize\ttfamily type(\hyperlink{structdc__args_1_1cmd__opts__internal}{cmd\+\_\+opts\+\_\+internal}), dimension(\+:), allocatable, save dc\+\_\+args\+::cmd\+\_\+opts\+\_\+list\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 324 of file dc\+\_\+args.\+f90.



Referenced by dcargsclose0(), dcargsopen0(), and sortargtable().


\begin{DoxyCode}
324   \textcolor{keywordtype}{type}(cmd\_opts\_internal), \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{save} :: cmd\_opts\_list(:)
\end{DoxyCode}
