{"action":"created","comment":{"url":"https://api.github.com/repos/dftbplus/dftbplus/pulls/comments/175075118","pull_request_review_id":104547853,"id":175075118,"diff_hunk":"@@ -0,0 +1,2117 @@\n+! **************************************************************************\n+! *                INTERFACE of LIBNEGF for DFTB+\n+! *\n+! *  call negf_init(transpar, greendens, tundos, mpicomm, itempElec, initinfo)\n+! *  \n+! *  call negf_density(miter,spin,nkpoint,HH,SS,DensMat,EnMat)\n+! *\n+! *  call negf_current(HH,SS,spin,kpoint,wght,tunn,ledos,currents)\n+! *\n+! *  call negf_destroy()\n+! *  ----------------------------------------------------------------------\n+! *\n+! *  ---------------------------------------------------------------------- \n+! * Known Bugs & Problems:\n+! * \n+! *\n+! *\n+! * ---------------------------------------------------------------------- \n+module negf_int\n+  \n+  use accuracy\n+  use libnegf_vars  !, only : TNEGFstructure, TGDFTBTunDos, &\n+                    !       & TNEGFGreenDensInfo, TTransPar, Telph\n+  use libnegf\n+  use mat_conv\n+  use sparse2dense\n+  use densedescr\n+  use commonTypes, only : TOrbitals\n+  use libmpifx_module\n+\n+  use FormatOut                                                          \n+  \n+  implicit none\n+  private\n+\n+  Type(Tnegf), target, public :: negf\n+\n+  public :: negf_init      ! general library initializations\n+  public :: negf_init_str  ! passing structure parameters\n+  public :: negf_init_dephasing\n+  public :: negf_init_elph                                               \n+  public :: negf_destroy\n+  \n+  ! wrapped functions passing dftb matrices. Needed for parallel\n+  public :: calcdensity_green\n+  public :: calcEdensity_green\n+  public :: calcPDOS_green\n+  public :: calc_current\n+  public :: local_currents\n+  \n+  ! interface csr matrices. The pattering must be predefined \n+  ! using negf_init_csr \n+  public :: negf_init_csr\n+  type(z_CSR) :: csrHam, csrOver\n+\n+  ! non wrapped direct calls  \n+  private :: negf_density, negf_current, negf_ldos\n+\n+  contains\n+\n+  !------------------------------------------------------------------------------\n+  ! Init gDFTB environment and variables\n+  !\n+  ! Note: mpicomm should be the global commworld here\n+  !------------------------------------------------------------------------------\n+  subroutine negf_init(transpar, greendens, tundos, mpicomm,&\n+        & tempElec, initinfo)\n+    \n+    Type(TTranspar), intent(IN) :: transpar\n+    Type(TNEGFGreenDensInfo), intent(IN) :: greendens\n+    Type(TNEGFTunDos), intent(IN) :: tundos\n+    Type(mpifx_comm), intent(in) :: mpicomm\n+    real(dp), intent(in) :: tempElec \n+    logical, intent(OUT) :: initinfo\n+    \n+    ! local variables\n+    real(dp), dimension(:), allocatable :: pot, eFermi\n+    integer :: i,error, l, ncont, nc_vec(1), j, nldos\n+    integer, dimension(:), allocatable :: sizes  \n+    ! string needed to hold processor name\n+    character(:), allocatable :: hostname\n+    type(lnParams) :: params\n+   \n+    error = 0 \n+    initinfo = .true.       \n+\n+    call negf_mpi_init(mpicomm)\n+     \n+    if (transpar%defined) then\n+      ncont = transpar%ncont \n+    else\n+      ncont = 0\n+    endif\n+    \n+    ! ------------------------------------------------------------------------------\n+    !! Set defaults and fill up the parameter structure with them\n+    call init_negf(negf)\n+    call init_contacts(negf, ncont)\n+    call set_scratch(negf, \".\")\n+    if (id0) call create_scratch(negf)    \n+    call get_params(negf, params)\n+    \n+    ! ------------------------------------------------------------------------------\n+    !This must be different for different initialisations, to be separated\n+    !Higher between transport and greendens is taken, temporary\n+    if (tundos%defined .and. greendens%defined) then                                          \n+       if (tundos%verbose.gt.greendens%verbose) then \n+          params%verbose = tundos%verbose\n+       else\n+          params%verbose = greendens%verbose\n+       endif\n+    else\n+       if (tundos%defined) params%verbose = tundos%verbose\n+       if (greendens%defined) params%verbose = greendens%verbose\n+    end if\n+    ! ------------------------------------------------------------------------------\n+    ! This parameter is used to set the averall drop threshold in libnegf\n+    ! It affects especially transmission that is not accurate more than \n+    ! this value.\n+    call set_drop(1.d-20)\n+\n+ \n+    ! ------------------------------------------------------------------------------\n+    ! Assign spin degenracy and check consistency between different input blocks\n+    if (tundos%defined .and. greendens%defined) then\n+      if (tundos%gSpin .ne. greendens%gSpin) then\n+        write(*,*) \"ERROR: spin degeneracy is not consistent between different input blocks\"","path":"prog/dftb+/lib_extlibs/negf_int.F90","position":127,"original_position":127,"commit_id":"107632bcad1a322494ac62714a720de59eef41f2","original_commit_id":"107632bcad1a322494ac62714a720de59eef41f2","user":{"login":"bhourahine","id":9715491,"avatar_url":"https://avatars3.githubusercontent.com/u/9715491?v=4","gravatar_id":"","url":"https://api.github.com/users/bhourahine","html_url":"https://github.com/bhourahine","followers_url":"https://api.github.com/users/bhourahine/followers","following_url":"https://api.github.com/users/bhourahine/following{/other_user}","gists_url":"https://api.github.com/users/bhourahine/gists{/gist_id}","starred_url":"https://api.github.com/users/bhourahine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhourahine/subscriptions","organizations_url":"https://api.github.com/users/bhourahine/orgs","repos_url":"https://api.github.com/users/bhourahine/repos","events_url":"https://api.github.com/users/bhourahine/events{/privacy}","received_events_url":"https://api.github.com/users/bhourahine/received_events","type":"User","site_admin":false},"body":"Write(*, statements won't connect with the parallel write-out structure of the main code - things like should this be appearing on rank=0 or from anything in the comm world?","created_at":"2018-03-16T12:32:41Z","updated_at":"2018-03-16T12:32:41Z","html_url":"https://github.com/dftbplus/dftbplus/pull/122#discussion_r175075118","pull_request_url":"https://api.github.com/repos/dftbplus/dftbplus/pulls/122","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dftbplus/dftbplus/pulls/comments/175075118"},"html":{"href":"https://github.com/dftbplus/dftbplus/pull/122#discussion_r175075118"},"pull_request":{"href":"https://api.github.com/repos/dftbplus/dftbplus/pulls/122"}}},"pull_request":{"url":"https://api.github.com/repos/dftbplus/dftbplus/pulls/122","id":174194932,"html_url":"https://github.com/dftbplus/dftbplus/pull/122","diff_url":"https://github.com/dftbplus/dftbplus/pull/122.diff","patch_url":"https://github.com/dftbplus/dftbplus/pull/122.patch","issue_url":"https://api.github.com/repos/dftbplus/dftbplus/issues/122","number":122,"state":"open","locked":false,"title":"Parallel negf","user":{"login":"pecchia","id":32100903,"avatar_url":"https://avatars0.githubusercontent.com/u/32100903?v=4","gravatar_id":"","url":"https://api.github.com/users/pecchia","html_url":"https://github.com/pecchia","followers_url":"https://api.github.com/users/pecchia/followers","following_url":"https://api.github.com/users/pecchia/following{/other_user}","gists_url":"https://api.github.com/users/pecchia/gists{/gist_id}","starred_url":"https://api.github.com/users/pecchia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pecchia/subscriptions","organizations_url":"https://api.github.com/users/pecchia/orgs","repos_url":"https://api.github.com/users/pecchia/repos","events_url":"https://api.github.com/users/pecchia/events{/privacy}","received_events_url":"https://api.github.com/users/pecchia/received_events","type":"User","site_admin":false},"body":"Transport extensions to be merged. \r\nI'm wearing my rock helmet...","created_at":"2018-03-10T23:23:40Z","updated_at":"2018-03-16T12:32:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07f3debdcfb43dd8d8a33e2364c80d54857ccf80","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dftbplus/dftbplus/pulls/122/commits","review_comments_url":"https://api.github.com/repos/dftbplus/dftbplus/pulls/122/comments","review_comment_url":"https://api.github.com/repos/dftbplus/dftbplus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dftbplus/dftbplus/issues/122/comments","statuses_url":"https://api.github.com/repos/dftbplus/dftbplus/statuses/107632bcad1a322494ac62714a720de59eef41f2","head":{"label":"aradi:parallel-negf","ref":"parallel-negf","sha":"107632bcad1a322494ac62714a720de59eef41f2","user":{"login":"aradi","id":2452321,"avatar_url":"https://avatars0.githubusercontent.com/u/2452321?v=4","gravatar_id":"","url":"https://api.github.com/users/aradi","html_url":"https://github.com/aradi","followers_url":"https://api.github.com/users/aradi/followers","following_url":"https://api.github.com/users/aradi/following{/other_user}","gists_url":"https://api.github.com/users/aradi/gists{/gist_id}","starred_url":"https://api.github.com/users/aradi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aradi/subscriptions","organizations_url":"https://api.github.com/users/aradi/orgs","repos_url":"https://api.github.com/users/aradi/repos","events_url":"https://api.github.com/users/aradi/events{/privacy}","received_events_url":"https://api.github.com/users/aradi/received_events","type":"User","site_admin":false},"repo":{"id":93145559,"name":"dftbplus","full_name":"aradi/dftbplus","owner":{"login":"aradi","id":2452321,"avatar_url":"https://avatars0.githubusercontent.com/u/2452321?v=4","gravatar_id":"","url":"https://api.github.com/users/aradi","html_url":"https://github.com/aradi","followers_url":"https://api.github.com/users/aradi/followers","following_url":"https://api.github.com/users/aradi/following{/other_user}","gists_url":"https://api.github.com/users/aradi/gists{/gist_id}","starred_url":"https://api.github.com/users/aradi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aradi/subscriptions","organizations_url":"https://api.github.com/users/aradi/orgs","repos_url":"https://api.github.com/users/aradi/repos","events_url":"https://api.github.com/users/aradi/events{/privacy}","received_events_url":"https://api.github.com/users/aradi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aradi/dftbplus","description":"DFTB+ general package for performing fast atomistic simulations","fork":true,"url":"https://api.github.com/repos/aradi/dftbplus","forks_url":"https://api.github.com/repos/aradi/dftbplus/forks","keys_url":"https://api.github.com/repos/aradi/dftbplus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aradi/dftbplus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aradi/dftbplus/teams","hooks_url":"https://api.github.com/repos/aradi/dftbplus/hooks","issue_events_url":"https://api.github.com/repos/aradi/dftbplus/issues/events{/number}","events_url":"https://api.github.com/repos/aradi/dftbplus/events","assignees_url":"https://api.github.com/repos/aradi/dftbplus/assignees{/user}","branches_url":"https://api.github.com/repos/aradi/dftbplus/branches{/branch}","tags_url":"https://api.github.com/repos/aradi/dftbplus/tags","blobs_url":"https://api.github.com/repos/aradi/dftbplus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aradi/dftbplus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aradi/dftbplus/git/refs{/sha}","trees_url":"https://api.github.com/repos/aradi/dftbplus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aradi/dftbplus/statuses/{sha}","languages_url":"https://api.github.com/repos/aradi/dftbplus/languages","stargazers_url":"https://api.github.com/repos/aradi/dftbplus/stargazers","contributors_url":"https://api.github.com/repos/aradi/dftbplus/contributors","subscribers_url":"https://api.github.com/repos/aradi/dftbplus/subscribers","subscription_url":"https://api.github.com/repos/aradi/dftbplus/subscription","commits_url":"https://api.github.com/repos/aradi/dftbplus/commits{/sha}","git_commits_url":"https://api.github.com/repos/aradi/dftbplus/git/commits{/sha}","comments_url":"https://api.github.com/repos/aradi/dftbplus/comments{/number}","issue_comment_url":"https://api.github.com/repos/aradi/dftbplus/issues/comments{/number}","contents_url":"https://api.github.com/repos/aradi/dftbplus/contents/{+path}","compare_url":"https://api.github.com/repos/aradi/dftbplus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aradi/dftbplus/merges","archive_url":"https://api.github.com/repos/aradi/dftbplus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aradi/dftbplus/downloads","issues_url":"https://api.github.com/repos/aradi/dftbplus/issues{/number}","pulls_url":"https://api.github.com/repos/aradi/dftbplus/pulls{/number}","milestones_url":"https://api.github.com/repos/aradi/dftbplus/milestones{/number}","notifications_url":"https://api.github.com/repos/aradi/dftbplus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aradi/dftbplus/labels{/name}","releases_url":"https://api.github.com/repos/aradi/dftbplus/releases{/id}","deployments_url":"https://api.github.com/repos/aradi/dftbplus/deployments","created_at":"2017-06-02T08:37:43Z","updated_at":"2017-06-02T08:37:46Z","pushed_at":"2018-03-16T12:08:37Z","git_url":"git://github.com/aradi/dftbplus.git","ssh_url":"git@github.com:aradi/dftbplus.git","clone_url":"https://github.com/aradi/dftbplus.git","svn_url":"https://github.com/aradi/dftbplus","homepage":null,"size":5259,"stargazers_count":0,"watchers_count":0,"language":"Fortran","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"dftbplus:master","ref":"master","sha":"6dfe51d78b94509dd874e94d15f641db94a723f9","user":{"login":"dftbplus","id":24522763,"avatar_url":"https://avatars1.githubusercontent.com/u/24522763?v=4","gravatar_id":"","url":"https://api.github.com/users/dftbplus","html_url":"https://github.com/dftbplus","followers_url":"https://api.github.com/users/dftbplus/followers","following_url":"https://api.github.com/users/dftbplus/following{/other_user}","gists_url":"https://api.github.com/users/dftbplus/gists{/gist_id}","starred_url":"https://api.github.com/users/dftbplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dftbplus/subscriptions","organizations_url":"https://api.github.com/users/dftbplus/orgs","repos_url":"https://api.github.com/users/dftbplus/repos","events_url":"https://api.github.com/users/dftbplus/events{/privacy}","received_events_url":"https://api.github.com/users/dftbplus/received_events","type":"Organization","site_admin":false},"repo":{"id":93144454,"name":"dftbplus","full_name":"dftbplus/dftbplus","owner":{"login":"dftbplus","id":24522763,"avatar_url":"https://avatars1.githubusercontent.com/u/24522763?v=4","gravatar_id":"","url":"https://api.github.com/users/dftbplus","html_url":"https://github.com/dftbplus","followers_url":"https://api.github.com/users/dftbplus/followers","following_url":"https://api.github.com/users/dftbplus/following{/other_user}","gists_url":"https://api.github.com/users/dftbplus/gists{/gist_id}","starred_url":"https://api.github.com/users/dftbplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dftbplus/subscriptions","organizations_url":"https://api.github.com/users/dftbplus/orgs","repos_url":"https://api.github.com/users/dftbplus/repos","events_url":"https://api.github.com/users/dftbplus/events{/privacy}","received_events_url":"https://api.github.com/users/dftbplus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dftbplus/dftbplus","description":"DFTB+ general package for performing fast atomistic simulations","fork":false,"url":"https://api.github.com/repos/dftbplus/dftbplus","forks_url":"https://api.github.com/repos/dftbplus/dftbplus/forks","keys_url":"https://api.github.com/repos/dftbplus/dftbplus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dftbplus/dftbplus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dftbplus/dftbplus/teams","hooks_url":"https://api.github.com/repos/dftbplus/dftbplus/hooks","issue_events_url":"https://api.github.com/repos/dftbplus/dftbplus/issues/events{/number}","events_url":"https://api.github.com/repos/dftbplus/dftbplus/events","assignees_url":"https://api.github.com/repos/dftbplus/dftbplus/assignees{/user}","branches_url":"https://api.github.com/repos/dftbplus/dftbplus/branches{/branch}","tags_url":"https://api.github.com/repos/dftbplus/dftbplus/tags","blobs_url":"https://api.github.com/repos/dftbplus/dftbplus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dftbplus/dftbplus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dftbplus/dftbplus/git/refs{/sha}","trees_url":"https://api.github.com/repos/dftbplus/dftbplus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dftbplus/dftbplus/statuses/{sha}","languages_url":"https://api.github.com/repos/dftbplus/dftbplus/languages","stargazers_url":"https://api.github.com/repos/dftbplus/dftbplus/stargazers","contributors_url":"https://api.github.com/repos/dftbplus/dftbplus/contributors","subscribers_url":"https://api.github.com/repos/dftbplus/dftbplus/subscribers","subscription_url":"https://api.github.com/repos/dftbplus/dftbplus/subscription","commits_url":"https://api.github.com/repos/dftbplus/dftbplus/commits{/sha}","git_commits_url":"https://api.github.com/repos/dftbplus/dftbplus/git/commits{/sha}","comments_url":"https://api.github.com/repos/dftbplus/dftbplus/comments{/number}","issue_comment_url":"https://api.github.com/repos/dftbplus/dftbplus/issues/comments{/number}","contents_url":"https://api.github.com/repos/dftbplus/dftbplus/contents/{+path}","compare_url":"https://api.github.com/repos/dftbplus/dftbplus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dftbplus/dftbplus/merges","archive_url":"https://api.github.com/repos/dftbplus/dftbplus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dftbplus/dftbplus/downloads","issues_url":"https://api.github.com/repos/dftbplus/dftbplus/issues{/number}","pulls_url":"https://api.github.com/repos/dftbplus/dftbplus/pulls{/number}","milestones_url":"https://api.github.com/repos/dftbplus/dftbplus/milestones{/number}","notifications_url":"https://api.github.com/repos/dftbplus/dftbplus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dftbplus/dftbplus/labels{/name}","releases_url":"https://api.github.com/repos/dftbplus/dftbplus/releases{/id}","deployments_url":"https://api.github.com/repos/dftbplus/dftbplus/deployments","created_at":"2017-06-02T08:26:33Z","updated_at":"2018-03-16T00:09:13Z","pushed_at":"2018-03-16T01:17:19Z","git_url":"git://github.com/dftbplus/dftbplus.git","ssh_url":"git@github.com:dftbplus/dftbplus.git","clone_url":"https://github.com/dftbplus/dftbplus.git","svn_url":"https://github.com/dftbplus/dftbplus","homepage":"http://www.dftbplus.org","size":3220,"stargazers_count":45,"watchers_count":45,"language":"Fortran","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":25,"open_issues":9,"watchers":45,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dftbplus/dftbplus/pulls/122"},"html":{"href":"https://github.com/dftbplus/dftbplus/pull/122"},"issue":{"href":"https://api.github.com/repos/dftbplus/dftbplus/issues/122"},"comments":{"href":"https://api.github.com/repos/dftbplus/dftbplus/issues/122/comments"},"review_comments":{"href":"https://api.github.com/repos/dftbplus/dftbplus/pulls/122/comments"},"review_comment":{"href":"https://api.github.com/repos/dftbplus/dftbplus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dftbplus/dftbplus/pulls/122/commits"},"statuses":{"href":"https://api.github.com/repos/dftbplus/dftbplus/statuses/107632bcad1a322494ac62714a720de59eef41f2"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bhourahine"}}