{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/49951211","id":49951211,"diff_hunk":"@@ -526,6 +572,185 @@ pure function find_energy_index(mat, E) result(i)\n   end function find_energy_index\n \n !===============================================================================\n+! MULTIPOLE_EVAL_ALLOCATE allocates fixed-length arrays that vary based on\n+! what nuclides are loaded into the problem\n+!===============================================================================\n+\n+  subroutine multipole_eval_allocate()\n+    allocate(sigT_factor(max_L))\n+    allocate(twophi(max_L))\n+    allocate(broadened_polynomials(max_poly))\n+\n+    mp_already_alloc = .TRUE.\n+  end subroutine\n+\n+!===============================================================================\n+! MULTIPOLE_EVAL evaluates the windowed multipole equations for cross\n+! sections in the resolved resonance regions\n+!===============================================================================\n+\n+  subroutine multipole_eval(multipole, Emev, sqrtkT, sigT, sigA, sigF)\n+    type(MultipoleArray), intent(in) :: multipole                    !< The windowed multipole object to process.\n+    real(8), intent(in)              :: Emev                         !< The energy at which to evaluate the cross section in MeV\n+    real(8), intent(in)              :: sqrtkT                       !< The temperature in the form sqrt(kT (in eV)), at which to evaluate the cross section.\n+    real(8), intent(out)             :: sigT                         !< Total cross section\n+    real(8), intent(out)             :: sigA                         !< Absorption cross section\n+    real(8), intent(out)             :: sigF                         !< Fission cross section\n+    complex(8) :: PSIIKI\n+    complex(8) :: CDUM1\n+    complex(8) :: w_val\n+    complex(8) :: Z\n+    real(8) :: sqrtE\n+    real(8) :: invE\n+    real(8) :: DOPP\n+    real(8) :: DOPP_ECOEF\n+    real(8) :: temp\n+    real(8) :: E\n+    integer :: iP\n+    integer :: iC\n+    integer :: iW\n+    integer :: startw\n+    integer :: startw_1\n+    integer :: startw_endw\n+    integer :: endw\n+\n+    ! Convert to eV\n+    E = Emev * 1.0D6\n+\n+    sqrtE = sqrt(E)\n+    invE = E**(-1)\n+\n+    if(mp_already_alloc .eqv. .FALSE.) then\n+      call multipole_eval_allocate()\n+    end if\n+\n+    ! Locate us\n+    iW = floor((sqrtE - sqrt(multipole % start_E))/multipole % spacing + 1.0_8)\n+\n+    startw = multipole % w_start(iW)\n+    startw_1 = startw - 1 ! This is an index shift parameter.\n+    endw = multipole % w_end(iW)\n+    startw_endw = endw - startw + 1\n+\n+    ! Fill in factors\n+    if (startw <= endw) then\n+      call fill_factors(multipole, sqrtE, sigT_factor, twophi, multipole % num_l)\n+    end if\n+\n+    ! Generate some doppler broadening parameters\n+\n+    ! DOPP_ECOEF is inverse of dopp, divided by E, multiplied by sqrt(pi).\n+    DOPP = multipole % sqrtAWR/sqrtKT\n+    DOPP_ECOEF = DOPP*invE*SQRT_PI\n+\n+    sigT = 0.0_8\n+    sigA = 0.0_8\n+    sigF = 0.0_8\n+    ! Evaluate linefit first\n+\n+    if(sqrtkT /= 0 .AND. multipole % broaden_poly(iW) == 1) then ! Broaden the curvefit.\n+      call broaden_n_polynomials(E, DOPP, multipole % fit_order + 1, broadened_polynomials)\n+\n+      do iC = 1,multipole % fit_order+1\n+        sigT = sigT + multipole % curvefit(FIT_T, iC, iW)*broadened_polynomials(iC)\n+        sigA = sigA + multipole % curvefit(FIT_A, iC, iW)*broadened_polynomials(iC)\n+        if (multipole % fissionable) then\n+          sigF = sigF + multipole % curvefit(FIT_F, iC, iW)*broadened_polynomials(iC)\n+        end if\n+      end do\n+    else ! Evaluate as if it were a polynomial\n+      temp = invE\n+      do iC = 1,multipole % fit_order+1\n+\n+        sigT = sigT + multipole % curvefit(FIT_T, iC, iW)*temp\n+        sigA = sigA + multipole % curvefit(FIT_A, iC, iW)*temp\n+        if (multipole % fissionable) then\n+          sigF = sigF + multipole % curvefit(FIT_F, iC, iW)*temp\n+        end if\n+\n+        temp = temp * sqrtE\n+      end do\n+    end if\n+\n+    ! Then get the poles we want and broaden them.\n+\n+    if (sqrtkT == 0.0_8) then","path":"src/cross_section.F90","position":364,"original_position":364,"commit_id":"9b3e1b86c64bbfe5a49970698d450c94d4176685","original_commit_id":"9b3e1b86c64bbfe5a49970698d450c94d4176685","user":{"login":"smharper","id":4622797,"avatar_url":"https://avatars.githubusercontent.com/u/4622797?v=3","gravatar_id":"","url":"https://api.github.com/users/smharper","html_url":"https://github.com/smharper","followers_url":"https://api.github.com/users/smharper/followers","following_url":"https://api.github.com/users/smharper/following{/other_user}","gists_url":"https://api.github.com/users/smharper/gists{/gist_id}","starred_url":"https://api.github.com/users/smharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smharper/subscriptions","organizations_url":"https://api.github.com/users/smharper/orgs","repos_url":"https://api.github.com/users/smharper/repos","events_url":"https://api.github.com/users/smharper/events{/privacy}","received_events_url":"https://api.github.com/users/smharper/received_events","type":"User","site_admin":false},"body":"Do we need to worry about numerical instabilities for the Faddeeva function at low-but-not-zero T?","created_at":"2016-01-17T19:55:24Z","updated_at":"2016-01-17T19:55:24Z","html_url":"https://github.com/mit-crpg/openmc/pull/560#discussion_r49951211","pull_request_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/560","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/49951211"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/560#discussion_r49951211"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/560"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/560","id":56270791,"html_url":"https://github.com/mit-crpg/openmc/pull/560","diff_url":"https://github.com/mit-crpg/openmc/pull/560.diff","patch_url":"https://github.com/mit-crpg/openmc/pull/560.patch","issue_url":"https://api.github.com/repos/mit-crpg/openmc/issues/560","number":560,"state":"open","locked":false,"title":"Add basic windowed multipole library support","user":{"login":"cjosey","id":354602,"avatar_url":"https://avatars.githubusercontent.com/u/354602?v=3","gravatar_id":"","url":"https://api.github.com/users/cjosey","html_url":"https://github.com/cjosey","followers_url":"https://api.github.com/users/cjosey/followers","following_url":"https://api.github.com/users/cjosey/following{/other_user}","gists_url":"https://api.github.com/users/cjosey/gists{/gist_id}","starred_url":"https://api.github.com/users/cjosey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjosey/subscriptions","organizations_url":"https://api.github.com/users/cjosey/orgs","repos_url":"https://api.github.com/users/cjosey/repos","events_url":"https://api.github.com/users/cjosey/events{/privacy}","received_events_url":"https://api.github.com/users/cjosey/received_events","type":"User","site_admin":false},"body":"This is a work-in-progress PR for discussion purposes.\r\n\r\nThis commit adds the ability to load in windowed multipole temperature-dependent cross section data.  Given a windowed multipole file named ZAID.h5 in the same directory as the *.xml files of a simulation, OpenMC will now load this HDF5 file.  This will replace the resolved resonance region with windowed multipole data, and all other pointwise data by a smaller pointwise library to minimize memory footprint.  ACE data is still required for S(α, β), URR, and angular data.\r\n\r\nTemperatures are tentatively set by adding a <temperature> tag inside of a material in materials.xml.  Units are in Kelvin for now.  I do not expect this feature to stay in this PR.  We'll replace it with something better as the pieces fall into place.\r\n\r\nThis commit also adds the Faddeeva.cc library from http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package which requires OpenMC to compile both Fortran and C code.  Modifications have been done to most of CMakeLists.txt, but not all of it.  I am not familiar enough with compilers to know what flags to set to finish up the rest.\r\n\r\nThis codebase only supports the \"v0.2\" libraries.  If you have access to my Dropbox folder, you should already see it (I added it this morning).  These are identical to the older \"v0.1\" libraries, but with some of the stupid internal naming cleaned up.  If you do not have access, want access, and are in the mit-crpg group, email me.  I'm still figuring out how to deal with broader release right now.\r\n\r\nFeatures implemented so far:\r\n- [x] Windowed multipole support\r\n- [x] Rudimentary temperature input\r\n- [ ] Ideal temperature input\r\n- [ ] A way to handle the library without moving files in and out of the working directory\r\n- [ ] Final library API specification\r\n- [ ] Tests\r\n\r\nAt this point, any component can be changed, including the HDF5 library layout itself.  If there are any questions or suggestions on that front, I am welcome to them.\r\n\r\nAlso, I have not been able to test this with MPI (I'm having severe issues getting that working), and the testbench complains on omp runs about test_confidence_intervals.  The output warns that \"Maximum number of sites in fission bank reached.\" for it.\r\n\r\nFinally, performance has appeared to have worsened since I last tested this.  I'm not sure if it's because of the improvements in binary search lookup, making pointwise appear much faster, or a performance regression in my code.  If you see anything, let me know.","created_at":"2016-01-17T05:29:24Z","updated_at":"2016-01-17T19:55:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2ef83185972f241b9046728e5256c320b69056d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/560/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/560/comments","review_comment_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mit-crpg/openmc/issues/560/comments","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/9b3e1b86c64bbfe5a49970698d450c94d4176685","head":{"label":"cjosey:multipole-final","ref":"multipole-final","sha":"9b3e1b86c64bbfe5a49970698d450c94d4176685","user":{"login":"cjosey","id":354602,"avatar_url":"https://avatars.githubusercontent.com/u/354602?v=3","gravatar_id":"","url":"https://api.github.com/users/cjosey","html_url":"https://github.com/cjosey","followers_url":"https://api.github.com/users/cjosey/followers","following_url":"https://api.github.com/users/cjosey/following{/other_user}","gists_url":"https://api.github.com/users/cjosey/gists{/gist_id}","starred_url":"https://api.github.com/users/cjosey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjosey/subscriptions","organizations_url":"https://api.github.com/users/cjosey/orgs","repos_url":"https://api.github.com/users/cjosey/repos","events_url":"https://api.github.com/users/cjosey/events{/privacy}","received_events_url":"https://api.github.com/users/cjosey/received_events","type":"User","site_admin":false},"repo":{"id":38653494,"name":"openmc","full_name":"cjosey/openmc","owner":{"login":"cjosey","id":354602,"avatar_url":"https://avatars.githubusercontent.com/u/354602?v=3","gravatar_id":"","url":"https://api.github.com/users/cjosey","html_url":"https://github.com/cjosey","followers_url":"https://api.github.com/users/cjosey/followers","following_url":"https://api.github.com/users/cjosey/following{/other_user}","gists_url":"https://api.github.com/users/cjosey/gists{/gist_id}","starred_url":"https://api.github.com/users/cjosey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjosey/subscriptions","organizations_url":"https://api.github.com/users/cjosey/orgs","repos_url":"https://api.github.com/users/cjosey/repos","events_url":"https://api.github.com/users/cjosey/events{/privacy}","received_events_url":"https://api.github.com/users/cjosey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cjosey/openmc","description":"OpenMC Monte Carlo Code","fork":true,"url":"https://api.github.com/repos/cjosey/openmc","forks_url":"https://api.github.com/repos/cjosey/openmc/forks","keys_url":"https://api.github.com/repos/cjosey/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cjosey/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cjosey/openmc/teams","hooks_url":"https://api.github.com/repos/cjosey/openmc/hooks","issue_events_url":"https://api.github.com/repos/cjosey/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/cjosey/openmc/events","assignees_url":"https://api.github.com/repos/cjosey/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/cjosey/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/cjosey/openmc/tags","blobs_url":"https://api.github.com/repos/cjosey/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cjosey/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cjosey/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/cjosey/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cjosey/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/cjosey/openmc/languages","stargazers_url":"https://api.github.com/repos/cjosey/openmc/stargazers","contributors_url":"https://api.github.com/repos/cjosey/openmc/contributors","subscribers_url":"https://api.github.com/repos/cjosey/openmc/subscribers","subscription_url":"https://api.github.com/repos/cjosey/openmc/subscription","commits_url":"https://api.github.com/repos/cjosey/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/cjosey/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/cjosey/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/cjosey/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/cjosey/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/cjosey/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cjosey/openmc/merges","archive_url":"https://api.github.com/repos/cjosey/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cjosey/openmc/downloads","issues_url":"https://api.github.com/repos/cjosey/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/cjosey/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/cjosey/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/cjosey/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cjosey/openmc/labels{/name}","releases_url":"https://api.github.com/repos/cjosey/openmc/releases{/id}","created_at":"2015-07-07T00:10:58Z","updated_at":"2016-01-17T04:54:36Z","pushed_at":"2016-01-17T04:55:41Z","git_url":"git://github.com/cjosey/openmc.git","ssh_url":"git@github.com:cjosey/openmc.git","clone_url":"https://github.com/cjosey/openmc.git","svn_url":"https://github.com/cjosey/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":24780,"stargazers_count":0,"watchers_count":0,"language":"FORTRAN","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"39d2b8945fdbf8d45d25fc0e86fd866635844b7a","user":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"repo":{"id":2081118,"name":"openmc","full_name":"mit-crpg/openmc","owner":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mit-crpg/openmc","description":"OpenMC Monte Carlo Code","fork":false,"url":"https://api.github.com/repos/mit-crpg/openmc","forks_url":"https://api.github.com/repos/mit-crpg/openmc/forks","keys_url":"https://api.github.com/repos/mit-crpg/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mit-crpg/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mit-crpg/openmc/teams","hooks_url":"https://api.github.com/repos/mit-crpg/openmc/hooks","issue_events_url":"https://api.github.com/repos/mit-crpg/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/mit-crpg/openmc/events","assignees_url":"https://api.github.com/repos/mit-crpg/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/mit-crpg/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/mit-crpg/openmc/tags","blobs_url":"https://api.github.com/repos/mit-crpg/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mit-crpg/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mit-crpg/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/mit-crpg/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/mit-crpg/openmc/languages","stargazers_url":"https://api.github.com/repos/mit-crpg/openmc/stargazers","contributors_url":"https://api.github.com/repos/mit-crpg/openmc/contributors","subscribers_url":"https://api.github.com/repos/mit-crpg/openmc/subscribers","subscription_url":"https://api.github.com/repos/mit-crpg/openmc/subscription","commits_url":"https://api.github.com/repos/mit-crpg/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/mit-crpg/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/mit-crpg/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/mit-crpg/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/mit-crpg/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/mit-crpg/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mit-crpg/openmc/merges","archive_url":"https://api.github.com/repos/mit-crpg/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mit-crpg/openmc/downloads","issues_url":"https://api.github.com/repos/mit-crpg/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/mit-crpg/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/mit-crpg/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/mit-crpg/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mit-crpg/openmc/labels{/name}","releases_url":"https://api.github.com/repos/mit-crpg/openmc/releases{/id}","created_at":"2011-07-21T00:33:27Z","updated_at":"2016-01-16T16:08:51Z","pushed_at":"2016-01-17T05:29:24Z","git_url":"git://github.com/mit-crpg/openmc.git","ssh_url":"git@github.com:mit-crpg/openmc.git","clone_url":"https://github.com/mit-crpg/openmc.git","svn_url":"https://github.com/mit-crpg/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":40570,"stargazers_count":68,"watchers_count":68,"language":"FORTRAN","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":88,"mirror_url":null,"open_issues_count":50,"forks":88,"open_issues":50,"watchers":68,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/560"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/560"},"issue":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/560"},"comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/560/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/560/comments"},"review_comment":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/560/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/openmc/statuses/9b3e1b86c64bbfe5a49970698d450c94d4176685"}}}}