<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: omp thread in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868794#M2803</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Yes, I would be willing to take a cursory look at the code and make recommendations to point you in the right direction. However, to produce a fully tested and debugged version of your code may require a considerable amount of work (and may require access to your complete application, or a test suite for your critiical functions). If you are unable to make good progress with therecomendations, then you should consider hiring a contract programmer to do the work for you. Once you see the programming technique for this first application, you may have learned enough and feel confident enough to make the parallization code changes to your other applicaitons. There are several forum members here that may be willing to perform the contract work for you (including myself).&lt;BR /&gt;&lt;BR /&gt;From the sample code you submitted I am guessing you are performing something simalar to planetary modeling. I have experiece in this area by integrating the NAIF SPICE Toolkit (JPL planetary mission database) into a simulator. The simulator was written in FORTRAN and I madeextensive modifications for purposes of studying Space Elevator designs (I hold a U.S. Patent on an active tether design). The original simulation code was single threaded and was not capable of including multiple planetary bodies. It is now multi-threaded and can supplort planetary models to any desired fidelity (up to all planets, sun, all moons, allcalculated asteroids, comets, andartificial satelites).&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
    <pubDate>Mon, 12 Jan 2009 16:33:42 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2009-01-12T16:33:42Z</dc:date>
    <item>
      <title>omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868790#M2799</link>
      <description>with the risk of getting scolded by steve,tim and jim, i am putting 1 question here.&lt;BR /&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt;This is a part of my code and as you people can remember its bothering me for preety long time!&lt;BR /&gt; &lt;/SPAN&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt;!$OMP PARALLEL DO DEFAULT(NONE) &amp;amp; &lt;BR /&gt; !$OMP PRIVATE(il,ie,iie,ienrp,iend) &amp;amp; &lt;BR /&gt; !$OMP PRIVATE(temp,spec,xa,ya) &amp;amp; &lt;BR /&gt; !$OMP SHARED(ap1,ap2,ap3,ap4,ap6,ap7) &amp;amp; &lt;BR /&gt; !$OMP SHARED(ap8,ap9,ap10,ap11,ap12,ap13) &amp;amp; &lt;BR /&gt; !$OMP SHARED(MAP,SRL,seed,de,xxa,yya,e,istart) &lt;BR /&gt; do iend=9,63,lorbit &lt;BR /&gt; e=e+de &lt;BR /&gt; iie=0 &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt; ienrp=ienrp+1 &lt;BR /&gt; call hop(il,e,ienrp,map,srl,ap1,  &amp;amp; &lt;BR /&gt; ap6,ap7,ap8,ap9,ap10,ap11, &amp;amp; &lt;BR /&gt; ap12,ap13,ap2,ap3,ap4,xa,ya) &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt; istart=iend+1 &lt;BR /&gt; write(*,'(".",$)') &lt;BR /&gt; end do &lt;BR /&gt; !$OMP END PARALLEL DO &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt;the subroutine HOP has many other variable other then the arguments. should i declare them as private/shared as well? if yes, where should i declare it? in the main code or in the HOP itself? &lt;/SPAN&gt;&lt;/P&gt;
plz reply.</description>
      <pubDate>Mon, 12 Jan 2009 05:38:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868790#M2799</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-01-12T05:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868791#M2800</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Variables declared locally in HOP will be inherently private, and don't need any changes for OpenMP. &lt;BR /&gt;COMMON blocks, where the subroutine modifiies values, would need threadprivate, and possibly copyin directives.&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Jan 2009 13:30:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868791#M2800</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-01-12T13:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868792#M2801</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Roddur,&lt;BR /&gt;&lt;BR /&gt;We are not trying to scold you, we are trying to help you. Forum message repliestend to be short and to the point.&lt;BR /&gt;&lt;BR /&gt;In the places of your code where you modify a shared variable use !$OMP ATOMIC. Example:&lt;BR /&gt;&lt;BR /&gt; !$OMP ATOMIC&lt;BR /&gt; e=e+de&lt;BR /&gt;&lt;BR /&gt;Note, an atomic operation drills through to RAM, and generally affects the cache line holding e in the other cores. The atomic addition will take on the order of 100x to 300x the length of time it takes to add to a variable held in L1 cache. Therefore, it is best to perform as few of atomic operations in your loop as possible. When a significant portion of your loop (including code executed by hop in this case) is atomic, then consider rewriting the code such that each thread works on more seperated data.&lt;BR /&gt;&lt;BR /&gt;Also consider that a second thread may issue the e=e+de immediately following the first thread issuing the e=e+de but before the first thread issues the call to hop. Depending on how e was declared, the first thread's value of e entering hop might be that of the second thread's value for e. Note, typically e is passed through hop by reference.&lt;BR /&gt;&lt;BR /&gt;The PRIVATE variables (without COPYIN or other clause) are initialized to 0. Therefor a statement such as&lt;BR /&gt;&lt;BR /&gt; ienrp=ienrp+1&lt;BR /&gt;&lt;BR /&gt;cycles (1,2,3,...) for each thread. This may or may not be what you intend.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Jan 2009 13:43:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868792#M2801</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-01-12T13:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868793#M2802</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;hello, &lt;BR /&gt;thanks for you reply. is it possible for you to go through the code if i send you the routines? specially the hop.f90 and the main.f90 that calls the hop?&lt;BR /&gt;i guess in that case you can help me better. but this are ~500 line each.&lt;BR /&gt;if it is possible for you, i ll be greatful&lt;BR /&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Jan 2009 15:47:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868793#M2802</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-01-12T15:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868794#M2803</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Yes, I would be willing to take a cursory look at the code and make recommendations to point you in the right direction. However, to produce a fully tested and debugged version of your code may require a considerable amount of work (and may require access to your complete application, or a test suite for your critiical functions). If you are unable to make good progress with therecomendations, then you should consider hiring a contract programmer to do the work for you. Once you see the programming technique for this first application, you may have learned enough and feel confident enough to make the parallization code changes to your other applicaitons. There are several forum members here that may be willing to perform the contract work for you (including myself).&lt;BR /&gt;&lt;BR /&gt;From the sample code you submitted I am guessing you are performing something simalar to planetary modeling. I have experiece in this area by integrating the NAIF SPICE Toolkit (JPL planetary mission database) into a simulator. The simulator was written in FORTRAN and I madeextensive modifications for purposes of studying Space Elevator designs (I hold a U.S. Patent on an active tether design). The original simulation code was single threaded and was not capable of including multiple planetary bodies. It is now multi-threaded and can supplort planetary models to any desired fidelity (up to all planets, sun, all moons, allcalculated asteroids, comets, andartificial satelites).&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Jan 2009 16:33:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868794#M2803</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-01-12T16:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868795#M2804</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
hmmm...unfortunetly i dnt hv enough to hire a programmer...hence i depend on your goodwill. I am attaching the codes. plz suggest .&lt;BR /&gt;i have created a folder called rudra and put main.f90 and hop.f90 there. the parallel region contains 2 other subroutine, but they are unimportent.(one thing i am not sure is where the folder is saved)&lt;BR /&gt;looking for your reply.&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jan 2009 03:03:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868795#M2804</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-01-13T03:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868796#M2805</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I did not see your files. When you are on the Reply To Post web page, above the tool bar is Add Files button. I do not think you can add a folder. Can you .ZIP the folder and add the .zip archive.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jan 2009 15:17:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868796#M2805</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-01-13T15:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868797#M2806</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
i cannot upload the files, so i am just posting them. &lt;BR /&gt;though it become too congested, i think that ll help.&lt;BR /&gt;This is the main program!&lt;BR /&gt;&lt;BR /&gt;!***********************************************!&lt;BR /&gt;! DRIVER ROUTINE FOR THE ASR CODE  !&lt;BR /&gt;!  Rudra Banerjee   !&lt;BR /&gt;!  9.09.08    !&lt;BR /&gt;!***********************************************!&lt;BR /&gt; program main&lt;BR /&gt;&lt;BR /&gt; use kinds, only: RDP,i3&lt;BR /&gt; use parameters  !Declaring the parameters&lt;BR /&gt; use mhop  !Recursion&lt;BR /&gt; use mmat  !Structure matrix generator&lt;BR /&gt; use newfit  !B_P Feeting&lt;BR /&gt; use mdos  !DOS&lt;BR /&gt; use mband  !Energy band&lt;BR /&gt; use mfermi  !Fermi lebel&lt;BR /&gt; use mldos  !LDOS&lt;BR /&gt; use omp_lib&lt;BR /&gt;&lt;BR /&gt; implicit none&lt;BR /&gt;&lt;BR /&gt; integer(i3):: i,j,k,il,l,ikki,ok&lt;BR /&gt; integer(i3)::ios,nit=0,nsp,its&lt;BR /&gt; integer(i3):: ienrp,istart,iend,ie,iie&lt;BR /&gt; integer(i3)::ipq,nconv&lt;BR /&gt; integer:: osd1,osd2   !spllting of d-orbitals&lt;BR /&gt; integer(i3),parameter :: maxclock = 10&lt;BR /&gt; integer,dimension(nasite,ntsite)::map&lt;BR /&gt; real*8::t1,t2&lt;BR /&gt; real(RDP):: sum1,sum2,sum3,sum4,sum5,sum6,sum7, &amp;amp;&lt;BR /&gt; sum8,sum9,sum10,sum11,sum12,sum13&lt;BR /&gt; real(RDP)::dsum&lt;BR /&gt; real(RDP):: qtot_a,qtot_b,qtot_a1,qtot_b1&lt;BR /&gt; real(RDP)::q,de,e,ef,e_band&lt;BR /&gt; real(RDP):: xcha,xchb,qold_a,qold_b&lt;BR /&gt; real(RDP),dimension(maxrec,ienum+1)::xa,ya&lt;BR /&gt; real(RDP),dimension(maxrec+1,nfn+1):: xxa,yya&lt;BR /&gt; real(RDP),dimension(ienum+1)::seed&lt;BR /&gt; real(RDP),dimension(nfn+1):: temp&lt;BR /&gt; real(RDP),dimension(lorbit,lorbit)::ap5&lt;BR /&gt; real(RDP),dimension(lorbit)::ap1,ap6,ap7,ap8, &amp;amp;&lt;BR /&gt; ap9,ap10,ap11, &amp;amp;&lt;BR /&gt; ap12,ap13,p2,p3,p4&lt;BR /&gt; real(RDP),dimension(npn)::ap2,ap3,ap4&lt;BR /&gt; real(RDP),dimension(2)::es, cs, ds, gs, ep, cp, &amp;amp;&lt;BR /&gt; xx, dp, gp, ed, cd, dd, gd &lt;BR /&gt; real(RDP),dimension(2)::dels, delp, deld, rs,  &amp;amp; &lt;BR /&gt; rp, rd&lt;BR /&gt; real(RDP),dimension(2)::dsqs, dsqp, dsqd, ccs,  &amp;amp;&lt;BR /&gt; ccp, ccd, os, op, od&lt;BR /&gt; real(RDP),dimension(ntype,lorbit):: agc, agd, enu_ag, ag_op&lt;BR /&gt; real(RDP),dimension(lorbit)::cpot, enuc, dpot_sq, opc&lt;BR /&gt; real(RDP),dimension(lorbit,lorbit,0:nrsite)::srl&lt;BR /&gt; real(RDP),dimension(nkp,nfn+1)::spec&lt;BR /&gt; real(RDP),dimension(2,nfn+1,2)::sorb,porb,dorb&lt;BR /&gt; real(RDP),dimension(nfn+1)::dos,dos_a,dos_b&lt;BR /&gt; real(RDP),dimension(nfn+1)::dos_adn,dos_bdn,T_dos,dos_aa&lt;BR /&gt; real(RDP),dimension(3)::a&lt;BR /&gt; real(RDP),dimension(2,nfn+1,2)::dos1&lt;BR /&gt; real(RDP),dimension(0:8,2)::A_MOM,B_MOM&lt;BR /&gt; real(RDP),dimension(3,2)::ECG_A,ECG_B&lt;BR /&gt; integer,dimension(8) :: values1,values2&lt;BR /&gt; character(10)::potin,potout&lt;BR /&gt; character(2)::sps&lt;BR /&gt; character(10)::actn&lt;BR /&gt; character,parameter :: esc = char(27)&lt;BR /&gt; logical::lstop&lt;BR /&gt;! OMP SPL&lt;BR /&gt; integer::tid,nthrd&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; write(*,*) "Concentration of Atom A =",x&lt;BR /&gt; write(*,*) "Concentration of Atom B =",y&lt;BR /&gt; call date_and_time(VALUES=values1)&lt;BR /&gt; call cpu_time(t1)&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; lat: selectcase(lattice)&lt;BR /&gt; case(225) !fcc&lt;BR /&gt; osd1=3;osd2=2&lt;BR /&gt; case(221) !bcc&lt;BR /&gt; osd1=3;osd2=2 &lt;BR /&gt; case(216) !tetrahedron&lt;BR /&gt; osd1=3;osd2=2&lt;BR /&gt; case default !error&lt;BR /&gt; write(*,*) "ERROR!!TERMINATING RUN!!!"&lt;BR /&gt; write(*,*) "You have not selected allowed space group"&lt;BR /&gt; write(*,*) "Plz. select among 216/221/225"&lt;BR /&gt; stop &lt;BR /&gt; end select lat&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;lscf: do nit=1,nscf&lt;BR /&gt;&lt;BR /&gt; write (*,fmt='(3a)',advance='no') ' ', ESC, '[1m' ! set bold&lt;BR /&gt; write(*,'("Running ASR loop",1x,i3)',advance='no') nit&lt;BR /&gt; write (*, '(3a)') ' ', ESC, '[0m' ! restores display defaults.&lt;BR /&gt;&lt;BR /&gt;! Reading Augmented space map `ASMAP'&lt;BR /&gt; open(11,file=ASMAP,status='old',IOSTAT=ios,form='unformatted')&lt;BR /&gt; do i=1,nasite&lt;BR /&gt; read(11)(map(i,j),j=1,17)&lt;BR /&gt; end do&lt;BR /&gt; write(*,*) "Reading ASMAP Complete"&lt;BR /&gt; close(11)&lt;BR /&gt;&lt;BR /&gt; lspin: do nsp=1,spn&lt;BR /&gt; &lt;BR /&gt; if (nsp==1)then&lt;BR /&gt; sps='UP'&lt;BR /&gt; else&lt;BR /&gt; sps='DW'&lt;BR /&gt; endif&lt;BR /&gt;&lt;BR /&gt; write(*,'("WORKING FOR SPIN",1x,a2)') sps&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;! For the present purpose, we are dealling with binary alloy. Hence we&lt;BR /&gt;!  have two types of atom. We take potential files containning es,~cs,~ds,~gs &lt;BR /&gt;! ep,~cp,~dp,~gp, ed,~cd,~dd,~gd as&lt;BR /&gt;!  output of TB-LMTO calculation for both of these atom.&lt;BR /&gt;&lt;BR /&gt; do i=1,ntype&lt;BR /&gt; potin='POTPAR_'//ACHAR(i+16+48)&lt;BR /&gt; potout='POT_VAR_'//ACHAR(i+16+48)&lt;BR /&gt; &lt;BR /&gt; open(i,file=potin,status='old',iostat=ios)&lt;BR /&gt; if(ios/=0) then&lt;BR /&gt; write(*,*) "error in openning file",potin&lt;BR /&gt; stop&lt;BR /&gt; endif&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; write(*,*) "Reading POTENTIAL PARAMETERS from ",potin&lt;BR /&gt; read (i,*) es(i),cs(i),ds(i),xx(i),gs(i),xx(i) !&lt;BR /&gt; read (i,*) ep(i),cp(i),dp(i),xx(i),gp(i),xx(i) ! Reading up spins&lt;BR /&gt; read (i,*) ed(i),cd(i),dd(i),xx(i),gd(i),xx(i) !/&lt;BR /&gt;&lt;BR /&gt; if(nsp==2)then&lt;BR /&gt; read (i,*) es(i),cs(i),ds(i),xx(i),gs(i),xx(i) ! &lt;BR /&gt; read (i,*) ep(i),cp(i),dp(i),xx(i),gp(i),xx(i) ! Reading dn spins&lt;BR /&gt; read (i,*) ed(i),cd(i),dd(i),xx(i),gd(i),xx(i) !/ &lt;BR /&gt; endif&lt;BR /&gt; close(i)&lt;BR /&gt;&lt;BR /&gt; open(i+10,file=potout,status='unknown',position='append')&lt;BR /&gt; write(i+10,*) es(i),cs(i),ds(i),xx(i),gs(i),xx(i)&lt;BR /&gt; write(i+10,*) ep(i),cp(i),dp(i),xx(i),gp(i),xx(i)&lt;BR /&gt; write(i+10,*) ed(i),cd(i),dd(i),xx(i),gd(i),xx(i)&lt;BR /&gt; close(i+10)&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt;! Reading POTPAR files from LMTO done&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;! gamma --&amp;gt;alpha transformation&lt;BR /&gt;! Given, TB-LMTO potential paramaters are written in $Gamma$&lt;BR /&gt;! representation, we transform it to $alpha$ form.&lt;BR /&gt; do i=1,ntype&lt;BR /&gt;&lt;BR /&gt; ds(i)=dabs(ds(i))&lt;BR /&gt; dp(i)=dabs(dp(i))&lt;BR /&gt; dd(i)=dabs(dd(i))&lt;BR /&gt; &lt;BR /&gt; dels(i)=ds(i)*ds(i)&lt;BR /&gt; delp(i)=dp(i)*dp(i)&lt;BR /&gt; deld(i)=dd(i)*dd(i)&lt;BR /&gt;&lt;BR /&gt; rs(i)=1.0d0-(gs(i)-alps)*((cs(i)-es(i))/dels(i))&lt;BR /&gt; rp(i)=1.0d0-(gp(i)-alpp)*((cp(i)-ep(i))/delp(i))&lt;BR /&gt; rd(i)=1.0d0-(gd(i)-alpd)*((cd(i)-ed(i))/deld(i))&lt;BR /&gt;&lt;BR /&gt; dsqs(i)=rs(i)*dsqrt(dels(i))&lt;BR /&gt; dsqp(i)=rp(i)*dsqrt(delp(i))&lt;BR /&gt; dsqd(i)=rd(i)*dsqrt(deld(i))&lt;BR /&gt;&lt;BR /&gt; ccs(i)=rs(i)*(cs(i)-es(i))+es(i)&lt;BR /&gt; ccp(i)=rp(i)*(cp(i)-ep(i))+ep(i)&lt;BR /&gt; ccd(i)=rd(i)*(cd(i)-ed(i))+ed(i)&lt;BR /&gt;&lt;BR /&gt; os(i)=(alps-gs(i))/(dels(i)*rs(i))&lt;BR /&gt; op(i)=(alpp-gp(i))/(delp(i)*rp(i))&lt;BR /&gt; od(i)=(alpd-gd(i))/(deld(i)*rd(i))&lt;BR /&gt;&lt;BR /&gt; end do&lt;BR /&gt;! POTPAR for different orbitals&lt;BR /&gt;! Now, we assign texttt{potpar} to different orbitals (s,p,d)&lt;BR /&gt;&lt;BR /&gt; do i=1,ntype&lt;BR /&gt; &lt;BR /&gt; agc(i,1)=ccs(i) !&lt;BR /&gt; agd(i,1)=dsqs(i) ! &lt;BR /&gt; enu_ag(i,1)=es(i) ! POTPAR for S orbital&lt;BR /&gt; ag_op(i,1)=os(i) ! /&lt;BR /&gt; !/&lt;BR /&gt; &lt;BR /&gt; agc(i,2:4)= ccp(i) !&lt;BR /&gt; agd(i,2:4)= dsqp(i) ! &lt;BR /&gt; enu_ag(i,2:4)=ep(i) ! POTPAR for P orbital&lt;BR /&gt; ag_op(i,2:4)= op(i) ! /&lt;BR /&gt; !/&lt;BR /&gt;&lt;BR /&gt; agc(i,5:9)= ccd(i) !&lt;BR /&gt; agd(i,5:9)= dsqd(i) ! &lt;BR /&gt; enu_ag(i,5:9)=ed(i) ! POTPAR for D orbital&lt;BR /&gt; ag_op(i,5:9)= od(i) ! /&lt;BR /&gt; !/&lt;BR /&gt;&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt;ltype: do ipq=1,ntype&lt;BR /&gt; write(*,'("WORKING FOR ATOM",1x,i1)') ipq&lt;BR /&gt; open(12,file=STRUCTURE,status='old',IOSTAT=ios)&lt;BR /&gt;&lt;BR /&gt; do i=1,nrsite+1&lt;BR /&gt; do j=1,lorbit&lt;BR /&gt; read(12,*)(srl(j,k,i-1),k=1,lorbit)&lt;BR /&gt; end do&lt;BR /&gt; end do&lt;BR /&gt; close(12)&lt;BR /&gt; write(*,*) "Reading STRUCTURE MATRIX complete"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; do l=1,lorbit&lt;BR /&gt; cpot(l)=agc(ipq,l)&lt;BR /&gt; enuc(l)=enu_ag(ipq,l)&lt;BR /&gt; dpot_sq(l)=agd(ipq,l)**2&lt;BR /&gt; opc(l)=ag_op(ipq,l)&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt;! GENERATING POTENTIAL PARAMETERS TO BE USED IN RECURSION CODE&lt;BR /&gt;&lt;BR /&gt;! AP1&lt;BR /&gt; lap1:  do l=1,lorbit&lt;BR /&gt; ap1(l)=cpot(l)+dpot_sq(l)*srl(l,l,0) &lt;BR /&gt; end do lap1&lt;BR /&gt;! write(*,*) "AP01 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = &lt;BR /&gt;! AP2 &lt;BR /&gt; de=(emax-emin)/dfloat(ienum)&lt;BR /&gt; e=emin&lt;BR /&gt; k=0&lt;BR /&gt; lap2: do i=1,ienum+1&lt;BR /&gt; dsum=0.0d0&lt;BR /&gt; do l=1,lorbit&lt;BR /&gt; sum1=0.0d0;sum2=0.0d0&lt;BR /&gt; k=k+1&lt;BR /&gt; sum1= (agc(1,l)/(agd(1,l)*agd(1,l)))*x + &amp;amp;&lt;BR /&gt; (agc(2,l)/(agd(2,l)*agd(2,l)))*y  &lt;BR /&gt; sum1=(sum1+srl(l,l,0))*dpot_sq(l)&lt;BR /&gt; sum2=x/(agd(1,l)*agd(1,l))+y/(agd(2,l)*agd(2,l))&lt;BR /&gt; sum2=sum2*dpot_sq(l)&lt;BR /&gt; sum2=(sum2-1.0d0)*e&lt;BR /&gt; dsum=sum1-sum2&lt;BR /&gt; ap2(k)=dsum&lt;BR /&gt; enddo&lt;BR /&gt; seed(i)=e&lt;BR /&gt; e=e+de&lt;BR /&gt; end do lap2&lt;BR /&gt;! write(*,*) "AP02 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = &lt;BR /&gt;!AP3&lt;BR /&gt; de=(emax-emin)/dfloat(ienum)&lt;BR /&gt; e=emin&lt;BR /&gt; k=0&lt;BR /&gt; lap3: do i=1,ienum+1&lt;BR /&gt; dsum=0.0d0&lt;BR /&gt; &lt;BR /&gt; do l=1,lorbit&lt;BR /&gt; sum3=0.0d0&lt;BR /&gt; k=k+1&lt;BR /&gt; &lt;BR /&gt; sum3=(e-agc(1,l))/(agd(1,l)*agd(1,l))&lt;BR /&gt; sum3=sum3-(e-agc(2,l))/(agd(2,l)*agd(2,l))&lt;BR /&gt; sum3=sum3*(y-x)*dpot_sq(l)&lt;BR /&gt; &lt;BR /&gt; ap3(k)=-sum3&lt;BR /&gt; end do&lt;BR /&gt; seed(i)=e&lt;BR /&gt; e=e+de&lt;BR /&gt; end do lap3&lt;BR /&gt;! write(*,*) "AP03 Generated" &lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = &lt;BR /&gt;!AP4&lt;BR /&gt; e=emin&lt;BR /&gt; k=0&lt;BR /&gt; lap4: do i=1,ienum+1&lt;BR /&gt; dsum=0.0d0&lt;BR /&gt; &lt;BR /&gt; do l=1,lorbit&lt;BR /&gt; sum4=0.0d0&lt;BR /&gt; k=k+1&lt;BR /&gt; &lt;BR /&gt; sum4=(e-agc(1,l))/(agd(1,l)*agd(1,l))&lt;BR /&gt; sum4=sum4-(e-agc(2,l))/(agd(2,l)*agd(2,l))&lt;BR /&gt; sum4=sum4*dsqrt(x*y)*dpot_sq(l)&lt;BR /&gt; ap4(k)=-sum4&lt;BR /&gt; end do&lt;BR /&gt; e=e+de&lt;BR /&gt; end do lap4&lt;BR /&gt;! write(*,*) "AP04 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = &lt;BR /&gt;!AP5&lt;BR /&gt; ap5=0.0d0&lt;BR /&gt; &lt;BR /&gt; lap5: do i=1,lorbit&lt;BR /&gt; ap5(i,i)=dsqrt(dpot_sq(i))&lt;BR /&gt; end do lap5&lt;BR /&gt;! write(*,*) "AP05 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = &lt;BR /&gt; do i=1,nrsite&lt;BR /&gt; call matmult(ap5,i,srl)&lt;BR /&gt; end do&lt;BR /&gt;!  We generate new structure matrix from the subroutine texttt{matmult} to be&lt;BR /&gt;!  use for the texttt{POTPAR} 7-13.par&lt;BR /&gt;!=============================================&lt;BR /&gt;!AP6&lt;BR /&gt; lap6:  do l=1,lorbit&lt;BR /&gt; ap6(l)=cpot(l)+dpot_sq(l)*srl(l,l,0)-enuc(l) &lt;BR /&gt; end do lap6&lt;BR /&gt;! write(*,*) "AP06 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = =&lt;BR /&gt;!AP7 &lt;BR /&gt; lap7: do l=1,lorbit&lt;BR /&gt; sum7=0.0d0&lt;BR /&gt; sum7= ((agc(1,l)-enu_ag(1,l))/(agd(1,l)*agd(1,l)))*x + &amp;amp;&lt;BR /&gt; ((agc(2,l)-enu_ag(2,l))/(agd(2,l)*agd(2,l)))*y  &lt;BR /&gt; sum7=(sum7+srl(l,l,0))*dpot_sq(l)&lt;BR /&gt; &lt;BR /&gt; ap7(l)=sum7&lt;BR /&gt; enddo lap7&lt;BR /&gt;! write(*,*) "AP07 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = =&lt;BR /&gt;!AP9&lt;BR /&gt; lap9: do l=1,lorbit&lt;BR /&gt; sum9=0.0d0&lt;BR /&gt; sum9=(agc(1,l)-enu_ag(1,l))/(agd(1,l)*agd(1,l))&lt;BR /&gt; sum9=sum9-(agc(2,l)-enu_ag(2,l))/(agd(2,l)*agd(2,l))&lt;BR /&gt; sum9=sum9*(y-x)*dpot_sq(l)&lt;BR /&gt; ap9(l)=sum9&lt;BR /&gt; end do lap9 &lt;BR /&gt;! write(*,*) "AP09 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = =&lt;BR /&gt;!AP8&lt;BR /&gt; lap8: do l=1,lorbit&lt;BR /&gt; sum8=0.0d0&lt;BR /&gt; &lt;BR /&gt; sum8=(agc(1,l)-enu_ag(1,l))/(agd(1,l)*agd(1,l))&lt;BR /&gt; sum8=sum8-(agc(2,l)-enu_ag(2,l))/(agd(2,l)*agd(2,l))&lt;BR /&gt; sum8=sum8*dsqrt(x*y)*dpot_sq(l)&lt;BR /&gt;&lt;BR /&gt; ap8(l)=sum8&lt;BR /&gt; enddo lap8&lt;BR /&gt;! write(*,*) "AP08 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = =&lt;BR /&gt;!AP10&lt;BR /&gt; lap10: do l=1,lorbit&lt;BR /&gt; ap10(l)=opc(l)&lt;BR /&gt; enddo lap10&lt;BR /&gt;! write(*,*) "AP10 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = =&lt;BR /&gt;!AP11&lt;BR /&gt; lap11: do l=1,lorbit&lt;BR /&gt; ap11(l)=x*(agd(1,l)*ag_op(1,l)*agd(1,l))+ &amp;amp;&lt;BR /&gt; y*(agd(2,l)*ag_op(2,l)*agd(2,l))&lt;BR /&gt; ap11(l)=ap11(l)*(1.0d0/dpot_sq(l))&lt;BR /&gt; enddo lap11&lt;BR /&gt;! write(*,*) "AP11 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = =&lt;BR /&gt;!AP13&lt;BR /&gt; lap13: do l=1,lorbit&lt;BR /&gt;&lt;BR /&gt; sum13=0.0d0&lt;BR /&gt; sum13=agd(1,l)*ag_op(1,l)*agd(1,l)- &amp;amp;&lt;BR /&gt; agd(2,l)*ag_op(2,l)*agd(2,l)&lt;BR /&gt; sum13=sum13*(y-x)*(1.0d0/dpot_sq(l))&lt;BR /&gt;&lt;BR /&gt; ap13(l)=sum13&lt;BR /&gt; end do lap13&lt;BR /&gt;! write(*,*) "AP13 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = =&lt;BR /&gt;!AP12&lt;BR /&gt; lap12: do l=1,lorbit&lt;BR /&gt; ap12(l)=agd(1,l)*ag_op(1,l)*agd(1,l)- &amp;amp;&lt;BR /&gt; agd(2,l)*ag_op(2,l)*agd(2,l)&lt;BR /&gt; ap12(l)=ap12(l)*dsqrt(x*y)*(1.0d0/dpot_sq(l))&lt;BR /&gt; enddo lap12&lt;BR /&gt;! write(*,*) "AP12 Generated"&lt;BR /&gt;!= = = = = = = = = = = = = = = = = = = = = = =&lt;BR /&gt;&lt;BR /&gt;!  Once the texttt{POTPAR}'s are created, now we are ready to call the&lt;BR /&gt;!  recursion subroutine texttt{hop}. I have calculated hop for s,p and 2 d&lt;BR /&gt;!  orbitals(t2 &amp;amp; e2).&lt;BR /&gt; &lt;BR /&gt;!======================================================!&lt;BR /&gt;! this chunk should be parallel&lt;BR /&gt;! Energy dependent loop starts&lt;BR /&gt;! XA,YA,XXA,YYA,TEMP &amp;amp; SPEC&lt;BR /&gt;!======================================================!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;!$ call OMP_SET_NUM_THREADS(2)&lt;BR /&gt;&lt;BR /&gt;!$OMP PARALLEL DO DEFAULT(NONE) &amp;amp; &lt;BR /&gt;!$OMP PRIVATE(il,ie,iie,ienrp,iend) &amp;amp;&lt;BR /&gt;!$OMP PRIVATE(temp,spec,xa,ya) &amp;amp;&lt;BR /&gt;!$OMP SHARED(ap1,ap2,ap3,ap4,ap6,ap7) &amp;amp;&lt;BR /&gt;!$OMP SHARED(ap8,ap9,ap10,ap11,ap12,ap13) &amp;amp;&lt;BR /&gt;!$OMP SHARED(MAP,SRL,seed,de,xxa,yya,e,istart) &lt;BR /&gt;orbital: do il=1,lorbit-2,2&lt;BR /&gt; xa=0.0;ya=0.0&lt;BR /&gt; write(*,'(1x,"Starting orbital loop",1x,i1,$)') il&lt;BR /&gt; ienrp=0&lt;BR /&gt; e=emin-de&lt;BR /&gt; istart=1 &lt;BR /&gt;&lt;BR /&gt; do iend=9,63,lorbit&lt;BR /&gt;!$OMP ATOMIC&lt;BR /&gt; e=e+de&lt;BR /&gt; iie=0&lt;BR /&gt; &lt;BR /&gt;!$OMP ATOMIC&lt;BR /&gt; ienrp=ienrp+1&lt;BR /&gt; call hop(il,e,ienrp,map,srl,ap1,  &amp;amp; &lt;BR /&gt; ap6,ap7,ap8,ap9,ap10,ap11, &amp;amp;&lt;BR /&gt; ap12,ap13,ap2,ap3,ap4,xa,ya)&lt;BR /&gt;&lt;BR /&gt; write(*,*) loc(xa(1,1))&lt;BR /&gt; istart=iend+1&lt;BR /&gt; write(*,'(".",$)') &lt;BR /&gt; end do&lt;BR /&gt; call fit(xa,ya,seed,xxa,yya,temp)&lt;BR /&gt; call spectral(il,xxa,yya,temp,spec)&lt;BR /&gt; write(*,'("done")') &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; end do orbital&lt;BR /&gt;!$OMP END PARALLEL DO &lt;BR /&gt;!======================================================!&lt;BR /&gt;! Energy dependent loop done&lt;BR /&gt;! parallel thread shld end here&lt;BR /&gt;!  inquire(file='stop',EXIST=lstop)&lt;BR /&gt;!  if (lstop) then&lt;BR /&gt;!  open(190,file='stop',status='old')&lt;BR /&gt;!  read(190,*)actn&lt;BR /&gt;!  if(trim('immideate').eq.trim(actn))then&lt;BR /&gt;!  write(*,*) "HARD STOP ENCOUNTERED &amp;amp;&lt;BR /&gt;! &amp;amp; STOPPING SYSTEM IMMEDEATLY"&lt;BR /&gt;!  call system('rm -f stop')&lt;BR /&gt;! t0cpu(2)=scnds()&lt;BR /&gt;! t0wall(2) = cclock()&lt;BR /&gt;! write(*,'(1x,"ELAPSED WALL CLOCK TIME =",1x,f10.4,1x,"s")') &amp;amp;&lt;BR /&gt;! t0wall(2)-t0wall(1)&lt;BR /&gt;! write(*,'(1x,"ELAPSED CPU CLOCK TIME =",1x,f10.4,1x,"s")') &amp;amp;&lt;BR /&gt;! t0cpu(2)-t0cpu(1)&lt;BR /&gt;! stop&lt;BR /&gt;! &lt;BR /&gt;!  endif&lt;BR /&gt;!  if((trim('loop').eq.trim(actn)).and.(il==7)) &amp;amp;&lt;BR /&gt;!  write(*,*) "LOOP STOP ENCOUNTERED. &amp;amp;&lt;BR /&gt;!  &amp;amp; RUN WILL STOP AFTER THIS LSCF LOOP"&lt;BR /&gt;!  close(190)&lt;BR /&gt;!  endif&lt;BR /&gt;&lt;BR /&gt;!======================================================!&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; call tdos(spec,ipq,nsp,dos, &amp;amp;&lt;BR /&gt; sorb,porb,dorb,osd1,osd2)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;!***********************************************!&lt;BR /&gt;! Writing DOS to the files&lt;BR /&gt;! &lt;BR /&gt;!***********************************************!&lt;BR /&gt;! DOS of atom A&lt;BR /&gt; if(ipq==1.and.nsp==1)then  !UP spin for A&lt;BR /&gt; open(1,file='DOS_A_UP',status='replace')&lt;BR /&gt; do i=1,nfn+1&lt;BR /&gt; write(1,*)temp(i),dos(i)&lt;BR /&gt; dos_aa(i)=dos(i)&lt;BR /&gt; enddo&lt;BR /&gt; close(1)&lt;BR /&gt; endif&lt;BR /&gt; if(ipq==1.and.nsp==2)then !DOWN spin for A&lt;BR /&gt; open(1,file='DOS_A_DN',status='replace')&lt;BR /&gt; do i=1,nfn+1&lt;BR /&gt; write(1,*)temp(i),dos(i)&lt;BR /&gt; dos_adn(i)=dos(i)&lt;BR /&gt; enddo&lt;BR /&gt; close(1) &lt;BR /&gt; endif&lt;BR /&gt; &lt;BR /&gt;! DOS of atom B&lt;BR /&gt; if(ipq==2.and.nsp==1)then !UP spin for B&lt;BR /&gt; open(1,file='DOS_B_UP',status='replace')&lt;BR /&gt; do i=1,nfn+1&lt;BR /&gt; write(1,*)temp(i),dos(i)&lt;BR /&gt; dos_b(i)=dos(i)&lt;BR /&gt; enddo&lt;BR /&gt; close(1)&lt;BR /&gt; endif&lt;BR /&gt;&lt;BR /&gt; if(ipq==2.and.nsp==2)then !DOWN spin for B&lt;BR /&gt; open(1,file='DOS_B_DN',status='replace')&lt;BR /&gt; do i=1,nfn+1&lt;BR /&gt; write(1,*)temp(i),dos(i) &lt;BR /&gt; dos_bdn(i)=dos(i)&lt;BR /&gt; enddo&lt;BR /&gt; close(1)&lt;BR /&gt; endif&lt;BR /&gt;&lt;BR /&gt; end do ltype&lt;BR /&gt;&lt;BR /&gt; end do lspin&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; call ldos(dos_aa,dos_b,dos_adn,dos_bdn,temp,T_dos)&lt;BR /&gt;&lt;BR /&gt; call fermi(temp,T_dos,ef)&lt;BR /&gt; call band(temp,T_dos,ef,e_band)&lt;BR /&gt; &lt;BR /&gt; call pardos(temp,sorb,porb,dorb,ef,nit,e_band, &amp;amp;&lt;BR /&gt; qtot_a,qtot_b,qtot_a1,qtot_b1)&lt;BR /&gt; open(1,file='/home/rudra/Recursion/LMTO_A/ATOM/CHECK',status='new') &lt;BR /&gt;! write(1,*)ipdos&lt;BR /&gt; close(1,status='delete')&lt;BR /&gt;&lt;BR /&gt; open(2,file='/home/rudra/Recursion/LMTO_B/ATOM/CHECK',status='new') &lt;BR /&gt;! write(2,*)ipdos&lt;BR /&gt; close(2,status='delete')&lt;BR /&gt;&lt;BR /&gt; if(nit/=0)then&lt;BR /&gt; xcha=dabs(qtot_a-qold_a)&lt;BR /&gt; xchb=dabs(qtot_b-qold_b)&lt;BR /&gt; if((xcha&amp;lt;0.0001d0).and.(xchb&amp;lt;0.0001d0))then&lt;BR /&gt; write(*,*) 'CHARGE CONVERGENCE DONE'&lt;BR /&gt; nconv=nconv+1&lt;BR /&gt; if(nconv==5)stop "SCF DONE"&lt;BR /&gt; else&lt;BR /&gt; nconv=0&lt;BR /&gt; endif&lt;BR /&gt; endif&lt;BR /&gt; &lt;BR /&gt; qold_a=qtot_a&lt;BR /&gt; qold_b=qtot_b&lt;BR /&gt;&lt;BR /&gt; write(*,*) qtot_a,qtot_b&lt;BR /&gt; write(*,*) nit&lt;BR /&gt; if (nit==nscf)go to 3000&lt;BR /&gt;&lt;BR /&gt;11 open(1,file='/home/rudra/Recursion/LMTO_B/ATOM/CHECK_A',status='old',iostat=ok)&lt;BR /&gt; do ikki=1,150&lt;BR /&gt; end do&lt;BR /&gt;! if(ok/=0) goto 11&lt;BR /&gt; close(1,status='delete')&lt;BR /&gt;&lt;BR /&gt;12 open(1,file='/home/rudra/Recursion/LMTO_B/ATOM/CHECK_B',status='old',iostat=ok)&lt;BR /&gt; do ikki=1,150&lt;BR /&gt; end do&lt;BR /&gt;! if(ok/=0) go to 12&lt;BR /&gt; close(1,status='delete')&lt;BR /&gt;&lt;BR /&gt; inquire(file='stop',EXIST=lstop)&lt;BR /&gt; if (lstop) then&lt;BR /&gt; open(190,file='stop',status='old')&lt;BR /&gt; read(190,*)actn&lt;BR /&gt; if(trim('loop').eq.trim(actn))then&lt;BR /&gt; call system('rm -f stop')&lt;BR /&gt;!  go to 555&lt;BR /&gt; endif&lt;BR /&gt; close(190)&lt;BR /&gt; endif&lt;BR /&gt;&lt;BR /&gt; end do lscf&lt;BR /&gt;3000 continue&lt;BR /&gt;&lt;BR /&gt; call cpu_time(t2)&lt;BR /&gt; call date_and_time(VALUES=values2)&lt;BR /&gt; write(*,100) values2(3)-values1(3), values2(5)-values1(5),values2(6)-values1(6),values2(7)-values1(7)&lt;BR /&gt;100 format(1x,"ELAPSED WALL CLOCK TIME =",1x,i2,1x,"days",2x,i2,1x,"hr",2x,i2,1x,"min",2x,i2,1x,"sec")&lt;BR /&gt;&lt;BR /&gt;!555 t0cpu(2)=scnds()&lt;BR /&gt;! t0wall(2) = cclock()&lt;BR /&gt;! write(*,'(1x,"ELAPSED WALL CLOCK TIME =",1x,f10.4,1x,"s")') &amp;amp;&lt;BR /&gt;! t0wall(2)-t0wall(1)&lt;BR /&gt; write(*,'(1x,"ELAPSED CPU CLOCK TIME =",1x,f10.4,1x,"s")') &amp;amp;&lt;BR /&gt; t2-t1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; end program main&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-size: medium;"&gt;The code hop&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt;!*******************************************************!&lt;BR /&gt;! This is the recursion subroutine  !&lt;BR /&gt;! &lt;BR /&gt;!*******************************************************!&lt;BR /&gt; module mhop&lt;BR /&gt; CONTAINS&lt;BR /&gt; subroutine hop (il,e,ienrp,map,srl,ap1,ap6,ap7, &amp;amp;&lt;BR /&gt; ap8,ap9,ap10,ap11,ap12,ap13, &amp;amp;&lt;BR /&gt; p2,p3,p4,xa,ya)&lt;BR /&gt;!*******************************************************!&lt;BR /&gt;! The subroutine is the recursion subroutine !&lt;BR /&gt;! It uses the potential parameters generated !&lt;BR /&gt;! by *POTPAR* subroutine.    !&lt;BR /&gt;! this module interface is not actually required. !&lt;BR /&gt;! it is done only to make sure that POTPAR by !&lt;BR /&gt;! this routine and that this routine is called  !&lt;BR /&gt;! by main texttt{properly}.par&lt;BR /&gt;! Here We have done the 2nd order calculation : !&lt;BR /&gt;! $$E=H+hoh$$&lt;BR /&gt;!*******************************************************!&lt;BR /&gt; use kinds, only: RDP,i3&lt;BR /&gt; use parameters&lt;BR /&gt; implicit none&lt;BR /&gt; integer(i3):: i,il,ikl,ifind,ii,j&lt;BR /&gt; integer(i3):: nfill,jfill,isfill,nrec&lt;BR /&gt; integer(i3):: kc,k,ienrp&lt;BR /&gt; integer(i3):: mfill,ikk&lt;BR /&gt; integer(i3),dimension(nasite,ntsite),intent(in)::map&lt;BR /&gt; real(RDP):: s1,sum1,sum2,sum3,e&lt;BR /&gt; real(RDP),dimension(lorbit,lorbit,0:nrsite),intent(in):: srl&lt;BR /&gt; real(RDP),dimension(lorbit),intent(in)::ap1,ap6,ap7,ap8,ap9, &amp;amp;&lt;BR /&gt; ap10,ap11,ap12,ap13&lt;BR /&gt; real(RDP), dimension(lorbit),intent(in):: p2,p3,p4 &lt;BR /&gt; real(RDP), dimension(maxrec,ienum+1),intent(out):: ya,xa &lt;BR /&gt;&lt;BR /&gt; real(RDP),dimension(nsite,lorbit)::psii,psij,psik,psim &lt;BR /&gt; real(RDP),dimension(maxrec)::alpha &lt;BR /&gt; real(RDP),dimension(0:maxrec)::beta &lt;BR /&gt; real(RDP),dimension(lorbit)::cons,ar &lt;BR /&gt;&lt;BR /&gt; sum1=0.0d0&lt;BR /&gt; beta(0)=0.0d0&lt;BR /&gt; ifind=1&lt;BR /&gt;&lt;BR /&gt; psii(:,:)=0.0d0&lt;BR /&gt; psij(:,:)=0.0d0&lt;BR /&gt; psik(:,:)=0.0d0&lt;BR /&gt; psim(:,:)=0.0d0&lt;BR /&gt;&lt;BR /&gt; psij(1,il)=1.0d0&lt;BR /&gt; nfill=1&lt;BR /&gt;&lt;BR /&gt; open(15,file='coeff.dat',status='unknown') &lt;BR /&gt;&lt;BR /&gt;! Starting Recursion loop(12 iteration)&lt;BR /&gt; lrec: do nrec=1,maxrec&lt;BR /&gt; jfill=nfill&lt;BR /&gt;&lt;BR /&gt;lfill: do i=1,nfill&lt;BR /&gt; &lt;BR /&gt; kc=map(i,ntsite)&lt;BR /&gt;&lt;BR /&gt;!+++++++++++++++++++++++++++++++++++++++++++++++!&lt;BR /&gt;!   HOP    !&lt;BR /&gt;! For 2st order. hoh is included  !&lt;BR /&gt;!+++++++++++++++++++++++++++++++++++++++++++++++!&lt;BR /&gt;&lt;BR /&gt; if1:  if (kc==1) then&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=(ap6(ikl)*psij(i,ikl))&lt;BR /&gt; psim(i,ikl)=psim(i,ikl)+s1&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; cons(ii)=psij(i,ii)&lt;BR /&gt; end do&lt;BR /&gt; &lt;BR /&gt; do j=1,nrsite&lt;BR /&gt; k=map(i,j)&lt;BR /&gt; if(k&amp;gt;nsite) cycle&lt;BR /&gt; if(k&amp;gt;ifind) ifind=k&lt;BR /&gt; &lt;BR /&gt; call matp(srl,cons,j,ar)&lt;BR /&gt;&lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; psim(k,ii)=psim(k,ii)+ar(ii)&lt;BR /&gt; enddo&lt;BR /&gt; end do&lt;BR /&gt; cycle lfill&lt;BR /&gt; endif if1&lt;BR /&gt;&lt;BR /&gt;!-----------------------------------------------!&lt;BR /&gt;! If real space part is = 1 then  !&lt;BR /&gt;!-----------------------------------------------!&lt;BR /&gt;&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=ap7(ikl)*psij(i,ikl)&lt;BR /&gt; psim(i,ikl)=psim(i,ikl)+s1&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; cons(ii)=psij(i,ii)&lt;BR /&gt; end do&lt;BR /&gt; &lt;BR /&gt; do j=1,nrsite&lt;BR /&gt; k=map(i,j)&lt;BR /&gt; if(k&amp;gt;nsite) cycle&lt;BR /&gt; if(k&amp;gt;ifind) ifind=k&lt;BR /&gt; call matp(srl,cons,j,ar)&lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; psim(k,ii)=psim(k,ii)+ar(ii)&lt;BR /&gt; enddo&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; k=map(i,ntsite-2)&lt;BR /&gt; if (k&amp;gt;nsite) cycle lfill&lt;BR /&gt; if (k&amp;gt;ifind)ifind=k&lt;BR /&gt;&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=0.0d0&lt;BR /&gt; s1=ap8(ikl)*psij(i,ikl)&lt;BR /&gt; psim(k,ikl)=psim(k,ikl)+s1&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; k=map(i,ntsite-1)&lt;BR /&gt; if(k==0)cycle lfill&lt;BR /&gt;&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=0.0d0&lt;BR /&gt; s1=ap9(ikl)*psij(i,ikl)&lt;BR /&gt; psim(i,ikl)=psim(i,ikl)+s1&lt;BR /&gt; end do&lt;BR /&gt; end do lfill&lt;BR /&gt;!---------H operation finished--------!&lt;BR /&gt; &lt;BR /&gt;!---------O-operation Starts----------!&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; nfill=ifind&lt;BR /&gt;&lt;BR /&gt; if(nfill&amp;gt;nasite) nfill=nasite&lt;BR /&gt;&lt;BR /&gt;lnfill: do i=1,nfill&lt;BR /&gt; &lt;BR /&gt; kc=map(i,ntsite)&lt;BR /&gt;&lt;BR /&gt; if(kc==1)then&lt;BR /&gt; &lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=0.0d0&lt;BR /&gt; s1=ap10(ikl)*psim(i,ikl)&lt;BR /&gt; psik(i,ikl)=psik(i,ikl)+s1&lt;BR /&gt; enddo&lt;BR /&gt; cycle lnfill&lt;BR /&gt; endif&lt;BR /&gt;!-------------------------------------------------&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=ap11(ikl)*psim(i,ikl)&lt;BR /&gt; psik(i,ikl)=psik(i,ikl)+s1&lt;BR /&gt; enddo&lt;BR /&gt; &lt;BR /&gt; k=map(i,ntsite-2)&lt;BR /&gt; if(k.gt.nsite) cycle lnfill&lt;BR /&gt; if(k.gt.ifind)ifind=k&lt;BR /&gt;&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=0.0d0&lt;BR /&gt; s1=ap12(ikl)*psim(i,ikl)&lt;BR /&gt; psik(k,ikl)=psik(k,ikl)+s1&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; k=map(i,ntsite-1)&lt;BR /&gt;&lt;BR /&gt; if(k==0)cycle lnfill&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=0.0d0&lt;BR /&gt; &lt;BR /&gt; s1=ap13(ikl)*psim(i,ikl)&lt;BR /&gt; psik(i,ikl)=psik(i,ikl)+s1&lt;BR /&gt;&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; enddo lnfill &lt;BR /&gt;!------O-operation complete------------!&lt;BR /&gt; psim=0.0d0&lt;BR /&gt;&lt;BR /&gt;!******* again h-operation *************&lt;BR /&gt; isfill=ifind&lt;BR /&gt;&lt;BR /&gt; if(isfill&amp;gt;nasite)isfill=nasite&lt;BR /&gt;lisfill:do i=1,isfill&lt;BR /&gt;&lt;BR /&gt; kc=map(i,ntsite)&lt;BR /&gt;&lt;BR /&gt;lkc: if(kc==1)then&lt;BR /&gt;&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=0.0d0&lt;BR /&gt; s1=ap6(ikl)*psik(i,ikl)&lt;BR /&gt; psim(i,ikl)=psim(i,ikl)+s1&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; cons(ii)=psik(i,ii)&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; do j=1,nrsite&lt;BR /&gt; k=map(i,j)&lt;BR /&gt; if(k&amp;gt;nsite)cycle&lt;BR /&gt; if(k&amp;gt;ifind)ifind=k&lt;BR /&gt;&lt;BR /&gt; call matp(srl,cons,j,ar)&lt;BR /&gt; &lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; psim(k,ii)=psim(k,ii)+ar(ii)&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; enddo &lt;BR /&gt; &lt;BR /&gt; cycle lisfill&lt;BR /&gt; endif lkc&lt;BR /&gt;&lt;BR /&gt;!********************************************&lt;BR /&gt;&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=0.0d0&lt;BR /&gt; s1=ap7(ikl)*psik(i,ikl) &lt;BR /&gt; psim(i,ikl)=psim(i,ikl)+s1&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; cons(ii)=psik(i,ii)&lt;BR /&gt; enddo&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; do j=1,nrsite&lt;BR /&gt;&lt;BR /&gt; k=map(i,j)&lt;BR /&gt;&lt;BR /&gt; if(k&amp;gt;nsite)cycle&lt;BR /&gt;&lt;BR /&gt; if(k&amp;gt;ifind)ifind=k&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; call matp(srl,cons,j,ar) &lt;BR /&gt; &lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; psim(k,ii)=psim(k,ii)+ar(ii)&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; k=map(i,ntsite-2)&lt;BR /&gt; if(k.gt.nsite)cycle lisfill&lt;BR /&gt; if(k.gt.ifind)ifind=k&lt;BR /&gt;&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=0.0d0&lt;BR /&gt; s1=ap8(ikl)*psik(i,ikl)&lt;BR /&gt; psim(k,ikl)=psim(k,ikl)+s1&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; k=map(i,ntsite-1)&lt;BR /&gt;&lt;BR /&gt; if(k==0)cycle lisfill&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=0.0d0&lt;BR /&gt; s1=ap9(ikl)*psik(i,ikl)&lt;BR /&gt; psim(i,ikl)=psim(i,ikl)+s1&lt;BR /&gt;&lt;BR /&gt; enddo&lt;BR /&gt; &lt;BR /&gt; enddo lisfill&lt;BR /&gt;!*********** hoh complete*************&lt;BR /&gt; psik=0.0d0&lt;BR /&gt;!******** 2nd h-operatipn complete************** hoh complete&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; ljfill: do i=1,jfill&lt;BR /&gt; kc=map(i,ntsite)&lt;BR /&gt; lifn: if (kc==1) then&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=ap1(ikl)*psij(i,ikl)&lt;BR /&gt; psik(i,ikl)=psik(i,ikl)+s1&lt;BR /&gt; end do&lt;BR /&gt; &lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; cons(ii)=psij(i,ii)&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; nrs: do j=1,nrsite&lt;BR /&gt; k=map(i,j)&lt;BR /&gt; if (k&amp;gt;nsite) cycle&lt;BR /&gt; if(k&amp;gt;ifind) ifind=k&lt;BR /&gt; &lt;BR /&gt; call matp(srl,cons,j,ar)&lt;BR /&gt; &lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; psik(k,ii)=psik(k,ii)+ar(ii)&lt;BR /&gt; end do&lt;BR /&gt; &lt;BR /&gt; end do nrs&lt;BR /&gt; cycle ljfill&lt;BR /&gt; endif lifn   &lt;BR /&gt;&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=p2(ikl)*psij(i,ikl)&lt;BR /&gt; psik(i,ikl)=psik(i,ikl)+s1&lt;BR /&gt; end do&lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; cons(ii)=psij(i,ii)&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; do j=1,nrsite&lt;BR /&gt; k=map(i,j)&lt;BR /&gt; if (k&amp;gt;nsite) cycle&lt;BR /&gt; if (k&amp;gt;ifind)ifind=k&lt;BR /&gt; &lt;BR /&gt; call matp(srl,cons,j,ar)&lt;BR /&gt;&lt;BR /&gt; do ii=1,lorbit&lt;BR /&gt; psik(k,ii)=psik(k,ii)+ar(ii)&lt;BR /&gt; end do&lt;BR /&gt; &lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; k=map(i,ntsite-2)&lt;BR /&gt; if (k&amp;gt;nsite) cycle&lt;BR /&gt; if (k&amp;gt;ifind) ifind=k&lt;BR /&gt; &lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=p4(ikl)*psij(i,ikl)&lt;BR /&gt; psik(k,ikl)=psik(k,ikl)+s1&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; k=map(i,ntsite-1)&lt;BR /&gt; if (k==0) cycle &lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; s1=p3(ikl)*psij(i,ikl)&lt;BR /&gt; psik(i,ikl)=psik(i,ikl)+s1&lt;BR /&gt; end do&lt;BR /&gt; end do ljfill&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; do ikk=1,ifind&lt;BR /&gt; do ikl=1,lorbit&lt;BR /&gt; psik(ikk,ikl)=psik(ikk,ikl)-psim(ikk,ikl)&lt;BR /&gt; end do&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt;!===============================================!&lt;BR /&gt;! calculating $alpha$ &amp;amp; $beta$  !&lt;BR /&gt;! may be done as a subroutine  ! &lt;BR /&gt;!===============================================!&lt;BR /&gt;&lt;BR /&gt; mfill=ifind&lt;BR /&gt; sum1=0.0d0&lt;BR /&gt; do i=1,jfill&lt;BR /&gt; do j=1,lorbit&lt;BR /&gt; sum1=sum1+psij(i,j)*psij(i,j)&lt;BR /&gt; end do&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; sum2=0.0d0&lt;BR /&gt; do i=1,mfill&lt;BR /&gt; do j=1,lorbit&lt;BR /&gt; sum2=sum2+psik(i,j)*psij(i,j)&lt;BR /&gt; end do&lt;BR /&gt; end do&lt;BR /&gt; &lt;BR /&gt; alpha(nrec)=sum2/sum1  &lt;BR /&gt;write(*,*)il,"=&amp;gt;", loc(alpha(nrec))&lt;BR /&gt; do i=1,mfill&lt;BR /&gt; do j=1,lorbit&lt;BR /&gt; psik(i,j)=psik(i,j)-alpha(nrec)*psij(i,j)-beta(nrec-1)*psii(i,j)&lt;BR /&gt; end do&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; sum3=0.0d0&lt;BR /&gt; do i=1,mfill&lt;BR /&gt; do j=1,lorbit&lt;BR /&gt; sum3=sum3+psik(i,j)*psik(i,j)&lt;BR /&gt; end do&lt;BR /&gt; end do&lt;BR /&gt; &lt;BR /&gt; beta(nrec)=sum3/sum1&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; do i=1,nsite&lt;BR /&gt; do j=1,lorbit&lt;BR /&gt; psii(i,j)=psij(i,j)&lt;BR /&gt; psij(i,j)=psik(i,j)&lt;BR /&gt; psik(i,j)=0.0d0&lt;BR /&gt; psim(i,j)=0.0d0&lt;BR /&gt; end do&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; nfill=mfill&lt;BR /&gt; if (mfill&amp;gt;nasite)nfill=nasite&lt;BR /&gt; ifind=1&lt;BR /&gt; xa(nrec,ienrp)=alpha(nrec)&lt;BR /&gt; ya(nrec,ienrp)=beta(nrec)&lt;BR /&gt; write(15,*)nrec,alpha(nrec),beta(nrec) &lt;BR /&gt; end do lrec &lt;BR /&gt; close(15)&lt;BR /&gt; &lt;BR /&gt; end subroutine hop&lt;BR /&gt;&lt;BR /&gt;!-----------------------------------------------!&lt;BR /&gt;! Subroutine MATP    ! &lt;BR /&gt;! to multiply SRL*CONS   !&lt;BR /&gt; subroutine matp(srl,cons,j,ar)&lt;BR /&gt;!-----------------------------------------------!&lt;BR /&gt; use kinds&lt;BR /&gt; use parameters&lt;BR /&gt; implicit double precision(a-h,o-z)&lt;BR /&gt;&lt;BR /&gt; real(RDP),dimension(lorbit,lorbit,0:nrsite):: srl&lt;BR /&gt; real(RDP),dimension(lorbit):: cons,ar&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; do i=1,lorbit&lt;BR /&gt; su=0.0d0&lt;BR /&gt; do kl=1,lorbit&lt;BR /&gt; su=su+srl(i,kl,j)*cons(kl)&lt;BR /&gt; enddo&lt;BR /&gt; ar(i)=su&lt;BR /&gt; enddo&lt;BR /&gt; &lt;BR /&gt; end subroutine&lt;BR /&gt;&lt;BR /&gt; end module mhop&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-size: medium;"&gt;the parameter file&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;!***********************************************!&lt;BR /&gt;! This module declares the parameters used !&lt;BR /&gt;! in this code.    !&lt;BR /&gt;!***********************************************!&lt;BR /&gt; module parameters&lt;BR /&gt;&lt;BR /&gt; use kinds&lt;BR /&gt; PUBLIC&lt;BR /&gt; integer(i3),parameter:: &amp;amp;&lt;BR /&gt; lattice=221, &amp;amp;&lt;BR /&gt; idim=3,  &amp;amp;!Lattice dimension&lt;BR /&gt; norb=3,  &amp;amp;!Number of orbital calc.&lt;BR /&gt; nrsite=14, &amp;amp;!Nearest neighbour in real space&lt;BR /&gt; nasite=73109, &amp;amp;!Number of site in AS Map&lt;BR /&gt; ntype=2, &amp;amp;!Number of atom type&lt;BR /&gt; ntsite=nrsite+3,&amp;amp;!Dimension of AS Map &lt;BR /&gt; nsite=369902, &amp;amp;!Total number of n.n. in AS Map&lt;BR /&gt; maxrec=12, &amp;amp;!Number of recursion step&lt;BR /&gt; lorbit=9, &amp;amp;!Number of orbital(s+p+d)&lt;BR /&gt; nscf=1, &amp;amp;!SCF loop&lt;BR /&gt; imax=172, &amp;amp;&lt;BR /&gt; info=172, &amp;amp;&lt;BR /&gt; llmax=16, &amp;amp;&lt;BR /&gt; jl=7,  &amp;amp;&lt;BR /&gt; ienum=7, &amp;amp;!Number of seeds for fitting&lt;BR /&gt; ienump=ienum+1, &amp;amp;&lt;BR /&gt; nkp=17,  &amp;amp;!Number of points extrapolated&lt;BR /&gt; !for a and b&lt;BR /&gt; nfn=900, &amp;amp;&lt;BR /&gt; spn=2,  &amp;amp;!1=&amp;gt;up spin;2=&amp;gt;down spin&lt;BR /&gt; npn=lorbit*ienump&lt;BR /&gt;&lt;BR /&gt; real(RDP),parameter:: &amp;amp;&lt;BR /&gt; emin=-0.9d0, &amp;amp;!emax-&amp;gt;emin=energy range&lt;BR /&gt; emax=1.00d0, &amp;amp;!&lt;BR /&gt; z_a=24.0d0, &amp;amp;!Atomic number of atom A&lt;BR /&gt; z_b=25.0d0, &amp;amp;!Atomic number of atom B&lt;BR /&gt; e_a=6.0d0,  &amp;amp;!Valence electron atom A&lt;BR /&gt; e_b=7.0d0, &amp;amp;!Valence electron atom B&lt;BR /&gt; c_a=z_a-e_a, &amp;amp;!Core electron atom A&lt;BR /&gt; c_b=z_b-e_b, &amp;amp;!Core electron atom B&lt;BR /&gt; x=0.60_RDP, &amp;amp;!Conc. of atom type A&lt;BR /&gt; y=1.00d0-x, &amp;amp;!Conc. of atom type B&lt;BR /&gt; ALPF=0.005882d0,&amp;amp;&lt;BR /&gt; ALPS=0.34850d0, &amp;amp;!POTPAR for orb. S&lt;BR /&gt; ALPP=0.05303d0, &amp;amp;!POTPAR for orb. P&lt;BR /&gt; ALPD=0.01071d0, &amp;amp;!POTPAR for orb. D&lt;BR /&gt; ruban=0.10d0, &amp;amp;&lt;BR /&gt; amix=0.06d0, &amp;amp;!Mixing scheme parameter&lt;BR /&gt; filling=x*e_a+y*e_b&lt;BR /&gt; character(7)::ASMAP='BCC_MAP'&lt;BR /&gt; character(7)::CHK_A='CHECK_A',CHK_B='CHECK_B'&lt;BR /&gt; character(8)::STRUCTURE ='INFO_BCC'&lt;BR /&gt; end module parameters&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Jan 2009 05:02:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868797#M2806</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-01-14T05:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868798#M2807</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Roddur,&lt;BR /&gt;&lt;BR /&gt;I haven't looked too deep at the code, but in looking at the code it appears that there is something you need to explain or correct prior to looking further.&lt;BR /&gt;&lt;BR /&gt;The subroutine HOP is called from within a parallel region where each thread will enter with a different value foril (the parallel do loop variable)&lt;BR /&gt;&lt;BR /&gt;On entry into HOP each (every) thread issues&lt;BR /&gt;&lt;BR /&gt; open(15,file='coeff.dat',status='unknown') &lt;BR /&gt;&lt;BR /&gt;and begins a loop iterating on lrec&lt;BR /&gt;At the end of HOP is the end of the loop iterating on lrec and before the end do is the WRITE to file 15. And then following the loop is the CLOSE&lt;BR /&gt;&lt;BR /&gt;As written, you will have multiple threads creating, writing and closing this file under the assumption that it is the only thread performing this action.&lt;BR /&gt;&lt;BR /&gt;I am not suggesting this is the correct way to do this but it would seem like you would want to use a file number based on the incomming il value (e.g. 14+il) and use different named output files (e.g. coeff01.dat, coeff02.dat, ...)&lt;BR /&gt;&lt;BR /&gt;When you decide how to handle this then we can proceed looking further.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Jan 2009 13:12:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868798#M2807</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-01-14T13:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868799#M2808</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
yeah...u are right.&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Jan 2009 04:06:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868799#M2808</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-01-15T04:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: omp thread</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868800#M2809</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;roddur,&lt;BR /&gt;&lt;BR /&gt;Although you could use files as suggested, a fastermethod would be to create an allocatable array (of size lorbit) containing a user defined type containing an allocatable array and potentially other information such as last element stored. The inclosed allocatable array is then allocated to the max number of possibledata elements (containing the record curently written). Each thread then populates the records contained within its own array of records. Then after you exit theparallel region in main, you open the file and write the ordered data set to the file. Note, your il variablewas not part of the original data set written to the file so you would have to determine ifil(orbit)is importantto your output data set (as il may also be derrived by the position of the record in the output data set).&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Jan 2009 13:35:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/omp-thread/m-p/868800#M2809</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-01-15T13:35:30Z</dc:date>
    </item>
  </channel>
</rss>

