AutoMathText / data /code /fortran /0.05-0.10.jsonl
March07's picture
add batch 3/5 (200 files)
803451e verified
Raw
History Blame Contribute Delete
197 kB
{"text": "* Date: Mon, 4 May 1998 13:22:30 +0200 (MET DST)\n* From: Bengt Edvardsson <be@astro.uu.se>\n* To: Plez@Ferrum.fysik.lu.se\n************************************************************************\n*\n subroutine makeabund(overall,alpha,helium,rabund,sabund,fixabund,\n & abund,amass,aname,isotopfrac)\n*\n* Create a formatted abundance file\n* The programme scales groups of elements automatically\n* The input solar abundances are Grevesse et al. logarithmic\n* number abundances on a scale where N(Hydrogen) == 12.00\n* The output abundances are on the same scale (there has to be some H)\n* A null abundance is signalled as -29.0\n* STD?=1 indicates than no abundances have been fiddeled and\n* that the first line describes the whole list\n* STD?=0 mean that some abundance(s) has been modified by hand\n*\n* small changes by BPz 04/05-1998 for inclusion in MARCS35\n* more changes (isotopfrac inclusion), for SPECTRUM version (BPz 010798)\n*\n implicit none\n*\n integer natom,nelalpha,i,j\n parameter (natom = 92)\n parameter (nelalpha = 8)\n real amass(natom,0:250),abund(natom),sunabund(natom),\n & rfract(31:92),tempmass,\n & fixabund(natom),damass(natom),isotopfrac(natom,0:250),\n & sunabund_1998(natom),sunabund_2007(natom),checkiso\n real overall,alpha,helium,rabund,sabund,abundr,abunds,hfactor\n integer iel,ialpha,ielalpha(nelalpha)\n character*2 aname(natom),daname(natom)\n logical abund_2007\n*\n* isotopfrac(22,48) is isotopic fraction of 48Ti \n* sum_over_i>0{ isotopfrac(x,i) } = 1.000 \n* isotopfrac(x,0)==1.0; this is used in the case of no isotopes wanted\n* in calculation. It will ensure that the total abundance of the species\n* will be used.(if for example isotopic factors were included in gf-values)\n*\n\n*\nCCCC before 24/03-2004* C O Ne Mg Si S Ar Ca Ti\nCCCC before 24/03-2004 data ielalpha / 6, 8, 10, 12, 14, 16, 18, 20, 22 /\n* O Ne Mg Si S Ar Ca Ti\n data ielalpha / 8, 10, 12, 14, 16, 18, 20, 22 /\n\n*\n data daname / | atomic nr\n & 'H ','He','Li','Be','B ','C ','N ','O ','F ', | 1 - 9\n & 'Ne','Na','Mg','Al','Si','P ','S ','Cl','Ar', | 10 - 18\n & 'K ','Ca','Sc','Ti','V ','Cr','Mn','Fe','Co', | 19 - 27\n & 'Ni','Cu','Zn','Ga','Ge','As','Se','Br','Kr', | 28 - 36\n & 'Rb','Sr','Y ','Zr','Nb','Mo','Tc','Ru','Rh', | 37 - 45\n & 'Pd','Ag','Cd','In','Sn','Sb','Te','I ','Xe', | 46 - 54\n & 'Cs','Ba','La','Ce','Pr','Nd','Pm','Sm','Eu', | 55 - 63\n & 'Gd','Tb','Dy','Ho','Er','Tm','Yb','Lu','Hf', | 64 - 72\n & 'Ta','W ','Re','Os','Ir','Pt','Au','Hg','Tl', | 73 - 81\n & 'Pb','Bi','Po','At','Rn','Fr','Ra','Ac','Th', | 82 - 90\n & 'Pa','U '/ | 91 - 92\n*\n data damass / | atomic mass\n & 1.008, 4.003, 6.940, 9.010, 10.81, 12.01, 14.01, 16.00, 19.00, | 1 - 9\n & 20.18, 22.99, 24.31, 26.98, 28.08, 30.97, 32.06, 35.45, 39.95, | 10 - 18\n & 39.10, 40.08, 44.96, 47.90, 50.94, 52.00, 54.94, 55.85, 58.93, | 19 - 27\n & 58.70, 63.54, 65.37, 69.72, 72.59, 74.92, 78.96, 79.90, 83.80, | 28 - 36\n & 85.47, 87.62, 88.91, 91.22, 92.91, 95.94, 98.91, 101.0, 102.9, | 37 - 45\n & 106.4, 107.9, 112.4, 114.8, 118.7, 121.8, 127.6, 126.9, 131.3, | 46 - 54\n & 132.9, 137.3, 138.9, 140.1, 140.9, 144.2, 146.0, 150.4, 152.0, | 55 - 63\n & 157.3, 158.9, 162.5, 164.9, 167.3, 168.9, 170.0, 175.0, 178.5, | 64 - 72\n & 180.9, 183.9, 186.0, 190.0, 192.2, 195.1, 197.0, 200.6, 204.4, | 73 - 81\n & 207.2, 209.0, 210.0, 210.0, 222.0, 223.0, 226.0, 227.0, 232.0, | 82 - 90\n & 230.4, 238.0 / | 91 - 92\n*\n* Solar abundances ref: Grevesse Sauval 1998, Space Science Rev, in press\n data sunabund_1998 /\nCCCC before 19/01-2004 changed to agree with Asplund 2003, and Uppsala MARCS version and GRID\nCCCC & 12.00, 10.93, 1.10, 1.40, 2.55, 8.52, 7.92, 8.83, 4.56, | 1 - 9\nCCCC & 8.08, 6.33, 7.58, 6.47, 7.55, 5.45, 7.33, 5.50, 6.40, | 10 - 18\nCCCC\nCCCC\nCCCC\nCCCC & 1.69, 0.94, 1.77, 1.66, 2.00, 1.00, 2.24, 1.51, 2.17, | 46 - 54\nCCCC\nCCCC & 1.12, -0.10, 1.14, 0.26, 0.93, 0.00, 1.08, 0.06, 0.88, | 64 - 72\nCCCC & -0.13, 1.11, 0.28, 1.45, 1.35, 1.80, 1.01, 1.13, 0.90, | 73 - 81\nCCCC\nCCCC & -99.0, -0.47 / | 91 - 92\n & 12.00, 10.93, 1.10, 1.40, 2.79, 8.41, 7.80, 8.66, 4.48, | 1 - 9\n & 8.08, 6.33, 7.58, 6.47, 7.55, 5.45, 7.33, 5.28, 6.40, | 10 - 18\n & 5.12, 6.36, 3.17, 5.02, 4.00, 5.67, 5.39, 7.50, 4.92, | 19 - 27\n & 6.25, 4.21, 4.60, 2.88, 3.41, 2.37, 3.41, 2.63, 3.31, | 28 - 36\n & 2.60, 2.97, 2.24, 2.60, 1.42, 1.92, -99.0, 1.84, 1.12, | 37 - 45\n & 1.69, 1.24, 1.77, 0.82, 2.00, 1.00, 2.24, 1.51, 2.17, | 46 - 54\n & 1.13, 2.13, 1.17, 1.58, 0.71, 1.50, -99.0, 1.01, 0.51, | 55 - 63\n & 1.12, 0.35, 1.14, 0.51, 0.93, 0.15, 1.08, 0.06, 0.88, | 64 - 72\n & -0.13, 0.69, 0.28, 1.45, 1.35, 1.80, 0.85, 1.13, 0.83, | 73 - 81\n & 1.95, 0.71, -99.0, -99.0, -99.0, -99.0, -99.0, -99.0, 0.09, | 82 - 90\n & -99.0, -0.50 / | 91 - 92\n*\n data sunabund_2007 /\n & 12.00, 10.93, 1.05, 1.38, 2.70, 8.39, 7.78, 8.66, 4.56, | 1 - 9\n & 7.84, 6.17, 7.53, 6.37, 7.51, 5.36, 7.14, 5.50, 6.18, | 10 - 18\n & 5.08, 6.31, 3.17, 4.90, 4.00, 5.64, 5.39, 7.45, 4.92, | 19 - 27\n & 6.23, 4.21, 4.60, 2.88, 3.58, 2.29, 3.33, 2.56, 3.25, | 28 - 36\n & 2.60, 2.92, 2.21, 2.58, 1.42, 1.92, -99.0, 1.84, 1.12, | 37 - 45\n & 1.66, 0.94, 1.77, 1.60, 2.00, 1.00, 2.19, 1.51, 2.24, | 46 - 54\n & 1.07, 2.17, 1.13, 1.70, 0.58, 1.45, -99.0, 1.00, 0.52, | 55 - 63\n & 1.11, 0.28, 1.14, 0.51, 0.93, 0.00, 1.08, 0.06, 0.88, | 64 - 72\n & -0.17, 1.11, 0.23, 1.25, 1.38, 1.64, 1.01, 1.13, 0.90, | 73 - 81\n & 2.00, 0.65, -99.0, -99.0, -99.0, -99.0, -99.0, -99.0, 0.06, | 82 - 90\n & -99.0, -0.52 / | 91 - 92\n*\n*\n* Fractional r-process abundance for Ga-Bi (r+s simply assumed == 100%) | Date 2000-01-18\n* (Note: Ga-Sr (31-38) was just copied from Kaeppeler et al. 1989, below)\n* s-process from Stellar models: Arlandini C., Kaeppeler F., Wisshak K.,\n* Gallino R., Busso M., Straniero O., 1999, Astrophys J. 525, 886-900\n* Fractions corrected to the revised meteoritic abundances\n* of Grevesse N., Sauval A.J. 1998, Space Science Review 85, 161-174\n data rfract /\n* & H - F | 1 - 9\n* & Ne - Ar | 10 - 18\n* & K - Co | 19 - 27\n & .43, .47, .81, .85, .39, .47, | 28 - 36\n & .41, .11, .08, .17, .15, .50,-.99, .68, .86, | 37 - 45\n & .54, .80, .48, .65, .35, .75, .83, .80, .80, | 46 - 54\n & .85, .19, .38, .23, .51, .44,-.99, .71, .93, | 55 - 63\n & .85, .93, .85, .92, .83, .87, .67, .80, .44, | 64 - 72\n & .59, .44, .91, .91, .99, .95, .94, .41, .24, | 73 - 81\n & .54, .95,-.99,-.99,-.99,-.99,-.99,-.99, 1.0, | 82 - 90\n & -.99, 1.0 / | 91 - 92\n\nc* fractional r-process abundance for Cu-U (r+s simply assumed == 100%)\nc* r-process from Kaeppeler F., Beer H., Wisshak K. 1989, Reports on\nc* Progress in Physics 52, 945. Fraction found by division by the\nc* total meteoritic abundances given by Anders Grevesse 1989, Geochim.\nc* Cosmochim. Acta 53, 197. Th+U guess 1.0\nc* (Perhaps some more data in Beer et al 1997, ApJ 474,843)\nc* (Sneden et al 1998 ApJ 496,235: Sm 76%, Eu 97%)\nc data rfract /\nc* & H - F | 1 - 9\nc* & Ne - Ar | 10 - 18\nc* & K - Co | 19 - 27\nc & .21, .35, .43, .47, .81, .85, .39, .47, | 28 - 36\nc & .41, .11, .28, .18, .16, .25,-.99, .50, .83, | 37 - 45\nc & .56, .88, .57, .64, .36, .99, .82, .93, .84, | 46 - 54\nc & .85, .12, .25, .23, .56, .51,-.99, .68, .93, | 55 - 63\nc & .81, .91, .90, .92, .84, .84, .65, .83, .53, | 64 - 72\nc & .35, .46, .90, .96, .98, .96, .92, .42, .28, | 73 - 81\nc & .20, .64,-.99,-.99,-.99,-.99,-.99,-.99, 1.0, | 82 - 90\nc & -.99, 1.0 / | 91 - 92\n*\n*\n*\ncc* Solar abundances ref: Grevesse Noels Sauval 1996 ASP Conf 99, 117:\ncc data sunabund /\ncc & 12.00, 10.93, 1.16, 1.15, 2.60, 8.55, 7.97, 8.87, 4.56, | 1 - 9\ncc & 8.08, 6.33, 7.58, 6.47, 7.55, 5.45, 7.33, 5.50, 6.52, | 10 - 18\ncc & 5.12, 6.36, 3.17, 5.02, 4.00, 5.67, 5.39, 7.50, 4.92, | 19 - 27\ncc & 6.25, 4.21, 4.60, 2.88, 3.41, 2.37, 3.38, 2.63, 3.23, | 28 - 36\ncc & 2.60, 2.97, 2.24, 2.60, 1.42, 1.92, -29.0, 1.84, 1.12, | 37 - 45\ncc & 1.69, 0.94, 1.77, 1.66, 2.00, 1.00, 2.24, 1.51, 2.23, | 46 - 54\ncc & 1.13, 2.13, 1.17, 1.58, 0.71, 1.50, -29.0, 1.01, 0.51, | 55 - 63\ncc & 1.12, -0.10, 1.14, 0.26, 0.93, 0.00, 1.08, 0.76, 0.88, | 64 - 72\ncc & -0.13, 1.11, 0.28, 1.45, 1.35, 1.80, 1.01, 1.17, 0.90, | 73 - 81\ncc & 1.95, 0.71, -29.0, -29.0, -29.0, -29.0, -29.0, -29.0, 0.09, | 82 - 90\ncc & -29.0, -0.47 / | 91 - 92\ncc*\ncc* fractional r-process abundance for Cu-U (r+s assumed == 100%)\ncc* r-process from Kaeppeler F., Beer H., Wisshak K. 1989, Reports on\ncc* Progress in Physics 52, 945. Fraction found by division by the\ncc* total meteoritic abundances given by Anders Grevesse 1989, Geochim.\ncc* Cosmochim. Acta 53, 197 (Xe=1.34 Dy=1.08 Lu=1.69 !) Th+U guess 1.0\ncc* Isotopic fractions from nuclide chart U.S. Dept of Energy 1988\ncc* Ba r-process=1.46 from McWilliam et al. 1998, AJ 115, 1640\ncc* (Perhaps some more data in Beer et al 1997, ApJ 474,843)\ncc data rfract /\ncc* & H - F | 1- 9\ncc* & Ne - Ar | 10-18\ncc* & K - Co | 19-27\ncc & .21, .25, .43, .50, .81, .78, .39, .59, | 28-36\ncc & .41, .11, .28, .18, .16, .34,-.99, .55, .83, | 37-45\ncc & .73, .88, .54, .64, .37, .50, .75, .93, .50, | 46-54\ncc & .85, .21, .25, .11, .56, .61,-.99, .85, .93, | 55-63\ncc & .82, .91, .50, .92, .84, .84, .59, .50, .53, | 64-72\ncc & .35, .46, .90, .96, .98, .90, .92, .67, .28, | 73-81\ncc & .20, .64,-.99,-.99,-.99,-.99,-.99,-.99, 1.0, | 82-90\ncc & -.99, 1.0 / | 91-92\n*\ncc print *,'Overall metallicity? (-1.0 = Solar/10)'\ncc read(*,*) overall\ncc print *,'Helium abundance? (0.0 = Solar)'\ncc read(*,*) helium\ncc print *,'Alpha element scaling [alpha/Fe]? (+0.3 = Solar*2)'\ncc read(*,*) alpha\ncc print *,'r-element abundance [r/Fe]? (0.0 = Solar)'\ncc read(*,*) rabund\ncc print *,'s-element abundance [s/Fe]? (0.0 = Solar)'\ncc read(*,*) sabund\n*\n* chose set of abundances\n abund_2007=.true.\n if (abund_2007) then\n do iel=1,natom\n sunabund(iel)=sunabund_2007(iel)\n enddo\n else\n do iel=1,natom\n sunabund(iel)=sunabund_1998(iel)\n enddo\n endif\n*\n do iel=1,92\n aname(iel)=daname(iel)\n* mass of the default isotopic mix\n* This is superseded by the getisotopmass.f routine below.\n* BPz 18/06-2012\n amass(iel,0)=damass(iel)\n enddo\n abund(1)=sunabund(1)\n abund(2)=sunabund(2)\n* overall metallicity\n do iel=3,natom\n if(sunabund(iel).gt.-29.0) then\n abund(iel)=sunabund(iel)+overall\n else\n abund(iel)=-29.0\n endif\n enddo\n*\n if(alpha.ne.0.0) then\n* alpha element abundance [alpha/Fe]\n do ialpha=1,nelalpha\n abund(ielalpha(ialpha))=abund(ielalpha(ialpha))+alpha\n enddo\n endif\n*\n* helium deficient?\n if(helium.ne.0.0) then\n abund(2)=abund(2)+helium\n endif\n*\n* r-element or s-element anomaly?\n if(rabund.ne.0.0 .or. sabund.ne.0.0) then\n print*,aname(33),sunabund(33),abund(33),rfract(33)\n do iel=31,92 \ncc do iel=29,92\n if(sunabund(iel).gt.-29.0) then\n abundr=10.**rabund*rfract(iel)*10.**abund(iel)\n abunds=10.**sabund*(1.-rfract(iel))*10.**abund(iel)\n if(iel.eq.33) print*,rabund,sabund,abundr,abunds,abund(iel),iel\n abund(iel)=alog10(abundr+abunds)\n endif\n enddo\n endif\n*\n* If applicable, overrides any prescription by specific input value\n do iel=1,92\ncc abund(iel)=max(abund(iel),fixabund(iel))\n if (fixabund(iel).gt.-98.) then\n abund(iel)=fixabund(iel)\n endif\n enddo\n*\n* normalize to H=12.00\n hfactor=12.00-abund(1)\n if(hfactor.ne.0.0) then\n do iel=1,natom\n abund(iel)=abund(iel)+hfactor\n enddo\n endif\n*\n* isotopic ratios\n do i=1,250\n do j=1,92\n isotopfrac(j,i)=0.0\n enddo\n enddo\n do j=1,92\n isotopfrac(j,0)=1.0\n enddo\n*\n isotopfrac(1,1)=0.999966\n isotopfrac(1,2)=0.000034\n isotopfrac(2,3)=0.000142\n isotopfrac(2,4)=0.999858\n isotopfrac(3,6)=0.075\n isotopfrac(3,7)=0.925\n isotopfrac(4,9)=1.0\n isotopfrac(5,10)=0.199\n isotopfrac(5,11)=0.801\n isotopfrac(6,12)=0.9890\n isotopfrac(6,13)=0.0110\n isotopfrac(7,14)=0.99634\n isotopfrac(7,15)=0.00366\n isotopfrac(8,16)=0.99762\n isotopfrac(8,17)=0.00038\n isotopfrac(8,18)=0.00200\n isotopfrac(9,19)=1.00\n isotopfrac(10,20)=0.9299\n isotopfrac(10,21)=0.00226\n isotopfrac(10,22)=0.0679\n isotopfrac(11,23)=1.00\n isotopfrac(12,24)=0.7899\n isotopfrac(12,25)=0.1000\n isotopfrac(12,26)=0.1101\n isotopfrac(13,27)=1.00\n isotopfrac(14,28)=0.9223\n isotopfrac(14,29)=0.0467\n isotopfrac(14,30)=0.0310\n isotopfrac(15,31)=1.00\n isotopfrac(16,32)=0.9502\n isotopfrac(16,33)=0.0075\n isotopfrac(16,34)=0.0421\n isotopfrac(16,36)=0.0002\n isotopfrac(17,35)=0.7577\n isotopfrac(17,37)=0.2423\n isotopfrac(18,36)=0.842\n isotopfrac(18,38)=0.158\n isotopfrac(19,39)=0.932581\n isotopfrac(19,40)=0.0001167\n isotopfrac(19,41)=0.067302\n isotopfrac(20,40)=0.96941\n isotopfrac(20,42)=0.00647\n isotopfrac(20,43)=0.00135\n isotopfrac(20,44)=0.02086\n isotopfrac(20,46)=0.00004\n isotopfrac(20,48)=0.00187\n isotopfrac(21,45)=1.00\n isotopfrac(22,46)=0.080\n isotopfrac(22,47)=0.073\n isotopfrac(22,48)=0.738\n isotopfrac(22,49)=0.055\n isotopfrac(22,50)=0.054\n isotopfrac(23,50)=0.00250\n isotopfrac(23,51)=0.99750\n isotopfrac(24,50)=0.04345\n isotopfrac(24,52)=0.83789\n isotopfrac(24,53)=0.09501\n isotopfrac(24,54)=0.02365\n isotopfrac(25,55)=1.00\n isotopfrac(26,54)=0.058\n isotopfrac(26,56)=0.9172\n isotopfrac(26,57)=0.022\n isotopfrac(26,58)=0.0028\n isotopfrac(27,59)=1.00\n isotopfrac(28,58)=0.6827\n isotopfrac(28,60)=0.2610\n isotopfrac(28,61)=0.0113\n isotopfrac(28,62)=0.0359\n isotopfrac(28,64)=0.0091\n isotopfrac(29,63)=0.6917\n isotopfrac(29,65)=0.3083\n isotopfrac(30,64)=0.4863\n isotopfrac(30,66)=0.2790\n isotopfrac(30,67)=0.0410\n isotopfrac(30,68)=0.1875\n isotopfrac(30,70)=0.0062\n isotopfrac(31,69)=0.60108\n isotopfrac(31,71)=0.39892\n isotopfrac(32,70)=0.205\n isotopfrac(32,72)=0.274\n isotopfrac(32,73)=0.078\n isotopfrac(32,74)=0.365\n isotopfrac(32,76)=0.078\n isotopfrac(33,75)=1.00\n isotopfrac(34,74)=0.0088\n isotopfrac(34,76)=0.090\n isotopfrac(34,77)=0.076\n isotopfrac(34,78)=0.236\n isotopfrac(34,80)=0.497\n isotopfrac(34,82)=0.092\n isotopfrac(35,79)=0.5069\n isotopfrac(35,81)=0.4931\n isotopfrac(36,78)=0.00339\n isotopfrac(36,80)=0.0222\n isotopfrac(36,82)=0.1145\n isotopfrac(36,83)=0.1147\n isotopfrac(36,84)=0.5711\n isotopfrac(36,86)=0.1742\n isotopfrac(37,85)=0.72165\n isotopfrac(37,87)=0.27835\n isotopfrac(38,84)=0.0056\n isotopfrac(38,86)=0.0986\n isotopfrac(38,87)=0.0700\n isotopfrac(38,88)=0.8258\n isotopfrac(39,89)=1.00\n isotopfrac(40,90)=0.5145\n isotopfrac(40,91)=0.1122\n isotopfrac(40,92)=0.1715\n isotopfrac(40,94)=0.1738\n isotopfrac(40,96)=0.0280\n isotopfrac(41,93)=1.00\n isotopfrac(42,92)=0.1484\n isotopfrac(42,94)=0.0925\n isotopfrac(42,95)=0.1592\n isotopfrac(42,96)=0.1668\n isotopfrac(42,97)=0.0955\n isotopfrac(42,98)=0.2413\n isotopfrac(42,100)=0.0963\n isotopfrac(44,96)=0.0552\n isotopfrac(44,98)=0.0188\n isotopfrac(44,99)=0.127\n isotopfrac(44,100)=0.126\n isotopfrac(44,101)=0.170\n isotopfrac(44,102)=0.316\n isotopfrac(44,104)=0.187\n isotopfrac(45,103)=1.00\n isotopfrac(46,102)=0.01020\n isotopfrac(46,104)=0.1114\n isotopfrac(46,105)=0.2233\n isotopfrac(46,106)=0.2733\n isotopfrac(46,108)=0.2646\n isotopfrac(46,110)=0.1172\n isotopfrac(47,107)=0.51839\n isotopfrac(47,109)=0.48161\n isotopfrac(48,106)=0.0125\n isotopfrac(48,108)=0.0089\n isotopfrac(48,110)=0.1249\n isotopfrac(48,111)=0.1280\n isotopfrac(48,112)=0.2413\n isotopfrac(48,113)=0.1222\n isotopfrac(48,114)=0.2873\n isotopfrac(48,116)=0.0749\n isotopfrac(49,113)=0.043\n isotopfrac(49,115)=0.957\n isotopfrac(50,112)=0.00973\n isotopfrac(50,114)=0.00659\n isotopfrac(50,115)=0.00339\n isotopfrac(50,116)=0.14538\n isotopfrac(50,117)=0.07672\n isotopfrac(50,118)=0.24217\n isotopfrac(50,119)=0.08587\n isotopfrac(50,120)=0.32596\n isotopfrac(50,122)=0.04632\n isotopfrac(50,124)=0.05787\n isotopfrac(51,121)=0.57362\n isotopfrac(51,123)=0.42638\n isotopfrac(52,120)=0.0009\n isotopfrac(52,122)=0.0257\n isotopfrac(52,123)=0.0089\n isotopfrac(52,124)=0.0476\n isotopfrac(52,125)=0.0710\n isotopfrac(52,126)=0.1889\n isotopfrac(52,128)=0.3173\n isotopfrac(52,130)=0.3397\n isotopfrac(53,127)=1.00\n isotopfrac(54,124)=0.00121\n isotopfrac(54,126)=0.00108\n isotopfrac(54,128)=0.0219\n isotopfrac(54,129)=0.2734\n isotopfrac(54,130)=0.0435\n isotopfrac(54,131)=0.2169\n isotopfrac(54,132)=0.2650\n isotopfrac(54,134)=0.0976\n isotopfrac(54,136)=0.0794\n isotopfrac(55,133)=1.00\n isotopfrac(56,130)=0.00106\n isotopfrac(56,132)=0.00101\n isotopfrac(56,134)=0.02417\n isotopfrac(56,135)=0.06592\n isotopfrac(56,136)=0.07854\n isotopfrac(56,137)=0.1123\n isotopfrac(56,138)=0.7170\n isotopfrac(57,138)=0.00089\n isotopfrac(57,139)=0.99911\n isotopfrac(58,136)=0.0019\n isotopfrac(58,138)=0.0025\n isotopfrac(58,140)=0.8848\n isotopfrac(58,142)=0.1108\n isotopfrac(59,141)=1.00\n isotopfrac(60,142)=0.2713\n isotopfrac(60,143)=0.1218\n isotopfrac(60,144)=0.2380\n isotopfrac(60,145)=0.0830\n isotopfrac(60,146)=0.1719\n isotopfrac(60,148)=0.0576\n isotopfrac(60,150)=0.0564\n isotopfrac(62,144)=0.031\n isotopfrac(62,147)=0.150\n isotopfrac(62,148)=0.113\n isotopfrac(62,149)=0.138\n isotopfrac(62,150)=0.074\n isotopfrac(62,152)=0.267\n isotopfrac(62,154)=0.227\n isotopfrac(63,151)=0.478\n isotopfrac(63,153)=0.522\n isotopfrac(64,152)=0.0020\n isotopfrac(64,154)=0.0218\n isotopfrac(64,155)=0.1480\n isotopfrac(64,156)=0.2047\n isotopfrac(64,157)=0.1565\n isotopfrac(64,158)=0.2484\n isotopfrac(64,160)=0.2186\n isotopfrac(65,159)=1.00\n isotopfrac(66,156)=0.00056\n isotopfrac(66,158)=0.00096\n isotopfrac(66,160)=0.0234\n isotopfrac(66,161)=0.1891\n isotopfrac(66,162)=0.2551\n isotopfrac(66,163)=0.2490\n isotopfrac(66,164)=0.2819\n isotopfrac(67,165)=1.00\n isotopfrac(68,162)=0.0014\n isotopfrac(68,164)=0.0161\n isotopfrac(68,166)=0.336\n isotopfrac(68,167)=0.2295\n isotopfrac(68,168)=0.268\n isotopfrac(68,170)=0.149\n isotopfrac(69,169)=1.00\n isotopfrac(70,168)=0.0013\n isotopfrac(70,170)=0.0305\n isotopfrac(70,171)=0.143\n isotopfrac(70,172)=0.219\n isotopfrac(70,173)=0.1612\n isotopfrac(70,174)=0.318\n isotopfrac(70,176)=0.127\n isotopfrac(71,175)=0.9741\n isotopfrac(71,176)=0.0259\n isotopfrac(72,174)=0.00162\n isotopfrac(72,176)=0.05206\n isotopfrac(72,177)=0.18606\n isotopfrac(72,178)=0.27297\n isotopfrac(72,179)=0.13629\n isotopfrac(72,180)=0.35100\n isotopfrac(73,180)=0.00012\n isotopfrac(73,181)=0.99988\n isotopfrac(74,180)=0.0013\n isotopfrac(74,182)=0.263\n isotopfrac(74,183)=0.143\n isotopfrac(74,184)=0.3067\n isotopfrac(74,186)=0.286\n isotopfrac(75,185)=0.3740\n isotopfrac(75,187)=0.6260\n isotopfrac(76,184)=0.00018\n isotopfrac(76,186)=0.0158\n isotopfrac(76,187)=0.016\n isotopfrac(76,188)=0.133\n isotopfrac(76,189)=0.161\n isotopfrac(76,190)=0.264\n isotopfrac(76,192)=0.410\n isotopfrac(77,191)=0.373\n isotopfrac(77,193)=0.627\n isotopfrac(78,190)=0.000127\n isotopfrac(78,192)=0.0078\n isotopfrac(78,194)=0.329\n isotopfrac(78,195)=0.338\n isotopfrac(78,196)=0.252\n isotopfrac(78,198)=0.0719\n isotopfrac(79,197)=1.00\n isotopfrac(80,196)=0.001534\n isotopfrac(80,198)=0.09968\n isotopfrac(80,199)=0.16873\n isotopfrac(80,200)=0.23096\n isotopfrac(80,201)=0.13181\n isotopfrac(80,202)=0.29863\n isotopfrac(80,204)=0.06865\n isotopfrac(81,203)=0.29524\n isotopfrac(81,205)=0.70476\n isotopfrac(82,204)=0.0194\n isotopfrac(82,206)=0.1912\n isotopfrac(82,207)=0.2062\n isotopfrac(82,208)=0.5831\n isotopfrac(83,209)=1.00\n isotopfrac(90,232)=1.00\n isotopfrac(92,235)=0.007200\n isotopfrac(92,238)=0.992745\n\n* get the mass of each isotope\n* and recompute the default mix mass\n* BPz 12/06-2012\n call getisotopmass(amass)\n do i=1,92\n tempmass=amass(i,0)\n amass(i,0)=0.\n do j=1,250\n amass(i,0)=amass(i,0)+isotopfrac(i,j)*amass(i,j)\n enddo\n if (amass(i,0).eq.0.) then\n amass(i,0)=tempmass\n endif\n enddo\n\n* print*,' Atomic masses are masses of the default terrestrial',\n* & ' isotopic mixture. Cf makeabund.f.'\n*\n*\n* print out\n\nc open(90,file='abundances.tmp',status='unknown',form='formatted')\nc write(90,1020) overall,alpha,helium,rabund,sabund\nc 1020 format('* STD? [Fe/H] [He/Fe] [alpha/Fe] [r/Fe] [s/Fe]',/,\nc & ' 1 ', 6f8.2)\nc write(90,1000) (aname(iel),iel= 1,10)\nc write(90,1010) (abund(iel),iel= 1,10)\nc write(90,1000) (aname(iel),iel=11,20)\nc write(90,1010) (abund(iel),iel=11,20)\nc write(90,1000) (aname(iel),iel=21,30)\nc write(90,1010) (abund(iel),iel=21,30)\nc write(90,1000) (aname(iel),iel=31,40)\nc write(90,1010) (abund(iel),iel=31,40)\nc write(90,1000) (aname(iel),iel=41,50)\nc write(90,1010) (abund(iel),iel=41,50)\nc write(90,1000) (aname(iel),iel=51,60)\nc write(90,1010) (abund(iel),iel=51,60)\nc write(90,1000) (aname(iel),iel=61,70)\nc write(90,1010) (abund(iel),iel=61,70)\nc write(90,1000) (aname(iel),iel=71,80)\nc write(90,1010) (abund(iel),iel=71,80)\nc write(90,1000) (aname(iel),iel=81,90)\nc write(90,1010) (abund(iel),iel=81,90)\nc write(90,1000) (aname(iel),iel=91,92)\nc write(90,1010) (abund(iel),iel=91,92)\nc 1000 format('* ',10(3x,a2,2x))\nc 1010 format(2x,10f7.2)\nc*\nc print *,'makeabund; check Output in file abundances.tmp'\n return\n end\n", "meta": {"hexsha": "cf7a240e5b73ba59c73c2aad0c7f36ead94236bd", "size": 25100, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/turbospec/EXPORT-15.1/source-v15.1/makeabund.f", "max_stars_repo_name": "dnidever/apogee", "max_stars_repo_head_hexsha": "83ad7496a0b4193df9e2c01b06dc36cb879ea6c1", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 5, "max_stars_repo_stars_event_min_datetime": "2019-04-11T13:35:24.000Z", "max_stars_repo_stars_event_max_datetime": "2019-11-14T06:12:51.000Z", "max_issues_repo_path": "src/turbospec/EXPORT-15.1/source-v15.1/makeabund.f", "max_issues_repo_name": "dnidever/apogee", "max_issues_repo_head_hexsha": "83ad7496a0b4193df9e2c01b06dc36cb879ea6c1", "max_issues_repo_licenses": ["BSD-3-Clause"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/turbospec/EXPORT-15.1/source-v15.1/makeabund.f", "max_forks_repo_name": "dnidever/apogee", "max_forks_repo_head_hexsha": "83ad7496a0b4193df9e2c01b06dc36cb879ea6c1", "max_forks_repo_licenses": ["BSD-3-Clause"], "max_forks_count": 5, "max_forks_repo_forks_event_min_datetime": "2018-09-20T22:07:43.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-15T07:13:38.000Z", "avg_line_length": 40.3536977492, "max_line_length": 93, "alphanum_fraction": 0.5204780876, "num_tokens": 11066, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5544704502361149, "lm_q2_score": 0.1778108672995868, "lm_q1q2_score": 0.09859087164847596}}
{"text": "**==nquil.spg processed by SPAG 4.50J at 14:50 on 30 Jun 1995\n SUBROUTINE NQUIL(T,N,Dene,Jcont,Iphot,Idens,Icx)\n IMPLICIT NONE\nC*** Start of declarations inserted by SPAG\n REAL abhe , ABUnd , ABUnj , ALFLO , ALPHADI , apple , AUTOIN , b , \n & be , beta , BINmin , BINsyz , C1 , C2 , c5 , c6 , CA , cd1 , \n & cd2 , chi\n REAL CION , CONce , CTH , CTHEI , CTHER , CTHI , CTHR , dd , dei , \n & Dene , denh , DIMET , DNE , E , E3 , EA , EFFN , EFFNEW , \n & ei , eion\n REAL em , emet , emetj , F , fmet , fplus , GND , GREC , HENeut , \n & HEPlus , orange , over , P , PCOol , PHOT , plum , PM , \n & POPMET , POT , POU\n REAL POWer , prod , qm , rat , RE , recn , rgnd , rho , RHY , S2 , \n & S3 , S4 , S5 , SEATON , sec , st , starn , sum , T , t6\n REAL TU , WAVe , worl , zeff , zf\n INTEGER i , Icx , Idens , imet , imeta , Iphot , ix , iy , j , \n & Jcont , jlow , jmax , jp , jtop , jump , k , kmax , ktop , \n & l , lion\n INTEGER LL , ln , N , NBIn , NJ , nn , nqm , nval\nC*** End of declarations inserted by SPAG\nC ************************ METASTABLE POPULATION DATA\n \n DIMENSION emetj(30,4) , cd1(28) , cd2(28)\n DIMENSION rat(30) , prod(30) , c5(30) , c6(30) , over(30) , \n & imeta(30)\n DIMENSION sec(30)\n \n COMMON /DAT / E(30) , EA(30) , S2(30) , WAVe(220) , E3(220) , \n & F(220) , LL(30) , S3(30) , S4(30) , S5(30)\n COMMON /PARAMS/ NJ(12) , ABUnj(12) , ABUnd , BINmin , BINsyz , \n & NBIn\n COMMON /RATES / C1(30) , C2(30) , CTH\n COMMON /RESULT/ CONce(30) , CA(30) , POWer(220) , RHY , HENeut , \n & HEPlus , DNE , PCOol , POU , POT , RE , TU , PM(4)\n \n DATA emetj/5*0. , 6.5 , 8.35 , 10.2 , 0. , 14. , 0. , 17.6 , 0. , \n & 21.6 , 0. , 25.3 , 0. , 29.0 , 0. , 32.7 , 5*0. , 47.0 , 0. , \n & 51.8 , 0. , 0. , 5*0. , 5.34 , 7.10 , 8.87 , 0. , 12.5 , 0. , \n & 16.0 , 0. , 19.8 , 0. , 24.0 , 0. , 28.6 , 0. , 34.2 , 5*0. , \n & 57.1 , 0. , 64.8 , 0. , 0. , 5*0. , 4.18 , 5.78 , 7.48 , 0. , \n & 11.0 , 0. , 14.7 , 0. , 18.6 , 0. , 23.0 , 0. , 28.0 , 0. , \n & 33.9 , 5*0. , 60.4 , 0. , 69.2 , 0. , 0. , 11*0. , 2.72 , \n & 0. , 6.55 , 0. , 10.4 , 0. , 14.2 , 0. , 18.1 , 5*0. , 29.7 , \n & 0. , 38.9 , 2*0./\nC\n DATA imeta/0 , 0 , 0 , 1 , 2 , 3 , 5*0 , 4 , 18*0/\n DATA cd1/.0024 , -.0005 , .00 , .061 , .027 , .011 , .005 , .005 , \n & 0. , .0107 , .09 , .13 , .11 , .081 , .075 , .066 , .051 , \n & 11*0./\n DATA cd2/0. , .01485 , .300 , .108 , .107 , .024 , .075 , .051 , \n & .054 , .0167 , .36 , 17*0./\n DATA sec/4*1. , .9 , .9 , 6*1. , .6 , .5 , 1. , .7 , .9 , 13*1./\n\n fmet=0\n nval=0\n ix = 0\n abhe = 10.**(ABUnj(1)-12.)\n DO 100 i = 1 , 4\n PM(i) = 0.\n 100 CONTINUE\n orange = 1.\n c5(1) = 0.\n c5(N+1) = 0.\n jlow = 1\n jmax = N + 1\n jtop = N + 1\n c6(1) = 0\n t6 = T*1.0E-6\n st = SQRT(T)\n DO 200 j = 1 , N\nC IONIZATION RATE FROM YOUNGER\n eion = E(j)\n C1(j) = CION(N,j,eion,T)\n IF ( N-j.GT.1 ) THEN\nC IONIZATION FROM METASTABLE LEVEL : BE,B,C,MG SEQUENCES\n IF ( Idens.NE.0 ) THEN\n imet = imeta(N-j+1)\n IF ( imet.NE.0 ) THEN\n emet = emetj(N,imet)\n fmet = POPMET(N,imet,emet,Dene,T)\n PM(imet) = fmet\n em = E(j) - emet\n C1(j) = C1(j)*(1.-fmet) + fmet*CION(N,j,em,T)\n ENDIF\n ENDIF\nC INNERSHELL IONIZATION\n IF ( N-j.GT.1 ) THEN\n eion = EA(j)\n jp = N - 1\n IF ( N-j.GE.10 ) jp = N - 9\n C1(j) = C1(j) + CION(N,jp,eion,T)\n ENDIF\n ENDIF\nC IONIZATION FOLLOWING INNERSHELL EXCITATION : COWAN AND MANN\nC INCREASED FOR FE\n C1(j) = C1(j) + AUTOIN(N,j,T)\nC **************** PHOTOIONIZATION\n IF ( Iphot.NE.0 ) C1(j) = C1(j) + PHOT(N,j,E(j),T,Dene)/Dene\nC **************** RADIATIVE RECOMBINATION\n zeff = j\n beta = zeff*zeff/(6.34*t6)\n C2(j+1) = 2.07E-11*zeff*zeff*(0.4288+0.5*ALOG(beta)\n & +0.469*(beta**(-1./3.)))/SQRT(T)\n apple = C2(j+1)\n plum = 0\n recn = 0.\n rgnd = 0.\n IF ( N.NE.j ) THEN\n nval = INT(GND(N-j) + 0.1)\n starn = SQRT(13.6/E(j))*zeff\n DO 120 nqm = 1 , nval\n qm = nqm\n be = beta/(qm*qm)\n C2(j+1) = C2(j+1) - 5.197E-14*j*SQRT(be)*SEATON(be,qm)\n 120 CONTINUE\n IF ( C2(j+1).LT.0 ) C2(j+1) = 0\n i = N - j\nC RECOMBINATION TO GROUND STATE\n IF ( i.LE.17 ) rgnd = GREC(N,j,E(j),T)\n IF ( i.GT.1 ) THEN\n IF ( i.LT.4 .OR. i.GT.9 ) THEN\n ei = E(j)\n IF ( i.LT.17 ) THEN\nC RECOMBINATION TO OTHER STATES IN SAME SHELL\n lion = 1\n IF ( i.EQ.12 ) lion = 3\n ei = ei - E3(ix+lion)\n ENDIF\n starn = SQRT(13.595/ei)*zeff\n be = beta/(starn*starn)\n recn = EFFNEW(N-j,T,zeff,N)*SEATON(be,starn)\n & *2.599E-14*j*SQRT(ei*11590./T)/(starn*starn)\n ENDIF\n ENDIF\n ENDIF\n C2(j+1) = C2(j+1) + recn + rgnd\n IF ( beta.GE.0.5 ) THEN\n chi = 0.5*(0.735+ALOG(beta)+1./(3.*beta))\n ELSE\n chi = 1.2*beta + (0.55+1.04*ALOG(beta))*beta*beta + \n & (-0.43+1.01*ALOG(beta))*beta**3\n ENDIF\n DO 150 nqm = 1 , nval\n qm = nqm\n chi = chi - P(beta,qm)\n 150 CONTINUE\n chi = chi + EFFN(N-j,zeff,T)*P(beta,starn)/(2.*starn*starn)\n c6(j+1) = E(j)*1.6027E-12*(C2(j+1)+4.22E-22*SQRT(T/1.037E-11)\n & *chi)\nC DIELECTRONIC RECOMBINATION ***** DENSITY DEPENDENCE AND SECONDARY\nC ***** AUTOIONIZATION\n iy = LL(j)*3\n IF ( j.NE.1 ) THEN\n zeff = j - 1\n rho = (Dene/zeff**7.)**.2\n dd = 1.\n IF ( rho.GE.3 ) dd = 1./(1.+(cd1(N-j+1)+cd2(N-j+1)/zeff)\n & *rho)\n DO 160 l = 1 , iy\n ln = ix + l\n plum = plum + ALPHADI(N,j,l,ln,T)*AMIN1(dd,sec(N-j+1))\n 160 CONTINUE\nC DIELECTRONIC RECOMBINATION FOR METASTABLE LEVELS OF BE,B,C,MG ISO\n imet = imeta(N-j+1)\n IF ( imet.NE.0 ) THEN\n zf = j - 1\n b = SQRT(zf)*(zf+1.)**2.5/SQRT(zf*zf+13.4)\n plum = plum*(1.-fmet)\n plum = plum + fmet*DIMET(N,j,T,b,dd)\n ENDIF\nC *************** ADD DIELECTRONIC RECOMB AND STOREY'S LOW T DIELEC REC\n C2(j) = C2(j) + plum + ALFLO(N,j,T)\n ENDIF\n over(j) = plum/orange\n IF ( j.NE.1 ) c5(j) = plum*E(j-1)*10.**(ABUnd-1.)*1.6027\n ix = ix + iy\n orange = apple\n 200 CONTINUE\n IF ( Icx.NE.0 ) THEN\nC CHARGE TRANSFER CONTRIBUTION\n fplus = RHY/(1.+RHY)\n denh = 1./(.003+fplus+abhe*HEPlus+abhe*2.*(1.-HENeut-HEPlus))\n C1(N+1) = 0.\n C2(1) = 0.\n nn = N + 1\nC ********************************** S. Butler Charge Transfer Rates\n DO 250 j = 1 , N\n C1(j) = C1(j) + CTHI(N,j,T)*denh*fplus + CTHEI(N,j,T,Dene)\n & *HEPlus*abhe\n C2(j+1) = C2(j+1) + CTHR(N,j+1,T)*denh*(1.-fplus)\n & + CTHER(N,j+1,T)*HENeut*abhe\n 250 CONTINUE\n ENDIF\nC AUGER IONIZATION\n IF ( Iphot.EQ.2 ) CALL APHOT(N,Dene,Jcont)\n IF ( Jcont.EQ.1 ) GOTO 700\n DO 300 j = 1 , N\n C2(j+1) = ABS(C2(j+1))\n IF ( C1(j)/C2(j+1).LE.0. ) THEN\n rat(j) = 1.0E+6\n ELSE\n rat(j) = C2(j+1)/C1(j)\n IF ( j.EQ.1 .AND. T.GE.1.0E8 ) rat(j) = AMIN1(rat(j),1.0E4)\n ENDIF\n IF ( rat(j).LT.1.0E-5 ) jlow = j + 1\n IF ( rat(j).GE.1.0E+5 ) THEN\n jmax = j\n GOTO 400\n ENDIF\n 300 CONTINUE\n IF ( jlow.EQ.jmax ) THEN\n sum = 1.0000\n GOTO 500\n ENDIF\n 400 jump = jmax - 1\n prod(jump) = rat(jump)\n ktop = jump - jlow\n sum = 1.00000 + prod(jump)\n IF ( ktop.NE.0 ) THEN\n DO 450 k = 1 , ktop\n prod(jump-k) = rat(jump-k)*prod(jmax-k)\n prod(jump-k) = AMIN1(prod(jump-k),1.0E30)\n sum = sum + prod(jump-k)\n 450 CONTINUE\n ENDIF\n 500 DO 600 j = 1 , jtop\n CONce(j) = 0\n c5(j) = 0.\n 600 CONTINUE\n CONce(jmax) = 1.000/sum\n kmax = jmax - jlow\n IF ( kmax.NE.0 ) THEN\n DO 650 k = 1 , kmax\n CONce(jmax-k) = prod(jmax-k)*CONce(jmax)\n 650 CONTINUE\n ENDIF\n 700 IF ( N.EQ.2 ) DNE = 0.\n worl = 0.\n dei = 0.\n DO 800 j = 1 , jtop\n DNE = (j-1)*CONce(j)*10.**(ABUnd-12.) + DNE\n c6(j) = c6(j)*CONce(j)*10.0**(11.+ABUnd)\n RE = RE + c6(j)\n c5(j) = c5(j)*CONce(j)\n PCOol = PCOol + c5(j)\n PCOol = PCOol + c6(j)\n 800 CONTINUE\n RETURN\n END\n", "meta": {"hexsha": "e64e0a50a6209582202a59b5c04c410a50cbbd18", "size": 9281, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "xspec/tools/raysmith/nquil.f", "max_stars_repo_name": "DougBurke/xspeclmodels", "max_stars_repo_head_hexsha": "4e9caf971af51ab88eb0f8cf678a11f014710013", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "xspec/tools/raysmith/nquil.f", "max_issues_repo_name": "DougBurke/xspeclmodels", "max_issues_repo_head_hexsha": "4e9caf971af51ab88eb0f8cf678a11f014710013", "max_issues_repo_licenses": ["CC0-1.0"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "xspec/tools/raysmith/nquil.f", "max_forks_repo_name": "DougBurke/xspeclmodels", "max_forks_repo_head_hexsha": "4e9caf971af51ab88eb0f8cf678a11f014710013", "max_forks_repo_licenses": ["CC0-1.0"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 36.9760956175, "max_line_length": 73, "alphanum_fraction": 0.4231225084, "num_tokens": 3766, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5156199157230156, "lm_q2_score": 0.18952108675195606, "lm_q1q2_score": 0.0977208467787779}}
{"text": "program test\n ! This is a comment.\n\n ! The decleartion statement must be in the front.\n ! declear test\n integer a ! declear a integer variable named 'a'(default: long integer with 4 byte)\n real b ! declear a real variable named 'b'(default: single real with 4 byte)\n complex c ! declear a complex variable named 'c'(default: single complex with two single real value)\n character d ! declear a character variable named 'd'(default: one character)\n logical e ! declear a logical variable named 'e'(default value is false)\n integer(kind=4) aa ! declear a long integer variable with 4 byte after F90\n integer*2 ab ! declear a short integer variable with 2 byte in F77\n integer(1) ac ! declear a integer variable with 1 byte(shorter than short integer) in F77\n real(kind=8) ba ! declear a double real variable with 8 byte have 15 effective numbers\n complex*8 ca ! declear a double complex variable with two double real value\n character(len=10) da ! declear a string with 10 characters after F90\n character*10 db ! declear a string with 10 characters in F77\n logical :: ea = .true. ! declear a variable with '::' and assign a value after F90\n print *, 'ea=', ea\n\n ! print test (output)\n print *, 'print test!' ! print is a write which set UNIT is '*'(screen)\n\n ! write test (output)\n write (*,*) 'write test!' ! the frist '*' is UNIT(6), and the second '*' is FMT(nothing special)\n write ( UNIT=6, FMT=* ) 'full write test', '!' ! there is no ',' in the book.It will wrong with my compiler.\n\n ! assign test\n print *, 'a =', a\n a = 1\n print *, 'a =', a\n print *, 'b =', b\n b = 3.14159265358979 ! The single real variable only hava 6 effective number after dot. It seems the assign numbers is a single real variable.\n print *, 'b =', b\n print *, 'c =', c\n c = (1.0,0.1)\n print *, 'c =', c\n print *, 'd =', d\n d = \"a\" ! Only \"\"\" can use to assign a character variable in F77\n print *, 'd =', d\n d = 'ab' ! Only the frist character will be assigned.\n print *, 'd =', d\n print *, 'e =', e\n e = .true. ! two dots must in two sides of 'true' or 'false'\n print *, 'e =', e\n\n ! read test (input)\n print *, 'please input a integer'\n read (*,*) a ! read a integer from keyboard\n print *, 'your number =', a\n\n ! stop program (unnecessary)\n stop\n\nend program test\n", "meta": {"hexsha": "cbf2ffc1e9bcd7eba676003b3e94f0c9790a4971", "size": 2383, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "ivity/test/test.f95", "max_stars_repo_name": "hopeful0/fortran-study", "max_stars_repo_head_hexsha": "7bd50580436e747f428cefeda2ba595893867503", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "ivity/test/test.f95", "max_issues_repo_name": "hopeful0/fortran-study", "max_issues_repo_head_hexsha": "7bd50580436e747f428cefeda2ba595893867503", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "ivity/test/test.f95", "max_forks_repo_name": "hopeful0/fortran-study", "max_forks_repo_head_hexsha": "7bd50580436e747f428cefeda2ba595893867503", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 42.5535714286, "max_line_length": 146, "alphanum_fraction": 0.638690726, "num_tokens": 680, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.5, "lm_q2_score": 0.19193278644723683, "lm_q1q2_score": 0.09596639322361841}}
{"text": "Subroutine hijhrd(jp, jt, jout, jflg, iopjt0)\n Parameter (maxstr=150001)\n Dimension ip(100, 2), ipq(50), ipb(50), it(100, 2), itq(50), itb(50)\n Common /hjcrdn/yp(3, 300), yt(3, 300)\n Common /hparnt/hipr1(100), ihpr2(50), hint1(100), ihnt2(50)\n Common /hijdat/hidat0(10, 10), hidat(10)\n Common /hstrng/nfp(300, 15), pp(300, 15), nft(300, 15), pt(300, 15)\n Common /hjjet1/npj(300), kfpj(300, 500), pjpx(300, 500), pjpy(300, 500), pjpz(300, 500), pjpe(300, 500), pjpm(300, 500), ntj(300), kftj(300, 500), pjtx(300, 500), pjty(300, 500), pjtz(300, 500), pjte(300, 500), pjtm(300, 500)\n Common /hjjet2/nsg, njsg(maxstr), iasg(maxstr, 3), k1sg(maxstr, 100), k2sg(maxstr, 100), pxsg(maxstr, 100), pysg(maxstr, 100), pzsg(maxstr, 100), pesg(maxstr, 100), pmsg(maxstr, 100)\n Common /hjjet4/ndr, iadr(maxstr, 2), kfdr(maxstr), pdr(maxstr, 5)\n Common /xydr/rtdr(maxstr, 2)\n Common /rndf77/nseed\n Common /lujets/n, k(9000, 5), p(9000, 5), v(9000, 5)\n Common /ludat1/mstu(200), paru(200), mstj(200), parj(200)\n Common /pysubs/msel, msub(200), kfin(2, -40:40), ckin(200)\n Common /pypars/mstp(200), parp(200), msti(200), pari(200)\n Common /pyint1/mint(400), vint(400)\n Common /pyint2/iset(200), kfpr(200, 2), coef(200, 20), icol(40, 4, 2)\n Common /pyint5/ngen(0:200, 3), xsec(0:200, 3)\n Common /hpint/mint4, mint5, atco(200, 20), atxs(0:200)\n Common /phidcy/iphidcy, pttrig, ntrig, maxmiss, ipi0dcy\n Save\n mxjt = 500\n mxsg = 900\n mxsj = 100\n jflg = 0\n ihnt2(11) = jp\n ihnt2(12) = jt\n iopjet = iopjt0\n If (iopjet==1 .And. (nfp(jp,6)/=0 .Or. nft(jt,6)/=0)) iopjet = 0\n If (jp>ihnt2(1) .Or. jt>ihnt2(3)) Return\n If (nfp(jp,6)<0 .Or. nft(jt,6)<0) Return\n If (jout==0) Then\n epp = pp(jp, 4) + pp(jp, 3)\n epm = pp(jp, 4) - pp(jp, 3)\n etp = pt(jt, 4) + pt(jt, 3)\n etm = pt(jt, 4) - pt(jt, 3)\n If (epp<0.0) Goto 1000\n If (epm<0.0) Goto 1000\n If (etp<0.0) Goto 1000\n If (etm<0.0) Goto 1000\n If (epp/(epm+0.01)<=etp/(etm+0.01)) Return\n End If\n ecut1 = hipr1(1) + hipr1(8) + pp(jp, 14) + pp(jp, 15)\n ecut2 = hipr1(1) + hipr1(8) + pt(jt, 14) + pt(jt, 15)\n If (pp(jp,4)<=ecut1) Then\n nfp(jp, 6) = -abs(nfp(jp,6))\n Return\n End If\n If (pt(jt,4)<=ecut2) Then\n nft(jt, 6) = -abs(nft(jt,6))\n Return\n End If\n miss = 0\n misp = 0\n mist = 0\n If (nfp(jp,10)==0 .And. nft(jt,10)==0) Then\n mint(44) = mint4\n mint(45) = mint5\n xsec(0, 1) = atxs(0)\n xsec(11, 1) = atxs(11)\n xsec(12, 1) = atxs(12)\n xsec(28, 1) = atxs(28)\n Do i = 1, 20\n coef(11, i) = atco(11, i)\n coef(12, i) = atco(12, i)\n coef(28, i) = atco(28, i)\n End Do\n Else\n isub11 = 0\n isub12 = 0\n isub28 = 0\n If (xsec(11,1)/=0) isub11 = 1\n If (xsec(12,1)/=0) isub12 = 1\n If (xsec(28,1)/=0) isub28 = 1\n mint(44) = mint4 - isub11 - isub12 - isub28\n mint(45) = mint5 - isub11 - isub12 - isub28\n xsec(0, 1) = atxs(0) - atxs(11) - atxs(12) - atxs(28)\n xsec(11, 1) = 0.0\n xsec(12, 1) = 0.0\n xsec(28, 1) = 0.0\n Do i = 1, 20\n coef(11, i) = 0.0\n coef(12, i) = 0.0\n coef(28, i) = 0.0\n End Do\n End If\n 155 Call pythia\n jj = mint(31)\n If (jj/=1) Goto 155\n If (k(7,2)==-k(8,2)) Then\n qmass2 = (p(7,4)+p(8,4))**2 - (p(7,1)+p(8,1))**2 - (p(7,2)+p(8,2))**2 - (p(7,3)+p(8,3))**2\n qm = ulmass(k(7,2))\n If (qmass2<(2.0*qm+hipr1(1))**2) Goto 155\n End If\n pxp = pp(jp, 1) - p(3, 1)\n pyp = pp(jp, 2) - p(3, 2)\n pzp = pp(jp, 3) - p(3, 3)\n pep = pp(jp, 4) - p(3, 4)\n pxt = pt(jt, 1) - p(4, 1)\n pyt = pt(jt, 2) - p(4, 2)\n pzt = pt(jt, 3) - p(4, 3)\n pet = pt(jt, 4) - p(4, 4)\n If (pep<=ecut1) Then\n misp = misp + 1\n If (misp<50) Goto 155\n nfp(jp, 6) = -abs(nfp(jp,6))\n Return\n End If\n If (pet<=ecut2) Then\n mist = mist + 1\n If (mist<50) Goto 155\n nft(jt, 6) = -abs(nft(jt,6))\n Return\n End If\n wp = pep + pzp + pet + pzt\n wm = pep - pzp + pet - pzt\n If (wp<0.0 .Or. wm<0.0) Then\n miss = miss + 1\n If (pttrig>0) Then\n If (miss<maxmiss) Then\n Write (6, *) 'Failed to generate minijet Pt>', pttrig, 'GeV'\n Goto 155\n End If\n Else\n If (miss<50) Goto 155\n End If\n Return\n End If\n sw = wp*wm\n ampx = sqrt((ecut1-hipr1(8))**2+pxp**2+pyp**2+0.01)\n amtx = sqrt((ecut2-hipr1(8))**2+pxt**2+pyt**2+0.01)\n sxx = (ampx+amtx)**2\n If (sw<sxx .Or. vint(43)<hipr1(1)) Then\n miss = miss + 1\n If (miss>maxmiss) Goto 155\n Return\n End If\n hint1(41) = p(7, 1)\n hint1(42) = p(7, 2)\n hint1(43) = p(7, 3)\n hint1(44) = p(7, 4)\n hint1(45) = p(7, 5)\n hint1(46) = sqrt(p(7,1)**2+p(7,2)**2)\n hint1(51) = p(8, 1)\n hint1(52) = p(8, 2)\n hint1(53) = p(8, 3)\n hint1(54) = p(8, 4)\n hint1(55) = p(8, 5)\n hint1(56) = sqrt(p(8,1)**2+p(8,2)**2)\n ihnt2(14) = k(7, 2)\n ihnt2(15) = k(8, 2)\n pinird = (1.0-exp(-2.0*(vint(47)-hidat(1))))/(1.0+exp(-2.0*(vint(47)-hidat(1))))\n iinird = 0\n If (ranart(nseed)<=pinird) iinird = 1\n If (k(7,2)==-k(8,2)) Goto 190\n If (k(7,2)==21 .And. k(8,2)==21 .And. iopjet==1) Goto 190\n jflg = 2\n jpp = 0\n lpq = 0\n lpb = 0\n jtt = 0\n ltq = 0\n ltb = 0\n is7 = 0\n is8 = 0\n hint1(47) = 0.0\n hint1(48) = 0.0\n hint1(49) = 0.0\n hint1(50) = 0.0\n hint1(67) = 0.0\n hint1(68) = 0.0\n hint1(69) = 0.0\n hint1(70) = 0.0\n Do i = 9, n\n If (k(i,3)==1 .Or. k(i,3)==2 .Or. abs(k(i,2))>30) Goto 180\n If (k(i,3)==7) Then\n hint1(47) = hint1(47) + p(i, 1)\n hint1(48) = hint1(48) + p(i, 2)\n hint1(49) = hint1(49) + p(i, 3)\n hint1(50) = hint1(50) + p(i, 4)\n End If\n If (k(i,3)==8) Then\n hint1(67) = hint1(67) + p(i, 1)\n hint1(68) = hint1(68) + p(i, 2)\n hint1(69) = hint1(69) + p(i, 3)\n hint1(70) = hint1(70) + p(i, 4)\n End If\n If (k(i,2)>21 .And. k(i,2)<=30) Then\n ndr = ndr + 1\n iadr(ndr, 1) = jp\n iadr(ndr, 2) = jt\n kfdr(ndr) = k(i, 2)\n pdr(ndr, 1) = p(i, 1)\n pdr(ndr, 2) = p(i, 2)\n pdr(ndr, 3) = p(i, 3)\n pdr(ndr, 4) = p(i, 4)\n pdr(ndr, 5) = p(i, 5)\n rtdr(ndr, 1) = 0.5*(yp(1,jp)+yt(1,jt))\n rtdr(ndr, 2) = 0.5*(yp(2,jp)+yt(2,jt))\n Goto 180\n End If\n If (k(i,3)==7 .Or. k(i,3)==3) Then\n If (k(i,3)==7 .And. k(i,2)/=21 .And. k(i,2)==k(7,2) .And. is7==0) Then\n pp(jp, 10) = p(i, 1)\n pp(jp, 11) = p(i, 2)\n pp(jp, 12) = p(i, 3)\n pzp = pzp + p(i, 3)\n pep = pep + p(i, 4)\n nfp(jp, 10) = 1\n is7 = 1\n Goto 180\n End If\n If (k(i,3)==3 .And. (k(i,2)/=21 .Or. iinird==0)) Then\n pxp = pxp + p(i, 1)\n pyp = pyp + p(i, 2)\n pzp = pzp + p(i, 3)\n pep = pep + p(i, 4)\n Goto 180\n End If\n jpp = jpp + 1\n ip(jpp, 1) = i\n ip(jpp, 2) = 0\n If (k(i,2)/=21) Then\n If (k(i,2)>0) Then\n lpq = lpq + 1\n ipq(lpq) = jpp\n ip(jpp, 2) = lpq\n Else If (k(i,2)<0) Then\n lpb = lpb + 1\n ipb(lpb) = jpp\n ip(jpp, 2) = -lpb\n End If\n End If\n Else If (k(i,3)==8 .Or. k(i,3)==4) Then\n If (k(i,3)==8 .And. k(i,2)/=21 .And. k(i,2)==k(8,2) .And. is8==0) Then\n pt(jt, 10) = p(i, 1)\n pt(jt, 11) = p(i, 2)\n pt(jt, 12) = p(i, 3)\n pzt = pzt + p(i, 3)\n pet = pet + p(i, 4)\n nft(jt, 10) = 1\n is8 = 1\n Goto 180\n End If\n If (k(i,3)==4 .And. (k(i,2)/=21 .Or. iinird==0)) Then\n pxt = pxt + p(i, 1)\n pyt = pyt + p(i, 2)\n pzt = pzt + p(i, 3)\n pet = pet + p(i, 4)\n Goto 180\n End If\n jtt = jtt + 1\n it(jtt, 1) = i\n it(jtt, 2) = 0\n If (k(i,2)/=21) Then\n If (k(i,2)>0) Then\n ltq = ltq + 1\n itq(ltq) = jtt\n it(jtt, 2) = ltq\n Else If (k(i,2)<0) Then\n ltb = ltb + 1\n itb(ltb) = jtt\n it(jtt, 2) = -ltb\n End If\n End If\n End If\n 180 End Do\n If (lpq/=lpb .Or. ltq/=ltb) Then\n miss = miss + 1\n If (miss<=maxmiss) Goto 155\n Write (6, *) ' Q -QBAR NOT MATCHED IN HIJHRD'\n jflg = 0\n Return\n End If\n j = 0\n 181 j = j + 1\n If (j>jpp) Goto 182\n If (ip(j,2)==0) Then\n Goto 181\n Else If (ip(j,2)/=0) Then\n lp = abs(ip(j,2))\n ip1 = ip(j, 1)\n ip2 = ip(j, 2)\n ip(j, 1) = ip(ipq(lp), 1)\n ip(j, 2) = ip(ipq(lp), 2)\n ip(ipq(lp), 1) = ip1\n ip(ipq(lp), 2) = ip2\n If (ip2>0) Then\n ipq(ip2) = ipq(lp)\n Else If (ip2<0) Then\n ipb(-ip2) = ipq(lp)\n End If\n ip1 = ip(j+1, 1)\n ip2 = ip(j+1, 2)\n ip(j+1, 1) = ip(ipb(lp), 1)\n ip(j+1, 2) = ip(ipb(lp), 2)\n ip(ipb(lp), 1) = ip1\n ip(ipb(lp), 2) = ip2\n If (ip2>0) Then\n ipq(ip2) = ipb(lp)\n Else If (ip2<0) Then\n ipb(-ip2) = ipb(lp)\n End If\n j = j + 1\n Goto 181\n End If\n 182 j = 0\n 183 j = j + 1\n If (j>jtt) Goto 184\n If (it(j,2)==0) Then\n Goto 183\n Else If (it(j,2)/=0) Then\n lt = abs(it(j,2))\n it1 = it(j, 1)\n it2 = it(j, 2)\n it(j, 1) = it(itq(lt), 1)\n it(j, 2) = it(itq(lt), 2)\n it(itq(lt), 1) = it1\n it(itq(lt), 2) = it2\n If (it2>0) Then\n itq(it2) = itq(lt)\n Else If (it2<0) Then\n itb(-it2) = itq(lt)\n End If\n it1 = it(j+1, 1)\n it2 = it(j+1, 2)\n it(j+1, 1) = it(itb(lt), 1)\n it(j+1, 2) = it(itb(lt), 2)\n it(itb(lt), 1) = it1\n it(itb(lt), 2) = it2\n If (it2>0) Then\n itq(it2) = itb(lt)\n Else If (it2<0) Then\n itb(-it2) = itb(lt)\n End If\n j = j + 1\n Goto 183\n End If\n 184 Continue\n If (npj(jp)+jpp>mxjt .Or. ntj(jt)+jtt>mxjt) Then\n jflg = 0\n Write (6, *) 'number of partons per string exceeds'\n Write (6, *) 'the common block size'\n Return\n End If\n Do j = 1, jpp\n kfpj(jp, npj(jp)+j) = k(ip(j,1), 2)\n pjpx(jp, npj(jp)+j) = p(ip(j,1), 1)\n pjpy(jp, npj(jp)+j) = p(ip(j,1), 2)\n pjpz(jp, npj(jp)+j) = p(ip(j,1), 3)\n pjpe(jp, npj(jp)+j) = p(ip(j,1), 4)\n pjpm(jp, npj(jp)+j) = p(ip(j,1), 5)\n End Do\n npj(jp) = npj(jp) + jpp\n Do j = 1, jtt\n kftj(jt, ntj(jt)+j) = k(it(j,1), 2)\n pjtx(jt, ntj(jt)+j) = p(it(j,1), 1)\n pjty(jt, ntj(jt)+j) = p(it(j,1), 2)\n pjtz(jt, ntj(jt)+j) = p(it(j,1), 3)\n pjte(jt, ntj(jt)+j) = p(it(j,1), 4)\n pjtm(jt, ntj(jt)+j) = p(it(j,1), 5)\n End Do\n ntj(jt) = ntj(jt) + jtt\n Goto 900\n 190 jflg = 3\n If (k(7,2)/=21 .And. k(8,2)/=21 .And. k(7,2)*k(8,2)>0) Goto 155\n jpp = 0\n lpq = 0\n lpb = 0\n Do i = 9, n\n If (k(i,3)==1 .Or. k(i,3)==2 .Or. abs(k(i,2))>30) Goto 200\n If (k(i,2)>21 .And. k(i,2)<=30) Then\n ndr = ndr + 1\n iadr(ndr, 1) = jp\n iadr(ndr, 2) = jt\n kfdr(ndr) = k(i, 2)\n pdr(ndr, 1) = p(i, 1)\n pdr(ndr, 2) = p(i, 2)\n pdr(ndr, 3) = p(i, 3)\n pdr(ndr, 4) = p(i, 4)\n pdr(ndr, 5) = p(i, 5)\n rtdr(ndr, 1) = 0.5*(yp(1,jp)+yt(1,jt))\n rtdr(ndr, 2) = 0.5*(yp(2,jp)+yt(2,jt))\n Goto 200\n End If\n If (k(i,3)==3 .And. (k(i,2)/=21 .Or. iinird==0)) Then\n pxp = pxp + p(i, 1)\n pyp = pyp + p(i, 2)\n pzp = pzp + p(i, 3)\n pep = pep + p(i, 4)\n Goto 200\n End If\n If (k(i,3)==4 .And. (k(i,2)/=21 .Or. iinird==0)) Then\n pxt = pxt + p(i, 1)\n pyt = pyt + p(i, 2)\n pzt = pzt + p(i, 3)\n pet = pet + p(i, 4)\n Goto 200\n End If\n jpp = jpp + 1\n ip(jpp, 1) = i\n ip(jpp, 2) = 0\n If (k(i,2)/=21) Then\n If (k(i,2)>0) Then\n lpq = lpq + 1\n ipq(lpq) = jpp\n ip(jpp, 2) = lpq\n Else If (k(i,2)<0) Then\n lpb = lpb + 1\n ipb(lpb) = jpp\n ip(jpp, 2) = -lpb\n End If\n End If\n 200 End Do\n If (lpq/=lpb) Then\n miss = miss + 1\n If (miss<=maxmiss) Goto 155\n Write (6, *) lpq, lpb, 'Q-QBAR NOT CONSERVED OR NOT MATCHED'\n jflg = 0\n Return\n End If\n j = 0\n 220 j = j + 1\n If (j>jpp) Goto 222\n If (ip(j,2)==0) Goto 220\n lp = abs(ip(j,2))\n ip1 = ip(j, 1)\n ip2 = ip(j, 2)\n ip(j, 1) = ip(ipq(lp), 1)\n ip(j, 2) = ip(ipq(lp), 2)\n ip(ipq(lp), 1) = ip1\n ip(ipq(lp), 2) = ip2\n If (ip2>0) Then\n ipq(ip2) = ipq(lp)\n Else If (ip2<0) Then\n ipb(-ip2) = ipq(lp)\n End If\n ipq(lp) = j\n ip1 = ip(j+1, 1)\n ip2 = ip(j+1, 2)\n ip(j+1, 1) = ip(ipb(lp), 1)\n ip(j+1, 2) = ip(ipb(lp), 2)\n ip(ipb(lp), 1) = ip1\n ip(ipb(lp), 2) = ip2\n If (ip2>0) Then\n ipq(ip2) = ipb(lp)\n Else If (ip2<0) Then\n ipb(-ip2) = ipb(lp)\n End If\n ipb(lp) = j + 1\n j = j + 1\n Goto 220\n 222 Continue\n If (lpq>=1) Then\n Do l0 = 2, lpq\n ip1 = ip(2*l0-3, 1)\n ip2 = ip(2*l0-3, 2)\n ip(2*l0-3, 1) = ip(ipq(l0), 1)\n ip(2*l0-3, 2) = ip(ipq(l0), 2)\n ip(ipq(l0), 1) = ip1\n ip(ipq(l0), 2) = ip2\n If (ip2>0) Then\n ipq(ip2) = ipq(l0)\n Else If (ip2<0) Then\n ipb(-ip2) = ipq(l0)\n End If\n ipq(l0) = 2*l0 - 3\n ip1 = ip(2*l0-2, 1)\n ip2 = ip(2*l0-2, 2)\n ip(2*l0-2, 1) = ip(ipb(l0), 1)\n ip(2*l0-2, 2) = ip(ipb(l0), 2)\n ip(ipb(l0), 1) = ip1\n ip(ipb(l0), 2) = ip2\n If (ip2>0) Then\n ipq(ip2) = ipb(l0)\n Else If (ip2<0) Then\n ipb(-ip2) = ipb(l0)\n End If\n ipb(l0) = 2*l0 - 2\n End Do\n ip1 = ip(2*lpq-1, 1)\n ip2 = ip(2*lpq-1, 2)\n ip(2*lpq-1, 1) = ip(ipq(1), 1)\n ip(2*lpq-1, 2) = ip(ipq(1), 2)\n ip(ipq(1), 1) = ip1\n ip(ipq(1), 2) = ip2\n If (ip2>0) Then\n ipq(ip2) = ipq(1)\n Else If (ip2<0) Then\n ipb(-ip2) = ipq(1)\n End If\n ipq(1) = 2*lpq - 1\n ip1 = ip(jpp, 1)\n ip2 = ip(jpp, 2)\n ip(jpp, 1) = ip(ipb(1), 1)\n ip(jpp, 2) = ip(ipb(1), 2)\n ip(ipb(1), 1) = ip1\n ip(ipb(1), 2) = ip2\n If (ip2>0) Then\n ipq(ip2) = ipb(1)\n Else If (ip2<0) Then\n ipb(-ip2) = ipb(1)\n End If\n ipb(1) = jpp\n End If\n If (nsg>=mxsg) Then\n jflg = 0\n Write (6, *) 'number of jets forming single strings exceeds'\n Write (6, *) 'the common block size'\n Return\n End If\n If (jpp>mxsj) Then\n jflg = 0\n Write (6, *) 'number of partons per single jet system'\n Write (6, *) 'exceeds the common block size'\n Return\n End If\n nsg = nsg + 1\n njsg(nsg) = jpp\n iasg(nsg, 1) = jp\n iasg(nsg, 2) = jt\n iasg(nsg, 3) = 0\n Do i = 1, jpp\n k1sg(nsg, i) = 2\n k2sg(nsg, i) = k(ip(i,1), 2)\n If (k2sg(nsg,i)<0) k1sg(nsg, i) = 1\n pxsg(nsg, i) = p(ip(i,1), 1)\n pysg(nsg, i) = p(ip(i,1), 2)\n pzsg(nsg, i) = p(ip(i,1), 3)\n pesg(nsg, i) = p(ip(i,1), 4)\n pmsg(nsg, i) = p(ip(i,1), 5)\n End Do\n k1sg(nsg, 1) = 2\n k1sg(nsg, jpp) = 1\n 900 pp(jp, 1) = pxp\n pp(jp, 2) = pyp\n pp(jp, 3) = pzp\n pp(jp, 4) = pep\n pp(jp, 5) = 0.0\n pt(jt, 1) = pxt\n pt(jt, 2) = pyt\n pt(jt, 3) = pzt\n pt(jt, 4) = pet\n pt(jt, 5) = 0.0\n nfp(jp, 6) = nfp(jp, 6) + 1\n nft(jt, 6) = nft(jt, 6) + 1\n Return\n 1000 jflg = -1\n If (ihpr2(10)==0) Return\n Write (6, *) 'Fatal HIJHRD error'\n Write (6, *) jp, ' proj E+,E-', epp, epm, ' status', nfp(jp, 5)\n Write (6, *) jt, ' targ E+,E_', etp, etm, ' status', nft(jt, 5)\n Return\nEnd Subroutine hijhrd\n", "meta": {"hexsha": "6398d9c76a76e27d45bdec3594935e0ff95208f8", "size": 14715, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/hijhrd.f90", "max_stars_repo_name": "xiaohaijin/AMPT", "max_stars_repo_head_hexsha": "90c7a1ab4dc04a092e64af759d53e22f6fea5b02", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_stars_repo_stars_event_min_datetime": "2018-12-24T19:37:06.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-14T12:58:59.000Z", "max_issues_repo_path": "src/hijhrd.f90", "max_issues_repo_name": "xiaohaijin/AMPT", "max_issues_repo_head_hexsha": "90c7a1ab4dc04a092e64af759d53e22f6fea5b02", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/hijhrd.f90", "max_forks_repo_name": "xiaohaijin/AMPT", "max_forks_repo_head_hexsha": "90c7a1ab4dc04a092e64af759d53e22f6fea5b02", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 26.4658273381, "max_line_length": 227, "alphanum_fraction": 0.4753652735, "num_tokens": 7651, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5389832058771036, "lm_q2_score": 0.1666754088273618, "lm_q1q2_score": 0.08983524619064835}}
{"text": "program call_by_reference\n implicit none\n integer :: m\n m = 5\n print *, m\n call increment(m)\n print *, m\n\ncontains\n\n subroutine increment(n)\n implicit none\n integer, intent(inout) :: n\n\n n = n + 1\n end subroutine increment\n\nend program call_by_reference\n", "meta": {"hexsha": "f59ca924da8ddd4f5b2f4d2a6a674f5b39573579", "size": 299, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "source_code/call_by_semantics/call_by_reference.f90", "max_stars_repo_name": "caguerra/Fortran-MOOC", "max_stars_repo_head_hexsha": "fb8a9c24e62ce5f388deb06b21e3009aea6b78d4", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_count": 12, "max_stars_repo_stars_event_min_datetime": "2021-05-20T12:03:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-16T19:46:26.000Z", "max_issues_repo_path": "source_code/call_by_semantics/call_by_reference.f90", "max_issues_repo_name": "caguerra/Fortran-MOOC", "max_issues_repo_head_hexsha": "fb8a9c24e62ce5f388deb06b21e3009aea6b78d4", "max_issues_repo_licenses": ["CC-BY-4.0"], "max_issues_count": 2, "max_issues_repo_issues_event_min_datetime": "2021-09-30T04:25:50.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-06T08:21:30.000Z", "max_forks_repo_path": "source_code/call_by_semantics/call_by_reference.f90", "max_forks_repo_name": "caguerra/Fortran-MOOC", "max_forks_repo_head_hexsha": "fb8a9c24e62ce5f388deb06b21e3009aea6b78d4", "max_forks_repo_licenses": ["CC-BY-4.0"], "max_forks_count": 6, "max_forks_repo_forks_event_min_datetime": "2021-09-27T07:30:31.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-07T16:23:19.000Z", "avg_line_length": 15.7368421053, "max_line_length": 35, "alphanum_fraction": 0.6120401338, "num_tokens": 75, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.3174262655876759, "lm_q2_score": 0.2720245392906821, "lm_q1q2_score": 0.08634773365524923}}
{"text": "program line_continuation_01\nimplicit none\ninteger :: i\ni = 5\nif (i < 4) &\n print *, i\nif (i > 4) & ! This will print\n print *, i\nif (i > 4) &\n ! This will also print\n print *, i\nif (i > 4) & ! Yes\n ! This will also print\n print *, i\nend program\n", "meta": {"hexsha": "788a18b803f73d863bc5fad011a86483bd5fb600", "size": 264, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "integration_tests/line_continuation_01.f90", "max_stars_repo_name": "Thirumalai-Shaktivel/lfortran", "max_stars_repo_head_hexsha": "bb39faf1094b028351d5aefe27d64ee69302300a", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 316, "max_stars_repo_stars_event_min_datetime": "2019-03-24T16:23:41.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T07:28:33.000Z", "max_issues_repo_path": "integration_tests/line_continuation_01.f90", "max_issues_repo_name": "Thirumalai-Shaktivel/lfortran", "max_issues_repo_head_hexsha": "bb39faf1094b028351d5aefe27d64ee69302300a", "max_issues_repo_licenses": ["BSD-3-Clause"], "max_issues_count": 1, "max_issues_repo_issues_event_min_datetime": "2020-07-29T04:58:03.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-04T16:40:06.000Z", "max_forks_repo_path": "integration_tests/line_continuation_01.f90", "max_forks_repo_name": "Thirumalai-Shaktivel/lfortran", "max_forks_repo_head_hexsha": "bb39faf1094b028351d5aefe27d64ee69302300a", "max_forks_repo_licenses": ["BSD-3-Clause"], "max_forks_count": 26, "max_forks_repo_forks_event_min_datetime": "2019-03-28T19:40:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T07:28:55.000Z", "avg_line_length": 16.5, "max_line_length": 30, "alphanum_fraction": 0.5643939394, "num_tokens": 96, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4263215925474903, "lm_q2_score": 0.2018132150593341, "lm_q1q2_score": 0.08603733124122447}}
{"text": "program CASting ! CTM : fortran is case insensitive language\r\n \r\n implicit none;\r\n InteGer a, b;\r\n ReAl p, q;\r\n \r\n a = 5;\r\n b = 60;\r\n\r\n p = 45.28964;\r\n q = 78.25874;\r\n\r\n print *,\"a=\", a; \r\n print *,\"b=\", b; \r\n \r\n print *,\"p=\", p; \r\n print *,\"q=\", q; \r\n \r\n a = q;\r\n p = b;\r\n print *, \"After Implicit casting\";\r\n print *, \"a = \", a; ! Implicit Casting\r\n print *, \"p = \", p;\r\n \r\n print *, \"Explicit casting\"; \r\n print *, \"real(a) = \", real(a);\r\n print *, \"int(p) = \", int(p); ! CTM : int for casting not integer\r\n \r\nend program casting", "meta": {"hexsha": "3c4931357302a74ec54fd7597c9468a9d2fb8cf7", "size": 613, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "III-sem/NumericalMethod/FortranProgram/Practice/casting.f95", "max_stars_repo_name": "ASHD27/JMI-MCA", "max_stars_repo_head_hexsha": "61995cd2c8306b089a9b40d49d9716043d1145db", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max_stars_repo_stars_event_min_datetime": "2020-03-18T16:27:33.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-07T12:39:32.000Z", "max_issues_repo_path": "III-sem/NumericalMethod/FortranProgram/Practice/casting.f95", "max_issues_repo_name": "ASHD27/JMI-MCA", "max_issues_repo_head_hexsha": "61995cd2c8306b089a9b40d49d9716043d1145db", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "III-sem/NumericalMethod/FortranProgram/Practice/casting.f95", "max_forks_repo_name": "ASHD27/JMI-MCA", "max_forks_repo_head_hexsha": "61995cd2c8306b089a9b40d49d9716043d1145db", "max_forks_repo_licenses": ["MIT"], "max_forks_count": 10, "max_forks_repo_forks_event_min_datetime": "2019-11-11T06:49:10.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-07T12:41:20.000Z", "avg_line_length": 21.1379310345, "max_line_length": 72, "alphanum_fraction": 0.4469820555, "num_tokens": 191, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.3812195662561499, "lm_q2_score": 0.22000710486009023, "lm_q1q2_score": 0.08387101308803488}}
{"text": " program demo_present\n implicit none\n write(*,*) func(), func(42)\n contains\n\n integer function func(x)\n integer, intent(in), optional :: x\n if(present(x))then\n func=x**2\n else\n func=0\n endif\n end function\n\n end program demo_present\n", "meta": {"hexsha": "8d13442ce9c84d034466a45456bde7498b474512", "size": 293, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "example/present.f90", "max_stars_repo_name": "urbanjost/fortran-intrinsic-descriptions", "max_stars_repo_head_hexsha": "59b3618e6c247802cb26f32a1a77e8b718bcc165", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max_stars_repo_stars_event_min_datetime": "2021-12-31T17:21:59.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-06T15:56:29.000Z", "max_issues_repo_path": "example/present.f90", "max_issues_repo_name": "urbanjost/fortran-intrinsic-descriptions", "max_issues_repo_head_hexsha": "59b3618e6c247802cb26f32a1a77e8b718bcc165", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "example/present.f90", "max_forks_repo_name": "urbanjost/fortran-intrinsic-descriptions", "max_forks_repo_head_hexsha": "59b3618e6c247802cb26f32a1a77e8b718bcc165", "max_forks_repo_licenses": ["MIT"], "max_forks_count": 1, "max_forks_repo_forks_event_min_datetime": "2022-01-06T15:56:31.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-06T15:56:31.000Z", "avg_line_length": 18.3125, "max_line_length": 38, "alphanum_fraction": 0.5631399317, "num_tokens": 74, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.4455295350395727, "lm_q2_score": 0.184767510648, "lm_q1q2_score": 0.08231938310942274}}
{"text": "program exercise_1_7 \r\n implicit none\r\n \r\n character(*), parameter :: input_file = \"../data/input.txt\", output_file = \"./output.txt\"\r\n character(:), allocatable :: fmt !format\r\n integer :: In = 0, Out = 0, A , B \r\n\r\n fmt = \"(a, '= ',I0,' ', a, '= ', I0 )\"\r\n\r\n open (file=input_file, newunit=In)\r\n read (In, *) A, B\r\n close (In) \r\n\r\n a = a - b\r\n b = a + b\r\n a = b - a\r\n\r\n open (file=output_file, newunit=Out)\r\n fmt = \"(a, '= ',I0,' ', a, '= ', I0 )\" \r\n write (Out, fmt) \"a\", a, \"b\", b \r\n close (Out)\r\n\r\n ! call Write1 !Comment для процедуры при вызове можно использовать аргумент position=append или rewind\r\n\r\n ! contains\r\n ! subroutine Write1\r\n ! open (file=output_file, newunit=Out, position='append')\r\n ! write (Out, fmt) \"a\", A, \"b\", B \r\n ! close (Out)\r\n ! end subroutine Write1\r\n\r\n \r\nend program exercise_1_7\r\n\r\n\r\n", "meta": {"hexsha": "a86274d7a2932a40b34e9f2d2e38eff9bfba6705", "size": 940, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "1/src/main.f95", "max_stars_repo_name": "MarieLazarEva/Fortran_exercises", "max_stars_repo_head_hexsha": "a7c38c711753c6a10e193effa51a79ce86590b69", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "1/src/main.f95", "max_issues_repo_name": "MarieLazarEva/Fortran_exercises", "max_issues_repo_head_hexsha": "a7c38c711753c6a10e193effa51a79ce86590b69", "max_issues_repo_licenses": ["Unlicense"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "1/src/main.f95", "max_forks_repo_name": "MarieLazarEva/Fortran_exercises", "max_forks_repo_head_hexsha": "a7c38c711753c6a10e193effa51a79ce86590b69", "max_forks_repo_licenses": ["Unlicense"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 26.1111111111, "max_line_length": 106, "alphanum_fraction": 0.5042553191, "num_tokens": 293, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4610167793123159, "lm_q2_score": 0.17781087819190097, "lm_q1q2_score": 0.08197379839072469}}
{"text": "module m ! GitHub FortranTip derived_type_section.f90\r\nimplicit none\r\ntype :: v\r\n integer :: c(2) = [2,4], d = 6\r\nend type v\r\nend module m\r\n!\r\nprogram main\r\nuse m, only: v\r\nimplicit none\r\ncharacter (len=20) :: fmt=\"(*(1x,i0))\"\r\ntype(v) :: t(3)\r\nprint fmt,t(1:2) ! 2 4 6 2 4 6\r\nprint fmt,t(1:2)%d ! 6 6\r\nprint fmt,t ! 2 4 6 2 4 6 2 4 6\r\nprint fmt,t%c(1) ! 2 2 2\r\nprint fmt,t(1)%c(1:2) ! 2 4\r\n! print fmt,t%c ! invalid: gfortran complains about\r\n! two or more part references with nonzero rank\r\nend program main\r\n", "meta": {"hexsha": "036442d7d81c6daf6c4322db321071e73b9819bc", "size": 513, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "derived_type_section.f90", "max_stars_repo_name": "awvwgk/FortranTip", "max_stars_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "derived_type_section.f90", "max_issues_repo_name": "awvwgk/FortranTip", "max_issues_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_issues_repo_licenses": ["Unlicense"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "derived_type_section.f90", "max_forks_repo_name": "awvwgk/FortranTip", "max_forks_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_forks_repo_licenses": ["Unlicense"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 24.4285714286, "max_line_length": 54, "alphanum_fraction": 0.6296296296, "num_tokens": 205, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.48438008427698437, "lm_q2_score": 0.16667541089705434, "lm_q1q2_score": 0.08073424957721619}}
{"text": "PROGRAM task_2\n IMPLICIT NONE\n\n INTEGER :: a\n REAL :: pi = 3.1415926\n\n WRITE (*,110) pi\n110 FORMAT(E12.5)\n WRITE (*,100) pi\n100 FORMAT(E12.3)\n WRITE (*,90) pi\n90 FORMAT(E12.3E4)\n WRITE (*,80) pi\n80 FORMAT(ES12.3E4)\n WRITE (*,70) pi\n70 FORMAT(ES12.4E4)\n WRITE (*,'(\"please input an integer?\")')\n READ(*,*),a\n WRITE(*,*),a\n PRINT *,'The output format is wierd'\nEND PROGRAM task_2\n\n\n!这里把一个用户自定义函数当作参数传递给子程序,所有的这些外部过程\n!(external procedure)都可以被独立编译。\n! 一个程 序单元 是fortran程序中的一个独立编译部分,主程序,子程序,函数子程序\n!都可以看做是程序单元,fortunately,Fortran has provide a specific mechanism ,可以在构建最终程序前较容易开发和调试子任务\n", "meta": {"hexsha": "0c71b95351acfaa1076c951be4a7862c5f2718d0", "size": 590, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "basics/IO/print/print_format.f90", "max_stars_repo_name": "ComplicatedPhenomenon/Fortran_Takeoff", "max_stars_repo_head_hexsha": "a13180050367e59a91973af96ab680c2b76097be", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "basics/IO/print/print_format.f90", "max_issues_repo_name": "ComplicatedPhenomenon/Fortran_Takeoff", "max_issues_repo_head_hexsha": "a13180050367e59a91973af96ab680c2b76097be", "max_issues_repo_licenses": ["BSD-3-Clause"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "basics/IO/print/print_format.f90", "max_forks_repo_name": "ComplicatedPhenomenon/Fortran_Takeoff", "max_forks_repo_head_hexsha": "a13180050367e59a91973af96ab680c2b76097be", "max_forks_repo_licenses": ["BSD-3-Clause"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 21.0714285714, "max_line_length": 87, "alphanum_fraction": 0.7, "num_tokens": 276, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.38861802670584894, "lm_q2_score": 0.194367818018817, "lm_q1q2_score": 0.0755348378935942}}
{"text": " PROGRAM squared\n INTEGER :: i\n WRITE (*,*) \"Please enter a number.\"\n READ (*,*) i\n WRITE (*,*) \"Your number squared is \", i*i\n STOP\n END PROGRAM\n", "meta": {"hexsha": "ba51546767e9e0dcc69b9e0c3b4a989b767d3d4b", "size": 181, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/squared.f", "max_stars_repo_name": "Dreamseer/learning-fortran", "max_stars_repo_head_hexsha": "3ce70260f7b3707258ba4a85b85ed670e1f1e41a", "max_stars_repo_licenses": ["WTFPL"], "max_stars_count": 1, "max_stars_repo_stars_event_min_datetime": "2017-08-09T21:15:09.000Z", "max_stars_repo_stars_event_max_datetime": "2017-08-09T21:15:09.000Z", "max_issues_repo_path": "src/squared.f", "max_issues_repo_name": "Dreamseer/learning-fortran", "max_issues_repo_head_hexsha": "3ce70260f7b3707258ba4a85b85ed670e1f1e41a", "max_issues_repo_licenses": ["WTFPL"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/squared.f", "max_forks_repo_name": "Dreamseer/learning-fortran", "max_forks_repo_head_hexsha": "3ce70260f7b3707258ba4a85b85ed670e1f1e41a", "max_forks_repo_licenses": ["WTFPL"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 22.625, "max_line_length": 48, "alphanum_fraction": 0.4972375691, "num_tokens": 48, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4263215925474903, "lm_q2_score": 0.17328820379459514, "lm_q1q2_score": 0.07387650301140586}}
{"text": "! 2. Write function that reverses a list, preferably in place.\n \n program Exercises\n implicit none\n integer :: list(4)\n \n list = (/1, 2, 5, 3/)\n call reverse(list) \n \n contains\n subroutine reverse(list)\n ! Reverses in place.\n integer, dimension(1:) :: list\n integer :: i\n integer :: s\n integer :: halfSize\n integer :: temp\n \n s = size(list)\n halfSize = s / 2\n \n ! Swap pairs of elements in the list.\n do i=1,halfSize\n temp = list(i)\n list(i) = list(s-i+1)\n list(s-i+1) = temp \n end do\n \n end subroutine reverse\n \n end program Exercises", "meta": {"hexsha": "e1816f04c51ced48b0a70f76b3112459a0710c3f", "size": 835, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "L02.f90", "max_stars_repo_name": "clandrew/problemsf90", "max_stars_repo_head_hexsha": "8dd561f9ab4cb7a880efda5d3c4a32bc458cac24", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "L02.f90", "max_issues_repo_name": "clandrew/problemsf90", "max_issues_repo_head_hexsha": "8dd561f9ab4cb7a880efda5d3c4a32bc458cac24", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "L02.f90", "max_forks_repo_name": "clandrew/problemsf90", "max_forks_repo_head_hexsha": "8dd561f9ab4cb7a880efda5d3c4a32bc458cac24", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 26.935483871, "max_line_length": 62, "alphanum_fraction": 0.422754491, "num_tokens": 175, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.47268347662043286, "lm_q2_score": 0.15405756851741473, "lm_q1q2_score": 0.07282046708650214}}
{"text": "! Simulate F0 format with more options, for compilers disallowing NaN, Inf.\r\n! Fortran 95/2003 module and test program in this file f0noIEEE.f90 by\r\n! J F Harper, Mathematics, Victoria University, Wellington, NZ 10 Jan 2012.\r\n!\r\n! Compilers vary in their own treatments of leading zero and optional + sign\r\n! because Fortran standards f90,f95,f2003 differ, and f95 was ambiguous. The\r\n! module lets users choose their own treatment. The test program avoids IEEE\r\n! features such as NaN or Inf. I hope it works with f95 compilers that do\r\n! not support them, but I do not have such a compiler to test it with.\r\n!\r\n! Usage: function f0(x,n,s) or f0(x,n) returns the shortest possible string\r\n! of characters containing x in F0.n format, with leading zero and + sign\r\n! controlled by the character string s if it is present, or by SS,F0.n\r\n! format as in f2003 if not, so if separate positive and negative zeros are\r\n! supported then f0(-0.0,n) shall begin with a - sign. Arguments:\r\n!\r\n! x: value to be written by f0 [double precision or default real]\r\n! n: number of digits to be written after the decimal point [integer]\r\n! s: specifying treatment of + sign and leading zero [character(*)]\r\n!\r\n! If s is absent or contains neither LZ nor SP the effect is that of format\r\n! SS,F0.n as in the f2003 standard. If s contains SP the effect is that of\r\n! SP,F0.n, i.e. a + sign if x>0 or x is +0.0, a - sign if x<0 or -0.0.\r\n! If the processor does not support separate -0.0 and +0.0 then 0.0 is\r\n! treated as +0.0. A zero before the decimal point is inserted if the\r\n! output would otherwise have had no digits at all, or if s contains LZ and\r\n! there would otherwise be no digits before the decimal point.\r\n!\r\n! Public entities defined in this module are\r\n! four integer parameters: p1 = kind(1.0), p2 = kind(1d0),\r\n! ispace = space needed for -huge(1) in I0 format,\r\n! rspace = space needed for -huge(1d0) in F0.0 format,\r\n! two real parameters: zero1 = 0 of kind p1, zero2 = 0 of kind p2.\r\n! generic character function: f0 with four private specific forms, for real\r\n! kinds p1 and p2, and s present or absent.\r\n!\r\nmodule leadzero\r\n implicit none\r\n private\r\n public p1,p2,zero1,zero2,ispace,rspace,f0\r\n integer,parameter :: &\r\n p2 = kind(1d0), & ! double precision kind\r\n p1 = kind(1.0), & ! default real (single precision) kind\r\n ispace = range(1) + 2, & ! space needed for -huge(1) in I0 format\r\n rspace = range(1d0) + 4 ! space for -huge(real) in F0.0\r\n real(p1),parameter:: zero1 = 0\r\n real(p2),parameter:: zero2 = 0\r\n interface f0 ! no optional args in spec.expr. so 4 procedures here\r\n module procedure p2f0short, p1f0short, p2f0no_s, p1f0no_s\r\n end interface f0\r\n\r\ncontains\r\n\r\n pure function p1f0long(x,n,s) result(out)\r\n real(p1),intent(in)::x\r\n integer,intent(in) :: n ! using f0.n format\r\n character(*),intent(in)::s! for leading zero, SP options\r\n character(rspace+abs(n)):: out\r\n! so len(out) = max possible space for x in f0.n format\r\n integer :: ios\r\n character:: fmt*(7+2*ispace)\r\n out = ' '\r\n if (n<0) then\r\n out = '*** Error in f0: n<0 ***'\r\n else\r\n write(fmt,\"(A,I0,A,I0,A)\")'(SS,F',len(out),'.',n,')' ! SS: no + sign\r\n write(out,fmt,iostat=ios) x\r\n if(ios/=0) then\r\n out = '*** Error in f0: reading x ***'\r\n else\r\n out = fixstring(s,out,sign(1.0_p1,x)<zero1.and.x==zero1)\r\n end if\r\n end if\r\n end function p1f0long\r\n\r\n pure function p2f0long(x,n,s) result(out)\r\n real(p2),intent(in)::x\r\n integer,intent(in) :: n ! using f0.n format\r\n character(*),intent(in)::s! for leading zero, SP options\r\n character(rspace+abs(n)):: out\r\n! so len(out) = max possible space for x in f0.n format\r\n integer :: ios\r\n character:: fmt*(7+2*ispace)\r\n out = ' '\r\n if (n<0) then\r\n out = '*** Error n<0 ***'\r\n else\r\n write(fmt,\"(A,I0,A,I0,A)\")'(SS,F',len(out),'.',n,')' ! SS: no + sign\r\n write(out,fmt,iostat=ios) x\r\n if(ios/=0) then\r\n out = '*** Error reading x ***'\r\n else\r\n out = fixstring(s,out,sign(1.0_p2,x)<zero2.and.x==zero2)\r\n end if\r\n end if\r\n end function p2f0long\r\n\r\n pure function fixstring( s,in,neg0) result(out)\r\n character(*),intent(in)::s,in\r\n logical,intent(in)::neg0 ! true if x is negative zero\r\n character(len(in)):: out\r\n logical:: usingsp\r\n usingsp = (index(s,'SP')>0)\r\n out=adjustl(in)\r\n if (scan(out,'Aa')>0) then ! x is not a number\r\n out = 'NaN'\r\n else if(scan(out,'Ii')>0) then ! x is infinite\r\n out = merge('-Inf', &\r\n merge('+Inf','Inf ',usingsp),scan(out,'-')>0)// &\r\n repeat(' ',len(out)-4)\r\n else\r\n if (neg0.and.scan(out,'-')==0) out = '-'//out\r\n! If s contains 'LZ' then insert leading zero; if not, delete it\r\n if (index(s,'LZ')>0) then\r\n if (out(1:2)=='-.' ) out = '-0'//out(2:)\r\n if (out(1:1)=='.' ) out = '0'//out\r\n else\r\n if (out(1:3)=='-0.') out = '-'//out(3:)\r\n if (out(1:2)=='0.' ) out = out(2:)\r\n! Ensure at least one digit is written (n might be 0)\r\n if(trim(out)=='.' ) out = '0.'\r\n if(trim(out)=='-.' ) out = '-0.'\r\n end if\r\n! If s contains 'SP' then insert + sign if not negative\r\n if (usingsp.and.scan(out,'-')==0) out = '+'//out\r\n end if\r\n end function fixstring\r\n\r\n pure function p1f0short(x,n,s) ! trimmed invocation of p1f0long\r\n real(p1),intent(in) ::x\r\n integer,intent(in) :: n\r\n character,intent(in):: s*(*)\r\n character:: p1f0short*(len_trim(p1f0long(x,n,s)))\r\n p1f0short = trim(p1f0long(x,n,s))\r\n end function p1f0short\r\n\r\n pure function p2f0short(x,n,s) ! trimmed invocation of p2f0long\r\n real(p2),intent(in) ::x\r\n integer,intent(in) :: n\r\n character,intent(in):: s*(*)\r\n character:: p2f0short*(len_trim(p2f0long(x,n,s)))\r\n p2f0short = trim(p2f0long(x,n,s))\r\n end function p2f0short\r\n\r\n pure function p1f0no_s(x,n) ! like p1f0short with s absent\r\n real(p1),intent(in)::x\r\n integer,intent(in) :: n\r\n character:: p1f0no_s*(len_trim(p1f0long(x,n,' ')))\r\n p1f0no_s = trim(p1f0long(x,n,' '))\r\n end function p1f0no_s\r\n\r\n pure function p2f0no_s(x,n) ! like p2f0short with s absent\r\n real(p2),intent(in)::x\r\n integer,intent(in) :: n\r\n character:: p2f0no_s*(len_trim(p2f0long(x,n,' ')))\r\n p2f0no_s = trim(p2f0long(x,n,' '))\r\n end function p2f0no_s\r\n\r\nend module leadzero\r\n", "meta": {"hexsha": "ecece68c3cd385cf7344744b36fe86c58986926b", "size": 6542, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/computing/f0noIEEE.f90", "max_stars_repo_name": "timcera/flibs_from_svn", "max_stars_repo_head_hexsha": "7790369ac1f0ff6e35ef43546446b32446dccc6b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 17, "max_stars_repo_stars_event_min_datetime": "2017-01-16T11:28:50.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-04T15:58:19.000Z", "max_issues_repo_path": "src/computing/f0noIEEE.f90", "max_issues_repo_name": "timcera/flibs_from_svn", "max_issues_repo_head_hexsha": "7790369ac1f0ff6e35ef43546446b32446dccc6b", "max_issues_repo_licenses": ["BSD-3-Clause"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/computing/f0noIEEE.f90", "max_forks_repo_name": "timcera/flibs_from_svn", "max_forks_repo_head_hexsha": "7790369ac1f0ff6e35ef43546446b32446dccc6b", "max_forks_repo_licenses": ["BSD-3-Clause"], "max_forks_count": 6, "max_forks_repo_forks_event_min_datetime": "2017-06-08T07:29:08.000Z", "max_forks_repo_forks_event_max_datetime": "2019-02-24T02:07:22.000Z", "avg_line_length": 40.8875, "max_line_length": 77, "alphanum_fraction": 0.607612351, "num_tokens": 2082, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4960938294709195, "lm_q2_score": 0.14414884751767365, "lm_q1q2_score": 0.07151135377886238}}
{"text": "! For derived types with pointer components, whether copying\r\n! is shallow or deep is complicated. See the Fortran Discourse\r\n! thread \"Should we avoid assignment of derived types in \r\n! robust programs?\"\r\nprogram main\r\ncharacter (len=20) :: fmt = \"(a,' =',*(1x,i0))\"\r\ninteger , target :: a(2)\r\ninteger , pointer :: b(:)\r\ninteger , allocatable :: c(:), f(:)\r\na = [4,9]\r\nb => a ! shallow copy -- changing a changes b\r\nallocate (c, source=a) ! deep copy -- changing a won't change c\r\nassociate (d => a) ! d is a shallow copy\r\nassociate (e => (a)) ! e is a deep copy since (a) is expression\r\nf = a ! deep copy\r\nd = d - 1 ! changes a, b, d\r\nprint fmt, \"a\", a\r\nprint fmt, \"b\", b\r\nprint fmt, \"c\", c\r\nprint fmt, \"d\", d\r\nprint fmt, \"e\", e\r\nprint fmt, \"f\", f\r\nend associate ; end associate\r\nend program main\r\n! output:\r\n! a = 3 8\r\n! b = 3 8\r\n! c = 4 9\r\n! d = 3 8\r\n! e = 4 9\r\n! f = 4 9\r\n", "meta": {"hexsha": "347a550810e4d88bfc4d61196bfb6dc846eb6db0", "size": 891, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "copy.f90", "max_stars_repo_name": "awvwgk/FortranTip", "max_stars_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "copy.f90", "max_issues_repo_name": "awvwgk/FortranTip", "max_issues_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_issues_repo_licenses": ["Unlicense"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "copy.f90", "max_forks_repo_name": "awvwgk/FortranTip", "max_forks_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_forks_repo_licenses": ["Unlicense"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 27.84375, "max_line_length": 64, "alphanum_fraction": 0.595959596, "num_tokens": 297, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.46879062662624377, "lm_q2_score": 0.1480472055495773, "lm_q1q2_score": 0.06940314225985066}}
{"text": "! ###################################################################\n! Copyright (c) 2013-2020, Marc De Graef Research Group/Carnegie Mellon University\n! All rights reserved.\n!\n! Redistribution and use in source and binary forms, with or without modification, are \n! permitted provided that the following conditions are met:\n!\n! - Redistributions of source code must retain the above copyright notice, this list \n! of conditions and the following disclaimer.\n! - Redistributions in binary form must reproduce the above copyright notice, this \n! list of conditions and the following disclaimer in the documentation and/or \n! other materials provided with the distribution.\n! - Neither the names of Marc De Graef, Carnegie Mellon University nor the names \n! of its contributors may be used to endorse or promote products derived from \n! this software without specific prior written permission.\n!\n! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \n! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE \n! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE \n! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL \n! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR \n! SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER \n! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, \n! OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE \n! USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n! ###################################################################\n\n!--------------------------------------------------------------------------\n! EMsoft:EMxtalExtract.f90\n!--------------------------------------------------------------------------\n!\n! PROGRAM: EMmkxtalExtract \n!\n!> @author Marc De Graef, Carnegie Mellon University\n!\n!> @brief extract information from a crystal structure file and put in txt file for input redirect\n!\n!> @date 07/19/18 MDG 1.0 original\n!--------------------------------------------------------------------------\nprogram EMxtalExtract\n\nuse local\nuse typedefs\nuse HDFsupport\nuse io\nuse crystal\nuse symmetry\nuse files\n\nIMPLICIT NONE\n\ntype(unitcell) :: cell\ncharacter(fnlen) :: progname, progdesc, fname, txtname\ninteger(kind=irg) :: numarg, i, io_int(3)\nreal(kind=dbl) :: io_real(5)\ninteger(kind=irg) :: iargc !< external function for command line\ncharacter(fnlen) :: arg !< to be read from the command line\n\n!> numbers of the space groups with two settings\ninteger(kind=irg),parameter :: tworig(24)=(/48,50,59,68,70,85,86,88,125,126,129,130,133,134,137,138,&\n 141,142,201,203,222,224,227,228/)\n\n\n !nullify(cell) \n !allocate(cell) \n\n progname = 'EMxtalExtract.f90'\n progdesc = 'Extract all information from an HDF crystal structure file and dump it in regular or Wyckoff form to a text file'\n\n! deal with the command line arguments, if any\n call Interpret_Program_Arguments(1,(/ 926 /), progname)\n\n call EMsoft(progname, progdesc)\n \n numarg = iargc()\n if (numarg.gt.0) then ! there is at least one argument\n do i=1,numarg\n call getarg(i,arg)\n! does the argument start with a '-' character? \n if (arg(1:1).eq.'-') then\n if (trim(arg).eq.'-h') then\n call Message(' Program should be called as follows: ', frm = \"(/A)\")\n call Message(' '//trim(progname)//' [-h] ', frm = \"(A)\")\n call Message(' To produce this message, type '//trim(progname)//' -h', frm = \"(A)\")\n end if\n end if\n end do\n end if\n\n call ReadValue('Enter input xtal file name (*.xtal) ', fname)\n cell%fname = trim(fname)\n call CrystalData(cell,verbose=.TRUE.)\n call CalcPositions(cell,'v')\n \n call ReadValue('Enter text file name for output (*.txt) ', txtname)\n open (unit=dataunit, file=trim(txtname), status='unknown',form='formatted')\n\n! 1. write the crystal system\n if (cell%SG%SYM_trigonal.eqv..TRUE.) then\n write(dataunit,\"(I1)\") 5\n if (cell%xtal_system.eq.4) then\n write(dataunit,\"(I1)\") 1\n else\n write(dataunit,\"(I1)\") 0\n end if\n else\n write(dataunit,\"(I1)\") cell%xtal_system\n end if\n\n! 2. lattice parameters (only the ones that are needed)\n! a is always needed\n write(dataunit,\"(F10.5)\") cell%a\n select case (cell%xtal_system)\n case (1)\n ! tetragonal\n case (2)\n write(dataunit,\"(F10.5)\") cell%c\n ! orthorhombic\n case (3)\n write(dataunit,\"(F10.5)\") cell%b\n write(dataunit,\"(F10.5)\") cell%c\n ! hexagonal\n case (4)\n write(dataunit,\"(F10.5)\") cell%c\n ! rhombohedral \n case (5)\n write(dataunit,\"(F10.5)\") cell%alpha\n ! monoclinic \n case (6)\n write(dataunit,\"(F10.5)\") cell%b\n write(dataunit,\"(F10.5)\") cell%c\n write(dataunit,\"(F10.5)\") cell%beta\n ! triclinic \n case (7) \n write(dataunit,\"(F10.5)\") cell%b\n write(dataunit,\"(F10.5)\") cell%c\n write(dataunit,\"(F10.5)\") cell%alpha\n write(dataunit,\"(F10.5)\") cell%beta\n write(dataunit,\"(F10.5)\") cell%gamma\n end select\n\n! 3. space group number\n write(dataunit,\"(I3)\") cell%SYM_SGnum\n\n! 4. some space groups have a second setting\n if (minval(tworig-cell%SYM_SGnum).eq.0) then \n write(dataunit,\"(I3)\") cell%SYM_SGset\n end if\n\n! 5. the atom coordinates, site occupations, and Debye-Waller factors are output here...\n do i=1,cell%ATOM_ntype\n if (i.gt.1) write(dataunit,\"('y')\")\n write(dataunit,\"(I2)\") cell%ATOM_type(i)\n write(dataunit,\"(4(F10.5,','),F10.5)\") cell%ATOM_pos(i,1:5)\n end do\n write(dataunit,\"('n')\")\n\n! 6. xtal file name\n write(dataunit,\"(A)\") trim(cell%fname)\n\n! 7. source, if defined\n if (trim(cell%source).eq.'undefined') then\n write(dataunit,\"(A)\") ''''''\n call Message('')\n call Message('=========================')\n call Message('The current version of the structure file has an empty Source field.')\n call Message('Please edit the text file and add a citation describing where the structure data comes from (max 512 characters).')\n call Message('=========================')\n call Message('')\n else\n write(dataunit,\"('''',A,'''')\") trim(cell%source)\n end if \n\n close(unit=dataunit,status='keep')\n\n call Message('')\n call Message('The text output file '//trim(fname)//' has been created.')\n call Message('You can edit this file with a text editor to make corrections,')\n call Message('or to add a Source string on the last line (if not already present) between single quotes') \n call Message('Then, use the following command to update the actual structure file:')\n call Message('')\n call Message('EMmkxtal < '//trim(txtname))\n call Message('')\n\nend program EMxtalExtract\n", "meta": {"hexsha": "aa1b3b252a020ec91485588f4e36563da00093e9", "size": 6924, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Source/Utilities/EMxtalExtract.f90", "max_stars_repo_name": "hwagit/EMsoft", "max_stars_repo_head_hexsha": "cfd93d7cb5d83f44a865b9f62a6515d588180a21", "max_stars_repo_licenses": ["Intel", "BSD-3-Clause", "MIT-CMU", "Unlicense"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Source/Utilities/EMxtalExtract.f90", "max_issues_repo_name": "hwagit/EMsoft", "max_issues_repo_head_hexsha": "cfd93d7cb5d83f44a865b9f62a6515d588180a21", "max_issues_repo_licenses": ["Intel", "BSD-3-Clause", "MIT-CMU", "Unlicense"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Source/Utilities/EMxtalExtract.f90", "max_forks_repo_name": "hwagit/EMsoft", "max_forks_repo_head_hexsha": "cfd93d7cb5d83f44a865b9f62a6515d588180a21", "max_forks_repo_licenses": ["Intel", "BSD-3-Clause", "MIT-CMU", "Unlicense"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 37.0267379679, "max_line_length": 132, "alphanum_fraction": 0.6337377239, "num_tokens": 1787, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.41869690935568665, "lm_q2_score": 0.16451646699291614, "lm_q1q2_score": 0.06888253626805083}}
{"text": "C******************************************************************************\nC FILE: omp_bug1.f\nC DESCRIPTION:\nC This example attempts to show use of the PARALLEL DO construct. However\nC it will generate errors at compile time. Try to determine what is causing\nC the error. See omp_bug1fix.f for a corrected version.\nC AUTHOR: Blaise Barney 5/99\nC LAST REVISED: \nC******************************************************************************\n\n PROGRAM WORKSHARE3\n\n INTEGER TID, OMP_GET_THREAD_NUM, N, I, CHUNKSIZE, CHUNK\n PARAMETER (N=50)\n PARAMETER (CHUNKSIZE=5) \n REAL A(N), B(N), C(N)\n\n! Some initializations\n DO I = 1, N\n A(I) = I * 1.0\n B(I) = A(I)\n ENDDO\n CHUNK = CHUNKSIZE\n \n!$OMP PARALLEL DO SHARED(A,B,C,CHUNK) \n!$OMP& PRIVATE(I,TID) \n!$OMP& SCHEDULE(STATIC,CHUNK)\n\n TID = OMP_GET_THREAD_NUM()\n DO I = 1, N\n C(I) = A(I) + B(I)\n PRINT *,'TID= ',TID,'I= ',I,'C(I)= ',C(I)\n ENDDO\n\n!$OMP END PARALLEL DO\n\n END\n\n", "meta": {"hexsha": "eeb618def6c777d03ec357401d481dd9451cf045", "size": 1037, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "openmp/code_examples/Fortran/omp_bug1.f", "max_stars_repo_name": "davidleitw/HPC-Tutorials", "max_stars_repo_head_hexsha": "98a9ecdfde322950cc18710091b247a67998840b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 93, "max_stars_repo_stars_event_min_datetime": "2021-03-15T20:40:09.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T08:57:40.000Z", "max_issues_repo_path": "openmp/code_examples/Fortran/omp_bug1.f", "max_issues_repo_name": "davidleitw/HPC-Tutorials", "max_issues_repo_head_hexsha": "98a9ecdfde322950cc18710091b247a67998840b", "max_issues_repo_licenses": ["MIT"], "max_issues_count": 6, "max_issues_repo_issues_event_min_datetime": "2021-05-14T04:55:45.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-29T16:33:20.000Z", "max_forks_repo_path": "openmp/code_examples/Fortran/omp_bug1.f", "max_forks_repo_name": "davidleitw/HPC-Tutorials", "max_forks_repo_head_hexsha": "98a9ecdfde322950cc18710091b247a67998840b", "max_forks_repo_licenses": ["MIT"], "max_forks_count": 63, "max_forks_repo_forks_event_min_datetime": "2021-03-10T00:31:09.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T13:48:30.000Z", "avg_line_length": 26.5897435897, "max_line_length": 79, "alphanum_fraction": 0.4985535198, "num_tokens": 300, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.41869689484852374, "lm_q2_score": 0.16451646904109268, "lm_q1q2_score": 0.0688825347389488}}
{"text": "!-----------------------------------------------------------------------\n!\n! Copyright (c) 2016 Tom L. Underwood\n!\n! Permission is hereby granted, free of charge, to any person obtaining \n! a copy of this software and associated documentation files (the \n! \"Software\"), to deal in the Software without restriction, including \n! without limitation the rights to use, copy, modify, merge, publish, \n! distribute, sublicense, and/or sell copies of the Software, and to \n! permit persons to whom the Software is furnished to do so, subject to\n! the following conditions:\n! \n! The above copyright notice and this permission notice shall be \n! included in all copies or substantial portions of the Software.\n! \n! THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n! EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n! NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS \n! BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN \n! ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN \n! CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \n! SOFTWARE.\n!\n!-----------------------------------------------------------------------\n!\n! By extracting lines beginning with the regular expression '\\!\\! ?'\n! (ignoring leading whitespace), and then removing matches to the\n! regular expression, html documentation corresponding to this \n! source code will be created.\n!\n!! <html>\n!! <head>\n!! <title> rng_mod Documentation </title>\n!! </head>\n!! <body>\n!! \n!! <h1> <code>rng_mod</code> Documentation </h1>\n!!\n!! <h2> Author </h2>\n!! <p> Tom Underwood </p>\n!!\n!! <h2> Description </h2>\n!! <p>\n!! <code>rng_mod</code> is a module which contains procedures for\n!! generating random numbers by the Mersenne twister MT19937 algorithm\n!! by acting as a wrapper for 'mt95.f90'), as well as a number of \n!! other useful random-number-related procedures.\n!! </p>\n!!\nmodule rng_mod\n\n !! <h2> Dependencies </h2>\n !! <p> \n !! <ul>\n !! <li> <code> kinds_mod </code> </li>\n !! <li> <code> mt95 </code> </li>\n !! </ul>\n !! </p>\n use kinds_mod\n use mt95\n\n implicit none\n\ncontains\n\n !! <h2> Procedures </h2>\n\n !! <h3> <code> subroutine init_random_seed() </code> </h3>\n !! <p>\n !! <code> init_random_seed </code> initialises the random number generator\n !! using the (optional) integer seed specified in the argument. If there is\n !! no argument then a random seed is used - which is taken from the system\n !! clock.\n !! </p>\n !! <table border=\"1\">\n !! <tr>\n !! <td> <b> Argument </b> </td>\n !! <td> <b> Type </b> </td>\n !! <td> <b> Description </b> </td>\n !! </tr>\n !! <tr>\n !! <td> <code> seed </code> </td>\n !! <td> <code> integer, intent(in), optional </code> </td>\n !! <td> A specific seed for the random number generator. </td>\n !! </tr>\n !! </table>\n subroutine init_random_seed(seed)\n integer, intent(in), optional :: seed\n integer :: clock\n if(present(seed)) then\n call genrand_init(seed)\n else\n call system_clock(count=clock)\n call genrand_init(clock)\n end if\n end subroutine init_random_seed\n\n\n\n !! <h3> <code> function get_random_number() </code> </h3>\n !! <p>\n !! <code> get_random_number </code> generates a random number between\n !! 0 and 1. We emphasise that this number may be 0, but not 1.\n !! </p>\n !! <p><b>Returns:</b> <code> real(rk) </code> </p>\n function get_random_number()\n real(rk) :: get_random_number\n\n call genrand_real2(get_random_number)\n\n end function get_random_number\n\n \n\n !! <h3> <code> function top_hat_rand(L) </code> </h3>\n !! <p>\n !! <code> top_hat_rand </code> generates a random number between\n !! <code>-L</code> and <code>L</code>, where <code>L>0</code>.\n !! </p>\n !! <table border=\"1\">\n !! <tr>\n !! <td> <b> Argument </b> </td>\n !! <td> <b> Type </b> </td>\n !! <td> <b> Description </b> </td>\n !! </tr>\n !! <tr>\n !! <td> <code> L </code> </td>\n !! <td> <code> real(rk), intent(in) </code> </td>\n !! <td> \n !! The highest magnitude of random number generated by the\n !! function.\n !! </td>\n !! </tr>\n !! </table>\n !! <p><b>Returns:</b> <code> real(rk) </code> </p>\n function top_hat_rand(L)\n real(rk), intent(in) :: L\n real(rk) :: top_hat_rand\n top_hat_rand=(2.0_rk*get_random_number()-1.0_rk)*L\n end function top_hat_rand\n\n\n !! <h3> <code> function bag_array(nspec) </code> </h3>\n !! <p>\n !! This function returns a random array with the specified number of occurences of the numbers 1, 2, ...\n !! Its name reflects the fact that the array reflects drawing at random balls of various types from\n !! a 'bag' containing the specified number of each type of ball.\n !! </p>\n !! <table border=\"1\">\n !! <tr>\n !! <td> <b> Argument </b> </td>\n !! <td> <b> Type </b> </td>\n !! <td> <b> Description </b> </td>\n !! </tr>\n !! <tr>\n !! <td> <code> nspec </code> </td>\n !! <td> <code> integer(ik), dimension(:), allocatable, intent(in) </code> </td>\n !! <td> \n !! Array containing the number of occurences of each number to occur in the returned array:\n !! <code>nspec(1)</code> is the number of times 1 should occur; <code>nspec(2)</code> is the number\n !! of times 2 should occur; etc. E.g. <code>nspec=</code>\n !! This array should have 1 as its first index.\n !! </td>\n !! </tr>\n !! </table>\n !! <p><b>Returns:</b> <code> integer(ik), dimension(:), allocatable </code> </p>\n function bag_array(nspec)\n integer(ik), dimension(:), intent(in) :: nspec\n integer(ik), dimension(:), allocatable :: bag_array\n ! The total number of elements in the array to return\n integer(ik) :: nelem\n ! The total number of species to consider\n integer(ik) :: totspec\n ! The total number of elements left to assign.\n integer(ik) :: nleft\n ! An array containing the number of elements left to assign for each species\n integer(ik), dimension(size(nspec)) :: nleftspec\n ! Unimportant variables\n integer(ik) :: i,n\n real(rk) :: cutoff, rand\n\n nleftspec=nspec\n totspec=size(nspec)\n nelem=sum(nspec)\n allocate(bag_array(nelem))\n bag_array=0 ! For error trapping\n\n ! Assign the species\n nleft=nelem\n do n=1,nelem\n ! Get a random number\n rand=get_random_number()\n\n ! Decide which species it corresponds to. If rand<nleftspec(1)/nleft, then we choose\n ! species 1; if nleftspec(1)/nleft<=rand<(nleftspec(1)+nleftspec(2))/nleft then we choose\n ! species 2; etc.\n cutoff=0\n do i=1,totspec\n cutoff=cutoff+(1.0_rk*nleftspec(i))/nleft\n if(rand<cutoff) then\n bag_array(n)=i\n ! Update nleft and nleftspec\n nleft=nleft-1\n nleftspec(i)=nleftspec(i)-1\n exit\n end if\n end do\n \n end do\n end function bag_array\n\n\n\n\nend module rng_mod\n!!\n!! </body>\n!! </html>\n", "meta": {"hexsha": "65be6d087ffa4ac814ae7ac14a65896e6e68dad0", "size": 6972, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "rng_mod.f95", "max_stars_repo_name": "tomlunderwood/monteswitch", "max_stars_repo_head_hexsha": "1dd95dd46c0a1301fb4e520d2024e9b70bc71958", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "max_stars_repo_stars_event_min_datetime": "2015-03-23T14:59:00.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-27T16:46:25.000Z", "max_issues_repo_path": "rng_mod.f95", "max_issues_repo_name": "tomlunderwood/monteswitch", "max_issues_repo_head_hexsha": "1dd95dd46c0a1301fb4e520d2024e9b70bc71958", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "rng_mod.f95", "max_forks_repo_name": "tomlunderwood/monteswitch", "max_forks_repo_head_hexsha": "1dd95dd46c0a1301fb4e520d2024e9b70bc71958", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 31.6909090909, "max_line_length": 106, "alphanum_fraction": 0.6123063683, "num_tokens": 2047, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.411110869232168, "lm_q2_score": 0.16667540882736176, "lm_q1q2_score": 0.06852207220264366}}
{"text": "! Sourced allocation in Object-oriented programming (Metcalf et al., 2018) 15.4.4 (p.298-)\n! allocate (a, source=b) は配列bのindexの下限,上限が配列aに引き継がれる\nmodule mod_source_allocation\n implicit none\n type :: t\n integer :: x\n real :: y\n end type t\n\ncontains\n\n subroutine s_set(b)\n ! Set lower and upper bounds\n ! 次行はtype(t)でもよいが,tを拡張した型に対応できるclass(t)が汎用的\n class(t), intent(in) :: b(:) ! 形状引継ぎ仮配列 assumed-shape array\n ! 割付仮配列も可能\n ! 割付仮配列とする場合の要件:実引数も割付配列,実引数と仮引数は同一type,引用仕様明示\n ! 同一typeの条件より,仮引数をclassにするとエラーとなる\n ! type(t), intent(in), allocatable :: b(:) ! 割付仮配列 \n !!! class(t), intent(in), allocatable :: b(:) ! Error\n class(t), allocatable :: a(:)\n allocate (a(lbound(b,1):ubound(b,1)), source=b) ! 配列indexの下限と上限を指定\n print *, 's_set a=', a(:)%x, a(:)%y\n end subroutine s_set\n\n subroutine s(b)\n class(t) :: b(:)\n class(t), allocatable :: a(:)\n allocate (a, source=b) ! 配列indexの下限と上限を指定しない\n print *, 's a=', a(:)%x, a(:)%y\n end subroutine s\n\nend module mod_source_allocation\n\nprogram source_allocation\n use mod_source_allocation\n implicit none\n\n type(t), allocatable :: b(:)\n allocate(t :: b(0:1)) ! 配列indexの下限0,上限1と指定\n b(0) = t(1, 1.0)\n b(1) = t(2, 2.0)\n print *, 'b=', b%x, b%y\n ! 配列bのindexの下限,上限を組込関数lbount(),ubound()から取得\n call s_set(b)\n ! 配列indexの下限・上限は実引数から取得\n call s(b)\n\nend program source_allocation\n", "meta": {"hexsha": "c16a772bca19d30c90d7f382db66d981c6b1f68e", "size": 1600, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/oop/source_allocation.f90", "max_stars_repo_name": "jsasaki-utokyo/modern-fortran", "max_stars_repo_head_hexsha": "125a1d61fb85bdf7f8e57ee47a10dbdb75dfa17f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/oop/source_allocation.f90", "max_issues_repo_name": "jsasaki-utokyo/modern-fortran", "max_issues_repo_head_hexsha": "125a1d61fb85bdf7f8e57ee47a10dbdb75dfa17f", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/oop/source_allocation.f90", "max_forks_repo_name": "jsasaki-utokyo/modern-fortran", "max_forks_repo_head_hexsha": "125a1d61fb85bdf7f8e57ee47a10dbdb75dfa17f", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 32.0, "max_line_length": 99, "alphanum_fraction": 0.555, "num_tokens": 635, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4726834766204328, "lm_q2_score": 0.13477590873473297, "lm_q1q2_score": 0.06370634510541173}}
{"text": "program scatter \n\nimplicit none \ninclude 'mpif.h'\n\n! Defining the variables and parameters \n\n integer :: rank, size, ierr\n integer, parameter :: length = 4 \n integer, parameter :: iroot = 0\n integer, dimension(length) :: b\n integer :: sendcount, recvcount \n integer :: recv_buff, i\n\n call MPI_INIT(ierr)\n\n call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr)\n call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)\n\n if (size.lt.length) then \n print *, \"Decrease the length of the scattering array !\"\n end if \n\n if(rank.eq.iroot) then \n do i = 1, length\n b(i) = i \n end do \n end if\n\n sendcount = 1\n recvcount = sendcount\n\n call MPI_SCATTER(b, sendcount, MPI_INTEGER, &\n recv_buff, recvcount, MPI_INTEGER, &\n iroot, MPI_COMM_WORLD, ierr)\n \n\n print *, \"P(\", rank, \"): recv buffer :\", recv_buff\n\n call MPI_FINALIZE(ierr)\n\n \n\nend program \n", "meta": {"hexsha": "bac8bf33044b7cff3d76dba2d5900fe5983c5b55", "size": 1029, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "collective_communication/MPI_SCATTER/scatter.f90", "max_stars_repo_name": "skn96/MPI_examples", "max_stars_repo_head_hexsha": "0f09d76060b1ca478a01b1a8e4fac844a4dceeaa", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "collective_communication/MPI_SCATTER/scatter.f90", "max_issues_repo_name": "skn96/MPI_examples", "max_issues_repo_head_hexsha": "0f09d76060b1ca478a01b1a8e4fac844a4dceeaa", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "collective_communication/MPI_SCATTER/scatter.f90", "max_forks_repo_name": "skn96/MPI_examples", "max_forks_repo_head_hexsha": "0f09d76060b1ca478a01b1a8e4fac844a4dceeaa", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 22.8666666667, "max_line_length": 72, "alphanum_fraction": 0.5578231293, "num_tokens": 245, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.48438008427698437, "lm_q2_score": 0.12940273494909915, "lm_q1q2_score": 0.06268010766031691}}
{"text": "PROGRAM shw\n IMPLICIT NONE\n REAL (KIND =8) :: r ! Input number\n REAL (KIND=8) :: s ! Result\n\n ! Get a number from user\n WRITE(*,*) 'Input a number: '\n READ(*,*) r\n ! Calculate the sine of the number\n s = SIN(r)\n ! Write result to screen\n WRITE(*,*) 'Hello World! SINE of ', r, ' =', s\n\nEND PROGRAM shw\n", "meta": {"hexsha": "f8da5990571729c713e96a805d961d26014e2838", "size": 332, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "doc/Programs/LecturePrograms/programs/IntroProgramming/Fortran/program1.f90", "max_stars_repo_name": "kimrojas/ComputationalPhysicsMSU", "max_stars_repo_head_hexsha": "a47cfc18b3ad6adb23045b3f49fab18c0333f556", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": 220, "max_stars_repo_stars_event_min_datetime": "2016-08-25T09:18:33.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T14:09:16.000Z", "max_issues_repo_path": "doc/Programs/LecturePrograms/programs/IntroProgramming/Fortran/program1.f90", "max_issues_repo_name": "dnhdang94/ComputationalPhysicsMSU", "max_issues_repo_head_hexsha": "16990c74cf06eb5b933982137f0536d669567259", "max_issues_repo_licenses": ["CC0-1.0"], "max_issues_count": 3, "max_issues_repo_issues_event_min_datetime": "2020-01-18T10:43:38.000Z", "max_issues_repo_issues_event_max_datetime": "2020-02-08T13:15:42.000Z", "max_forks_repo_path": "doc/Programs/LecturePrograms/programs/IntroProgramming/Fortran/program1.f90", "max_forks_repo_name": "dnhdang94/ComputationalPhysicsMSU", "max_forks_repo_head_hexsha": "16990c74cf06eb5b933982137f0536d669567259", "max_forks_repo_licenses": ["CC0-1.0"], "max_forks_count": 136, "max_forks_repo_forks_event_min_datetime": "2016-08-25T09:04:56.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-12T09:54:21.000Z", "avg_line_length": 22.1333333333, "max_line_length": 48, "alphanum_fraction": 0.5602409639, "num_tokens": 115, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.37022539259558657, "lm_q2_score": 0.16451646084838673, "lm_q1q2_score": 0.06090817130603042}}
{"text": " program main\r\nC%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nC %\r\nC Copyright (C) 1996, The Board of Trustees of the Leland Stanford %\r\nC Junior University. All rights reserved. %\r\nC %\r\nC The programs in GSLIB are distributed in the hope that they will be %\r\nC useful, but WITHOUT ANY WARRANTY. No author or distributor accepts %\r\nC responsibility to anyone for the consequences of using them or for %\r\nC whether they serve any particular purpose or work at all, unless he %\r\nC says so in writing. Everyone is granted permission to copy, modify %\r\nC and redistribute the programs in GSLIB, but only under the condition %\r\nC that this notice and the above copyright notice remain intact. %\r\nC %\r\nC%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nc-----------------------------------------------------------------------\r\nc\r\nc Add Coordinates to a GSLIB Gridded File\r\nc ***************************************\r\nc\r\nc Takes a 3-D realization that is stored in the order implicit to GSLIB\r\nc grid files and adds coordinates (for transfer to other programs, error\r\nc checking, and so on)\r\nc\r\nc\r\nc\r\nc AUTHOR: Clayton V. Deutsch DATE: 1989-1999\r\nc-----------------------------------------------------------------------\r\n use msflib\r\n parameter (MAXLEN=132,MAXFIL=512,VERSION=2.907)\r\n character str*512,datafl*512,outfl*512,fmt*36,label*20\r\n logical testfl\r\n data lin/1/,lout/2/\r\nc\r\nc Note VERSION number:\r\nc\r\n write(*,9999) VERSION\r\n 9999 format(/' ADDCOORD Version: ',f5.3/)\r\nc\r\nc Get the name of the parameter file - try the default name if no input:\r\nc\r\n do i=1,512\r\n str(i:i) = ' '\r\n end do\r\n call getarg(1,str)\r\n if(str(1:1).eq.' ')then\r\n write(*,*) 'Which parameter file do you want to use?'\r\n read (*,'(a)') str\r\n end if\r\n if(str(1:1).eq.' ') str(1:20) = 'addcoord.par '\r\n inquire(file=str,exist=testfl)\r\n if(.not.testfl) then\r\n write(*,*) 'ERROR - the parameter file does not exist,'\r\n write(*,*) ' check for the file and try again '\r\n write(*,*)\r\n if(str(1:20).eq.'addcoord.par ') then\r\n write(*,*) ' creating a blank parameter file'\r\n call makepar\r\n write(*,*)\r\n end if\r\n stop\r\n endif\r\n open(lin,file=str,status='OLD')\r\nc\r\nc Find Start of Parameters:\r\nc\r\n 1 read(lin,'(a4)',end=98) str(1:4)\r\n if(str(1:4).ne.'STAR') go to 1\r\nc\r\nc Read Input Parameters:\r\nc\r\n read(lin,'(a512)',err=98) datafl\r\n call chknam(datafl,MAXFIL)\r\n write(*,*) 'Data File = ',datafl(1:40)\r\n\r\n read(lin,'(a512)',err=98) outfl\r\n call chknam(outfl,MAXFIL)\r\n write(*,*) 'Output File = ',outfl(1:40)\r\n\r\n read(lin,*,err=98) isim\r\n write(*,*) 'Realization number = ',isim\r\n\r\n read(lin,*,err=98) nx,xmn,xsiz\r\n write(*,*) 'X grid size = ',nx,xmn,xsiz\r\n\r\n read(lin,*,err=98) ny,ymn,ysiz\r\n write(*,*) 'Y grid size = ',ny,ymn,ysiz\r\n\r\n read(lin,*,err=98) nz,zmn,zsiz\r\n write(*,*) 'Z grid size = ',nz,zmn,zsiz\r\n\r\n write(*,*)\r\n close(lin)\r\nc\r\nc Format?\r\nc\r\n ix = 7\r\n xbig = max(abs(xmn),abs(xmn+real(nx-1)*xsiz))\r\n if(xbig.gt.1) ix = 6\r\n if(xbig.gt.10) ix = 5\r\n if(xbig.gt.100) ix = 4\r\n if(xbig.gt.1000) ix = 3\r\n if(xbig.gt.10000) ix = 2\r\n if(xbig.gt.100000) ix = 1\r\n if(xbig.gt.1000000) ix = 0\r\n iy = 7\r\n ybig = max(abs(ymn),abs(ymn+real(ny-1)*ysiz))\r\n if(ybig.gt.1) iy = 6\r\n if(ybig.gt.10) iy = 5\r\n if(ybig.gt.100) iy = 4\r\n if(ybig.gt.1000) iy = 3\r\n if(ybig.gt.10000) iy = 2\r\n if(ybig.gt.100000) iy = 1\r\n if(ybig.gt.1000000) iy = 0\r\n iz = 7\r\n zbig = max(abs(zmn),abs(zmn+real(nz-1)*zsiz))\r\n if(zbig.gt.1) iz = 6\r\n if(zbig.gt.10) iz = 5\r\n if(zbig.gt.100) iz = 4\r\n if(zbig.gt.1000) iz = 3\r\n if(zbig.gt.10000) iz = 2\r\n if(zbig.gt.100000) iz = 1\r\n if(zbig.gt.1000000) iz = 0\r\n write(fmt,101) ix,iy,iz\r\n 101 format('(f10.',i1,',1x,f10.',i1,',1x,f10.',i1,',1x,a)')\r\n write(*,*) 'Format: ',fmt\r\nc\r\nc Read in the data (if the file exists): \r\nc\r\n inquire(file=datafl,exist=testfl)\r\n if(.not.testfl) then\r\n write(*,*) 'ERROR - the data file does not exist,'\r\n write(*,*) ' check for the file and try again '\r\n stop\r\n endif\r\n open(lout,file=outfl,status='UNKNOWN')\r\n open(lin,file=datafl,status='OLD')\r\n read(lin,'(a)',err=99) str\r\n read(lin,*,err=99) nvari\r\n write(lout,200)\r\n 200 format('ADDCOORD Output')\r\n write(lout,201) nvari+3,nx,ny,nz\r\n 201 format(4(1x,i4))\r\n write(lout,202)\r\n 202 format('X',/,'Y',/,'Z')\r\n do i=1,nvari\r\n read(lin,'(a20)',err=99) label\r\n write(lout,'(a20)') label\r\n end do\r\nc\r\nc Get input/output files ready:\r\nc\r\nc\r\nc Get to the right realization:\r\nc\r\n do i=1,isim-1\r\n do iz=1,nz\r\n do iy=1,ny\r\n do ix=1,nx\r\n read(lin,*)\r\n end do\r\n end do\r\n end do\r\n end do\r\nc\r\nc Loop over grid\r\nc\r\n do iz=1,nz\r\n zz = zmn + real(iz-1)*zsiz\r\n do iy=1,ny\r\n yy = ymn + real(iy-1)*ysiz\r\n do ix=1,nx\r\n xx = xmn + real(ix-1)*xsiz\r\n read(lin,'(a80)') str(1:80)\r\n call strlen(str,80,lostr)\r\n write(lout,fmt) xx,yy,zz,str(1:lostr)\r\n end do\r\n end do\r\n end do\r\nc\r\nc Finished:\r\nc\r\n close(lin)\r\n close(lout)\r\n write(*,9998) VERSION\r\n 9998 format(/' ADDCOORD Version: ',f5.3, ' Finished'/)\r\n stop\r\n 98 stop ' ERROR in parameter file'\r\n 99 stop ' ERROR in data file'\r\n end\r\n\r\n\r\n\r\n subroutine makepar\r\nc-----------------------------------------------------------------------\r\nc\r\nc Write a Parameter File\r\nc **********************\r\nc\r\nc\r\nc\r\nc-----------------------------------------------------------------------\r\n lun = 99\r\n open(lun,file='addcoord.par',status='UNKNOWN')\r\n write(lun,10)\r\n 10 format(' Parameters for ADDCOORD',/,\r\n + ' ***********************',/,/,\r\n + 'START OF PARAMETERS:')\r\n\r\n write(lun,11)\r\n 11 format('sgsim.out ',\r\n + '-file with data')\r\n write(lun,12)\r\n 12 format('addcoord.out ',\r\n + '-file for output')\r\n write(lun,13)\r\n 13 format('1 ',\r\n + '-realization number')\r\n write(lun,14)\r\n 14 format('50 2.5 5.0 ',\r\n + '-nx,xmn,xsiz')\r\n write(lun,15)\r\n 15 format('50 2.5 5.0 ',\r\n + '-ny,ymn,ysiz')\r\n write(lun,16)\r\n 16 format('1 0.5 1.0 ',\r\n + '-nz,zmn,zsiz')\r\n\r\n close(lun)\r\n return\r\n end\r\n\r\n\r\n\r\n subroutine chknam(str,len)\r\nc-----------------------------------------------------------------------\r\nc\r\nc Check for a Valid File Name\r\nc ***************************\r\nc\r\nc This subroutine takes the character string \"str\" of length \"len\" and\r\nc removes all leading blanks and blanks out all characters after the\r\nc first blank found in the string (leading blanks are removed first).\r\nc\r\nc\r\nc\r\nc-----------------------------------------------------------------------\r\n parameter (MAXLEN=132)\r\n character str(MAXLEN)*1\r\nc\r\nc Remove leading blanks:\r\nc\r\n do i=1,len-1\r\n if(str(i).ne.' ') then\r\n if(i.eq.1) go to 1\r\n do j=1,len-i+1\r\n k = j + i - 1\r\n str(j) = str(k)\r\n end do\r\n do j=len,len-i+2,-1\r\n str(j) = ' '\r\n end do\r\n go to 1\r\n end if\r\n end do\r\n 1 continue\r\nc\r\nc Find first blank and blank out the remaining characters:\r\nc\r\n do i=1,len-1\r\n if(str(i).eq.' ') then\r\n do j=i+1,len\r\n str(j) = ' '\r\n end do\r\n go to 2\r\n end if\r\n end do\r\n 2 continue\r\nc\r\nc Return with modified file name:\r\nc\r\n return\r\n end\r\n\r\n\r\n\r\n subroutine strlen(str,MAXLEN,lostr)\r\nc-----------------------------------------------------------------------\r\nc\r\nc Determine the length of the string minus trailing blanks\r\nc\r\nc\r\nc\r\nc-----------------------------------------------------------------------\r\n character str*132\r\n lostr = MAXLEN\r\n do i=1,MAXLEN\r\n j = MAXLEN - i + 1\r\n if(str(j:j).ne.' ') return\r\n lostr = lostr - 1\r\n end do\r\n return\r\n end\r\n", "meta": {"hexsha": "507336464feb31b39a7275d1e969a37289d2ed16", "size": 9355, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "src/original/addcoord/addcoord.for", "max_stars_repo_name": "exepulveda/gslib2.0", "max_stars_repo_head_hexsha": "5c021000eb3da8703ced3ee9be145d6c0ecb2608", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max_stars_repo_stars_event_min_datetime": "2021-07-09T06:03:38.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-20T11:11:19.000Z", "max_issues_repo_path": "src/original/addcoord/addcoord.for", "max_issues_repo_name": "exepulveda/gslib2.0", "max_issues_repo_head_hexsha": "5c021000eb3da8703ced3ee9be145d6c0ecb2608", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/original/addcoord/addcoord.for", "max_forks_repo_name": "exepulveda/gslib2.0", "max_forks_repo_head_hexsha": "5c021000eb3da8703ced3ee9be145d6c0ecb2608", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 30.7730263158, "max_line_length": 73, "alphanum_fraction": 0.4309994655, "num_tokens": 2534, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4687906266262437, "lm_q2_score": 0.1276526286405008, "lm_q1q2_score": 0.05984235577086756}}
{"text": "PROGRAM outputdata\n IMPLICIT NONE\n\n REAL, DIMENSION(100) :: x, y\n INTEGER :: i\n CHARACTER (len=200) :: text\n CHARACTER (len=10) :: postfix\n postfix = '.txt'\n text = 'I HOPE U CAN UNDERSTAND, THE SPACE IS VERY LIMITED, SO U NeeD TO BE MAKE GOOD USE OF IT'\n OPEN(9, file = 'secrets'//postfix, status = 'new')\n\n WRITE (9,*) text\n CLOSE(9)\n\n DO i = 1, 100\n x(i) = 0.1 * i\n y(i) = SIN(x(i))\n END DO\n\n !output data into a file\n OPEN(1, file = 'data1.dat',status = 'new')\n DO i = 1, 100\n WRITE (1,*) x(i), y(i)\n END DO\n\n CLOSE(1)\n\nEND PROGRAM outputdata\n", "meta": {"hexsha": "a2b9c371f794b2aa501dbada0653512c9de5cc3f", "size": 592, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "basics/IO/open.f90", "max_stars_repo_name": "ComplicatedPhenomenon/Fortran_Takeoff", "max_stars_repo_head_hexsha": "a13180050367e59a91973af96ab680c2b76097be", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "basics/IO/open.f90", "max_issues_repo_name": "ComplicatedPhenomenon/Fortran_Takeoff", "max_issues_repo_head_hexsha": "a13180050367e59a91973af96ab680c2b76097be", "max_issues_repo_licenses": ["BSD-3-Clause"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "basics/IO/open.f90", "max_forks_repo_name": "ComplicatedPhenomenon/Fortran_Takeoff", "max_forks_repo_head_hexsha": "a13180050367e59a91973af96ab680c2b76097be", "max_forks_repo_licenses": ["BSD-3-Clause"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 20.4137931034, "max_line_length": 98, "alphanum_fraction": 0.5743243243, "num_tokens": 217, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.48828339529583464, "lm_q2_score": 0.12252321251815919, "lm_q1q2_score": 0.05982605021091988}}
{"text": "! from http://calcul.math.cnrs.fr/Documents/Ecoles/2010/f2py-cours.pdf\n! Pierre Navaro\n\n! cette fonction appelle une fonction python\n\nsubroutine sommef(f, n, s)\n ! Calcule la somme (f(i), i=1,n)\n external f\n integer, intent(in) :: n\n real, intent(out) :: s\n s = 0.0\n do i = 1, n\n s = s + f(i)\n end do\nend subroutine sommef\n", "meta": {"hexsha": "1c028ddc329eb185a410c03d63709809c84d8451", "size": 351, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "sandbox/fortranpython/navaro/callpy.f90", "max_stars_repo_name": "rboman/progs", "max_stars_repo_head_hexsha": "c60b4e0487d01ccd007bcba79d1548ebe1685655", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 2, "max_stars_repo_stars_event_min_datetime": "2021-12-12T13:26:06.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-03T16:14:53.000Z", "max_issues_repo_path": "sandbox/fortranpython/navaro/callpy.f90", "max_issues_repo_name": "rboman/progs", "max_issues_repo_head_hexsha": "c60b4e0487d01ccd007bcba79d1548ebe1685655", "max_issues_repo_licenses": ["Apache-2.0"], "max_issues_count": 5, "max_issues_repo_issues_event_min_datetime": "2019-03-01T07:08:46.000Z", "max_issues_repo_issues_event_max_datetime": "2019-04-28T07:32:42.000Z", "max_forks_repo_path": "sandbox/fortranpython/navaro/callpy.f90", "max_forks_repo_name": "rboman/progs", "max_forks_repo_head_hexsha": "c60b4e0487d01ccd007bcba79d1548ebe1685655", "max_forks_repo_licenses": ["Apache-2.0"], "max_forks_count": 2, "max_forks_repo_forks_event_min_datetime": "2017-12-13T13:13:52.000Z", "max_forks_repo_forks_event_max_datetime": "2019-03-13T20:08:15.000Z", "avg_line_length": 21.9375, "max_line_length": 70, "alphanum_fraction": 0.6182336182, "num_tokens": 120, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.4882833952958347, "lm_q2_score": 0.11757214436736563, "lm_q1q2_score": 0.05740852584390933}}
{"text": " program reverse_string\n implicit none\n character (80) :: cadena\n integer :: k, n\n !\n cadena = \"abcdefgh\"\n n = len_trim (cadena)\n !\n write (*,*) cadena\n forall (k=1:n) cadena (k:k) = cadena (n-k+1:n-k+1)\n write (*,*) cadena\n !\nend program reverse_string\n", "meta": {"hexsha": "a9c174df497df07b21c362598ca18989884b95b4", "size": 265, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "Task/Reverse-a-string/Fortran/reverse-a-string-3.f", "max_stars_repo_name": "LaudateCorpus1/RosettaCodeData", "max_stars_repo_head_hexsha": "9ad63ea473a958506c041077f1d810c0c7c8c18d", "max_stars_repo_licenses": ["Info-ZIP"], "max_stars_count": 1, "max_stars_repo_stars_event_min_datetime": "2021-05-05T13:42:20.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-05T13:42:20.000Z", "max_issues_repo_path": "Task/Reverse-a-string/Fortran/reverse-a-string-3.f", "max_issues_repo_name": "seanwallawalla-forks/RosettaCodeData", "max_issues_repo_head_hexsha": "9ad63ea473a958506c041077f1d810c0c7c8c18d", "max_issues_repo_licenses": ["Info-ZIP"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Task/Reverse-a-string/Fortran/reverse-a-string-3.f", "max_forks_repo_name": "seanwallawalla-forks/RosettaCodeData", "max_forks_repo_head_hexsha": "9ad63ea473a958506c041077f1d810c0c7c8c18d", "max_forks_repo_licenses": ["Info-ZIP"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 18.9285714286, "max_line_length": 52, "alphanum_fraction": 0.6150943396, "num_tokens": 87, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.49218813572079556, "lm_q2_score": 0.11596072741941772, "lm_q1q2_score": 0.05707449424539055}}
{"text": " program main\r\nC%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nC %\r\nC Copyright (C) 1996, The Board of Trustees of the Leland Stanford %\r\nC Junior University. All rights reserved. %\r\nC %\r\nC The programs in GSLIB are distributed in the hope that they will be %\r\nC useful, but WITHOUT ANY WARRANTY. No author or distributor accepts %\r\nC responsibility to anyone for the consequences of using them or for %\r\nC whether they serve any particular purpose or work at all, unless he %\r\nC says so in writing. Everyone is granted permission to copy, modify %\r\nC and redistribute the programs in GSLIB, but only under the condition %\r\nC that this notice and the above copyright notice remain intact. %\r\nC %\r\nC%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nc-----------------------------------------------------------------------\r\nc\r\nc Plot Variograms\r\nc ***************\r\nc\r\nc New version requires a parameter file (created if none given the first\r\nc time the program is run)\r\nc\r\nc\r\nc\r\nc AUTHOR: Clayton V. Deutsch DATE: 1989-1999\r\nc-----------------------------------------------------------------------\r\n use msflib\r\n parameter (MAXLAG=5001,BIGNUM=1.0e21,EPSLON=1.0e-5,MAXCAT=24,\r\n + VERSION=2.905)\r\n\r\n integer redint(MAXCAT),grnint(MAXCAT),bluint(MAXCAT),test\r\n character outfl*512,title*40,str*512\r\n real xx(MAXLAG),yy(MAXLAG)\r\n logical testfl\r\nc\r\nc Declare dynamic arrays:\r\nc\r\n character*512,allocatable :: datafl(:)\r\n real,allocatable :: ar1(:,:),ar2(:,:)\r\n integer,allocatable :: ivar(:),idash(:),ipts(:),iline(:),\r\n + nlag(:),iclr(:)\r\nc\r\nc Common variables for Postscript Plotting:\r\nc\r\n common /psdata/ lpsout,pscl,pxmin,pxmax,pymin,pymax,xmin,\r\n + xmax,ymin,ymax\r\n common /olddat/ xvmn,xvmx,yvmn,yvmx\r\nc\r\nc Hardcoded categorical colors:\r\nc\r\n data redint/255,255,255,127, 0, 0, 0,255,255,0,127,170,\r\n + 255, 0,200,9*255/,\r\n + grnint/ 0,127,255,255,255,255, 0, 0,255,0, 0, 85,\r\n + 85,255,200,9* 0/,\r\n + bluint/ 0, 0, 0, 0, 0,255,255,255,255,0,255, 0,\r\n + 170,127,200,9*255/\r\nc\r\nc Hardwire many of the plot parameters:\r\nc\r\n data lin/1/,lpsout/2/,pscl/0.24/,pxmin/0.0/,pxmax/288.0/\r\n + pymin/0.0/,pymax/216.0/,xmin/-10.0/,xmax/60.0/,\r\n + ymin/-10.0/,ymax/60.0/,vpxmin/1.0/,vpxmax/59.5/,\r\n + vpymin/0.0/,vpymax/58.0/\r\nc\r\nc Note VERSION number:\r\nc\r\n write(*,9999) VERSION\r\n 9999 format(/' VARGPLT Version: ',f5.3/)\r\nc\r\nc Get the name of the parameter file - try the default name if no input:\r\nc\r\n do i=1,512\r\n str(i:i) = ' '\r\n end do\r\n call getarg(1,str)\r\n if(str(1:1).eq.' ')then\r\n write(*,*) 'Which parameter file do you want to use?'\r\n read (*,'(a)') str\r\n end if\r\n if(str(1:1).eq.' ') str(1:20) = 'vargplt.par '\r\n inquire(file=str,exist=testfl)\r\n if(.not.testfl) then\r\n write(*,*) 'ERROR - the parameter file does not exist,'\r\n write(*,*) ' check for the file and try again '\r\n write(*,*)\r\n if(str(1:20).eq.'vargplt.par ') then\r\n write(*,*) ' creating a blank parameter file'\r\n call makepar\r\n write(*,*)\r\n end if\r\n stop\r\n endif\r\n open(lin,file=str,status='OLD')\r\nc\r\nc Find Start of Parameters:\r\nc\r\n 1 read(lin,'(a4)',end=98) str(1:4)\r\n if(str(1:4).ne.'STAR') go to 1\r\nc\r\nc Read Input Parameters:\r\nc\r\n read(lin,'(a512)',err=98) outfl\r\n call chknam(outfl,512)\r\n write(*,*) ' output file = ',outfl(1:40)\r\n\r\n read(lin,*,err=98) nvar\r\n write(*,*) ' number of variograms = ',nvar\r\nc\r\nc Read needed parameters:\r\nc \r\n MAXVAR = nvar\r\nc\r\nc Allocate the needed memory:\r\nc1\r\n allocate(datafl(MAXVAR),stat = test)\r\n if(test.ne.0)then\r\n write(*,*)'ERROR: Allocation failed due to',\r\n + ' insufficient memory.'\r\n stop\r\n end if\r\nc2\r\n allocate(ar1(MAXVAR,MAXLAG),stat = test)\r\n if(test.ne.0)then\r\n write(*,*)'ERROR: Allocation failed due to',\r\n + ' insufficient memory.'\r\n stop\r\n end if\r\nc3\r\n allocate(ar2(MAXVAR,MAXLAG),stat = test)\r\n if(test.ne.0)then\r\n write(*,*)'ERROR: Allocation failed due to',\r\n + ' insufficient memory.'\r\n stop\r\n end if\r\nc4\r\n allocate(ivar(MAXVAR),stat = test)\r\n if(test.ne.0)then\r\n write(*,*)'ERROR: Allocation failed due to',\r\n + ' insufficient memory.'\r\n stop\r\n end if\r\nc5\r\n allocate(idash(MAXVAR),stat = test)\r\n if(test.ne.0)then\r\n write(*,*)'ERROR: Allocation failed due to',\r\n + ' insufficient memory.'\r\n stop\r\n end if\r\nc6\r\n allocate(ipts(MAXVAR),stat = test)\r\n if(test.ne.0)then\r\n write(*,*)'ERROR: Allocation failed due to',\r\n + ' insufficient memory.'\r\n stop\r\n end if\r\nc7\r\n allocate(iline(MAXVAR),stat = test)\r\n if(test.ne.0)then\r\n write(*,*)'ERROR: Allocation failed due to',\r\n + ' insufficient memory.'\r\n stop\r\n end if\r\nc8\r\n allocate(nlag(MAXVAR),stat = test)\r\n if(test.ne.0)then\r\n write(*,*)'ERROR: Allocation failed due to',\r\n + ' insufficient memory.'\r\n stop\r\n end if\r\nc9\r\n allocate(iclr(MAXVAR),stat = test)\r\n if(test.ne.0)then\r\n write(*,*)'ERROR: Allocation failed due to',\r\n + ' insufficient memory.'\r\n stop\r\n end if\r\nc \r\n\r\n read(lin,*,err=98) dmin,dmax\r\n write(*,*) ' distance limits = ',dmin,dmax\r\n\r\n read(lin,*,err=98) gmin,gmax\r\n write(*,*) ' variogram limits = ',gmin,gmax\r\n\r\n read(lin,*,err=98) isill,sillval\r\n write(*,*) ' plot sill, sill value = ',isill,sillval\r\n\r\n read(lin,'(a40)') title\r\n call chktitle(title,40)\r\n write(*,*) ' title = ',title\r\n\r\n do i=1,nvar\r\n read(lin,'(a512)') datafl(i)\r\n call chknam(datafl(i),512)\r\n write(*,*) ' data file ',i,' = ',datafl(i)\r\n read(lin,*) ivar(i),idash(i),ipts(i),iline(i),iclr(i)\r\n write(*,*) ' parameters ',\r\n + ivar(i),idash(i),ipts(i),iline(i),iclr(i)\r\n end do\r\n close(lin)\r\nc\r\nc Read the variograms:\r\nc\r\n do iii=1,nvar\r\nc\r\nc Find the right variogram:\r\nc\r\n write(*,*) ' working on variogram ',iii\r\n write(*,*) ' trying to open ',datafl(iii)\r\n open(lin,file=datafl(iii))\r\n write(*,*) ' opened ',datafl(iii)\r\n read(lin,'(a80)') str\r\n do jjj=1,ivar(iii)-1\r\n do jj3=1,1000\r\n read(lin,'(a80)') str\r\n if(str(1:1).ne.' ') go to 333\r\n end do\r\n 333 continue\r\n end do\r\nc\r\nc Read the variogram:\r\nc\r\n np = 0\r\n do jjj=1,MAXLAG\r\n read(lin,'(a80)',end=334) str\r\n if(str(1:1).ne.' ') go to 334\r\n backspace lin\r\n np = np + 1\r\n read(lin,*,err=334,end=334) iiii,ar1(iii,np),ar2(iii,np)\r\n if(ar1(iii,np).lt.0.0001) np = np - 1\r\n end do\r\n 334 continue\r\n nlag(iii) = np\r\n close(lin)\r\nc\r\nc Finish reading all variograms:\r\nc\r\n end do\r\nc\r\nc Establish data-based limits to distance and variogram:\r\nc\r\n dbdmin = 1.0e21\r\n dbdmax = -1.0e21\r\n dbvmin = 1.0e21\r\n dbvmax = -1.0e21\r\n do i=1,nvar\r\n do j=1,nlag(i)\r\n if(ar1(i,j).lt.dbdmin) dbdmin = ar1(i,j)\r\n if(ar1(i,j).gt.dbdmax) dbdmax = ar1(i,j)\r\n if(ar2(i,j).lt.dbvmin) dbvmin = ar2(i,j)\r\n if(ar2(i,j).gt.dbvmax) dbvmax = ar2(i,j)\r\n end do\r\n end do\r\n if(dmax.le.dmin) then\r\n dmin = 0.0\r\n dmax = dbdmax\r\n end if\r\n if(gmax.le.gmin) then\r\n gmin = dbvmin\r\n gmax = dbvmax\r\n end if\r\n xvmin = dmin\r\n xvmax = dmax\r\n yvmin = gmin\r\n yvmax = gmax\r\nc\r\nc Write the variograms:\r\nc\r\n open(lpsout,file=outfl,status='UNKNOWN')\r\n write(lpsout,998)\r\n 998 format('%!PS % Remove ',\r\n + /, '90 234 translate 1.5 1.5 scale % these lines ',\r\n + /, ' % for EPSF file ',\r\n + /, '%!PS-Adobe-3.0 EPSF-3.0',\r\n + /, '%%BoundingBox: 0 0 288 216',\r\n + /, '%%Creator: GSLIB',\r\n + /, '%%Title: ',\r\n + /, '%%CreationDate: ',\r\n + /, '%%EndComments',/,/,/,'%',/,'%',/,'%',/,\r\n + /, '/m {moveto} def /l {lineto} def /r {rlineto} def',\r\n + /, '/s {stroke} def /n {newpath} def /c {closepath} def',\r\n + /, '/rtext{ dup stringwidth pop -1 div 0 rmoveto show } def',\r\n + /, '/ctext{ dup stringwidth pop -2 div 0 rmoveto show } def',\r\n + /, '/ltext{show} def /gr{grestore} def /gs{gsave} def',\r\n + /, '/tr{translate} def /setc{setrgbcolor} def',\r\n + /, '/bullet{ 8 0 360 arc c fill } def',/,/,\r\n + /, '%72 72 translate',/,/,\r\n + /, '0.240000 0.240000 scale')\r\nc\r\nc Draw and scale axes:\r\nc\r\n ts = 7.5\r\n xvmn = xvmin\r\n xvmx = xvmax\r\n yvmn = yvmin\r\n yvmx = yvmax\r\n write(lpsout,100)\r\n 100 format('gsave /Symbol findfont 100 scalefont setfont ',\r\n + '0 501 m (g) rtext grestore')\r\n xrange = vpxmax - vpxmin\r\n yrange = vpymax - vpymin\r\n xloc = vpxmin + 0.50*xrange\r\n yloc = vpymin - 0.15*yrange\r\n call pstext(xloc,yloc,8,'Distance',ts,1,0.0,1)\r\n xloc = vpxmin\r\n yloc = vpymax + 0.01*(vpxmax-vpxmin)\r\n call pstext(xloc,yloc,40,title,9.0,3,0.0,0)\r\n idsh = -1\r\n ilog = 0\r\n i45 = 0\r\n call scal(xvmin,xvmax,yvmin,yvmax,vpxmin,vpxmax,vpymin,vpymax,\r\n + ilog,i45)\r\nc\r\nc Write variogram bullets and lines:\r\nc\r\n do iii=1,nvar\r\nc\r\nc Color?\r\nc\r\n if(iclr(iii).gt.0) then\r\n jclr = iclr(iii)\r\n irr = redint(jclr)\r\n igg = grnint(jclr)\r\n ibb = bluint(jclr)\r\n write(lpsout,301) irr,igg,ibb\r\n 301 format(3i4,' setrgbcolor')\r\n end if\r\nc\r\nc Mark bullets:\r\nc\r\n if(ipts(iii).eq.1) then\r\n do i=1,nlag(iii)\r\n xloc = resc(xvmn,xvmx,vpxmin,vpxmax,ar1(iii,i))\r\n yloc = resc(yvmn,yvmx,vpymin,vpymax,ar2(iii,i))\r\n if(ar1(iii,i).ge.dmin.and.ar1(iii,i).le.dmax.and.\r\n + ar2(iii,i).ge.gmin.and.ar2(iii,i).le.gmax) then\r\n ix = int((resc(xmin,xmax,pxmin,pxmax,xloc))/pscl)\r\n iy = int((resc(ymin,ymax,pymin,pymax,yloc))/pscl)\r\n write(lpsout,32) ix,iy\r\n end if\r\n end do\r\n 32 format('n ',i4.4,1x,i4.4,' bullet')\r\n end if\r\nc\r\nc Draw a line:\r\nc\r\n if(iline(iii).eq.1) then\r\n np = 0\r\n do i=1,nlag(iii)\r\n xx(i) = resc(xvmn,xvmx,vpxmin,vpxmax,ar1(iii,i))\r\n yy(i) = resc(yvmn,yvmx,vpymin,vpymax,ar2(iii,i))\r\n if(ar1(iii,i).lt.dmin.or.ar1(iii,i).gt.dmax.or.\r\n + ar2(iii,i).lt.gmin.or.ar2(iii,i).gt.gmax) then\r\n if(np.eq.0) np = i-1\r\n end if\r\n end do\r\n idsh = idash(iii)\r\n np = nlag(iii)\r\n call psline(np,xx,yy,0.5,idsh)\r\n end if\r\n write(lpsout,302)\r\n 302 format('0 0 0 setrgbcolor')\r\nc\r\nc Finish loop over all annotation:\r\nc\r\n end do\r\nc\r\nc Draw sill line?\r\nc\r\n if(isill.eq.1) then\r\n np = 2\r\n xx(1) = resc(xvmn,xvmx,vpxmin,vpxmax,dmin)\r\n yy(1) = resc(yvmn,yvmx,vpymin,vpymax,sillval)\r\n xx(2) = resc(xvmn,xvmx,vpxmin,vpxmax,dmax)\r\n yy(2) = resc(yvmn,yvmx,vpymin,vpymax,sillval)\r\n call psline(np,xx,yy,0.5,0)\r\n end if\r\nc\r\nc Close data file:\r\nc\r\n write(lpsout,999)\r\n 999 format('%END OF POSTSCRIPT FILE',/,'4.166667 4.166667 scale',/,/,\r\n + '%%EOF',/,'showpage')\r\n close(lpsout)\r\nc\r\nc Finished:\r\nc\r\n 9997 write(*,9998) VERSION\r\n 9998 format(/' VARGPLT Version: ',f5.3, ' Finished'/)\r\n stop\r\n 98 stop 'Error in parameter file'\r\n end\r\n\r\n\r\n\r\n subroutine makepar\r\nc-----------------------------------------------------------------------\r\nc\r\nc Write a Parameter File\r\nc **********************\r\nc\r\nc\r\nc\r\nc-----------------------------------------------------------------------\r\n lun = 99\r\n open(lun,file='vargplt.par',status='UNKNOWN')\r\n write(lun,10)\r\n 10 format(' Parameters for VARGPLT',/,\r\n + ' **********************',/,/,\r\n + 'START OF PARAMETERS:')\r\n\r\n write(lun,11)\r\n 11 format('vargplt.ps ',\r\n + '-file for PostScript output')\r\n write(lun,12)\r\n 12 format('2 ',\r\n + '-number of variograms to plot')\r\n write(lun,13)\r\n 13 format('0.0 20.0 ',\r\n + '-distance limits (from data if max<min)')\r\n write(lun,14)\r\n 14 format('0.0 1.2 ',\r\n + '-variogram limits (from data if max<min)')\r\n write(lun,24)\r\n 24 format('1 1.0 ',\r\n + '-plot sill (0=no,1=yes), sill value)')\r\n write(lun,15)\r\n 15 format('Normal Scores Semivariogram ',\r\n + '-Title for variogram')\r\n write(lun,16)\r\n 16 format('gamv.out ',\r\n + '-1 file with variogram data')\r\n write(lun,17)\r\n 17 format('1 1 1 1 1 ',\r\n + '- variogram #, dash #, pts?, line?, color')\r\n write(lun,18)\r\n 18 format('vmodel.var ',\r\n + '-2 file with variogram data')\r\n write(lun,19)\r\n 19 format('1 3 0 1 10 ',\r\n + '- variogram #, dash #, pts?, line?, color')\r\n write(lun,20)\r\n 20 format(//,'Color Codes for Variogram Lines/Points:')\r\n write(lun,21)\r\n 21 format(' 1=red, 2=orange, 3=yellow, 4=light green,',\r\n + ' 5=green, 6=light blue,',/,\r\n + ' 7=dark blue, 8=violet, 9=white,',\r\n + ' 10=black, 11=purple, 12=brown,',/,\r\n + ' 13=pink, 14=intermediate green, 15=gray')\r\n\r\n close(lun)\r\n return\r\n end\r\n", "meta": {"hexsha": "f6477859e87c00af8bfe67c0ec249bfb6011392d", "size": 15254, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "src/original/vargplt/vargplt.for", "max_stars_repo_name": "exepulveda/gslib2.0", "max_stars_repo_head_hexsha": "5c021000eb3da8703ced3ee9be145d6c0ecb2608", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max_stars_repo_stars_event_min_datetime": "2021-07-09T06:03:38.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-20T11:11:19.000Z", "max_issues_repo_path": "src/original/vargplt/vargplt.for", "max_issues_repo_name": "exepulveda/gslib2.0", "max_issues_repo_head_hexsha": "5c021000eb3da8703ced3ee9be145d6c0ecb2608", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/original/vargplt/vargplt.for", "max_forks_repo_name": "exepulveda/gslib2.0", "max_forks_repo_head_hexsha": "5c021000eb3da8703ced3ee9be145d6c0ecb2608", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 33.5252747253, "max_line_length": 73, "alphanum_fraction": 0.4577815655, "num_tokens": 4576, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4843800842769844, "lm_q2_score": 0.11757212272365286, "lm_q1q2_score": 0.056949594713506926}}
{"text": "program compare_character_variables\r\nimplicit none\r\ncharacter (len=4), allocatable :: w(:)\r\nw = [\"John\",\"Joan\",\"girl\",\"boy \"]\r\nprint*,findloc(w,\"girl\"),findloc(w,\"abcd\") ! 3 0\r\nwrite (*,\"(*(g0,:,1x))\") minval(w),minval(w(3:)) ! Joan boy\r\nwrite (*,\"(*(g0,:,1x))\") minloc(w),minloc(w,mask=[0,0,1,1] == 1)\r\nprint*,\" \" < \"*\", \"*\" < \"0\", \"0\" < \"1\", \"9\" < \"A\", &\r\n \"Z\" < \"a\", \"a\" < \"b\"\r\n! replacing < with .lt. in the line above gives same result\r\nprint*,llt(\" \",\"*\"),llt(\"*\",\"0\"),llt(\"0\",\"1\"),llt(\"9\",\"A\"), &\r\n llt(\"Z\",\"a\"),llt(\"a\",\"b\") ! same result\r\n! ASCII collating sequence is blanks, special characters, \r\n! numerals, upper case letters, lower case letters\r\nend program compare_character_variables\r\n! output:\r\n! 3 0\r\n! Joan boy \r\n! 2 4\r\n! T T T T T T\r\n! T T T T T T\r\n", "meta": {"hexsha": "cac1a2af47663013b14cb433811c9fbdc9296652", "size": 783, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "compare_character.f90", "max_stars_repo_name": "awvwgk/FortranTip", "max_stars_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "compare_character.f90", "max_issues_repo_name": "awvwgk/FortranTip", "max_issues_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_issues_repo_licenses": ["Unlicense"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "compare_character.f90", "max_forks_repo_name": "awvwgk/FortranTip", "max_forks_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_forks_repo_licenses": ["Unlicense"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 35.5909090909, "max_line_length": 65, "alphanum_fraction": 0.5542784163, "num_tokens": 285, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.47657965106367595, "lm_q2_score": 0.11920292828022305, "lm_q1q2_score": 0.05680968996555709}}
{"text": "*DECK FUNDOC\n SUBROUTINE FUNDOC\nC***BEGIN PROLOGUE FUNDOC\nC***PURPOSE Documentation for FNLIB, a collection of routines for\nC evaluating elementary and special functions.\nC***LIBRARY SLATEC\nC***CATEGORY C, Z\nC***TYPE ALL (FUNDOC-A)\nC***KEYWORDS DOCUMENTATION, ELEMENTARY FUNCTIONS, SPECIAL FUNCTIONS\nC***AUTHOR Kahaner, D. K., (NBS)\nC***DESCRIPTION\nC\nC The SLATEC Library -- Elementary And Special Functions\nC\nC This describes the elementary and special function routines available\nC in the SLATEC library. Most of the these routines were written by\nC Wayne Fullerton while at LANL. Some were written by Don Amos of SNLA.\nC There are approximately 63 single precision, 63 double precision and\nC 25 complex user callable elementary and special function routines.\nC\nC The table below gives a breakdown of routines according to their\nC function. Unless otherwise indicated all routines are function\nC subprograms.\nC Sngl. Dble.\nC Description Notation Prec. Prec. Complex\nC\nC ***Intrinsic Functions and Fundamental Functions***\nC Unpack floating point Call R9UPAK(X,Y,N) D9UPAK --\nC number\nC Pack floating point R9PAK(Y,N) D9PAK --\nC number\nC Initialize orthogonal INITS(OS,NOS,ETA) INITDS --\nC polynomial series\nC Evaluate Chebyshev summation for CSEVL(X,CS,N) DCSEVL --\nC series i = 1 to n of\nC cs(i)*(2*x)**(i-1)\nC\nC ***Elementary Functions***\nC Argument = theta in z = \\ z \\ * -- -- CARG(Z)\nC radians e**(i * theta)\nC Cube root CBRT(X) DCBRT CCBRT\nC Relative error exponen- ((e**x) -1) / x EXPREL(X) DEXPRL CEXPRL\nC tial from first order\nC Common logarithm log to the base 10 -- -- CLOG10(Z)\nC of z\nC Relative error logarithm ln(1 + x) ALNREL(X) DLNREL CLNREL\nC Relative error logarithm (ln(1 + x) - x R9LN2R(X) D9LN2R C9LN2R\nC from second order + x**2/2) / x**3\nC ***Trigonometric and Hyperbolic Functions***\nC Tangent tan z -- -- CTAN(Z)\nC Cotangent cot x COT(X) DCOT CCOT\nC Sine x in degrees sin((2*pi*x)/360) SINDG(X) DSINDG --\nC Cosine x in degrees cos((2*pi*x)/360) COSDG(X) DCOSDG --\nC Arc sine arcsin (z) -- -- CASIN(Z)\nC Arc cosine arccos (z) -- -- CACOS(Z)\nC Arc tangent arctan (z) -- -- CATAN(Z)\nC Quadrant correct arctan (z1/z2) -- -- CATAN2(Z1,\nC arc tangent Z2)\nC Hyperbolic sine sinh z -- -- CSINH(Z)\nC Hyperbolic cosine cosh z -- -- CCOSH(Z)\nC Hyperbolic tangent tanh z -- -- CTANH(Z)\nC Arc hyperbolic sine arcsinh (x) ASINH(X) DASINH CASINH\nC Arc hyperbolic cosine arccosh (x) ACOSH(X) DACOSH CACOSH\nC Arc hyperbolic tangent arctanh (x) ATANH(X) DATANH CATANH\nC Relative error arc (arctan (x) - x) R9ATN1(X) D9ATN1 --\nC tangent from first order / x**3\nC ***Exponential Integrals and Related Functions***\nC Exponential integral Ei(x) = (minus) EI(X) DEI --\nC the integral from\nC -x to infinity of\nC (e**-t / t)dt\nC Exponential integral E sub 1 (x) = E1(X) DE1 --\nC the integral from x\nC to infinity of\nC (e**-t / t) dt\nC Logarithmic integral li(x) = the ALI(X) DLI --\nC integral from 0 to\nC x of (1 / ln t) dt\nC Sequences of exponential integrals.\nC M values are computed where\nC k=0,1,...M-1 and n>=1\nC Exponential integral E sub n+k (x) Call EXINT(X, DEXINT --\nC =the integral from N,KODE,M,TOL,\nC 1 to infinity of EN,IERR)\nC (e**(-x*t)/t**(n+k))dt\nC ***Gamma Functions and Related Functions***\nC Factorial n! FAC(N) DFAC --\nC Binomial n!/(m!*(n-m)!) BINOM(N,M) DBINOM --\nC Gamma gamma(x) GAMMA(X) DGAMMA CGAMMA\nC Gamma(x) under and Call GAMLIM( DGAMLM --\nC overflow limits XMIN,XMAX)\nC Reciprocal gamma 1 / gamma(x) GAMR(X) DGAMR CGAMR\nC Log abs gamma ln \\gamma(x)\\ ALNGAM(X) DLNGAM --\nC Log gamma ln gamma(z) -- -- CLNGAM\nC Log abs gamma g = ln \\gamma(x)\\ Call ALGAMS(X, DLGAMS --\nC with sign s = sign gamma(x) G,S)\nC Incomplete gamma gamma(a,x) = GAMI(A,X) DGAMI --\nC the integral from\nC 0 to x of\nC (t**(a-1) * e**-t)dt\nC Complementary gamma(a,x) = GAMIC(A,X) DGAMIC --\nC incomplete gamma the integral from\nC x to infinity of\nC (t**(a-1) * e**-t)dt\nC Tricomi's gamma super star(a,x) GAMIT(A,X) DGAMIT --\nC incomplete gamma = x**-a *\nC incomplete gamma(a,x)\nC / gamma(a)\nC Psi (Digamma) psi(x) = gamma'(x) PSI(X) DPSI CPSI\nC / gamma(x)\nC Pochhammer's (a) sub x = gamma(a+x) POCH(A,X) DPOCH --\nC generalized symbol / gamma(a)\nC Pochhammer's symbol ((a) sub x -1) / x POCH1(A,X) DPOCH1 --\nC from first order\nC Beta b(a,b) = (gamma(a) BETA(A,B) DBETA CBETA\nC * gamma(b))\nC / gamma(a+b)\nC = the integral\nC from 0 to 1 of\nC (t**(a-1) *\nC (1-t)**(b-1))dt\nC Log beta ln b(a,b) ALBETA(A,B) DLBETA CLBETA\nC Incomplete beta i sub x (a,b) = BETAI(X,A,B) DBETAI __\nC b sub x (a,b) / b(a,b)\nC = 1 / b(a,b) *\nC the integral\nC from 0 to x of\nC (t**(a-1) *\nC (1-t)**(b-1))dt\nC Log gamma correction ln gamma(x) - R9LGMC(X) D9LGMC C9LGMC\nC term when Stirling's (ln(2 * pi))/2 -\nC approximation is valid (x - 1/2) * ln(x) + x\nC ***Error Functions and Fresnel Integrals***\nC Error function erf x = (2 / ERF(X) DERF --\nC square root of pi) *\nC the integral from\nC 0 to x of\nC e**(-t**2)dt\nC Complementary erfc x = (2 / ERFC(X) DERFC --\nC error function square root of pi) *\nC the integral from\nC x to infinity of\nC e**(-t**2)dt\nC Dawson's function F(x) = e**(-x**2) DAWS(X) DDAWS --\nC * the integral from\nC from 0 to x of\nC e**(t**2)dt\nC ***Bessel Functions***\nC Bessel functions of special integer order\nC First kind, order zero J sub 0 (x) BESJ0(X) DBESJ0 --\nC First kind, order one J sub 1 (x) BESJ1(X) DBESJ1 --\nC Second kind, order zero Y sub 0 (x) BESY0(X) DBESY0 --\nC Second kind, order one Y sub 1 (x) BESY1(X) DBESY1 --\nC Modified (hyperbolic) Bessel functions of special integer order\nC First kind, order zero I sub 0 (x) BESI0(X) DBESI0 --\nC First kind, order one I sub 1 (x) BESI1(X) DBESI1 --\nC Third kind, order zero K sub 0 (x) BESK0(X) DBESK0 --\nC Third kind, order one K sub 1 (x) BESK1(X) DBESK1 --\nC Modified (hyperbolic) Bessel functions of special integer order\nC scaled by an exponential\nC First kind, order zero e**-\\x\\ * I sub 0(x) BESI0E(X) DBSI0E --\nC First kind, order one e**-\\x\\ * I sub 1(x) BESI1E(X) DBSI1E --\nC Third kind, order zero e**x * K sub 0 (x) BESK0E(X) DBSK0E --\nC Third kind, order one e**x * K sub 1 (x) BESK1E(X) DBSK1E --\nC Sequences of Bessel functions of general order.\nC N values are computed where k = 1,2,...N and v .ge. 0.\nC Modified first kind I sub v+k-1 (x) Call BESI(X, DBESI --\nC optional scaling ALPHA,KODE,N,\nC by e**(-x) Y,NZ)\nC First kind J sub v+k-1 (x) Call BESJ(X, DBESJ --\nC ALPHA,N,Y,NZ)\nC Second kind Y sub v+k-1 (x) Call BESY(X, DBESY --\nC FNU,N,Y)\nC Modified third kind K sub v+k-1 (x) Call BESK(X, DBESK --\nC optional scaling FNU,KODE,N,Y,\nC by e**(x) NZ)\nC Sequences of Bessel functions. \\N\\ values are computed where\nC I = 0, 1, 2, ..., N-1 for N > 0 or I = 0, -1, -2, ..., N+1\nC for N < 0.\nC Modified third kind K sub v+i (x) Call BESKS( DBESKS --\nC XNU,X,N,BK)\nC Sequences of Bessel functions scaled by an exponential.\nC \\N\\ values are computed where I = 0, 1, 2, ..., N-1\nC for N > 0 or I = 0, -1, -2, ..., N+1 for N < 0.\nC Modified third kind e**x * Call BESKES( DBSKES --\nC K sub v+i (x) XNU,X,N,BK)\nC ***Bessel Functions of Fractional Order***\nC Airy functions\nC Airy Ai(x) AI(X) DAI --\nC Bairy Bi(x) BI(X) DBI --\nC Exponentially scaled Airy functions\nC Airy Ai(x), x <= 0 AIE(X) DAIE --\nC exp(2/3 * x**(3/2))\nC * Ai(x), x >= 0\nC Bairy Bi(x), x <= 0 BIE(X) DBIE --\nC exp(-2/3 * x**(3/2))\nC * Bi(x), x >= 0\nC ***Confluent Hypergeometric Functions***\nC Confluent U(a,b,x) CHU(A,B,X) DCHU --\nC hypergeometric\nC ***Miscellaneous Functions***\nC Spence s(x) = - the SPENC(X) DSPENC --\nC dilogarithm integral from\nC 0 to x of\nC ((ln \\1-y\\) / y)dy\nC\nC***REFERENCES (NONE)\nC***ROUTINES CALLED (NONE)\nC***REVISION HISTORY (YYMMDD)\nC 801015 DATE WRITTEN\nC 861211 REVISION DATE from Version 3.2\nC 891214 Prologue converted to Version 4.0 format. (BAB)\nC 900326 Routine name changed from FNLIBD to FUNDOC. (WRB)\nC 900723 PURPOSE section revised. (WRB)\nC***END PROLOGUE FUNDOC\nC***FIRST EXECUTABLE STATEMENT FUNDOC\n RETURN\n END\n", "meta": {"hexsha": "3ee4b5ad7f36520906a150e122fdd865e6139d91", "size": 11429, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "slatec/src/fundoc.f", "max_stars_repo_name": "andremirt/v_cond", "max_stars_repo_head_hexsha": "6b5c364d7cd4243686488b2bd4318be3927e07ea", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "slatec/src/fundoc.f", "max_issues_repo_name": "andremirt/v_cond", "max_issues_repo_head_hexsha": "6b5c364d7cd4243686488b2bd4318be3927e07ea", "max_issues_repo_licenses": ["Unlicense"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "slatec/src/fundoc.f", "max_forks_repo_name": "andremirt/v_cond", "max_forks_repo_head_hexsha": "6b5c364d7cd4243686488b2bd4318be3927e07ea", "max_forks_repo_licenses": ["Unlicense"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 52.1872146119, "max_line_length": 72, "alphanum_fraction": 0.4698573803, "num_tokens": 3292, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4493926197162523, "lm_q2_score": 0.12592277467581975, "lm_q1q2_score": 0.05658876559350599}}
{"text": "program messing_up\n implicit none\n integer :: i, n, step\n\n n = 10\n step = 1\n do i = 1, n, step\n print *, i\n if (i == 2) n = 10\n step = 2\n end do\nend program messing_up\n", "meta": {"hexsha": "be4a113b3bc22ff80ac1b48d8da7ecc81e5e0726", "size": 207, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "source_code/iterations/messing_up.f90", "max_stars_repo_name": "caguerra/Fortran-MOOC", "max_stars_repo_head_hexsha": "fb8a9c24e62ce5f388deb06b21e3009aea6b78d4", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_count": 12, "max_stars_repo_stars_event_min_datetime": "2021-05-20T12:03:45.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-16T19:46:26.000Z", "max_issues_repo_path": "source_code/iterations/messing_up.f90", "max_issues_repo_name": "caguerra/Fortran-MOOC", "max_issues_repo_head_hexsha": "fb8a9c24e62ce5f388deb06b21e3009aea6b78d4", "max_issues_repo_licenses": ["CC-BY-4.0"], "max_issues_count": 2, "max_issues_repo_issues_event_min_datetime": "2021-09-30T04:25:50.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-06T08:21:30.000Z", "max_forks_repo_path": "source_code/iterations/messing_up.f90", "max_forks_repo_name": "caguerra/Fortran-MOOC", "max_forks_repo_head_hexsha": "fb8a9c24e62ce5f388deb06b21e3009aea6b78d4", "max_forks_repo_licenses": ["CC-BY-4.0"], "max_forks_count": 6, "max_forks_repo_forks_event_min_datetime": "2021-09-27T07:30:31.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-07T16:23:19.000Z", "avg_line_length": 15.9230769231, "max_line_length": 26, "alphanum_fraction": 0.4927536232, "num_tokens": 73, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.2689414096510109, "lm_q2_score": 0.20946968626535548, "lm_q1q2_score": 0.0563350727033597}}
{"text": "\r\n\r\n\r\nmodule mumps_mod\r\n\r\n save\r\n ! integer,parameter:: ui_out = 10 ! unit for mumps log file\r\n !integer,parameter:: st_unit=11 ! unit for output statistics file\r\n\r\n\r\n INCLUDE 'dmumps_struc.h'\r\n\r\n !logical,private:: mumps_initialized = .false.\r\n\r\n\r\ncontains\r\n\r\n!---------------------------------------------------------------\r\n\r\nsubroutine init( mumps_par, sym )\r\n\r\nimplicit none\r\n\r\nTYPE (DMUMPS_STRUC),intent(inout):: mumps_par\r\ninteger(kind=8),intent(in):: sym ! =0 unsymmetric, =1 symm. pos def, =2 general symm.\r\n\r\n !mumps_par%COMM = MPI_COMM_WORLD\r\n mumps_par%SYM = sym ! =0 unsymmetric, =1 symm. pos def, =2 general symm.\r\n mumps_par%PAR = 1\r\n\r\n mumps_par%JOB = -1 ! initialize\r\n CALL DMUMPS(mumps_par)\r\n\r\n\r\n !if (mumps_par%MYID == 0) then\r\n ! open(unit=ui_out, file='mumps.log', action='write')\r\n !end if\r\n\r\n !mumps_initialized = .true.\r\n\r\nreturn\r\nend subroutine init\r\n\r\n!---------------------------------------------------------------\r\n\r\nsubroutine convert_to_mumps_format( mumps_par, n, A,jA,iA, ierr )\r\n! A is actually a transpose.\r\nimplicit none\r\n\r\nTYPE (DMUMPS_STRUC),intent(inout):: mumps_par\r\ninteger(kind=8),intent(in):: n ! # of rows in A\r\nreal(kind=8),intent(in):: A(*)\r\ninteger(kind=8),intent(in):: jA(*), iA(n+1)\r\ninteger(kind=8),intent(out):: ierr\r\n\r\ninteger nonz, i,j, j1,j2, ind, jcol, istat\r\n\r\n\r\nnonz = iA(n+1) - 1\r\n!n = size(iA) - 1\r\n\r\nmumps_par%N = n\r\n\r\nif (mumps_par%SYM == 0) then ! not symmetric matrix\r\n mumps_par%NZ = nonz\r\n allocate( mumps_par%IRN(nonz), mumps_par%JCN(nonz), mumps_par%A(nonz), stat=istat)\r\n if ( istat /= 0 ) then\r\n ierr = -13 ! allocation error\r\n return\r\n end if\r\n\r\n\r\n do i = 1, n\r\n mumps_par%JCN( iA(i) : iA(i+1)-1 ) = i\r\n end do ! i\r\n\r\n mumps_par%IRN = jA(1:nonz)\r\n mumps_par%A = A(1:nonz)\r\n\r\nelse ! symmetric matrix\r\n ! Keep only the lower half of the matrix (row >= column).\r\n\r\n nonz = nonz/2 + n ! should be +n/2, but I'm using n just in case.\r\n allocate( mumps_par%IRN(nonz), mumps_par%JCN(nonz), mumps_par%A(nonz), stat=istat)\r\n if ( istat /= 0 ) then\r\n ierr = -13 ! allocation error\r\n return\r\n end if\r\n\r\n ind = 0\r\n do i = 1, n\r\n\r\n j1 = iA(i)\r\n j2 = iA(i+1) - 1\r\n do j = j1, j2\r\n jcol = jA(j)\r\n\r\n if (i >= jcol) then\r\n ind = ind + 1\r\n mumps_par%A(ind) = A(j)\r\n mumps_par%JCN(ind) = jcol\r\n mumps_par%IRN(ind) = i\r\n end if\r\n\r\n end do ! j\r\n end do ! i\r\n\r\n mumps_par%NZ = ind\r\n !if (nonz < ind) call errorstop('nonz < ind') ! debug\r\nend if\r\n\r\nierr = 0\r\nreturn\r\nend subroutine convert_to_mumps_format\r\n\r\n!---------------------------------------------------------------\r\n\r\nsubroutine factor_matrix( mumps_par, ierr )\r\n\r\nimplicit none\r\n\r\nTYPE (DMUMPS_STRUC),intent(inout):: mumps_par\r\ninteger(kind=8),intent(out):: ierr\r\n\r\n!mumps_par%icntl(2) = 6 ! output stream for diagnostics\r\nmumps_par%icntl(4) = 0 ! 1 ! amount of output\r\n\r\n\r\nmumps_par%icntl(2) = 0 ! ui_out ! output stream for diagnostic printing\r\nmumps_par%icntl(3) = 0 ! ui_out ! output stream for global information\r\n\r\n!mumps_par%icntl(14) = 40 ! % increase in working space\r\n\r\n!mumps_par%icntl(11) = 0 ! return statistics\r\n! mumps_par%icntl(7) = 5 ! ordering type\r\n!mumps_par%cntl(1) = 0.d0 ! rel. threshold for numerical pivoting\r\n\r\n\r\nmumps_factorization: do\r\n\r\n mumps_par%JOB = 1 ! analysis\r\n CALL DMUMPS(mumps_par)\r\n\r\n mumps_par%JOB = 2 ! factorization\r\n CALL DMUMPS(mumps_par)\r\n\r\n ierr = mumps_par%INFOG(1)\r\n\r\n\r\n if ( mumps_par%INFOG(1) == -9 .or. mumps_par%INFOG(1) == -8 ) then\r\n ! Main internal real/complex workarray S too small.\r\n mumps_par%icntl(14) = mumps_par%icntl(14) + 10\r\n if ( mumps_par%MYID == 0 ) then\r\n write(*,30) mumps_par%icntl(14)\r\n 30 format(/'MUMPS percentage increase in the estimated working space', &\r\n /'increased to',i4)\r\n end if\r\n\r\n !else if (mumps_par%INFOG(1) == -13) then\r\n ! if ( mumps_par%MYID == 0 ) then\r\n ! write(*,40)\r\n ! 40 format(/'MUMPS memory allocation error.'/)\r\n ! end if\r\n ! stop\r\n\r\n !else if (mumps_par%INFOG(1) == -10) then\r\n ! if ( mumps_par%MYID == 0 ) then\r\n ! write(*,45)\r\n ! 45 format(/'MUMPS ERROR: Numerically singular matrix.'/)\r\n ! end if\r\n ! stop\r\n\r\n !else if (mumps_par%INFOG(1) == -40) then\r\n ! if ( mumps_par%MYID == 0 ) then\r\n ! write(*,46)\r\n ! 46 format(/'MUMPS ERROR: matrix is not positive definite.'/)\r\n ! end if\r\n ! stop\r\n\r\n !else if ( mumps_par%INFOG(1) < 0 ) then\r\n ! if ( mumps_par%MYID == 0 ) then\r\n ! write(*,20) mumps_par%INFOG(1), mumps_par%INFOG(2)\r\n ! 20 format(/'ERROR occured in MUMPS!',/,'INFOG(1), INFOG(2) ', 2i6,/)\r\n ! end if\r\n ! stop\r\n\r\n else\r\n exit mumps_factorization ! factorization successful\r\n end if\r\n\r\nend do mumps_factorization\r\n\r\n\r\nif ( mumps_par%MYID == 0 ) then\r\n !flush(ui_out)\r\n ! Turn off mumps output.\r\n mumps_par%icntl(2) = 0 ! output stream for diagnostic printing\r\n mumps_par%icntl(3) = 0 ! output stream for global information\r\nend if\r\n\r\n\r\nreturn\r\nend subroutine factor_matrix\r\n\r\n!--------------------------------------------------------------\r\n\r\nsubroutine solve( mumps_par, nrhs, rhs, x, transpose )\r\n! Solve A*x = rhs\r\n\r\nimplicit none\r\n\r\nTYPE (DMUMPS_STRUC),intent(inout):: mumps_par\r\ninteger(kind=8),intent(in):: nrhs ! # of right-hand-sides\r\nreal(kind=8),intent(in):: rhs(nrhs * mumps_par%N)\r\nreal(kind=8),intent(out),target:: x(nrhs * mumps_par%N) ! solution\r\nlogical,intent(in):: transpose ! if .true. take the transpose\r\n\r\n x = rhs\r\n\r\n mumps_par%RHS => x\r\n\r\n ! The following is significant only on the host cpu.\r\n mumps_par%NRHS = nrhs ! # of right-hand-sides\r\n mumps_par%LRHS = mumps_par%N ! size of system\r\n\r\n if (transpose) then\r\n mumps_par%icntl(9) = 0 ! for solving A'x = b\r\n else\r\n mumps_par%icntl(9) = 1 ! for solving Ax = b\r\n end if\r\n\r\n\r\n mumps_par%JOB = 3 ! Solve the system.\r\n CALL DMUMPS(mumps_par)\r\n ! At this point mumps_par%RHS (rhs) contains the solution.\r\n\r\n\r\nreturn\r\nend subroutine solve\r\n\r\n!--------------------------------------------------------------\r\n\r\nsubroutine destroy(mumps_par)\r\n\r\nimplicit none\r\nTYPE (DMUMPS_STRUC),intent(inout):: mumps_par\r\n\r\n!if (.not. mumps_initialized) return\r\n\r\n! Destroy the instance (deallocate internal data structures)\r\nmumps_par%JOB = -2\r\nCALL DMUMPS(mumps_par)\r\n\r\nif (associated(mumps_par%A)) then\r\n deallocate(mumps_par%IRN, mumps_par%JCN, mumps_par%A)\r\nend if\r\n\r\n!if (mumps_par%MYID == 0) then\r\n! close(ui_out)\r\n!end if\r\n\r\nreturn\r\nend subroutine destroy\r\n\r\n\r\nend module mumps_mod\r\n", "meta": {"hexsha": "710e0c8102682d35df6b9e5f098d9142c2bde047", "size": 6715, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "pymatsolver/mumps/mumps_p.f90", "max_stars_repo_name": "cauachagas/pymatsolver", "max_stars_repo_head_hexsha": "89d4b3d3bc8d0ac48b4524bd03658d6c9f78da8d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 18, "max_stars_repo_stars_event_min_datetime": "2019-02-03T07:53:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-05T01:09:05.000Z", "max_issues_repo_path": "pymatsolver/mumps/mumps_p.f90", "max_issues_repo_name": "cauachagas/pymatsolver", "max_issues_repo_head_hexsha": "89d4b3d3bc8d0ac48b4524bd03658d6c9f78da8d", "max_issues_repo_licenses": ["MIT"], "max_issues_count": 19, "max_issues_repo_issues_event_min_datetime": "2015-05-13T16:19:24.000Z", "max_issues_repo_issues_event_max_datetime": "2018-02-21T16:39:00.000Z", "max_forks_repo_path": "pymatsolver/mumps/mumps_p.f90", "max_forks_repo_name": "cauachagas/pymatsolver", "max_forks_repo_head_hexsha": "89d4b3d3bc8d0ac48b4524bd03658d6c9f78da8d", "max_forks_repo_licenses": ["MIT"], "max_forks_count": 10, "max_forks_repo_forks_event_min_datetime": "2015-05-06T00:44:22.000Z", "max_forks_repo_forks_event_max_datetime": "2018-02-15T18:18:56.000Z", "avg_line_length": 25.1498127341, "max_line_length": 87, "alphanum_fraction": 0.5825763217, "num_tokens": 2156, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.46490157137338844, "lm_q2_score": 0.12085322457439825, "lm_q1q2_score": 0.056184854010178746}}
{"text": "program sum\nimplicit none\n \nreal :: a, b, result\n\na = 500.00\nb = 600.00\nresult = a+b\n\nprint*,\"the sum is\", result\nend program sum\n", "meta": {"hexsha": "ad3cfcae3e78ed8969bc34673688842a5fac46ff", "size": 130, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "sum/sum.f90", "max_stars_repo_name": "akkiturb/Ilkay-s-Fortran-Class", "max_stars_repo_head_hexsha": "0600640574354052a5a7d87bad520b8a03650d0e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_repo_stars_event_min_datetime": "2020-12-18T19:31:01.000Z", "max_stars_repo_stars_event_max_datetime": "2020-12-18T19:31:01.000Z", "max_issues_repo_path": "sum/sum.f90", "max_issues_repo_name": "akkiturb/Scientific-computing-in-Fortran", "max_issues_repo_head_hexsha": "0600640574354052a5a7d87bad520b8a03650d0e", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "sum/sum.f90", "max_forks_repo_name": "akkiturb/Scientific-computing-in-Fortran", "max_forks_repo_head_hexsha": "0600640574354052a5a7d87bad520b8a03650d0e", "max_forks_repo_licenses": ["MIT"], "max_forks_count": 2, "max_forks_repo_forks_event_min_datetime": "2020-02-04T19:45:56.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-10T14:22:05.000Z", "avg_line_length": 10.8333333333, "max_line_length": 27, "alphanum_fraction": 0.6615384615, "num_tokens": 46, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO\n\n", "lm_q1_score": 0.3208213008246071, "lm_q2_score": 0.17106118956561076, "lm_q1q2_score": 0.054880073357043944}}
{"text": "!\n! The Laboratory of Algorithms\n!\n! The MIT License\n!\n! Copyright 2011-2015 Andrey Pudov.\n!\n! Permission is hereby granted, free of charge, to any person obtaining a copy\n! of this software and associated documentation files (the 'Software'), to deal\n! in the Software without restriction, including without limitation the rights\n! to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n! copies of the Software, and to permit persons to whom the Software is\n! furnished to do so, subject to the following conditions:\n!\n! The above copyright notice and this permission notice shall be included in\n! all copies or substantial portions of the Software.\n!\n! THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n! THE SOFTWARE.\n!\n\nmodule MShift\n\n implicit none\n private\n\n type, public :: TShift\n contains\n procedure, nopass :: shift => shiftByLoop\n procedure, nopass :: shiftBack => shiftBackByLoop\n\n procedure, nopass :: shiftByLoop\n procedure, nopass :: shiftByAssignment\n procedure, nopass :: shiftByIntrinsic\n\n procedure, nopass :: shiftBackByLoop\n end type\n\ncontains\n subroutine shiftByLoop(array)\n integer, dimension(:), intent(in out) :: array\n\n integer index\n\n do index = size(array) - 1, 1, -1\n array(index + 1) = array(index)\n end do\n end subroutine\n\n subroutine shiftByAssignment(array)\n integer, dimension(:), intent(in out) :: array\n\n array(2:size(array)) = array(1:size(array) - 1)\n end subroutine\n\n subroutine shiftByIntrinsic(array)\n integer, dimension(:), intent(in out) :: array\n\n array = cshift(array, -1)\n array(1) = array(2) ! replace the last element of an array by first element\n end subroutine\n\n subroutine shiftBackByLoop(array)\n integer, dimension(:), intent(in out) :: array\n\n integer index\n\n do index = 1, size(array) - 1\n array(index) = array(index + 1)\n end do\n end subroutine\nend module\n", "meta": {"hexsha": "5eb2f82cb78d0b74a007d1a67aa26a572a16a772", "size": 2439, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "Arrays/Shift.f", "max_stars_repo_name": "andreypudov/Algorithms", "max_stars_repo_head_hexsha": "9693efa0abed30a38fcb9c3f7eebbd5b92b734f5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16, "max_stars_repo_stars_event_min_datetime": "2016-02-15T14:45:45.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-01T22:42:32.000Z", "max_issues_repo_path": "Arrays/Shift.f", "max_issues_repo_name": "jlokimlin/Algorithms", "max_issues_repo_head_hexsha": "d981990394d940fd999334b0b65b118567670d1a", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Arrays/Shift.f", "max_forks_repo_name": "jlokimlin/Algorithms", "max_forks_repo_head_hexsha": "d981990394d940fd999334b0b65b118567670d1a", "max_forks_repo_licenses": ["MIT"], "max_forks_count": 4, "max_forks_repo_forks_event_min_datetime": "2016-02-24T15:47:02.000Z", "max_forks_repo_forks_event_max_datetime": "2019-03-01T10:45:03.000Z", "avg_line_length": 31.2692307692, "max_line_length": 83, "alphanum_fraction": 0.6871668717, "num_tokens": 567, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.46490157137338844, "lm_q2_score": 0.11757213354550883, "lm_q1q2_score": 0.05465946963502893}}
{"text": "program if\n!Una sentencia if..then\ni = 2\nif (i .eq. 2) then\nprint *, \"i == 2\"\nend if\n\n!i = 3\nif (i .eq. 3) then\n\tprint *, \"i == 3\"\nelse\n\tprint *, \"i /= 3\"\nend if\n\nend program if\n", "meta": {"hexsha": "b16af50bf17d98249d7023eea89491688a59a1ed", "size": 178, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Sententicas de control/if.f90", "max_stars_repo_name": "kotoromo/Fortran-Basico", "max_stars_repo_head_hexsha": "1d37a82754acd1c231981adc3dea2d606e76d6c6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Sententicas de control/if.f90", "max_issues_repo_name": "kotoromo/Fortran-Basico", "max_issues_repo_head_hexsha": "1d37a82754acd1c231981adc3dea2d606e76d6c6", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Sententicas de control/if.f90", "max_forks_repo_name": "kotoromo/Fortran-Basico", "max_forks_repo_head_hexsha": "1d37a82754acd1c231981adc3dea2d606e76d6c6", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 11.125, "max_line_length": 23, "alphanum_fraction": 0.5505617978, "num_tokens": 80, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.2309197629292718, "lm_q2_score": 0.23091976292927183, "lm_q1q2_score": 0.0533239369113111}}
{"text": " MODULE LA_PRECISION\n!\n! -- LAPACK95 interface driver routine (version 3.0) --\n! UNI-C, Denmark; Univ. of Tennessee, USA; NAG Ltd., UK\n! September, 2000\n!\n! DEFINES SINGLE AND DOUBLE PRECISION PARAMETERS, SP AND DP.\n! THESE VALUES ARE COMPILER DEPENDENT.\n!\n INTEGER, PARAMETER :: SP=KIND(1.0), DP=KIND(1.0D0)\n!\n END MODULE LA_PRECISION\n\n MODULE LA_AUXMOD\n!\n! -- LAPACK95 interface driver routine (version 3.0) --\n! UNI-C, Denmark; Univ. of Tennessee, USA; NAG Ltd., UK\n! September, 2000\n!\n INTERFACE\n SUBROUTINE ERINFO(LINFO, SRNAME, INFO, ISTAT)\n CHARACTER( LEN = * ), INTENT(IN) :: SRNAME\n INTEGER , INTENT(IN) :: LINFO\n INTEGER , INTENT(OUT), OPTIONAL :: INFO\n INTEGER , INTENT(IN), OPTIONAL :: ISTAT\n END SUBROUTINE ERINFO\n INTEGER FUNCTION LA_WS_GELS( VER, M, N, NRHS, TRANS )\n CHARACTER( LEN=1 ), INTENT(IN) :: TRANS, VER\n INTEGER, INTENT(IN) :: M, N, NRHS\n END FUNCTION LA_WS_GELS\n INTEGER FUNCTION LA_WS_GELSS( VER, M, N, NRHS )\n CHARACTER(LEN=1), INTENT(IN) :: VER\n INTEGER, INTENT(IN) :: M, N, NRHS\n END FUNCTION LA_WS_GELSS\n END INTERFACE\n!\n CONTAINS\n!\n LOGICAL FUNCTION LSAME( CA, CB )\n!\n! PURPOSE\n! =======\n!\n! LSAME TESTS IF CA IS THE SAME LETTER AS CB REGARDLESS OF CASE.\n!\n! PARAMETERS\n! ==========\n!\n! CA (INPUT) CHARACTER*1\n! CB (INPUT) CHARACTER*1\n! CHARACTERS TO BE COMPARED.\n!\n! .. SCALAR ARGUMENTS ..\n CHARACTER*1, INTENT(IN) :: CA, CB\n! .. PARAMETERS ..\n INTEGER, PARAMETER :: IOFF=32\n! .. LOCAL SCALARS ..\n INTEGER :: INTA, INTB, ZCODE\n! .. INTRINSIC FUNCTIONS ..\n INTRINSIC ICHAR\n!\n! .. EXECUTABLE STATEMENTS ..\n!\n! TEST IF THE CHARACTERS ARE EQUAL\n!\n LSAME = CA == CB\n!\n! NOW TEST FOR EQUIVALENCE\n!\n IF( .NOT.LSAME )THEN\n!\n! USE 'Z' RATHER THAN 'A' SO THAT ASCII CAN BE DETECTED ON PRIME\n! MACHINES, ON WHICH ICHAR RETURNS A VALUE WITH BIT 8 SET.\n! ICHAR('A') ON PRIME MACHINES RETURNS 193 WHICH IS THE SAME AS\n! ICHAR('A') ON AN EBCDIC MACHINE.\n!\n ZCODE = ICHAR( 'Z' )\n!\n INTA = ICHAR( CA )\n INTB = ICHAR( CB )\n!\n IF( ZCODE.EQ.90 .OR. ZCODE.EQ.122 )THEN\n!\n! ASCII IS ASSUMED - ZCODE IS THE ASCII CODE OF EITHER LOWER OR\n! UPPER CASE 'Z'.\n!\n IF( INTA.GE.97 .AND. INTA.LE.122 ) INTA = INTA - 32\n IF( INTB.GE.97 .AND. INTB.LE.122 ) INTB = INTB - 32\n!\n ELSE IF( ZCODE.EQ.233 .OR. ZCODE.EQ.169 )THEN\n!\n! EBCDIC IS ASSUMED - ZCODE IS THE EBCDIC CODE OF EITHER LOWER OR\n! UPPER CASE 'Z'.\n!\n IF( INTA.GE.129 .AND. INTA.LE.137 .OR. &\n! & INTA.GE.145 .AND. INTA.LE.153 .OR. &\n & INTA.GE.162 .AND. INTA.LE.169 ) INTA = INTA + 64\n IF( INTB.GE.129 .AND. INTB.LE.137 .OR. &\n & INTB.GE.145 .AND. INTB.LE.153 .OR. &\n & INTB.GE.162 .AND. INTB.LE.169 ) INTB = INTB + 64\n!\n ELSE IF( ZCODE.EQ.218 .OR. ZCODE.EQ.250 )THEN\n!\n! ASCII IS ASSUMED, ON PRIME MACHINES - ZCODE IS THE ASCII CODE\n! PLUS 128 OF EITHER LOWER OR UPPER CASE 'Z'.\n!\n IF( INTA.GE.225 .AND. INTA.LE.250 ) INTA = INTA - 32\n IF( INTB.GE.225 .AND. INTB.LE.250 ) INTB = INTB - 32\n ENDIF\n LSAME = INTA == INTB\n ENDIF\n END FUNCTION LSAME\n\n END MODULE LA_AUXMOD\n", "meta": {"hexsha": "63f69d06e35d47f38faf895cded085d1ecbc7874", "size": 3624, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/la_auxmod.f90", "max_stars_repo_name": "MattBurn/LAPACK95", "max_stars_repo_head_hexsha": "bcd9d4b706f4213a6a4c0ebb4521754ffeff3752", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 8, "max_stars_repo_stars_event_min_datetime": "2018-12-29T15:07:54.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-02T10:09:22.000Z", "max_issues_repo_path": "src/la_auxmod.f90", "max_issues_repo_name": "MattBurn/LAPACK95", "max_issues_repo_head_hexsha": "bcd9d4b706f4213a6a4c0ebb4521754ffeff3752", "max_issues_repo_licenses": ["BSD-3-Clause"], "max_issues_count": 2, "max_issues_repo_issues_event_min_datetime": "2017-02-21T10:46:38.000Z", "max_issues_repo_issues_event_max_datetime": "2017-10-20T17:03:14.000Z", "max_forks_repo_path": "src/la_auxmod.f90", "max_forks_repo_name": "MattBurn/LAPACK95", "max_forks_repo_head_hexsha": "bcd9d4b706f4213a6a4c0ebb4521754ffeff3752", "max_forks_repo_licenses": ["BSD-3-Clause"], "max_forks_count": 7, "max_forks_repo_forks_event_min_datetime": "2018-12-29T15:34:01.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-15T07:12:40.000Z", "avg_line_length": 31.5130434783, "max_line_length": 73, "alphanum_fraction": 0.5353200883, "num_tokens": 1154, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4263216071250873, "lm_q2_score": 0.12421301807811348, "lm_q1q2_score": 0.05295469349291886}}
{"text": " program em\n n1 = 10\n n2 = 30\n call add(n1, n2, n)\n print *,n\n do 100 i = n1,n\n u = 1.\n 100 continue\n end\nc\n subroutine add(m1, m2, m)\n m = m1 + m2\n return\n end\n", "meta": {"hexsha": "2744a6d7f582365e66719d7b8b95a116a6deadb7", "size": 225, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/PIPS/validation/Complexity/em.f", "max_stars_repo_name": "DVSR1966/par4all", "max_stars_repo_head_hexsha": "86b33ca9da736e832b568c5637a2381f360f1996", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 51, "max_stars_repo_stars_event_min_datetime": "2015-01-31T01:51:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-18T02:01:50.000Z", "max_issues_repo_path": "packages/PIPS/validation/Complexity/em.f", "max_issues_repo_name": "DVSR1966/par4all", "max_issues_repo_head_hexsha": "86b33ca9da736e832b568c5637a2381f360f1996", "max_issues_repo_licenses": ["MIT"], "max_issues_count": 7, "max_issues_repo_issues_event_min_datetime": "2017-05-29T09:29:00.000Z", "max_issues_repo_issues_event_max_datetime": "2019-03-11T16:01:39.000Z", "max_forks_repo_path": "packages/PIPS/validation/Complexity/em.f", "max_forks_repo_name": "DVSR1966/par4all", "max_forks_repo_head_hexsha": "86b33ca9da736e832b568c5637a2381f360f1996", "max_forks_repo_licenses": ["MIT"], "max_forks_count": 12, "max_forks_repo_forks_event_min_datetime": "2015-03-26T08:05:38.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-18T02:01:51.000Z", "avg_line_length": 15.0, "max_line_length": 31, "alphanum_fraction": 0.4133333333, "num_tokens": 86, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4649015713733885, "lm_q2_score": 0.11279540479169524, "lm_q1q2_score": 0.05243876093135655}}
{"text": "! http://adventofcode.com/day/4\n! \n! Part 1\n! ------\n! Santa needs help mining some AdventCoins (very similar to\n! bitcoins) to use as gifts for all the economically\n! forward-thinking little girls and boys.\n! \n! To do this, he needs to find MD5 hashes which, in hexadecimal,\n! start with at least five zeroes. The input to the MD5 hash\n! is some secret key (your puzzle input, given below) followed by\n! a number in decimal. To mine AdventCoins, you must find Santa\n! the lowest positive number (no leading zeroes: 1, 2, 3, ...)\n! that produces such a hash.\n! \n! For example:\n! \n! - If your secret key is abcdef, the answer is 609043, because\n! the MD5 hash of abcdef609043 starts with five zeroes\n! (000001dbbfa...), and it is the lowest such number to do so.\n! - If your secret key is pqrstuv, the lowest number it combines\n! with to make an MD5 hash starting with five zeroes is\n! 1048970; that is, the MD5 hash of pqrstuv1048970 looks\n! like 000006136ef....\n! \n! \n! Part 2\n! ------\n! Now find one that starts with six zeroes.\n\ninclude 'md5.f95'\n\nprogram puzzle04\n implicit none\n\n interface\n function work(input, prefix, digest)\n implicit none\n character(len=*), intent(in) :: input, prefix\n character(len=32), intent(out) :: digest\n integer work\n end function work\n end interface\n\n integer, parameter :: infile = 10\n character(10000) :: text\n character(50) :: input\n character(32) :: digest\n character(30) :: num\n integer :: strlen, i, j, digestlen\n logical :: found\n\n open(unit=infile, file='../advent2015/inputs/input04.txt')\n\n ! Read the input file\n read(infile, '(a10000)') text\n text = trim(text)\n strlen = len(trim(text))\n \n ! Part 1\n i = work(trim(text), '00000', digest)\n write (num, '(i8)') i\n print '(a22, a8, a10, a32)', '[Fortran] Puzzle 4-1: ', trim(adjustl(num)), ' produces ', trim(digest)\n\n ! Part 2\n i = work(trim(text), '000000', digest)\n write (num, '(i8)') i\n print '(a22, a8, a10, a32)', '[Fortran] Puzzle 4-2: ', adjustl(num), ' produces ', digest\nend program\n\ninteger function work(text, prefix, digest)\n implicit none\n\n interface\n function check(digest, prefix)\n implicit none\n character(len=*), intent(in) :: digest, prefix\n logical check\n end function check\n function md5(string)\n implicit none\n character*(*), intent(in) :: string\n character*32 md5\n end function md5\n end interface\n\n character(len=*), intent(in) :: text, prefix\n character(len=32), intent(out) :: digest\n character(len=50) :: input\n character(len=30) :: num\n integer :: inputlen, prefixlen, i, j\n logical :: found\n\n found = .false.\n i = -1\n do while (.not. found)\n i = i + 1\n\n write (num, '(i30)') i\n input = trim(trim(text) // trim(adjustl(num)))\n digest = md5(trim(input))\n\n ! The MD5 algorithm has a known issue where 0s become spaces, so\n ! we need to change them back for the comparison to work\n do j = 1, 32\n if (digest(j:j) == ' ') then\n digest(j:j) = '0'\n end if\n end do\n\n found = check(digest, prefix)\n end do\n\n work = i\nend function\n\nlogical function check(digest, prefix)\n implicit none\n character(len=*), intent(in) :: digest, prefix\n integer :: prefixlen, i\n\n prefixlen = len(prefix)\n\n if (digest(1:prefixlen) == prefix) then\n check = .true.\n else\n check = .false.\n end if\nend function\n", "meta": {"hexsha": "d20b5dd6d953201024213e85249a9f2750fc16c1", "size": 3631, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "advent2015.f/puzzle04.f95", "max_stars_repo_name": "rnelson/adventofcode", "max_stars_repo_head_hexsha": "d15a360f7e3e6f306bede3f1c4252be4088b8cc7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_repo_stars_event_min_datetime": "2015-12-03T13:20:10.000Z", "max_stars_repo_stars_event_max_datetime": "2015-12-03T13:20:10.000Z", "max_issues_repo_path": "advent2015.f/puzzle04.f95", "max_issues_repo_name": "rnelson/adventofcode", "max_issues_repo_head_hexsha": "d15a360f7e3e6f306bede3f1c4252be4088b8cc7", "max_issues_repo_licenses": ["MIT"], "max_issues_count": 1, "max_issues_repo_issues_event_min_datetime": "2020-10-13T11:59:33.000Z", "max_issues_repo_issues_event_max_datetime": "2020-10-13T11:59:33.000Z", "max_forks_repo_path": "advent2015.f/puzzle04.f95", "max_forks_repo_name": "rnelson/adventofcode", "max_forks_repo_head_hexsha": "d15a360f7e3e6f306bede3f1c4252be4088b8cc7", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 27.9307692308, "max_line_length": 105, "alphanum_fraction": 0.6036904434, "num_tokens": 1001, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. NO\n2. NO", "lm_q1_score": 0.4765796361952087, "lm_q2_score": 0.10818896534500981, "lm_q1q2_score": 0.051560657744460815}}