{"id":5645,"date":"2024-05-22T18:50:27","date_gmt":"2024-05-22T09:50:27","guid":{"rendered":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/?page_id=5645"},"modified":"2024-05-27T20:33:01","modified_gmt":"2024-05-27T11:33:01","slug":"wrf-with-intel-oneapi","status":"publish","type":"page","link":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/?page_id=5645","title":{"rendered":"WRF with Intel oneAPI"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">22 May 2024, Han Soo Lee<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">WRF (v4.4 and v4.6.0) compilation with Intel oneAPI<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Before installing the WRF, you must install the Netcdf with Intel oneAPI first. Then, compile the WRF with the following steps.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install necessary library such as <code>libpng<\/code> and <code>Jasper<\/code>. The other libraries such as <code>zlib, szip, CUnit, UDUNITS, curl, Netcdf<\/code> should be installed beforehand following <strong><a href=\"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/?page_id=5612\" data-type=\"page\" data-id=\"5612\" target=\"_blank\" rel=\"noreferrer noopener\">the instruction<\/a><\/strong>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In the following build_scripts, you have to modify&nbsp;<code><strong>HOME<\/strong><\/code>&nbsp;variable according to your HPC system environment. Check out the&nbsp;<strong>versions<\/strong>&nbsp;of the library carefully as well.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>We used the&nbsp;<code>Downloads<\/code>&nbsp;in&nbsp;<code>home&nbsp;<\/code>directory for the process below.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">libpng<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">make a script,&nbsp;<code>build_libpng.sh<\/code>, in&nbsp;<code>~\/Downloads\/<\/code>&nbsp;as below, and run the code after changing the mode,&nbsp;<code>chmod a+x build_libpng.sh<\/code><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nHOME=\"\/home\/hslee\/Downloads\/wrf_libs_intel\"\n\n# build_libpng.sh\nversion_libpng=\"1.6.43\"\nwget http:\/\/prdownloads.sourceforge.net\/libpng\/libpng-${version_libpng}.tar.gz\n\ntar xvf libpng-${version_libpng}.tar.gz\ncd libpng-${version_libpng}\/\n\n.\/configure --prefix=${HOME}\/libpng\/${version_libpng}\nmake\nmake install<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Jasper<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">make a script,&nbsp;<code>build_udunits.sh<\/code>, and run the script in the same way as above.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nHOME=\"\/home\/hslee\/Downloads\/wrf_libs_intel\"\n\n# build_jasper.sh\nversion_jasper=\"1.900.29\"\nwget https:\/\/www.ece.uvic.ca\/~frodo\/jasper\/software\/jasper-${version_jasper}.tar.gz\ntar xvf jasper-${version_jasper}.tar.gz\ncd jasper-${version_jasper}\/\n#\n.\/configure --prefix=${HOME}\/jasper\/${version_jasper}\nmake\nmake install<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">add the following in&nbsp;<code>~\/.bashrc<\/code>, then log-in again. You have to change \u201c\/home\/hslee\/Downloads\/wrf_libs_intel\u201d according to your environment.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code># JASPER\nexport JASPERLIB=\"-L\/home\/hslee\/Downloads\/wrf_libs_intel\/jasper\/1.900.29\/lib\"\nexport JASPERINC=\"-I\/home\/hslee\/Downloads\/wrf_libs_intel\/jasper\/1.900.29\/include\"<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">WRF (v4.4 and v4.6.0) compilation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You have to change NETCDF according to your environment as you already installed by following <strong><a href=\"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/?page_id=5612\" data-type=\"page\" data-id=\"5612\">the<\/a><a href=\"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/?page_id=5612\" data-type=\"page\" data-id=\"5612\" target=\"_blank\" rel=\"noreferrer noopener\"> <\/a><a href=\"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/?page_id=5612\" data-type=\"page\" data-id=\"5612\">instruction<\/a>.<\/strong> <\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>export NETCDF=\/home\/hslee\/Downloads\/wrf_libs_intel\/netcdf4-intel\/\nexport HDF5=\/home\/hslee\/Downloads\/wrf_libs_intel\/hdf5\/1.12.0\nwget https:\/\/github.com\/wrf-model\/WRF\/archive\/v4.4.tar.gz\n#wget https:\/\/github.com\/wrf-model\/WRF\/archive\/v4.6.0.tar.gz\ntar xvf v4.4.tar.gz\ncd WRF-4.4\/\n.\/configure <\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Output<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>checking for perl5... no\nchecking for perl... found \/usr\/bin\/perl (perl)\nWill use NETCDF in dir: \/home\/hslee\/Downloads\/wrf_libs_intel\/netcdf4-intel\nADIOS2 not set in environment. Will configure WRF for use without.\nHDF5 not set in environment. Will configure WRF for use without.\nPHDF5 not set in environment. Will configure WRF for use without.\nWill use 'time' to report timing information\n\n\nIf you REALLY want Grib2 output from WRF, modify the arch\/Config.pl script.\nRight now you are not getting the Jasper lib, from the environment, compiled into WRF.\n\n------------------------------------------------------------------------\nPlease select from among the following Linux x86_64 options:\n\n  1. (serial)   2. (smpar)   3. (dmpar)   4. (dm+sm)   PGI (pgf90\/gcc)\n  5. (serial)   6. (smpar)   7. (dmpar)   8. (dm+sm)   PGI (pgf90\/pgcc): SGI MPT\n  9. (serial)  10. (smpar)  11. (dmpar)  12. (dm+sm)   PGI (pgf90\/gcc): PGI accelerator\n 13. (serial)  14. (smpar)  15. (dmpar)  16. (dm+sm)   INTEL (ifort\/icc)\n                                         17. (dm+sm)   INTEL (ifort\/icc): Xeon Phi (MIC architecture)\n 18. (serial)  19. (smpar)  20. (dmpar)  21. (dm+sm)   INTEL (ifort\/icc): Xeon (SNB with AVX mods)\n 22. (serial)  23. (smpar)  24. (dmpar)  25. (dm+sm)   INTEL (ifort\/icc): SGI MPT\n 26. (serial)  27. (smpar)  28. (dmpar)  29. (dm+sm)   INTEL (ifort\/icc): IBM POE\n 30. (serial)               31. (dmpar)                PATHSCALE (pathf90\/pathcc)\n 32. (serial)  33. (smpar)  34. (dmpar)  35. (dm+sm)   GNU (gfortran\/gcc)\n 36. (serial)  37. (smpar)  38. (dmpar)  39. (dm+sm)   IBM (xlf90_r\/cc_r)\n 40. (serial)  41. (smpar)  42. (dmpar)  43. (dm+sm)   PGI (ftn\/gcc): Cray XC CLE\n 44. (serial)  45. (smpar)  46. (dmpar)  47. (dm+sm)   CRAY CCE (ftn $(NOOMP)\/cc): Cray XE and XC\n 48. (serial)  49. (smpar)  50. (dmpar)  51. (dm+sm)   INTEL (ftn\/icc): Cray XC\n 52. (serial)  53. (smpar)  54. (dmpar)  55. (dm+sm)   PGI (pgf90\/pgcc)\n 56. (serial)  57. (smpar)  58. (dmpar)  59. (dm+sm)   PGI (pgf90\/gcc): -f90=pgf90\n 60. (serial)  61. (smpar)  62. (dmpar)  63. (dm+sm)   PGI (pgf90\/pgcc): -f90=pgf90\n 64. (serial)  65. (smpar)  66. (dmpar)  67. (dm+sm)   INTEL (ifort\/icc): HSW\/BDW\n 68. (serial)  69. (smpar)  70. (dmpar)  71. (dm+sm)   INTEL (ifort\/icc): KNL MIC\n 72. (serial)  73. (smpar)  74. (dmpar)  75. (dm+sm)   AMD (flang\/clang) :  AMD ZEN1\/ ZEN2\/ ZEN3 Architectures\n 76. (serial)  77. (smpar)  78. (dmpar)  79. (dm+sm)   INTEL (ifx\/icx) : oneAPI LLVM\n 80. (serial)  81. (smpar)  82. (dmpar)  83. (dm+sm)   FUJITSU (frtpx\/fccpx): FX10\/FX100 SPARC64 IXfx\/Xlfx\n\nEnter selection &#91;1-83] : 15\n------------------------------------------------------------------------\nCompile for nesting? (1=basic, 2=preset moves, 3=vortex following) &#91;default 1]: 1\n\nConfiguration successful! \n------------------------------------------------------------------------\ntesting for fseeko and fseeko64\nfseeko64 is supported\n------------------------------------------------------------------------\n...<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"edit-configurewrf\">Edit configure.wrf<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the following for (dmpar) option in configure.wrf:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>DM_FC           =       mpiifort\nDM_CC           =       mpiicc<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">compile the code<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/compile em_real | tee compile.log<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Here, it will take around 30-40 min to complete the compilation. Chill out with a cup of coffee! Fingers crossed!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Output<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>---&gt;                  Executables successfully built                  &lt;---\n \n-rwxrwxr-x 1 wrf wrf 40691640 Jul 30 12:35 main\/ndown.exe\n-rwxrwxr-x 1 wrf wrf 40572760 Jul 30 12:35 main\/real.exe\n-rwxrwxr-x 1 wrf wrf 40048888 Jul 30 12:35 main\/tc.exe\n-rwxrwxr-x 1 wrf wrf 44609360 Jul 30 12:35 main\/wrf.exe\n \n==========================================================================<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes, you have to re-run the configure and compile again, if you do not have the *.exe files as the output.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/clean -a<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Then, repeat the configure and compile process.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>WPS compilation<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It will be updated soon.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>22 May 2024, Han Soo Lee WRF (v4.4 and v4.6.0) compilation with Intel oneAPI Before installing the WRF, you must install the Netcdf with Intel oneAPI first. Then, compile the WRF with the following steps. Install necessary library such as&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/?page_id=5645\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1535,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5645","page","type-page","status-publish","hentry"],"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"hslee","author_link":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/?author=1"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":"22 May 2024, Han Soo Lee WRF (v4.4 and v4.6.0) compilation with Intel oneAPI Before installing the WRF, you must install the Netcdf with Intel oneAPI first. Then, compile the WRF with the following steps. Install necessary library such as...Read more","_links":{"self":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/index.php?rest_route=\/wp\/v2\/pages\/5645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5645"}],"version-history":[{"count":20,"href":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/index.php?rest_route=\/wp\/v2\/pages\/5645\/revisions"}],"predecessor-version":[{"id":5675,"href":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/index.php?rest_route=\/wp\/v2\/pages\/5645\/revisions\/5675"}],"up":[{"embeddable":true,"href":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/index.php?rest_route=\/wp\/v2\/pages\/1535"}],"wp:attachment":[{"href":"https:\/\/home.hiroshima-u.ac.jp\/~leehs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}