{"id":2121,"date":"2015-01-17T18:33:36","date_gmt":"2015-01-17T17:33:36","guid":{"rendered":"http:\/\/roboblog.fatal-fury.de\/?p=2121"},"modified":"2015-01-17T18:33:36","modified_gmt":"2015-01-17T17:33:36","slug":"suppress-unused-dummy-argument-warning-in-fortran","status":"publish","type":"post","link":"http:\/\/roboblog.fatal-fury.de\/?p=2121","title":{"rendered":"suppress \"unused dummy argument\" warning in fortran"},"content":{"rendered":"<p>Here is my way to supress the \"unused dummy argument\" warning. I'm searched a long time but did not find a solution which works on any compiler and newer fortran standard.<\/p>\n<p>In C\/C++ it is very easy. Just write (void)variable; But this just trigger an \"Unclassifiable statement\" error.<\/p>\n<pre><code>#define UNUSED(x) if(size( (\/(x)\/) ) < 0) continue\r\n\r\nprogram main\r\n  implicit none\r\n\r\n  type testtype\r\n    integer :: x\r\n  end type\r\n\r\n  type(testtype) :: x\r\n  type(testtype), pointer :: y => null()\r\n\r\n  integer :: z\r\n  \r\n  UNUSED(x)\r\n  UNUSED(y)\r\n  UNUSED(z)\r\nend program\r\n<\/code><\/pre>\n<pre>\r\n$ gfortran -Wall -Wextra -fcheck=all -g test.F90\r\n$ .\/a.out\r\n$\r\n<\/pre>\n<p>hf<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is my way to supress the \"unused dummy argument\" warning. I'm searched a long time but did not find a solution which works on any compiler and newer fortran standard. In C\/C++ it is very easy. Just write (void)variable; But this just trigger an \"Unclassifiable statement\" error. #define UNUSED(x) if(size( (\/(x)\/) ) < 0) [&hellip;]\n<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[30],"class_list":["post-2121","post","type-post","status-publish","format-standard","hentry","category-allgemein","tag-fortran"],"_links":{"self":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2121"}],"version-history":[{"count":2,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2121\/revisions"}],"predecessor-version":[{"id":2123,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2121\/revisions\/2123"}],"wp:attachment":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2121"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}