{"id":2060,"date":"2021-09-14T15:14:15","date_gmt":"2021-09-14T06:14:15","guid":{"rendered":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/?page_id=2060"},"modified":"2022-11-17T17:29:18","modified_gmt":"2022-11-17T08:29:18","slug":"vscode-de-fortran","status":"publish","type":"page","link":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/vscode-de-fortran\/","title":{"rendered":"\u306f\u3058\u3081\u3066\u306e Fortran \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0 vscode \u7248"},"content":{"rendered":"<p style=\"text-align: right;\">\u845b\u897f \u771f\u5bff\u3000\u5f18\u524d\u5927\u5b66\u5927\u5b66\u9662\u7406\u5de5\u5b66\u7814\u7a76\u79d1<\/p>\n<p>Jupyter Fortran Kernel \u3092\u4f7f\u3063\u305f Fortran 90\/95 \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5165\u9580 \u3067\u3042\u308b<\/p>\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/jupyter\/fortran\/\">\u306f\u3057\u3099\u3081\u3066\u306e Fortran \u30d5\u309a\u30ed\u30af\u3099\u30e9\u30df\u30f3\u30af\u3099 &#8211; \u5f18\u524d\u5927\u5b66 Homw Sweet Home<\/a><\/li>\n<\/ul>\n<p>\u306e Visual Studio Code \u7248\u3002<\/p>\n\n<h2>HEROIC 2021 \u63a8\u5968\u5b9f\u884c\u74b0\u5883\u306e\u78ba\u8a8d<\/h2>\n<p>gfortran \u304a\u3088\u3073 Visual Studio Code \u3092\u4f7f\u3044\u307e\u3059\u3002\u60c5\u5831\u57fa\u76e4\u30bb\u30f3\u30bf\u30fcPC\u5b9f\u7fd2\u5ba4\u306e Ubuntu, Windows 10, macOS \u306b\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3067\u3059\u3002<\/p>\n<p>\u81ea\u5206\u306e\u30d1\u30bd\u30b3\u30f3\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5834\u5408\uff0c\u30bb\u30f3\u30bf\u30fc\u3067\u306f Windows \u3067\u306f Chocolatey\uff0cmacOS \u306e\u3067\u306f Homebrew \u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u5229\u7528\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u307e\u3059\u306e\u3067\uff0c\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li>Windows\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/windows\/chocolatey\/\">Chocolatey: \u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3<\/a>\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/windows\/windows-%E3%82%BD%E3%83%95%E3%83%88%E3%82%A6%E3%82%A7%E3%82%A2\/#mingw-w641020\">MinGW-w64<\/a><\/li>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/windows\/windows-%E3%82%BD%E3%83%95%E3%83%88%E3%82%A6%E3%82%A7%E3%82%A2\/#visual_studio_code_1550\">Visual Studio Code<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Ubuntu\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/ubuntu\/ubuntu-%e3%82%bd%e3%83%95%e3%83%88%e3%82%a6%e3%82%a7%e3%82%a2\/#gcc_g_gfortran\">gcc, g++, gfortran<\/a><\/li>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/ubuntu\/ubuntu-%e3%82%bd%e3%83%95%e3%83%88%e3%82%a6%e3%82%a7%e3%82%a2\/#visual_studio_code\">Visual Studio Code<\/a><\/li>\n<\/ul>\n<\/li>\n<li>macOS\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/macos\/homebrew\/\">Homebrew: \u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3<\/a>\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/macos\/macos-%e3%82%bd%e3%83%95%e3%83%88%e3%82%a6%e3%82%a7%e3%82%a2\/#gcc_g_gfortran\">gcc, g++, gfortran<\/a><\/li>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/macos\/macos-%e3%82%bd%e3%83%95%e3%83%88%e3%82%a6%e3%82%a7%e3%82%a2\/#visual_studio_code\">Visual Studio Code<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u62e1\u5f35\u6a5f\u80fd\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/h2>\n<p>Visual Studio Code \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u307e\u307e\u3067\u306f\uff0c\u30e1\u30cb\u30e5\u30fc\u3082\u65e5\u672c\u8a9e\u5316\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u7528\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3068\u3057\u3066\u7d71\u5408\u74b0\u5883\u7684\u306b\u6d3b\u7528\u3059\u308b\u305f\u3081\uff0c\u3044\u304f\u3064\u304b\u62e1\u5f35\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\uff0c\u7c21\u5358\u306a\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306b\uff0c\u6a5f\u80fd\u62e1\u5f35\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a\uff08settings.json \u306e\u7de8\u96c6\uff09\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u4f55\u3084\u3089\u96e3\u3057\u3044\u3053\u3068\u304c\u66f8\u3044\u3066\u3044\u305d\u3046\u3067\u3059\u304c\uff0c\u57fa\u672c\u7684\u306b\u30bf\u30fc\u30df\u30ca\u30eb\u753b\u9762\u306b\u30b3\u30d4\u30da\u3059\u308c\u3070\u4f5c\u696d\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/visual-studio-code-%e3%81%ae%e6%8b%a1%e5%bc%b5%e6%a9%9f%e8%83%bd%e3%81%a8%e8%a8%ad%e5%ae%9a\/\">Visual Studio Code \u306e\u62e1\u5f35\u6a5f\u80fd\u3068\u8a2d\u5b9a<\/a><\/li>\n<\/ul>\n<h3>\u53c2\u8003\uff1aJupyter Fortran kernel \u3067\u306f\u3060\u3081\u306a\u306e\u304b<\/h3>\n<p>\u5f18\u5927 JupyterHub \u3067\u306f Fortran kernel \u3082\u4f7f\u3048\u307e\u3059\u3057\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b Jupyter Notebook \u306e Fortran kernel \u306e\u4f7f\u7528\u4f8b\u3082\u307e\u3068\u3081\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/home.hirosaki-u.ac.jp\/jupyter\/fortran\/\">\u306f\u3058\u3081\u3066\u306e Fortran \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/a><\/li>\n<\/ul>\n<p>Jupyter Notebook \u74b0\u5883\u305d\u306e\u3082\u306e\u306f\uff08\u7279\u306b\u521d\u5fc3\u8005\u306b\u3068\u3063\u3066\uff09\u5927\u5909\u4fbf\u5229\u306a\u306e\u3067\u3059\u304c\uff0c\u6b8b\u5ff5\u306a\u3053\u3068\u306b\uff0c\u672c\u7a3f\u57f7\u7b46\u6642\u70b9\u3067\u306e<a href=\"https:\/\/github.com\/ZedThree\/jupyter-fortran-kernel\"> jupyter-fortran-kernel<\/a> \u306f\uff0c<code>read<\/code> \u6587\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u81f4\u547d\u7684\u306a\u5f31\u70b9\u304c\u3042\u308a\u307e\u3059\u3002\uff08\u30ad\u30fc\u30dc\u30fc\u30c9\u304b\u3089\u306e\u5165\u529b\u3092\u8aad\u307f\u53d6\u308c\u305a\uff0c\u30a8\u30e9\u30fc\u3068\u306a\u3063\u3066\u3057\u307e\u3046\u3002\uff09<\/p>\n<p>\u3067\u3059\u306e\u3067\uff0cFortran \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u6559\u80b2\u7528\u306e\u74b0\u5883\u3068\u3057\u3066\u306f\uff0cJupyter Notebook \u3067\u306f\u306a\u304f\uff0cVisual Studio Code \u306e Modern Fortran \u3068Code Runner \u6a5f\u80fd\u62e1\u5f35\u3092\u5229\u7528\u3057\u305f\u74b0\u5883\u3092\u4f7f\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<h2>\u6700\u521d\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30bb\u30c3\u30b7\u30e7\u30f3<\/h2>\n<ul>\n<li>Visual Studio Code \u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<br \/>\n\u30a2\u30d7\u30ea\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\uff0c\u30bf\u30fc\u30df\u30ca\u30eb\uff08Windows \u3067\u306f\u300cPowerShell\u300d\uff0cUbuntu \u3067\u306f\u300c\u7aef\u672b\u300d\uff0cmacOS \u3067\u306f\u300c\u30bf\u30fc\u30df\u30ca\u30eb\u300d\uff09\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306b <code>code<\/code> \u3068\u5165\u529b\u3057\u3066\u30a8\u30f3\u30bf\u30fc\u30ad\u30fc\u3092\u62bc\u3057\u3066\u3082\u8d77\u52d5\u3057\u307e\u3059\u3002<\/li>\n<li>\u300c<strong>\u30d5\u30a1\u30a4\u30eb<\/strong>\u300d\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u300c<strong>\u65b0\u898f\u30d5\u30a1\u30a4\u30eb<\/strong>\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1891\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort1-640x253.png\" alt=\"\" width=\"640\" height=\"253\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort1-640x253.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort1-300x118.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort1-360x142.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort1.png 1428w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<ul>\n<li>\u300cUntitled-1\u300d\u306a\u3069\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u65b0\u898f\u30d5\u30a1\u30a4\u30eb\u304c\u3067\u304d\u307e\u3059\u306e\u3067\uff0c\uff08\u307e\u3060\u4f55\u3082\u66f8\u3044\u3066\u3044\u307e\u305b\u3093\u304c\uff09\u300c<strong>\u30d5\u30a1\u30a4\u30eb<\/strong>\u300d\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u300c<strong>\u4fdd\u5b58<\/strong>\u300d\u307e\u305f\u306f\u300c<strong>\u540d\u524d\u3092\u4ed8\u3051\u3066\u4fdd\u5b58&#8230;<\/strong> \u300d\u3092\u9078\u629e\u3057\uff0c\u300c<code>ai1.f90<\/code>\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1900\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort01-640x249.png\" alt=\"\" width=\"640\" height=\"249\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort01-640x249.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort01-300x117.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort01-360x140.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/fort01.png 1432w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2198\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv001-640x244.png\" alt=\"\" width=\"640\" height=\"244\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv001-640x244.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv001-300x114.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv001-360x137.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv001.png 1465w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<ul>\n<li>\u62e1\u5f35\u5b50\u306f\u300c<code>.f90<\/code>\u300d\u3068\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\nVisual Studio Code \u306f\uff0c\u3053\u306e\u62e1\u5f35\u5b50\u3092\u307f\u3066\uff0c\u3042\u3041\u3053\u308c\u304b\u3089\u66f8\u304f\u5185\u5bb9\u306f Fortran 90\/95 \u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u6587\u306a\u3093\u3060\u306a\u3041\u3068\u8a8d\u8b58\u3057\uff0c\u3044\u308d\u3044\u308d\u306a\u304a\u7bc0\u4ecb\u3092\u3084\u3044\u3066\u304f\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n<h3>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c<\/h3>\n<ul>\n<li>\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u6587\u3092\u4e00\u5b57\u4e00\u53e5\u9593\u9055\u3044\u306a\u304f\u6253\u3061\u8fbc\u307f\u307e\u3059\u3002\u30b3\u30d4\u30da\u3057\u3066\u3082\u3044\u3044\u3067\u3059\u3002<\/li>\n<\/ul>\n<h4>ai1.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram ai1\r\n  boku = 2.5\r\n  kanojo = 0\r\n  love = boku * kanojo\r\n  print *, love\r\nend program\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2199 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv02-640x392.png\" alt=\"\" width=\"640\" height=\"392\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv02-640x392.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv02-300x184.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv02-1536x940.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv02-360x220.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv02.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<ul>\n<li>\u53f3\u4e0a\u306e \u25b7 \u30de\u30fc\u30af\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\uff0c\u307e\u3060\u30d5\u30a1\u30a4\u30eb\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u81ea\u52d5\u7684\u306b\u4fdd\u5b58\u3057\u3066\uff0c\u30a6\u30a4\u30f3\u30c9\u30a6\u306e\u4e0b\u306b\u30bf\u30fc\u30df\u30ca\u30eb\u753b\u9762\u304c\u958b\u304d\uff0c\u81ea\u52d5\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3068\u5b9f\u884c\u3092\u884c\u3044\u307e\u3059\u3002<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2200 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv03-640x392.png\" alt=\"\" width=\"640\" height=\"392\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv03-640x392.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv03-300x184.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv03-1536x940.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv03-360x220.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv03.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<ul>\n<li>\u4e0b\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u30a6\u30a4\u30f3\u30c9\u30a6\u306b\uff0c\u30b3\u30f3\u30d1\u30a4\u30eb\u6e08\u307f\u306e\u30b3\u30de\u30f3\u30c9 <code>.\/ai1<\/code> \u3092\u6253\u3061\u8fbc\u3093\u3067\uff0c\u3082\u3046\u4e00\u5ea6\u5b9f\u884c\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2201 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv04-640x392.png\" alt=\"\" width=\"640\" height=\"392\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv04-640x392.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv04-300x184.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv04-1536x940.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv04-360x220.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv04.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<div class=\"inner_cell\">\n<div class=\"text_cell_render border-box-sizing rendered_html\">\n<h3 id=\"implicit-none-\u306b\u3059\u308b\u52d5\u6a5f\u4ed8\u3051\" data-toc-modified-id=\"implicit-none-\u306b\u3059\u308b\u52d5\u6a5f\u4ed8\u3051-8.1\">implicit none \u306b\u3059\u308b\u52d5\u6a5f\u4ed8\u3051<\/h3>\n<p>\u4e0a\u306e\u30d7\u30ed\u30b0\u30e9\u30e0 <code>ai1.f90<\/code> \u306f\u7121\u4e8b\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u304d\u3066\u30a8\u30e9\u30fc\u306a\u304f\u5b9f\u884c\u3055\u308c\u305f\u304c\uff0c\u7d50\u679c\u304c <code>0<\/code> \u3068\u3044\u3046\u306e\u306f\uff0c\u3042\u307e\u308a\u306b\u5bc2\u3057\u3044\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\uff0c\u5c11\u3057\u5909\u66f4\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092 <code>ai2.f90<\/code> \u3068\u3057\u3066\u4fdd\u5b58\u3057\uff0c\u53f3\u4e0a\u306e \u25b7 \u30de\u30fc\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u5b9f\u884c\u3059\u308b\u3068&#8230;<\/p>\n<h4>ai2.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram ai2\r\n  watashi = 2.5\r\n  kareshi = 0.4\r\n  love = watashi * kareshi\r\n  print *, love\r\nend program\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2202 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv05-640x392.png\" alt=\"\" width=\"640\" height=\"392\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv05-640x392.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv05-300x184.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv05-1536x940.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv05-360x220.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv05.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u7d50\u679c\u306f\u3084\u306f\u308a <code>0<\/code> \u3068\u306a\u3063\u3066\u3057\u307e\u3046\u3002\u304a\u304b\u3057\u3044&#8230; <code>2.5<\/code> \u306b <code>0.4<\/code> \u3092\u304b\u3051\u308c\u3070 <code>1.0<\/code> \u306b\u306a\u308b\u306f\u305a\u3060\u304c&#8230;<\/p>\n<h4>\u6697\u9ed9\u306e\u578b\u5ba3\u8a00\u3068\u3044\u3046\u6b74\u53f2\u7684\u6163\u7fd2<\/h4>\n<p>\u6b74\u53f2\u7684\u6163\u7fd2\u306b\u3088\u308a\uff0cFORTRAN \u3067\u306f\uff0c\u9ed9\u3063\u3066\u3044\u308c\u3070 <code>i, j, k, l, m, n<\/code> \u3067\u59cb\u307e\u308b\u5909\u6570\u306f <strong>\u6574\u6570<\/strong>\uff0c\u305d\u308c\u4ee5\u5916\u306e\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u3067\u59cb\u307e\u308b\u5909\u6570\u306f <strong>\u5b9f\u6570<\/strong> \u3068\u3057\u3066\u6271\u308f\u308c\u3066\u304d\u305f\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u4f8b\u984c <code>program ai2<\/code> \u3067\u306f\uff0c<code>kareshi = 0.4<\/code> \u306f\u5b9f\u306f <code>kareshi = 0<\/code> \u306e\u3053\u3068\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u601d\u3044\u3082\u304b\u3051\u306a\u3044\u30c8\u30e9\u30d6\u30eb\uff08\u30a2\u30a4\u306b\u30c8\u30e9\u30d6\u30eb\u306f\u3064\u304d\u3082\u306e\uff1f\uff09\u3092\u9632\u3050\u610f\u5473\u3082\u517c\u306d\u3066\uff0c\u6700\u8fd1\u306e\u6559\u79d1\u66f8\u3067\u306f\uff0c\u3053\u306e\u6697\u9ed9\u306e\u578b\u5ba3\u8a00\u3092\u7121\u52b9\u306b\u3059\u308b\u3088\u3046\u306b\uff0c\u30d7\u30ed\u30b0\u30e9\u30e0\u6587\u306e\u5192\u982d\u306b<\/p>\n<div class=\"highlight\" style=\"text-align: center;\">\n<p><code><span class=\"k\"><strong>implicit none<\/strong><\/span><\/code><\/p>\n<\/div>\n<p>\u3068\u66f8\u304f\u3053\u3068\u3092\u63a8\u5968\u3057\u3066\u3044\u308b\u3002<\/p>\n<h4 id=\"\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30a4\u30eb\" data-toc-modified-id=\"\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30a4\u30eb-8.2\">\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30a4\u30eb<\/h4>\n<p>\u3053\u3053\u3067\u306f\uff0c\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u306a\u3069\u3092\u53c2\u8003\u306b\u3057\u3066\uff0c\u305d\u308c\u3089\u3057\u3044\u30b9\u30bf\u30a4\u30eb\u3067\u66f8\u3044\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u53c2\u8003\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/www.mri-jma.go.jp\/Project\/mrinpd\/coderule.html\">Fortran \u6a19\u6e96\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30eb\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/codingstyleguide.readthedocs.io\/en\/latest\/\">Modern Fortran Coding Style Guide\u2019s documentation<\/a><\/li>\n<\/ul>\n<h4>ai.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram ai\r\n  ! ! \u304b\u3089\u59cb\u307e\u308b\u884c\u306f\u30b3\u30e1\u30f3\u30c8\u884c\u3002\u5b9f\u884c\u306b\u5f71\u97ff\u3057\u307e\u305b\u3093\u3002\r\n  ! \u6697\u9ed9\u306e\u578b\u5ba3\u8a00\u306f\u7121\u52b9\u306b\u3057\u3066\uff0c\r\n  ! \u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u4f7f\u3046\u5909\u6570\u306f\u5168\u3066\u5ba3\u8a00\u3057\u307e\u3059\u3002\r\n  implicit none\r\n  real :: watashi, kareshi, love\r\n  watashi = 2.5\r\n  kareshi = 0.4\r\n  love = watashi * kareshi\r\n  print *, love\r\nend program ai\r\n<\/pre>\n<div class=\"inner_cell\">\n<div class=\"text_cell_render border-box-sizing rendered_html\">\n<p>\u4e0a\u306e\u30d7\u30ed\u30b0\u30e9\u30e0 <code>ai.f90<\/code> \u3092\u4f8b\u306b\uff0c\u73fe\u4ee3\u7684\u8996\u70b9\u304b\u3089\u63a8\u5968\u3055\u308c\u3066\u3044\u308b\u66f8\u304d\u65b9\u3092\u4ee5\u4e0b\u306b\u4f8b\u793a\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>Fortran \u4e3b\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\uff0c<code>program ...<\/code> \u3067\u306f\u3058\u307e\u308a\u307e\u3059\u3002<\/li>\n<li>Fortran \u306f\u5927\u6587\u5b57\u3068\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u307e\u305b\u3093\u3002\u3053\u3053\u3067\u306f\u539f\u5247\u3068\u3057\u3066\u5168\u3066\u5c0f\u6587\u5b57\u3067\u66f8\u304f\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/li>\n<li><code>!<\/code> \u304b\u3089\u306f\u3058\u307e\u308b\u884c\u306f\u30b3\u30e1\u30f3\u30c8\u884c\u3067\u3059\u3002\u30b3\u30e1\u30f3\u30c8\u884c\u306f\u305d\u308c\u3092\u8aad\u3080\u4eba\u9593\u306e\u305f\u3081\u306e\u6ce8\u91c8\u3067\u3042\u308a\uff0c\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c\u6642\u306b\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002<\/li>\n<li>5\u884c\u76ee\u3067\u307e\u305a\u6697\u9ed9\u306e\u578b\u5ba3\u8a00\u3092\u7121\u52b9\u306b\u3057\u307e\u3059\u3002<code>implicit none<\/code> \u3068\u5ba3\u8a00\u3057\u305f\u3089\uff0c\u4ee5\u964d\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u6587\u5185\u3067\u4f7f\u7528\u3059\u308b\u5909\u6570\u306f\uff0c\u5168\u3066\u4ee5\u4e0b\u306e\u4f8b\u306e\u3088\u3046\u306b\u5ba3\u8a00\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<li>\u6b21\u306b\u3053\u308c\u304b\u3089\u4f7f\u3046\u5909\u6570\u306e\u578b\u3092 <code>real<\/code>\uff08\u5b9f\u6570\uff09\u3068\u3057\u3066\u5ba3\u8a00\u3057\u307e\u3059\u3002<\/li>\n<li>7\u884c\u76ee\u3067\u306f\uff0c\u6570\u5024 <code>2.5<\/code> \u3092\u5909\u6570 <code>watashi<\/code> \u306b\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002\u4eba\u4e00\u500d\u3069\u3053\u308d\u304b\uff0c\u4eba\u3088\u308a <code>2.5<\/code> \u500d\u306e\u601d\u3044\u304c\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<li>8\u884c\u76ee\u3067\u306f\uff0c\u6570\u5024 <code>0.4<\/code> \u3092\u5909\u6570 <code>kareshi<\/code> \u306b\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<li>9\u884c\u76ee\u3067\u306f\uff0c\u5909\u6570 <code>watashi<\/code> \u306b\u4ee3\u5165\u3055\u308c\u305f\u6570\u5024\u3068\uff0c\u5909\u6570 <code>kareshi<\/code> \u306b\u4ee3\u5165\u3055\u308c\u305f\u6570\u5024\u3092\u304b\u3051\u305f\u7b54\u3048\u3092\uff0c\u5909\u6570 <code>love<\/code> \u306b\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<li>10\u884c\u76ee\u3067\u306f\uff0c\u5909\u6570 <code>love<\/code> \u306e\u5024\u3092\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u6a19\u6e96\u51fa\u529b\uff08\u753b\u9762\uff09\u3078\u306e\u51fa\u529b\u306f <code>print<\/code> \u306b\u7d71\u4e00\u3057\u307e\u3059\u3002<\/li>\n<li>\u4e3b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u6700\u5f8c\u306f <code>end program ...<\/code> \u3067\u7d42\u308f\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002\u3081\u3067\u305f\u304f <code>1.00000000<\/code> \u3068\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2203 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv06-640x494.png\" alt=\"\" width=\"640\" height=\"494\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv06-640x494.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv06-300x232.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv06-1536x1187.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv06-349x270.png 349w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv06.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h2>\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u4f8b<\/h2>\n<p>\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u3068\u306f\uff0c\u5bb6\u8a08\u306e\u6d88\u8cbb\u652f\u51fa\u306b\u5360\u3081\u308b\u98f2\u98df\u8cbb\uff08\u98df\u6599\u8cbb\uff0c\u98df\u8cbb\uff09\u306e\u5272\u5408\uff08\u30d1\u30fc\u30bb\u30f3\u30c8\u5358\u4f4d\uff09\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e <code>engel.f90<\/code> \u306f\u6d88\u8cbb\u652f\u51fa 110,000\u5186\uff0c\u98f2\u98df\u8cbb 37,000\u5186\u306e\u4eba\u306e\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u4f8b\u3067\u3059\u3002\u30b3\u30d4\u30da\u3057\u3066 <code>engel.f90<\/code> \u3068\u3057\u3066\u4fdd\u5b58\u3057\uff0c\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h4>engel.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram engel\r\n  ! \u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u3092\u6c42\u3081\u308b\r\n  implicit none\r\n  ! \u6d88\u8cbb\u652f\u51fa spending, \u98f2\u98df\u8cbb food, \u30a8\u30f3\u30b2\u30eb\u4fc2\u6570 eng\r\n  real :: spending, food, eng\r\n  spending = 110000\r\n  food = 37000\r\n  eng = food * 100 \/ spending\r\n  print *, eng\r\nend program engel\r\n<\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2204 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv07-640x473.png\" alt=\"\" width=\"640\" height=\"473\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv07-640x473.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv07-300x222.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv07-1536x1136.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv07-360x266.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv07.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306e\u5024\u304c <code>33.6363640<\/code> \u3068\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2 id=\"\u30c7\u30fc\u30bf\u306e\u578b\" data-toc-modified-id=\"\u30c7\u30fc\u30bf\u306e\u578b-9.1\">\u30c7\u30fc\u30bf\u306e\u578b<\/h2>\n<h3 id=\"\u5b9f\u6570\u578b\" data-toc-modified-id=\"\u5b9f\u6570\u578b-9.1.1\">\u5b9f\u6570\u578b<\/h3>\n<h4 id=\"real\" data-toc-modified-id=\"real-9.1.1.1\">real<\/h4>\n<p>\u4e0a\u306e\u4f8b\u3067\u306f\uff0c<code>real<\/code>\uff08\u5b9f\u6570\uff09\u3068\u3057\u3066\u5909\u6570 <code>spending<\/code>, <code>food<\/code>, <code>eng<\/code> \u3092\u5ba3\u8a00\u3057\u3066\u3044\u307e\u3057\u305f\u3002 <code>real<\/code> \u306f <code>real(4)<\/code> \u3068\u540c\u7b49\u3067\u3042\u308a\uff0creal \u3067\u5ba3\u8a00\u3055\u308c\u308b\u5b9f\u6570\u304c\u8868\u793a\u3067\u304d\u308b\u6700\u5927\u5024\u30fb\u6700\u5c0f\u5024\u306f\u6709\u52b9\u6841\u6570\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u30b3\u30d4\u30da\u3057\u3066 <code>real.f90<\/code> \u3068\u3057\u3066\u4fdd\u5b58\u3057\uff0c\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h4>real.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram real\r\n  implicit none\r\n  real :: r\r\n  print *, '1 \/ 3 = ', 1.0 \/ 3.0\r\n  print *, 'real \u306e\u6700\u5927\u5024\u306f', huge(r)\r\n  print *, 'real \u306e\u6700\u5c0f\u5024\u306f', tiny(r)\r\nend program real\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2205 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv08-640x473.png\" alt=\"\" width=\"640\" height=\"473\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv08-640x473.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv08-300x222.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv08-1536x1136.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv08-360x266.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv08.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\u306f<\/p>\n<pre> 1 \/ 3 =   0.333333343    \r\n real \u306e\u6700\u5927\u5024\u306f   3.40282347E+38\r\n real \u306e\u6700\u5c0f\u5024\u306f   1.17549435E-38\r\n<\/pre>\n<h4 id=\"real(8),-real(16)\" data-toc-modified-id=\"real(8),-real(16)-9.1.1.2\">real(8), real(16)<\/h4>\n<p><code>real<\/code> \u3067\u306f\u8868\u305b\u306a\u3044\u975e\u5e38\u306b\u5927\u304d\u3044\u5b9f\u6570\u3084\uff0c\u3088\u308a\u6709\u52b9\u6841\u6570\u306e\u591a\u3044\u5b9f\u6570\u3092\u4f7f\u3046\u5834\u5408\u306f\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b <code>real(8)<\/code> \u3084 <code>real(16)<\/code> \u3068\u5ba3\u8a00\u3057\u307e\u3059\u3002\u8868\u793a\u3067\u304d\u308b\u6700\u5927\u5024\u30fb\u6700\u5c0f\u5024\u306f\u6709\u52b9\u6841\u6570\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u30b3\u30d4\u30da\u3057\u3066 <code>real816.f90<\/code> \u3068\u3057\u3066\u4fdd\u5b58\u3057\uff0c\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h4>real816.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram real816\r\n  implicit none\r\n  real(8)  :: r8\r\n  real(16) :: r16\r\n  print *, '1 \/ 3 = ', 1.0_8 \/ 3.0_8\r\n  print *, 'real(8) \u306e\u6700\u5927\u5024\u306f', huge(r8)\r\n  print *, 'real(8) \u306e\u6700\u5c0f\u5024\u306f', tiny(r8)\r\n  print *, ' '\r\n  print *, '1 \/ 3 = ', 1.0_16 \/ 3.0_16\r\n  print *, 'real(16) \u306e\u6700\u5927\u5024\u306f', huge(r16)\r\n  print *, 'real(16) \u306e\u6700\u5c0f\u5024\u306f', tiny(r16)  \r\nend program real816\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2207 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv09-640x597.png\" alt=\"\" width=\"640\" height=\"597\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv09-640x597.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv09-300x280.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv09-1536x1432.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv09-290x270.png 290w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv09.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre> 1 \/ 3 =   0.33333333333333331     \r\n real(8) \u306e\u6700\u5927\u5024\u306f   1.7976931348623157E+308\r\n real(8) \u306e\u6700\u5c0f\u5024\u306f   2.2250738585072014E-308\r\n  \r\n 1 \/ 3 =   0.333333333333333333333333333333333317      \r\n real(16) \u306e\u6700\u5927\u5024\u306f   1.18973149535723176508575932662800702E+4932\r\n real(16) \u306e\u6700\u5c0f\u5024\u306f   3.36210314311209350626267781732175260E-4932\r\n$<\/pre>\n<h4 id=\"\u53c2\u8003\uff1aselected_real_kind\" data-toc-modified-id=\"\u53c2\u8003\uff1aselected_real_kind-9.1.1.3\">\u53c2\u8003\uff1aselected_real_kind<\/h4>\n<p>\u4f8b\u3048\u3070\u6709\u52b9\u6841\u6570 12 \u6841\u306e\u5b9f\u6570\u3092\u8868\u3057\u305f\u3044\u5834\u5408\uff0c<code>real<\/code>, <code>real(8)<\/code>, <code>real(16)<\/code> \u306e\u3069\u308c\u3092\u4f7f\u3048\u3070\u3044\u3044\u304b\u8abf\u3079\u308b\u306e\u304c\u9762\u5012\u306a\u5834\u5408\u306f<\/p>\n<div class=\"highlight\">\n<pre class=\"brush: fortran; light: true; title: ; notranslate\" title=\"\">\r\ninteger, parameter :: dp = selected_real_kind(12)\r\n  real(dp)...\r\n<\/pre>\n<\/div>\n<p>\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30b3\u30d4\u30da\u3057\uff0c<code>printau1.f90<\/code> \u3068\u3057\u3066\u4fdd\u5b58\u3057\uff0c\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h4>printau1.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram printau1\r\n  implicit none\r\n  ! \u5929\u6587\u5358\u4f4d\u306f 12 \u6841\u306e\u5b9a\u7fa9\u5b9a\u6570\uff08\u8aa4\u5dee\u7121\u3057\uff09\r\n  integer, parameter :: dp = selected_real_kind(12)\r\n  real(dp), parameter :: au1 = 149597870700.0_dp\r\n  print *, &quot;1 \u5929\u6587\u5358\u4f4d\u306f&quot;, au1, &quot; m \u3067\u3059\u3002&quot;\r\nend program printau1\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2208 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv10-640x399.png\" alt=\"\" width=\"640\" height=\"399\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv10-640x399.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv10-300x187.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv10-1536x958.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv10-360x225.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv10.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre> 1 \u5929\u6587\u5358\u4f4d\u306f   149597870700.00000       m \u3067\u3059\u3002\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3 id=\"\u6574\u6570\u578b\" data-toc-modified-id=\"\u6574\u6570\u578b-9.1.2\">\u6574\u6570\u578b<\/h3>\n<h4 id=\"integer\" data-toc-modified-id=\"integer-9.1.2.1\">integer<\/h4>\n<p>\u6574\u6570\u578b\u306f <code>integer<\/code> \u3067\u3059\u3002\u8868\u793a\u3067\u304d\u308b\u6700\u5927\u5024\u306f\u6709\u52b9\u6841\u6570\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>int.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram int\r\n  implicit none\r\n  integer :: i\r\n  print *, '1 \/ 3 = ', 1 \/ 3\r\n  print *, 'integer \u306e\u6700\u5927\u5024\u306f', huge(i)\r\nend program int\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2209 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv11-1-640x380.png\" alt=\"\" width=\"640\" height=\"380\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv11-1-640x380.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv11-1-300x178.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv11-1-1536x912.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv11-1-360x214.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv11-1.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre> 1 \/ 3 =            0\r\n integer \u306e\u6700\u5927\u5024\u306f  2147483647\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4 id=\"integer(8),-integer(16)\" data-toc-modified-id=\"integer(8),-integer(16)-9.1.2.2\">integer(8), integer(16)<\/h4>\n<p>\u3088\u308a\u6841\u6570\u306e\u591a\u3044\u6574\u6570\u3092\u6271\u3046\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b <code>integer(8)<\/code> \u3084 <code>integer(16)<\/code> \u3092\u4f7f\u3044\u307e\u3059\u3002\u8868\u793a\u3067\u304d\u308b\u6700\u5927\u5024\u306f\u6709\u52b9\u6841\u6570\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>int816.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram int816\r\n  implicit none\r\n  integer(8)  :: i8\r\n  integer(16) :: i16 \r\n  print *, 'integer(8) \u306e\u6700\u5927\u5024\u306f ', huge(i8)\r\n  print *, 'integer(16) \u306e\u6700\u5927\u5024\u306f', huge(i16)\r\nend program int816\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2210 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv13-640x419.png\" alt=\"\" width=\"640\" height=\"419\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv13-640x419.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv13-300x196.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv13-1536x1006.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv13-360x236.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv13.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\uff0c<\/p>\n<pre> integer(8) \u306e\u6700\u5927\u5024\u306f   9223372036854775807\r\n integer(16) \u306e\u6700\u5927\u5024\u306f  170141183460469231731687303715884105727\r\n<\/pre>\n<h4 id=\"\u53c2\u8003\uff1aselected_int_kind\" data-toc-modified-id=\"\u53c2\u8003\uff1aselected_int_kind-9.1.2.3\">\u53c2\u8003\uff1aselected_int_kind<\/h4>\n<p>\u4f8b\u3048\u3070\u6709\u52b9\u6841\u6570 12 \u6841\uff08\u4ee5\u4e0a\uff09\u306e\u6574\u6570\u3092\u8868\u3057\u305f\u3044\u5834\u5408\uff0c<code>integer<\/code>, <code>integer(8)<\/code>, <code>integer(16)<\/code> \u306e\u3069\u308c\u3092\u4f7f\u3048\u3070\u3044\u3044\u304b\u8abf\u3079\u308b\u306e\u304c\u9762\u5012\u306a\u5834\u5408\u306f<\/p>\n<div class=\"highlight\">\n<pre class=\"brush: fortran; light: true; title: ; notranslate\" title=\"\">\r\ninteger, parameter :: ik = selected_int_kind(12) \r\ninteger(ik)... \r\n<\/pre>\n<\/div>\n<p>\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<h4>\u00a0printau.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">program printau\r\n  implicit none\r\n  ! \u5929\u6587\u5358\u4f4d\u306f 12 \u6841\u306e\u5b9a\u7fa9\u5b9a\u6570\uff08\u8aa4\u5dee\u7121\u3057\uff09\r\n  integer, parameter :: ik = selected_int_kind(12)\r\n  integer(ik), parameter :: au = 149597870700_ik\r\n  print *, &quot;1 \u5929\u6587\u5358\u4f4d\u306f&quot;, au, &quot; m \u3067\u3059\u3002&quot;\r\nend program printau\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2211 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv14-640x419.png\" alt=\"\" width=\"640\" height=\"419\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv14-640x419.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv14-300x196.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv14-1536x1006.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv14-360x236.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv14.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\uff0c<\/p>\n<pre> 1 \u5929\u6587\u5358\u4f4d\u306f         149597870700  m \u3067\u3059\u3002\r\n<\/pre>\n<h3 id=\"\u6587\u5b57\u578b\" data-toc-modified-id=\"\u6587\u5b57\u578b-9.1.3\">\u6587\u5b57\u578b<\/h3>\n<p>\u6587\u5b57\u578b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b <code>character<\/code> \u3067\u5ba3\u8a00\u3057\uff0c\u6587\u5b57\u306e\u6700\u5927\u6570\u3092\u62ec\u5f27\u3067\u66f8\u304d\u307e\u3059\u3002<\/p>\n<p>\u5909\u6570 <code>moji<\/code> \u306b\u6587\u5b57\u5217\u3092\u4ee3\u5165\u3059\u308b\u5834\u5408\u306f\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b <code>'<\/code> \u307e\u305f\u306f <code>\"<\/code> \u3067\u56f2\u307f\u307e\u3059\u3002<\/p>\n<h4>printchar.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram printchar\r\n  implicit none\r\n  ! \u6587\u5b57\u578b\u306e\u5909\u6570 moji\uff08\u9577\u305512\uff09\u306e\u5ba3\u8a00\r\n  character(12) :: moji\r\n  moji = 'engel keisu '\r\n  print *, moji\r\nend program printchar\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2212 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv15-640x419.png\" alt=\"\" width=\"640\" height=\"419\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv15-640x419.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv15-300x196.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv15-1536x1006.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv15-360x236.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv15.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h2>\u5f0f\u3068\u6f14\u7b97<\/h2>\n<h3>\u4e3b\u306a\u6f14\u7b97\u5b50<\/h3>\n<p>\u8db3\u3057\u7b97\u306f <code>+<\/code>\uff0c \u5f15\u304d\u7b97\u306f <code>-<\/code>\uff0c\u639b\u3051\u7b97\u306f <code>*<\/code>\uff0c\u5272\u308a\u7b97\u306f <code>\/ <\/code>\u3067\u3059\u3002<\/p>\n<p>\u512a\u5148\u7684\u306b\u8a08\u7b97\u3057\u305f\u3044\u7b87\u6240\u306f\u4e38\u62ec\u5f27 <code>( )<\/code> \u3067 \u30b0\u30eb\u30fc\u30d7\u5316\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3092\u53c2\u7167\uff1a<\/p>\n<h4>yusen.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram yusen\r\n  print *, 2 +  50 - 5 * 6 \/2\r\n  print *, 2 + (50 - 5 * 6)\/2\r\nend program yusen\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2213 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv16-640x342.png\" alt=\"\" width=\"640\" height=\"342\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv16-640x342.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv16-300x160.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv16-1536x821.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv16-360x192.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv16.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><code>\/\/<\/code> \u306f\u6587\u5b57\u5217\u306e\u9023\u7d50\u6f14\u7b97\u306b\u4f7f\u3044\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3092\u53c2\u7167\u3002<\/p>\n<h4>charadd.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram charadd\r\n  implicit none\r\n  character(6) :: x0, y0\r\n  x0 = 'engel '\r\n  y0 = 'keisu '\r\n  print *, x0 \/\/ y0\r\nend program charadd\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2214 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv17-640x403.png\" alt=\"\" width=\"640\" height=\"403\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv17-640x403.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv17-300x189.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv17-1536x967.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv17-360x227.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv17.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u6587\u5b57\u5217\u3068\u6570\u5024\u3092\u76f4\u63a5\u9023\u7d50\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u6587\u5b57\u5217\u3068\u6570\u5024\u3092\u9023\u7d50\u306a\u3069\u3057\u306a\u304f\u3066\u3082\uff0c<code>print<\/code> \u6587\u306f\uff0c\u30ab\u30f3\u30de (<code>,<\/code>) \u3067\u533a\u5207\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u8907\u6570\u306e\u9805\u76ee\uff08\u5909\u6570\uff09\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>engel2.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram engel2\r\n  implicit none\r\n  real :: spending, food, eng\r\n  spending = 110000\r\n  food = 37000\r\n  eng = food * 100 \/ spending\r\n  print *, '\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f ', eng, '\u3067\u3059\u3002'\r\nend program engel2\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2215 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv18-640x424.png\" alt=\"\" width=\"640\" height=\"424\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv18-640x424.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv18-300x199.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv18-1536x1019.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv18-360x239.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv18.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> \u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f    33.6363640     \u3067\u3059\u3002\r\n<\/pre>\n<p>\u9664\u7b97 <code>\/<\/code> \u306e\u4f8b\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<h4>divide.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram divide\r\n  print *, '17 \/ 3      = ', 17 \/ 3\r\n  print *, '17.0 \/ 3    = ', 17.0 \/ 3\r\n  print *, '17.0_8 \/ 3  = ', 17.0_8 \/ 3\r\n  print *, '17.0_16 \/ 3 = ', 17.0_16 \/ 3\r\nend program divide\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2216 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv19-640x429.png\" alt=\"\" width=\"640\" height=\"429\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv19-640x429.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv19-300x201.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv19-1536x1029.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv19-360x241.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv19.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> 17 \/ 3      =            5\r\n 17.0 \/ 3    =    5.66666651    \r\n 17.0_8 \/ 3  =    5.6666666666666670     \r\n 17.0_16 \/ 3 =    5.66666666666666666666666666666666692      \r\n<\/pre>\n<ul>\n<li>2\u884c\u76ee\u3067\u306f\uff0c\u6574\u6570\u3092\u6574\u6570\u3067\u5272\u308b\u306e\u3067\uff0c\u5c0f\u6570\u5206\u3092\u5207\u308a\u6368\u3066\u305f\u6574\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002<\/li>\n<li>3\u884c\u76ee\u3067\u306f\uff0c<code>17.0<\/code> \u3068\u6700\u5f8c\u306b\u5c0f\u6570\u70b9\u3092\u3064\u3051\u305f\u306e\u3067\uff0c\u5b9f\u6570\u578b\uff08<code>real<\/code>\uff09\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\uff0c\u5c0f\u6570\u70b9\u4ee5\u4e0b6\u6841\u304f\u3089\u3044\u307e\u3067\u306e\u7cbe\u5ea6\u3067\u3059\u3002<\/li>\n<li>4\u884c\u76ee\u306f <code>17.0_8<\/code> \u3067 <code>real(8)<\/code> \u306e\u5b9f\u6570\u3068\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\uff0c\u5c0f\u6570\u70b9\u4ee5\u4e0b15\u6841\u304f\u3089\u3044\u307e\u3067\u306e\u7cbe\u5ea6\u3067\u3059\u3002<\/li>\n<li>5\u884c\u76ee\u3067\u306f\uff0c<code>17.0_16<\/code> \u3067 <code>real(16)<\/code> \u306e\u5b9f\u6570\u3068\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\uff0c\u5c0f\u6570\u70b9\u4ee5\u4e0b33\u6841\u304f\u3089\u3044\u307e\u3067\u306e\u7cbe\u5ea6\u3067\u3059\u3002<\/li>\n<\/ul>\n<p>\u3079\u304d\u4e57\u306f <code>**<\/code> \u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/ql-cache\/quicklatex.com-3732ddbd4673a19b97c5f51da7e1da0b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#50;&#94;&#52;&#61;&#50;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#50;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#50;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"140\" style=\"vertical-align: 0px;\"\/> \u3068 <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/ql-cache\/quicklatex.com-41d1fab84ccec4a2f1321dcffa35ed2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#50;&#94;&#123;&#49;&#47;&#50;&#125;&#61;&#92;&#115;&#113;&#114;&#116;&#123;&#50;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"78\" style=\"vertical-align: -2px;\"\/> \u306e\u5024\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<h4>power.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram power\r\n  print *, '2**4   =', 2**4\r\n  print *, '2**0.5 =', 2**0.5\r\nend program power\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2217 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv20-640x390.png\" alt=\"\" width=\"640\" height=\"390\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv20-640x390.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv20-300x183.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv20-1536x936.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv20-360x219.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv20.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<pre> 2**4   =          16\r\n 2**0.5 =   1.41421354    \r\n<\/pre>\n<p>\u3079\u304d\u4e57\u306b\u9650\u3089\u305a\uff0c\u3042\u307e\u308a\u306b\u3082\u6841\u6570\u304c\u591a\u304f\u306a\u308b\u8a08\u7b97\u3059\u308b\u3068\uff0c\u57fa\u672c\u6574\u6570\u578b\uff08<code>integer<\/code>\uff09\u306e\u7bc4\u56f2\u3092\u8d85\u3048\u3066\u3057\u307e\u3044\uff0c\u304a\u304b\u3057\u306a\u5024\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u6ce8\u610f\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\uff0c<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/ql-cache\/quicklatex.com-7a38ba0659cd6b69ec82f780c58ea201_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#50;&#94;&#123;&#51;&#49;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"22\" style=\"vertical-align: 0px;\"\/> \u3042\u305f\u308a\u3067\u7b54\u3048\u304c\u5909\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4>oor.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram oor\r\n  ! out of range\r\n  print *, '2**29 = ', 2**29\r\n  print *, '2**30 = ', 2**30\r\n  print *, '2**31 = ', 2**30 * 2\r\n  print *, '2**32 = ', 2**30 * 2 * 2\r\nend program oor\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2218 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv21-640x432.png\" alt=\"\" width=\"640\" height=\"432\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv21-640x432.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv21-300x203.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv21-1536x1037.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv21-360x243.png 360w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv21.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> 2**29 =    536870912\r\n 2**30 =   1073741824\r\n 2**31 =  -2147483648\r\n 2**32 =            0\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u975e\u5e38\u306b\u5927\u304d\u3044\uff08\u307e\u305f\u306f\u6975\u3081\u3066\u5c0f\u3055\u3044\uff09\u6570\u5024\u3092\u6271\u3046\u5834\u5408\u3084\uff0c<code>real<\/code> \u306e\u6709\u52b9\u6841\u6570\u7d046\u6841\u3067\u306f\u8db3\u308a\u306a\u3044\u5834\u5408\uff0c\u4f8b\u3048\u3070\u6709\u52b9\u6841\u6570\u309215\uff08\u4ee5\u4e0a\uff09\u3068\u3059\u308b\u5834\u5408\u306f\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u306e\u4f8b\u3067\u6574\u6570\u578b\u306e\u5834\u5408\u306b\u6b63\u3057\u3044\u7b54\u3048\u304c\u51fa\u306a\u304b\u3063\u305f <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/ql-cache\/quicklatex.com-55611728729adac655a7e323bd9b349b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#50;&#94;&#123;&#51;&#49;&#125;&#44;&#32;&#50;&#94;&#123;&#51;&#50;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"54\" style=\"vertical-align: -4px;\"\/> \u306a\u3069\u3082\uff0c\u4ee5\u4e0b\u306e\u4f8b\u306e\u3088\u3046\u306b\u6709\u52b9\u6841\u6570\u3092\u591a\u304f\u3068\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u7cbe\u5ea6\u3088\u304f\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<h4>precision.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram precision \r\n  implicit none\r\n  ! 15\u6841\uff08\u4ee5\u4e0a\uff09\u306e\u6709\u52b9\u6841\u6570\u3092\u6301\u3064\u5b9f\u6570\u30fb\u6574\u6570\u306e\u5b9a\u7fa9\u7528\r\n  integer, parameter :: dp = selected_real_kind(p=15)\r\n  integer, parameter :: ik = selected_int_kind(15)\r\n  real(dp) :: sqrtwo\r\n  sqrtwo = sqrt(2.0_dp)\r\n  print *, 'sqrt(2.0)    = ', sqrt(2.0)\r\n  print *, 'sqrt(2.0_dp) = ', sqrtwo\r\n  print *, '2**31 = ', 2_ik**31\r\n  print *, '2**32 = ', 2_ik**32\r\nend program precision\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2220 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv22-640x549.png\" alt=\"\" width=\"640\" height=\"549\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv22-640x549.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv22-300x258.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv22-1536x1318.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv22-315x270.png 315w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv22.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> sqrt(2.0)    =    1.41421354    \r\n sqrt(2.0_dp) =    1.4142135623730951     \r\n 2**31 =            2147483648\r\n 2**32 =            4294967296\r\n<\/pre>\n<h3>\u7df4\u7fd2 1<\/h3>\n<p>1 \u5929\u6587\u5358\u4f4d\uff081 au\uff09\u306e\u8ddd\u96e2\u3092\u5149\u901f c \u3067\u9032\u3080\u306e\u306b\u8981\u3059\u308b\u6642\u9593\u306f\uff08\u4f55\u6642\u9593\uff09\u4f55\u5206\u4f55\u79d2\u304b\u3002\u305f\u3060\u3057\uff0c<\/p>\n<ul>\n<li>1 \u5929\u6587\u5358\u4f4d\u306f 12 \u6841\u306e\u5b9a\u7fa9\u5b9a\u6570\uff08\u8aa4\u5dee\u7121\u3057\uff09\u3067 <code>149597870700<\/code> m<\/li>\n<li>\u5149\u901f c \u306f 9 \u6841\u306e\u5b9a\u7fa9\u5b9a\u6570\uff08\u8aa4\u5dee\u7121\u3057\uff09\u3067 <code>299792458<\/code> m\/s \u3067\u3042\u308b\u3002<\/li>\n<\/ul>\n<p>\u53c2\u8003\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E5%A4%A9%E6%96%87%E5%8D%98%E4%BD%8D\">\u5929\u6587\u5358\u4f4d &#8211; Wikipedia<\/a><\/li>\n<li><a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E5%85%89%E9%80%9F\">\u5149\u901f &#8211; Wikipedia<\/a><\/li>\n<\/ul>\n<h2>\u5bfe\u8a71\u578b\u30d7\u30ed\u30b0\u30e9\u30e0<\/h2>\n<p>\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\uff0c\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u3067\u6d88\u8cbb\u652f\u51fa\u3084\u98f2\u98df\u8cbb\u3092\u6c7a\u3081\u3066\u3044\u307e\u3057\u305f\u304c\uff0c\u4eca\u5ea6\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u4eba\u304c\u5165\u529b\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u4f8b\u3067\u306f\uff0c<code>read *, spending<\/code> \u3067\u30ad\u30fc\u30dc\u30fc\u30c9\u304b\u3089\u306e\u5165\u529b\u5024\u3092\u5909\u6570 <code>spending<\/code> \u306b\u5165\u308c\u307e\u3059\u3002<\/p>\n<h4>engelread.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram engelread\r\n  implicit none\r\n  real :: spending, food, eng\r\n  print *, &quot;\u6d88\u8cbb\u652f\u51fa? &quot;\r\n  read *, spending\r\n  print *, &quot;\u98f2\u98df\u8cbb? &quot;\r\n  read *, food\r\n  eng = food * 100 \/ spending\r\n  print *, &quot;\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f&quot;, eng\r\nend program engelread\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2221 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv23-640x531.png\" alt=\"\" width=\"640\" height=\"531\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv23-640x531.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv23-300x249.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv23-1536x1275.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv23-325x270.png 325w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv23.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> \u6d88\u8cbb\u652f\u51fa? \r\n110000     &lt;----- \u30ad\u30fc\u30dc\u30fc\u30c9\u304b\u3089\u5165\u529b\r\n \u98f2\u98df\u8cbb? \r\n37000      &lt;----- \u30ad\u30fc\u30dc\u30fc\u30c9\u304b\u3089\u5165\u529b\r\n \u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f   33.6363640    \r\n<\/pre>\n<h2>\u95a2\u6570\u306e\u5b9a\u7fa9\u3068\u547c\u3073\u51fa\u3057<\/h2>\n<p>\uff08\u3053\u308c\u307e\u3067\u306e\u4f8b\u3067\u306f1\u56de\u3057\u304b\u8a08\u7b97\u3057\u3066\u3044\u307e\u305b\u3093\u304c\uff09\u3088\u304f\u4f7f\u3046\u8a08\u7b97\u3092\u300c\u95a2\u6570\u300d\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u4f8b\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\uff0c\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u3092\u8a08\u7b97\u3059\u308b\u95a2\u6570 <code>calc()<\/code> \u3092\u5b9a\u7fa9\u3057\uff0c\u4e3b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u305d\u306e\u95a2\u6570\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code>calc<\/code> \u304c\u5b9f\u6570\u578b\u3067\u3042\u308b\u3053\u3068\u306f\uff0c\u4e3b\u30d7\u30ed\u30b0\u30e9\u30e0\u5185\u3067\u3082\uff0c\u95a2\u6570\u526f\u30d7\u30ed\u30b0\u30e9\u30e0\u5185\u3067\u3082 <code>real<\/code> \u3068\u3057\u3066\u5ba3\u8a00\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h4>engelcalc.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram engelcalc\r\n  implicit none\r\n  real :: spending, food, eng, calc\r\n  spending = 110000\r\n  food = 37000\r\n  eng = calc(spending, food)\r\n  print *, &quot;\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f&quot;, eng\r\nend program engelcalc\r\n\r\nfunction calc(spending, food)\r\n  ! \u6d88\u8cbb\u652f\u51fa spending \u3068\u98df\u8cbb food \u304b\u3089\r\n  ! \u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u3092\u8a08\u7b97\r\n  implicit none\r\n  real :: calc, spending, food\r\n  calc = food * 100 \/ spending\r\nend function calc\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2222 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv24-640x565.png\" alt=\"\" width=\"640\" height=\"565\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv24-640x565.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv24-300x265.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv24-1536x1355.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv24-306x270.png 306w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv24.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> \u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f   33.6363640    \r\n<\/pre>\n<h3>\u7df4\u7fd2 2<\/h3>\n<p>\u6d88\u8cbb\u652f\u51fa\u3092\u5165\u529b\u3059\u308b\u3068\uff0c\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u304c 20 ~ 40 \u3068\u306a\u308b\u98f2\u98df\u8cbb\u3092\u8868\u793a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308a\u306a\u3055\u3044\u3002<\/p>\n<h2>\u7d44\u307f\u8fbc\u307f\u95a2\u6570<\/h2>\n<p>\u95a2\u6570\u306f\u4e0a\u8a18\u306e\u4f8b\u306e\u3088\u3046\u306b\u81ea\u5206\u3067\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\uff0c\u3042\u3089\u304b\u3058\u3081\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u300c\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u300d\u3092\u4f7f\u3046\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\uff0c\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u306e\u4f8b\u3068\u3057\u3066\uff0c<\/p>\n<ul>\n<li>\u5c0f\u6570\u70b9\u4ee5\u4e0b\u3092\u5207\u308a\u6368\u3066\u308b <code>floor()<\/code><\/li>\n<li>\u5c0f\u6570\u70b9\u4ee5\u4e0b\u3092\u56db\u6368\u4e94\u5165\u3059\u308b <code>nint()<\/code><\/li>\n<\/ul>\n<p>\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3061\u306a\u307f\u306b\uff0c<\/p>\n<ul>\n<li>\u5c0f\u6570\u70b9\u4ee5\u4e0b\u3092\u5207\u308a\u4e0a\u3052\u308b\u95a2\u6570\u306f <code>ceiling()<\/code><\/li>\n<li><code>sqrt(x)<\/code> \u306f\u5e73\u65b9\u6839\uff0c<\/li>\n<li>\u4e09\u89d2\u95a2\u6570\u306f <code>sin(x)<\/code>, <code>cos(x)<\/code>, <code>tan(x)<\/code><\/li>\n<li>\u6307\u6570\u95a2\u6570\u306f <code>exp(x)<\/code>, \u81ea\u7136\u5bfe\u6570\u306f <code>log(x)<\/code>, \u5e38\u7528\u5bfe\u6570\u306f <code>log10(x)<\/code><\/li>\n<li><code>int(x)<\/code> \u306f\u5b9f\u6570\u3092\u6574\u6570\u306b\u5909\u63db\u3057\uff0c<code>real(n)<\/code> \u306f\u6574\u6570\u3092\u5b9f\u6570\u306b\u5909\u63db\u3057\u307e\u3059\u3002<code> dble(x)<\/code> \u306f\u500d\u7cbe\u5ea6\u5b9f\u6570\u306b\u5909\u63db\u3059\u308b\u306e\u3067\u3057\u305f\u3002<\/li>\n<\/ul>\n<h4>func.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram func\r\n  implicit none\r\n  real :: spending, food, eng\r\n  spending = 110000\r\n  food = 37000\r\n  eng = food * 100 \/ spending\r\n  print *, '\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f', eng\r\n  print *, '\u5207\u308a\u6368\u3066\u3067\u306f  ', floor(eng)\r\n  print *, '\u56db\u6368\u4e94\u5165\u3067\u306f  ', nint(eng)\r\nend\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2223 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv25-640x482.png\" alt=\"\" width=\"640\" height=\"482\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv25-640x482.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv25-300x226.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv25-1536x1157.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv25-358x270.png 358w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv25.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> \u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f   33.6363640    \r\n \u5207\u308a\u6368\u3066\u3067\u306f            33\r\n \u56db\u6368\u4e94\u5165\u3067\u306f            34\r\n<\/pre>\n<h3>Fortran \u306e\u7d44\u307f\u8fbc\u307f\u95a2\u6570<\/h3>\n<p>Fortran \u3067\u4f7f\u3048\u308b\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u306b\u3064\u3044\u3066\u306f\uff0c\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u691c\u7d22\u3059\u308b\u3068\uff0c\u3044\u308d\u3044\u308d\u898b\u3064\u304b\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\uff0c\u4ee5\u4e0b\u306e JAMSTEC \u306e\u30b5\u30a4\u30c8\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/www.jamstec.go.jp\/j\/\">JAMSTEC | \u6d77\u6d0b\u7814\u7a76\u958b\u767a\u6a5f\u69cb | \u30b8\u30e3\u30e0\u30b9\u30c6\u30c3\u30af<\/a>\n<ul>\n<li><a href=\"https:\/\/www.jamstec.go.jp\/es\/jp\/simschool\/f90learning\/\">Fortran90 \u30b3\u30fc\u30b9<\/a>\n<ul>\n<li><a href=\"https:\/\/www.jamstec.go.jp\/es\/jp\/simschool\/f90learning\/chap4\/page1.html\">4.1 \u7d44\u307f\u8fbc\u307f\u95a2\u6570<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u7df4\u7fd2 3<\/h3>\n<p>\u5c0f\u6570\u70b9\u4ee5\u4e0b\u3092\u5207\u308a\u4e0a\u3052\u305f\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306e\u5024\u3092\u8868\u793a\u3055\u305b\u308b\u3088\u3046\u306b\u4e0a\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5909\u66f4\u3057\u306a\u3055\u3044\u3002<\/p>\n<h2>\u6761\u4ef6\u5206\u5c90<\/h2>\n<p>\u6761\u4ef6\u5206\u5c90\u3068\u306f\uff0c\u4f8b\u3048\u3070\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306e\u5024\u306b\u3088\u3063\u3066\u5b9f\u884c\u6587\u3092\u5909\u3048\u308b\u3053\u3068\u3067\u3059\u3002\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\uff0c\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306e\u5024\u304c 40 \u4ee5\u4e0a\u3060\u3068\uff0c\u300c\u9ad8\u3044\u5024\u3067\u3059\u3002\u300d\u3068\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<h4>engelif.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram engelif\r\n  implicit none\r\n  real :: spending, food, eng\r\n  print *, &quot;\u6d88\u8cbb\u652f\u51fa? &quot;\r\n  read *, spending\r\n  print *, &quot;\u98f2\u98df\u8cbb? &quot;\r\n  read *, food\r\n  eng = food * 100 \/ spending\r\n  if (eng &gt;= 40) then\r\n    print *, &quot;\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f&quot;, eng, &quot;\u3067\u3059\u3002\u9ad8\u3044\u5024\u3067\u3059\u3002&quot;\r\n  else\r\n    print *, &quot;\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f&quot;, eng, &quot;\u3067\u3059\u3002&quot;\r\n  end if\r\nend program engelif\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2224 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv26-640x605.png\" alt=\"\" width=\"640\" height=\"605\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv26-640x605.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv26-300x284.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv26-1536x1452.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv26-286x270.png 286w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv26.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> \u6d88\u8cbb\u652f\u51fa? \r\n110000     &lt;----- \u30ad\u30fc\u30dc\u30fc\u30c9\u304b\u3089\u306e\u5165\u529b\r\n \u98f2\u98df\u8cbb? \r\n45000      &lt;----- \u30ad\u30fc\u30dc\u30fc\u30c9\u304b\u3089\u306e\u5165\u529b\r\n \u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306f   40.9090919     \u3067\u3059\u3002\u9ad8\u3044\u5024\u3067\u3059\u3002\r\n<\/pre>\n<p>\u6761\u4ef6\u5206\u5c90\u306e <code>if<\/code> \u6587\u306e\u66f8\u5f0f\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: fortran; light: true; title: ; notranslate\" title=\"\">\r\nif (\u6761\u4ef6\u5f0f1) then\r\n  \u6761\u4ef6\u5f0f1 \u304c\u6e80\u305f\u3055\u308c\u305f\u5834\u5408\u306b\u5b9f\u884c\u3059\u308b\u6587\r\nelse if (\u6761\u4ef6\u5f0f2) then\r\n  \u6761\u4ef6\u5f0f2 \u304c\u6e80\u305f\u3055\u308c\u305f\u5834\u5408\u306b\u5b9f\u884c\u3059\u308b\u6587\r\nelse if (\u6761\u4ef6\u5f0f3) then\r\n  \u6761\u4ef6\u5f0f3 \u304c\u6e80\u305f\u3055\u308c\u305f\u5834\u5408\u306b\u5b9f\u884c\u3059\u308b\u6587\r\n...\r\nelse\r\n  \u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306b\u5b9f\u884c\u3059\u308b\u6587\r\nend if\r\n<\/pre>\n<h3>\u95a2\u4fc2\u6f14\u7b97\u5b50<\/h3>\n<p>\u4e0a\u306e\u4f8b\u3067\u306f\uff0c<code>eng &gt;= 40<\/code> \u3064\u307e\u308a <code>eng<\/code> \u304c <code>40<\/code> \u4ee5\u4e0a\u306e\u3068\u304d\uff0c\u3068\u3044\u3046\u95a2\u4fc2\u6f14\u7b97\u5b50\u3092\u4f7f\u3044\u307e\u3057\u305f\u3002\u4ed6\u306e\u4f8b\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p><code>a == b<\/code> \u00a0\u00a0 <code>a<\/code> \u3068 <code>b<\/code> \u304c\u7b49\u3057\u3044\u3068\u304d<br \/>\n<code>a \/= b<\/code> \u00a0\u00a0 <code>a<\/code> \u3068 <code>b<\/code> \u304c\u7b49\u3057\u304f\u306a\u3044\u3068\u304d<br \/>\n<code>a &lt; b\u00a0<\/code> \u00a0\u00a0 <code>a<\/code> \u304c <code>b<\/code> \u3088\u308a\u5c0f\u3055\u3044\u3068\u304d<br \/>\n<code>a &lt;= b<\/code> \u00a0\u00a0 <code>a<\/code> \u304c <code>b<\/code> \u4ee5\u4e0b\u306e\u3068\u304d<br \/>\n<code>a &gt; b\u00a0<\/code> \u00a0\u00a0 <code>a<\/code> \u304c <code>b<\/code> \u3088\u308a\u5927\u304d\u3044\u3068\u304d<br \/>\n<code>a &gt;= b<\/code> \u00a0\u00a0 <code>a<\/code> \u304c <code>b<\/code> \u4ee5\u4e0a\u306e\u3068\u304d<\/p>\n<p>&nbsp;<\/p>\n<h3>\u7df4\u7fd2 4<\/h3>\n<p>\u4e0a\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0 <code>engelif.f90<\/code> \u306e\u6761\u4ef6\u5206\u5c90\u3092\uff0c\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u304c<\/p>\n<ol>\n<li>40 \u4ee5\u4e0a\u306e\u5834\u5408\u306b\u306f\u300c\u9ad8\u3044\u5024\u3067\u3059\u3002\u300d<\/li>\n<li>40 \u672a\u6e80 20 \u4ee5\u4e0a\u306e\u5834\u5408\u306b\u306f\u300c\u6b63\u5e38\u5024\u3067\u3059\u3002\u300d<\/li>\n<li>20 \u672a\u6e80\u306e\u5834\u5408\u306b\u306f\u300c\u4f4e\u3044\u5024\u3067\u3059\u3002\u300d<\/li>\n<\/ol>\n<p>\u3068\u8868\u793a\u3055\u305b\u308b\u3088\u3046\u306b\u5909\u66f4\u3057\uff0c<code>engelif2.f90<\/code> \u3068\u3057\u3066\u4fdd\u5b58\u3057\uff0c\u5b9f\u884c\u3057\u3066\u307f\u306a\u3055\u3044\u3002<\/p>\n<h2>\u7e70\u308a\u8fd4\u3057\u51e6\u7406<\/h2>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\uff0c1\u884c\u76ee\u3067\u4ee3\u5165\u3055\u308c\u305f\u6d88\u8cbb\u652f\u51fa\u306b\u5bfe\u3057\u3066\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002<\/p>\n<p>1\u56de\u3060\u3051\u8a08\u7b97\u3057\u3066\u8868\u793a\u3059\u308b\u306e\u3067\u306f\u306a\u304f\uff0c\u98f2\u98df\u8cbb\u306e\u521d\u671f\u5024\uff08\u3053\u3053\u3067\u306f <code>30000<\/code> \u5186\uff09\u304b\u3089\uff0c\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u3092\u8a08\u7b97\u3057\u3066\u8868\u793a\u3057\uff0c\u6761\u4ef6\u5f0f\uff08\u3053\u3053\u3067\u306f <code>50000<\/code> \u5186\u4ee5\u4e0b\uff09\u304c\u6210\u308a\u7acb\u3064\u5834\u5408\u306b\uff0c<code>5000<\/code> \u5186\u305a\u3064\u5897\u3084\u3057\u306a\u304c\u3089\u8a08\u7b97\u3068\u8868\u793a\u3092\u7d9a\u3051\u307e\u3059\u3002<\/p>\n<p>\u8868\u793a\u306e\u969b\u306b\uff0c\u5b9f\u6570\u3092\u6574\u6570\u306b\u5909\u63db\u3059\u308b\u95a2\u6570 <code>int<\/code> \u3084\u5c0f\u6570\u70b9\u4ee5\u4e0b\u3092\u56db\u6368\u4e94\u5165\u3059\u308b\u95a2\u6570 <code>nint<\/code> \u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4>engelloop1.f90<\/h4>\n<pre class=\"brush: fortran; highlight: [6,7]; title: ; notranslate\" title=\"\">\r\nprogram engelloop1\r\n  implicit none\r\n  real :: spending, food, eng\r\n  spending = 110000\r\n  food = 30000\r\n  print *, &quot;\u6d88\u8cbb\u652f\u51fa&quot;, int(spending), &amp;\r\n            &quot;\u5186\u306b\u5bfe\u3059\u308b\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306e\u5024&quot;\r\n  do while (food &lt;= 50000)\r\n    eng = food * 100 \/ spending\r\n    print *, &quot;  \u98f2\u98df\u8cbb&quot;, int(food), &quot;\u5186\u306e\u5834\u5408: &quot;, nint(eng)\r\n    food = food + 5000\r\n  end do\r\nend program engelloop1\r\n<\/pre>\n<p>6\u884c\u76ee\u306e\u6700\u5f8c\u306b <code>&amp;<\/code> \u3092\u3064\u3051\uff0c7\u884c\u76ee\u304c\u7d99\u7d9a\u884c\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u30021\u884c\u304c\u9577\u304f\u306a\u308b\u3068\u304d\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2225 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv27-640x604.png\" alt=\"\" width=\"640\" height=\"604\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv27-640x604.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv27-300x283.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv27-1536x1450.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv27-286x270.png 286w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv27.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> \u6d88\u8cbb\u652f\u51fa      110000 \u5186\u306b\u5bfe\u3059\u308b\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306e\u5024\r\n   \u98f2\u98df\u8cbb       30000 \u5186\u306e\u5834\u5408:           27\r\n   \u98f2\u98df\u8cbb       35000 \u5186\u306e\u5834\u5408:           32\r\n   \u98f2\u98df\u8cbb       40000 \u5186\u306e\u5834\u5408:           36\r\n   \u98f2\u98df\u8cbb       45000 \u5186\u306e\u5834\u5408:           41\r\n   \u98f2\u98df\u8cbb       50000 \u5186\u306e\u5834\u5408:           45\r\n<\/pre>\n<p><code>do while<\/code> \u6587\u306e\u66f8\u5f0f\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"brush: fortran; light: true; title: ; notranslate\" title=\"\">\r\ndo while (\u6761\u4ef6\u5f0f)\r\n    \u6761\u4ef6\u5f0f\u304c\u6210\u308a\u7acb\u3064\u5834\u5408\u306b\u5b9f\u884c\u3055\u308c\u308b\u6587\r\nend do\r\n<\/pre>\n<p>\u3053\u306e\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u306e <code>do while<\/code> \u6587\u306e\u4e2d\u306b\u51fa\u3066\u304f\u308b<\/p>\n<pre class=\"brush: fortran; light: true; title: ; notranslate\" title=\"\">\r\nfood = food + 5000\r\n<\/pre>\n<p>\u3068\u3044\u3046\u66f8\u304d\u65b9\u306f\uff0c\u6700\u521d\u306f\u3073\u3063\u304f\u308a\u3059\u308b\u304b\u3082\u77e5\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u6570\u5b66\u306e\u7b49\u5f0f\u3067\u306f\uff0c\u4e21\u8fba\u304c\u7b49\u3057\u304f\u306a\u308b\u3053\u3068\u306f\u306a\u3044\u306e\u3067\u610f\u5473\u306e\u306a\u3044\u5f0f\u3067\u3059\u304c\uff0cFortran \u3067\u306f\uff0c<code>=<\/code> \u306f\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7b49\u3057\u3044\u3053\u3068\u3092\u793a\u3059\u300c\u7b49\u53f7\u300d\u3067\u306f\u306a\u304f\uff0c\u53f3\u8fba\u3067\u8a08\u7b97\u3057\u305f\u6570\u5024\u3092\u5de6\u8fba\u306b\u300c\u4ee3\u5165\u300d\u3059\u308b\u3053\u3068\u3092\u8868\u3057\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3053\u306e\u5f0f\u306f\uff0c<\/p>\n<p style=\"padding-left: 40px;\">\u5909\u6570 <code>food<\/code> \u306e\u73fe\u5728\u306e\u5024\u306b <code>5000<\/code> \u3092\u8db3\u3057\u305f\u5024\u3092\u3042\u3089\u305f\u3081\u3066\u5909\u6570 <code>food<\/code> \u306b\u4ee3\u5165\u3059\u308b<\/p>\n<p>\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u540c\u69d8\u306e\u5185\u5bb9\u3092 <code>do<\/code> \u6587\u3067\u66f8\u3044\u305f\u4f8b\u304c\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<\/p>\n<h4>engelloop2.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram engelloop2\r\n  implicit none\r\n  integer :: i\r\n  real :: spending, food, eng\r\n  spending = 110000\r\n  print *, &quot;\u6d88\u8cbb\u652f\u51fa&quot;, int(spending), &amp;\r\n           &quot;\u5186\u306b\u5bfe\u3059\u308b\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306e\u5024&quot;\r\n  do i = 30000, 50000, 5000\r\n    food = float(i)\r\n    eng = food * 100 \/ spending\r\n    print *, &quot;  \u98f2\u98df\u8cbb&quot;, int(food), &quot;\u5186\u306e\u5834\u5408: &quot;, nint(eng)\r\n  end do\r\nend program engelloop2\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2226 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv28-640x604.png\" alt=\"\" width=\"640\" height=\"604\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv28-640x604.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv28-300x283.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv28-1536x1450.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv28-286x270.png 286w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv28.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> \u6d88\u8cbb\u652f\u51fa      110000 \u5186\u306b\u5bfe\u3059\u308b\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306e\u5024\r\n   \u98f2\u98df\u8cbb       30000 \u5186\u306e\u5834\u5408:           27\r\n   \u98f2\u98df\u8cbb       35000 \u5186\u306e\u5834\u5408:           32\r\n   \u98f2\u98df\u8cbb       40000 \u5186\u306e\u5834\u5408:           36\r\n   \u98f2\u98df\u8cbb       45000 \u5186\u306e\u5834\u5408:           41\r\n   \u98f2\u98df\u8cbb       50000 \u5186\u306e\u5834\u5408:           45\r\n<\/pre>\n<p><code>do<\/code> \u6587\u306e\u66f8\u5f0f\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"brush: fortran; light: true; title: ; notranslate\" title=\"\">\r\ndo ivar = istart, iend, istep\r\n    ivar \u304c istart \u304b\u3089 iend \u306e\u9593\uff0c\u5b9f\u884c\u3055\u308c\u308b\u6587\r\nend do\r\n<\/pre>\n<p><code>ivar<\/code> \u306f\u6574\u6570\u5909\u6570\u3067\uff0c\u305d\u306e\u521d\u671f\u5024\u306f <code>istart<\/code>\u3002\u6587\u304c\u5b9f\u884c\u3055\u308c\u308b\u3054\u3068\u306b\uff0c<code>ivar<\/code> \u306e\u5024\u306f <code>istep<\/code> \u3060\u3051\u52a0\u7b97\u3055\u308c\uff0c<code>iend<\/code> \u306e\u5024\u306b\u306a\u308b\u3068\u30eb\u30fc\u30d7\u304c\u7d42\u4e86\u3057\u307e\u3059\u3002<code>istep<\/code> \u3092\u7701\u7565\u3057\u305f\u5834\u5408\u306f <code>1<\/code> \u3068\u307f\u306a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\uff0c\u5ff5\u306e\u305f\u3081\uff0c\u57fa\u672c\u6574\u6570\u578b\uff08<code>integer<\/code>\uff09\u306e <code>i<\/code> \u3092\u5b9f\u6570\u578b\uff08<code>real<\/code>\uff09\u306b\u5909\u63db\u3059\u308b\u7d44\u307f\u8fbc\u307f\u95a2\u6570 <code>float()<\/code> \u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<code>float()<\/code> \u306f <code>real()<\/code> \u3068\u540c\u3058\u3067\u3059\u3002<\/p>\n<h3>\u7df4\u7fd2 5<\/h3>\n<p>\u4ee5\u4e0b\u306e\u5024\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\uff0c\u5b9f\u884c\u3057\u3066\u307f\u306a\u3055\u3044\u3002<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 53px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/ql-cache\/quicklatex.com-a1bd0d07202f824a1664bbc5010bb3ca_l3.png\" height=\"53\" width=\"47\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#091;&#92;&#115;&#117;&#109;&#95;&#123;&#110;&#61;&#49;&#125;&#94;&#123;&#49;&#48;&#125;&#32;&#110;&#94;&#50;&#92;&#093;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<h2>\u914d\u5217\u3068\u30d5\u30a1\u30a4\u30eb<\/h2>\n<h3>\u914d\u5217<\/h3>\n<p>\u6210\u5206\u304c5\u500b\u306e\u914d\u5217\u3092\u5ba3\u8a00\u3057\uff0c\u5404\u6210\u5206\u306b\u6570\u5024\u3092\u5165\u308c\u305f\u308a\u8868\u793a\u3057\u305f\u308a\u3059\u308b\u4f8b\u3067\u3059\u3002<\/p>\n<h4>array.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram array\r\n  implicit none\r\n  integer :: a(5), b(5), i\r\n  ! a \u306e\u5404\u6210\u5206\u3092\u8a2d\u5b9a\r\n  a = &#x5B;5, 4, 3, 2, 1]\r\n  print *, '\u5168\u6210\u5206\u3092\u4e00\u6319\u306b\u8868\u793a'\r\n  print *, a\r\n  print *, '\u7e26\u306b\u8868\u793a'\r\n  do i = 1, 5\r\n    print *, a(i)\r\n  end do\r\n  ! b \u306e\u5168\u6210\u5206\u3092 0 \u306b\r\n  b = 0\r\n  ! \u7b2c3\u6210\u5206\u306e\u5024\u3092\u8a2d\u5b9a\r\n  b(3) = 3\r\n  print *, '1\u3064\u3060\u3051 0 \u3067\u306a\u3044\u6210\u5206\u3092\u3082\u3064\u914d\u5217'\r\n  print *, b\r\nend program array\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2227 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv29-640x747.png\" alt=\"\" width=\"640\" height=\"747\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv29-640x747.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv29-300x350.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv29-1317x1536.png 1317w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv29-231x270.png 231w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv29.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre> \u5168\u6210\u5206\u3092\u4e00\u6319\u306b\u8868\u793a\r\n           5           4           3           2           1\r\n \u7e26\u306b\u8868\u793a\r\n           5\r\n           4\r\n           3\r\n           2\r\n           1\r\n 1\u3064\u3060\u3051 0 \u3067\u306a\u3044\u6210\u5206\u3092\u3082\u3064\u914d\u5217\r\n           0           0           3           0           0\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3>\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u914d\u5217\u3078\u8aad\u307f\u8fbc\u307f<\/h3>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb <code>mydata.txt<\/code> \u3092\u7528\u610f\u3057\u307e\u3059\u3002<\/p>\n<pre>$ cat mydata.txt\r\n1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n<\/pre>\n<p>\u4ee5\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\uff0c\u30d5\u30a1\u30a4\u30eb <code>mydata.txt<\/code> \u306e\u6570\u5024\u3092\u6210\u5206\u304c6\u500b\u306e\u914d\u5217 <code>a<\/code> \u306b\u8aad\u307f\u8fbc\u307f\uff0c\u6210\u5206\u306e\u7dcf\u548c\uff0c\u5e73\u5747\uff0c\u6700\u5927\u5024\uff0c\u6700\u5c0f\u5024\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<h4>readdata1.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram readdata1\r\n  implicit none\r\n  integer :: row\r\n  real :: a(6)\r\n  open(10, file = 'mydata.txt')\r\n  read(10, *) a\r\n  do row = 1, 6\r\n    print *, a(row)\r\n  end do\r\n  ! \u6210\u5206\u306e\u548c\u306f sum(a)\r\n  print *, '\u6210\u5206\u306e\u7dcf\u548c\u306f', sum(a)\r\n  ! \u6210\u5206\u306e\u500b\u6570\u306f size(a)\r\n  print *, '\u6210\u5206\u306e\u5e73\u5747\u306f', sum(a)\/size(a)\r\n  print *, '\u6700\u5927\u5024\u306f    ', maxval(a)\r\n  print *, '\u6700\u5c0f\u5024\u306f    ', minval(a)\r\nend program readdata1\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2228 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv30-640x722.png\" alt=\"\" width=\"640\" height=\"722\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv30-640x722.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv30-300x338.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv30-1362x1536.png 1362w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv30-239x270.png 239w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv30.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre>   1.00000000    \r\n   2.00000000    \r\n   3.00000000    \r\n   4.00000000    \r\n   5.00000000    \r\n   6.00000000    \r\n \u6210\u5206\u306e\u7dcf\u548c\u306f   21.0000000    \r\n \u6210\u5206\u306e\u5e73\u5747\u306f   3.50000000    \r\n \u6700\u5927\u5024\u306f       6.00000000    \r\n \u6700\u5c0f\u5024\u306f       1.00000000    \r\n<\/pre>\n<p>\u6b21\u306f\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u300c6\u884c2\u5217\u300d\u306e\u30c7\u30fc\u30bf\u304c\u5165\u3063\u305f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb <code>mydata2.txt<\/code> \u3092\u8aad\u307f\u8fbc\u3080\u4f8b\u3067\u3059\u3002<\/p>\n<pre>$ cat mydata2.txt\r\n1  1\r\n2  4\r\n3  9\r\n4 16\r\n5 25\r\n6 36\r\n<\/pre>\n<h4>readdata2ng.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram readdata2ng\r\n  implicit none\r\n  integer :: row, col\r\n  integer :: b(6, 2)\r\n  open(10, file = 'mydata2.txt')\r\n  read(10, *) b\r\n  do row = 1, 6\r\n    print *, (b(row, col), col = 1, 2)\r\n  end do\r\nend program readdata2ng\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2229 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv31-640x538.png\" alt=\"\" width=\"640\" height=\"538\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv31-640x538.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv31-300x252.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv31-1536x1291.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv31-321x270.png 321w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv31.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre>           1           4\r\n           1          16\r\n           2           5\r\n           4          25\r\n           3           6\r\n           9          36\r\n<\/pre>\n<p>\u4e0a\u306e\u7d50\u679c\u304b\u3089\u308f\u304b\u308b\u3088\u3046\u306b\uff0c<code>dimension(6, 2)<\/code> \u306e\u914d\u5217 <code>b<\/code> \u3092\u7528\u610f\u3057\u3066 <code>read(10, *) b<\/code> \u3068\u3059\u308b\u3060\u3051\u3067\u306f\uff0c\u671f\u5f85\u3057\u305f\u3088\u3046\u306b\u306f\u8aad\u307f\u8fbc\u307e\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u30c8\u30ea\u30c3\u30ad\u30fc\u3067\u3059\u304c\uff0c<code>dimension(2, 6)<\/code> \u306e\u914d\u5217 \u306b\u8aad\u307f\u8fbc\u307e\u305b\u3066\uff0c\u305d\u306e\u8ee2\u7f6e\u3092\u3068\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u4ee5\u4e0b\u306e\u4f8b\u3092\u53c2\u7167\u3002<\/p>\n<h4>readdata2.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram readdata2\r\n  implicit none\r\n  integer :: row, col\r\n  integer :: b(2, 6), c(6, 2)\r\n  open(10, file = 'mydata2.txt')\r\n  ! \u3042\u3048\u3066 dimension(2, 6) \u306e\u914d\u5217 b \u306b\u8aad\u307f\u8fbc\u3080\r\n  read(10, *) b\r\n  ! b \u306e\u8ee2\u7f6e\u884c\u5217\u3092 c \u306b\u4ee3\u5165\r\n  c = transpose(b)\r\n  do row = 1, 6\r\n    print *, (c(row, col), col = 1, 2)\r\n  end do\r\nend program readdata2\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2230 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv32-640x597.png\" alt=\"\" width=\"640\" height=\"597\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv32-640x597.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv32-300x280.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv32-1536x1434.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv32-289x270.png 289w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv32.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre>           1           1\r\n           2           4\r\n           3           9\r\n           4          16\r\n           5          25\r\n           6          36\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3>\u30d5\u30a1\u30a4\u30eb\u3078\u66f8\u304d\u8fbc\u307f<\/h3>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u8fbc\u307f\u4f8b\u3067\u3059\u3002<\/p>\n<h4>writedata.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram writedata\r\n  implicit none\r\n  integer :: i\r\n  real :: x\r\n  open(12, file = 'myoutput.txt')\r\n  do i = 1, 10\r\n    x = i * 0.1\r\n    write(12, *) x, sin(x)\r\n  end do\r\nend program writedata\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2231 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv33-640x618.png\" alt=\"\" width=\"640\" height=\"618\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv33-640x618.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv33-300x290.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv33-1536x1483.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv33-280x270.png 280w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv33.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u66f8\u304d\u8fbc\u307e\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u8868\u793a\uff1a<\/p>\n<pre>$ cat myoutput.txt\r\n  0.100000001       9.98334214E-02\r\n  0.200000003      0.198669329    \r\n  0.300000012      0.295520216    \r\n  0.400000006      0.389418334    \r\n  0.500000000      0.479425550    \r\n  0.600000024      0.564642489    \r\n  0.699999988      0.644217670    \r\n  0.800000012      0.717356086    \r\n  0.900000036      0.783326924    \r\n   1.00000000      0.841470957    \r\n$ \r\n<\/pre>\n<h2>\u66f8\u5f0f\u6307\u5b9a<\/h2>\n<p>\u753b\u9762\u3078\u306e\u51fa\u529b\u306e\u969b\uff0c<code>print *, ...<\/code> \u306a\u3069\u3068\u66f8\u3044\u3066\u3044\u305f\u304c\uff0c\u3053\u306e <code>*<\/code> \u306e\u90e8\u5206\u306b\u3064\u3044\u3066\u3002<\/p>\n<p><code>*<\/code> \u306f\uff08\u7279\u306b\u66f8\u5f0f\u3092\u3057\u306a\u3044\u3067\uff09\u304a\u307e\u304b\u305b\u3067\u51fa\u529b\u3055\u305b\u308b\u3002\u66f8\u5f0f\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u3068\u304d\u306b\u306f <code>*<\/code> \u306e\u5834\u6240\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n<h3>\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306e\u6307\u5b9a<\/h3>\n<p>\u5b9f\u6570\u3092\u8868\u793a\u3059\u308b\u969b\uff0c\u5168\u4f53\u306e\u6587\u5b57\u6570\u3068\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306e\u6841\u6570\u3092\u6307\u5b9a\u3057\u3066\u8868\u793a\u3055\u305b\u308b\u4f8b\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070 <code>'(f8.5)'<\/code> \u306f\u5168\u4f53\u3067 <code>8<\/code> \u6841\u306e\u8868\u793a\u7bc4\u56f2\u3092\u3068\u308a\uff0c\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306f <code>5<\/code> \u6841\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<h4>formatf.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram formatf\r\n  implicit none\r\n  character(10) :: ten = '1234567890'\r\n  ! 15\u6841\uff08\u4ee5\u4e0a\uff09\u306e\u6709\u52b9\u6841\u6570\u3092\u6301\u3064\u5b9f\u6570\u306e\u5b9a\u7fa9\r\n  integer, parameter :: dp = selected_real_kind(p=15)\r\n  real(dp) :: sqrtwo\r\n  sqrtwo = sqrt(2.0E0_dp)\r\n  print '(2a10, a)', ten, ten, ' \u6841\u6570'\r\n  print '(f8.5)', sqrtwo\r\n  print '(f18.15)', sqrtwo\r\n  ! \u5165\u308c\u5b50\u306b\u3059\u308b\u5834\u5408\u306f&quot; \u3068 ' \u3067\u4f7f\u3044\u5206\u3051\u308b\r\n  print '(&quot;2\u306e\u5e73\u65b9\u6839\u306f&quot;, f18.15, &quot; \u3067\u3059\u3002&quot;)', sqrtwo\r\nend program formatf\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2232 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv34-640x568.png\" alt=\"\" width=\"640\" height=\"568\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv34-640x568.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv34-300x266.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv34-1536x1364.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv34-304x270.png 304w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv34.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre>12345678901234567890 \u6841\u6570\r\n 1.41421\r\n 1.414213562373095\r\n2\u306e\u5e73\u65b9\u6839\u306f 1.414213562373095 \u3067\u3059\u3002\r\n<\/pre>\n<h3>\u7df4\u7fd2 6<\/h3>\n<p><a href=\"#engel2f90\">engel2.f90<\/a> \u306e\u51fa\u529b\u3092\uff0c\u30a8\u30f3\u30b2\u30eb\u4fc2\u6570\u306e\u5024\u3092\uff08\u56db\u6368\u4e94\u5165\u3057\u3066\uff09\u5c0f\u6570\u70b9\u4ee5\u4e0b1\u6841\u307e\u3067\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3057\u306a\u3055\u3044\u3002<\/p>\n<h3>\u6307\u6570\u8868\u5f0f\u306e\u6307\u5b9a<\/h3>\n<p>\u975e\u5e38\u306b\u5927\u304d\u3044\u6570\u3084\u5c0f\u3055\u3044\u6570\u3092\u8868\u793a\u3059\u308b\u3068\u304d\u306b\u306f\uff0c <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/ql-cache\/quicklatex.com-cfd7bb50bd030f8fddffa15eafebb2da_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#49;&#46;&#57;&#56;&#57;&#49;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#49;&#48;&#94;&#123;&#51;&#48;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"102\" style=\"vertical-align: 0px;\"\/>\u00a0 \u3084 <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/ql-cache\/quicklatex.com-8c5cf3951e242f17f3d83974716de0d2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#54;&#46;&#54;&#55;&#52;&#51;&#48;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#49;&#48;&#94;&#123;&#45;&#49;&#49;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"122\" style=\"vertical-align: 0px;\"\/> \u306a\u3069\u306e\u3088\u3046\u306a\u6307\u6570\u8868\u793a\u3092\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070 <code>'(e9.2)'<\/code> \u3067\u306f\uff0c\u5168\u4f53\u3067 <code>9<\/code> \u6841\u306e\u8868\u793a\u5206\u3092\u78ba\u4fdd\u3057\uff0c\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306f <code>2<\/code> \u6841\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u307e\u307e\u3060\u3068\u6574\u6570\u90e8\u5206\u304c <code>0<\/code> \u3067\u59cb\u307e\u308b\u306e\u3067\uff0c<code>'(1pe9.2)'<\/code> \u3068\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<h4>formate.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram formate\r\n  implicit none\r\n  character(10) :: ten\r\n  ! \u5149\u901f\u306f9\u6841\u306e\u5b9a\u7fa9\u5b9a\u6570\uff08\u8aa4\u5dee\u7121\u3057\uff09\r\n  integer, parameter :: c = 299792458\r\n  ! 9\u6841\uff08\u4ee5\u4e0a\uff09\u306e\u6709\u52b9\u6841\u6570\u3092\u6301\u3064\u5b9f\u6570\u306e\u5b9a\u7fa9\r\n  integer, parameter :: dp = selected_real_kind(p=9)\r\n  real(dp) :: val\r\n  val = c\r\n  ten = '1234567890'\r\n  print '(2a10, a)',  ten, ten, ' \u6841\u6570'\r\n  print '(e9.2)', val\r\n  print '(1pe9.2)', val\r\n  print '(1pe15.8)', val\r\n  ! \u5165\u308c\u5b50\u306b\u3059\u308b\u5834\u5408\u306f&quot; \u3068 ' \u3067\u4f7f\u3044\u5206\u3051\u308b\r\n  print '(&quot;\u5149\u901f\u306f&quot;, 1pe15.8, &quot; m\/s \u3067\u3059\u3002&quot;)', val\r\nend program formate\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2233 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35-640x667.png\" alt=\"\" width=\"640\" height=\"667\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35-640x667.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35-300x313.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35-1473x1536.png 1473w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35-259x270.png 259w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre>12345678901234567890 \u6841\u6570\r\n 0.30E+09\r\n 3.00E+08\r\n 2.99792458E+08\r\n\u5149\u901f\u306f 2.99792458E+08 m\/s \u3067\u3059\u3002\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3>\u6587\u5b57\u578b\u306e\u66f8\u5f0f\u6307\u5b9a<\/h3>\n<h4>formata.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram formata\r\n  implicit none\r\n  character(10) :: ten\r\n  ten = '1234567890'\r\n  print '(a, a)', ten, ten\r\n  print '(2a)', ten, ten\r\n  print '(2a5)', ten, ten\r\n  print '(a6,a4)', ten, ten\r\nend program formata\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2234 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv36-640x487.png\" alt=\"\" width=\"640\" height=\"487\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv36-640x487.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv36-300x228.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv36-1536x1168.png 1536w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv36-355x270.png 355w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv36.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre>12345678901234567890\r\n12345678901234567890\r\n1234512345\r\n1234561234\r\n<\/pre>\n<h3>\u6574\u6570\u306e\u66f8\u5f0f\u6307\u5b9a<\/h3>\n<h4>formati.f90<\/h4>\n<pre class=\"brush: fortran; title: ; notranslate\" title=\"\">\r\nprogram formati\r\n  implicit none\r\n  integer :: v(4), m(4, 4)\r\n  integer :: row, col\r\n  ! v \u306e\u6210\u5206\r\n  v = &#x5B;1, 23, 456, 7890]\r\n  do row = 1, 4\r\n    print '(i5)', v(row)\r\n  end do\r\n  ! 4\u884c4\u5217\u306e\u6210\u5206\u3092\u5168\u3066 0 \u306b\r\n  m = 0\r\n  ! \u5bfe\u89d2\u6210\u5206\r\n  m(1,1) = 1\r\n  m(2,2) = 23\r\n  m(3,3) = 456\r\n  m(4,4) = 7890\r\n  ! \u66f8\u5f0f\u6307\u5b9a\u3067\u5c0f\u7dba\u9e97\u306b\u8868\u793a\r\n  do row = 1, 4\r\n    print '(4i5)', (m(row, col), col = 1, 4)\r\n  end do\r\nend program formati\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2235 size-large\" src=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35a-640x795.png\" alt=\"\" width=\"640\" height=\"795\" srcset=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35a-640x795.png 640w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35a-300x373.png 300w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35a-1236x1536.png 1236w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35a-1648x2048.png 1648w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35a-217x270.png 217w, https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-content\/uploads\/sites\/25\/forv35a.png 1680w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre>    1\r\n   23\r\n  456\r\n 7890\r\n    1    0    0    0\r\n    0   23    0    0\r\n    0    0  456    0\r\n    0    0    0 7890\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u845b\u897f \u771f\u5bff\u3000\u5f18\u524d\u5927\u5b66\u5927\u5b66\u9662\u7406\u5de5\u5b66\u7814\u7a76\u79d1 Jupyter Fo <a href=\"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/vscode-de-fortran\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-2060","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/pages\/2060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/comments?post=2060"}],"version-history":[{"count":39,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/pages\/2060\/revisions"}],"predecessor-version":[{"id":2342,"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/pages\/2060\/revisions\/2342"}],"wp:attachment":[{"href":"https:\/\/home.hirosaki-u.ac.jp\/heroic-2020\/wp-json\/wp\/v2\/media?parent=2060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}