gfortran.info 897 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591
  1. This is gfortran.info, produced by makeinfo version 5.1 from
  2. gfortran.texi.
  3. Copyright (C) 1999-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover Texts
  8. being (a) (see below), and with the Back-Cover Texts being (b) (see
  9. below). A copy of the license is included in the section entitled "GNU
  10. Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise funds
  16. for GNU development.
  17. INFO-DIR-SECTION Software development
  18. START-INFO-DIR-ENTRY
  19. * gfortran: (gfortran). The GNU Fortran Compiler.
  20. END-INFO-DIR-ENTRY
  21. This file documents the use and the internals of the GNU Fortran
  22. compiler, ('gfortran').
  23. Published by the Free Software Foundation 51 Franklin Street, Fifth
  24. Floor Boston, MA 02110-1301 USA
  25. Copyright (C) 1999-2020 Free Software Foundation, Inc.
  26. Permission is granted to copy, distribute and/or modify this document
  27. under the terms of the GNU Free Documentation License, Version 1.3 or
  28. any later version published by the Free Software Foundation; with the
  29. Invariant Sections being "Funding Free Software", the Front-Cover Texts
  30. being (a) (see below), and with the Back-Cover Texts being (b) (see
  31. below). A copy of the license is included in the section entitled "GNU
  32. Free Documentation License".
  33. (a) The FSF's Front-Cover Text is:
  34. A GNU Manual
  35. (b) The FSF's Back-Cover Text is:
  36. You have freedom to copy and modify this GNU Manual, like GNU
  37. software. Copies published by the Free Software Foundation raise funds
  38. for GNU development.
  39. 
  40. File: gfortran.info, Node: Top, Next: Introduction, Up: (dir)
  41. Introduction
  42. ************
  43. This manual documents the use of 'gfortran', the GNU Fortran compiler.
  44. You can find in this manual how to invoke 'gfortran', as well as its
  45. features and incompatibilities.
  46. * Menu:
  47. * Introduction::
  48. Part I: Invoking GNU Fortran
  49. * Invoking GNU Fortran:: Command options supported by 'gfortran'.
  50. * Runtime:: Influencing runtime behavior with environment variables.
  51. Part II: Language Reference
  52. * Fortran standards status:: Fortran 2003, 2008 and 2018 features supported by GNU Fortran.
  53. * Compiler Characteristics:: User-visible implementation details.
  54. * Extensions:: Language extensions implemented by GNU Fortran.
  55. * Mixed-Language Programming:: Interoperability with C
  56. * Coarray Programming::
  57. * Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran.
  58. * Intrinsic Modules:: Intrinsic modules supported by GNU Fortran.
  59. * Contributing:: How you can help.
  60. * Copying:: GNU General Public License says
  61. how you can copy and share GNU Fortran.
  62. * GNU Free Documentation License::
  63. How you can copy and share this manual.
  64. * Funding:: How to help assure continued work for free software.
  65. * Option Index:: Index of command line options
  66. * Keyword Index:: Index of concepts
  67. 
  68. File: gfortran.info, Node: Introduction, Next: Invoking GNU Fortran, Prev: Top, Up: Top
  69. 1 Introduction
  70. **************
  71. The GNU Fortran compiler front end was designed initially as a free
  72. replacement for, or alternative to, the Unix 'f95' command; 'gfortran'
  73. is the command you will use to invoke the compiler.
  74. * Menu:
  75. * About GNU Fortran:: What you should know about the GNU Fortran compiler.
  76. * GNU Fortran and GCC:: You can compile Fortran, C, or other programs.
  77. * Preprocessing and conditional compilation:: The Fortran preprocessor
  78. * GNU Fortran and G77:: Why we chose to start from scratch.
  79. * Project Status:: Status of GNU Fortran, roadmap, proposed extensions.
  80. * Standards:: Standards supported by GNU Fortran.
  81. 
  82. File: gfortran.info, Node: About GNU Fortran, Next: GNU Fortran and GCC, Up: Introduction
  83. 1.1 About GNU Fortran
  84. =====================
  85. The GNU Fortran compiler supports the Fortran 77, 90 and 95 standards
  86. completely, parts of the Fortran 2003, 2008 and 2018 standards, and
  87. several vendor extensions. The development goal is to provide the
  88. following features:
  89. * Read a user's program, stored in a file and containing instructions
  90. written in Fortran 77, Fortran 90, Fortran 95, Fortran 2003,
  91. Fortran 2008 or Fortran 2018. This file contains "source code".
  92. * Translate the user's program into instructions a computer can carry
  93. out more quickly than it takes to translate the instructions in the
  94. first place. The result after compilation of a program is "machine
  95. code", code designed to be efficiently translated and processed by
  96. a machine such as your computer. Humans usually are not as good
  97. writing machine code as they are at writing Fortran (or C++, Ada,
  98. or Java), because it is easy to make tiny mistakes writing machine
  99. code.
  100. * Provide the user with information about the reasons why the
  101. compiler is unable to create a binary from the source code.
  102. Usually this will be the case if the source code is flawed. The
  103. Fortran 90 standard requires that the compiler can point out
  104. mistakes to the user. An incorrect usage of the language causes an
  105. "error message".
  106. The compiler will also attempt to diagnose cases where the user's
  107. program contains a correct usage of the language, but instructs the
  108. computer to do something questionable. This kind of diagnostics
  109. message is called a "warning message".
  110. * Provide optional information about the translation passes from the
  111. source code to machine code. This can help a user of the compiler
  112. to find the cause of certain bugs which may not be obvious in the
  113. source code, but may be more easily found at a lower level compiler
  114. output. It also helps developers to find bugs in the compiler
  115. itself.
  116. * Provide information in the generated machine code that can make it
  117. easier to find bugs in the program (using a debugging tool, called
  118. a "debugger", such as the GNU Debugger 'gdb').
  119. * Locate and gather machine code already generated to perform actions
  120. requested by statements in the user's program. This machine code
  121. is organized into "modules" and is located and "linked" to the user
  122. program.
  123. The GNU Fortran compiler consists of several components:
  124. * A version of the 'gcc' command (which also might be installed as
  125. the system's 'cc' command) that also understands and accepts
  126. Fortran source code. The 'gcc' command is the "driver" program for
  127. all the languages in the GNU Compiler Collection (GCC); With 'gcc',
  128. you can compile the source code of any language for which a front
  129. end is available in GCC.
  130. * The 'gfortran' command itself, which also might be installed as the
  131. system's 'f95' command. 'gfortran' is just another driver program,
  132. but specifically for the Fortran compiler only. The difference
  133. with 'gcc' is that 'gfortran' will automatically link the correct
  134. libraries to your program.
  135. * A collection of run-time libraries. These libraries contain the
  136. machine code needed to support capabilities of the Fortran language
  137. that are not directly provided by the machine code generated by the
  138. 'gfortran' compilation phase, such as intrinsic functions and
  139. subroutines, and routines for interaction with files and the
  140. operating system.
  141. * The Fortran compiler itself, ('f951'). This is the GNU Fortran
  142. parser and code generator, linked to and interfaced with the GCC
  143. backend library. 'f951' "translates" the source code to assembler
  144. code. You would typically not use this program directly; instead,
  145. the 'gcc' or 'gfortran' driver programs will call it for you.
  146. 
  147. File: gfortran.info, Node: GNU Fortran and GCC, Next: Preprocessing and conditional compilation, Prev: About GNU Fortran, Up: Introduction
  148. 1.2 GNU Fortran and GCC
  149. =======================
  150. GNU Fortran is a part of GCC, the "GNU Compiler Collection". GCC
  151. consists of a collection of front ends for various languages, which
  152. translate the source code into a language-independent form called
  153. "GENERIC". This is then processed by a common middle end which provides
  154. optimization, and then passed to one of a collection of back ends which
  155. generate code for different computer architectures and operating
  156. systems.
  157. Functionally, this is implemented with a driver program ('gcc') which
  158. provides the command-line interface for the compiler. It calls the
  159. relevant compiler front-end program (e.g., 'f951' for Fortran) for each
  160. file in the source code, and then calls the assembler and linker as
  161. appropriate to produce the compiled output. In a copy of GCC which has
  162. been compiled with Fortran language support enabled, 'gcc' will
  163. recognize files with '.f', '.for', '.ftn', '.f90', '.f95', '.f03' and
  164. '.f08' extensions as Fortran source code, and compile it accordingly. A
  165. 'gfortran' driver program is also provided, which is identical to 'gcc'
  166. except that it automatically links the Fortran runtime libraries into
  167. the compiled program.
  168. Source files with '.f', '.for', '.fpp', '.ftn', '.F', '.FOR', '.FPP',
  169. and '.FTN' extensions are treated as fixed form. Source files with
  170. '.f90', '.f95', '.f03', '.f08', '.F90', '.F95', '.F03' and '.F08'
  171. extensions are treated as free form. The capitalized versions of either
  172. form are run through preprocessing. Source files with the lower case
  173. '.fpp' extension are also run through preprocessing.
  174. This manual specifically documents the Fortran front end, which
  175. handles the programming language's syntax and semantics. The aspects of
  176. GCC which relate to the optimization passes and the back-end code
  177. generation are documented in the GCC manual; see *note Introduction:
  178. (gcc)Top. The two manuals together provide a complete reference for the
  179. GNU Fortran compiler.
  180. 
  181. File: gfortran.info, Node: Preprocessing and conditional compilation, Next: GNU Fortran and G77, Prev: GNU Fortran and GCC, Up: Introduction
  182. 1.3 Preprocessing and conditional compilation
  183. =============================================
  184. Many Fortran compilers including GNU Fortran allow passing the source
  185. code through a C preprocessor (CPP; sometimes also called the Fortran
  186. preprocessor, FPP) to allow for conditional compilation. In the case of
  187. GNU Fortran, this is the GNU C Preprocessor in the traditional mode. On
  188. systems with case-preserving file names, the preprocessor is
  189. automatically invoked if the filename extension is '.F', '.FOR', '.FTN',
  190. '.fpp', '.FPP', '.F90', '.F95', '.F03' or '.F08'. To manually invoke
  191. the preprocessor on any file, use '-cpp', to disable preprocessing on
  192. files where the preprocessor is run automatically, use '-nocpp'.
  193. If a preprocessed file includes another file with the Fortran
  194. 'INCLUDE' statement, the included file is not preprocessed. To
  195. preprocess included files, use the equivalent preprocessor statement
  196. '#include'.
  197. If GNU Fortran invokes the preprocessor, '__GFORTRAN__' is defined.
  198. The macros '__GNUC__', '__GNUC_MINOR__' and '__GNUC_PATCHLEVEL__' can be
  199. used to determine the version of the compiler. See *note Overview:
  200. (cpp)Top. for details.
  201. GNU Fortran supports a number of 'INTEGER' and 'REAL' kind types in
  202. additional to the kind types required by the Fortran standard. The
  203. availability of any given kind type is architecture dependent. The
  204. following pre-defined preprocessor macros can be used to conditionally
  205. include code for these additional kind types: '__GFC_INT_1__',
  206. '__GFC_INT_2__', '__GFC_INT_8__', '__GFC_INT_16__', '__GFC_REAL_10__',
  207. and '__GFC_REAL_16__'.
  208. While CPP is the de-facto standard for preprocessing Fortran code,
  209. Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines
  210. Conditional Compilation, which is not widely used and not directly
  211. supported by the GNU Fortran compiler. You can use the program coco to
  212. preprocess such files (<http://www.daniellnagle.com/coco.html>).
  213. 
  214. File: gfortran.info, Node: GNU Fortran and G77, Next: Project Status, Prev: Preprocessing and conditional compilation, Up: Introduction
  215. 1.4 GNU Fortran and G77
  216. =======================
  217. The GNU Fortran compiler is the successor to 'g77', the Fortran 77 front
  218. end included in GCC prior to version 4. It is an entirely new program
  219. that has been designed to provide Fortran 95 support and extensibility
  220. for future Fortran language standards, as well as providing backwards
  221. compatibility for Fortran 77 and nearly all of the GNU language
  222. extensions supported by 'g77'.
  223. 
  224. File: gfortran.info, Node: Project Status, Next: Standards, Prev: GNU Fortran and G77, Up: Introduction
  225. 1.5 Project Status
  226. ==================
  227. As soon as 'gfortran' can parse all of the statements correctly, it
  228. will be in the "larva" state. When we generate code, the "puppa"
  229. state. When 'gfortran' is done, we'll see if it will be a
  230. beautiful butterfly, or just a big bug....
  231. -Andy Vaught, April 2000
  232. The start of the GNU Fortran 95 project was announced on the GCC
  233. homepage in March 18, 2000 (even though Andy had already been working on
  234. it for a while, of course).
  235. The GNU Fortran compiler is able to compile nearly all
  236. standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs,
  237. including a number of standard and non-standard extensions, and can be
  238. used on real-world programs. In particular, the supported extensions
  239. include OpenMP, Cray-style pointers, some old vendor extensions, and
  240. several Fortran 2003 and Fortran 2008 features, including TR 15581.
  241. However, it is still under development and has a few remaining rough
  242. edges. There also is initial support for OpenACC.
  243. At present, the GNU Fortran compiler passes the NIST Fortran 77 Test
  244. Suite (http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html), and
  245. produces acceptable results on the LAPACK Test Suite
  246. (http://www.netlib.org/lapack/faq.html#1.21). It also provides
  247. respectable performance on the Polyhedron Fortran compiler benchmarks
  248. (http://www.polyhedron.com/fortran-compiler-comparisons/polyhedron-benchmark-suite)
  249. and the Livermore Fortran Kernels test
  250. (http://www.netlib.org/benchmark/livermore). It has been used to
  251. compile a number of large real-world programs, including the HARMONIE
  252. and HIRLAM weather forecasting code (http://hirlam.org/) and the Tonto
  253. quantum chemistry package
  254. (http://physical-chemistry.scb.uwa.edu.au/tonto/wiki/index.php/Main_Page);
  255. see <https://gcc.gnu.org/wiki/GfortranApps> for an extended list.
  256. Among other things, the GNU Fortran compiler is intended as a
  257. replacement for G77. At this point, nearly all programs that could be
  258. compiled with G77 can be compiled with GNU Fortran, although there are a
  259. few minor known regressions.
  260. The primary work remaining to be done on GNU Fortran falls into three
  261. categories: bug fixing (primarily regarding the treatment of invalid
  262. code and providing useful error messages), improving the compiler
  263. optimizations and the performance of compiled code, and extending the
  264. compiler to support future standards--in particular, Fortran 2003,
  265. Fortran 2008 and Fortran 2018.
  266. 
  267. File: gfortran.info, Node: Standards, Prev: Project Status, Up: Introduction
  268. 1.6 Standards
  269. =============
  270. * Menu:
  271. * Varying Length Character Strings::
  272. The GNU Fortran compiler implements ISO/IEC 1539:1997 (Fortran 95). As
  273. such, it can also compile essentially all standard-compliant Fortran 90
  274. and Fortran 77 programs. It also supports the ISO/IEC TR-15581
  275. enhancements to allocatable arrays.
  276. GNU Fortran also have a partial support for ISO/IEC 1539-1:2004
  277. (Fortran 2003), ISO/IEC 1539-1:2010 (Fortran 2008), the Technical
  278. Specification 'Further Interoperability of Fortran with C' (ISO/IEC TS
  279. 29113:2012). Full support of those standards and future Fortran
  280. standards is planned. The current status of the support is can be found
  281. in the *note Fortran 2003 status::, *note Fortran 2008 status:: and
  282. *note Fortran 2018 status:: sections of the documentation.
  283. Additionally, the GNU Fortran compilers supports the OpenMP
  284. specification (version 4.0 and most of the features of the 4.5 version,
  285. <http://openmp.org/wp/openmp-specifications/>). There also is support
  286. for the OpenACC specification (targeting version 2.6,
  287. <http://www.openacc.org/>). See <https://gcc.gnu.org/wiki/OpenACC> for
  288. more information.
  289. 
  290. File: gfortran.info, Node: Varying Length Character Strings, Up: Standards
  291. 1.6.1 Varying Length Character Strings
  292. --------------------------------------
  293. The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000)
  294. varying length character strings. While GNU Fortran currently does not
  295. support such strings directly, there exist two Fortran implementations
  296. for them, which work with GNU Fortran. They can be found at
  297. <http://www.fortran.com/iso_varying_string.f95> and at
  298. <ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/>.
  299. Deferred-length character strings of Fortran 2003 supports part of
  300. the features of 'ISO_VARYING_STRING' and should be considered as
  301. replacement. (Namely, allocatable or pointers of the type
  302. 'character(len=:)'.)
  303. 
  304. File: gfortran.info, Node: Invoking GNU Fortran, Next: Runtime, Prev: Introduction, Up: Top
  305. 2 GNU Fortran Command Options
  306. *****************************
  307. The 'gfortran' command supports all the options supported by the 'gcc'
  308. command. Only options specific to GNU Fortran are documented here.
  309. *Note GCC Command Options: (gcc)Invoking GCC, for information on the
  310. non-Fortran-specific aspects of the 'gcc' command (and, therefore, the
  311. 'gfortran' command).
  312. All GCC and GNU Fortran options are accepted both by 'gfortran' and
  313. by 'gcc' (as well as any other drivers built at the same time, such as
  314. 'g++'), since adding GNU Fortran to the GCC distribution enables
  315. acceptance of GNU Fortran options by all of the relevant drivers.
  316. In some cases, options have positive and negative forms; the negative
  317. form of '-ffoo' would be '-fno-foo'. This manual documents only one of
  318. these two forms, whichever one is not the default.
  319. * Menu:
  320. * Option Summary:: Brief list of all 'gfortran' options,
  321. without explanations.
  322. * Fortran Dialect Options:: Controlling the variant of Fortran language
  323. compiled.
  324. * Preprocessing Options:: Enable and customize preprocessing.
  325. * Error and Warning Options:: How picky should the compiler be?
  326. * Debugging Options:: Symbol tables, measurements, and debugging dumps.
  327. * Directory Options:: Where to find module files
  328. * Link Options :: Influencing the linking step
  329. * Runtime Options:: Influencing runtime behavior
  330. * Code Gen Options:: Specifying conventions for function calls, data layout
  331. and register usage.
  332. * Interoperability Options:: Options for interoperability with other
  333. languages.
  334. * Environment Variables:: Environment variables that affect 'gfortran'.
  335. 
  336. File: gfortran.info, Node: Option Summary, Next: Fortran Dialect Options, Up: Invoking GNU Fortran
  337. 2.1 Option summary
  338. ==================
  339. Here is a summary of all the options specific to GNU Fortran, grouped by
  340. type. Explanations are in the following sections.
  341. _Fortran Language Options_
  342. *Note Options controlling Fortran dialect: Fortran Dialect Options.
  343. -fall-intrinsics -fallow-argument-mismatch -fallow-invalid-boz
  344. -fbackslash -fcray-pointer -fd-lines-as-code -fd-lines-as-comments
  345. -fdec -fdec-char-conversions -fdec-structure -fdec-intrinsic-ints
  346. -fdec-static -fdec-math -fdec-include -fdec-format-defaults
  347. -fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8
  348. -fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok
  349. -ffixed-line-length-N -ffixed-line-length-none -fpad-source
  350. -ffree-form -ffree-line-length-N -ffree-line-length-none
  351. -fimplicit-none -finteger-4-integer-8 -fmax-identifier-length
  352. -fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp
  353. -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10
  354. -freal-8-real-16 -freal-8-real-4 -std=STD -ftest-forall-temp
  355. _Preprocessing Options_
  356. *Note Enable and customize preprocessing: Preprocessing Options.
  357. -A-QUESTION[=ANSWER]
  358. -AQUESTION=ANSWER -C -CC -DMACRO[=DEFN]
  359. -H -P
  360. -UMACRO -cpp -dD -dI -dM -dN -dU -fworking-directory
  361. -imultilib DIR
  362. -iprefix FILE -iquote -isysroot DIR -isystem DIR -nocpp
  363. -nostdinc
  364. -undef
  365. _Error and Warning Options_
  366. *Note Options to request or suppress errors and warnings: Error and
  367. Warning Options.
  368. -Waliasing -Wall -Wampersand -Warray-bounds
  369. -Wc-binding-type -Wcharacter-truncation -Wconversion
  370. -Wdo-subscript -Wfunction-elimination -Wimplicit-interface
  371. -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only
  372. -Wintrinsics-std -Wline-truncation -Wno-align-commons
  373. -Wno-overwrite-recursive -Wno-tabs -Wreal-q-constant -Wsurprising
  374. -Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all
  375. -Wfrontend-loop-interchange -Wtarget-lifetime -fmax-errors=N
  376. -fsyntax-only -pedantic
  377. -pedantic-errors
  378. _Debugging Options_
  379. *Note Options for debugging your program or GNU Fortran: Debugging
  380. Options.
  381. -fbacktrace -fdump-fortran-optimized -fdump-fortran-original
  382. -fdump-fortran-global -fdump-parse-tree -ffpe-trap=LIST
  383. -ffpe-summary=LIST
  384. _Directory Options_
  385. *Note Options for directory search: Directory Options.
  386. -IDIR -JDIR -fintrinsic-modules-path DIR
  387. _Link Options_
  388. *Note Options for influencing the linking step: Link Options.
  389. -static-libgfortran
  390. _Runtime Options_
  391. *Note Options for influencing runtime behavior: Runtime Options.
  392. -fconvert=CONVERSION -fmax-subrecord-length=LENGTH
  393. -frecord-marker=LENGTH -fsign-zero
  394. _Interoperability Options_
  395. *Note Options for interoperability: Interoperability Options.
  396. -fc-prototypes -fc-prototypes-external
  397. _Code Generation Options_
  398. *Note Options for code generation conventions: Code Gen Options.
  399. -faggressive-function-elimination -fblas-matmul-limit=N
  400. -fbounds-check -ftail-call-workaround -ftail-call-workaround=N
  401. -fcheck-array-temporaries
  402. -fcheck=<ALL|ARRAY-TEMPS|BITS|BOUNDS|DO|MEM|POINTER|RECURSION>
  403. -fcoarray=<NONE|SINGLE|LIB> -fexternal-blas -ff2c
  404. -ffrontend-loop-interchange -ffrontend-optimize
  405. -finit-character=N -finit-integer=N -finit-local-zero
  406. -finit-derived -finit-logical=<TRUE|FALSE>
  407. -finit-real=<ZERO|INF|-INF|NAN|SNAN>
  408. -finline-matmul-limit=N
  409. -finline-arg-packing -fmax-array-constructor=N
  410. -fmax-stack-var-size=N -fno-align-commons -fno-automatic
  411. -fno-protect-parens -fno-underscoring -fsecond-underscore
  412. -fpack-derived -frealloc-lhs -frecursive -frepack-arrays
  413. -fshort-enums -fstack-arrays
  414. 
  415. File: gfortran.info, Node: Fortran Dialect Options, Next: Preprocessing Options, Prev: Option Summary, Up: Invoking GNU Fortran
  416. 2.2 Options controlling Fortran dialect
  417. =======================================
  418. The following options control the details of the Fortran dialect
  419. accepted by the compiler:
  420. '-ffree-form'
  421. '-ffixed-form'
  422. Specify the layout used by the source file. The free form layout
  423. was introduced in Fortran 90. Fixed form was traditionally used in
  424. older Fortran programs. When neither option is specified, the
  425. source form is determined by the file extension.
  426. '-fall-intrinsics'
  427. This option causes all intrinsic procedures (including the
  428. GNU-specific extensions) to be accepted. This can be useful with
  429. '-std=f95' to force standard-compliance but get access to the full
  430. range of intrinsics available with 'gfortran'. As a consequence,
  431. '-Wintrinsics-std' will be ignored and no user-defined procedure
  432. with the same name as any intrinsic will be called except when it
  433. is explicitly declared 'EXTERNAL'.
  434. '-fallow-argument-mismatch'
  435. Some code contains calls to external procedures whith mismatches
  436. between the calls and the procedure definition, or with mismatches
  437. between different calls. Such code is non-conforming, and will
  438. usually be flagged wi1th an error. This options degrades the error
  439. to a warning, which can only be disabled by disabling all warnings
  440. vial '-w'. Only a single occurrence per argument is flagged by
  441. this warning. '-fallow-argument-mismatch' is implied by
  442. '-std=legacy'.
  443. Using this option is _strongly_ discouraged. It is possible to
  444. provide standard-conforming code which allows different types of
  445. arguments by using an explicit interface and 'TYPE(*)'.
  446. '-fallow-invalid-boz'
  447. A BOZ literal constant can occur in a limited number of contexts in
  448. standard conforming Fortran. This option degrades an error
  449. condition to a warning, and allows a BOZ literal constant to appear
  450. where the Fortran standard would otherwise prohibit its use.
  451. '-fd-lines-as-code'
  452. '-fd-lines-as-comments'
  453. Enable special treatment for lines beginning with 'd' or 'D' in
  454. fixed form sources. If the '-fd-lines-as-code' option is given
  455. they are treated as if the first column contained a blank. If the
  456. '-fd-lines-as-comments' option is given, they are treated as
  457. comment lines.
  458. '-fdec'
  459. DEC compatibility mode. Enables extensions and other features that
  460. mimic the default behavior of older compilers (such as DEC). These
  461. features are non-standard and should be avoided at all costs. For
  462. details on GNU Fortran's implementation of these extensions see the
  463. full documentation.
  464. Other flags enabled by this switch are: '-fdollar-ok'
  465. '-fcray-pointer' '-fdec-char-conversions' '-fdec-structure'
  466. '-fdec-intrinsic-ints' '-fdec-static' '-fdec-math' '-fdec-include'
  467. '-fdec-blank-format-item' '-fdec-format-defaults'
  468. If '-fd-lines-as-code'/'-fd-lines-as-comments' are unset, then
  469. '-fdec' also sets '-fd-lines-as-comments'.
  470. '-fdec-char-conversions'
  471. Enable the use of character literals in assignments and 'DATA'
  472. statements for non-character variables.
  473. '-fdec-structure'
  474. Enable DEC 'STRUCTURE' and 'RECORD' as well as 'UNION', 'MAP', and
  475. dot ('.') as a member separator (in addition to '%'). This is
  476. provided for compatibility only; Fortran 90 derived types should be
  477. used instead where possible.
  478. '-fdec-intrinsic-ints'
  479. Enable B/I/J/K kind variants of existing integer functions (e.g.
  480. BIAND, IIAND, JIAND, etc...). For a complete list of intrinsics
  481. see the full documentation.
  482. '-fdec-math'
  483. Enable legacy math intrinsics such as COTAN and degree-valued
  484. trigonometric functions (e.g. TAND, ATAND, etc...) for
  485. compatability with older code.
  486. '-fdec-static'
  487. Enable DEC-style STATIC and AUTOMATIC attributes to explicitly
  488. specify the storage of variables and other objects.
  489. '-fdec-include'
  490. Enable parsing of INCLUDE as a statement in addition to parsing it
  491. as INCLUDE line. When parsed as INCLUDE statement, INCLUDE does
  492. not have to be on a single line and can use line continuations.
  493. '-fdec-format-defaults'
  494. Enable format specifiers F, G and I to be used without width
  495. specifiers, default widths will be used instead.
  496. '-fdec-blank-format-item'
  497. Enable a blank format item at the end of a format specification
  498. i.e. nothing following the final comma.
  499. '-fdollar-ok'
  500. Allow '$' as a valid non-first character in a symbol name. Symbols
  501. that start with '$' are rejected since it is unclear which rules to
  502. apply to implicit typing as different vendors implement different
  503. rules. Using '$' in 'IMPLICIT' statements is also rejected.
  504. '-fbackslash'
  505. Change the interpretation of backslashes in string literals from a
  506. single backslash character to "C-style" escape characters. The
  507. following combinations are expanded '\a', '\b', '\f', '\n', '\r',
  508. '\t', '\v', '\\', and '\0' to the ASCII characters alert,
  509. backspace, form feed, newline, carriage return, horizontal tab,
  510. vertical tab, backslash, and NUL, respectively. Additionally,
  511. '\x'NN, '\u'NNNN and '\U'NNNNNNNN (where each N is a hexadecimal
  512. digit) are translated into the Unicode characters corresponding to
  513. the specified code points. All other combinations of a character
  514. preceded by \ are unexpanded.
  515. '-fmodule-private'
  516. Set the default accessibility of module entities to 'PRIVATE'.
  517. Use-associated entities will not be accessible unless they are
  518. explicitly declared as 'PUBLIC'.
  519. '-ffixed-line-length-N'
  520. Set column after which characters are ignored in typical fixed-form
  521. lines in the source file, and, unless '-fno-pad-source', through
  522. which spaces are assumed (as if padded to that length) after the
  523. ends of short fixed-form lines.
  524. Popular values for N include 72 (the standard and the default), 80
  525. (card image), and 132 (corresponding to "extended-source" options
  526. in some popular compilers). N may also be 'none', meaning that the
  527. entire line is meaningful and that continued character constants
  528. never have implicit spaces appended to them to fill out the line.
  529. '-ffixed-line-length-0' means the same thing as
  530. '-ffixed-line-length-none'.
  531. '-fno-pad-source'
  532. By default fixed-form lines have spaces assumed (as if padded to
  533. that length) after the ends of short fixed-form lines. This is not
  534. done either if '-ffixed-line-length-0', '-ffixed-line-length-none'
  535. or if '-fno-pad-source' option is used. With any of those options
  536. continued character constants never have implicit spaces appended
  537. to them to fill out the line.
  538. '-ffree-line-length-N'
  539. Set column after which characters are ignored in typical free-form
  540. lines in the source file. The default value is 132. N may be
  541. 'none', meaning that the entire line is meaningful.
  542. '-ffree-line-length-0' means the same thing as
  543. '-ffree-line-length-none'.
  544. '-fmax-identifier-length=N'
  545. Specify the maximum allowed identifier length. Typical values are
  546. 31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
  547. '-fimplicit-none'
  548. Specify that no implicit typing is allowed, unless overridden by
  549. explicit 'IMPLICIT' statements. This is the equivalent of adding
  550. 'implicit none' to the start of every procedure.
  551. '-fcray-pointer'
  552. Enable the Cray pointer extension, which provides C-like pointer
  553. functionality.
  554. '-fopenacc'
  555. Enable the OpenACC extensions. This includes OpenACC '!$acc'
  556. directives in free form and 'c$acc', '*$acc' and '!$acc' directives
  557. in fixed form, '!$' conditional compilation sentinels in free form
  558. and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
  559. arranges for the OpenACC runtime library to be linked in.
  560. '-fopenmp'
  561. Enable the OpenMP extensions. This includes OpenMP '!$omp'
  562. directives in free form and 'c$omp', '*$omp' and '!$omp' directives
  563. in fixed form, '!$' conditional compilation sentinels in free form
  564. and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
  565. arranges for the OpenMP runtime library to be linked in. The
  566. option '-fopenmp' implies '-frecursive'.
  567. '-fno-range-check'
  568. Disable range checking on results of simplification of constant
  569. expressions during compilation. For example, GNU Fortran will give
  570. an error at compile time when simplifying 'a = 1. / 0'. With this
  571. option, no error will be given and 'a' will be assigned the value
  572. '+Infinity'. If an expression evaluates to a value outside of the
  573. relevant range of ['-HUGE()':'HUGE()'], then the expression will be
  574. replaced by '-Inf' or '+Inf' as appropriate. Similarly, 'DATA
  575. i/Z'FFFFFFFF'/' will result in an integer overflow on most systems,
  576. but with '-fno-range-check' the value will "wrap around" and 'i'
  577. will be initialized to -1 instead.
  578. '-fdefault-integer-8'
  579. Set the default integer and logical types to an 8 byte wide type.
  580. This option also affects the kind of integer constants like '42'.
  581. Unlike '-finteger-4-integer-8', it does not promote variables with
  582. explicit kind declaration.
  583. '-fdefault-real-8'
  584. Set the default real type to an 8 byte wide type. This option also
  585. affects the kind of non-double real constants like '1.0'. This
  586. option promotes the default width of 'DOUBLE PRECISION' and double
  587. real constants like '1.d0' to 16 bytes if possible. If
  588. '-fdefault-double-8' is given along with 'fdefault-real-8', 'DOUBLE
  589. PRECISION' and double real constants are not promoted. Unlike
  590. '-freal-4-real-8', 'fdefault-real-8' does not promote variables
  591. with explicit kind declarations.
  592. '-fdefault-real-10'
  593. Set the default real type to an 10 byte wide type. This option
  594. also affects the kind of non-double real constants like '1.0'.
  595. This option promotes the default width of 'DOUBLE PRECISION' and
  596. double real constants like '1.d0' to 16 bytes if possible. If
  597. '-fdefault-double-8' is given along with 'fdefault-real-10',
  598. 'DOUBLE PRECISION' and double real constants are not promoted.
  599. Unlike '-freal-4-real-10', 'fdefault-real-10' does not promote
  600. variables with explicit kind declarations.
  601. '-fdefault-real-16'
  602. Set the default real type to an 16 byte wide type. This option
  603. also affects the kind of non-double real constants like '1.0'.
  604. This option promotes the default width of 'DOUBLE PRECISION' and
  605. double real constants like '1.d0' to 16 bytes if possible. If
  606. '-fdefault-double-8' is given along with 'fdefault-real-16',
  607. 'DOUBLE PRECISION' and double real constants are not promoted.
  608. Unlike '-freal-4-real-16', 'fdefault-real-16' does not promote
  609. variables with explicit kind declarations.
  610. '-fdefault-double-8'
  611. Set the 'DOUBLE PRECISION' type and double real constants like
  612. '1.d0' to an 8 byte wide type. Do nothing if this is already the
  613. default. This option prevents '-fdefault-real-8',
  614. '-fdefault-real-10', and '-fdefault-real-16', from promoting
  615. 'DOUBLE PRECISION' and double real constants like '1.d0' to 16
  616. bytes.
  617. '-finteger-4-integer-8'
  618. Promote all 'INTEGER(KIND=4)' entities to an 'INTEGER(KIND=8)'
  619. entities. If 'KIND=8' is unavailable, then an error will be
  620. issued. This option should be used with care and may not be
  621. suitable for your codes. Areas of possible concern include calls
  622. to external procedures, alignment in 'EQUIVALENCE' and/or 'COMMON',
  623. generic interfaces, BOZ literal constant conversion, and I/O.
  624. Inspection of the intermediate representation of the translated
  625. Fortran code, produced by '-fdump-tree-original', is suggested.
  626. '-freal-4-real-8'
  627. '-freal-4-real-10'
  628. '-freal-4-real-16'
  629. '-freal-8-real-4'
  630. '-freal-8-real-10'
  631. '-freal-8-real-16'
  632. Promote all 'REAL(KIND=M)' entities to 'REAL(KIND=N)' entities. If
  633. 'REAL(KIND=N)' is unavailable, then an error will be issued. All
  634. other real kind types are unaffected by this option. These options
  635. should be used with care and may not be suitable for your codes.
  636. Areas of possible concern include calls to external procedures,
  637. alignment in 'EQUIVALENCE' and/or 'COMMON', generic interfaces, BOZ
  638. literal constant conversion, and I/O. Inspection of the
  639. intermediate representation of the translated Fortran code,
  640. produced by '-fdump-tree-original', is suggested.
  641. '-std=STD'
  642. Specify the standard to which the program is expected to conform,
  643. which may be one of 'f95', 'f2003', 'f2008', 'f2018', 'gnu', or
  644. 'legacy'. The default value for STD is 'gnu', which specifies a
  645. superset of the latest Fortran standard that includes all of the
  646. extensions supported by GNU Fortran, although warnings will be
  647. given for obsolete extensions not recommended for use in new code.
  648. The 'legacy' value is equivalent but without the warnings for
  649. obsolete extensions, and may be useful for old non-standard
  650. programs. The 'f95', 'f2003', 'f2008', and 'f2018' values specify
  651. strict conformance to the Fortran 95, Fortran 2003, Fortran 2008
  652. and Fortran 2018 standards, respectively; errors are given for all
  653. extensions beyond the relevant language standard, and warnings are
  654. given for the Fortran 77 features that are permitted but
  655. obsolescent in later standards. The deprecated option
  656. '-std=f2008ts' acts as an alias for '-std=f2018'. It is only
  657. present for backwards compatibility with earlier gfortran versions
  658. and should not be used any more.
  659. '-ftest-forall-temp'
  660. Enhance test coverage by forcing most forall assignments to use
  661. temporary.
  662. 
  663. File: gfortran.info, Node: Preprocessing Options, Next: Error and Warning Options, Prev: Fortran Dialect Options, Up: Invoking GNU Fortran
  664. 2.3 Enable and customize preprocessing
  665. ======================================
  666. Preprocessor related options. See section *note Preprocessing and
  667. conditional compilation:: for more detailed information on preprocessing
  668. in 'gfortran'.
  669. '-cpp'
  670. '-nocpp'
  671. Enable preprocessing. The preprocessor is automatically invoked if
  672. the file extension is '.fpp', '.FPP', '.F', '.FOR', '.FTN', '.F90',
  673. '.F95', '.F03' or '.F08'. Use this option to manually enable
  674. preprocessing of any kind of Fortran file.
  675. To disable preprocessing of files with any of the above listed
  676. extensions, use the negative form: '-nocpp'.
  677. The preprocessor is run in traditional mode. Any restrictions of
  678. the file-format, especially the limits on line length, apply for
  679. preprocessed output as well, so it might be advisable to use the
  680. '-ffree-line-length-none' or '-ffixed-line-length-none' options.
  681. '-dM'
  682. Instead of the normal output, generate a list of ''#define''
  683. directives for all the macros defined during the execution of the
  684. preprocessor, including predefined macros. This gives you a way of
  685. finding out what is predefined in your version of the preprocessor.
  686. Assuming you have no file 'foo.f90', the command
  687. touch foo.f90; gfortran -cpp -E -dM foo.f90
  688. will show all the predefined macros.
  689. '-dD'
  690. Like '-dM' except in two respects: it does not include the
  691. predefined macros, and it outputs both the '#define' directives and
  692. the result of preprocessing. Both kinds of output go to the
  693. standard output file.
  694. '-dN'
  695. Like '-dD', but emit only the macro names, not their expansions.
  696. '-dU'
  697. Like 'dD' except that only macros that are expanded, or whose
  698. definedness is tested in preprocessor directives, are output; the
  699. output is delayed until the use or test of the macro; and
  700. ''#undef'' directives are also output for macros tested but
  701. undefined at the time.
  702. '-dI'
  703. Output ''#include'' directives in addition to the result of
  704. preprocessing.
  705. '-fworking-directory'
  706. Enable generation of linemarkers in the preprocessor output that
  707. will let the compiler know the current working directory at the
  708. time of preprocessing. When this option is enabled, the
  709. preprocessor will emit, after the initial linemarker, a second
  710. linemarker with the current working directory followed by two
  711. slashes. GCC will use this directory, when it is present in the
  712. preprocessed input, as the directory emitted as the current working
  713. directory in some debugging information formats. This option is
  714. implicitly enabled if debugging information is enabled, but this
  715. can be inhibited with the negated form '-fno-working-directory'.
  716. If the '-P' flag is present in the command line, this option has no
  717. effect, since no '#line' directives are emitted whatsoever.
  718. '-idirafter DIR'
  719. Search DIR for include files, but do it after all directories
  720. specified with '-I' and the standard system directories have been
  721. exhausted. DIR is treated as a system include directory. If dir
  722. begins with '=', then the '=' will be replaced by the sysroot
  723. prefix; see '--sysroot' and '-isysroot'.
  724. '-imultilib DIR'
  725. Use DIR as a subdirectory of the directory containing
  726. target-specific C++ headers.
  727. '-iprefix PREFIX'
  728. Specify PREFIX as the prefix for subsequent '-iwithprefix' options.
  729. If the PREFIX represents a directory, you should include the final
  730. ''/''.
  731. '-isysroot DIR'
  732. This option is like the '--sysroot' option, but applies only to
  733. header files. See the '--sysroot' option for more information.
  734. '-iquote DIR'
  735. Search DIR only for header files requested with '#include "file"';
  736. they are not searched for '#include <file>', before all directories
  737. specified by '-I' and before the standard system directories. If
  738. DIR begins with '=', then the '=' will be replaced by the sysroot
  739. prefix; see '--sysroot' and '-isysroot'.
  740. '-isystem DIR'
  741. Search DIR for header files, after all directories specified by
  742. '-I' but before the standard system directories. Mark it as a
  743. system directory, so that it gets the same special treatment as is
  744. applied to the standard system directories. If DIR begins with
  745. '=', then the '=' will be replaced by the sysroot prefix; see
  746. '--sysroot' and '-isysroot'.
  747. '-nostdinc'
  748. Do not search the standard system directories for header files.
  749. Only the directories you have specified with '-I' options (and the
  750. directory of the current file, if appropriate) are searched.
  751. '-undef'
  752. Do not predefine any system-specific or GCC-specific macros. The
  753. standard predefined macros remain defined.
  754. '-APREDICATE=ANSWER'
  755. Make an assertion with the predicate PREDICATE and answer ANSWER.
  756. This form is preferred to the older form -A predicate(answer),
  757. which is still supported, because it does not use shell special
  758. characters.
  759. '-A-PREDICATE=ANSWER'
  760. Cancel an assertion with the predicate PREDICATE and answer ANSWER.
  761. '-C'
  762. Do not discard comments. All comments are passed through to the
  763. output file, except for comments in processed directives, which are
  764. deleted along with the directive.
  765. You should be prepared for side effects when using '-C'; it causes
  766. the preprocessor to treat comments as tokens in their own right.
  767. For example, comments appearing at the start of what would be a
  768. directive line have the effect of turning that line into an
  769. ordinary source line, since the first token on the line is no
  770. longer a ''#''.
  771. Warning: this currently handles C-Style comments only. The
  772. preprocessor does not yet recognize Fortran-style comments.
  773. '-CC'
  774. Do not discard comments, including during macro expansion. This is
  775. like '-C', except that comments contained within macros are also
  776. passed through to the output file where the macro is expanded.
  777. In addition to the side-effects of the '-C' option, the '-CC'
  778. option causes all C++-style comments inside a macro to be converted
  779. to C-style comments. This is to prevent later use of that macro
  780. from inadvertently commenting out the remainder of the source line.
  781. The '-CC' option is generally used to support lint comments.
  782. Warning: this currently handles C- and C++-Style comments only.
  783. The preprocessor does not yet recognize Fortran-style comments.
  784. '-DNAME'
  785. Predefine name as a macro, with definition '1'.
  786. '-DNAME=DEFINITION'
  787. The contents of DEFINITION are tokenized and processed as if they
  788. appeared during translation phase three in a ''#define'' directive.
  789. In particular, the definition will be truncated by embedded newline
  790. characters.
  791. If you are invoking the preprocessor from a shell or shell-like
  792. program you may need to use the shell's quoting syntax to protect
  793. characters such as spaces that have a meaning in the shell syntax.
  794. If you wish to define a function-like macro on the command line,
  795. write its argument list with surrounding parentheses before the
  796. equals sign (if any). Parentheses are meaningful to most shells,
  797. so you will need to quote the option. With sh and csh,
  798. '-D'name(args...)=definition'' works.
  799. '-D' and '-U' options are processed in the order they are given on
  800. the command line. All -imacros file and -include file options are
  801. processed after all -D and -U options.
  802. '-H'
  803. Print the name of each header file used, in addition to other
  804. normal activities. Each name is indented to show how deep in the
  805. ''#include'' stack it is.
  806. '-P'
  807. Inhibit generation of linemarkers in the output from the
  808. preprocessor. This might be useful when running the preprocessor
  809. on something that is not C code, and will be sent to a program
  810. which might be confused by the linemarkers.
  811. '-UNAME'
  812. Cancel any previous definition of NAME, either built in or provided
  813. with a '-D' option.
  814. 
  815. File: gfortran.info, Node: Error and Warning Options, Next: Debugging Options, Prev: Preprocessing Options, Up: Invoking GNU Fortran
  816. 2.4 Options to request or suppress errors and warnings
  817. ======================================================
  818. Errors are diagnostic messages that report that the GNU Fortran compiler
  819. cannot compile the relevant piece of source code. The compiler will
  820. continue to process the program in an attempt to report further errors
  821. to aid in debugging, but will not produce any compiled output.
  822. Warnings are diagnostic messages that report constructions which are
  823. not inherently erroneous but which are risky or suggest there is likely
  824. to be a bug in the program. Unless '-Werror' is specified, they do not
  825. prevent compilation of the program.
  826. You can request many specific warnings with options beginning '-W',
  827. for example '-Wimplicit' to request warnings on implicit declarations.
  828. Each of these specific warning options also has a negative form
  829. beginning '-Wno-' to turn off warnings; for example, '-Wno-implicit'.
  830. This manual lists only one of the two forms, whichever is not the
  831. default.
  832. These options control the amount and kinds of errors and warnings
  833. produced by GNU Fortran:
  834. '-fmax-errors=N'
  835. Limits the maximum number of error messages to N, at which point
  836. GNU Fortran bails out rather than attempting to continue processing
  837. the source code. If N is 0, there is no limit on the number of
  838. error messages produced.
  839. '-fsyntax-only'
  840. Check the code for syntax errors, but do not actually compile it.
  841. This will generate module files for each module present in the
  842. code, but no other output file.
  843. '-Wpedantic'
  844. '-pedantic'
  845. Issue warnings for uses of extensions to Fortran. '-pedantic' also
  846. applies to C-language constructs where they occur in GNU Fortran
  847. source files, such as use of '\e' in a character constant within a
  848. directive like '#include'.
  849. Valid Fortran programs should compile properly with or without this
  850. option. However, without this option, certain GNU extensions and
  851. traditional Fortran features are supported as well. With this
  852. option, many of them are rejected.
  853. Some users try to use '-pedantic' to check programs for
  854. conformance. They soon find that it does not do quite what they
  855. want--it finds some nonstandard practices, but not all. However,
  856. improvements to GNU Fortran in this area are welcome.
  857. This should be used in conjunction with '-std=f95', '-std=f2003',
  858. '-std=f2008' or '-std=f2018'.
  859. '-pedantic-errors'
  860. Like '-pedantic', except that errors are produced rather than
  861. warnings.
  862. '-Wall'
  863. Enables commonly used warning options pertaining to usage that we
  864. recommend avoiding and that we believe are easy to avoid. This
  865. currently includes '-Waliasing', '-Wampersand', '-Wconversion',
  866. '-Wsurprising', '-Wc-binding-type', '-Wintrinsics-std', '-Wtabs',
  867. '-Wintrinsic-shadow', '-Wline-truncation', '-Wtarget-lifetime',
  868. '-Winteger-division', '-Wreal-q-constant', '-Wunused' and
  869. '-Wundefined-do-loop'.
  870. '-Waliasing'
  871. Warn about possible aliasing of dummy arguments. Specifically, it
  872. warns if the same actual argument is associated with a dummy
  873. argument with 'INTENT(IN)' and a dummy argument with 'INTENT(OUT)'
  874. in a call with an explicit interface.
  875. The following example will trigger the warning.
  876. interface
  877. subroutine bar(a,b)
  878. integer, intent(in) :: a
  879. integer, intent(out) :: b
  880. end subroutine
  881. end interface
  882. integer :: a
  883. call bar(a,a)
  884. '-Wampersand'
  885. Warn about missing ampersand in continued character constants. The
  886. warning is given with '-Wampersand', '-pedantic', '-std=f95',
  887. '-std=f2003', '-std=f2008' and '-std=f2018'. Note: With no
  888. ampersand given in a continued character constant, GNU Fortran
  889. assumes continuation at the first non-comment, non-whitespace
  890. character after the ampersand that initiated the continuation.
  891. '-Warray-temporaries'
  892. Warn about array temporaries generated by the compiler. The
  893. information generated by this warning is sometimes useful in
  894. optimization, in order to avoid such temporaries.
  895. '-Wc-binding-type'
  896. Warn if the a variable might not be C interoperable. In
  897. particular, warn if the variable has been declared using an
  898. intrinsic type with default kind instead of using a kind parameter
  899. defined for C interoperability in the intrinsic 'ISO_C_Binding'
  900. module. This option is implied by '-Wall'.
  901. '-Wcharacter-truncation'
  902. Warn when a character assignment will truncate the assigned string.
  903. '-Wline-truncation'
  904. Warn when a source code line will be truncated. This option is
  905. implied by '-Wall'. For free-form source code, the default is
  906. '-Werror=line-truncation' such that truncations are reported as
  907. error.
  908. '-Wconversion'
  909. Warn about implicit conversions that are likely to change the value
  910. of the expression after conversion. Implied by '-Wall'.
  911. '-Wconversion-extra'
  912. Warn about implicit conversions between different types and kinds.
  913. This option does _not_ imply '-Wconversion'.
  914. '-Wextra'
  915. Enables some warning options for usages of language features which
  916. may be problematic. This currently includes '-Wcompare-reals',
  917. '-Wunused-parameter' and '-Wdo-subscript'.
  918. '-Wfrontend-loop-interchange'
  919. Warn when using '-ffrontend-loop-interchange' for performing loop
  920. interchanges.
  921. '-Wimplicit-interface'
  922. Warn if a procedure is called without an explicit interface. Note
  923. this only checks that an explicit interface is present. It does
  924. not check that the declared interfaces are consistent across
  925. program units.
  926. '-Wimplicit-procedure'
  927. Warn if a procedure is called that has neither an explicit
  928. interface nor has been declared as 'EXTERNAL'.
  929. '-Winteger-division'
  930. Warn if a constant integer division truncates its result. As an
  931. example, 3/5 evaluates to 0.
  932. '-Wintrinsics-std'
  933. Warn if 'gfortran' finds a procedure named like an intrinsic not
  934. available in the currently selected standard (with '-std') and
  935. treats it as 'EXTERNAL' procedure because of this.
  936. '-fall-intrinsics' can be used to never trigger this behavior and
  937. always link to the intrinsic regardless of the selected standard.
  938. '-Wno-overwrite-recursive'
  939. Do not warn when '-fno-automatic' is used with '-frecursive'.
  940. Recursion will be broken if the relevant local variables do not
  941. have the attribute 'AUTOMATIC' explicitly declared. This option
  942. can be used to suppress the warning when it is known that recursion
  943. is not broken. Useful for build environments that use '-Werror'.
  944. '-Wreal-q-constant'
  945. Produce a warning if a real-literal-constant contains a 'q'
  946. exponent-letter.
  947. '-Wsurprising'
  948. Produce a warning when "suspicious" code constructs are
  949. encountered. While technically legal these usually indicate that
  950. an error has been made.
  951. This currently produces a warning under the following
  952. circumstances:
  953. * An INTEGER SELECT construct has a CASE that can never be
  954. matched as its lower value is greater than its upper value.
  955. * A LOGICAL SELECT construct has three CASE statements.
  956. * A TRANSFER specifies a source that is shorter than the
  957. destination.
  958. * The type of a function result is declared more than once with
  959. the same type. If '-pedantic' or standard-conforming mode is
  960. enabled, this is an error.
  961. * A 'CHARACTER' variable is declared with negative length.
  962. '-Wtabs'
  963. By default, tabs are accepted as whitespace, but tabs are not
  964. members of the Fortran Character Set. For continuation lines, a
  965. tab followed by a digit between 1 and 9 is supported. '-Wtabs'
  966. will cause a warning to be issued if a tab is encountered. Note,
  967. '-Wtabs' is active for '-pedantic', '-std=f95', '-std=f2003',
  968. '-std=f2008', '-std=f2018' and '-Wall'.
  969. '-Wundefined-do-loop'
  970. Warn if a DO loop with step either 1 or -1 yields an underflow or
  971. an overflow during iteration of an induction variable of the loop.
  972. This option is implied by '-Wall'.
  973. '-Wunderflow'
  974. Produce a warning when numerical constant expressions are
  975. encountered, which yield an UNDERFLOW during compilation. Enabled
  976. by default.
  977. '-Wintrinsic-shadow'
  978. Warn if a user-defined procedure or module procedure has the same
  979. name as an intrinsic; in this case, an explicit interface or
  980. 'EXTERNAL' or 'INTRINSIC' declaration might be needed to get calls
  981. later resolved to the desired intrinsic/procedure. This option is
  982. implied by '-Wall'.
  983. '-Wuse-without-only'
  984. Warn if a 'USE' statement has no 'ONLY' qualifier and thus
  985. implicitly imports all public entities of the used module.
  986. '-Wunused-dummy-argument'
  987. Warn about unused dummy arguments. This option is implied by
  988. '-Wall'.
  989. '-Wunused-parameter'
  990. Contrary to 'gcc''s meaning of '-Wunused-parameter', 'gfortran''s
  991. implementation of this option does not warn about unused dummy
  992. arguments (see '-Wunused-dummy-argument'), but about unused
  993. 'PARAMETER' values. '-Wunused-parameter' is implied by '-Wextra'
  994. if also '-Wunused' or '-Wall' is used.
  995. '-Walign-commons'
  996. By default, 'gfortran' warns about any occasion of variables being
  997. padded for proper alignment inside a 'COMMON' block. This warning
  998. can be turned off via '-Wno-align-commons'. See also
  999. '-falign-commons'.
  1000. '-Wfunction-elimination'
  1001. Warn if any calls to impure functions are eliminated by the
  1002. optimizations enabled by the '-ffrontend-optimize' option. This
  1003. option is implied by '-Wextra'.
  1004. '-Wrealloc-lhs'
  1005. Warn when the compiler might insert code to for allocation or
  1006. reallocation of an allocatable array variable of intrinsic type in
  1007. intrinsic assignments. In hot loops, the Fortran 2003 reallocation
  1008. feature may reduce the performance. If the array is already
  1009. allocated with the correct shape, consider using a whole-array
  1010. array-spec (e.g. '(:,:,:)') for the variable on the left-hand side
  1011. to prevent the reallocation check. Note that in some cases the
  1012. warning is shown, even if the compiler will optimize reallocation
  1013. checks away. For instance, when the right-hand side contains the
  1014. same variable multiplied by a scalar. See also '-frealloc-lhs'.
  1015. '-Wrealloc-lhs-all'
  1016. Warn when the compiler inserts code to for allocation or
  1017. reallocation of an allocatable variable; this includes scalars and
  1018. derived types.
  1019. '-Wcompare-reals'
  1020. Warn when comparing real or complex types for equality or
  1021. inequality. This option is implied by '-Wextra'.
  1022. '-Wtarget-lifetime'
  1023. Warn if the pointer in a pointer assignment might be longer than
  1024. the its target. This option is implied by '-Wall'.
  1025. '-Wzerotrip'
  1026. Warn if a 'DO' loop is known to execute zero times at compile time.
  1027. This option is implied by '-Wall'.
  1028. '-Wdo-subscript'
  1029. Warn if an array subscript inside a DO loop could lead to an
  1030. out-of-bounds access even if the compiler cannot prove that the
  1031. statement is actually executed, in cases like
  1032. real a(3)
  1033. do i=1,4
  1034. if (condition(i)) then
  1035. a(i) = 1.2
  1036. end if
  1037. end do
  1038. This option is implied by '-Wextra'.
  1039. '-Werror'
  1040. Turns all warnings into errors.
  1041. *Note Options to Request or Suppress Errors and Warnings:
  1042. (gcc)Warning Options, for information on more options offered by the GBE
  1043. shared by 'gfortran', 'gcc' and other GNU compilers.
  1044. Some of these have no effect when compiling programs written in
  1045. Fortran.
  1046. 
  1047. File: gfortran.info, Node: Debugging Options, Next: Directory Options, Prev: Error and Warning Options, Up: Invoking GNU Fortran
  1048. 2.5 Options for debugging your program or GNU Fortran
  1049. =====================================================
  1050. GNU Fortran has various special options that are used for debugging
  1051. either your program or the GNU Fortran compiler.
  1052. '-fdump-fortran-original'
  1053. Output the internal parse tree after translating the source program
  1054. into internal representation. This option is mostly useful for
  1055. debugging the GNU Fortran compiler itself. The output generated by
  1056. this option might change between releases. This option may also
  1057. generate internal compiler errors for features which have only
  1058. recently been added.
  1059. '-fdump-fortran-optimized'
  1060. Output the parse tree after front-end optimization. Mostly useful
  1061. for debugging the GNU Fortran compiler itself. The output
  1062. generated by this option might change between releases. This
  1063. option may also generate internal compiler errors for features
  1064. which have only recently been added.
  1065. '-fdump-parse-tree'
  1066. Output the internal parse tree after translating the source program
  1067. into internal representation. Mostly useful for debugging the GNU
  1068. Fortran compiler itself. The output generated by this option might
  1069. change between releases. This option may also generate internal
  1070. compiler errors for features which have only recently been added.
  1071. This option is deprecated; use '-fdump-fortran-original' instead.
  1072. '-fdump-fortran-global'
  1073. Output a list of the global identifiers after translating into
  1074. middle-end representation. Mostly useful for debugging the GNU
  1075. Fortran compiler itself. The output generated by this option might
  1076. change between releases. This option may also generate internal
  1077. compiler errors for features which have only recently been added.
  1078. '-ffpe-trap=LIST'
  1079. Specify a list of floating point exception traps to enable. On
  1080. most systems, if a floating point exception occurs and the trap for
  1081. that exception is enabled, a SIGFPE signal will be sent and the
  1082. program being aborted, producing a core file useful for debugging.
  1083. LIST is a (possibly empty) comma-separated list of the following
  1084. exceptions: 'invalid' (invalid floating point operation, such as
  1085. 'SQRT(-1.0)'), 'zero' (division by zero), 'overflow' (overflow in a
  1086. floating point operation), 'underflow' (underflow in a floating
  1087. point operation), 'inexact' (loss of precision during operation),
  1088. and 'denormal' (operation performed on a denormal value). The
  1089. first five exceptions correspond to the five IEEE 754 exceptions,
  1090. whereas the last one ('denormal') is not part of the IEEE 754
  1091. standard but is available on some common architectures such as x86.
  1092. The first three exceptions ('invalid', 'zero', and 'overflow')
  1093. often indicate serious errors, and unless the program has
  1094. provisions for dealing with these exceptions, enabling traps for
  1095. these three exceptions is probably a good idea.
  1096. If the option is used more than once in the command line, the lists
  1097. will be joined: ''ffpe-trap='LIST1 'ffpe-trap='LIST2' is equivalent
  1098. to 'ffpe-trap='LIST1,LIST2.
  1099. Note that once enabled an exception cannot be disabled (no negative
  1100. form).
  1101. Many, if not most, floating point operations incur loss of
  1102. precision due to rounding, and hence the 'ffpe-trap=inexact' is
  1103. likely to be uninteresting in practice.
  1104. By default no exception traps are enabled.
  1105. '-ffpe-summary=LIST'
  1106. Specify a list of floating-point exceptions, whose flag status is
  1107. printed to 'ERROR_UNIT' when invoking 'STOP' and 'ERROR STOP'.
  1108. LIST can be either 'none', 'all' or a comma-separated list of the
  1109. following exceptions: 'invalid', 'zero', 'overflow', 'underflow',
  1110. 'inexact' and 'denormal'. (See '-ffpe-trap' for a description of
  1111. the exceptions.)
  1112. If the option is used more than once in the command line, only the
  1113. last one will be used.
  1114. By default, a summary for all exceptions but 'inexact' is shown.
  1115. '-fno-backtrace'
  1116. When a serious runtime error is encountered or a deadly signal is
  1117. emitted (segmentation fault, illegal instruction, bus error,
  1118. floating-point exception, and the other POSIX signals that have the
  1119. action 'core'), the Fortran runtime library tries to output a
  1120. backtrace of the error. '-fno-backtrace' disables the backtrace
  1121. generation. This option only has influence for compilation of the
  1122. Fortran main program.
  1123. *Note Options for Debugging Your Program or GCC: (gcc)Debugging
  1124. Options, for more information on debugging options.
  1125. 
  1126. File: gfortran.info, Node: Directory Options, Next: Link Options, Prev: Debugging Options, Up: Invoking GNU Fortran
  1127. 2.6 Options for directory search
  1128. ================================
  1129. These options affect how GNU Fortran searches for files specified by the
  1130. 'INCLUDE' directive and where it searches for previously compiled
  1131. modules.
  1132. It also affects the search paths used by 'cpp' when used to
  1133. preprocess Fortran source.
  1134. '-IDIR'
  1135. These affect interpretation of the 'INCLUDE' directive (as well as
  1136. of the '#include' directive of the 'cpp' preprocessor).
  1137. Also note that the general behavior of '-I' and 'INCLUDE' is pretty
  1138. much the same as of '-I' with '#include' in the 'cpp' preprocessor,
  1139. with regard to looking for 'header.gcc' files and other such
  1140. things.
  1141. This path is also used to search for '.mod' files when previously
  1142. compiled modules are required by a 'USE' statement.
  1143. *Note Options for Directory Search: (gcc)Directory Options, for
  1144. information on the '-I' option.
  1145. '-JDIR'
  1146. This option specifies where to put '.mod' files for compiled
  1147. modules. It is also added to the list of directories to searched
  1148. by an 'USE' statement.
  1149. The default is the current directory.
  1150. '-fintrinsic-modules-path DIR'
  1151. This option specifies the location of pre-compiled intrinsic
  1152. modules, if they are not in the default location expected by the
  1153. compiler.
  1154. 
  1155. File: gfortran.info, Node: Link Options, Next: Runtime Options, Prev: Directory Options, Up: Invoking GNU Fortran
  1156. 2.7 Influencing the linking step
  1157. ================================
  1158. These options come into play when the compiler links object files into
  1159. an executable output file. They are meaningless if the compiler is not
  1160. doing a link step.
  1161. '-static-libgfortran'
  1162. On systems that provide 'libgfortran' as a shared and a static
  1163. library, this option forces the use of the static version. If no
  1164. shared version of 'libgfortran' was built when the compiler was
  1165. configured, this option has no effect.
  1166. 
  1167. File: gfortran.info, Node: Runtime Options, Next: Code Gen Options, Prev: Link Options, Up: Invoking GNU Fortran
  1168. 2.8 Influencing runtime behavior
  1169. ================================
  1170. These options affect the runtime behavior of programs compiled with GNU
  1171. Fortran.
  1172. '-fconvert=CONVERSION'
  1173. Specify the representation of data for unformatted files. Valid
  1174. values for conversion are: 'native', the default; 'swap', swap
  1175. between big- and little-endian; 'big-endian', use big-endian
  1176. representation for unformatted files; 'little-endian', use
  1177. little-endian representation for unformatted files.
  1178. _This option has an effect only when used in the main program. The
  1179. 'CONVERT' specifier and the GFORTRAN_CONVERT_UNIT environment
  1180. variable override the default specified by '-fconvert'._
  1181. '-frecord-marker=LENGTH'
  1182. Specify the length of record markers for unformatted files. Valid
  1183. values for LENGTH are 4 and 8. Default is 4. _This is different
  1184. from previous versions of 'gfortran'_, which specified a default
  1185. record marker length of 8 on most systems. If you want to read or
  1186. write files compatible with earlier versions of 'gfortran', use
  1187. '-frecord-marker=8'.
  1188. '-fmax-subrecord-length=LENGTH'
  1189. Specify the maximum length for a subrecord. The maximum permitted
  1190. value for length is 2147483639, which is also the default. Only
  1191. really useful for use by the gfortran testsuite.
  1192. '-fsign-zero'
  1193. When enabled, floating point numbers of value zero with the sign
  1194. bit set are written as negative number in formatted output and
  1195. treated as negative in the 'SIGN' intrinsic. '-fno-sign-zero' does
  1196. not print the negative sign of zero values (or values rounded to
  1197. zero for I/O) and regards zero as positive number in the 'SIGN'
  1198. intrinsic for compatibility with Fortran 77. The default is
  1199. '-fsign-zero'.
  1200. 
  1201. File: gfortran.info, Node: Code Gen Options, Next: Interoperability Options, Prev: Runtime Options, Up: Invoking GNU Fortran
  1202. 2.9 Options for code generation conventions
  1203. ===========================================
  1204. These machine-independent options control the interface conventions used
  1205. in code generation.
  1206. Most of them have both positive and negative forms; the negative form
  1207. of '-ffoo' would be '-fno-foo'. In the table below, only one of the
  1208. forms is listed--the one which is not the default. You can figure out
  1209. the other form by either removing 'no-' or adding it.
  1210. '-fno-automatic'
  1211. Treat each program unit (except those marked as RECURSIVE) as if
  1212. the 'SAVE' statement were specified for every local variable and
  1213. array referenced in it. Does not affect common blocks. (Some
  1214. Fortran compilers provide this option under the name '-static' or
  1215. '-save'.) The default, which is '-fautomatic', uses the stack for
  1216. local variables smaller than the value given by
  1217. '-fmax-stack-var-size'. Use the option '-frecursive' to use no
  1218. static memory.
  1219. Local variables or arrays having an explicit 'SAVE' attribute are
  1220. silently ignored unless the '-pedantic' option is added.
  1221. '-ff2c'
  1222. Generate code designed to be compatible with code generated by
  1223. 'g77' and 'f2c'.
  1224. The calling conventions used by 'g77' (originally implemented in
  1225. 'f2c') require functions that return type default 'REAL' to
  1226. actually return the C type 'double', and functions that return type
  1227. 'COMPLEX' to return the values via an extra argument in the calling
  1228. sequence that points to where to store the return value. Under the
  1229. default GNU calling conventions, such functions simply return their
  1230. results as they would in GNU C--default 'REAL' functions return the
  1231. C type 'float', and 'COMPLEX' functions return the GNU C type
  1232. 'complex'. Additionally, this option implies the
  1233. '-fsecond-underscore' option, unless '-fno-second-underscore' is
  1234. explicitly requested.
  1235. This does not affect the generation of code that interfaces with
  1236. the 'libgfortran' library.
  1237. _Caution:_ It is not a good idea to mix Fortran code compiled with
  1238. '-ff2c' with code compiled with the default '-fno-f2c' calling
  1239. conventions as, calling 'COMPLEX' or default 'REAL' functions
  1240. between program parts which were compiled with different calling
  1241. conventions will break at execution time.
  1242. _Caution:_ This will break code which passes intrinsic functions of
  1243. type default 'REAL' or 'COMPLEX' as actual arguments, as the
  1244. library implementations use the '-fno-f2c' calling conventions.
  1245. '-fno-underscoring'
  1246. Do not transform names of entities specified in the Fortran source
  1247. file by appending underscores to them.
  1248. With '-funderscoring' in effect, GNU Fortran appends one underscore
  1249. to external names with no underscores. This is done to ensure
  1250. compatibility with code produced by many UNIX Fortran compilers.
  1251. _Caution_: The default behavior of GNU Fortran is incompatible with
  1252. 'f2c' and 'g77', please use the '-ff2c' option if you want object
  1253. files compiled with GNU Fortran to be compatible with object code
  1254. created with these tools.
  1255. Use of '-fno-underscoring' is not recommended unless you are
  1256. experimenting with issues such as integration of GNU Fortran into
  1257. existing system environments (vis-a`-vis existing libraries, tools,
  1258. and so on).
  1259. For example, with '-funderscoring', and assuming that 'j()' and
  1260. 'max_count()' are external functions while 'my_var' and 'lvar' are
  1261. local variables, a statement like
  1262. I = J() + MAX_COUNT (MY_VAR, LVAR)
  1263. is implemented as something akin to:
  1264. i = j_() + max_count__(&my_var__, &lvar);
  1265. With '-fno-underscoring', the same statement is implemented as:
  1266. i = j() + max_count(&my_var, &lvar);
  1267. Use of '-fno-underscoring' allows direct specification of
  1268. user-defined names while debugging and when interfacing GNU Fortran
  1269. code with other languages.
  1270. Note that just because the names match does _not_ mean that the
  1271. interface implemented by GNU Fortran for an external name matches
  1272. the interface implemented by some other language for that same
  1273. name. That is, getting code produced by GNU Fortran to link to
  1274. code produced by some other compiler using this or any other method
  1275. can be only a small part of the overall solution--getting the code
  1276. generated by both compilers to agree on issues other than naming
  1277. can require significant effort, and, unlike naming disagreements,
  1278. linkers normally cannot detect disagreements in these other areas.
  1279. Also, note that with '-fno-underscoring', the lack of appended
  1280. underscores introduces the very real possibility that a
  1281. user-defined external name will conflict with a name in a system
  1282. library, which could make finding unresolved-reference bugs quite
  1283. difficult in some cases--they might occur at program run time, and
  1284. show up only as buggy behavior at run time.
  1285. In future versions of GNU Fortran we hope to improve naming and
  1286. linking issues so that debugging always involves using the names as
  1287. they appear in the source, even if the names as seen by the linker
  1288. are mangled to prevent accidental linking between procedures with
  1289. incompatible interfaces.
  1290. '-fsecond-underscore'
  1291. By default, GNU Fortran appends an underscore to external names.
  1292. If this option is used GNU Fortran appends two underscores to names
  1293. with underscores and one underscore to external names with no
  1294. underscores. GNU Fortran also appends two underscores to internal
  1295. names with underscores to avoid naming collisions with external
  1296. names.
  1297. This option has no effect if '-fno-underscoring' is in effect. It
  1298. is implied by the '-ff2c' option.
  1299. Otherwise, with this option, an external name such as 'MAX_COUNT'
  1300. is implemented as a reference to the link-time external symbol
  1301. 'max_count__', instead of 'max_count_'. This is required for
  1302. compatibility with 'g77' and 'f2c', and is implied by use of the
  1303. '-ff2c' option.
  1304. '-fcoarray=<KEYWORD>'
  1305. 'none'
  1306. Disable coarray support; using coarray declarations and
  1307. image-control statements will produce a compile-time error.
  1308. (Default)
  1309. 'single'
  1310. Single-image mode, i.e. 'num_images()' is always one.
  1311. 'lib'
  1312. Library-based coarray parallelization; a suitable GNU Fortran
  1313. coarray library needs to be linked.
  1314. '-fcheck=<KEYWORD>'
  1315. Enable the generation of run-time checks; the argument shall be a
  1316. comma-delimited list of the following keywords. Prefixing a check
  1317. with 'no-' disables it if it was activated by a previous
  1318. specification.
  1319. 'all'
  1320. Enable all run-time test of '-fcheck'.
  1321. 'array-temps'
  1322. Warns at run time when for passing an actual argument a
  1323. temporary array had to be generated. The information
  1324. generated by this warning is sometimes useful in optimization,
  1325. in order to avoid such temporaries.
  1326. Note: The warning is only printed once per location.
  1327. 'bits'
  1328. Enable generation of run-time checks for invalid arguments to
  1329. the bit manipulation intrinsics.
  1330. 'bounds'
  1331. Enable generation of run-time checks for array subscripts and
  1332. against the declared minimum and maximum values. It also
  1333. checks array indices for assumed and deferred shape arrays
  1334. against the actual allocated bounds and ensures that all
  1335. string lengths are equal for character array constructors
  1336. without an explicit typespec.
  1337. Some checks require that '-fcheck=bounds' is set for the
  1338. compilation of the main program.
  1339. Note: In the future this may also include other forms of
  1340. checking, e.g., checking substring references.
  1341. 'do'
  1342. Enable generation of run-time checks for invalid modification
  1343. of loop iteration variables.
  1344. 'mem'
  1345. Enable generation of run-time checks for memory allocation.
  1346. Note: This option does not affect explicit allocations using
  1347. the 'ALLOCATE' statement, which will be always checked.
  1348. 'pointer'
  1349. Enable generation of run-time checks for pointers and
  1350. allocatables.
  1351. 'recursion'
  1352. Enable generation of run-time checks for recursively called
  1353. subroutines and functions which are not marked as recursive.
  1354. See also '-frecursive'. Note: This check does not work for
  1355. OpenMP programs and is disabled if used together with
  1356. '-frecursive' and '-fopenmp'.
  1357. Example: Assuming you have a file 'foo.f90', the command
  1358. gfortran -fcheck=all,no-array-temps foo.f90
  1359. will compile the file with all checks enabled as specified above
  1360. except warnings for generated array temporaries.
  1361. '-fbounds-check'
  1362. Deprecated alias for '-fcheck=bounds'.
  1363. '-ftail-call-workaround'
  1364. '-ftail-call-workaround=N'
  1365. Some C interfaces to Fortran codes violate the gfortran ABI by
  1366. omitting the hidden character length arguments as described in
  1367. *Note Argument passing conventions::. This can lead to crashes
  1368. because pushing arguments for tail calls can overflow the stack.
  1369. To provide a workaround for existing binary packages, this option
  1370. disables tail call optimization for gfortran procedures with
  1371. character arguments. With '-ftail-call-workaround=2' tail call
  1372. optimization is disabled in all gfortran procedures with character
  1373. arguments, with '-ftail-call-workaround=1' or equivalent
  1374. '-ftail-call-workaround' only in gfortran procedures with character
  1375. arguments that call implicitly prototyped procedures.
  1376. Using this option can lead to problems including crashes due to
  1377. insufficient stack space.
  1378. It is _very strongly_ recommended to fix the code in question. The
  1379. '-fc-prototypes-external' option can be used to generate prototypes
  1380. which conform to gfortran's ABI, for inclusion in the source code.
  1381. Support for this option will likely be withdrawn in a future
  1382. release of gfortran.
  1383. The negative form, '-fno-tail-call-workaround' or equivalent
  1384. '-ftail-call-workaround=0', can be used to disable this option.
  1385. Default is currently '-ftail-call-workaround', this will change in
  1386. future releases.
  1387. '-fcheck-array-temporaries'
  1388. Deprecated alias for '-fcheck=array-temps'.
  1389. '-fmax-array-constructor=N'
  1390. This option can be used to increase the upper limit permitted in
  1391. array constructors. The code below requires this option to expand
  1392. the array at compile time.
  1393. program test
  1394. implicit none
  1395. integer j
  1396. integer, parameter :: n = 100000
  1397. integer, parameter :: i(n) = (/ (2*j, j = 1, n) /)
  1398. print '(10(I0,1X))', i
  1399. end program test
  1400. _Caution: This option can lead to long compile times and
  1401. excessively large object files._
  1402. The default value for N is 65535.
  1403. '-fmax-stack-var-size=N'
  1404. This option specifies the size in bytes of the largest array that
  1405. will be put on the stack; if the size is exceeded static memory is
  1406. used (except in procedures marked as RECURSIVE). Use the option
  1407. '-frecursive' to allow for recursive procedures which do not have a
  1408. RECURSIVE attribute or for parallel programs. Use '-fno-automatic'
  1409. to never use the stack.
  1410. This option currently only affects local arrays declared with
  1411. constant bounds, and may not apply to all character variables.
  1412. Future versions of GNU Fortran may improve this behavior.
  1413. The default value for N is 65536.
  1414. '-fstack-arrays'
  1415. Adding this option will make the Fortran compiler put all arrays of
  1416. unknown size and array temporaries onto stack memory. If your
  1417. program uses very large local arrays it is possible that you will
  1418. have to extend your runtime limits for stack memory on some
  1419. operating systems. This flag is enabled by default at optimization
  1420. level '-Ofast' unless '-fmax-stack-var-size' is specified.
  1421. '-fpack-derived'
  1422. This option tells GNU Fortran to pack derived type members as
  1423. closely as possible. Code compiled with this option is likely to
  1424. be incompatible with code compiled without this option, and may
  1425. execute slower.
  1426. '-frepack-arrays'
  1427. In some circumstances GNU Fortran may pass assumed shape array
  1428. sections via a descriptor describing a noncontiguous area of
  1429. memory. This option adds code to the function prologue to repack
  1430. the data into a contiguous block at runtime.
  1431. This should result in faster accesses to the array. However it can
  1432. introduce significant overhead to the function call, especially
  1433. when the passed data is noncontiguous.
  1434. '-fshort-enums'
  1435. This option is provided for interoperability with C code that was
  1436. compiled with the '-fshort-enums' option. It will make GNU Fortran
  1437. choose the smallest 'INTEGER' kind a given enumerator set will fit
  1438. in, and give all its enumerators this kind.
  1439. '-finline-arg-packing'
  1440. When passing an assumed-shape argument of a procedure as actual
  1441. argument to an assumed-size or explicit size or as argument to a
  1442. procedure that does not have an explicit interface, the argument
  1443. may have to be packed, that is put into contiguous memory. An
  1444. example is the call to 'foo' in
  1445. subroutine foo(a)
  1446. real, dimension(*) :: a
  1447. end subroutine foo
  1448. subroutine bar(b)
  1449. real, dimension(:) :: b
  1450. call foo(b)
  1451. end subroutine bar
  1452. When '-finline-arg-packing' is in effect, this packing will be
  1453. performed by inline code. This allows for more optimization while
  1454. increasing code size.
  1455. '-finline-arg-packing' is implied by any of the '-O' options except
  1456. when optimizing for size via '-Os'. If the code contains a very
  1457. large number of argument that have to be packed, code size and also
  1458. compilation time may become excessive. If that is the case, it may
  1459. be better to disable this option. Instances of packing can be
  1460. found by using by using '-Warray-temporaries'.
  1461. '-fexternal-blas'
  1462. This option will make 'gfortran' generate calls to BLAS functions
  1463. for some matrix operations like 'MATMUL', instead of using our own
  1464. algorithms, if the size of the matrices involved is larger than a
  1465. given limit (see '-fblas-matmul-limit'). This may be profitable if
  1466. an optimized vendor BLAS library is available. The BLAS library
  1467. will have to be specified at link time.
  1468. '-fblas-matmul-limit=N'
  1469. Only significant when '-fexternal-blas' is in effect. Matrix
  1470. multiplication of matrices with size larger than (or equal to) N
  1471. will be performed by calls to BLAS functions, while others will be
  1472. handled by 'gfortran' internal algorithms. If the matrices
  1473. involved are not square, the size comparison is performed using the
  1474. geometric mean of the dimensions of the argument and result
  1475. matrices.
  1476. The default value for N is 30.
  1477. '-finline-matmul-limit=N'
  1478. When front-end optimiztion is active, some calls to the 'MATMUL'
  1479. intrinsic function will be inlined. This may result in code size
  1480. increase if the size of the matrix cannot be determined at compile
  1481. time, as code for both cases is generated. Setting
  1482. '-finline-matmul-limit=0' will disable inlining in all cases.
  1483. Setting this option with a value of N will produce inline code for
  1484. matrices with size up to N. If the matrices involved are not
  1485. square, the size comparison is performed using the geometric mean
  1486. of the dimensions of the argument and result matrices.
  1487. The default value for N is 30. The '-fblas-matmul-limit' can be
  1488. used to change this value.
  1489. '-frecursive'
  1490. Allow indirect recursion by forcing all local arrays to be
  1491. allocated on the stack. This flag cannot be used together with
  1492. '-fmax-stack-var-size=' or '-fno-automatic'.
  1493. '-finit-local-zero'
  1494. '-finit-derived'
  1495. '-finit-integer=N'
  1496. '-finit-real=<ZERO|INF|-INF|NAN|SNAN>'
  1497. '-finit-logical=<TRUE|FALSE>'
  1498. '-finit-character=N'
  1499. The '-finit-local-zero' option instructs the compiler to initialize
  1500. local 'INTEGER', 'REAL', and 'COMPLEX' variables to zero, 'LOGICAL'
  1501. variables to false, and 'CHARACTER' variables to a string of null
  1502. bytes. Finer-grained initialization options are provided by the
  1503. '-finit-integer=N', '-finit-real=<ZERO|INF|-INF|NAN|SNAN>' (which
  1504. also initializes the real and imaginary parts of local 'COMPLEX'
  1505. variables), '-finit-logical=<TRUE|FALSE>', and '-finit-character=N'
  1506. (where N is an ASCII character value) options.
  1507. With '-finit-derived', components of derived type variables will be
  1508. initialized according to these flags. Components whose type is not
  1509. covered by an explicit '-finit-*' flag will be treated as described
  1510. above with '-finit-local-zero'.
  1511. These options do not initialize
  1512. * objects with the POINTER attribute
  1513. * allocatable arrays
  1514. * variables that appear in an 'EQUIVALENCE' statement.
  1515. (These limitations may be removed in future releases).
  1516. Note that the '-finit-real=nan' option initializes 'REAL' and
  1517. 'COMPLEX' variables with a quiet NaN. For a signalling NaN use
  1518. '-finit-real=snan'; note, however, that compile-time optimizations
  1519. may convert them into quiet NaN and that trapping needs to be
  1520. enabled (e.g. via '-ffpe-trap').
  1521. The '-finit-integer' option will parse the value into an integer of
  1522. type 'INTEGER(kind=C_LONG)' on the host. Said value is then
  1523. assigned to the integer variables in the Fortran code, which might
  1524. result in wraparound if the value is too large for the kind.
  1525. Finally, note that enabling any of the '-finit-*' options will
  1526. silence warnings that would have been emitted by '-Wuninitialized'
  1527. for the affected local variables.
  1528. '-falign-commons'
  1529. By default, 'gfortran' enforces proper alignment of all variables
  1530. in a 'COMMON' block by padding them as needed. On certain
  1531. platforms this is mandatory, on others it increases performance.
  1532. If a 'COMMON' block is not declared with consistent data types
  1533. everywhere, this padding can cause trouble, and
  1534. '-fno-align-commons' can be used to disable automatic alignment.
  1535. The same form of this option should be used for all files that
  1536. share a 'COMMON' block. To avoid potential alignment issues in
  1537. 'COMMON' blocks, it is recommended to order objects from largest to
  1538. smallest.
  1539. '-fno-protect-parens'
  1540. By default the parentheses in expression are honored for all
  1541. optimization levels such that the compiler does not do any
  1542. re-association. Using '-fno-protect-parens' allows the compiler to
  1543. reorder 'REAL' and 'COMPLEX' expressions to produce faster code.
  1544. Note that for the re-association optimization '-fno-signed-zeros'
  1545. and '-fno-trapping-math' need to be in effect. The parentheses
  1546. protection is enabled by default, unless '-Ofast' is given.
  1547. '-frealloc-lhs'
  1548. An allocatable left-hand side of an intrinsic assignment is
  1549. automatically (re)allocated if it is either unallocated or has a
  1550. different shape. The option is enabled by default except when
  1551. '-std=f95' is given. See also '-Wrealloc-lhs'.
  1552. '-faggressive-function-elimination'
  1553. Functions with identical argument lists are eliminated within
  1554. statements, regardless of whether these functions are marked 'PURE'
  1555. or not. For example, in
  1556. a = f(b,c) + f(b,c)
  1557. there will only be a single call to 'f'. This option only works if
  1558. '-ffrontend-optimize' is in effect.
  1559. '-ffrontend-optimize'
  1560. This option performs front-end optimization, based on manipulating
  1561. parts the Fortran parse tree. Enabled by default by any '-O'
  1562. option except '-O0' and '-Og'. Optimizations enabled by this
  1563. option include:
  1564. * inlining calls to 'MATMUL',
  1565. * elimination of identical function calls within expressions,
  1566. * removing unnecessary calls to 'TRIM' in comparisons and
  1567. assignments,
  1568. * replacing 'TRIM(a)' with 'a(1:LEN_TRIM(a))' and
  1569. * short-circuiting of logical operators ('.AND.' and '.OR.').
  1570. It can be deselected by specifying '-fno-frontend-optimize'.
  1571. '-ffrontend-loop-interchange'
  1572. Attempt to interchange loops in the Fortran front end where
  1573. profitable. Enabled by default by any '-O' option. At the moment,
  1574. this option only affects 'FORALL' and 'DO CONCURRENT' statements
  1575. with several forall triplets.
  1576. *Note Options for Code Generation Conventions: (gcc)Code Gen Options,
  1577. for information on more options offered by the GBE shared by 'gfortran',
  1578. 'gcc', and other GNU compilers.
  1579. 
  1580. File: gfortran.info, Node: Interoperability Options, Next: Environment Variables, Prev: Code Gen Options, Up: Invoking GNU Fortran
  1581. 2.10 Options for interoperability with other languages
  1582. ======================================================
  1583. -fc-prototypes
  1584. This option will generate C prototypes from 'BIND(C)' variable
  1585. declarations, types and procedure interfaces and writes them to
  1586. standard output. 'ENUM' is not yet supported.
  1587. The generated prototypes may need inclusion of an appropriate
  1588. header, such as '<stdint.h>' or '<stdlib.h>'. For types which are
  1589. not specified using the appropriate kind from the 'iso_c_binding'
  1590. module, a warning is added as a comment to the code.
  1591. For function pointers, a pointer to a function returning 'int'
  1592. without an explicit argument list is generated.
  1593. Example of use:
  1594. $ gfortran -fc-prototypes -fsyntax-only foo.f90 > foo.h
  1595. where the C code intended for interoperating with the Fortran code
  1596. then uses '#include "foo.h"'.
  1597. -fc-prototypes-external
  1598. This option will generate C prototypes from external functions and
  1599. subroutines and write them to standard output. This may be useful
  1600. for making sure that C bindings to Fortran code are correct. This
  1601. option does not generate prototypes for 'BIND(C)' procedures, use
  1602. '-fc-prototypes' for that.
  1603. The generated prototypes may need inclusion of an appropriate
  1604. header, such as as '<stdint.h>' or '<stdlib.h>'.
  1605. This is primarily meant for legacy code to ensure that existing C
  1606. bindings match what 'gfortran' emits. The generated C prototypes
  1607. should be correct for the current version of the compiler, but may
  1608. not match what other compilers or earlier versions of 'gfortran'
  1609. need. For new developments, use of the 'BIND(C)' features is
  1610. recommended.
  1611. Example of use:
  1612. $ gfortran -fc-prototypes-external -fsyntax-only foo.f > foo.h
  1613. where the C code intended for interoperating with the Fortran code
  1614. then uses '#include "foo.h"'.
  1615. 
  1616. File: gfortran.info, Node: Environment Variables, Prev: Interoperability Options, Up: Invoking GNU Fortran
  1617. 2.11 Environment variables affecting 'gfortran'
  1618. ===============================================
  1619. The 'gfortran' compiler currently does not make use of any environment
  1620. variables to control its operation above and beyond those that affect
  1621. the operation of 'gcc'.
  1622. *Note Environment Variables Affecting GCC: (gcc)Environment
  1623. Variables, for information on environment variables.
  1624. *Note Runtime::, for environment variables that affect the run-time
  1625. behavior of programs compiled with GNU Fortran.
  1626. 
  1627. File: gfortran.info, Node: Runtime, Next: Fortran standards status, Prev: Invoking GNU Fortran, Up: Top
  1628. 3 Runtime: Influencing runtime behavior with environment variables
  1629. ******************************************************************
  1630. The behavior of the 'gfortran' can be influenced by environment
  1631. variables.
  1632. Malformed environment variables are silently ignored.
  1633. * Menu:
  1634. * TMPDIR:: Directory for scratch files
  1635. * GFORTRAN_STDIN_UNIT:: Unit number for standard input
  1636. * GFORTRAN_STDOUT_UNIT:: Unit number for standard output
  1637. * GFORTRAN_STDERR_UNIT:: Unit number for standard error
  1638. * GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units
  1639. * GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units.
  1640. * GFORTRAN_SHOW_LOCUS:: Show location for runtime errors
  1641. * GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted
  1642. * GFORTRAN_LIST_SEPARATOR:: Separator for list output
  1643. * GFORTRAN_CONVERT_UNIT:: Set endianness for unformatted I/O
  1644. * GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors
  1645. * GFORTRAN_FORMATTED_BUFFER_SIZE:: Buffer size for formatted files
  1646. * GFORTRAN_UNFORMATTED_BUFFER_SIZE:: Buffer size for unformatted files
  1647. 
  1648. File: gfortran.info, Node: TMPDIR, Next: GFORTRAN_STDIN_UNIT, Up: Runtime
  1649. 3.1 'TMPDIR'--Directory for scratch files
  1650. =========================================
  1651. When opening a file with 'STATUS='SCRATCH'', GNU Fortran tries to create
  1652. the file in one of the potential directories by testing each directory
  1653. in the order below.
  1654. 1. The environment variable 'TMPDIR', if it exists.
  1655. 2. On the MinGW target, the directory returned by the 'GetTempPath'
  1656. function. Alternatively, on the Cygwin target, the 'TMP' and
  1657. 'TEMP' environment variables, if they exist, in that order.
  1658. 3. The 'P_tmpdir' macro if it is defined, otherwise the directory
  1659. '/tmp'.
  1660. 
  1661. File: gfortran.info, Node: GFORTRAN_STDIN_UNIT, Next: GFORTRAN_STDOUT_UNIT, Prev: TMPDIR, Up: Runtime
  1662. 3.2 'GFORTRAN_STDIN_UNIT'--Unit number for standard input
  1663. =========================================================
  1664. This environment variable can be used to select the unit number
  1665. preconnected to standard input. This must be a positive integer. The
  1666. default value is 5.
  1667. 
  1668. File: gfortran.info, Node: GFORTRAN_STDOUT_UNIT, Next: GFORTRAN_STDERR_UNIT, Prev: GFORTRAN_STDIN_UNIT, Up: Runtime
  1669. 3.3 'GFORTRAN_STDOUT_UNIT'--Unit number for standard output
  1670. ===========================================================
  1671. This environment variable can be used to select the unit number
  1672. preconnected to standard output. This must be a positive integer. The
  1673. default value is 6.
  1674. 
  1675. File: gfortran.info, Node: GFORTRAN_STDERR_UNIT, Next: GFORTRAN_UNBUFFERED_ALL, Prev: GFORTRAN_STDOUT_UNIT, Up: Runtime
  1676. 3.4 'GFORTRAN_STDERR_UNIT'--Unit number for standard error
  1677. ==========================================================
  1678. This environment variable can be used to select the unit number
  1679. preconnected to standard error. This must be a positive integer. The
  1680. default value is 0.
  1681. 
  1682. File: gfortran.info, Node: GFORTRAN_UNBUFFERED_ALL, Next: GFORTRAN_UNBUFFERED_PRECONNECTED, Prev: GFORTRAN_STDERR_UNIT, Up: Runtime
  1683. 3.5 'GFORTRAN_UNBUFFERED_ALL'--Do not buffer I/O on all units
  1684. =============================================================
  1685. This environment variable controls whether all I/O is unbuffered. If
  1686. the first letter is 'y', 'Y' or '1', all I/O is unbuffered. This will
  1687. slow down small sequential reads and writes. If the first letter is
  1688. 'n', 'N' or '0', I/O is buffered. This is the default.
  1689. 
  1690. File: gfortran.info, Node: GFORTRAN_UNBUFFERED_PRECONNECTED, Next: GFORTRAN_SHOW_LOCUS, Prev: GFORTRAN_UNBUFFERED_ALL, Up: Runtime
  1691. 3.6 'GFORTRAN_UNBUFFERED_PRECONNECTED'--Do not buffer I/O on preconnected units
  1692. ===============================================================================
  1693. The environment variable named 'GFORTRAN_UNBUFFERED_PRECONNECTED'
  1694. controls whether I/O on a preconnected unit (i.e. STDOUT or STDERR) is
  1695. unbuffered. If the first letter is 'y', 'Y' or '1', I/O is unbuffered.
  1696. This will slow down small sequential reads and writes. If the first
  1697. letter is 'n', 'N' or '0', I/O is buffered. This is the default.
  1698. 
  1699. File: gfortran.info, Node: GFORTRAN_SHOW_LOCUS, Next: GFORTRAN_OPTIONAL_PLUS, Prev: GFORTRAN_UNBUFFERED_PRECONNECTED, Up: Runtime
  1700. 3.7 'GFORTRAN_SHOW_LOCUS'--Show location for runtime errors
  1701. ===========================================================
  1702. If the first letter is 'y', 'Y' or '1', filename and line numbers for
  1703. runtime errors are printed. If the first letter is 'n', 'N' or '0', do
  1704. not print filename and line numbers for runtime errors. The default is
  1705. to print the location.
  1706. 
  1707. File: gfortran.info, Node: GFORTRAN_OPTIONAL_PLUS, Next: GFORTRAN_LIST_SEPARATOR, Prev: GFORTRAN_SHOW_LOCUS, Up: Runtime
  1708. 3.8 'GFORTRAN_OPTIONAL_PLUS'--Print leading + where permitted
  1709. =============================================================
  1710. If the first letter is 'y', 'Y' or '1', a plus sign is printed where
  1711. permitted by the Fortran standard. If the first letter is 'n', 'N' or
  1712. '0', a plus sign is not printed in most cases. Default is not to print
  1713. plus signs.
  1714. 
  1715. File: gfortran.info, Node: GFORTRAN_LIST_SEPARATOR, Next: GFORTRAN_CONVERT_UNIT, Prev: GFORTRAN_OPTIONAL_PLUS, Up: Runtime
  1716. 3.9 'GFORTRAN_LIST_SEPARATOR'--Separator for list output
  1717. ========================================================
  1718. This environment variable specifies the separator when writing
  1719. list-directed output. It may contain any number of spaces and at most
  1720. one comma. If you specify this on the command line, be sure to quote
  1721. spaces, as in
  1722. $ GFORTRAN_LIST_SEPARATOR=' , ' ./a.out
  1723. when 'a.out' is the compiled Fortran program that you want to run.
  1724. Default is a single space.
  1725. 
  1726. File: gfortran.info, Node: GFORTRAN_CONVERT_UNIT, Next: GFORTRAN_ERROR_BACKTRACE, Prev: GFORTRAN_LIST_SEPARATOR, Up: Runtime
  1727. 3.10 'GFORTRAN_CONVERT_UNIT'--Set endianness for unformatted I/O
  1728. ================================================================
  1729. By setting the 'GFORTRAN_CONVERT_UNIT' variable, it is possible to
  1730. change the representation of data for unformatted files. The syntax for
  1731. the 'GFORTRAN_CONVERT_UNIT' variable is:
  1732. GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
  1733. mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
  1734. exception: mode ':' unit_list | unit_list ;
  1735. unit_list: unit_spec | unit_list unit_spec ;
  1736. unit_spec: INTEGER | INTEGER '-' INTEGER ;
  1737. The variable consists of an optional default mode, followed by a list
  1738. of optional exceptions, which are separated by semicolons from the
  1739. preceding default and each other. Each exception consists of a format
  1740. and a comma-separated list of units. Valid values for the modes are the
  1741. same as for the 'CONVERT' specifier:
  1742. 'NATIVE' Use the native format. This is the default.
  1743. 'SWAP' Swap between little- and big-endian.
  1744. 'LITTLE_ENDIAN' Use the little-endian format for unformatted files.
  1745. 'BIG_ENDIAN' Use the big-endian format for unformatted files.
  1746. A missing mode for an exception is taken to mean 'BIG_ENDIAN'.
  1747. Examples of values for 'GFORTRAN_CONVERT_UNIT' are:
  1748. ''big_endian'' Do all unformatted I/O in big_endian mode.
  1749. ''little_endian;native:10-20,25'' Do all unformatted I/O in
  1750. little_endian mode, except for units 10 to 20 and 25, which are in
  1751. native format.
  1752. ''10-20'' Units 10 to 20 are big-endian, the rest is native.
  1753. Setting the environment variables should be done on the command line
  1754. or via the 'export' command for 'sh'-compatible shells and via 'setenv'
  1755. for 'csh'-compatible shells.
  1756. Example for 'sh':
  1757. $ gfortran foo.f90
  1758. $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out
  1759. Example code for 'csh':
  1760. % gfortran foo.f90
  1761. % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20'
  1762. % ./a.out
  1763. Using anything but the native representation for unformatted data
  1764. carries a significant speed overhead. If speed in this area matters to
  1765. you, it is best if you use this only for data that needs to be portable.
  1766. *Note CONVERT specifier::, for an alternative way to specify the data
  1767. representation for unformatted files. *Note Runtime Options::, for
  1768. setting a default data representation for the whole program. The
  1769. 'CONVERT' specifier overrides the '-fconvert' compile options.
  1770. _Note that the values specified via the GFORTRAN_CONVERT_UNIT
  1771. environment variable will override the CONVERT specifier in the open
  1772. statement_. This is to give control over data formats to users who do
  1773. not have the source code of their program available.
  1774. 
  1775. File: gfortran.info, Node: GFORTRAN_ERROR_BACKTRACE, Next: GFORTRAN_FORMATTED_BUFFER_SIZE, Prev: GFORTRAN_CONVERT_UNIT, Up: Runtime
  1776. 3.11 'GFORTRAN_ERROR_BACKTRACE'--Show backtrace on run-time errors
  1777. ==================================================================
  1778. If the 'GFORTRAN_ERROR_BACKTRACE' variable is set to 'y', 'Y' or '1'
  1779. (only the first letter is relevant) then a backtrace is printed when a
  1780. serious run-time error occurs. To disable the backtracing, set the
  1781. variable to 'n', 'N', '0'. Default is to print a backtrace unless the
  1782. '-fno-backtrace' compile option was used.
  1783. 
  1784. File: gfortran.info, Node: GFORTRAN_FORMATTED_BUFFER_SIZE, Next: GFORTRAN_UNFORMATTED_BUFFER_SIZE, Prev: GFORTRAN_ERROR_BACKTRACE, Up: Runtime
  1785. 3.12 'GFORTRAN_FORMATTED_BUFFER_SIZE'--Set buffer size for formatted I/O
  1786. ========================================================================
  1787. The 'GFORTRAN_FORMATTED_BUFFER_SIZE' environment variable specifies
  1788. buffer size in bytes to be used for formatted output. The default value
  1789. is 8192.
  1790. 
  1791. File: gfortran.info, Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE, Prev: GFORTRAN_FORMATTED_BUFFER_SIZE, Up: Runtime
  1792. 3.13 'GFORTRAN_UNFORMATTED_BUFFER_SIZE'--Set buffer size for unformatted I/O
  1793. ============================================================================
  1794. The 'GFORTRAN_UNFORMATTED_BUFFER_SIZE' environment variable specifies
  1795. buffer size in bytes to be used for unformatted output. The default
  1796. value is 131072.
  1797. 
  1798. File: gfortran.info, Node: Fortran standards status, Next: Compiler Characteristics, Prev: Runtime, Up: Top
  1799. 4 Fortran standards status
  1800. **************************
  1801. * Menu:
  1802. * Fortran 2003 status::
  1803. * Fortran 2008 status::
  1804. * Fortran 2018 status::
  1805. 
  1806. File: gfortran.info, Node: Fortran 2003 status, Next: Fortran 2008 status, Up: Fortran standards status
  1807. 4.1 Fortran 2003 status
  1808. =======================
  1809. GNU Fortran supports several Fortran 2003 features; an incomplete list
  1810. can be found below. See also the wiki page
  1811. (https://gcc.gnu.org/wiki/Fortran2003) about Fortran 2003.
  1812. * Procedure pointers including procedure-pointer components with
  1813. 'PASS' attribute.
  1814. * Procedures which are bound to a derived type (type-bound
  1815. procedures) including 'PASS', 'PROCEDURE' and 'GENERIC', and
  1816. operators bound to a type.
  1817. * Abstract interfaces and type extension with the possibility to
  1818. override type-bound procedures or to have deferred binding.
  1819. * Polymorphic entities ("'CLASS'") for derived types and unlimited
  1820. polymorphism ("'CLASS(*)'") - including 'SAME_TYPE_AS',
  1821. 'EXTENDS_TYPE_OF' and 'SELECT TYPE' for scalars and arrays and
  1822. finalization.
  1823. * Generic interface names, which have the same name as derived types,
  1824. are now supported. This allows one to write constructor functions.
  1825. Note that Fortran does not support static constructor functions.
  1826. For static variables, only default initialization or
  1827. structure-constructor initialization are available.
  1828. * The 'ASSOCIATE' construct.
  1829. * Interoperability with C including enumerations,
  1830. * In structure constructors the components with default values may be
  1831. omitted.
  1832. * Extensions to the 'ALLOCATE' statement, allowing for a
  1833. type-specification with type parameter and for allocation and
  1834. initialization from a 'SOURCE=' expression; 'ALLOCATE' and
  1835. 'DEALLOCATE' optionally return an error message string via
  1836. 'ERRMSG='.
  1837. * Reallocation on assignment: If an intrinsic assignment is used, an
  1838. allocatable variable on the left-hand side is automatically
  1839. allocated (if unallocated) or reallocated (if the shape is
  1840. different). Currently, scalar deferred character length left-hand
  1841. sides are correctly handled but arrays are not yet fully
  1842. implemented.
  1843. * Deferred-length character variables and scalar deferred-length
  1844. character components of derived types are supported. (Note that
  1845. array-valued compoents are not yet implemented.)
  1846. * Transferring of allocations via 'MOVE_ALLOC'.
  1847. * The 'PRIVATE' and 'PUBLIC' attributes may be given individually to
  1848. derived-type components.
  1849. * In pointer assignments, the lower bound may be specified and the
  1850. remapping of elements is supported.
  1851. * For pointers an 'INTENT' may be specified which affect the
  1852. association status not the value of the pointer target.
  1853. * Intrinsics 'command_argument_count', 'get_command',
  1854. 'get_command_argument', and 'get_environment_variable'.
  1855. * Support for Unicode characters (ISO 10646) and UTF-8, including the
  1856. 'SELECTED_CHAR_KIND' and 'NEW_LINE' intrinsic functions.
  1857. * Support for binary, octal and hexadecimal (BOZ) constants in the
  1858. intrinsic functions 'INT', 'REAL', 'CMPLX' and 'DBLE'.
  1859. * Support for namelist variables with allocatable and pointer
  1860. attribute and nonconstant length type parameter.
  1861. * Array constructors using square brackets. That is, '[...]' rather
  1862. than '(/.../)'. Type-specification for array constructors like '(/
  1863. some-type :: ... /)'.
  1864. * Extensions to the specification and initialization expressions,
  1865. including the support for intrinsics with real and complex
  1866. arguments.
  1867. * Support for the asynchronous input/output.
  1868. * 'FLUSH' statement.
  1869. * 'IOMSG=' specifier for I/O statements.
  1870. * Support for the declaration of enumeration constants via the 'ENUM'
  1871. and 'ENUMERATOR' statements. Interoperability with 'gcc' is
  1872. guaranteed also for the case where the '-fshort-enums' command line
  1873. option is given.
  1874. * TR 15581:
  1875. * 'ALLOCATABLE' dummy arguments.
  1876. * 'ALLOCATABLE' function results
  1877. * 'ALLOCATABLE' components of derived types
  1878. * The 'OPEN' statement supports the 'ACCESS='STREAM'' specifier,
  1879. allowing I/O without any record structure.
  1880. * Namelist input/output for internal files.
  1881. * Minor I/O features: Rounding during formatted output, using of a
  1882. decimal comma instead of a decimal point, setting whether a plus
  1883. sign should appear for positive numbers. On systems where 'strtod'
  1884. honours the rounding mode, the rounding mode is also supported for
  1885. input.
  1886. * The 'PROTECTED' statement and attribute.
  1887. * The 'VALUE' statement and attribute.
  1888. * The 'VOLATILE' statement and attribute.
  1889. * The 'IMPORT' statement, allowing to import host-associated derived
  1890. types.
  1891. * The intrinsic modules 'ISO_FORTRAN_ENVIRONMENT' is supported, which
  1892. contains parameters of the I/O units, storage sizes. Additionally,
  1893. procedures for C interoperability are available in the
  1894. 'ISO_C_BINDING' module.
  1895. * 'USE' statement with 'INTRINSIC' and 'NON_INTRINSIC' attribute;
  1896. supported intrinsic modules: 'ISO_FORTRAN_ENV', 'ISO_C_BINDING',
  1897. 'OMP_LIB' and 'OMP_LIB_KINDS', and 'OPENACC'.
  1898. * Renaming of operators in the 'USE' statement.
  1899. 
  1900. File: gfortran.info, Node: Fortran 2008 status, Next: Fortran 2018 status, Prev: Fortran 2003 status, Up: Fortran standards status
  1901. 4.2 Fortran 2008 status
  1902. =======================
  1903. The latest version of the Fortran standard is ISO/IEC 1539-1:2010,
  1904. informally known as Fortran 2008. The official version is available
  1905. from International Organization for Standardization (ISO) or its
  1906. national member organizations. The the final draft (FDIS) can be
  1907. downloaded free of charge from
  1908. <http://www.nag.co.uk/sc22wg5/links.html>. Fortran is developed by the
  1909. Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1
  1910. of the International Organization for Standardization and the
  1911. International Electrotechnical Commission (IEC). This group is known as
  1912. WG5 (http://www.nag.co.uk/sc22wg5/).
  1913. The GNU Fortran compiler supports several of the new features of
  1914. Fortran 2008; the wiki (https://gcc.gnu.org/wiki/Fortran2008Status) has
  1915. some information about the current Fortran 2008 implementation status.
  1916. In particular, the following is implemented.
  1917. * The '-std=f2008' option and support for the file extensions '.f08'
  1918. and '.F08'.
  1919. * The 'OPEN' statement now supports the 'NEWUNIT=' option, which
  1920. returns a unique file unit, thus preventing inadvertent use of the
  1921. same unit in different parts of the program.
  1922. * The 'g0' format descriptor and unlimited format items.
  1923. * The mathematical intrinsics 'ASINH', 'ACOSH', 'ATANH', 'ERF',
  1924. 'ERFC', 'GAMMA', 'LOG_GAMMA', 'BESSEL_J0', 'BESSEL_J1',
  1925. 'BESSEL_JN', 'BESSEL_Y0', 'BESSEL_Y1', 'BESSEL_YN', 'HYPOT',
  1926. 'NORM2', and 'ERFC_SCALED'.
  1927. * Using complex arguments with 'TAN', 'SINH', 'COSH', 'TANH', 'ASIN',
  1928. 'ACOS', and 'ATAN' is now possible; 'ATAN'(Y,X) is now an alias for
  1929. 'ATAN2'(Y,X).
  1930. * Support of the 'PARITY' intrinsic functions.
  1931. * The following bit intrinsics: 'LEADZ' and 'TRAILZ' for counting the
  1932. number of leading and trailing zero bits, 'POPCNT' and 'POPPAR' for
  1933. counting the number of one bits and returning the parity; 'BGE',
  1934. 'BGT', 'BLE', and 'BLT' for bitwise comparisons; 'DSHIFTL' and
  1935. 'DSHIFTR' for combined left and right shifts, 'MASKL' and 'MASKR'
  1936. for simple left and right justified masks, 'MERGE_BITS' for a
  1937. bitwise merge using a mask, 'SHIFTA', 'SHIFTL' and 'SHIFTR' for
  1938. shift operations, and the transformational bit intrinsics 'IALL',
  1939. 'IANY' and 'IPARITY'.
  1940. * Support of the 'EXECUTE_COMMAND_LINE' intrinsic subroutine.
  1941. * Support for the 'STORAGE_SIZE' intrinsic inquiry function.
  1942. * The 'INT{8,16,32}' and 'REAL{32,64,128}' kind type parameters and
  1943. the array-valued named constants 'INTEGER_KINDS', 'LOGICAL_KINDS',
  1944. 'REAL_KINDS' and 'CHARACTER_KINDS' of the intrinsic module
  1945. 'ISO_FORTRAN_ENV'.
  1946. * The module procedures 'C_SIZEOF' of the intrinsic module
  1947. 'ISO_C_BINDINGS' and 'COMPILER_VERSION' and 'COMPILER_OPTIONS' of
  1948. 'ISO_FORTRAN_ENV'.
  1949. * Coarray support for serial programs with '-fcoarray=single' flag
  1950. and experimental support for multiple images with the
  1951. '-fcoarray=lib' flag.
  1952. * Submodules are supported. It should noted that 'MODULEs' do not
  1953. produce the smod file needed by the descendent 'SUBMODULEs' unless
  1954. they contain at least one 'MODULE PROCEDURE' interface. The reason
  1955. for this is that 'SUBMODULEs' are useless without 'MODULE
  1956. PROCEDUREs'. See http://j3-fortran.org/doc/meeting/207/15-209.txt
  1957. for a discussion and a draft interpretation. Adopting this
  1958. interpretation has the advantage that code that does not use
  1959. submodules does not generate smod files.
  1960. * The 'DO CONCURRENT' construct is supported.
  1961. * The 'BLOCK' construct is supported.
  1962. * The 'STOP' and the new 'ERROR STOP' statements now support all
  1963. constant expressions. Both show the signals which were signaling
  1964. at termination.
  1965. * Support for the 'CONTIGUOUS' attribute.
  1966. * Support for 'ALLOCATE' with 'MOLD'.
  1967. * Support for the 'IMPURE' attribute for procedures, which allows for
  1968. 'ELEMENTAL' procedures without the restrictions of 'PURE'.
  1969. * Null pointers (including 'NULL()') and not-allocated variables can
  1970. be used as actual argument to optional non-pointer, non-allocatable
  1971. dummy arguments, denoting an absent argument.
  1972. * Non-pointer variables with 'TARGET' attribute can be used as actual
  1973. argument to 'POINTER' dummies with 'INTENT(IN)'.
  1974. * Pointers including procedure pointers and those in a derived type
  1975. (pointer components) can now be initialized by a target instead of
  1976. only by 'NULL'.
  1977. * The 'EXIT' statement (with construct-name) can be now be used to
  1978. leave not only the 'DO' but also the 'ASSOCIATE', 'BLOCK', 'IF',
  1979. 'SELECT CASE' and 'SELECT TYPE' constructs.
  1980. * Internal procedures can now be used as actual argument.
  1981. * Minor features: obsolesce diagnostics for 'ENTRY' with
  1982. '-std=f2008'; a line may start with a semicolon; for internal and
  1983. module procedures 'END' can be used instead of 'END SUBROUTINE' and
  1984. 'END FUNCTION'; 'SELECTED_REAL_KIND' now also takes a 'RADIX'
  1985. argument; intrinsic types are supported for
  1986. 'TYPE'(INTRINSIC-TYPE-SPEC); multiple type-bound procedures can be
  1987. declared in a single 'PROCEDURE' statement; implied-shape arrays
  1988. are supported for named constants ('PARAMETER').
  1989. 
  1990. File: gfortran.info, Node: Fortran 2018 status, Prev: Fortran 2008 status, Up: Fortran standards status
  1991. 4.3 Status of Fortran 2018 support
  1992. ==================================
  1993. * ERROR STOP in a PURE procedure An 'ERROR STOP' statement is
  1994. permitted in a 'PURE' procedure.
  1995. * IMPLICIT NONE with a spec-list Support the 'IMPLICIT NONE'
  1996. statement with an 'implicit-none-spec-list'.
  1997. * Behavior of INQUIRE with the RECL= specifier
  1998. The behavior of the 'INQUIRE' statement with the 'RECL=' specifier
  1999. now conforms to Fortran 2018.
  2000. 4.3.1 TS 29113 Status (Further Interoperability with C)
  2001. -------------------------------------------------------
  2002. GNU Fortran supports some of the new features of the Technical
  2003. Specification (TS) 29113 on Further Interoperability of Fortran with C.
  2004. The wiki (https://gcc.gnu.org/wiki/TS29113Status) has some information
  2005. about the current TS 29113 implementation status. In particular, the
  2006. following is implemented.
  2007. See also *note Further Interoperability of Fortran with C::.
  2008. * The 'OPTIONAL' attribute is allowed for dummy arguments of 'BIND(C)
  2009. procedures.'
  2010. * The 'RANK' intrinsic is supported.
  2011. * GNU Fortran's implementation for variables with 'ASYNCHRONOUS'
  2012. attribute is compatible with TS 29113.
  2013. * Assumed types ('TYPE(*)').
  2014. * Assumed-rank ('DIMENSION(..)').
  2015. * ISO_Fortran_binding (now in Fortran 2018 18.4) is implemented such
  2016. that conversion of the array descriptor for assumed type or assumed
  2017. rank arrays is done in the library. The include file
  2018. ISO_Fortran_binding.h is can be found in
  2019. '~prefix/lib/gcc/$target/$version'.
  2020. 4.3.2 TS 18508 Status (Additional Parallel Features)
  2021. ----------------------------------------------------
  2022. GNU Fortran supports the following new features of the Technical
  2023. Specification 18508 on Additional Parallel Features in Fortran:
  2024. * The new atomic ADD, CAS, FETCH and ADD/OR/XOR, OR and XOR
  2025. intrinsics.
  2026. * The 'CO_MIN' and 'CO_MAX' and 'SUM' reduction intrinsics. And the
  2027. 'CO_BROADCAST' and 'CO_REDUCE' intrinsic, except that those do not
  2028. support polymorphic types or types with allocatable, pointer or
  2029. polymorphic components.
  2030. * Events ('EVENT POST', 'EVENT WAIT', 'EVENT_QUERY')
  2031. * Failed images ('FAIL IMAGE', 'IMAGE_STATUS', 'FAILED_IMAGES',
  2032. 'STOPPED_IMAGES')
  2033. 
  2034. File: gfortran.info, Node: Compiler Characteristics, Next: Extensions, Prev: Fortran standards status, Up: Top
  2035. 5 Compiler Characteristics
  2036. **************************
  2037. This chapter describes certain characteristics of the GNU Fortran
  2038. compiler, that are not specified by the Fortran standard, but which
  2039. might in some way or another become visible to the programmer.
  2040. * Menu:
  2041. * KIND Type Parameters::
  2042. * Internal representation of LOGICAL variables::
  2043. * Evaluation of logical expressions::
  2044. * MAX and MIN intrinsics with REAL NaN arguments::
  2045. * Thread-safety of the runtime library::
  2046. * Data consistency and durability::
  2047. * Files opened without an explicit ACTION= specifier::
  2048. * File operations on symbolic links::
  2049. * File format of unformatted sequential files::
  2050. * Asynchronous I/O::
  2051. 
  2052. File: gfortran.info, Node: KIND Type Parameters, Next: Internal representation of LOGICAL variables, Up: Compiler Characteristics
  2053. 5.1 KIND Type Parameters
  2054. ========================
  2055. The 'KIND' type parameters supported by GNU Fortran for the primitive
  2056. data types are:
  2057. 'INTEGER'
  2058. 1, 2, 4, 8*, 16*, default: 4**
  2059. 'LOGICAL'
  2060. 1, 2, 4, 8*, 16*, default: 4**
  2061. 'REAL'
  2062. 4, 8, 10*, 16*, default: 4***
  2063. 'COMPLEX'
  2064. 4, 8, 10*, 16*, default: 4***
  2065. 'DOUBLE PRECISION'
  2066. 4, 8, 10*, 16*, default: 8***
  2067. 'CHARACTER'
  2068. 1, 4, default: 1
  2069. * not available on all systems
  2070. ** unless '-fdefault-integer-8' is used
  2071. *** unless '-fdefault-real-8' is used (see *note Fortran Dialect
  2072. Options::)
  2073. The 'KIND' value matches the storage size in bytes, except for 'COMPLEX'
  2074. where the storage size is twice as much (or both real and imaginary part
  2075. are a real value of the given size). It is recommended to use the *note
  2076. SELECTED_CHAR_KIND::, *note SELECTED_INT_KIND:: and *note
  2077. SELECTED_REAL_KIND:: intrinsics or the 'INT8', 'INT16', 'INT32',
  2078. 'INT64', 'REAL32', 'REAL64', and 'REAL128' parameters of the
  2079. 'ISO_FORTRAN_ENV' module instead of the concrete values. The available
  2080. kind parameters can be found in the constant arrays 'CHARACTER_KINDS',
  2081. 'INTEGER_KINDS', 'LOGICAL_KINDS' and 'REAL_KINDS' in the *note
  2082. ISO_FORTRAN_ENV:: module. For C interoperability, the kind parameters
  2083. of the *note ISO_C_BINDING:: module should be used.
  2084. 
  2085. File: gfortran.info, Node: Internal representation of LOGICAL variables, Next: Evaluation of logical expressions, Prev: KIND Type Parameters, Up: Compiler Characteristics
  2086. 5.2 Internal representation of LOGICAL variables
  2087. ================================================
  2088. The Fortran standard does not specify how variables of 'LOGICAL' type
  2089. are represented, beyond requiring that 'LOGICAL' variables of default
  2090. kind have the same storage size as default 'INTEGER' and 'REAL'
  2091. variables. The GNU Fortran internal representation is as follows.
  2092. A 'LOGICAL(KIND=N)' variable is represented as an 'INTEGER(KIND=N)'
  2093. variable, however, with only two permissible values: '1' for '.TRUE.'
  2094. and '0' for '.FALSE.'. Any other integer value results in undefined
  2095. behavior.
  2096. See also *note Argument passing conventions:: and *note
  2097. Interoperability with C::.
  2098. 
  2099. File: gfortran.info, Node: Evaluation of logical expressions, Next: MAX and MIN intrinsics with REAL NaN arguments, Prev: Internal representation of LOGICAL variables, Up: Compiler Characteristics
  2100. 5.3 Evaluation of logical expressions
  2101. =====================================
  2102. The Fortran standard does not require the compiler to evaluate all parts
  2103. of an expression, if they do not contribute to the final result. For
  2104. logical expressions with '.AND.' or '.OR.' operators, in particular, GNU
  2105. Fortran will optimize out function calls (even to impure functions) if
  2106. the result of the expression can be established without them. However,
  2107. since not all compilers do that, and such an optimization can
  2108. potentially modify the program flow and subsequent results, GNU Fortran
  2109. throws warnings for such situations with the '-Wfunction-elimination'
  2110. flag.
  2111. 
  2112. File: gfortran.info, Node: MAX and MIN intrinsics with REAL NaN arguments, Next: Thread-safety of the runtime library, Prev: Evaluation of logical expressions, Up: Compiler Characteristics
  2113. 5.4 MAX and MIN intrinsics with REAL NaN arguments
  2114. ==================================================
  2115. The Fortran standard does not specify what the result of the 'MAX' and
  2116. 'MIN' intrinsics are if one of the arguments is a 'NaN'. Accordingly,
  2117. the GNU Fortran compiler does not specify that either, as this allows
  2118. for faster and more compact code to be generated. If the programmer
  2119. wishes to take some specific action in case one of the arguments is a
  2120. 'NaN', it is necessary to explicitly test the arguments before calling
  2121. 'MAX' or 'MIN', e.g. with the 'IEEE_IS_NAN' function from the intrinsic
  2122. module 'IEEE_ARITHMETIC'.
  2123. 
  2124. File: gfortran.info, Node: Thread-safety of the runtime library, Next: Data consistency and durability, Prev: MAX and MIN intrinsics with REAL NaN arguments, Up: Compiler Characteristics
  2125. 5.5 Thread-safety of the runtime library
  2126. ========================================
  2127. GNU Fortran can be used in programs with multiple threads, e.g. by using
  2128. OpenMP, by calling OS thread handling functions via the 'ISO_C_BINDING'
  2129. facility, or by GNU Fortran compiled library code being called from a
  2130. multi-threaded program.
  2131. The GNU Fortran runtime library, ('libgfortran'), supports being
  2132. called concurrently from multiple threads with the following exceptions.
  2133. During library initialization, the C 'getenv' function is used, which
  2134. need not be thread-safe. Similarly, the 'getenv' function is used to
  2135. implement the 'GET_ENVIRONMENT_VARIABLE' and 'GETENV' intrinsics. It is
  2136. the responsibility of the user to ensure that the environment is not
  2137. being updated concurrently when any of these actions are taking place.
  2138. The 'EXECUTE_COMMAND_LINE' and 'SYSTEM' intrinsics are implemented
  2139. with the 'system' function, which need not be thread-safe. It is the
  2140. responsibility of the user to ensure that 'system' is not called
  2141. concurrently.
  2142. For platforms not supporting thread-safe POSIX functions, further
  2143. functionality might not be thread-safe. For details, please consult the
  2144. documentation for your operating system.
  2145. The GNU Fortran runtime library uses various C library functions that
  2146. depend on the locale, such as 'strtod' and 'snprintf'. In order to work
  2147. correctly in locale-aware programs that set the locale using
  2148. 'setlocale', the locale is reset to the default "C" locale while
  2149. executing a formatted 'READ' or 'WRITE' statement. On targets
  2150. supporting the POSIX 2008 per-thread locale functions (e.g.
  2151. 'newlocale', 'uselocale', 'freelocale'), these are used and thus the
  2152. global locale set using 'setlocale' or the per-thread locales in other
  2153. threads are not affected. However, on targets lacking this
  2154. functionality, the global LC_NUMERIC locale is set to "C" during the
  2155. formatted I/O. Thus, on such targets it's not safe to call 'setlocale'
  2156. concurrently from another thread while a Fortran formatted I/O operation
  2157. is in progress. Also, other threads doing something dependent on the
  2158. LC_NUMERIC locale might not work correctly if a formatted I/O operation
  2159. is in progress in another thread.
  2160. 
  2161. File: gfortran.info, Node: Data consistency and durability, Next: Files opened without an explicit ACTION= specifier, Prev: Thread-safety of the runtime library, Up: Compiler Characteristics
  2162. 5.6 Data consistency and durability
  2163. ===================================
  2164. This section contains a brief overview of data and metadata consistency
  2165. and durability issues when doing I/O.
  2166. With respect to durability, GNU Fortran makes no effort to ensure
  2167. that data is committed to stable storage. If this is required, the GNU
  2168. Fortran programmer can use the intrinsic 'FNUM' to retrieve the low
  2169. level file descriptor corresponding to an open Fortran unit. Then,
  2170. using e.g. the 'ISO_C_BINDING' feature, one can call the underlying
  2171. system call to flush dirty data to stable storage, such as 'fsync' on
  2172. POSIX, '_commit' on MingW, or 'fcntl(fd, F_FULLSYNC, 0)' on Mac OS X.
  2173. The following example shows how to call fsync:
  2174. ! Declare the interface for POSIX fsync function
  2175. interface
  2176. function fsync (fd) bind(c,name="fsync")
  2177. use iso_c_binding, only: c_int
  2178. integer(c_int), value :: fd
  2179. integer(c_int) :: fsync
  2180. end function fsync
  2181. end interface
  2182. ! Variable declaration
  2183. integer :: ret
  2184. ! Opening unit 10
  2185. open (10,file="foo")
  2186. ! ...
  2187. ! Perform I/O on unit 10
  2188. ! ...
  2189. ! Flush and sync
  2190. flush(10)
  2191. ret = fsync(fnum(10))
  2192. ! Handle possible error
  2193. if (ret /= 0) stop "Error calling FSYNC"
  2194. With respect to consistency, for regular files GNU Fortran uses
  2195. buffered I/O in order to improve performance. This buffer is flushed
  2196. automatically when full and in some other situations, e.g. when closing
  2197. a unit. It can also be explicitly flushed with the 'FLUSH' statement.
  2198. Also, the buffering can be turned off with the 'GFORTRAN_UNBUFFERED_ALL'
  2199. and 'GFORTRAN_UNBUFFERED_PRECONNECTED' environment variables. Special
  2200. files, such as terminals and pipes, are always unbuffered. Sometimes,
  2201. however, further things may need to be done in order to allow other
  2202. processes to see data that GNU Fortran has written, as follows.
  2203. The Windows platform supports a relaxed metadata consistency model,
  2204. where file metadata is written to the directory lazily. This means
  2205. that, for instance, the 'dir' command can show a stale size for a file.
  2206. One can force a directory metadata update by closing the unit, or by
  2207. calling '_commit' on the file descriptor. Note, though, that '_commit'
  2208. will force all dirty data to stable storage, which is often a very slow
  2209. operation.
  2210. The Network File System (NFS) implements a relaxed consistency model
  2211. called open-to-close consistency. Closing a file forces dirty data and
  2212. metadata to be flushed to the server, and opening a file forces the
  2213. client to contact the server in order to revalidate cached data.
  2214. 'fsync' will also force a flush of dirty data and metadata to the
  2215. server. Similar to 'open' and 'close', acquiring and releasing 'fcntl'
  2216. file locks, if the server supports them, will also force cache
  2217. validation and flushing dirty data and metadata.
  2218. 
  2219. File: gfortran.info, Node: Files opened without an explicit ACTION= specifier, Next: File operations on symbolic links, Prev: Data consistency and durability, Up: Compiler Characteristics
  2220. 5.7 Files opened without an explicit ACTION= specifier
  2221. ======================================================
  2222. The Fortran standard says that if an 'OPEN' statement is executed
  2223. without an explicit 'ACTION=' specifier, the default value is processor
  2224. dependent. GNU Fortran behaves as follows:
  2225. 1. Attempt to open the file with 'ACTION='READWRITE''
  2226. 2. If that fails, try to open with 'ACTION='READ''
  2227. 3. If that fails, try to open with 'ACTION='WRITE''
  2228. 4. If that fails, generate an error
  2229. 
  2230. File: gfortran.info, Node: File operations on symbolic links, Next: File format of unformatted sequential files, Prev: Files opened without an explicit ACTION= specifier, Up: Compiler Characteristics
  2231. 5.8 File operations on symbolic links
  2232. =====================================
  2233. This section documents the behavior of GNU Fortran for file operations
  2234. on symbolic links, on systems that support them.
  2235. * Results of INQUIRE statements of the "inquire by file" form will
  2236. relate to the target of the symbolic link. For example,
  2237. 'INQUIRE(FILE="foo",EXIST=ex)' will set EX to .TRUE. if FOO is a
  2238. symbolic link pointing to an existing file, and .FALSE. if FOO
  2239. points to an non-existing file ("dangling" symbolic link).
  2240. * Using the 'OPEN' statement with a 'STATUS="NEW"' specifier on a
  2241. symbolic link will result in an error condition, whether the
  2242. symbolic link points to an existing target or is dangling.
  2243. * If a symbolic link was connected, using the 'CLOSE' statement with
  2244. a 'STATUS="DELETE"' specifier will cause the symbolic link itself
  2245. to be deleted, not its target.
  2246. 
  2247. File: gfortran.info, Node: File format of unformatted sequential files, Next: Asynchronous I/O, Prev: File operations on symbolic links, Up: Compiler Characteristics
  2248. 5.9 File format of unformatted sequential files
  2249. ===============================================
  2250. Unformatted sequential files are stored as logical records using record
  2251. markers. Each logical record consists of one of more subrecords.
  2252. Each subrecord consists of a leading record marker, the data written
  2253. by the user program, and a trailing record marker. The record markers
  2254. are four-byte integers by default, and eight-byte integers if the
  2255. '-fmax-subrecord-length=8' option (which exists for backwards
  2256. compability only) is in effect.
  2257. The representation of the record markers is that of unformatted files
  2258. given with the '-fconvert' option, the *note CONVERT specifier:: in an
  2259. open statement or the *note GFORTRAN_CONVERT_UNIT:: environment
  2260. variable.
  2261. The maximum number of bytes of user data in a subrecord is 2147483639
  2262. (2 GiB - 9) for a four-byte record marker. This limit can be lowered
  2263. with the '-fmax-subrecord-length' option, altough this is rarely useful.
  2264. If the length of a logical record exceeds this limit, the data is
  2265. distributed among several subrecords.
  2266. The absolute of the number stored in the record markers is the number
  2267. of bytes of user data in the corresponding subrecord. If the leading
  2268. record marker of a subrecord contains a negative number, another
  2269. subrecord follows the current one. If the trailing record marker
  2270. contains a negative number, then there is a preceding subrecord.
  2271. In the most simple case, with only one subrecord per logical record,
  2272. both record markers contain the number of bytes of user data in the
  2273. record.
  2274. The format for unformatted sequential data can be duplicated using
  2275. unformatted stream, as shown in the example program for an unformatted
  2276. record containing a single subrecord:
  2277. program main
  2278. use iso_fortran_env, only: int32
  2279. implicit none
  2280. integer(int32) :: i
  2281. real, dimension(10) :: a, b
  2282. call random_number(a)
  2283. open (10,file='test.dat',form='unformatted',access='stream')
  2284. inquire (iolength=i) a
  2285. write (10) i, a, i
  2286. close (10)
  2287. open (10,file='test.dat',form='unformatted')
  2288. read (10) b
  2289. if (all (a == b)) print *,'success!'
  2290. end program main
  2291. 
  2292. File: gfortran.info, Node: Asynchronous I/O, Prev: File format of unformatted sequential files, Up: Compiler Characteristics
  2293. 5.10 Asynchronous I/O
  2294. =====================
  2295. Asynchronous I/O is supported if the program is linked against the POSIX
  2296. thread library. If that is not the case, all I/O is performed as
  2297. synchronous. On systems which do not support pthread condition
  2298. variables, such as AIX, I/O is also performed as synchronous.
  2299. On some systems, such as Darwin or Solaris, the POSIX thread library
  2300. is always linked in, so asynchronous I/O is always performed. On other
  2301. sytems, such as Linux, it is necessary to specify '-pthread',
  2302. '-lpthread' or '-fopenmp' during the linking step.
  2303. 
  2304. File: gfortran.info, Node: Extensions, Next: Mixed-Language Programming, Prev: Compiler Characteristics, Up: Top
  2305. 6 Extensions
  2306. ************
  2307. The two sections below detail the extensions to standard Fortran that
  2308. are implemented in GNU Fortran, as well as some of the popular or
  2309. historically important extensions that are not (or not yet) implemented.
  2310. For the latter case, we explain the alternatives available to GNU
  2311. Fortran users, including replacement by standard-conforming code or GNU
  2312. extensions.
  2313. * Menu:
  2314. * Extensions implemented in GNU Fortran::
  2315. * Extensions not implemented in GNU Fortran::
  2316. 
  2317. File: gfortran.info, Node: Extensions implemented in GNU Fortran, Next: Extensions not implemented in GNU Fortran, Up: Extensions
  2318. 6.1 Extensions implemented in GNU Fortran
  2319. =========================================
  2320. GNU Fortran implements a number of extensions over standard Fortran.
  2321. This chapter contains information on their syntax and meaning. There
  2322. are currently two categories of GNU Fortran extensions, those that
  2323. provide functionality beyond that provided by any standard, and those
  2324. that are supported by GNU Fortran purely for backward compatibility with
  2325. legacy compilers. By default, '-std=gnu' allows the compiler to accept
  2326. both types of extensions, but to warn about the use of the latter.
  2327. Specifying either '-std=f95', '-std=f2003', '-std=f2008', or
  2328. '-std=f2018' disables both types of extensions, and '-std=legacy' allows
  2329. both without warning. The special compile flag '-fdec' enables
  2330. additional compatibility extensions along with those enabled by
  2331. '-std=legacy'.
  2332. * Menu:
  2333. * Old-style kind specifications::
  2334. * Old-style variable initialization::
  2335. * Extensions to namelist::
  2336. * X format descriptor without count field::
  2337. * Commas in FORMAT specifications::
  2338. * Missing period in FORMAT specifications::
  2339. * Default widths for F, G and I format descriptors::
  2340. * I/O item lists::
  2341. * 'Q' exponent-letter::
  2342. * BOZ literal constants::
  2343. * Real array indices::
  2344. * Unary operators::
  2345. * Implicitly convert LOGICAL and INTEGER values::
  2346. * Hollerith constants support::
  2347. * Character conversion::
  2348. * Cray pointers::
  2349. * CONVERT specifier::
  2350. * OpenMP::
  2351. * OpenACC::
  2352. * Argument list functions::
  2353. * Read/Write after EOF marker::
  2354. * STRUCTURE and RECORD::
  2355. * UNION and MAP::
  2356. * Type variants for integer intrinsics::
  2357. * AUTOMATIC and STATIC attributes::
  2358. * Extended math intrinsics::
  2359. * Form feed as whitespace::
  2360. * TYPE as an alias for PRINT::
  2361. * %LOC as an rvalue::
  2362. * .XOR. operator::
  2363. * Bitwise logical operators::
  2364. * Extended I/O specifiers::
  2365. * Legacy PARAMETER statements::
  2366. * Default exponents::
  2367. 
  2368. File: gfortran.info, Node: Old-style kind specifications, Next: Old-style variable initialization, Up: Extensions implemented in GNU Fortran
  2369. 6.1.1 Old-style kind specifications
  2370. -----------------------------------
  2371. GNU Fortran allows old-style kind specifications in declarations. These
  2372. look like:
  2373. TYPESPEC*size x,y,z
  2374. where 'TYPESPEC' is a basic type ('INTEGER', 'REAL', etc.), and where
  2375. 'size' is a byte count corresponding to the storage size of a valid kind
  2376. for that type. (For 'COMPLEX' variables, 'size' is the total size of
  2377. the real and imaginary parts.) The statement then declares 'x', 'y' and
  2378. 'z' to be of type 'TYPESPEC' with the appropriate kind. This is
  2379. equivalent to the standard-conforming declaration
  2380. TYPESPEC(k) x,y,z
  2381. where 'k' is the kind parameter suitable for the intended precision. As
  2382. kind parameters are implementation-dependent, use the 'KIND',
  2383. 'SELECTED_INT_KIND' and 'SELECTED_REAL_KIND' intrinsics to retrieve the
  2384. correct value, for instance 'REAL*8 x' can be replaced by:
  2385. INTEGER, PARAMETER :: dbl = KIND(1.0d0)
  2386. REAL(KIND=dbl) :: x
  2387. 
  2388. File: gfortran.info, Node: Old-style variable initialization, Next: Extensions to namelist, Prev: Old-style kind specifications, Up: Extensions implemented in GNU Fortran
  2389. 6.1.2 Old-style variable initialization
  2390. ---------------------------------------
  2391. GNU Fortran allows old-style initialization of variables of the form:
  2392. INTEGER i/1/,j/2/
  2393. REAL x(2,2) /3*0.,1./
  2394. The syntax for the initializers is as for the 'DATA' statement, but
  2395. unlike in a 'DATA' statement, an initializer only applies to the
  2396. variable immediately preceding the initialization. In other words,
  2397. something like 'INTEGER I,J/2,3/' is not valid. This style of
  2398. initialization is only allowed in declarations without double colons
  2399. ('::'); the double colons were introduced in Fortran 90, which also
  2400. introduced a standard syntax for initializing variables in type
  2401. declarations.
  2402. Examples of standard-conforming code equivalent to the above example
  2403. are:
  2404. ! Fortran 90
  2405. INTEGER :: i = 1, j = 2
  2406. REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x))
  2407. ! Fortran 77
  2408. INTEGER i, j
  2409. REAL x(2,2)
  2410. DATA i/1/, j/2/, x/3*0.,1./
  2411. Note that variables which are explicitly initialized in declarations
  2412. or in 'DATA' statements automatically acquire the 'SAVE' attribute.
  2413. 
  2414. File: gfortran.info, Node: Extensions to namelist, Next: X format descriptor without count field, Prev: Old-style variable initialization, Up: Extensions implemented in GNU Fortran
  2415. 6.1.3 Extensions to namelist
  2416. ----------------------------
  2417. GNU Fortran fully supports the Fortran 95 standard for namelist I/O
  2418. including array qualifiers, substrings and fully qualified derived
  2419. types. The output from a namelist write is compatible with namelist
  2420. read. The output has all names in upper case and indentation to column
  2421. 1 after the namelist name. Two extensions are permitted:
  2422. Old-style use of '$' instead of '&'
  2423. $MYNML
  2424. X(:)%Y(2) = 1.0 2.0 3.0
  2425. CH(1:4) = "abcd"
  2426. $END
  2427. It should be noted that the default terminator is '/' rather than
  2428. '&END'.
  2429. Querying of the namelist when inputting from stdin. After at least
  2430. one space, entering '?' sends to stdout the namelist name and the names
  2431. of the variables in the namelist:
  2432. ?
  2433. &mynml
  2434. x
  2435. x%y
  2436. ch
  2437. &end
  2438. Entering '=?' outputs the namelist to stdout, as if 'WRITE(*,NML =
  2439. mynml)' had been called:
  2440. =?
  2441. &MYNML
  2442. X(1)%Y= 0.000000 , 1.000000 , 0.000000 ,
  2443. X(2)%Y= 0.000000 , 2.000000 , 0.000000 ,
  2444. X(3)%Y= 0.000000 , 3.000000 , 0.000000 ,
  2445. CH=abcd, /
  2446. To aid this dialog, when input is from stdin, errors send their
  2447. messages to stderr and execution continues, even if 'IOSTAT' is set.
  2448. 'PRINT' namelist is permitted. This causes an error if '-std=f95' is
  2449. used.
  2450. PROGRAM test_print
  2451. REAL, dimension (4) :: x = (/1.0, 2.0, 3.0, 4.0/)
  2452. NAMELIST /mynml/ x
  2453. PRINT mynml
  2454. END PROGRAM test_print
  2455. Expanded namelist reads are permitted. This causes an error if
  2456. '-std=f95' is used. In the following example, the first element of the
  2457. array will be given the value 0.00 and the two succeeding elements will
  2458. be given the values 1.00 and 2.00.
  2459. &MYNML
  2460. X(1,1) = 0.00 , 1.00 , 2.00
  2461. /
  2462. When writing a namelist, if no 'DELIM=' is specified, by default a
  2463. double quote is used to delimit character strings. If -std=F95, F2003,
  2464. or F2008, etc, the delim status is set to 'none'. Defaulting to quotes
  2465. ensures that namelists with character strings can be subsequently read
  2466. back in accurately.
  2467. 
  2468. File: gfortran.info, Node: X format descriptor without count field, Next: Commas in FORMAT specifications, Prev: Extensions to namelist, Up: Extensions implemented in GNU Fortran
  2469. 6.1.4 'X' format descriptor without count field
  2470. -----------------------------------------------
  2471. To support legacy codes, GNU Fortran permits the count field of the 'X'
  2472. edit descriptor in 'FORMAT' statements to be omitted. When omitted, the
  2473. count is implicitly assumed to be one.
  2474. PRINT 10, 2, 3
  2475. 10 FORMAT (I1, X, I1)
  2476. 
  2477. File: gfortran.info, Node: Commas in FORMAT specifications, Next: Missing period in FORMAT specifications, Prev: X format descriptor without count field, Up: Extensions implemented in GNU Fortran
  2478. 6.1.5 Commas in 'FORMAT' specifications
  2479. ---------------------------------------
  2480. To support legacy codes, GNU Fortran allows the comma separator to be
  2481. omitted immediately before and after character string edit descriptors
  2482. in 'FORMAT' statements. A comma with no following format decriptor is
  2483. permited if the '-fdec-blank-format-item' is given on the command line.
  2484. This is considered non-conforming code and is discouraged.
  2485. PRINT 10, 2, 3
  2486. 10 FORMAT ('FOO='I1' BAR='I2)
  2487. print 20, 5, 6
  2488. 20 FORMAT (I3, I3,)
  2489. 
  2490. File: gfortran.info, Node: Missing period in FORMAT specifications, Next: Default widths for F, G and I format descriptors, Prev: Commas in FORMAT specifications, Up: Extensions implemented in GNU Fortran
  2491. 6.1.6 Missing period in 'FORMAT' specifications
  2492. -----------------------------------------------
  2493. To support legacy codes, GNU Fortran allows missing periods in format
  2494. specifications if and only if '-std=legacy' is given on the command
  2495. line. This is considered non-conforming code and is discouraged.
  2496. REAL :: value
  2497. READ(*,10) value
  2498. 10 FORMAT ('F4')
  2499. 
  2500. File: gfortran.info, Node: Default widths for F, G and I format descriptors, Next: I/O item lists, Prev: Missing period in FORMAT specifications, Up: Extensions implemented in GNU Fortran
  2501. 6.1.7 Default widths for 'F', 'G' and 'I' format descriptors
  2502. ------------------------------------------------------------
  2503. To support legacy codes, GNU Fortran allows width to be omitted from
  2504. format specifications if and only if '-fdec-format-defaults' is given on
  2505. the command line. Default widths will be used. This is considered
  2506. non-conforming code and is discouraged.
  2507. REAL :: value1
  2508. INTEGER :: value2
  2509. WRITE(*,10) value1, value1, value2
  2510. 10 FORMAT ('F, G, I')
  2511. 
  2512. File: gfortran.info, Node: I/O item lists, Next: 'Q' exponent-letter, Prev: Default widths for F, G and I format descriptors, Up: Extensions implemented in GNU Fortran
  2513. 6.1.8 I/O item lists
  2514. --------------------
  2515. To support legacy codes, GNU Fortran allows the input item list of the
  2516. 'READ' statement, and the output item lists of the 'WRITE' and 'PRINT'
  2517. statements, to start with a comma.
  2518. 
  2519. File: gfortran.info, Node: 'Q' exponent-letter, Next: BOZ literal constants, Prev: I/O item lists, Up: Extensions implemented in GNU Fortran
  2520. 6.1.9 'Q' exponent-letter
  2521. -------------------------
  2522. GNU Fortran accepts real literal constants with an exponent-letter of
  2523. 'Q', for example, '1.23Q45'. The constant is interpreted as a
  2524. 'REAL(16)' entity on targets that support this type. If the target does
  2525. not support 'REAL(16)' but has a 'REAL(10)' type, then the
  2526. real-literal-constant will be interpreted as a 'REAL(10)' entity. In
  2527. the absence of 'REAL(16)' and 'REAL(10)', an error will occur.
  2528. 
  2529. File: gfortran.info, Node: BOZ literal constants, Next: Real array indices, Prev: 'Q' exponent-letter, Up: Extensions implemented in GNU Fortran
  2530. 6.1.10 BOZ literal constants
  2531. ----------------------------
  2532. Besides decimal constants, Fortran also supports binary ('b'), octal
  2533. ('o') and hexadecimal ('z') integer constants. The syntax is: 'prefix
  2534. quote digits quote', were the prefix is either 'b', 'o' or 'z', quote is
  2535. either ''' or '"' and the digits are '0' or '1' for binary, between '0'
  2536. and '7' for octal, and between '0' and 'F' for hexadecimal. (Example:
  2537. 'b'01011101''.)
  2538. Up to Fortran 95, BOZ literal constants were only allowed to
  2539. initialize integer variables in DATA statements. Since Fortran 2003 BOZ
  2540. literal constants are also allowed as actual arguments to the 'REAL',
  2541. 'DBLE', 'INT' and 'CMPLX' intrinsic functions. The BOZ literal constant
  2542. is simply a string of bits, which is padded or truncated as needed,
  2543. during conversion to a numeric type. The Fortran standard states that
  2544. the treatment of the sign bit is processor dependent. Gfortran
  2545. interprets the sign bit as a user would expect.
  2546. As a deprecated extension, GNU Fortran allows hexadecimal BOZ literal
  2547. constants to be specified using the 'X' prefix. That the BOZ literal
  2548. constant can also be specified by adding a suffix to the string, for
  2549. example, 'Z'ABC'' and ''ABC'X' are equivalent. Additionally, as
  2550. extension, BOZ literals are permitted in some contexts outside of 'DATA'
  2551. and the intrinsic functions listed in the Fortran standard. Use
  2552. '-fallow-invalid-boz' to enable the extension.
  2553. 
  2554. File: gfortran.info, Node: Real array indices, Next: Unary operators, Prev: BOZ literal constants, Up: Extensions implemented in GNU Fortran
  2555. 6.1.11 Real array indices
  2556. -------------------------
  2557. As an extension, GNU Fortran allows the use of 'REAL' expressions or
  2558. variables as array indices.
  2559. 
  2560. File: gfortran.info, Node: Unary operators, Next: Implicitly convert LOGICAL and INTEGER values, Prev: Real array indices, Up: Extensions implemented in GNU Fortran
  2561. 6.1.12 Unary operators
  2562. ----------------------
  2563. As an extension, GNU Fortran allows unary plus and unary minus operators
  2564. to appear as the second operand of binary arithmetic operators without
  2565. the need for parenthesis.
  2566. X = Y * -Z
  2567. 
  2568. File: gfortran.info, Node: Implicitly convert LOGICAL and INTEGER values, Next: Hollerith constants support, Prev: Unary operators, Up: Extensions implemented in GNU Fortran
  2569. 6.1.13 Implicitly convert 'LOGICAL' and 'INTEGER' values
  2570. --------------------------------------------------------
  2571. As an extension for backwards compatibility with other compilers, GNU
  2572. Fortran allows the implicit conversion of 'LOGICAL' values to 'INTEGER'
  2573. values and vice versa. When converting from a 'LOGICAL' to an
  2574. 'INTEGER', '.FALSE.' is interpreted as zero, and '.TRUE.' is interpreted
  2575. as one. When converting from 'INTEGER' to 'LOGICAL', the value zero is
  2576. interpreted as '.FALSE.' and any nonzero value is interpreted as
  2577. '.TRUE.'.
  2578. LOGICAL :: l
  2579. l = 1
  2580. INTEGER :: i
  2581. i = .TRUE.
  2582. However, there is no implicit conversion of 'INTEGER' values in
  2583. 'if'-statements, nor of 'LOGICAL' or 'INTEGER' values in I/O operations.
  2584. 
  2585. File: gfortran.info, Node: Hollerith constants support, Next: Character conversion, Prev: Implicitly convert LOGICAL and INTEGER values, Up: Extensions implemented in GNU Fortran
  2586. 6.1.14 Hollerith constants support
  2587. ----------------------------------
  2588. GNU Fortran supports Hollerith constants in assignments, 'DATA'
  2589. statements, function and subroutine arguments. A Hollerith constant is
  2590. written as a string of characters preceded by an integer constant
  2591. indicating the character count, and the letter 'H' or 'h', and stored in
  2592. bytewise fashion in a numeric ('INTEGER', 'REAL', or 'COMPLEX'),
  2593. 'LOGICAL' or 'CHARACTER' variable. The constant will be padded with
  2594. spaces or truncated to fit the size of the variable in which it is
  2595. stored.
  2596. Examples of valid uses of Hollerith constants:
  2597. complex*16 x(2)
  2598. data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
  2599. x(1) = 16HABCDEFGHIJKLMNOP
  2600. call foo (4h abc)
  2601. Examples of Hollerith constants:
  2602. integer*4 a
  2603. a = 0H ! Invalid, at least one character is needed.
  2604. a = 4HAB12 ! Valid
  2605. a = 8H12345678 ! Valid, but the Hollerith constant will be truncated.
  2606. a = 3Hxyz ! Valid, but the Hollerith constant will be padded.
  2607. In general, Hollerith constants were used to provide a rudimentary
  2608. facility for handling character strings in early Fortran compilers,
  2609. prior to the introduction of 'CHARACTER' variables in Fortran 77; in
  2610. those cases, the standard-compliant equivalent is to convert the program
  2611. to use proper character strings. On occasion, there may be a case where
  2612. the intent is specifically to initialize a numeric variable with a given
  2613. byte sequence. In these cases, the same result can be obtained by using
  2614. the 'TRANSFER' statement, as in this example.
  2615. integer(kind=4) :: a
  2616. a = transfer ("abcd", a) ! equivalent to: a = 4Habcd
  2617. The use of the '-fdec' option extends support of Hollerith constants
  2618. to comparisons:
  2619. integer*4 a
  2620. a = 4hABCD
  2621. if (a .ne. 4habcd) then
  2622. write(*,*) "no match"
  2623. end if
  2624. Supported types are numeric ('INTEGER', 'REAL', or 'COMPLEX'), and
  2625. 'CHARACTER'.
  2626. 
  2627. File: gfortran.info, Node: Character conversion, Next: Cray pointers, Prev: Hollerith constants support, Up: Extensions implemented in GNU Fortran
  2628. 6.1.15 Character conversion
  2629. ---------------------------
  2630. Allowing character literals to be used in a similar way to Hollerith
  2631. constants is a non-standard extension. This feature is enabled using
  2632. -fdec-char-conversions and only applies to character literals of
  2633. 'kind=1'.
  2634. Character literals can be used in 'DATA' statements and assignments
  2635. with numeric ('INTEGER', 'REAL', or 'COMPLEX') or 'LOGICAL' variables.
  2636. Like Hollerith constants they are copied byte-wise fashion. The
  2637. constant will be padded with spaces or truncated to fit the size of the
  2638. variable in which it is stored.
  2639. Examples:
  2640. integer*4 x
  2641. data x / 'abcd' /
  2642. x = 'A' ! Will be padded.
  2643. x = 'ab1234' ! Will be truncated.
  2644. 
  2645. File: gfortran.info, Node: Cray pointers, Next: CONVERT specifier, Prev: Character conversion, Up: Extensions implemented in GNU Fortran
  2646. 6.1.16 Cray pointers
  2647. --------------------
  2648. Cray pointers are part of a non-standard extension that provides a
  2649. C-like pointer in Fortran. This is accomplished through a pair of
  2650. variables: an integer "pointer" that holds a memory address, and a
  2651. "pointee" that is used to dereference the pointer.
  2652. Pointer/pointee pairs are declared in statements of the form:
  2653. pointer ( <pointer> , <pointee> )
  2654. or,
  2655. pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ...
  2656. The pointer is an integer that is intended to hold a memory address.
  2657. The pointee may be an array or scalar. If an assumed-size array is
  2658. permitted within the scoping unit, a pointee can be an assumed-size
  2659. array. That is, the last dimension may be left unspecified by using a
  2660. '*' in place of a value. A pointee cannot be an assumed shape array.
  2661. No space is allocated for the pointee.
  2662. The pointee may have its type declared before or after the pointer
  2663. statement, and its array specification (if any) may be declared before,
  2664. during, or after the pointer statement. The pointer may be declared as
  2665. an integer prior to the pointer statement. However, some machines have
  2666. default integer sizes that are different than the size of a pointer, and
  2667. so the following code is not portable:
  2668. integer ipt
  2669. pointer (ipt, iarr)
  2670. If a pointer is declared with a kind that is too small, the compiler
  2671. will issue a warning; the resulting binary will probably not work
  2672. correctly, because the memory addresses stored in the pointers may be
  2673. truncated. It is safer to omit the first line of the above example; if
  2674. explicit declaration of ipt's type is omitted, then the compiler will
  2675. ensure that ipt is an integer variable large enough to hold a pointer.
  2676. Pointer arithmetic is valid with Cray pointers, but it is not the
  2677. same as C pointer arithmetic. Cray pointers are just ordinary integers,
  2678. so the user is responsible for determining how many bytes to add to a
  2679. pointer in order to increment it. Consider the following example:
  2680. real target(10)
  2681. real pointee(10)
  2682. pointer (ipt, pointee)
  2683. ipt = loc (target)
  2684. ipt = ipt + 1
  2685. The last statement does not set 'ipt' to the address of 'target(1)',
  2686. as it would in C pointer arithmetic. Adding '1' to 'ipt' just adds one
  2687. byte to the address stored in 'ipt'.
  2688. Any expression involving the pointee will be translated to use the
  2689. value stored in the pointer as the base address.
  2690. To get the address of elements, this extension provides an intrinsic
  2691. function 'LOC()'. The 'LOC()' function is equivalent to the '&'
  2692. operator in C, except the address is cast to an integer type:
  2693. real ar(10)
  2694. pointer(ipt, arpte(10))
  2695. real arpte
  2696. ipt = loc(ar) ! Makes arpte is an alias for ar
  2697. arpte(1) = 1.0 ! Sets ar(1) to 1.0
  2698. The pointer can also be set by a call to the 'MALLOC' intrinsic (see
  2699. *note MALLOC::).
  2700. Cray pointees often are used to alias an existing variable. For
  2701. example:
  2702. integer target(10)
  2703. integer iarr(10)
  2704. pointer (ipt, iarr)
  2705. ipt = loc(target)
  2706. As long as 'ipt' remains unchanged, 'iarr' is now an alias for
  2707. 'target'. The optimizer, however, will not detect this aliasing, so it
  2708. is unsafe to use 'iarr' and 'target' simultaneously. Using a pointee in
  2709. any way that violates the Fortran aliasing rules or assumptions is
  2710. illegal. It is the user's responsibility to avoid doing this; the
  2711. compiler works under the assumption that no such aliasing occurs.
  2712. Cray pointers will work correctly when there is no aliasing (i.e.,
  2713. when they are used to access a dynamically allocated block of memory),
  2714. and also in any routine where a pointee is used, but any variable with
  2715. which it shares storage is not used. Code that violates these rules may
  2716. not run as the user intends. This is not a bug in the optimizer; any
  2717. code that violates the aliasing rules is illegal. (Note that this is
  2718. not unique to GNU Fortran; any Fortran compiler that supports Cray
  2719. pointers will "incorrectly" optimize code with illegal aliasing.)
  2720. There are a number of restrictions on the attributes that can be
  2721. applied to Cray pointers and pointees. Pointees may not have the
  2722. 'ALLOCATABLE', 'INTENT', 'OPTIONAL', 'DUMMY', 'TARGET', 'INTRINSIC', or
  2723. 'POINTER' attributes. Pointers may not have the 'DIMENSION', 'POINTER',
  2724. 'TARGET', 'ALLOCATABLE', 'EXTERNAL', or 'INTRINSIC' attributes, nor may
  2725. they be function results. Pointees may not occur in more than one
  2726. pointer statement. A pointee cannot be a pointer. Pointees cannot
  2727. occur in equivalence, common, or data statements.
  2728. A Cray pointer may also point to a function or a subroutine. For
  2729. example, the following excerpt is valid:
  2730. implicit none
  2731. external sub
  2732. pointer (subptr,subpte)
  2733. external subpte
  2734. subptr = loc(sub)
  2735. call subpte()
  2736. [...]
  2737. subroutine sub
  2738. [...]
  2739. end subroutine sub
  2740. A pointer may be modified during the course of a program, and this
  2741. will change the location to which the pointee refers. However, when
  2742. pointees are passed as arguments, they are treated as ordinary variables
  2743. in the invoked function. Subsequent changes to the pointer will not
  2744. change the base address of the array that was passed.
  2745. 
  2746. File: gfortran.info, Node: CONVERT specifier, Next: OpenMP, Prev: Cray pointers, Up: Extensions implemented in GNU Fortran
  2747. 6.1.17 'CONVERT' specifier
  2748. --------------------------
  2749. GNU Fortran allows the conversion of unformatted data between little-
  2750. and big-endian representation to facilitate moving of data between
  2751. different systems. The conversion can be indicated with the 'CONVERT'
  2752. specifier on the 'OPEN' statement. *Note GFORTRAN_CONVERT_UNIT::, for
  2753. an alternative way of specifying the data format via an environment
  2754. variable.
  2755. Valid values for 'CONVERT' are:
  2756. 'CONVERT='NATIVE'' Use the native format. This is the default.
  2757. 'CONVERT='SWAP'' Swap between little- and big-endian.
  2758. 'CONVERT='LITTLE_ENDIAN'' Use the little-endian representation for
  2759. unformatted files.
  2760. 'CONVERT='BIG_ENDIAN'' Use the big-endian representation for
  2761. unformatted files.
  2762. Using the option could look like this:
  2763. open(file='big.dat',form='unformatted',access='sequential', &
  2764. convert='big_endian')
  2765. The value of the conversion can be queried by using
  2766. 'INQUIRE(CONVERT=ch)'. The values returned are ''BIG_ENDIAN'' and
  2767. ''LITTLE_ENDIAN''.
  2768. 'CONVERT' works between big- and little-endian for 'INTEGER' values
  2769. of all supported kinds and for 'REAL' on IEEE systems of kinds 4 and 8.
  2770. Conversion between different "extended double" types on different
  2771. architectures such as m68k and x86_64, which GNU Fortran supports as
  2772. 'REAL(KIND=10)' and 'REAL(KIND=16)', will probably not work.
  2773. _Note that the values specified via the GFORTRAN_CONVERT_UNIT
  2774. environment variable will override the CONVERT specifier in the open
  2775. statement_. This is to give control over data formats to users who do
  2776. not have the source code of their program available.
  2777. Using anything but the native representation for unformatted data
  2778. carries a significant speed overhead. If speed in this area matters to
  2779. you, it is best if you use this only for data that needs to be portable.
  2780. 
  2781. File: gfortran.info, Node: OpenMP, Next: OpenACC, Prev: CONVERT specifier, Up: Extensions implemented in GNU Fortran
  2782. 6.1.18 OpenMP
  2783. -------------
  2784. OpenMP (Open Multi-Processing) is an application programming interface
  2785. (API) that supports multi-platform shared memory multiprocessing
  2786. programming in C/C++ and Fortran on many architectures, including Unix
  2787. and Microsoft Windows platforms. It consists of a set of compiler
  2788. directives, library routines, and environment variables that influence
  2789. run-time behavior.
  2790. GNU Fortran strives to be compatible to the OpenMP Application
  2791. Program Interface v4.5 (http://openmp.org/wp/openmp-specifications/).
  2792. To enable the processing of the OpenMP directive '!$omp' in free-form
  2793. source code; the 'c$omp', '*$omp' and '!$omp' directives in fixed form;
  2794. the '!$' conditional compilation sentinels in free form; and the 'c$',
  2795. '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be invoked
  2796. with the '-fopenmp'. This also arranges for automatic linking of the
  2797. GNU Offloading and Multi Processing Runtime Library *note libgomp:
  2798. (libgomp)Top.
  2799. The OpenMP Fortran runtime library routines are provided both in a
  2800. form of a Fortran 90 module named 'omp_lib' and in a form of a Fortran
  2801. 'include' file named 'omp_lib.h'.
  2802. An example of a parallelized loop taken from Appendix A.1 of the
  2803. OpenMP Application Program Interface v2.5:
  2804. SUBROUTINE A1(N, A, B)
  2805. INTEGER I, N
  2806. REAL B(N), A(N)
  2807. !$OMP PARALLEL DO !I is private by default
  2808. DO I=2,N
  2809. B(I) = (A(I) + A(I-1)) / 2.0
  2810. ENDDO
  2811. !$OMP END PARALLEL DO
  2812. END SUBROUTINE A1
  2813. Please note:
  2814. * '-fopenmp' implies '-frecursive', i.e., all local arrays will be
  2815. allocated on the stack. When porting existing code to OpenMP, this
  2816. may lead to surprising results, especially to segmentation faults
  2817. if the stacksize is limited.
  2818. * On glibc-based systems, OpenMP enabled applications cannot be
  2819. statically linked due to limitations of the underlying
  2820. pthreads-implementation. It might be possible to get a working
  2821. solution if '-Wl,--whole-archive -lpthread -Wl,--no-whole-archive'
  2822. is added to the command line. However, this is not supported by
  2823. 'gcc' and thus not recommended.
  2824. 
  2825. File: gfortran.info, Node: OpenACC, Next: Argument list functions, Prev: OpenMP, Up: Extensions implemented in GNU Fortran
  2826. 6.1.19 OpenACC
  2827. --------------
  2828. OpenACC is an application programming interface (API) that supports
  2829. offloading of code to accelerator devices. It consists of a set of
  2830. compiler directives, library routines, and environment variables that
  2831. influence run-time behavior.
  2832. GNU Fortran strives to be compatible to the OpenACC Application
  2833. Programming Interface v2.6 (http://www.openacc.org/).
  2834. To enable the processing of the OpenACC directive '!$acc' in
  2835. free-form source code; the 'c$acc', '*$acc' and '!$acc' directives in
  2836. fixed form; the '!$' conditional compilation sentinels in free form; and
  2837. the 'c$', '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be
  2838. invoked with the '-fopenacc'. This also arranges for automatic linking
  2839. of the GNU Offloading and Multi Processing Runtime Library *note
  2840. libgomp: (libgomp)Top.
  2841. The OpenACC Fortran runtime library routines are provided both in a
  2842. form of a Fortran 90 module named 'openacc' and in a form of a Fortran
  2843. 'include' file named 'openacc_lib.h'.
  2844. 
  2845. File: gfortran.info, Node: Argument list functions, Next: Read/Write after EOF marker, Prev: OpenACC, Up: Extensions implemented in GNU Fortran
  2846. 6.1.20 Argument list functions '%VAL', '%REF' and '%LOC'
  2847. --------------------------------------------------------
  2848. GNU Fortran supports argument list functions '%VAL', '%REF' and '%LOC'
  2849. statements, for backward compatibility with g77. It is recommended that
  2850. these should be used only for code that is accessing facilities outside
  2851. of GNU Fortran, such as operating system or windowing facilities. It is
  2852. best to constrain such uses to isolated portions of a program-portions
  2853. that deal specifically and exclusively with low-level, system-dependent
  2854. facilities. Such portions might well provide a portable interface for
  2855. use by the program as a whole, but are themselves not portable, and
  2856. should be thoroughly tested each time they are rebuilt using a new
  2857. compiler or version of a compiler.
  2858. '%VAL' passes a scalar argument by value, '%REF' passes it by
  2859. reference and '%LOC' passes its memory location. Since gfortran already
  2860. passes scalar arguments by reference, '%REF' is in effect a do-nothing.
  2861. '%LOC' has the same effect as a Fortran pointer.
  2862. An example of passing an argument by value to a C subroutine foo.:
  2863. C
  2864. C prototype void foo_ (float x);
  2865. C
  2866. external foo
  2867. real*4 x
  2868. x = 3.14159
  2869. call foo (%VAL (x))
  2870. end
  2871. For details refer to the g77 manual
  2872. <https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top>.
  2873. Also, 'c_by_val.f' and its partner 'c_by_val.c' of the GNU Fortran
  2874. testsuite are worth a look.
  2875. 
  2876. File: gfortran.info, Node: Read/Write after EOF marker, Next: STRUCTURE and RECORD, Prev: Argument list functions, Up: Extensions implemented in GNU Fortran
  2877. 6.1.21 Read/Write after EOF marker
  2878. ----------------------------------
  2879. Some legacy codes rely on allowing 'READ' or 'WRITE' after the EOF file
  2880. marker in order to find the end of a file. GNU Fortran normally rejects
  2881. these codes with a run-time error message and suggests the user consider
  2882. 'BACKSPACE' or 'REWIND' to properly position the file before the EOF
  2883. marker. As an extension, the run-time error may be disabled using
  2884. -std=legacy.
  2885. 
  2886. File: gfortran.info, Node: STRUCTURE and RECORD, Next: UNION and MAP, Prev: Read/Write after EOF marker, Up: Extensions implemented in GNU Fortran
  2887. 6.1.22 'STRUCTURE' and 'RECORD'
  2888. -------------------------------
  2889. Record structures are a pre-Fortran-90 vendor extension to create
  2890. user-defined aggregate data types. Support for record structures in GNU
  2891. Fortran can be enabled with the '-fdec-structure' compile flag. If you
  2892. have a choice, you should instead use Fortran 90's "derived types",
  2893. which have a different syntax.
  2894. In many cases, record structures can easily be converted to derived
  2895. types. To convert, replace 'STRUCTURE /'STRUCTURE-NAME'/' by 'TYPE'
  2896. TYPE-NAME. Additionally, replace 'RECORD /'STRUCTURE-NAME'/' by
  2897. 'TYPE('TYPE-NAME')'. Finally, in the component access, replace the
  2898. period ('.') by the percent sign ('%').
  2899. Here is an example of code using the non portable record structure
  2900. syntax:
  2901. ! Declaring a structure named ``item'' and containing three fields:
  2902. ! an integer ID, an description string and a floating-point price.
  2903. STRUCTURE /item/
  2904. INTEGER id
  2905. CHARACTER(LEN=200) description
  2906. REAL price
  2907. END STRUCTURE
  2908. ! Define two variables, an single record of type ``item''
  2909. ! named ``pear'', and an array of items named ``store_catalog''
  2910. RECORD /item/ pear, store_catalog(100)
  2911. ! We can directly access the fields of both variables
  2912. pear.id = 92316
  2913. pear.description = "juicy D'Anjou pear"
  2914. pear.price = 0.15
  2915. store_catalog(7).id = 7831
  2916. store_catalog(7).description = "milk bottle"
  2917. store_catalog(7).price = 1.2
  2918. ! We can also manipulate the whole structure
  2919. store_catalog(12) = pear
  2920. print *, store_catalog(12)
  2921. This code can easily be rewritten in the Fortran 90 syntax as following:
  2922. ! ``STRUCTURE /name/ ... END STRUCTURE'' becomes
  2923. ! ``TYPE name ... END TYPE''
  2924. TYPE item
  2925. INTEGER id
  2926. CHARACTER(LEN=200) description
  2927. REAL price
  2928. END TYPE
  2929. ! ``RECORD /name/ variable'' becomes ``TYPE(name) variable''
  2930. TYPE(item) pear, store_catalog(100)
  2931. ! Instead of using a dot (.) to access fields of a record, the
  2932. ! standard syntax uses a percent sign (%)
  2933. pear%id = 92316
  2934. pear%description = "juicy D'Anjou pear"
  2935. pear%price = 0.15
  2936. store_catalog(7)%id = 7831
  2937. store_catalog(7)%description = "milk bottle"
  2938. store_catalog(7)%price = 1.2
  2939. ! Assignments of a whole variable do not change
  2940. store_catalog(12) = pear
  2941. print *, store_catalog(12)
  2942. GNU Fortran implements STRUCTURES like derived types with the following
  2943. rules and exceptions:
  2944. * Structures act like derived types with the 'SEQUENCE' attribute.
  2945. Otherwise they may contain no specifiers.
  2946. * Structures may contain a special field with the name '%FILL'. This
  2947. will create an anonymous component which cannot be accessed but
  2948. occupies space just as if a component of the same type was declared
  2949. in its place, useful for alignment purposes. As an example, the
  2950. following structure will consist of at least sixteen bytes:
  2951. structure /padded/
  2952. character(4) start
  2953. character(8) %FILL
  2954. character(4) end
  2955. end structure
  2956. * Structures may share names with other symbols. For example, the
  2957. following is invalid for derived types, but valid for structures:
  2958. structure /header/
  2959. ! ...
  2960. end structure
  2961. record /header/ header
  2962. * Structure types may be declared nested within another parent
  2963. structure. The syntax is:
  2964. structure /type-name/
  2965. ...
  2966. structure [/<type-name>/] <field-list>
  2967. ...
  2968. The type name may be ommitted, in which case the structure type
  2969. itself is anonymous, and other structures of the same type cannot
  2970. be instantiated. The following shows some examples:
  2971. structure /appointment/
  2972. ! nested structure definition: app_time is an array of two 'time'
  2973. structure /time/ app_time (2)
  2974. integer(1) hour, minute
  2975. end structure
  2976. character(10) memo
  2977. end structure
  2978. ! The 'time' structure is still usable
  2979. record /time/ now
  2980. now = time(5, 30)
  2981. ...
  2982. structure /appointment/
  2983. ! anonymous nested structure definition
  2984. structure start, end
  2985. integer(1) hour, minute
  2986. end structure
  2987. character(10) memo
  2988. end structure
  2989. * Structures may contain 'UNION' blocks. For more detail see the
  2990. section on *note UNION and MAP::.
  2991. * Structures support old-style initialization of components, like
  2992. those described in *note Old-style variable initialization::. For
  2993. array initializers, an initializer may contain a repeat
  2994. specification of the form '<literal-integer> *
  2995. <constant-initializer>'. The value of the integer indicates the
  2996. number of times to repeat the constant initializer when expanding
  2997. the initializer list.
  2998. 
  2999. File: gfortran.info, Node: UNION and MAP, Next: Type variants for integer intrinsics, Prev: STRUCTURE and RECORD, Up: Extensions implemented in GNU Fortran
  3000. 6.1.23 'UNION' and 'MAP'
  3001. ------------------------
  3002. Unions are an old vendor extension which were commonly used with the
  3003. non-standard *note STRUCTURE and RECORD:: extensions. Use of 'UNION'
  3004. and 'MAP' is automatically enabled with '-fdec-structure'.
  3005. A 'UNION' declaration occurs within a structure; within the
  3006. definition of each union is a number of 'MAP' blocks. Each 'MAP' shares
  3007. storage with its sibling maps (in the same union), and the size of the
  3008. union is the size of the largest map within it, just as with unions in
  3009. C. The major difference is that component references do not indicate
  3010. which union or map the component is in (the compiler gets to figure that
  3011. out).
  3012. Here is a small example:
  3013. structure /myunion/
  3014. union
  3015. map
  3016. character(2) w0, w1, w2
  3017. end map
  3018. map
  3019. character(6) long
  3020. end map
  3021. end union
  3022. end structure
  3023. record /myunion/ rec
  3024. ! After this assignment...
  3025. rec.long = 'hello!'
  3026. ! The following is true:
  3027. ! rec.w0 === 'he'
  3028. ! rec.w1 === 'll'
  3029. ! rec.w2 === 'o!'
  3030. The two maps share memory, and the size of the union is ultimately
  3031. six bytes:
  3032. 0 1 2 3 4 5 6 Byte offset
  3033. -------------------------------
  3034. | | | | | | |
  3035. -------------------------------
  3036. ^ W0 ^ W1 ^ W2 ^
  3037. \-------/ \-------/ \-------/
  3038. ^ LONG ^
  3039. \---------------------------/
  3040. Following is an example mirroring the layout of an Intel x86_64
  3041. register:
  3042. structure /reg/
  3043. union ! U0 ! rax
  3044. map
  3045. character(16) rx
  3046. end map
  3047. map
  3048. character(8) rh ! rah
  3049. union ! U1
  3050. map
  3051. character(8) rl ! ral
  3052. end map
  3053. map
  3054. character(8) ex ! eax
  3055. end map
  3056. map
  3057. character(4) eh ! eah
  3058. union ! U2
  3059. map
  3060. character(4) el ! eal
  3061. end map
  3062. map
  3063. character(4) x ! ax
  3064. end map
  3065. map
  3066. character(2) h ! ah
  3067. character(2) l ! al
  3068. end map
  3069. end union
  3070. end map
  3071. end union
  3072. end map
  3073. end union
  3074. end structure
  3075. record /reg/ a
  3076. ! After this assignment...
  3077. a.rx = 'AAAAAAAA.BBB.C.D'
  3078. ! The following is true:
  3079. a.rx === 'AAAAAAAA.BBB.C.D'
  3080. a.rh === 'AAAAAAAA'
  3081. a.rl === '.BBB.C.D'
  3082. a.ex === '.BBB.C.D'
  3083. a.eh === '.BBB'
  3084. a.el === '.C.D'
  3085. a.x === '.C.D'
  3086. a.h === '.C'
  3087. a.l === '.D'
  3088. 
  3089. File: gfortran.info, Node: Type variants for integer intrinsics, Next: AUTOMATIC and STATIC attributes, Prev: UNION and MAP, Up: Extensions implemented in GNU Fortran
  3090. 6.1.24 Type variants for integer intrinsics
  3091. -------------------------------------------
  3092. Similar to the D/C prefixes to real functions to specify the
  3093. input/output types, GNU Fortran offers B/I/J/K prefixes to integer
  3094. functions for compatibility with DEC programs. The types implied by
  3095. each are:
  3096. B - INTEGER(kind=1)
  3097. I - INTEGER(kind=2)
  3098. J - INTEGER(kind=4)
  3099. K - INTEGER(kind=8)
  3100. GNU Fortran supports these with the flag '-fdec-intrinsic-ints'.
  3101. Intrinsics for which prefixed versions are available and in what form
  3102. are noted in *note Intrinsic Procedures::. The complete list of
  3103. supported intrinsics is here:
  3104. Intrinsic B I J K
  3105. ---------------------------------------------------------------------------
  3106. '*note 'BABS' 'IIABS' 'JIABS' 'KIABS'
  3107. ABS::'
  3108. '*note 'BBTEST' 'BITEST' 'BJTEST' 'BKTEST'
  3109. BTEST::'
  3110. '*note 'BIAND' 'IIAND' 'JIAND' 'KIAND'
  3111. IAND::'
  3112. '*note 'BBCLR' 'IIBCLR' 'JIBCLR' 'KIBCLR'
  3113. IBCLR::'
  3114. '*note 'BBITS' 'IIBITS' 'JIBITS' 'KIBITS'
  3115. IBITS::'
  3116. '*note 'BBSET' 'IIBSET' 'JIBSET' 'KIBSET'
  3117. IBSET::'
  3118. '*note 'BIEOR' 'IIEOR' 'JIEOR' 'KIEOR'
  3119. IEOR::'
  3120. '*note 'BIOR' 'IIOR' 'JIOR' 'KIOR'
  3121. IOR::'
  3122. '*note 'BSHFT' 'IISHFT' 'JISHFT' 'KISHFT'
  3123. ISHFT::'
  3124. '*note 'BSHFTC' 'IISHFTC' 'JISHFTC' 'KISHFTC'
  3125. ISHFTC::'
  3126. '*note 'BMOD' 'IMOD' 'JMOD' 'KMOD'
  3127. MOD::'
  3128. '*note 'BNOT' 'INOT' 'JNOT' 'KNOT'
  3129. NOT::'
  3130. '*note '--' 'FLOATI' 'FLOATJ' 'FLOATK'
  3131. REAL::'
  3132. 
  3133. File: gfortran.info, Node: AUTOMATIC and STATIC attributes, Next: Extended math intrinsics, Prev: Type variants for integer intrinsics, Up: Extensions implemented in GNU Fortran
  3134. 6.1.25 'AUTOMATIC' and 'STATIC' attributes
  3135. ------------------------------------------
  3136. With '-fdec-static' GNU Fortran supports the DEC extended attributes
  3137. 'STATIC' and 'AUTOMATIC' to provide explicit specification of entity
  3138. storage. These follow the syntax of the Fortran standard 'SAVE'
  3139. attribute.
  3140. 'STATIC' is exactly equivalent to 'SAVE', and specifies that an
  3141. entity should be allocated in static memory. As an example, 'STATIC'
  3142. local variables will retain their values across multiple calls to a
  3143. function.
  3144. Entities marked 'AUTOMATIC' will be stack automatic whenever
  3145. possible. 'AUTOMATIC' is the default for local variables smaller than
  3146. '-fmax-stack-var-size', unless '-fno-automatic' is given. This
  3147. attribute overrides '-fno-automatic', '-fmax-stack-var-size', and
  3148. blanket 'SAVE' statements.
  3149. Examples:
  3150. subroutine f
  3151. integer, automatic :: i ! automatic variable
  3152. integer x, y ! static variables
  3153. save
  3154. ...
  3155. endsubroutine
  3156. subroutine f
  3157. integer a, b, c, x, y, z
  3158. static :: x
  3159. save y
  3160. automatic z, c
  3161. ! a, b, c, and z are automatic
  3162. ! x and y are static
  3163. endsubroutine
  3164. ! Compiled with -fno-automatic
  3165. subroutine f
  3166. integer a, b, c, d
  3167. automatic :: a
  3168. ! a is automatic; b, c, and d are static
  3169. endsubroutine
  3170. 
  3171. File: gfortran.info, Node: Extended math intrinsics, Next: Form feed as whitespace, Prev: AUTOMATIC and STATIC attributes, Up: Extensions implemented in GNU Fortran
  3172. 6.1.26 Extended math intrinsics
  3173. -------------------------------
  3174. GNU Fortran supports an extended list of mathematical intrinsics with
  3175. the compile flag '-fdec-math' for compatability with legacy code. These
  3176. intrinsics are described fully in *note Intrinsic Procedures:: where it
  3177. is noted that they are extensions and should be avoided whenever
  3178. possible.
  3179. Specifically, '-fdec-math' enables the *note COTAN:: intrinsic, and
  3180. trigonometric intrinsics which accept or produce values in degrees
  3181. instead of radians. Here is a summary of the new intrinsics:
  3182. Radians Degrees
  3183. --------------------------------------------------------------------------
  3184. '*note ACOS::' '*note ACOSD::'*
  3185. '*note ASIN::' '*note ASIND::'*
  3186. '*note ATAN::' '*note ATAND::'*
  3187. '*note ATAN2::' '*note ATAN2D::'*
  3188. '*note COS::' '*note COSD::'*
  3189. '*note COTAN::'* '*note COTAND::'*
  3190. '*note SIN::' '*note SIND::'*
  3191. '*note TAN::' '*note TAND::'*
  3192. * Enabled with '-fdec-math'.
  3193. For advanced users, it may be important to know the implementation of
  3194. these functions. They are simply wrappers around the standard radian
  3195. functions, which have more accurate builtin versions. These functions
  3196. convert their arguments (or results) to degrees (or radians) by taking
  3197. the value modulus 360 (or 2*pi) and then multiplying it by a constant
  3198. radian-to-degree (or degree-to-radian) factor, as appropriate. The
  3199. factor is computed at compile-time as 180/pi (or pi/180).
  3200. 
  3201. File: gfortran.info, Node: Form feed as whitespace, Next: TYPE as an alias for PRINT, Prev: Extended math intrinsics, Up: Extensions implemented in GNU Fortran
  3202. 6.1.27 Form feed as whitespace
  3203. ------------------------------
  3204. Historically, legacy compilers allowed insertion of form feed characters
  3205. ('\f', ASCII 0xC) at the beginning of lines for formatted output to line
  3206. printers, though the Fortran standard does not mention this. GNU
  3207. Fortran supports the interpretation of form feed characters in source as
  3208. whitespace for compatibility.
  3209. 
  3210. File: gfortran.info, Node: TYPE as an alias for PRINT, Next: %LOC as an rvalue, Prev: Form feed as whitespace, Up: Extensions implemented in GNU Fortran
  3211. 6.1.28 TYPE as an alias for PRINT
  3212. ---------------------------------
  3213. For compatibility, GNU Fortran will interpret 'TYPE' statements as
  3214. 'PRINT' statements with the flag '-fdec'. With this flag asserted, the
  3215. following two examples are equivalent:
  3216. TYPE *, 'hello world'
  3217. PRINT *, 'hello world'
  3218. 
  3219. File: gfortran.info, Node: %LOC as an rvalue, Next: .XOR. operator, Prev: TYPE as an alias for PRINT, Up: Extensions implemented in GNU Fortran
  3220. 6.1.29 %LOC as an rvalue
  3221. ------------------------
  3222. Normally '%LOC' is allowed only in parameter lists. However the
  3223. intrinsic function 'LOC' does the same thing, and is usable as the
  3224. right-hand-side of assignments. For compatibility, GNU Fortran supports
  3225. the use of '%LOC' as an alias for the builtin 'LOC' with '-std=legacy'.
  3226. With this feature enabled the following two examples are equivalent:
  3227. integer :: i, l
  3228. l = %loc(i)
  3229. call sub(l)
  3230. integer :: i
  3231. call sub(%loc(i))
  3232. 
  3233. File: gfortran.info, Node: .XOR. operator, Next: Bitwise logical operators, Prev: %LOC as an rvalue, Up: Extensions implemented in GNU Fortran
  3234. 6.1.30 .XOR. operator
  3235. ---------------------
  3236. GNU Fortran supports '.XOR.' as a logical operator with '-std=legacy'
  3237. for compatibility with legacy code. '.XOR.' is equivalent to '.NEQV.'.
  3238. That is, the output is true if and only if the inputs differ.
  3239. 
  3240. File: gfortran.info, Node: Bitwise logical operators, Next: Extended I/O specifiers, Prev: .XOR. operator, Up: Extensions implemented in GNU Fortran
  3241. 6.1.31 Bitwise logical operators
  3242. --------------------------------
  3243. With '-fdec', GNU Fortran relaxes the type constraints on logical
  3244. operators to allow integer operands, and performs the corresponding
  3245. bitwise operation instead. This flag is for compatibility only, and
  3246. should be avoided in new code. Consider:
  3247. INTEGER :: i, j
  3248. i = z'33'
  3249. j = z'cc'
  3250. print *, i .AND. j
  3251. In this example, compiled with '-fdec', GNU Fortran will replace the
  3252. '.AND.' operation with a call to the intrinsic '*note IAND::' function,
  3253. yielding the bitwise-and of 'i' and 'j'.
  3254. Note that this conversion will occur if at least one operand is of
  3255. integral type. As a result, a logical operand will be converted to an
  3256. integer when the other operand is an integer in a logical operation. In
  3257. this case, '.TRUE.' is converted to '1' and '.FALSE.' to '0'.
  3258. Here is the mapping of logical operator to bitwise intrinsic used
  3259. with '-fdec':
  3260. Operator Intrinsic Bitwise operation
  3261. ---------------------------------------------------------------------------
  3262. '.NOT.' '*note NOT::' complement
  3263. '.AND.' '*note IAND::' intersection
  3264. '.OR.' '*note IOR::' union
  3265. '.NEQV.' '*note IEOR::' exclusive or
  3266. '.EQV.' '*note complement of exclusive or
  3267. NOT::(*note
  3268. IEOR::)'
  3269. 
  3270. File: gfortran.info, Node: Extended I/O specifiers, Next: Legacy PARAMETER statements, Prev: Bitwise logical operators, Up: Extensions implemented in GNU Fortran
  3271. 6.1.32 Extended I/O specifiers
  3272. ------------------------------
  3273. GNU Fortran supports the additional legacy I/O specifiers
  3274. 'CARRIAGECONTROL', 'READONLY', and 'SHARE' with the compile flag
  3275. '-fdec', for compatibility.
  3276. 'CARRIAGECONTROL'
  3277. The 'CARRIAGECONTROL' specifier allows a user to control line
  3278. termination settings between output records for an I/O unit. The
  3279. specifier has no meaning for readonly files. When
  3280. 'CARRAIGECONTROL' is specified upon opening a unit for formatted
  3281. writing, the exact 'CARRIAGECONTROL' setting determines what
  3282. characters to write between output records. The syntax is:
  3283. OPEN(..., CARRIAGECONTROL=cc)
  3284. Where _cc_ is a character expression that evaluates to one of the
  3285. following values:
  3286. ''LIST'' One line feed between records (default)
  3287. ''FORTRAN'' Legacy interpretation of the first character (see below)
  3288. ''NONE'' No separator between records
  3289. With 'CARRIAGECONTROL='FORTRAN'', when a record is written, the
  3290. first character of the input record is not written, and instead
  3291. determines the output record separator as follows:
  3292. Leading character Meaning Output separating
  3293. character(s)
  3294. ----------------------------------------------------------------------------
  3295. ''+'' Overprinting Carriage return only
  3296. ''-'' New line Line feed and carriage
  3297. return
  3298. ''0'' Skip line Two line feeds and carriage
  3299. return
  3300. ''1'' New page Form feed and carriage
  3301. return
  3302. ''$'' Prompting Line feed (no carriage
  3303. return)
  3304. 'CHAR(0)' Overprinting (no None
  3305. advance)
  3306. 'READONLY'
  3307. The 'READONLY' specifier may be given upon opening a unit, and is
  3308. equivalent to specifying 'ACTION='READ'', except that the file may
  3309. not be deleted on close (i.e. 'CLOSE' with 'STATUS="DELETE"').
  3310. The syntax is:
  3311. OPEN(..., READONLY)
  3312. 'SHARE'
  3313. The 'SHARE' specifier allows system-level locking on a unit upon
  3314. opening it for controlled access from multiple processes/threads.
  3315. The 'SHARE' specifier has several forms:
  3316. OPEN(..., SHARE=sh)
  3317. OPEN(..., SHARED)
  3318. OPEN(..., NOSHARED)
  3319. Where _sh_ in the first form is a character expression that
  3320. evaluates to a value as seen in the table below. The latter two
  3321. forms are aliases for particular values of _sh_:
  3322. Explicit form Short form Meaning
  3323. ----------------------------------------------------------------------------
  3324. 'SHARE='DENYRW'' 'NOSHARED' Exclusive (write) lock
  3325. 'SHARE='DENYNONE'' 'SHARED' Shared (read) lock
  3326. In general only one process may hold an exclusive (write) lock for
  3327. a given file at a time, whereas many processes may hold shared
  3328. (read) locks for the same file.
  3329. The behavior of locking may vary with your operating system. On
  3330. POSIX systems, locking is implemented with 'fcntl'. Consult your
  3331. corresponding operating system's manual pages for further details.
  3332. Locking via 'SHARE=' is not supported on other systems.
  3333. 
  3334. File: gfortran.info, Node: Legacy PARAMETER statements, Next: Default exponents, Prev: Extended I/O specifiers, Up: Extensions implemented in GNU Fortran
  3335. 6.1.33 Legacy PARAMETER statements
  3336. ----------------------------------
  3337. For compatibility, GNU Fortran supports legacy PARAMETER statements
  3338. without parentheses with '-std=legacy'. A warning is emitted if used
  3339. with '-std=gnu', and an error is acknowledged with a real Fortran
  3340. standard flag ('-std=f95', etc...). These statements take the following
  3341. form:
  3342. implicit real (E)
  3343. parameter e = 2.718282
  3344. real c
  3345. parameter c = 3.0e8
  3346. 
  3347. File: gfortran.info, Node: Default exponents, Prev: Legacy PARAMETER statements, Up: Extensions implemented in GNU Fortran
  3348. 6.1.34 Default exponents
  3349. ------------------------
  3350. For compatibility, GNU Fortran supports a default exponent of zero in
  3351. real constants with '-fdec'. For example, '9e' would be interpreted as
  3352. '9e0', rather than an error.
  3353. 
  3354. File: gfortran.info, Node: Extensions not implemented in GNU Fortran, Prev: Extensions implemented in GNU Fortran, Up: Extensions
  3355. 6.2 Extensions not implemented in GNU Fortran
  3356. =============================================
  3357. The long history of the Fortran language, its wide use and broad
  3358. userbase, the large number of different compiler vendors and the lack of
  3359. some features crucial to users in the first standards have lead to the
  3360. existence of a number of important extensions to the language. While
  3361. some of the most useful or popular extensions are supported by the GNU
  3362. Fortran compiler, not all existing extensions are supported. This
  3363. section aims at listing these extensions and offering advice on how best
  3364. make code that uses them running with the GNU Fortran compiler.
  3365. * Menu:
  3366. * ENCODE and DECODE statements::
  3367. * Variable FORMAT expressions::
  3368. * Alternate complex function syntax::
  3369. * Volatile COMMON blocks::
  3370. * OPEN( ... NAME=)::
  3371. * Q edit descriptor::
  3372. 
  3373. File: gfortran.info, Node: ENCODE and DECODE statements, Next: Variable FORMAT expressions, Up: Extensions not implemented in GNU Fortran
  3374. 6.2.1 'ENCODE' and 'DECODE' statements
  3375. --------------------------------------
  3376. GNU Fortran does not support the 'ENCODE' and 'DECODE' statements.
  3377. These statements are best replaced by 'READ' and 'WRITE' statements
  3378. involving internal files ('CHARACTER' variables and arrays), which have
  3379. been part of the Fortran standard since Fortran 77. For example,
  3380. replace a code fragment like
  3381. INTEGER*1 LINE(80)
  3382. REAL A, B, C
  3383. c ... Code that sets LINE
  3384. DECODE (80, 9000, LINE) A, B, C
  3385. 9000 FORMAT (1X, 3(F10.5))
  3386. with the following:
  3387. CHARACTER(LEN=80) LINE
  3388. REAL A, B, C
  3389. c ... Code that sets LINE
  3390. READ (UNIT=LINE, FMT=9000) A, B, C
  3391. 9000 FORMAT (1X, 3(F10.5))
  3392. Similarly, replace a code fragment like
  3393. INTEGER*1 LINE(80)
  3394. REAL A, B, C
  3395. c ... Code that sets A, B and C
  3396. ENCODE (80, 9000, LINE) A, B, C
  3397. 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
  3398. with the following:
  3399. CHARACTER(LEN=80) LINE
  3400. REAL A, B, C
  3401. c ... Code that sets A, B and C
  3402. WRITE (UNIT=LINE, FMT=9000) A, B, C
  3403. 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
  3404. 
  3405. File: gfortran.info, Node: Variable FORMAT expressions, Next: Alternate complex function syntax, Prev: ENCODE and DECODE statements, Up: Extensions not implemented in GNU Fortran
  3406. 6.2.2 Variable 'FORMAT' expressions
  3407. -----------------------------------
  3408. A variable 'FORMAT' expression is format statement which includes angle
  3409. brackets enclosing a Fortran expression: 'FORMAT(I<N>)'. GNU Fortran
  3410. does not support this legacy extension. The effect of variable format
  3411. expressions can be reproduced by using the more powerful (and standard)
  3412. combination of internal output and string formats. For example, replace
  3413. a code fragment like this:
  3414. WRITE(6,20) INT1
  3415. 20 FORMAT(I<N+1>)
  3416. with the following:
  3417. c Variable declaration
  3418. CHARACTER(LEN=20) FMT
  3419. c
  3420. c Other code here...
  3421. c
  3422. WRITE(FMT,'("(I", I0, ")")') N+1
  3423. WRITE(6,FMT) INT1
  3424. or with:
  3425. c Variable declaration
  3426. CHARACTER(LEN=20) FMT
  3427. c
  3428. c Other code here...
  3429. c
  3430. WRITE(FMT,*) N+1
  3431. WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1
  3432. 
  3433. File: gfortran.info, Node: Alternate complex function syntax, Next: Volatile COMMON blocks, Prev: Variable FORMAT expressions, Up: Extensions not implemented in GNU Fortran
  3434. 6.2.3 Alternate complex function syntax
  3435. ---------------------------------------
  3436. Some Fortran compilers, including 'g77', let the user declare complex
  3437. functions with the syntax 'COMPLEX FUNCTION name*16()', as well as
  3438. 'COMPLEX*16 FUNCTION name()'. Both are non-standard, legacy extensions.
  3439. 'gfortran' accepts the latter form, which is more common, but not the
  3440. former.
  3441. 
  3442. File: gfortran.info, Node: Volatile COMMON blocks, Next: OPEN( ... NAME=), Prev: Alternate complex function syntax, Up: Extensions not implemented in GNU Fortran
  3443. 6.2.4 Volatile 'COMMON' blocks
  3444. ------------------------------
  3445. Some Fortran compilers, including 'g77', let the user declare 'COMMON'
  3446. with the 'VOLATILE' attribute. This is invalid standard Fortran syntax
  3447. and is not supported by 'gfortran'. Note that 'gfortran' accepts
  3448. 'VOLATILE' variables in 'COMMON' blocks since revision 4.3.
  3449. 
  3450. File: gfortran.info, Node: OPEN( ... NAME=), Next: Q edit descriptor, Prev: Volatile COMMON blocks, Up: Extensions not implemented in GNU Fortran
  3451. 6.2.5 'OPEN( ... NAME=)'
  3452. ------------------------
  3453. Some Fortran compilers, including 'g77', let the user declare 'OPEN( ...
  3454. NAME=)'. This is invalid standard Fortran syntax and is not supported
  3455. by 'gfortran'. 'OPEN( ... NAME=)' should be replaced with 'OPEN( ...
  3456. FILE=)'.
  3457. 
  3458. File: gfortran.info, Node: Q edit descriptor, Prev: OPEN( ... NAME=), Up: Extensions not implemented in GNU Fortran
  3459. 6.2.6 'Q' edit descriptor
  3460. -------------------------
  3461. Some Fortran compilers provide the 'Q' edit descriptor, which transfers
  3462. the number of characters left within an input record into an integer
  3463. variable.
  3464. A direct replacement of the 'Q' edit descriptor is not available in
  3465. 'gfortran'. How to replicate its functionality using
  3466. standard-conforming code depends on what the intent of the original code
  3467. is.
  3468. Options to replace 'Q' may be to read the whole line into a character
  3469. variable and then counting the number of non-blank characters left using
  3470. 'LEN_TRIM'. Another method may be to use formatted stream, read the
  3471. data up to the position where the 'Q' descriptor occurred, use 'INQUIRE'
  3472. to get the file position, count the characters up to the next 'NEW_LINE'
  3473. and then start reading from the position marked previously.
  3474. 
  3475. File: gfortran.info, Node: Mixed-Language Programming, Next: Coarray Programming, Prev: Extensions, Up: Top
  3476. 7 Mixed-Language Programming
  3477. ****************************
  3478. * Menu:
  3479. * Interoperability with C::
  3480. * GNU Fortran Compiler Directives::
  3481. * Non-Fortran Main Program::
  3482. * Naming and argument-passing conventions::
  3483. This chapter is about mixed-language interoperability, but also applies
  3484. if one links Fortran code compiled by different compilers. In most
  3485. cases, use of the C Binding features of the Fortran 2003 standard is
  3486. sufficient, and their use is highly recommended.
  3487. 
  3488. File: gfortran.info, Node: Interoperability with C, Next: GNU Fortran Compiler Directives, Up: Mixed-Language Programming
  3489. 7.1 Interoperability with C
  3490. ===========================
  3491. * Menu:
  3492. * Intrinsic Types::
  3493. * Derived Types and struct::
  3494. * Interoperable Global Variables::
  3495. * Interoperable Subroutines and Functions::
  3496. * Working with Pointers::
  3497. * Further Interoperability of Fortran with C::
  3498. Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a standardized way
  3499. to generate procedure and derived-type declarations and global variables
  3500. which are interoperable with C (ISO/IEC 9899:1999). The 'bind(C)'
  3501. attribute has been added to inform the compiler that a symbol shall be
  3502. interoperable with C; also, some constraints are added. Note, however,
  3503. that not all C features have a Fortran equivalent or vice versa. For
  3504. instance, neither C's unsigned integers nor C's functions with variable
  3505. number of arguments have an equivalent in Fortran.
  3506. Note that array dimensions are reversely ordered in C and that arrays
  3507. in C always start with index 0 while in Fortran they start by default
  3508. with 1. Thus, an array declaration 'A(n,m)' in Fortran matches
  3509. 'A[m][n]' in C and accessing the element 'A(i,j)' matches 'A[j-1][i-1]'.
  3510. The element following 'A(i,j)' (C: 'A[j-1][i-1]'; assuming i < n) in
  3511. memory is 'A(i+1,j)' (C: 'A[j-1][i]').
  3512. 
  3513. File: gfortran.info, Node: Intrinsic Types, Next: Derived Types and struct, Up: Interoperability with C
  3514. 7.1.1 Intrinsic Types
  3515. ---------------------
  3516. In order to ensure that exactly the same variable type and kind is used
  3517. in C and Fortran, the named constants shall be used which are defined in
  3518. the 'ISO_C_BINDING' intrinsic module. That module contains named
  3519. constants for kind parameters and character named constants for the
  3520. escape sequences in C. For a list of the constants, see *note
  3521. ISO_C_BINDING::.
  3522. For logical types, please note that the Fortran standard only
  3523. guarantees interoperability between C99's '_Bool' and Fortran's
  3524. 'C_Bool'-kind logicals and C99 defines that 'true' has the value 1 and
  3525. 'false' the value 0. Using any other integer value with GNU Fortran's
  3526. 'LOGICAL' (with any kind parameter) gives an undefined result. (Passing
  3527. other integer values than 0 and 1 to GCC's '_Bool' is also undefined,
  3528. unless the integer is explicitly or implicitly casted to '_Bool'.)
  3529. 
  3530. File: gfortran.info, Node: Derived Types and struct, Next: Interoperable Global Variables, Prev: Intrinsic Types, Up: Interoperability with C
  3531. 7.1.2 Derived Types and struct
  3532. ------------------------------
  3533. For compatibility of derived types with 'struct', one needs to use the
  3534. 'BIND(C)' attribute in the type declaration. For instance, the
  3535. following type declaration
  3536. USE ISO_C_BINDING
  3537. TYPE, BIND(C) :: myType
  3538. INTEGER(C_INT) :: i1, i2
  3539. INTEGER(C_SIGNED_CHAR) :: i3
  3540. REAL(C_DOUBLE) :: d1
  3541. COMPLEX(C_FLOAT_COMPLEX) :: c1
  3542. CHARACTER(KIND=C_CHAR) :: str(5)
  3543. END TYPE
  3544. matches the following 'struct' declaration in C
  3545. struct {
  3546. int i1, i2;
  3547. /* Note: "char" might be signed or unsigned. */
  3548. signed char i3;
  3549. double d1;
  3550. float _Complex c1;
  3551. char str[5];
  3552. } myType;
  3553. Derived types with the C binding attribute shall not have the
  3554. 'sequence' attribute, type parameters, the 'extends' attribute, nor
  3555. type-bound procedures. Every component must be of interoperable type
  3556. and kind and may not have the 'pointer' or 'allocatable' attribute. The
  3557. names of the components are irrelevant for interoperability.
  3558. As there exist no direct Fortran equivalents, neither unions nor
  3559. structs with bit field or variable-length array members are
  3560. interoperable.
  3561. 
  3562. File: gfortran.info, Node: Interoperable Global Variables, Next: Interoperable Subroutines and Functions, Prev: Derived Types and struct, Up: Interoperability with C
  3563. 7.1.3 Interoperable Global Variables
  3564. ------------------------------------
  3565. Variables can be made accessible from C using the C binding attribute,
  3566. optionally together with specifying a binding name. Those variables
  3567. have to be declared in the declaration part of a 'MODULE', be of
  3568. interoperable type, and have neither the 'pointer' nor the 'allocatable'
  3569. attribute.
  3570. MODULE m
  3571. USE myType_module
  3572. USE ISO_C_BINDING
  3573. integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag
  3574. type(myType), bind(C) :: tp
  3575. END MODULE
  3576. Here, '_MyProject_flags' is the case-sensitive name of the variable
  3577. as seen from C programs while 'global_flag' is the case-insensitive name
  3578. as seen from Fortran. If no binding name is specified, as for TP, the C
  3579. binding name is the (lowercase) Fortran binding name. If a binding name
  3580. is specified, only a single variable may be after the double colon.
  3581. Note of warning: You cannot use a global variable to access ERRNO of the
  3582. C library as the C standard allows it to be a macro. Use the 'IERRNO'
  3583. intrinsic (GNU extension) instead.
  3584. 
  3585. File: gfortran.info, Node: Interoperable Subroutines and Functions, Next: Working with Pointers, Prev: Interoperable Global Variables, Up: Interoperability with C
  3586. 7.1.4 Interoperable Subroutines and Functions
  3587. ---------------------------------------------
  3588. Subroutines and functions have to have the 'BIND(C)' attribute to be
  3589. compatible with C. The dummy argument declaration is relatively
  3590. straightforward. However, one needs to be careful because C uses
  3591. call-by-value by default while Fortran behaves usually similar to
  3592. call-by-reference. Furthermore, strings and pointers are handled
  3593. differently. Note that in Fortran 2003 and 2008 only explicit size and
  3594. assumed-size arrays are supported but not assumed-shape or
  3595. deferred-shape (i.e. allocatable or pointer) arrays. However, those
  3596. are allowed since the Technical Specification 29113, see *note Further
  3597. Interoperability of Fortran with C::
  3598. To pass a variable by value, use the 'VALUE' attribute. Thus, the
  3599. following C prototype
  3600. int func(int i, int *j)
  3601. matches the Fortran declaration
  3602. integer(c_int) function func(i,j)
  3603. use iso_c_binding, only: c_int
  3604. integer(c_int), VALUE :: i
  3605. integer(c_int) :: j
  3606. Note that pointer arguments also frequently need the 'VALUE'
  3607. attribute, see *note Working with Pointers::.
  3608. Strings are handled quite differently in C and Fortran. In C a
  3609. string is a 'NUL'-terminated array of characters while in Fortran each
  3610. string has a length associated with it and is thus not terminated (by
  3611. e.g. 'NUL'). For example, if one wants to use the following C
  3612. function,
  3613. #include <stdio.h>
  3614. void print_C(char *string) /* equivalent: char string[] */
  3615. {
  3616. printf("%s\n", string);
  3617. }
  3618. to print "Hello World" from Fortran, one can call it using
  3619. use iso_c_binding, only: C_CHAR, C_NULL_CHAR
  3620. interface
  3621. subroutine print_c(string) bind(C, name="print_C")
  3622. use iso_c_binding, only: c_char
  3623. character(kind=c_char) :: string(*)
  3624. end subroutine print_c
  3625. end interface
  3626. call print_c(C_CHAR_"Hello World"//C_NULL_CHAR)
  3627. As the example shows, one needs to ensure that the string is 'NUL'
  3628. terminated. Additionally, the dummy argument STRING of 'print_C' is a
  3629. length-one assumed-size array; using 'character(len=*)' is not allowed.
  3630. The example above uses 'c_char_"Hello World"' to ensure the string
  3631. literal has the right type; typically the default character kind and
  3632. 'c_char' are the same and thus '"Hello World"' is equivalent. However,
  3633. the standard does not guarantee this.
  3634. The use of strings is now further illustrated using the C library
  3635. function 'strncpy', whose prototype is
  3636. char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
  3637. The function 'strncpy' copies at most N characters from string S2 to
  3638. S1 and returns S1. In the following example, we ignore the return
  3639. value:
  3640. use iso_c_binding
  3641. implicit none
  3642. character(len=30) :: str,str2
  3643. interface
  3644. ! Ignore the return value of strncpy -> subroutine
  3645. ! "restrict" is always assumed if we do not pass a pointer
  3646. subroutine strncpy(dest, src, n) bind(C)
  3647. import
  3648. character(kind=c_char), intent(out) :: dest(*)
  3649. character(kind=c_char), intent(in) :: src(*)
  3650. integer(c_size_t), value, intent(in) :: n
  3651. end subroutine strncpy
  3652. end interface
  3653. str = repeat('X',30) ! Initialize whole string with 'X'
  3654. call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, &
  3655. len(c_char_"Hello World",kind=c_size_t))
  3656. print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX"
  3657. end
  3658. The intrinsic procedures are described in *note Intrinsic
  3659. Procedures::.
  3660. 
  3661. File: gfortran.info, Node: Working with Pointers, Next: Further Interoperability of Fortran with C, Prev: Interoperable Subroutines and Functions, Up: Interoperability with C
  3662. 7.1.5 Working with Pointers
  3663. ---------------------------
  3664. C pointers are represented in Fortran via the special opaque derived
  3665. type 'type(c_ptr)' (with private components). Thus one needs to use
  3666. intrinsic conversion procedures to convert from or to C pointers.
  3667. For some applications, using an assumed type ('TYPE(*)') can be an
  3668. alternative to a C pointer; see *note Further Interoperability of
  3669. Fortran with C::.
  3670. For example,
  3671. use iso_c_binding
  3672. type(c_ptr) :: cptr1, cptr2
  3673. integer, target :: array(7), scalar
  3674. integer, pointer :: pa(:), ps
  3675. cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the
  3676. ! array is contiguous if required by the C
  3677. ! procedure
  3678. cptr2 = c_loc(scalar)
  3679. call c_f_pointer(cptr2, ps)
  3680. call c_f_pointer(cptr2, pa, shape=[7])
  3681. When converting C to Fortran arrays, the one-dimensional 'SHAPE'
  3682. argument has to be passed.
  3683. If a pointer is a dummy-argument of an interoperable procedure, it
  3684. usually has to be declared using the 'VALUE' attribute. 'void*' matches
  3685. 'TYPE(C_PTR), VALUE', while 'TYPE(C_PTR)' alone matches 'void**'.
  3686. Procedure pointers are handled analogously to pointers; the C type is
  3687. 'TYPE(C_FUNPTR)' and the intrinsic conversion procedures are
  3688. 'C_F_PROCPOINTER' and 'C_FUNLOC'.
  3689. Let us consider two examples of actually passing a procedure pointer
  3690. from C to Fortran and vice versa. Note that these examples are also
  3691. very similar to passing ordinary pointers between both languages.
  3692. First, consider this code in C:
  3693. /* Procedure implemented in Fortran. */
  3694. void get_values (void (*)(double));
  3695. /* Call-back routine we want called from Fortran. */
  3696. void
  3697. print_it (double x)
  3698. {
  3699. printf ("Number is %f.\n", x);
  3700. }
  3701. /* Call Fortran routine and pass call-back to it. */
  3702. void
  3703. foobar ()
  3704. {
  3705. get_values (&print_it);
  3706. }
  3707. A matching implementation for 'get_values' in Fortran, that correctly
  3708. receives the procedure pointer from C and is able to call it, is given
  3709. in the following 'MODULE':
  3710. MODULE m
  3711. IMPLICIT NONE
  3712. ! Define interface of call-back routine.
  3713. ABSTRACT INTERFACE
  3714. SUBROUTINE callback (x)
  3715. USE, INTRINSIC :: ISO_C_BINDING
  3716. REAL(KIND=C_DOUBLE), INTENT(IN), VALUE :: x
  3717. END SUBROUTINE callback
  3718. END INTERFACE
  3719. CONTAINS
  3720. ! Define C-bound procedure.
  3721. SUBROUTINE get_values (cproc) BIND(C)
  3722. USE, INTRINSIC :: ISO_C_BINDING
  3723. TYPE(C_FUNPTR), INTENT(IN), VALUE :: cproc
  3724. PROCEDURE(callback), POINTER :: proc
  3725. ! Convert C to Fortran procedure pointer.
  3726. CALL C_F_PROCPOINTER (cproc, proc)
  3727. ! Call it.
  3728. CALL proc (1.0_C_DOUBLE)
  3729. CALL proc (-42.0_C_DOUBLE)
  3730. CALL proc (18.12_C_DOUBLE)
  3731. END SUBROUTINE get_values
  3732. END MODULE m
  3733. Next, we want to call a C routine that expects a procedure pointer
  3734. argument and pass it a Fortran procedure (which clearly must be
  3735. interoperable!). Again, the C function may be:
  3736. int
  3737. call_it (int (*func)(int), int arg)
  3738. {
  3739. return func (arg);
  3740. }
  3741. It can be used as in the following Fortran code:
  3742. MODULE m
  3743. USE, INTRINSIC :: ISO_C_BINDING
  3744. IMPLICIT NONE
  3745. ! Define interface of C function.
  3746. INTERFACE
  3747. INTEGER(KIND=C_INT) FUNCTION call_it (func, arg) BIND(C)
  3748. USE, INTRINSIC :: ISO_C_BINDING
  3749. TYPE(C_FUNPTR), INTENT(IN), VALUE :: func
  3750. INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
  3751. END FUNCTION call_it
  3752. END INTERFACE
  3753. CONTAINS
  3754. ! Define procedure passed to C function.
  3755. ! It must be interoperable!
  3756. INTEGER(KIND=C_INT) FUNCTION double_it (arg) BIND(C)
  3757. INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
  3758. double_it = arg + arg
  3759. END FUNCTION double_it
  3760. ! Call C function.
  3761. SUBROUTINE foobar ()
  3762. TYPE(C_FUNPTR) :: cproc
  3763. INTEGER(KIND=C_INT) :: i
  3764. ! Get C procedure pointer.
  3765. cproc = C_FUNLOC (double_it)
  3766. ! Use it.
  3767. DO i = 1_C_INT, 10_C_INT
  3768. PRINT *, call_it (cproc, i)
  3769. END DO
  3770. END SUBROUTINE foobar
  3771. END MODULE m
  3772. 
  3773. File: gfortran.info, Node: Further Interoperability of Fortran with C, Prev: Working with Pointers, Up: Interoperability with C
  3774. 7.1.6 Further Interoperability of Fortran with C
  3775. ------------------------------------------------
  3776. The Technical Specification ISO/IEC TS 29113:2012 on further
  3777. interoperability of Fortran with C extends the interoperability support
  3778. of Fortran 2003 and Fortran 2008. Besides removing some restrictions
  3779. and constraints, it adds assumed-type ('TYPE(*)') and assumed-rank
  3780. ('dimension') variables and allows for interoperability of
  3781. assumed-shape, assumed-rank and deferred-shape arrays, including
  3782. allocatables and pointers.
  3783. Note: Currently, GNU Fortran does not use internally the array
  3784. descriptor (dope vector) as specified in the Technical Specification,
  3785. but uses an array descriptor with different fields. Assumed type and
  3786. assumed rank formal arguments are converted in the library to the
  3787. specified form. The ISO_Fortran_binding API functions (also Fortran
  3788. 2018 18.4) are implemented in libgfortran. Alternatively, the Chasm
  3789. Language Interoperability Tools,
  3790. <http://chasm-interop.sourceforge.net/>, provide an interface to GNU
  3791. Fortran's array descriptor.
  3792. The Technical Specification adds the following new features, which
  3793. are supported by GNU Fortran:
  3794. * The 'ASYNCHRONOUS' attribute has been clarified and extended to
  3795. allow its use with asynchronous communication in user-provided
  3796. libraries such as in implementations of the Message Passing
  3797. Interface specification.
  3798. * Many constraints have been relaxed, in particular for the 'C_LOC'
  3799. and 'C_F_POINTER' intrinsics.
  3800. * The 'OPTIONAL' attribute is now allowed for dummy arguments; an
  3801. absent argument matches a 'NULL' pointer.
  3802. * Assumed types ('TYPE(*)') have been added, which may only be used
  3803. for dummy arguments. They are unlimited polymorphic but contrary
  3804. to 'CLASS(*)' they do not contain any type information, similar to
  3805. C's 'void *' pointers. Expressions of any type and kind can be
  3806. passed; thus, it can be used as replacement for 'TYPE(C_PTR)',
  3807. avoiding the use of 'C_LOC' in the caller.
  3808. Note, however, that 'TYPE(*)' only accepts scalar arguments, unless
  3809. the 'DIMENSION' is explicitly specified. As 'DIMENSION(*)' only
  3810. supports array (including array elements) but no scalars, it is not
  3811. a full replacement for 'C_LOC'. On the other hand, assumed-type
  3812. assumed-rank dummy arguments ('TYPE(*), DIMENSION(..)') allow for
  3813. both scalars and arrays, but require special code on the callee
  3814. side to handle the array descriptor.
  3815. * Assumed-rank arrays ('DIMENSION(..)') as dummy argument allow that
  3816. scalars and arrays of any rank can be passed as actual argument.
  3817. As the Technical Specification does not provide for direct means to
  3818. operate with them, they have to be used either from the C side or
  3819. be converted using 'C_LOC' and 'C_F_POINTER' to scalars or arrays
  3820. of a specific rank. The rank can be determined using the 'RANK'
  3821. intrinisic.
  3822. Currently unimplemented:
  3823. * GNU Fortran always uses an array descriptor, which does not match
  3824. the one of the Technical Specification. The
  3825. 'ISO_Fortran_binding.h' header file and the C functions it
  3826. specifies are not available.
  3827. * Using assumed-shape, assumed-rank and deferred-shape arrays in
  3828. 'BIND(C)' procedures is not fully supported. In particular, C
  3829. interoperable strings of other length than one are not supported as
  3830. this requires the new array descriptor.
  3831. 
  3832. File: gfortran.info, Node: GNU Fortran Compiler Directives, Next: Non-Fortran Main Program, Prev: Interoperability with C, Up: Mixed-Language Programming
  3833. 7.2 GNU Fortran Compiler Directives
  3834. ===================================
  3835. * Menu:
  3836. * ATTRIBUTES directive::
  3837. * UNROLL directive::
  3838. * BUILTIN directive::
  3839. * IVDEP directive::
  3840. * VECTOR directive::
  3841. * NOVECTOR directive::
  3842. 
  3843. File: gfortran.info, Node: ATTRIBUTES directive, Next: UNROLL directive, Up: GNU Fortran Compiler Directives
  3844. 7.2.1 ATTRIBUTES directive
  3845. --------------------------
  3846. The Fortran standard describes how a conforming program shall behave;
  3847. however, the exact implementation is not standardized. In order to
  3848. allow the user to choose specific implementation details, compiler
  3849. directives can be used to set attributes of variables and procedures
  3850. which are not part of the standard. Whether a given attribute is
  3851. supported and its exact effects depend on both the operating system and
  3852. on the processor; see *note C Extensions: (gcc)Top. for details.
  3853. For procedures and procedure pointers, the following attributes can
  3854. be used to change the calling convention:
  3855. * 'CDECL' - standard C calling convention
  3856. * 'STDCALL' - convention where the called procedure pops the stack
  3857. * 'FASTCALL' - part of the arguments are passed via registers instead
  3858. using the stack
  3859. Besides changing the calling convention, the attributes also
  3860. influence the decoration of the symbol name, e.g., by a leading
  3861. underscore or by a trailing at-sign followed by the number of bytes on
  3862. the stack. When assigning a procedure to a procedure pointer, both
  3863. should use the same calling convention.
  3864. On some systems, procedures and global variables (module variables
  3865. and 'COMMON' blocks) need special handling to be accessible when they
  3866. are in a shared library. The following attributes are available:
  3867. * 'DLLEXPORT' - provide a global pointer to a pointer in the DLL
  3868. * 'DLLIMPORT' - reference the function or variable using a global
  3869. pointer
  3870. For dummy arguments, the 'NO_ARG_CHECK' attribute can be used; in
  3871. other compilers, it is also known as 'IGNORE_TKR'. For dummy arguments
  3872. with this attribute actual arguments of any type and kind (similar to
  3873. 'TYPE(*)'), scalars and arrays of any rank (no equivalent in Fortran
  3874. standard) are accepted. As with 'TYPE(*)', the argument is unlimited
  3875. polymorphic and no type information is available. Additionally, the
  3876. argument may only be passed to dummy arguments with the 'NO_ARG_CHECK'
  3877. attribute and as argument to the 'PRESENT' intrinsic function and to
  3878. 'C_LOC' of the 'ISO_C_BINDING' module.
  3879. Variables with 'NO_ARG_CHECK' attribute shall be of assumed-type
  3880. ('TYPE(*)'; recommended) or of type 'INTEGER', 'LOGICAL', 'REAL' or
  3881. 'COMPLEX'. They shall not have the 'ALLOCATE', 'CODIMENSION',
  3882. 'INTENT(OUT)', 'POINTER' or 'VALUE' attribute; furthermore, they shall
  3883. be either scalar or of assumed-size ('dimension(*)'). As 'TYPE(*)', the
  3884. 'NO_ARG_CHECK' attribute requires an explicit interface.
  3885. * 'NO_ARG_CHECK' - disable the type, kind and rank checking
  3886. The attributes are specified using the syntax
  3887. '!GCC$ ATTRIBUTES' ATTRIBUTE-LIST '::' VARIABLE-LIST
  3888. where in free-form source code only whitespace is allowed before
  3889. '!GCC$' and in fixed-form source code '!GCC$', 'cGCC$' or '*GCC$' shall
  3890. start in the first column.
  3891. For procedures, the compiler directives shall be placed into the body
  3892. of the procedure; for variables and procedure pointers, they shall be in
  3893. the same declaration part as the variable or procedure pointer.
  3894. 
  3895. File: gfortran.info, Node: UNROLL directive, Next: BUILTIN directive, Prev: ATTRIBUTES directive, Up: GNU Fortran Compiler Directives
  3896. 7.2.2 UNROLL directive
  3897. ----------------------
  3898. The syntax of the directive is
  3899. '!GCC$ unroll N'
  3900. You can use this directive to control how many times a loop should be
  3901. unrolled. It must be placed immediately before a 'DO' loop and applies
  3902. only to the loop that follows. N is an integer constant specifying the
  3903. unrolling factor. The values of 0 and 1 block any unrolling of the
  3904. loop.
  3905. 
  3906. File: gfortran.info, Node: BUILTIN directive, Next: IVDEP directive, Prev: UNROLL directive, Up: GNU Fortran Compiler Directives
  3907. 7.2.3 BUILTIN directive
  3908. -----------------------
  3909. The syntax of the directive is
  3910. '!GCC$ BUILTIN (B) attributes simd FLAGS IF('target')'
  3911. You can use this directive to define which middle-end built-ins
  3912. provide vector implementations. 'B' is name of the middle-end built-in.
  3913. 'FLAGS' are optional and must be either "(inbranch)" or "(notinbranch)".
  3914. 'IF' statement is optional and is used to filter multilib ABIs for the
  3915. built-in that should be vectorized. Example usage:
  3916. !GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64')
  3917. The purpose of the directive is to provide an API among the GCC
  3918. compiler and the GNU C Library which would define vector implementations
  3919. of math routines.
  3920. 
  3921. File: gfortran.info, Node: IVDEP directive, Next: VECTOR directive, Prev: BUILTIN directive, Up: GNU Fortran Compiler Directives
  3922. 7.2.4 IVDEP directive
  3923. ---------------------
  3924. The syntax of the directive is
  3925. '!GCC$ ivdep'
  3926. This directive tells the compiler to ignore vector dependencies in
  3927. the following loop. It must be placed immediately before a 'DO' loop
  3928. and applies only to the loop that follows.
  3929. Sometimes the compiler may not have sufficient information to decide
  3930. whether a particular loop is vectorizable due to potential dependencies
  3931. between iterations. The purpose of the directive is to tell the
  3932. compiler that vectorization is safe.
  3933. This directive is intended for annotation of existing code. For new
  3934. code it is recommended to consider OpenMP SIMD directives as potential
  3935. alternative.
  3936. 
  3937. File: gfortran.info, Node: VECTOR directive, Next: NOVECTOR directive, Prev: IVDEP directive, Up: GNU Fortran Compiler Directives
  3938. 7.2.5 VECTOR directive
  3939. ----------------------
  3940. The syntax of the directive is
  3941. '!GCC$ vector'
  3942. This directive tells the compiler to vectorize the following loop.
  3943. It must be placed immediately before a 'DO' loop and applies only to the
  3944. loop that follows.
  3945. 
  3946. File: gfortran.info, Node: NOVECTOR directive, Prev: VECTOR directive, Up: GNU Fortran Compiler Directives
  3947. 7.2.6 NOVECTOR directive
  3948. ------------------------
  3949. The syntax of the directive is
  3950. '!GCC$ novector'
  3951. This directive tells the compiler to not vectorize the following
  3952. loop. It must be placed immediately before a 'DO' loop and applies only
  3953. to the loop that follows.
  3954. 
  3955. File: gfortran.info, Node: Non-Fortran Main Program, Next: Naming and argument-passing conventions, Prev: GNU Fortran Compiler Directives, Up: Mixed-Language Programming
  3956. 7.3 Non-Fortran Main Program
  3957. ============================
  3958. * Menu:
  3959. * _gfortran_set_args:: Save command-line arguments
  3960. * _gfortran_set_options:: Set library option flags
  3961. * _gfortran_set_convert:: Set endian conversion
  3962. * _gfortran_set_record_marker:: Set length of record markers
  3963. * _gfortran_set_fpe:: Set when a Floating Point Exception should be raised
  3964. * _gfortran_set_max_subrecord_length:: Set subrecord length
  3965. Even if you are doing mixed-language programming, it is very likely that
  3966. you do not need to know or use the information in this section. Since
  3967. it is about the internal structure of GNU Fortran, it may also change in
  3968. GCC minor releases.
  3969. When you compile a 'PROGRAM' with GNU Fortran, a function with the
  3970. name 'main' (in the symbol table of the object file) is generated, which
  3971. initializes the libgfortran library and then calls the actual program
  3972. which uses the name 'MAIN__', for historic reasons. If you link GNU
  3973. Fortran compiled procedures to, e.g., a C or C++ program or to a Fortran
  3974. program compiled by a different compiler, the libgfortran library is not
  3975. initialized and thus a few intrinsic procedures do not work properly,
  3976. e.g. those for obtaining the command-line arguments.
  3977. Therefore, if your 'PROGRAM' is not compiled with GNU Fortran and the
  3978. GNU Fortran compiled procedures require intrinsics relying on the
  3979. library initialization, you need to initialize the library yourself.
  3980. Using the default options, gfortran calls '_gfortran_set_args' and
  3981. '_gfortran_set_options'. The initialization of the former is needed if
  3982. the called procedures access the command line (and for backtracing); the
  3983. latter sets some flags based on the standard chosen or to enable
  3984. backtracing. In typical programs, it is not necessary to call any
  3985. initialization function.
  3986. If your 'PROGRAM' is compiled with GNU Fortran, you shall not call
  3987. any of the following functions. The libgfortran initialization
  3988. functions are shown in C syntax but using C bindings they are also
  3989. accessible from Fortran.
  3990. 
  3991. File: gfortran.info, Node: _gfortran_set_args, Next: _gfortran_set_options, Up: Non-Fortran Main Program
  3992. 7.3.1 '_gfortran_set_args' -- Save command-line arguments
  3993. ---------------------------------------------------------
  3994. _Description_:
  3995. '_gfortran_set_args' saves the command-line arguments; this
  3996. initialization is required if any of the command-line intrinsics is
  3997. called. Additionally, it shall be called if backtracing is enabled
  3998. (see '_gfortran_set_options').
  3999. _Syntax_:
  4000. 'void _gfortran_set_args (int argc, char *argv[])'
  4001. _Arguments_:
  4002. ARGC number of command line argument strings
  4003. ARGV the command-line argument strings; argv[0] is
  4004. the pathname of the executable itself.
  4005. _Example_:
  4006. int main (int argc, char *argv[])
  4007. {
  4008. /* Initialize libgfortran. */
  4009. _gfortran_set_args (argc, argv);
  4010. return 0;
  4011. }
  4012. 
  4013. File: gfortran.info, Node: _gfortran_set_options, Next: _gfortran_set_convert, Prev: _gfortran_set_args, Up: Non-Fortran Main Program
  4014. 7.3.2 '_gfortran_set_options' -- Set library option flags
  4015. ---------------------------------------------------------
  4016. _Description_:
  4017. '_gfortran_set_options' sets several flags related to the Fortran
  4018. standard to be used, whether backtracing should be enabled and
  4019. whether range checks should be performed. The syntax allows for
  4020. upward compatibility since the number of passed flags is specified;
  4021. for non-passed flags, the default value is used. See also *note
  4022. Code Gen Options::. Please note that not all flags are actually
  4023. used.
  4024. _Syntax_:
  4025. 'void _gfortran_set_options (int num, int options[])'
  4026. _Arguments_:
  4027. NUM number of options passed
  4028. ARGV The list of flag values
  4029. _option flag list_:
  4030. OPTION[0] Allowed standard; can give run-time errors if
  4031. e.g. an input-output edit descriptor is invalid
  4032. in a given standard. Possible values are
  4033. (bitwise or-ed) 'GFC_STD_F77' (1),
  4034. 'GFC_STD_F95_OBS' (2), 'GFC_STD_F95_DEL' (4),
  4035. 'GFC_STD_F95' (8), 'GFC_STD_F2003' (16),
  4036. 'GFC_STD_GNU' (32), 'GFC_STD_LEGACY' (64),
  4037. 'GFC_STD_F2008' (128), 'GFC_STD_F2008_OBS'
  4038. (256), 'GFC_STD_F2008_TS' (512), 'GFC_STD_F2018'
  4039. (1024), 'GFC_STD_F2018_OBS' (2048), and
  4040. 'GFC_STD=F2018_DEL' (4096). Default:
  4041. 'GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95
  4042. | GFC_STD_F2003 | GFC_STD_F2008 |
  4043. GFC_STD_F2008_TS | GFC_STD_F2008_OBS |
  4044. GFC_STD_F77 | GFC_STD_F2018 | GFC_STD_F2018_OBS
  4045. | GFC_STD_F2018_DEL | GFC_STD_GNU |
  4046. GFC_STD_LEGACY'.
  4047. OPTION[1] Standard-warning flag; prints a warning to
  4048. standard error. Default: 'GFC_STD_F95_DEL |
  4049. GFC_STD_LEGACY'.
  4050. OPTION[2] If non zero, enable pedantic checking. Default:
  4051. off.
  4052. OPTION[3] Unused.
  4053. OPTION[4] If non zero, enable backtracing on run-time
  4054. errors. Default: off. (Default in the
  4055. compiler: on.) Note: Installs a signal handler
  4056. and requires command-line initialization using
  4057. '_gfortran_set_args'.
  4058. OPTION[5] If non zero, supports signed zeros. Default:
  4059. enabled.
  4060. OPTION[6] Enables run-time checking. Possible values are
  4061. (bitwise or-ed): GFC_RTCHECK_BOUNDS (1),
  4062. GFC_RTCHECK_ARRAY_TEMPS (2),
  4063. GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO (16),
  4064. GFC_RTCHECK_POINTER (32), GFC_RTCHECK_BITS (64).
  4065. Default: disabled.
  4066. OPTION[7] Unused.
  4067. OPTION[8] Show a warning when invoking 'STOP' and 'ERROR
  4068. STOP' if a floating-point exception occurred.
  4069. Possible values are (bitwise or-ed)
  4070. 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
  4071. 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
  4072. 'GFC_FPE_UNDERFLOW' (16), 'GFC_FPE_INEXACT'
  4073. (32). Default: None (0). (Default in the
  4074. compiler: 'GFC_FPE_INVALID | GFC_FPE_DENORMAL |
  4075. GFC_FPE_ZERO | GFC_FPE_OVERFLOW |
  4076. GFC_FPE_UNDERFLOW'.)
  4077. _Example_:
  4078. /* Use gfortran 4.9 default options. */
  4079. static int options[] = {68, 511, 0, 0, 1, 1, 0, 0, 31};
  4080. _gfortran_set_options (9, &options);
  4081. 
  4082. File: gfortran.info, Node: _gfortran_set_convert, Next: _gfortran_set_record_marker, Prev: _gfortran_set_options, Up: Non-Fortran Main Program
  4083. 7.3.3 '_gfortran_set_convert' -- Set endian conversion
  4084. ------------------------------------------------------
  4085. _Description_:
  4086. '_gfortran_set_convert' set the representation of data for
  4087. unformatted files.
  4088. _Syntax_:
  4089. 'void _gfortran_set_convert (int conv)'
  4090. _Arguments_:
  4091. CONV Endian conversion, possible values:
  4092. GFC_CONVERT_NATIVE (0, default),
  4093. GFC_CONVERT_SWAP (1), GFC_CONVERT_BIG (2),
  4094. GFC_CONVERT_LITTLE (3).
  4095. _Example_:
  4096. int main (int argc, char *argv[])
  4097. {
  4098. /* Initialize libgfortran. */
  4099. _gfortran_set_args (argc, argv);
  4100. _gfortran_set_convert (1);
  4101. return 0;
  4102. }
  4103. 
  4104. File: gfortran.info, Node: _gfortran_set_record_marker, Next: _gfortran_set_fpe, Prev: _gfortran_set_convert, Up: Non-Fortran Main Program
  4105. 7.3.4 '_gfortran_set_record_marker' -- Set length of record markers
  4106. -------------------------------------------------------------------
  4107. _Description_:
  4108. '_gfortran_set_record_marker' sets the length of record markers for
  4109. unformatted files.
  4110. _Syntax_:
  4111. 'void _gfortran_set_record_marker (int val)'
  4112. _Arguments_:
  4113. VAL Length of the record marker; valid values are 4
  4114. and 8. Default is 4.
  4115. _Example_:
  4116. int main (int argc, char *argv[])
  4117. {
  4118. /* Initialize libgfortran. */
  4119. _gfortran_set_args (argc, argv);
  4120. _gfortran_set_record_marker (8);
  4121. return 0;
  4122. }
  4123. 
  4124. File: gfortran.info, Node: _gfortran_set_fpe, Next: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_record_marker, Up: Non-Fortran Main Program
  4125. 7.3.5 '_gfortran_set_fpe' -- Enable floating point exception traps
  4126. ------------------------------------------------------------------
  4127. _Description_:
  4128. '_gfortran_set_fpe' enables floating point exception traps for the
  4129. specified exceptions. On most systems, this will result in a
  4130. SIGFPE signal being sent and the program being aborted.
  4131. _Syntax_:
  4132. 'void _gfortran_set_fpe (int val)'
  4133. _Arguments_:
  4134. OPTION[0] IEEE exceptions. Possible values are (bitwise
  4135. or-ed) zero (0, default) no trapping,
  4136. 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
  4137. 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
  4138. 'GFC_FPE_UNDERFLOW' (16), and 'GFC_FPE_INEXACT'
  4139. (32).
  4140. _Example_:
  4141. int main (int argc, char *argv[])
  4142. {
  4143. /* Initialize libgfortran. */
  4144. _gfortran_set_args (argc, argv);
  4145. /* FPE for invalid operations such as SQRT(-1.0). */
  4146. _gfortran_set_fpe (1);
  4147. return 0;
  4148. }
  4149. 
  4150. File: gfortran.info, Node: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_fpe, Up: Non-Fortran Main Program
  4151. 7.3.6 '_gfortran_set_max_subrecord_length' -- Set subrecord length
  4152. ------------------------------------------------------------------
  4153. _Description_:
  4154. '_gfortran_set_max_subrecord_length' set the maximum length for a
  4155. subrecord. This option only makes sense for testing and debugging
  4156. of unformatted I/O.
  4157. _Syntax_:
  4158. 'void _gfortran_set_max_subrecord_length (int val)'
  4159. _Arguments_:
  4160. VAL the maximum length for a subrecord; the maximum
  4161. permitted value is 2147483639, which is also the
  4162. default.
  4163. _Example_:
  4164. int main (int argc, char *argv[])
  4165. {
  4166. /* Initialize libgfortran. */
  4167. _gfortran_set_args (argc, argv);
  4168. _gfortran_set_max_subrecord_length (8);
  4169. return 0;
  4170. }
  4171. 
  4172. File: gfortran.info, Node: Naming and argument-passing conventions, Prev: Non-Fortran Main Program, Up: Mixed-Language Programming
  4173. 7.4 Naming and argument-passing conventions
  4174. ===========================================
  4175. This section gives an overview about the naming convention of procedures
  4176. and global variables and about the argument passing conventions used by
  4177. GNU Fortran. If a C binding has been specified, the naming convention
  4178. and some of the argument-passing conventions change. If possible,
  4179. mixed-language and mixed-compiler projects should use the better defined
  4180. C binding for interoperability. See *note Interoperability with C::.
  4181. * Menu:
  4182. * Naming conventions::
  4183. * Argument passing conventions::
  4184. 
  4185. File: gfortran.info, Node: Naming conventions, Next: Argument passing conventions, Up: Naming and argument-passing conventions
  4186. 7.4.1 Naming conventions
  4187. ------------------------
  4188. According the Fortran standard, valid Fortran names consist of a letter
  4189. between 'A' to 'Z', 'a' to 'z', digits '0', '1' to '9' and underscores
  4190. ('_') with the restriction that names may only start with a letter. As
  4191. vendor extension, the dollar sign ('$') is additionally permitted with
  4192. the option '-fdollar-ok', but not as first character and only if the
  4193. target system supports it.
  4194. By default, the procedure name is the lower-cased Fortran name with
  4195. an appended underscore ('_'); using '-fno-underscoring' no underscore is
  4196. appended while '-fsecond-underscore' appends two underscores. Depending
  4197. on the target system and the calling convention, the procedure might be
  4198. additionally dressed; for instance, on 32bit Windows with 'stdcall', an
  4199. at-sign '@' followed by an integer number is appended. For the changing
  4200. the calling convention, see *note GNU Fortran Compiler Directives::.
  4201. For common blocks, the same convention is used, i.e. by default an
  4202. underscore is appended to the lower-cased Fortran name. Blank commons
  4203. have the name '__BLNK__'.
  4204. For procedures and variables declared in the specification space of a
  4205. module, the name is formed by '__', followed by the lower-cased module
  4206. name, '_MOD_', and the lower-cased Fortran name. Note that no
  4207. underscore is appended.
  4208. 
  4209. File: gfortran.info, Node: Argument passing conventions, Prev: Naming conventions, Up: Naming and argument-passing conventions
  4210. 7.4.2 Argument passing conventions
  4211. ----------------------------------
  4212. Subroutines do not return a value (matching C99's 'void') while
  4213. functions either return a value as specified in the platform ABI or the
  4214. result variable is passed as hidden argument to the function and no
  4215. result is returned. A hidden result variable is used when the result
  4216. variable is an array or of type 'CHARACTER'.
  4217. Arguments are passed according to the platform ABI. In particular,
  4218. complex arguments might not be compatible to a struct with two real
  4219. components for the real and imaginary part. The argument passing
  4220. matches the one of C99's '_Complex'. Functions with scalar complex
  4221. result variables return their value and do not use a by-reference
  4222. argument. Note that with the '-ff2c' option, the argument passing is
  4223. modified and no longer completely matches the platform ABI. Some other
  4224. Fortran compilers use 'f2c' semantic by default; this might cause
  4225. problems with interoperablility.
  4226. GNU Fortran passes most arguments by reference, i.e. by passing a
  4227. pointer to the data. Note that the compiler might use a temporary
  4228. variable into which the actual argument has been copied, if required
  4229. semantically (copy-in/copy-out).
  4230. For arguments with 'ALLOCATABLE' and 'POINTER' attribute (including
  4231. procedure pointers), a pointer to the pointer is passed such that the
  4232. pointer address can be modified in the procedure.
  4233. For dummy arguments with the 'VALUE' attribute: Scalar arguments of
  4234. the type 'INTEGER', 'LOGICAL', 'REAL' and 'COMPLEX' are passed by value
  4235. according to the platform ABI. (As vendor extension and not recommended,
  4236. using '%VAL()' in the call to a procedure has the same effect.) For
  4237. 'TYPE(C_PTR)' and procedure pointers, the pointer itself is passed such
  4238. that it can be modified without affecting the caller.
  4239. For Boolean ('LOGICAL') arguments, please note that GCC expects only
  4240. the integer value 0 and 1. If a GNU Fortran 'LOGICAL' variable contains
  4241. another integer value, the result is undefined. As some other Fortran
  4242. compilers use -1 for '.TRUE.', extra care has to be taken - such as
  4243. passing the value as 'INTEGER'. (The same value restriction also
  4244. applies to other front ends of GCC, e.g. to GCC's C99 compiler for
  4245. '_Bool' or GCC's Ada compiler for 'Boolean'.)
  4246. For arguments of 'CHARACTER' type, the character length is passed as
  4247. a hidden argument at the end of the argument list. For deferred-length
  4248. strings, the value is passed by reference, otherwise by value. The
  4249. character length has the C type 'size_t' (or 'INTEGER(kind=C_SIZE_T)' in
  4250. Fortran). Note that this is different to older versions of the GNU
  4251. Fortran compiler, where the type of the hidden character length argument
  4252. was a C 'int'. In order to retain compatibility with older versions,
  4253. one can e.g. for the following Fortran procedure
  4254. subroutine fstrlen (s, a)
  4255. character(len=*) :: s
  4256. integer :: a
  4257. print*, len(s)
  4258. end subroutine fstrlen
  4259. define the corresponding C prototype as follows:
  4260. #if __GNUC__ > 7
  4261. typedef size_t fortran_charlen_t;
  4262. #else
  4263. typedef int fortran_charlen_t;
  4264. #endif
  4265. void fstrlen_ (char*, int*, fortran_charlen_t);
  4266. In order to avoid such compiler-specific details, for new code it is
  4267. instead recommended to use the ISO_C_BINDING feature.
  4268. Note with C binding, 'CHARACTER(len=1)' result variables are returned
  4269. according to the platform ABI and no hidden length argument is used for
  4270. dummy arguments; with 'VALUE', those variables are passed by value.
  4271. For 'OPTIONAL' dummy arguments, an absent argument is denoted by a
  4272. NULL pointer, except for scalar dummy arguments of type 'INTEGER',
  4273. 'LOGICAL', 'REAL' and 'COMPLEX' which have the 'VALUE' attribute. For
  4274. those, a hidden Boolean argument ('logical(kind=C_bool),value') is used
  4275. to indicate whether the argument is present.
  4276. Arguments which are assumed-shape, assumed-rank or deferred-rank
  4277. arrays or, with '-fcoarray=lib', allocatable scalar coarrays use an
  4278. array descriptor. All other arrays pass the address of the first
  4279. element of the array. With '-fcoarray=lib', the token and the offset
  4280. belonging to nonallocatable coarrays dummy arguments are passed as
  4281. hidden argument along the character length hidden arguments. The token
  4282. is an oparque pointer identifying the coarray and the offset is a
  4283. passed-by-value integer of kind 'C_PTRDIFF_T', denoting the byte offset
  4284. between the base address of the coarray and the passed scalar or first
  4285. element of the passed array.
  4286. The arguments are passed in the following order
  4287. * Result variable, when the function result is passed by reference
  4288. * Character length of the function result, if it is a of type
  4289. 'CHARACTER' and no C binding is used
  4290. * The arguments in the order in which they appear in the Fortran
  4291. declaration
  4292. * The the present status for optional arguments with value attribute,
  4293. which are internally passed by value
  4294. * The character length and/or coarray token and offset for the first
  4295. argument which is a 'CHARACTER' or a nonallocatable coarray dummy
  4296. argument, followed by the hidden arguments of the next dummy
  4297. argument of such a type
  4298. 
  4299. File: gfortran.info, Node: Coarray Programming, Next: Intrinsic Procedures, Prev: Mixed-Language Programming, Up: Top
  4300. 8 Coarray Programming
  4301. *********************
  4302. * Menu:
  4303. * Type and enum ABI Documentation::
  4304. * Function ABI Documentation::
  4305. 
  4306. File: gfortran.info, Node: Type and enum ABI Documentation, Next: Function ABI Documentation, Up: Coarray Programming
  4307. 8.1 Type and enum ABI Documentation
  4308. ===================================
  4309. * Menu:
  4310. * caf_token_t::
  4311. * caf_register_t::
  4312. * caf_deregister_t::
  4313. * caf_reference_t::
  4314. * caf_team_t::
  4315. 
  4316. File: gfortran.info, Node: caf_token_t, Next: caf_register_t, Up: Type and enum ABI Documentation
  4317. 8.1.1 'caf_token_t'
  4318. -------------------
  4319. Typedef of type 'void *' on the compiler side. Can be any data type on
  4320. the library side.
  4321. 
  4322. File: gfortran.info, Node: caf_register_t, Next: caf_deregister_t, Prev: caf_token_t, Up: Type and enum ABI Documentation
  4323. 8.1.2 'caf_register_t'
  4324. ----------------------
  4325. Indicates which kind of coarray variable should be registered.
  4326. typedef enum caf_register_t {
  4327. CAF_REGTYPE_COARRAY_STATIC,
  4328. CAF_REGTYPE_COARRAY_ALLOC,
  4329. CAF_REGTYPE_LOCK_STATIC,
  4330. CAF_REGTYPE_LOCK_ALLOC,
  4331. CAF_REGTYPE_CRITICAL,
  4332. CAF_REGTYPE_EVENT_STATIC,
  4333. CAF_REGTYPE_EVENT_ALLOC,
  4334. CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY,
  4335. CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY
  4336. }
  4337. caf_register_t;
  4338. The values 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and
  4339. 'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' are for allocatable components
  4340. in derived type coarrays only. The first one sets up the token without
  4341. allocating memory for allocatable component. The latter one only
  4342. allocates the memory for an allocatable component in a derived type
  4343. coarray. The token needs to be setup previously by the REGISTER_ONLY.
  4344. This allows to have allocatable components un-allocated on some images.
  4345. The status whether an allocatable component is allocated on a remote
  4346. image can be queried by '_caf_is_present' which used internally by the
  4347. 'ALLOCATED' intrinsic.
  4348. 
  4349. File: gfortran.info, Node: caf_deregister_t, Next: caf_reference_t, Prev: caf_register_t, Up: Type and enum ABI Documentation
  4350. 8.1.3 'caf_deregister_t'
  4351. ------------------------
  4352. typedef enum caf_deregister_t {
  4353. CAF_DEREGTYPE_COARRAY_DEREGISTER,
  4354. CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY
  4355. }
  4356. caf_deregister_t;
  4357. Allows to specifiy the type of deregistration of a coarray object.
  4358. The 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' flag is only allowed for
  4359. allocatable components in derived type coarrays.
  4360. 
  4361. File: gfortran.info, Node: caf_reference_t, Next: caf_team_t, Prev: caf_deregister_t, Up: Type and enum ABI Documentation
  4362. 8.1.4 'caf_reference_t'
  4363. -----------------------
  4364. The structure used for implementing arbitrary reference chains. A
  4365. 'CAF_REFERENCE_T' allows to specify a component reference or any kind of
  4366. array reference of any rank supported by gfortran. For array references
  4367. all kinds as known by the compiler/Fortran standard are supported
  4368. indicated by a 'MODE'.
  4369. typedef enum caf_ref_type_t {
  4370. /* Reference a component of a derived type, either regular one or an
  4371. allocatable or pointer type. For regular ones idx in caf_reference_t is
  4372. set to -1. */
  4373. CAF_REF_COMPONENT,
  4374. /* Reference an allocatable array. */
  4375. CAF_REF_ARRAY,
  4376. /* Reference a non-allocatable/non-pointer array. I.e., the coarray object
  4377. has no array descriptor associated and the addressing is done
  4378. completely using the ref. */
  4379. CAF_REF_STATIC_ARRAY
  4380. } caf_ref_type_t;
  4381. typedef enum caf_array_ref_t {
  4382. /* No array ref. This terminates the array ref. */
  4383. CAF_ARR_REF_NONE = 0,
  4384. /* Reference array elements given by a vector. Only for this mode
  4385. caf_reference_t.u.a.dim[i].v is valid. */
  4386. CAF_ARR_REF_VECTOR,
  4387. /* A full array ref (:). */
  4388. CAF_ARR_REF_FULL,
  4389. /* Reference a range on elements given by start, end and stride. */
  4390. CAF_ARR_REF_RANGE,
  4391. /* Only a single item is referenced given in the start member. */
  4392. CAF_ARR_REF_SINGLE,
  4393. /* An array ref of the kind (i:), where i is an arbitrary valid index in the
  4394. array. The index i is given in the start member. */
  4395. CAF_ARR_REF_OPEN_END,
  4396. /* An array ref of the kind (:i), where the lower bound of the array ref
  4397. is given by the remote side. The index i is given in the end member. */
  4398. CAF_ARR_REF_OPEN_START
  4399. } caf_array_ref_t;
  4400. /* References to remote components of a derived type. */
  4401. typedef struct caf_reference_t {
  4402. /* A pointer to the next ref or NULL. */
  4403. struct caf_reference_t *next;
  4404. /* The type of the reference. */
  4405. /* caf_ref_type_t, replaced by int to allow specification in fortran FE. */
  4406. int type;
  4407. /* The size of an item referenced in bytes. I.e. in an array ref this is
  4408. the factor to advance the array pointer with to get to the next item.
  4409. For component refs this gives just the size of the element referenced. */
  4410. size_t item_size;
  4411. union {
  4412. struct {
  4413. /* The offset (in bytes) of the component in the derived type.
  4414. Unused for allocatable or pointer components. */
  4415. ptrdiff_t offset;
  4416. /* The offset (in bytes) to the caf_token associated with this
  4417. component. NULL, when not allocatable/pointer ref. */
  4418. ptrdiff_t caf_token_offset;
  4419. } c;
  4420. struct {
  4421. /* The mode of the array ref. See CAF_ARR_REF_*. */
  4422. /* caf_array_ref_t, replaced by unsigend char to allow specification in
  4423. fortran FE. */
  4424. unsigned char mode[GFC_MAX_DIMENSIONS];
  4425. /* The type of a static array. Unset for array's with descriptors. */
  4426. int static_array_type;
  4427. /* Subscript refs (s) or vector refs (v). */
  4428. union {
  4429. struct {
  4430. /* The start and end boundary of the ref and the stride. */
  4431. index_type start, end, stride;
  4432. } s;
  4433. struct {
  4434. /* nvec entries of kind giving the elements to reference. */
  4435. void *vector;
  4436. /* The number of entries in vector. */
  4437. size_t nvec;
  4438. /* The integer kind used for the elements in vector. */
  4439. int kind;
  4440. } v;
  4441. } dim[GFC_MAX_DIMENSIONS];
  4442. } a;
  4443. } u;
  4444. } caf_reference_t;
  4445. The references make up a single linked list of reference operations.
  4446. The 'NEXT' member links to the next reference or NULL to indicate the
  4447. end of the chain. Component and array refs can be arbitrarly mixed as
  4448. long as they comply to the Fortran standard.
  4449. _NOTES_ The member 'STATIC_ARRAY_TYPE' is used only when the 'TYPE'
  4450. is 'CAF_REF_STATIC_ARRAY'. The member gives the type of the data
  4451. referenced. Because no array descriptor is available for a
  4452. descriptor-less array and type conversion still needs to take place the
  4453. type is transported here.
  4454. At the moment 'CAF_ARR_REF_VECTOR' is not implemented in the front
  4455. end for descriptor-less arrays. The library caf_single has untested
  4456. support for it.
  4457. 
  4458. File: gfortran.info, Node: caf_team_t, Prev: caf_reference_t, Up: Type and enum ABI Documentation
  4459. 8.1.5 'caf_team_t'
  4460. ------------------
  4461. Opaque pointer to represent a team-handle. This type is a stand-in for
  4462. the future implementation of teams. It is about to change without
  4463. further notice.
  4464. 
  4465. File: gfortran.info, Node: Function ABI Documentation, Prev: Type and enum ABI Documentation, Up: Coarray Programming
  4466. 8.2 Function ABI Documentation
  4467. ==============================
  4468. * Menu:
  4469. * _gfortran_caf_init:: Initialiation function
  4470. * _gfortran_caf_finish:: Finalization function
  4471. * _gfortran_caf_this_image:: Querying the image number
  4472. * _gfortran_caf_num_images:: Querying the maximal number of images
  4473. * _gfortran_caf_image_status :: Query the status of an image
  4474. * _gfortran_caf_failed_images :: Get an array of the indexes of the failed images
  4475. * _gfortran_caf_stopped_images :: Get an array of the indexes of the stopped images
  4476. * _gfortran_caf_register:: Registering coarrays
  4477. * _gfortran_caf_deregister:: Deregistering coarrays
  4478. * _gfortran_caf_is_present:: Query whether an allocatable or pointer component in a derived type coarray is allocated
  4479. * _gfortran_caf_send:: Sending data from a local image to a remote image
  4480. * _gfortran_caf_get:: Getting data from a remote image
  4481. * _gfortran_caf_sendget:: Sending data between remote images
  4482. * _gfortran_caf_send_by_ref:: Sending data from a local image to a remote image using enhanced references
  4483. * _gfortran_caf_get_by_ref:: Getting data from a remote image using enhanced references
  4484. * _gfortran_caf_sendget_by_ref:: Sending data between remote images using enhanced references
  4485. * _gfortran_caf_lock:: Locking a lock variable
  4486. * _gfortran_caf_unlock:: Unlocking a lock variable
  4487. * _gfortran_caf_event_post:: Post an event
  4488. * _gfortran_caf_event_wait:: Wait that an event occurred
  4489. * _gfortran_caf_event_query:: Query event count
  4490. * _gfortran_caf_sync_all:: All-image barrier
  4491. * _gfortran_caf_sync_images:: Barrier for selected images
  4492. * _gfortran_caf_sync_memory:: Wait for completion of segment-memory operations
  4493. * _gfortran_caf_error_stop:: Error termination with exit code
  4494. * _gfortran_caf_error_stop_str:: Error termination with string
  4495. * _gfortran_caf_fail_image :: Mark the image failed and end its execution
  4496. * _gfortran_caf_atomic_define:: Atomic variable assignment
  4497. * _gfortran_caf_atomic_ref:: Atomic variable reference
  4498. * _gfortran_caf_atomic_cas:: Atomic compare and swap
  4499. * _gfortran_caf_atomic_op:: Atomic operation
  4500. * _gfortran_caf_co_broadcast:: Sending data to all images
  4501. * _gfortran_caf_co_max:: Collective maximum reduction
  4502. * _gfortran_caf_co_min:: Collective minimum reduction
  4503. * _gfortran_caf_co_sum:: Collective summing reduction
  4504. * _gfortran_caf_co_reduce:: Generic collective reduction
  4505. 
  4506. File: gfortran.info, Node: _gfortran_caf_init, Next: _gfortran_caf_finish, Up: Function ABI Documentation
  4507. 8.2.1 '_gfortran_caf_init' -- Initialiation function
  4508. ----------------------------------------------------
  4509. _Description_:
  4510. This function is called at startup of the program before the
  4511. Fortran main program, if the latter has been compiled with
  4512. '-fcoarray=lib'. It takes as arguments the command-line arguments
  4513. of the program. It is permitted to pass two 'NULL' pointers as
  4514. argument; if non-'NULL', the library is permitted to modify the
  4515. arguments.
  4516. _Syntax_:
  4517. 'void _gfortran_caf_init (int *argc, char ***argv)'
  4518. _Arguments_:
  4519. ARGC intent(inout) An integer pointer with the number
  4520. of arguments passed to the program or 'NULL'.
  4521. ARGV intent(inout) A pointer to an array of strings
  4522. with the command-line arguments or 'NULL'.
  4523. _NOTES_
  4524. The function is modelled after the initialization function of the
  4525. Message Passing Interface (MPI) specification. Due to the way
  4526. coarray registration works, it might not be the first call to the
  4527. library. If the main program is not written in Fortran and only a
  4528. library uses coarrays, it can happen that this function is never
  4529. called. Therefore, it is recommended that the library does not
  4530. rely on the passed arguments and whether the call has been done.
  4531. 
  4532. File: gfortran.info, Node: _gfortran_caf_finish, Next: _gfortran_caf_this_image, Prev: _gfortran_caf_init, Up: Function ABI Documentation
  4533. 8.2.2 '_gfortran_caf_finish' -- Finalization function
  4534. -----------------------------------------------------
  4535. _Description_:
  4536. This function is called at the end of the Fortran main program, if
  4537. it has been compiled with the '-fcoarray=lib' option.
  4538. _Syntax_:
  4539. 'void _gfortran_caf_finish (void)'
  4540. _NOTES_
  4541. For non-Fortran programs, it is recommended to call the function at
  4542. the end of the main program. To ensure that the shutdown is also
  4543. performed for programs where this function is not explicitly
  4544. invoked, for instance non-Fortran programs or calls to the system's
  4545. exit() function, the library can use a destructor function. Note
  4546. that programs can also be terminated using the STOP and ERROR STOP
  4547. statements; those use different library calls.
  4548. 
  4549. File: gfortran.info, Node: _gfortran_caf_this_image, Next: _gfortran_caf_num_images, Prev: _gfortran_caf_finish, Up: Function ABI Documentation
  4550. 8.2.3 '_gfortran_caf_this_image' -- Querying the image number
  4551. -------------------------------------------------------------
  4552. _Description_:
  4553. This function returns the current image number, which is a positive
  4554. number.
  4555. _Syntax_:
  4556. 'int _gfortran_caf_this_image (int distance)'
  4557. _Arguments_:
  4558. DISTANCE As specified for the 'this_image' intrinsic in
  4559. TS18508. Shall be a non-negative number.
  4560. _NOTES_
  4561. If the Fortran intrinsic 'this_image' is invoked without an
  4562. argument, which is the only permitted form in Fortran 2008, GCC
  4563. passes '0' as first argument.
  4564. 
  4565. File: gfortran.info, Node: _gfortran_caf_num_images, Next: _gfortran_caf_image_status, Prev: _gfortran_caf_this_image, Up: Function ABI Documentation
  4566. 8.2.4 '_gfortran_caf_num_images' -- Querying the maximal number of images
  4567. -------------------------------------------------------------------------
  4568. _Description_:
  4569. This function returns the number of images in the current team, if
  4570. DISTANCE is 0 or the number of images in the parent team at the
  4571. specified distance. If failed is -1, the function returns the
  4572. number of all images at the specified distance; if it is 0, the
  4573. function returns the number of nonfailed images, and if it is 1, it
  4574. returns the number of failed images.
  4575. _Syntax_:
  4576. 'int _gfortran_caf_num_images(int distance, int failed)'
  4577. _Arguments_:
  4578. DISTANCE the distance from this image to the ancestor.
  4579. Shall be positive.
  4580. FAILED shall be -1, 0, or 1
  4581. _NOTES_
  4582. This function follows TS18508. If the num_image intrinsic has no
  4583. arguments, then the compiler passes 'distance=0' and 'failed=-1' to
  4584. the function.
  4585. 
  4586. File: gfortran.info, Node: _gfortran_caf_image_status, Next: _gfortran_caf_failed_images, Prev: _gfortran_caf_num_images, Up: Function ABI Documentation
  4587. 8.2.5 '_gfortran_caf_image_status' -- Query the status of an image
  4588. ------------------------------------------------------------------
  4589. _Description_:
  4590. Get the status of the image given by the id IMAGE of the team given
  4591. by TEAM. Valid results are zero, for image is ok,
  4592. 'STAT_STOPPED_IMAGE' from the ISO_FORTRAN_ENV module to indicate
  4593. that the image has been stopped and 'STAT_FAILED_IMAGE' also from
  4594. ISO_FORTRAN_ENV to indicate that the image has executed a 'FAIL
  4595. IMAGE' statement.
  4596. _Syntax_:
  4597. 'int _gfortran_caf_image_status (int image, caf_team_t * team)'
  4598. _Arguments_:
  4599. IMAGE the positive scalar id of the image in the
  4600. current TEAM.
  4601. TEAM optional; team on the which the inquiry is to be
  4602. performed.
  4603. _NOTES_
  4604. This function follows TS18508. Because team-functionality is not
  4605. yet implemented a null-pointer is passed for the TEAM argument at
  4606. the moment.
  4607. 
  4608. File: gfortran.info, Node: _gfortran_caf_failed_images, Next: _gfortran_caf_stopped_images, Prev: _gfortran_caf_image_status, Up: Function ABI Documentation
  4609. 8.2.6 '_gfortran_caf_failed_images' -- Get an array of the indexes of the failed images
  4610. ---------------------------------------------------------------------------------------
  4611. _Description_:
  4612. Get an array of image indexes in the current TEAM that have failed.
  4613. The array is sorted ascendingly. When TEAM is not provided the
  4614. current team is to be used. When KIND is provided then the
  4615. resulting array is of that integer kind else it is of default
  4616. integer kind. The returns an unallocated size zero array when no
  4617. images have failed.
  4618. _Syntax_:
  4619. 'int _gfortran_caf_failed_images (caf_team_t * team, int * kind)'
  4620. _Arguments_:
  4621. TEAM optional; team on the which the inquiry is to be
  4622. performed.
  4623. IMAGE optional; the kind of the resulting integer
  4624. array.
  4625. _NOTES_
  4626. This function follows TS18508. Because team-functionality is not
  4627. yet implemented a null-pointer is passed for the TEAM argument at
  4628. the moment.
  4629. 
  4630. File: gfortran.info, Node: _gfortran_caf_stopped_images, Next: _gfortran_caf_register, Prev: _gfortran_caf_failed_images, Up: Function ABI Documentation
  4631. 8.2.7 '_gfortran_caf_stopped_images' -- Get an array of the indexes of the stopped images
  4632. -----------------------------------------------------------------------------------------
  4633. _Description_:
  4634. Get an array of image indexes in the current TEAM that have
  4635. stopped. The array is sorted ascendingly. When TEAM is not
  4636. provided the current team is to be used. When KIND is provided
  4637. then the resulting array is of that integer kind else it is of
  4638. default integer kind. The returns an unallocated size zero array
  4639. when no images have failed.
  4640. _Syntax_:
  4641. 'int _gfortran_caf_stopped_images (caf_team_t * team, int * kind)'
  4642. _Arguments_:
  4643. TEAM optional; team on the which the inquiry is to be
  4644. performed.
  4645. IMAGE optional; the kind of the resulting integer
  4646. array.
  4647. _NOTES_
  4648. This function follows TS18508. Because team-functionality is not
  4649. yet implemented a null-pointer is passed for the TEAM argument at
  4650. the moment.
  4651. 
  4652. File: gfortran.info, Node: _gfortran_caf_register, Next: _gfortran_caf_deregister, Prev: _gfortran_caf_stopped_images, Up: Function ABI Documentation
  4653. 8.2.8 '_gfortran_caf_register' -- Registering coarrays
  4654. ------------------------------------------------------
  4655. _Description_:
  4656. Registers memory for a coarray and creates a token to identify the
  4657. coarray. The routine is called for both coarrays with 'SAVE'
  4658. attribute and using an explicit 'ALLOCATE' statement. If an error
  4659. occurs and STAT is a 'NULL' pointer, the function shall abort with
  4660. printing an error message and starting the error termination. If
  4661. no error occurs and STAT is present, it shall be set to zero.
  4662. Otherwise, it shall be set to a positive value and, if not-'NULL',
  4663. ERRMSG shall be set to a string describing the failure. The
  4664. routine shall register the memory provided in the 'DATA'-component
  4665. of the array descriptor DESC, when that component is non-'NULL',
  4666. else it shall allocate sufficient memory and provide a pointer to
  4667. it in the 'DATA'-component of DESC. The array descriptor has rank
  4668. zero, when a scalar object is to be registered and the array
  4669. descriptor may be invalid after the call to
  4670. '_gfortran_caf_register'. When an array is to be allocated the
  4671. descriptor persists.
  4672. For 'CAF_REGTYPE_COARRAY_STATIC' and 'CAF_REGTYPE_COARRAY_ALLOC',
  4673. the passed size is the byte size requested. For
  4674. 'CAF_REGTYPE_LOCK_STATIC', 'CAF_REGTYPE_LOCK_ALLOC' and
  4675. 'CAF_REGTYPE_CRITICAL' it is the array size or one for a scalar.
  4676. When 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' is used, then only a
  4677. token for an allocatable or pointer component is created. The
  4678. 'SIZE' parameter is not used then. On the contrary when
  4679. 'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' is specified, then the
  4680. TOKEN needs to be registered by a previous call with regtype
  4681. 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and either the memory
  4682. specified in the DESC's data-ptr is registered or allocate when the
  4683. data-ptr is 'NULL'.
  4684. _Syntax_:
  4685. 'void caf_register (size_t size, caf_register_t type, caf_token_t
  4686. *token, gfc_descriptor_t *desc, int *stat, char *errmsg, size_t
  4687. errmsg_len)'
  4688. _Arguments_:
  4689. SIZE For normal coarrays, the byte size of the
  4690. coarray to be allocated; for lock types and
  4691. event types, the number of elements.
  4692. TYPE one of the caf_register_t types.
  4693. TOKEN intent(out) An opaque pointer identifying the
  4694. coarray.
  4695. DESC intent(inout) The (pseudo) array descriptor.
  4696. STAT intent(out) For allocatable coarrays, stores the
  4697. STAT=; may be 'NULL'
  4698. ERRMSG intent(out) When an error occurs, this will be
  4699. set to an error message; may be 'NULL'
  4700. ERRMSG_LEN the buffer size of errmsg.
  4701. _NOTES_
  4702. Nonallocatable coarrays have to be registered prior use from remote
  4703. images. In order to guarantee this, they have to be registered
  4704. before the main program. This can be achieved by creating
  4705. constructor functions. That is what GCC does such that also for
  4706. nonallocatable coarrays the memory is allocated and no static
  4707. memory is used. The token permits to identify the coarray; to the
  4708. processor, the token is a nonaliasing pointer. The library can,
  4709. for instance, store the base address of the coarray in the token,
  4710. some handle or a more complicated struct. The library may also
  4711. store the array descriptor DESC when its rank is non-zero.
  4712. For lock types, the value shall only be used for checking the
  4713. allocation status. Note that for critical blocks, the locking is
  4714. only required on one image; in the locking statement, the processor
  4715. shall always pass an image index of one for critical-block lock
  4716. variables ('CAF_REGTYPE_CRITICAL'). For lock types and
  4717. critical-block variables, the initial value shall be unlocked (or,
  4718. respecitively, not in critical section) such as the value false;
  4719. for event types, the initial state should be no event, e.g. zero.
  4720. 
  4721. File: gfortran.info, Node: _gfortran_caf_deregister, Next: _gfortran_caf_is_present, Prev: _gfortran_caf_register, Up: Function ABI Documentation
  4722. 8.2.9 '_gfortran_caf_deregister' -- Deregistering coarrays
  4723. ----------------------------------------------------------
  4724. _Description_:
  4725. Called to free or deregister the memory of a coarray; the processor
  4726. calls this function for automatic and explicit deallocation. In
  4727. case of an error, this function shall fail with an error message,
  4728. unless the STAT variable is not null. The library is only expected
  4729. to free memory it allocated itself during a call to
  4730. '_gfortran_caf_register'.
  4731. _Syntax_:
  4732. 'void caf_deregister (caf_token_t *token, caf_deregister_t type,
  4733. int *stat, char *errmsg, size_t errmsg_len)'
  4734. _Arguments_:
  4735. TOKEN the token to free.
  4736. TYPE the type of action to take for the coarray. A
  4737. 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' is
  4738. allowed only for allocatable or pointer
  4739. components of derived type coarrays. The action
  4740. only deallocates the local memory without
  4741. deleting the token.
  4742. STAT intent(out) Stores the STAT=; may be NULL
  4743. ERRMSG intent(out) When an error occurs, this will be
  4744. set to an error message; may be NULL
  4745. ERRMSG_LEN the buffer size of errmsg.
  4746. _NOTES_
  4747. For nonalloatable coarrays this function is never called. If a
  4748. cleanup is required, it has to be handled via the finish, stop and
  4749. error stop functions, and via destructors.
  4750. 
  4751. File: gfortran.info, Node: _gfortran_caf_is_present, Next: _gfortran_caf_send, Prev: _gfortran_caf_deregister, Up: Function ABI Documentation
  4752. 8.2.10 '_gfortran_caf_is_present' -- Query whether an allocatable or pointer component in a derived type coarray is allocated
  4753. -----------------------------------------------------------------------------------------------------------------------------
  4754. _Description_:
  4755. Used to query the coarray library whether an allocatable component
  4756. in a derived type coarray is allocated on a remote image.
  4757. _Syntax_:
  4758. 'void _gfortran_caf_is_present (caf_token_t token, int image_index,
  4759. gfc_reference_t *ref)'
  4760. _Arguments_:
  4761. TOKEN An opaque pointer identifying the coarray.
  4762. IMAGE_INDEX The ID of the remote image; must be a positive
  4763. number.
  4764. REF A chain of references to address the allocatable
  4765. or pointer component in the derived type
  4766. coarray. The object reference needs to be a
  4767. scalar or a full array reference, respectively.
  4768. 
  4769. File: gfortran.info, Node: _gfortran_caf_send, Next: _gfortran_caf_get, Prev: _gfortran_caf_is_present, Up: Function ABI Documentation
  4770. 8.2.11 '_gfortran_caf_send' -- Sending data from a local image to a remote image
  4771. --------------------------------------------------------------------------------
  4772. _Description_:
  4773. Called to send a scalar, an array section or a whole array from a
  4774. local to a remote image identified by the image_index.
  4775. _Syntax_:
  4776. 'void _gfortran_caf_send (caf_token_t token, size_t offset, int
  4777. image_index, gfc_descriptor_t *dest, caf_vector_t *dst_vector,
  4778. gfc_descriptor_t *src, int dst_kind, int src_kind, bool
  4779. may_require_tmp, int *stat)'
  4780. _Arguments_:
  4781. TOKEN intent(in) An opaque pointer identifying the
  4782. coarray.
  4783. OFFSET intent(in) By which amount of bytes the actual
  4784. data is shifted compared to the base address of
  4785. the coarray.
  4786. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4787. positive number.
  4788. DEST intent(in) Array descriptor for the remote image
  4789. for the bounds and the size. The 'base_addr'
  4790. shall not be accessed.
  4791. DST_VECTOR intent(in) If not NULL, it contains the vector
  4792. subscript of the destination array; the values
  4793. are relative to the dimension triplet of the
  4794. dest argument.
  4795. SRC intent(in) Array descriptor of the local array
  4796. to be transferred to the remote image
  4797. DST_KIND intent(in) Kind of the destination argument
  4798. SRC_KIND intent(in) Kind of the source argument
  4799. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4800. known at compile time that the DEST and SRC
  4801. either cannot overlap or overlap (fully or
  4802. partially) such that walking SRC and DEST in
  4803. element wise element order (honoring the stride
  4804. value) will not lead to wrong results.
  4805. Otherwise, the value is 'true'.
  4806. STAT intent(out) when non-NULL give the result of the
  4807. operation, i.e., zero on success and non-zero on
  4808. error. When NULL and an error occurs, then an
  4809. error message is printed and the program is
  4810. terminated.
  4811. _NOTES_
  4812. It is permitted to have IMAGE_INDEX equal the current image; the
  4813. memory of the send-to and the send-from might (partially) overlap
  4814. in that case. The implementation has to take care that it handles
  4815. this case, e.g. using 'memmove' which handles (partially)
  4816. overlapping memory. If MAY_REQUIRE_TMP is true, the library might
  4817. additionally create a temporary variable, unless additional checks
  4818. show that this is not required (e.g. because walking backward is
  4819. possible or because both arrays are contiguous and 'memmove' takes
  4820. care of overlap issues).
  4821. Note that the assignment of a scalar to an array is permitted. In
  4822. addition, the library has to handle numeric-type conversion and for
  4823. strings, padding and different character kinds.
  4824. 
  4825. File: gfortran.info, Node: _gfortran_caf_get, Next: _gfortran_caf_sendget, Prev: _gfortran_caf_send, Up: Function ABI Documentation
  4826. 8.2.12 '_gfortran_caf_get' -- Getting data from a remote image
  4827. --------------------------------------------------------------
  4828. _Description_:
  4829. Called to get an array section or a whole array from a remote,
  4830. image identified by the image_index.
  4831. _Syntax_:
  4832. 'void _gfortran_caf_get (caf_token_t token, size_t offset, int
  4833. image_index, gfc_descriptor_t *src, caf_vector_t *src_vector,
  4834. gfc_descriptor_t *dest, int src_kind, int dst_kind, bool
  4835. may_require_tmp, int *stat)'
  4836. _Arguments_:
  4837. TOKEN intent(in) An opaque pointer identifying the
  4838. coarray.
  4839. OFFSET intent(in) By which amount of bytes the actual
  4840. data is shifted compared to the base address of
  4841. the coarray.
  4842. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4843. positive number.
  4844. DEST intent(out) Array descriptor of the local array
  4845. to store the data retrieved from the remote
  4846. image
  4847. SRC intent(in) Array descriptor for the remote image
  4848. for the bounds and the size. The 'base_addr'
  4849. shall not be accessed.
  4850. SRC_VECTOR intent(in) If not NULL, it contains the vector
  4851. subscript of the source array; the values are
  4852. relative to the dimension triplet of the SRC
  4853. argument.
  4854. DST_KIND intent(in) Kind of the destination argument
  4855. SRC_KIND intent(in) Kind of the source argument
  4856. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4857. known at compile time that the DEST and SRC
  4858. either cannot overlap or overlap (fully or
  4859. partially) such that walking SRC and DEST in
  4860. element wise element order (honoring the stride
  4861. value) will not lead to wrong results.
  4862. Otherwise, the value is 'true'.
  4863. STAT intent(out) When non-NULL give the result of the
  4864. operation, i.e., zero on success and non-zero on
  4865. error. When NULL and an error occurs, then an
  4866. error message is printed and the program is
  4867. terminated.
  4868. _NOTES_
  4869. It is permitted to have IMAGE_INDEX equal the current image; the
  4870. memory of the send-to and the send-from might (partially) overlap
  4871. in that case. The implementation has to take care that it handles
  4872. this case, e.g. using 'memmove' which handles (partially)
  4873. overlapping memory. If MAY_REQUIRE_TMP is true, the library might
  4874. additionally create a temporary variable, unless additional checks
  4875. show that this is not required (e.g. because walking backward is
  4876. possible or because both arrays are contiguous and 'memmove' takes
  4877. care of overlap issues).
  4878. Note that the library has to handle numeric-type conversion and for
  4879. strings, padding and different character kinds.
  4880. 
  4881. File: gfortran.info, Node: _gfortran_caf_sendget, Next: _gfortran_caf_send_by_ref, Prev: _gfortran_caf_get, Up: Function ABI Documentation
  4882. 8.2.13 '_gfortran_caf_sendget' -- Sending data between remote images
  4883. --------------------------------------------------------------------
  4884. _Description_:
  4885. Called to send a scalar, an array section or a whole array from a
  4886. remote image identified by the SRC_IMAGE_INDEX to a remote image
  4887. identified by the DST_IMAGE_INDEX.
  4888. _Syntax_:
  4889. 'void _gfortran_caf_sendget (caf_token_t dst_token, size_t
  4890. dst_offset, int dst_image_index, gfc_descriptor_t *dest,
  4891. caf_vector_t *dst_vector, caf_token_t src_token, size_t src_offset,
  4892. int src_image_index, gfc_descriptor_t *src, caf_vector_t
  4893. *src_vector, int dst_kind, int src_kind, bool may_require_tmp, int
  4894. *stat)'
  4895. _Arguments_:
  4896. DST_TOKEN intent(in) An opaque pointer identifying the
  4897. destination coarray.
  4898. DST_OFFSET intent(in) By which amount of bytes the actual
  4899. data is shifted compared to the base address of
  4900. the destination coarray.
  4901. DST_IMAGE_INDEXintent(in) The ID of the destination remote
  4902. image; must be a positive number.
  4903. DEST intent(in) Array descriptor for the destination
  4904. remote image for the bounds and the size. The
  4905. 'base_addr' shall not be accessed.
  4906. DST_VECTOR intent(int) If not NULL, it contains the vector
  4907. subscript of the destination array; the values
  4908. are relative to the dimension triplet of the
  4909. DEST argument.
  4910. SRC_TOKEN intent(in) An opaque pointer identifying the
  4911. source coarray.
  4912. SRC_OFFSET intent(in) By which amount of bytes the actual
  4913. data is shifted compared to the base address of
  4914. the source coarray.
  4915. SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
  4916. must be a positive number.
  4917. SRC intent(in) Array descriptor of the local array
  4918. to be transferred to the remote image.
  4919. SRC_VECTOR intent(in) Array descriptor of the local array
  4920. to be transferred to the remote image
  4921. DST_KIND intent(in) Kind of the destination argument
  4922. SRC_KIND intent(in) Kind of the source argument
  4923. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4924. known at compile time that the DEST and SRC
  4925. either cannot overlap or overlap (fully or
  4926. partially) such that walking SRC and DEST in
  4927. element wise element order (honoring the stride
  4928. value) will not lead to wrong results.
  4929. Otherwise, the value is 'true'.
  4930. STAT intent(out) when non-NULL give the result of the
  4931. operation, i.e., zero on success and non-zero on
  4932. error. When NULL and an error occurs, then an
  4933. error message is printed and the program is
  4934. terminated.
  4935. _NOTES_
  4936. It is permitted to have the same image index for both
  4937. SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
  4938. the send-from might (partially) overlap in that case. The
  4939. implementation has to take care that it handles this case, e.g.
  4940. using 'memmove' which handles (partially) overlapping memory. If
  4941. MAY_REQUIRE_TMP is true, the library might additionally create a
  4942. temporary variable, unless additional checks show that this is not
  4943. required (e.g. because walking backward is possible or because
  4944. both arrays are contiguous and 'memmove' takes care of overlap
  4945. issues).
  4946. Note that the assignment of a scalar to an array is permitted. In
  4947. addition, the library has to handle numeric-type conversion and for
  4948. strings, padding and different character kinds.
  4949. 
  4950. File: gfortran.info, Node: _gfortran_caf_send_by_ref, Next: _gfortran_caf_get_by_ref, Prev: _gfortran_caf_sendget, Up: Function ABI Documentation
  4951. 8.2.14 '_gfortran_caf_send_by_ref' -- Sending data from a local image to a remote image with enhanced referencing options
  4952. -------------------------------------------------------------------------------------------------------------------------
  4953. _Description_:
  4954. Called to send a scalar, an array section or a whole array from a
  4955. local to a remote image identified by the IMAGE_INDEX.
  4956. _Syntax_:
  4957. 'void _gfortran_caf_send_by_ref (caf_token_t token, int
  4958. image_index, gfc_descriptor_t *src, caf_reference_t *refs, int
  4959. dst_kind, int src_kind, bool may_require_tmp, bool
  4960. dst_reallocatable, int *stat, int dst_type)'
  4961. _Arguments_:
  4962. TOKEN intent(in) An opaque pointer identifying the
  4963. coarray.
  4964. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4965. positive number.
  4966. SRC intent(in) Array descriptor of the local array
  4967. to be transferred to the remote image
  4968. REFS intent(in) The references on the remote array to
  4969. store the data given by src. Guaranteed to have
  4970. at least one entry.
  4971. DST_KIND intent(in) Kind of the destination argument
  4972. SRC_KIND intent(in) Kind of the source argument
  4973. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4974. known at compile time that the DEST and SRC
  4975. either cannot overlap or overlap (fully or
  4976. partially) such that walking SRC and DEST in
  4977. element wise element order (honoring the stride
  4978. value) will not lead to wrong results.
  4979. Otherwise, the value is 'true'.
  4980. DST_REALLOCATABLEintent(in) Set when the destination is of
  4981. allocatable or pointer type and the refs will
  4982. allow reallocation, i.e., the ref is a full
  4983. array or component ref.
  4984. STAT intent(out) When non-'NULL' give the result of
  4985. the operation, i.e., zero on success and
  4986. non-zero on error. When 'NULL' and an error
  4987. occurs, then an error message is printed and the
  4988. program is terminated.
  4989. DST_TYPE intent(in) Give the type of the destination.
  4990. When the destination is not an array, than the
  4991. precise type, e.g. of a component in a derived
  4992. type, is not known, but provided here.
  4993. _NOTES_
  4994. It is permitted to have IMAGE_INDEX equal the current image; the
  4995. memory of the send-to and the send-from might (partially) overlap
  4996. in that case. The implementation has to take care that it handles
  4997. this case, e.g. using 'memmove' which handles (partially)
  4998. overlapping memory. If MAY_REQUIRE_TMP is true, the library might
  4999. additionally create a temporary variable, unless additional checks
  5000. show that this is not required (e.g. because walking backward is
  5001. possible or because both arrays are contiguous and 'memmove' takes
  5002. care of overlap issues).
  5003. Note that the assignment of a scalar to an array is permitted. In
  5004. addition, the library has to handle numeric-type conversion and for
  5005. strings, padding and different character kinds.
  5006. Because of the more complicated references possible some operations
  5007. may be unsupported by certain libraries. The library is expected
  5008. to issue a precise error message why the operation is not
  5009. permitted.
  5010. 
  5011. File: gfortran.info, Node: _gfortran_caf_get_by_ref, Next: _gfortran_caf_sendget_by_ref, Prev: _gfortran_caf_send_by_ref, Up: Function ABI Documentation
  5012. 8.2.15 '_gfortran_caf_get_by_ref' -- Getting data from a remote image using enhanced references
  5013. -----------------------------------------------------------------------------------------------
  5014. _Description_:
  5015. Called to get a scalar, an array section or a whole array from a
  5016. remote image identified by the IMAGE_INDEX.
  5017. _Syntax_:
  5018. 'void _gfortran_caf_get_by_ref (caf_token_t token, int image_index,
  5019. caf_reference_t *refs, gfc_descriptor_t *dst, int dst_kind, int
  5020. src_kind, bool may_require_tmp, bool dst_reallocatable, int *stat,
  5021. int src_type)'
  5022. _Arguments_:
  5023. TOKEN intent(in) An opaque pointer identifying the
  5024. coarray.
  5025. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5026. positive number.
  5027. REFS intent(in) The references to apply to the remote
  5028. structure to get the data.
  5029. DST intent(in) Array descriptor of the local array
  5030. to store the data transferred from the remote
  5031. image. May be reallocated where needed and when
  5032. DST_REALLOCATABLE allows it.
  5033. DST_KIND intent(in) Kind of the destination argument
  5034. SRC_KIND intent(in) Kind of the source argument
  5035. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  5036. known at compile time that the DEST and SRC
  5037. either cannot overlap or overlap (fully or
  5038. partially) such that walking SRC and DEST in
  5039. element wise element order (honoring the stride
  5040. value) will not lead to wrong results.
  5041. Otherwise, the value is 'true'.
  5042. DST_REALLOCATABLEintent(in) Set when DST is of allocatable or
  5043. pointer type and its refs allow reallocation,
  5044. i.e., the full array or a component is
  5045. referenced.
  5046. STAT intent(out) When non-'NULL' give the result of
  5047. the operation, i.e., zero on success and
  5048. non-zero on error. When 'NULL' and an error
  5049. occurs, then an error message is printed and the
  5050. program is terminated.
  5051. SRC_TYPE intent(in) Give the type of the source. When
  5052. the source is not an array, than the precise
  5053. type, e.g. of a component in a derived type, is
  5054. not known, but provided here.
  5055. _NOTES_
  5056. It is permitted to have 'image_index' equal the current image; the
  5057. memory of the send-to and the send-from might (partially) overlap
  5058. in that case. The implementation has to take care that it handles
  5059. this case, e.g. using 'memmove' which handles (partially)
  5060. overlapping memory. If MAY_REQUIRE_TMP is true, the library might
  5061. additionally create a temporary variable, unless additional checks
  5062. show that this is not required (e.g. because walking backward is
  5063. possible or because both arrays are contiguous and 'memmove' takes
  5064. care of overlap issues).
  5065. Note that the library has to handle numeric-type conversion and for
  5066. strings, padding and different character kinds.
  5067. Because of the more complicated references possible some operations
  5068. may be unsupported by certain libraries. The library is expected
  5069. to issue a precise error message why the operation is not
  5070. permitted.
  5071. 
  5072. File: gfortran.info, Node: _gfortran_caf_sendget_by_ref, Next: _gfortran_caf_lock, Prev: _gfortran_caf_get_by_ref, Up: Function ABI Documentation
  5073. 8.2.16 '_gfortran_caf_sendget_by_ref' -- Sending data between remote images using enhanced references on both sides
  5074. -------------------------------------------------------------------------------------------------------------------
  5075. _Description_:
  5076. Called to send a scalar, an array section or a whole array from a
  5077. remote image identified by the SRC_IMAGE_INDEX to a remote image
  5078. identified by the DST_IMAGE_INDEX.
  5079. _Syntax_:
  5080. 'void _gfortran_caf_sendget_by_ref (caf_token_t dst_token, int
  5081. dst_image_index, caf_reference_t *dst_refs, caf_token_t src_token,
  5082. int src_image_index, caf_reference_t *src_refs, int dst_kind, int
  5083. src_kind, bool may_require_tmp, int *dst_stat, int *src_stat, int
  5084. dst_type, int src_type)'
  5085. _Arguments_:
  5086. DST_TOKEN intent(in) An opaque pointer identifying the
  5087. destination coarray.
  5088. DST_IMAGE_INDEXintent(in) The ID of the destination remote
  5089. image; must be a positive number.
  5090. DST_REFS intent(in) The references on the remote array to
  5091. store the data given by the source. Guaranteed
  5092. to have at least one entry.
  5093. SRC_TOKEN intent(in) An opaque pointer identifying the
  5094. source coarray.
  5095. SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
  5096. must be a positive number.
  5097. SRC_REFS intent(in) The references to apply to the remote
  5098. structure to get the data.
  5099. DST_KIND intent(in) Kind of the destination argument
  5100. SRC_KIND intent(in) Kind of the source argument
  5101. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  5102. known at compile time that the DEST and SRC
  5103. either cannot overlap or overlap (fully or
  5104. partially) such that walking SRC and DEST in
  5105. element wise element order (honoring the stride
  5106. value) will not lead to wrong results.
  5107. Otherwise, the value is 'true'.
  5108. DST_STAT intent(out) when non-'NULL' give the result of
  5109. the send-operation, i.e., zero on success and
  5110. non-zero on error. When 'NULL' and an error
  5111. occurs, then an error message is printed and the
  5112. program is terminated.
  5113. SRC_STAT intent(out) When non-'NULL' give the result of
  5114. the get-operation, i.e., zero on success and
  5115. non-zero on error. When 'NULL' and an error
  5116. occurs, then an error message is printed and the
  5117. program is terminated.
  5118. DST_TYPE intent(in) Give the type of the destination.
  5119. When the destination is not an array, than the
  5120. precise type, e.g. of a component in a derived
  5121. type, is not known, but provided here.
  5122. SRC_TYPE intent(in) Give the type of the source. When
  5123. the source is not an array, than the precise
  5124. type, e.g. of a component in a derived type, is
  5125. not known, but provided here.
  5126. _NOTES_
  5127. It is permitted to have the same image index for both
  5128. SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
  5129. the send-from might (partially) overlap in that case. The
  5130. implementation has to take care that it handles this case, e.g.
  5131. using 'memmove' which handles (partially) overlapping memory. If
  5132. MAY_REQUIRE_TMP is true, the library might additionally create a
  5133. temporary variable, unless additional checks show that this is not
  5134. required (e.g. because walking backward is possible or because
  5135. both arrays are contiguous and 'memmove' takes care of overlap
  5136. issues).
  5137. Note that the assignment of a scalar to an array is permitted. In
  5138. addition, the library has to handle numeric-type conversion and for
  5139. strings, padding and different character kinds.
  5140. Because of the more complicated references possible some operations
  5141. may be unsupported by certain libraries. The library is expected
  5142. to issue a precise error message why the operation is not
  5143. permitted.
  5144. 
  5145. File: gfortran.info, Node: _gfortran_caf_lock, Next: _gfortran_caf_unlock, Prev: _gfortran_caf_sendget_by_ref, Up: Function ABI Documentation
  5146. 8.2.17 '_gfortran_caf_lock' -- Locking a lock variable
  5147. ------------------------------------------------------
  5148. _Description_:
  5149. Acquire a lock on the given image on a scalar locking variable or
  5150. for the given array element for an array-valued variable. If the
  5151. AQUIRED_LOCK is 'NULL', the function returns after having obtained
  5152. the lock. If it is non-'NULL', then ACQUIRED_LOCK is assigned the
  5153. value true (one) when the lock could be obtained and false (zero)
  5154. otherwise. Locking a lock variable which has already been locked
  5155. by the same image is an error.
  5156. _Syntax_:
  5157. 'void _gfortran_caf_lock (caf_token_t token, size_t index, int
  5158. image_index, int *aquired_lock, int *stat, char *errmsg, size_t
  5159. errmsg_len)'
  5160. _Arguments_:
  5161. TOKEN intent(in) An opaque pointer identifying the
  5162. coarray.
  5163. INDEX intent(in) Array index; first array index is 0.
  5164. For scalars, it is always 0.
  5165. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5166. positive number.
  5167. AQUIRED_LOCKintent(out) If not NULL, it returns whether lock
  5168. could be obtained.
  5169. STAT intent(out) Stores the STAT=; may be NULL.
  5170. ERRMSG intent(out) When an error occurs, this will be
  5171. set to an error message; may be NULL.
  5172. ERRMSG_LEN intent(in) the buffer size of errmsg
  5173. _NOTES_
  5174. This function is also called for critical blocks; for those, the
  5175. array index is always zero and the image index is one. Libraries
  5176. are permitted to use other images for critical-block locking
  5177. variables.
  5178. 
  5179. File: gfortran.info, Node: _gfortran_caf_unlock, Next: _gfortran_caf_event_post, Prev: _gfortran_caf_lock, Up: Function ABI Documentation
  5180. 8.2.18 '_gfortran_caf_lock' -- Unlocking a lock variable
  5181. --------------------------------------------------------
  5182. _Description_:
  5183. Release a lock on the given image on a scalar locking variable or
  5184. for the given array element for an array-valued variable.
  5185. Unlocking a lock variable which is unlocked or has been locked by a
  5186. different image is an error.
  5187. _Syntax_:
  5188. 'void _gfortran_caf_unlock (caf_token_t token, size_t index, int
  5189. image_index, int *stat, char *errmsg, size_t errmsg_len)'
  5190. _Arguments_:
  5191. TOKEN intent(in) An opaque pointer identifying the
  5192. coarray.
  5193. INDEX intent(in) Array index; first array index is 0.
  5194. For scalars, it is always 0.
  5195. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5196. positive number.
  5197. STAT intent(out) For allocatable coarrays, stores the
  5198. STAT=; may be NULL.
  5199. ERRMSG intent(out) When an error occurs, this will be
  5200. set to an error message; may be NULL.
  5201. ERRMSG_LEN intent(in) the buffer size of errmsg
  5202. _NOTES_
  5203. This function is also called for critical block; for those, the
  5204. array index is always zero and the image index is one. Libraries
  5205. are permitted to use other images for critical-block locking
  5206. variables.
  5207. 
  5208. File: gfortran.info, Node: _gfortran_caf_event_post, Next: _gfortran_caf_event_wait, Prev: _gfortran_caf_unlock, Up: Function ABI Documentation
  5209. 8.2.19 '_gfortran_caf_event_post' -- Post an event
  5210. --------------------------------------------------
  5211. _Description_:
  5212. Increment the event count of the specified event variable.
  5213. _Syntax_:
  5214. 'void _gfortran_caf_event_post (caf_token_t token, size_t index,
  5215. int image_index, int *stat, char *errmsg, size_t errmsg_len)'
  5216. _Arguments_:
  5217. TOKEN intent(in) An opaque pointer identifying the
  5218. coarray.
  5219. INDEX intent(in) Array index; first array index is 0.
  5220. For scalars, it is always 0.
  5221. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5222. positive number; zero indicates the current
  5223. image, when accessed noncoindexed.
  5224. STAT intent(out) Stores the STAT=; may be NULL.
  5225. ERRMSG intent(out) When an error occurs, this will be
  5226. set to an error message; may be NULL.
  5227. ERRMSG_LEN intent(in) the buffer size of errmsg
  5228. _NOTES_
  5229. This acts like an atomic add of one to the remote image's event
  5230. variable. The statement is an image-control statement but does not
  5231. imply sync memory. Still, all preceeding push communications of
  5232. this image to the specified remote image have to be completed
  5233. before 'event_wait' on the remote image returns.
  5234. 
  5235. File: gfortran.info, Node: _gfortran_caf_event_wait, Next: _gfortran_caf_event_query, Prev: _gfortran_caf_event_post, Up: Function ABI Documentation
  5236. 8.2.20 '_gfortran_caf_event_wait' -- Wait that an event occurred
  5237. ----------------------------------------------------------------
  5238. _Description_:
  5239. Wait until the event count has reached at least the specified
  5240. UNTIL_COUNT; if so, atomically decrement the event variable by this
  5241. amount and return.
  5242. _Syntax_:
  5243. 'void _gfortran_caf_event_wait (caf_token_t token, size_t index,
  5244. int until_count, int *stat, char *errmsg, size_t errmsg_len)'
  5245. _Arguments_:
  5246. TOKEN intent(in) An opaque pointer identifying the
  5247. coarray.
  5248. INDEX intent(in) Array index; first array index is 0.
  5249. For scalars, it is always 0.
  5250. UNTIL_COUNT intent(in) The number of events which have to be
  5251. available before the function returns.
  5252. STAT intent(out) Stores the STAT=; may be NULL.
  5253. ERRMSG intent(out) When an error occurs, this will be
  5254. set to an error message; may be NULL.
  5255. ERRMSG_LEN intent(in) the buffer size of errmsg
  5256. _NOTES_
  5257. This function only operates on a local coarray. It acts like a
  5258. loop checking atomically the value of the event variable, breaking
  5259. if the value is greater or equal the requested number of counts.
  5260. Before the function returns, the event variable has to be
  5261. decremented by the requested UNTIL_COUNT value. A possible
  5262. implementation would be a busy loop for a certain number of spins
  5263. (possibly depending on the number of threads relative to the number
  5264. of available cores) followed by another waiting strategy such as a
  5265. sleeping wait (possibly with an increasing number of sleep time)
  5266. or, if possible, a futex wait.
  5267. The statement is an image-control statement but does not imply sync
  5268. memory. Still, all preceeding push communications of this image to
  5269. the specified remote image have to be completed before 'event_wait'
  5270. on the remote image returns.
  5271. 
  5272. File: gfortran.info, Node: _gfortran_caf_event_query, Next: _gfortran_caf_sync_all, Prev: _gfortran_caf_event_wait, Up: Function ABI Documentation
  5273. 8.2.21 '_gfortran_caf_event_query' -- Query event count
  5274. -------------------------------------------------------
  5275. _Description_:
  5276. Return the event count of the specified event variable.
  5277. _Syntax_:
  5278. 'void _gfortran_caf_event_query (caf_token_t token, size_t index,
  5279. int image_index, int *count, int *stat)'
  5280. _Arguments_:
  5281. TOKEN intent(in) An opaque pointer identifying the
  5282. coarray.
  5283. INDEX intent(in) Array index; first array index is 0.
  5284. For scalars, it is always 0.
  5285. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5286. positive number; zero indicates the current
  5287. image when accessed noncoindexed.
  5288. COUNT intent(out) The number of events currently
  5289. posted to the event variable.
  5290. STAT intent(out) Stores the STAT=; may be NULL.
  5291. _NOTES_
  5292. The typical use is to check the local event variable to only call
  5293. 'event_wait' when the data is available. However, a coindexed
  5294. variable is permitted; there is no ordering or synchronization
  5295. implied. It acts like an atomic fetch of the value of the event
  5296. variable.
  5297. 
  5298. File: gfortran.info, Node: _gfortran_caf_sync_all, Next: _gfortran_caf_sync_images, Prev: _gfortran_caf_event_query, Up: Function ABI Documentation
  5299. 8.2.22 '_gfortran_caf_sync_all' -- All-image barrier
  5300. ----------------------------------------------------
  5301. _Description_:
  5302. Synchronization of all images in the current team; the program only
  5303. continues on a given image after this function has been called on
  5304. all images of the current team. Additionally, it ensures that all
  5305. pending data transfers of previous segment have completed.
  5306. _Syntax_:
  5307. 'void _gfortran_caf_sync_all (int *stat, char *errmsg, size_t
  5308. errmsg_len)'
  5309. _Arguments_:
  5310. STAT intent(out) Stores the status STAT= and may be
  5311. NULL.
  5312. ERRMSG intent(out) When an error occurs, this will be
  5313. set to an error message; may be NULL.
  5314. ERRMSG_LEN intent(in) the buffer size of errmsg
  5315. 
  5316. File: gfortran.info, Node: _gfortran_caf_sync_images, Next: _gfortran_caf_sync_memory, Prev: _gfortran_caf_sync_all, Up: Function ABI Documentation
  5317. 8.2.23 '_gfortran_caf_sync_images' -- Barrier for selected images
  5318. -----------------------------------------------------------------
  5319. _Description_:
  5320. Synchronization between the specified images; the program only
  5321. continues on a given image after this function has been called on
  5322. all images specified for that image. Note that one image can wait
  5323. for all other images in the current team (e.g. via 'sync
  5324. images(*)') while those only wait for that specific image.
  5325. Additionally, 'sync images' ensures that all pending data transfers
  5326. of previous segments have completed.
  5327. _Syntax_:
  5328. 'void _gfortran_caf_sync_images (int count, int images[], int
  5329. *stat, char *errmsg, size_t errmsg_len)'
  5330. _Arguments_:
  5331. COUNT intent(in) The number of images which are
  5332. provided in the next argument. For a zero-sized
  5333. array, the value is zero. For 'sync images
  5334. (*)', the value is -1.
  5335. IMAGES intent(in) An array with the images provided by
  5336. the user. If COUNT is zero, a NULL pointer is
  5337. passed.
  5338. STAT intent(out) Stores the status STAT= and may be
  5339. NULL.
  5340. ERRMSG intent(out) When an error occurs, this will be
  5341. set to an error message; may be NULL.
  5342. ERRMSG_LEN intent(in) the buffer size of errmsg
  5343. 
  5344. File: gfortran.info, Node: _gfortran_caf_sync_memory, Next: _gfortran_caf_error_stop, Prev: _gfortran_caf_sync_images, Up: Function ABI Documentation
  5345. 8.2.24 '_gfortran_caf_sync_memory' -- Wait for completion of segment-memory operations
  5346. --------------------------------------------------------------------------------------
  5347. _Description_:
  5348. Acts as optimization barrier between different segments. It also
  5349. ensures that all pending memory operations of this image have been
  5350. completed.
  5351. _Syntax_:
  5352. 'void _gfortran_caf_sync_memory (int *stat, char *errmsg, size_t
  5353. errmsg_len)'
  5354. _Arguments_:
  5355. STAT intent(out) Stores the status STAT= and may be
  5356. NULL.
  5357. ERRMSG intent(out) When an error occurs, this will be
  5358. set to an error message; may be NULL.
  5359. ERRMSG_LEN intent(in) the buffer size of errmsg
  5360. _NOTE_ A simple implementation could be
  5361. '__asm__ __volatile__ ("":::"memory")' to prevent code movements.
  5362. 
  5363. File: gfortran.info, Node: _gfortran_caf_error_stop, Next: _gfortran_caf_error_stop_str, Prev: _gfortran_caf_sync_memory, Up: Function ABI Documentation
  5364. 8.2.25 '_gfortran_caf_error_stop' -- Error termination with exit code
  5365. ---------------------------------------------------------------------
  5366. _Description_:
  5367. Invoked for an 'ERROR STOP' statement which has an integer
  5368. argument. The function should terminate the program with the
  5369. specified exit code.
  5370. _Syntax_:
  5371. 'void _gfortran_caf_error_stop (int error)'
  5372. _Arguments_:
  5373. ERROR intent(in) The exit status to be used.
  5374. 
  5375. File: gfortran.info, Node: _gfortran_caf_error_stop_str, Next: _gfortran_caf_fail_image, Prev: _gfortran_caf_error_stop, Up: Function ABI Documentation
  5376. 8.2.26 '_gfortran_caf_error_stop_str' -- Error termination with string
  5377. ----------------------------------------------------------------------
  5378. _Description_:
  5379. Invoked for an 'ERROR STOP' statement which has a string as
  5380. argument. The function should terminate the program with a
  5381. nonzero-exit code.
  5382. _Syntax_:
  5383. 'void _gfortran_caf_error_stop (const char *string, size_t len)'
  5384. _Arguments_:
  5385. STRING intent(in) the error message (not zero
  5386. terminated)
  5387. LEN intent(in) the length of the string
  5388. 
  5389. File: gfortran.info, Node: _gfortran_caf_fail_image, Next: _gfortran_caf_atomic_define, Prev: _gfortran_caf_error_stop_str, Up: Function ABI Documentation
  5390. 8.2.27 '_gfortran_caf_fail_image' -- Mark the image failed and end its execution
  5391. --------------------------------------------------------------------------------
  5392. _Description_:
  5393. Invoked for an 'FAIL IMAGE' statement. The function should
  5394. terminate the current image.
  5395. _Syntax_:
  5396. 'void _gfortran_caf_fail_image ()'
  5397. _NOTES_
  5398. This function follows TS18508.
  5399. 
  5400. File: gfortran.info, Node: _gfortran_caf_atomic_define, Next: _gfortran_caf_atomic_ref, Prev: _gfortran_caf_fail_image, Up: Function ABI Documentation
  5401. 8.2.28 '_gfortran_caf_atomic_define' -- Atomic variable assignment
  5402. ------------------------------------------------------------------
  5403. _Description_:
  5404. Assign atomically a value to an integer or logical variable.
  5405. _Syntax_:
  5406. 'void _gfortran_caf_atomic_define (caf_token_t token, size_t
  5407. offset, int image_index, void *value, int *stat, int type, int
  5408. kind)'
  5409. _Arguments_:
  5410. TOKEN intent(in) An opaque pointer identifying the
  5411. coarray.
  5412. OFFSET intent(in) By which amount of bytes the actual
  5413. data is shifted compared to the base address of
  5414. the coarray.
  5415. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5416. positive number; zero indicates the current
  5417. image when used noncoindexed.
  5418. VALUE intent(in) the value to be assigned, passed by
  5419. reference
  5420. STAT intent(out) Stores the status STAT= and may be
  5421. NULL.
  5422. TYPE intent(in) The data type, i.e. 'BT_INTEGER' (1)
  5423. or 'BT_LOGICAL' (2).
  5424. KIND intent(in) The kind value (only 4; always 'int')
  5425. 
  5426. File: gfortran.info, Node: _gfortran_caf_atomic_ref, Next: _gfortran_caf_atomic_cas, Prev: _gfortran_caf_atomic_define, Up: Function ABI Documentation
  5427. 8.2.29 '_gfortran_caf_atomic_ref' -- Atomic variable reference
  5428. --------------------------------------------------------------
  5429. _Description_:
  5430. Reference atomically a value of a kind-4 integer or logical
  5431. variable.
  5432. _Syntax_:
  5433. 'void _gfortran_caf_atomic_ref (caf_token_t token, size_t offset,
  5434. int image_index, void *value, int *stat, int type, int kind)'
  5435. _Arguments_:
  5436. TOKEN intent(in) An opaque pointer identifying the
  5437. coarray.
  5438. OFFSET intent(in) By which amount of bytes the actual
  5439. data is shifted compared to the base address of
  5440. the coarray.
  5441. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5442. positive number; zero indicates the current
  5443. image when used noncoindexed.
  5444. VALUE intent(out) The variable assigned the atomically
  5445. referenced variable.
  5446. STAT intent(out) Stores the status STAT= and may be
  5447. NULL.
  5448. TYPE the data type, i.e. 'BT_INTEGER' (1) or
  5449. 'BT_LOGICAL' (2).
  5450. KIND The kind value (only 4; always 'int')
  5451. 
  5452. File: gfortran.info, Node: _gfortran_caf_atomic_cas, Next: _gfortran_caf_atomic_op, Prev: _gfortran_caf_atomic_ref, Up: Function ABI Documentation
  5453. 8.2.30 '_gfortran_caf_atomic_cas' -- Atomic compare and swap
  5454. ------------------------------------------------------------
  5455. _Description_:
  5456. Atomic compare and swap of a kind-4 integer or logical variable.
  5457. Assigns atomically the specified value to the atomic variable, if
  5458. the latter has the value specified by the passed condition value.
  5459. _Syntax_:
  5460. 'void _gfortran_caf_atomic_cas (caf_token_t token, size_t offset,
  5461. int image_index, void *old, void *compare, void *new_val, int
  5462. *stat, int type, int kind)'
  5463. _Arguments_:
  5464. TOKEN intent(in) An opaque pointer identifying the
  5465. coarray.
  5466. OFFSET intent(in) By which amount of bytes the actual
  5467. data is shifted compared to the base address of
  5468. the coarray.
  5469. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5470. positive number; zero indicates the current
  5471. image when used noncoindexed.
  5472. OLD intent(out) The value which the atomic variable
  5473. had just before the cas operation.
  5474. COMPARE intent(in) The value used for comparision.
  5475. NEW_VAL intent(in) The new value for the atomic
  5476. variable, assigned to the atomic variable, if
  5477. 'compare' equals the value of the atomic
  5478. variable.
  5479. STAT intent(out) Stores the status STAT= and may be
  5480. NULL.
  5481. TYPE intent(in) the data type, i.e. 'BT_INTEGER' (1)
  5482. or 'BT_LOGICAL' (2).
  5483. KIND intent(in) The kind value (only 4; always 'int')
  5484. 
  5485. File: gfortran.info, Node: _gfortran_caf_atomic_op, Next: _gfortran_caf_co_broadcast, Prev: _gfortran_caf_atomic_cas, Up: Function ABI Documentation
  5486. 8.2.31 '_gfortran_caf_atomic_op' -- Atomic operation
  5487. ----------------------------------------------------
  5488. _Description_:
  5489. Apply an operation atomically to an atomic integer or logical
  5490. variable. After the operation, OLD contains the value just before
  5491. the operation, which, respectively, adds (GFC_CAF_ATOMIC_ADD)
  5492. atomically the 'value' to the atomic integer variable or does a
  5493. bitwise AND, OR or exclusive OR between the atomic variable and
  5494. VALUE; the result is then stored in the atomic variable.
  5495. _Syntax_:
  5496. 'void _gfortran_caf_atomic_op (int op, caf_token_t token, size_t
  5497. offset, int image_index, void *value, void *old, int *stat, int
  5498. type, int kind)'
  5499. _Arguments_:
  5500. OP intent(in) the operation to be performed;
  5501. possible values 'GFC_CAF_ATOMIC_ADD' (1),
  5502. 'GFC_CAF_ATOMIC_AND' (2), 'GFC_CAF_ATOMIC_OR'
  5503. (3), 'GFC_CAF_ATOMIC_XOR' (4).
  5504. TOKEN intent(in) An opaque pointer identifying the
  5505. coarray.
  5506. OFFSET intent(in) By which amount of bytes the actual
  5507. data is shifted compared to the base address of
  5508. the coarray.
  5509. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5510. positive number; zero indicates the current
  5511. image when used noncoindexed.
  5512. OLD intent(out) The value which the atomic variable
  5513. had just before the atomic operation.
  5514. VAL intent(in) The new value for the atomic
  5515. variable, assigned to the atomic variable, if
  5516. 'compare' equals the value of the atomic
  5517. variable.
  5518. STAT intent(out) Stores the status STAT= and may be
  5519. NULL.
  5520. TYPE intent(in) the data type, i.e. 'BT_INTEGER' (1)
  5521. or 'BT_LOGICAL' (2)
  5522. KIND intent(in) the kind value (only 4; always 'int')
  5523. 
  5524. File: gfortran.info, Node: _gfortran_caf_co_broadcast, Next: _gfortran_caf_co_max, Prev: _gfortran_caf_atomic_op, Up: Function ABI Documentation
  5525. 8.2.32 '_gfortran_caf_co_broadcast' -- Sending data to all images
  5526. -----------------------------------------------------------------
  5527. _Description_:
  5528. Distribute a value from a given image to all other images in the
  5529. team. Has to be called collectively.
  5530. _Syntax_:
  5531. 'void _gfortran_caf_co_broadcast (gfc_descriptor_t *a, int
  5532. source_image, int *stat, char *errmsg, size_t errmsg_len)'
  5533. _Arguments_:
  5534. A intent(inout) An array descriptor with the data
  5535. to be broadcasted (on SOURCE_IMAGE) or to be
  5536. received (other images).
  5537. SOURCE_IMAGEintent(in) The ID of the image from which the
  5538. data should be broadcasted.
  5539. STAT intent(out) Stores the status STAT= and may be
  5540. NULL.
  5541. ERRMSG intent(out) When an error occurs, this will be
  5542. set to an error message; may be NULL.
  5543. ERRMSG_LEN intent(in) the buffer size of errmsg.
  5544. 
  5545. File: gfortran.info, Node: _gfortran_caf_co_max, Next: _gfortran_caf_co_min, Prev: _gfortran_caf_co_broadcast, Up: Function ABI Documentation
  5546. 8.2.33 '_gfortran_caf_co_max' -- Collective maximum reduction
  5547. -------------------------------------------------------------
  5548. _Description_:
  5549. Calculates for each array element of the variable A the maximum
  5550. value for that element in the current team; if RESULT_IMAGE has the
  5551. value 0, the result shall be stored on all images, otherwise, only
  5552. on the specified image. This function operates on numeric values
  5553. and character strings.
  5554. _Syntax_:
  5555. 'void _gfortran_caf_co_max (gfc_descriptor_t *a, int result_image,
  5556. int *stat, char *errmsg, int a_len, size_t errmsg_len)'
  5557. _Arguments_:
  5558. A intent(inout) An array descriptor for the data
  5559. to be processed. On the destination image(s)
  5560. the result overwrites the old content.
  5561. RESULT_IMAGEintent(in) The ID of the image to which the
  5562. reduced value should be copied to; if zero, it
  5563. has to be copied to all images.
  5564. STAT intent(out) Stores the status STAT= and may be
  5565. NULL.
  5566. ERRMSG intent(out) When an error occurs, this will be
  5567. set to an error message; may be NULL.
  5568. A_LEN intent(in) the string length of argument A
  5569. ERRMSG_LEN intent(in) the buffer size of errmsg
  5570. _NOTES_
  5571. If RESULT_IMAGE is nonzero, the data in the array descriptor A on
  5572. all images except of the specified one become undefined; hence, the
  5573. library may make use of this.
  5574. 
  5575. File: gfortran.info, Node: _gfortran_caf_co_min, Next: _gfortran_caf_co_sum, Prev: _gfortran_caf_co_max, Up: Function ABI Documentation
  5576. 8.2.34 '_gfortran_caf_co_min' -- Collective minimum reduction
  5577. -------------------------------------------------------------
  5578. _Description_:
  5579. Calculates for each array element of the variable A the minimum
  5580. value for that element in the current team; if RESULT_IMAGE has the
  5581. value 0, the result shall be stored on all images, otherwise, only
  5582. on the specified image. This function operates on numeric values
  5583. and character strings.
  5584. _Syntax_:
  5585. 'void _gfortran_caf_co_min (gfc_descriptor_t *a, int result_image,
  5586. int *stat, char *errmsg, int a_len, size_t errmsg_len)'
  5587. _Arguments_:
  5588. A intent(inout) An array descriptor for the data
  5589. to be processed. On the destination image(s)
  5590. the result overwrites the old content.
  5591. RESULT_IMAGEintent(in) The ID of the image to which the
  5592. reduced value should be copied to; if zero, it
  5593. has to be copied to all images.
  5594. STAT intent(out) Stores the status STAT= and may be
  5595. NULL.
  5596. ERRMSG intent(out) When an error occurs, this will be
  5597. set to an error message; may be NULL.
  5598. A_LEN intent(in) the string length of argument A
  5599. ERRMSG_LEN intent(in) the buffer size of errmsg
  5600. _NOTES_
  5601. If RESULT_IMAGE is nonzero, the data in the array descriptor A on
  5602. all images except of the specified one become undefined; hence, the
  5603. library may make use of this.
  5604. 
  5605. File: gfortran.info, Node: _gfortran_caf_co_sum, Next: _gfortran_caf_co_reduce, Prev: _gfortran_caf_co_min, Up: Function ABI Documentation
  5606. 8.2.35 '_gfortran_caf_co_sum' -- Collective summing reduction
  5607. -------------------------------------------------------------
  5608. _Description_:
  5609. Calculates for each array element of the variable A the sum of all
  5610. values for that element in the current team; if RESULT_IMAGE has
  5611. the value 0, the result shall be stored on all images, otherwise,
  5612. only on the specified image. This function operates on numeric
  5613. values only.
  5614. _Syntax_:
  5615. 'void _gfortran_caf_co_sum (gfc_descriptor_t *a, int result_image,
  5616. int *stat, char *errmsg, size_t errmsg_len)'
  5617. _Arguments_:
  5618. A intent(inout) An array descriptor with the data
  5619. to be processed. On the destination image(s)
  5620. the result overwrites the old content.
  5621. RESULT_IMAGEintent(in) The ID of the image to which the
  5622. reduced value should be copied to; if zero, it
  5623. has to be copied to all images.
  5624. STAT intent(out) Stores the status STAT= and may be
  5625. NULL.
  5626. ERRMSG intent(out) When an error occurs, this will be
  5627. set to an error message; may be NULL.
  5628. ERRMSG_LEN intent(in) the buffer size of errmsg
  5629. _NOTES_
  5630. If RESULT_IMAGE is nonzero, the data in the array descriptor A on
  5631. all images except of the specified one become undefined; hence, the
  5632. library may make use of this.
  5633. 
  5634. File: gfortran.info, Node: _gfortran_caf_co_reduce, Prev: _gfortran_caf_co_sum, Up: Function ABI Documentation
  5635. 8.2.36 '_gfortran_caf_co_reduce' -- Generic collective reduction
  5636. ----------------------------------------------------------------
  5637. _Description_:
  5638. Calculates for each array element of the variable A the reduction
  5639. value for that element in the current team; if RESULT_IMAGE has the
  5640. value 0, the result shall be stored on all images, otherwise, only
  5641. on the specified image. The OPR is a pure function doing a
  5642. mathematically commutative and associative operation.
  5643. The OPR_FLAGS denote the following; the values are bitwise ored.
  5644. 'GFC_CAF_BYREF' (1) if the result should be returned by reference;
  5645. 'GFC_CAF_HIDDENLEN' (2) whether the result and argument string
  5646. lengths shall be specified as hidden arguments; 'GFC_CAF_ARG_VALUE'
  5647. (4) whether the arguments shall be passed by value,
  5648. 'GFC_CAF_ARG_DESC' (8) whether the arguments shall be passed by
  5649. descriptor.
  5650. _Syntax_:
  5651. 'void _gfortran_caf_co_reduce (gfc_descriptor_t *a, void * (*opr)
  5652. (void *, void *), int opr_flags, int result_image, int *stat, char
  5653. *errmsg, int a_len, size_t errmsg_len)'
  5654. _Arguments_:
  5655. A intent(inout) An array descriptor with the data
  5656. to be processed. On the destination image(s)
  5657. the result overwrites the old content.
  5658. OPR intent(in) Function pointer to the reduction
  5659. function
  5660. OPR_FLAGS intent(in) Flags regarding the reduction
  5661. function
  5662. RESULT_IMAGEintent(in) The ID of the image to which the
  5663. reduced value should be copied to; if zero, it
  5664. has to be copied to all images.
  5665. STAT intent(out) Stores the status STAT= and may be
  5666. NULL.
  5667. ERRMSG intent(out) When an error occurs, this will be
  5668. set to an error message; may be NULL.
  5669. A_LEN intent(in) the string length of argument A
  5670. ERRMSG_LEN intent(in) the buffer size of errmsg
  5671. _NOTES_
  5672. If RESULT_IMAGE is nonzero, the data in the array descriptor A on
  5673. all images except of the specified one become undefined; hence, the
  5674. library may make use of this.
  5675. For character arguments, the result is passed as first argument,
  5676. followed by the result string length, next come the two string
  5677. arguments, followed by the two hidden string length arguments.
  5678. With C binding, there are no hidden arguments and by-reference
  5679. passing and either only a single character is passed or an array
  5680. descriptor.
  5681. 
  5682. File: gfortran.info, Node: Intrinsic Procedures, Next: Intrinsic Modules, Prev: Coarray Programming, Up: Top
  5683. 9 Intrinsic Procedures
  5684. **********************
  5685. * Menu:
  5686. * Introduction: Introduction to Intrinsics
  5687. * 'ABORT': ABORT, Abort the program
  5688. * 'ABS': ABS, Absolute value
  5689. * 'ACCESS': ACCESS, Checks file access modes
  5690. * 'ACHAR': ACHAR, Character in ASCII collating sequence
  5691. * 'ACOS': ACOS, Arccosine function
  5692. * 'ACOSD': ACOSD, Arccosine function, degrees
  5693. * 'ACOSH': ACOSH, Inverse hyperbolic cosine function
  5694. * 'ADJUSTL': ADJUSTL, Left adjust a string
  5695. * 'ADJUSTR': ADJUSTR, Right adjust a string
  5696. * 'AIMAG': AIMAG, Imaginary part of complex number
  5697. * 'AINT': AINT, Truncate to a whole number
  5698. * 'ALARM': ALARM, Set an alarm clock
  5699. * 'ALL': ALL, Determine if all values are true
  5700. * 'ALLOCATED': ALLOCATED, Status of allocatable entity
  5701. * 'AND': AND, Bitwise logical AND
  5702. * 'ANINT': ANINT, Nearest whole number
  5703. * 'ANY': ANY, Determine if any values are true
  5704. * 'ASIN': ASIN, Arcsine function
  5705. * 'ASIND': ASIND, Arcsine function, degrees
  5706. * 'ASINH': ASINH, Inverse hyperbolic sine function
  5707. * 'ASSOCIATED': ASSOCIATED, Status of a pointer or pointer/target pair
  5708. * 'ATAN': ATAN, Arctangent function
  5709. * 'ATAND': ATAND, Arctangent function, degrees
  5710. * 'ATAN2': ATAN2, Arctangent function
  5711. * 'ATAN2D': ATAN2D, Arctangent function, degrees
  5712. * 'ATANH': ATANH, Inverse hyperbolic tangent function
  5713. * 'ATOMIC_ADD': ATOMIC_ADD, Atomic ADD operation
  5714. * 'ATOMIC_AND': ATOMIC_AND, Atomic bitwise AND operation
  5715. * 'ATOMIC_CAS': ATOMIC_CAS, Atomic compare and swap
  5716. * 'ATOMIC_DEFINE': ATOMIC_DEFINE, Setting a variable atomically
  5717. * 'ATOMIC_FETCH_ADD': ATOMIC_FETCH_ADD, Atomic ADD operation with prior fetch
  5718. * 'ATOMIC_FETCH_AND': ATOMIC_FETCH_AND, Atomic bitwise AND operation with prior fetch
  5719. * 'ATOMIC_FETCH_OR': ATOMIC_FETCH_OR, Atomic bitwise OR operation with prior fetch
  5720. * 'ATOMIC_FETCH_XOR': ATOMIC_FETCH_XOR, Atomic bitwise XOR operation with prior fetch
  5721. * 'ATOMIC_OR': ATOMIC_OR, Atomic bitwise OR operation
  5722. * 'ATOMIC_REF': ATOMIC_REF, Obtaining the value of a variable atomically
  5723. * 'ATOMIC_XOR': ATOMIC_XOR, Atomic bitwise OR operation
  5724. * 'BACKTRACE': BACKTRACE, Show a backtrace
  5725. * 'BESSEL_J0': BESSEL_J0, Bessel function of the first kind of order 0
  5726. * 'BESSEL_J1': BESSEL_J1, Bessel function of the first kind of order 1
  5727. * 'BESSEL_JN': BESSEL_JN, Bessel function of the first kind
  5728. * 'BESSEL_Y0': BESSEL_Y0, Bessel function of the second kind of order 0
  5729. * 'BESSEL_Y1': BESSEL_Y1, Bessel function of the second kind of order 1
  5730. * 'BESSEL_YN': BESSEL_YN, Bessel function of the second kind
  5731. * 'BGE': BGE, Bitwise greater than or equal to
  5732. * 'BGT': BGT, Bitwise greater than
  5733. * 'BIT_SIZE': BIT_SIZE, Bit size inquiry function
  5734. * 'BLE': BLE, Bitwise less than or equal to
  5735. * 'BLT': BLT, Bitwise less than
  5736. * 'BTEST': BTEST, Bit test function
  5737. * 'C_ASSOCIATED': C_ASSOCIATED, Status of a C pointer
  5738. * 'C_F_POINTER': C_F_POINTER, Convert C into Fortran pointer
  5739. * 'C_F_PROCPOINTER': C_F_PROCPOINTER, Convert C into Fortran procedure pointer
  5740. * 'C_FUNLOC': C_FUNLOC, Obtain the C address of a procedure
  5741. * 'C_LOC': C_LOC, Obtain the C address of an object
  5742. * 'C_SIZEOF': C_SIZEOF, Size in bytes of an expression
  5743. * 'CEILING': CEILING, Integer ceiling function
  5744. * 'CHAR': CHAR, Integer-to-character conversion function
  5745. * 'CHDIR': CHDIR, Change working directory
  5746. * 'CHMOD': CHMOD, Change access permissions of files
  5747. * 'CMPLX': CMPLX, Complex conversion function
  5748. * 'CO_BROADCAST': CO_BROADCAST, Copy a value to all images the current set of images
  5749. * 'CO_MAX': CO_MAX, Maximal value on the current set of images
  5750. * 'CO_MIN': CO_MIN, Minimal value on the current set of images
  5751. * 'CO_REDUCE': CO_REDUCE, Reduction of values on the current set of images
  5752. * 'CO_SUM': CO_SUM, Sum of values on the current set of images
  5753. * 'COMMAND_ARGUMENT_COUNT': COMMAND_ARGUMENT_COUNT, Get number of command line arguments
  5754. * 'COMPILER_OPTIONS': COMPILER_OPTIONS, Options passed to the compiler
  5755. * 'COMPILER_VERSION': COMPILER_VERSION, Compiler version string
  5756. * 'COMPLEX': COMPLEX, Complex conversion function
  5757. * 'CONJG': CONJG, Complex conjugate function
  5758. * 'COS': COS, Cosine function
  5759. * 'COSD': COSD, Cosine function, degrees
  5760. * 'COSH': COSH, Hyperbolic cosine function
  5761. * 'COTAN': COTAN, Cotangent function
  5762. * 'COTAND': COTAND, Cotangent function, degrees
  5763. * 'COUNT': COUNT, Count occurrences of TRUE in an array
  5764. * 'CPU_TIME': CPU_TIME, CPU time subroutine
  5765. * 'CSHIFT': CSHIFT, Circular shift elements of an array
  5766. * 'CTIME': CTIME, Subroutine (or function) to convert a time into a string
  5767. * 'DATE_AND_TIME': DATE_AND_TIME, Date and time subroutine
  5768. * 'DBLE': DBLE, Double precision conversion function
  5769. * 'DCMPLX': DCMPLX, Double complex conversion function
  5770. * 'DIGITS': DIGITS, Significant digits function
  5771. * 'DIM': DIM, Positive difference
  5772. * 'DOT_PRODUCT': DOT_PRODUCT, Dot product function
  5773. * 'DPROD': DPROD, Double product function
  5774. * 'DREAL': DREAL, Double real part function
  5775. * 'DSHIFTL': DSHIFTL, Combined left shift
  5776. * 'DSHIFTR': DSHIFTR, Combined right shift
  5777. * 'DTIME': DTIME, Execution time subroutine (or function)
  5778. * 'EOSHIFT': EOSHIFT, End-off shift elements of an array
  5779. * 'EPSILON': EPSILON, Epsilon function
  5780. * 'ERF': ERF, Error function
  5781. * 'ERFC': ERFC, Complementary error function
  5782. * 'ERFC_SCALED': ERFC_SCALED, Exponentially-scaled complementary error function
  5783. * 'ETIME': ETIME, Execution time subroutine (or function)
  5784. * 'EVENT_QUERY': EVENT_QUERY, Query whether a coarray event has occurred
  5785. * 'EXECUTE_COMMAND_LINE': EXECUTE_COMMAND_LINE, Execute a shell command
  5786. * 'EXIT': EXIT, Exit the program with status.
  5787. * 'EXP': EXP, Exponential function
  5788. * 'EXPONENT': EXPONENT, Exponent function
  5789. * 'EXTENDS_TYPE_OF': EXTENDS_TYPE_OF, Query dynamic type for extension
  5790. * 'FDATE': FDATE, Subroutine (or function) to get the current time as a string
  5791. * 'FGET': FGET, Read a single character in stream mode from stdin
  5792. * 'FGETC': FGETC, Read a single character in stream mode
  5793. * 'FINDLOC': FINDLOC, Search an array for a value
  5794. * 'FLOOR': FLOOR, Integer floor function
  5795. * 'FLUSH': FLUSH, Flush I/O unit(s)
  5796. * 'FNUM': FNUM, File number function
  5797. * 'FPUT': FPUT, Write a single character in stream mode to stdout
  5798. * 'FPUTC': FPUTC, Write a single character in stream mode
  5799. * 'FRACTION': FRACTION, Fractional part of the model representation
  5800. * 'FREE': FREE, Memory de-allocation subroutine
  5801. * 'FSEEK': FSEEK, Low level file positioning subroutine
  5802. * 'FSTAT': FSTAT, Get file status
  5803. * 'FTELL': FTELL, Current stream position
  5804. * 'GAMMA': GAMMA, Gamma function
  5805. * 'GERROR': GERROR, Get last system error message
  5806. * 'GETARG': GETARG, Get command line arguments
  5807. * 'GET_COMMAND': GET_COMMAND, Get the entire command line
  5808. * 'GET_COMMAND_ARGUMENT': GET_COMMAND_ARGUMENT, Get command line arguments
  5809. * 'GETCWD': GETCWD, Get current working directory
  5810. * 'GETENV': GETENV, Get an environmental variable
  5811. * 'GET_ENVIRONMENT_VARIABLE': GET_ENVIRONMENT_VARIABLE, Get an environmental variable
  5812. * 'GETGID': GETGID, Group ID function
  5813. * 'GETLOG': GETLOG, Get login name
  5814. * 'GETPID': GETPID, Process ID function
  5815. * 'GETUID': GETUID, User ID function
  5816. * 'GMTIME': GMTIME, Convert time to GMT info
  5817. * 'HOSTNM': HOSTNM, Get system host name
  5818. * 'HUGE': HUGE, Largest number of a kind
  5819. * 'HYPOT': HYPOT, Euclidean distance function
  5820. * 'IACHAR': IACHAR, Code in ASCII collating sequence
  5821. * 'IALL': IALL, Bitwise AND of array elements
  5822. * 'IAND': IAND, Bitwise logical and
  5823. * 'IANY': IANY, Bitwise OR of array elements
  5824. * 'IARGC': IARGC, Get the number of command line arguments
  5825. * 'IBCLR': IBCLR, Clear bit
  5826. * 'IBITS': IBITS, Bit extraction
  5827. * 'IBSET': IBSET, Set bit
  5828. * 'ICHAR': ICHAR, Character-to-integer conversion function
  5829. * 'IDATE': IDATE, Current local time (day/month/year)
  5830. * 'IEOR': IEOR, Bitwise logical exclusive or
  5831. * 'IERRNO': IERRNO, Function to get the last system error number
  5832. * 'IMAGE_INDEX': IMAGE_INDEX, Cosubscript to image index conversion
  5833. * 'INDEX': INDEX intrinsic, Position of a substring within a string
  5834. * 'INT': INT, Convert to integer type
  5835. * 'INT2': INT2, Convert to 16-bit integer type
  5836. * 'INT8': INT8, Convert to 64-bit integer type
  5837. * 'IOR': IOR, Bitwise logical or
  5838. * 'IPARITY': IPARITY, Bitwise XOR of array elements
  5839. * 'IRAND': IRAND, Integer pseudo-random number
  5840. * 'IS_CONTIGUOUS': IS_CONTIGUOUS, Test whether an array is contiguous
  5841. * 'IS_IOSTAT_END': IS_IOSTAT_END, Test for end-of-file value
  5842. * 'IS_IOSTAT_EOR': IS_IOSTAT_EOR, Test for end-of-record value
  5843. * 'ISATTY': ISATTY, Whether a unit is a terminal device
  5844. * 'ISHFT': ISHFT, Shift bits
  5845. * 'ISHFTC': ISHFTC, Shift bits circularly
  5846. * 'ISNAN': ISNAN, Tests for a NaN
  5847. * 'ITIME': ITIME, Current local time (hour/minutes/seconds)
  5848. * 'KILL': KILL, Send a signal to a process
  5849. * 'KIND': KIND, Kind of an entity
  5850. * 'LBOUND': LBOUND, Lower dimension bounds of an array
  5851. * 'LCOBOUND': LCOBOUND, Lower codimension bounds of an array
  5852. * 'LEADZ': LEADZ, Number of leading zero bits of an integer
  5853. * 'LEN': LEN, Length of a character entity
  5854. * 'LEN_TRIM': LEN_TRIM, Length of a character entity without trailing blank characters
  5855. * 'LGE': LGE, Lexical greater than or equal
  5856. * 'LGT': LGT, Lexical greater than
  5857. * 'LINK': LINK, Create a hard link
  5858. * 'LLE': LLE, Lexical less than or equal
  5859. * 'LLT': LLT, Lexical less than
  5860. * 'LNBLNK': LNBLNK, Index of the last non-blank character in a string
  5861. * 'LOC': LOC, Returns the address of a variable
  5862. * 'LOG': LOG, Logarithm function
  5863. * 'LOG10': LOG10, Base 10 logarithm function
  5864. * 'LOG_GAMMA': LOG_GAMMA, Logarithm of the Gamma function
  5865. * 'LOGICAL': LOGICAL, Convert to logical type
  5866. * 'LONG': LONG, Convert to integer type
  5867. * 'LSHIFT': LSHIFT, Left shift bits
  5868. * 'LSTAT': LSTAT, Get file status
  5869. * 'LTIME': LTIME, Convert time to local time info
  5870. * 'MALLOC': MALLOC, Dynamic memory allocation function
  5871. * 'MASKL': MASKL, Left justified mask
  5872. * 'MASKR': MASKR, Right justified mask
  5873. * 'MATMUL': MATMUL, matrix multiplication
  5874. * 'MAX': MAX, Maximum value of an argument list
  5875. * 'MAXEXPONENT': MAXEXPONENT, Maximum exponent of a real kind
  5876. * 'MAXLOC': MAXLOC, Location of the maximum value within an array
  5877. * 'MAXVAL': MAXVAL, Maximum value of an array
  5878. * 'MCLOCK': MCLOCK, Time function
  5879. * 'MCLOCK8': MCLOCK8, Time function (64-bit)
  5880. * 'MERGE': MERGE, Merge arrays
  5881. * 'MERGE_BITS': MERGE_BITS, Merge of bits under mask
  5882. * 'MIN': MIN, Minimum value of an argument list
  5883. * 'MINEXPONENT': MINEXPONENT, Minimum exponent of a real kind
  5884. * 'MINLOC': MINLOC, Location of the minimum value within an array
  5885. * 'MINVAL': MINVAL, Minimum value of an array
  5886. * 'MOD': MOD, Remainder function
  5887. * 'MODULO': MODULO, Modulo function
  5888. * 'MOVE_ALLOC': MOVE_ALLOC, Move allocation from one object to another
  5889. * 'MVBITS': MVBITS, Move bits from one integer to another
  5890. * 'NEAREST': NEAREST, Nearest representable number
  5891. * 'NEW_LINE': NEW_LINE, New line character
  5892. * 'NINT': NINT, Nearest whole number
  5893. * 'NORM2': NORM2, Euclidean vector norm
  5894. * 'NOT': NOT, Logical negation
  5895. * 'NULL': NULL, Function that returns an disassociated pointer
  5896. * 'NUM_IMAGES': NUM_IMAGES, Number of images
  5897. * 'OR': OR, Bitwise logical OR
  5898. * 'PACK': PACK, Pack an array into an array of rank one
  5899. * 'PARITY': PARITY, Reduction with exclusive OR
  5900. * 'PERROR': PERROR, Print system error message
  5901. * 'POPCNT': POPCNT, Number of bits set
  5902. * 'POPPAR': POPPAR, Parity of the number of bits set
  5903. * 'PRECISION': PRECISION, Decimal precision of a real kind
  5904. * 'PRESENT': PRESENT, Determine whether an optional dummy argument is specified
  5905. * 'PRODUCT': PRODUCT, Product of array elements
  5906. * 'RADIX': RADIX, Base of a data model
  5907. * 'RAN': RAN, Real pseudo-random number
  5908. * 'RAND': RAND, Real pseudo-random number
  5909. * 'RANDOM_INIT': RANDOM_INIT, Initialize pseudo-random number generator
  5910. * 'RANDOM_NUMBER': RANDOM_NUMBER, Pseudo-random number
  5911. * 'RANDOM_SEED': RANDOM_SEED, Initialize a pseudo-random number sequence
  5912. * 'RANGE': RANGE, Decimal exponent range
  5913. * 'RANK' : RANK, Rank of a data object
  5914. * 'REAL': REAL, Convert to real type
  5915. * 'RENAME': RENAME, Rename a file
  5916. * 'REPEAT': REPEAT, Repeated string concatenation
  5917. * 'RESHAPE': RESHAPE, Function to reshape an array
  5918. * 'RRSPACING': RRSPACING, Reciprocal of the relative spacing
  5919. * 'RSHIFT': RSHIFT, Right shift bits
  5920. * 'SAME_TYPE_AS': SAME_TYPE_AS, Query dynamic types for equality
  5921. * 'SCALE': SCALE, Scale a real value
  5922. * 'SCAN': SCAN, Scan a string for the presence of a set of characters
  5923. * 'SECNDS': SECNDS, Time function
  5924. * 'SECOND': SECOND, CPU time function
  5925. * 'SELECTED_CHAR_KIND': SELECTED_CHAR_KIND, Choose character kind
  5926. * 'SELECTED_INT_KIND': SELECTED_INT_KIND, Choose integer kind
  5927. * 'SELECTED_REAL_KIND': SELECTED_REAL_KIND, Choose real kind
  5928. * 'SET_EXPONENT': SET_EXPONENT, Set the exponent of the model
  5929. * 'SHAPE': SHAPE, Determine the shape of an array
  5930. * 'SHIFTA': SHIFTA, Right shift with fill
  5931. * 'SHIFTL': SHIFTL, Left shift
  5932. * 'SHIFTR': SHIFTR, Right shift
  5933. * 'SIGN': SIGN, Sign copying function
  5934. * 'SIGNAL': SIGNAL, Signal handling subroutine (or function)
  5935. * 'SIN': SIN, Sine function
  5936. * 'SIND': SIND, Sine function, degrees
  5937. * 'SINH': SINH, Hyperbolic sine function
  5938. * 'SIZE': SIZE, Function to determine the size of an array
  5939. * 'SIZEOF': SIZEOF, Determine the size in bytes of an expression
  5940. * 'SLEEP': SLEEP, Sleep for the specified number of seconds
  5941. * 'SPACING': SPACING, Smallest distance between two numbers of a given type
  5942. * 'SPREAD': SPREAD, Add a dimension to an array
  5943. * 'SQRT': SQRT, Square-root function
  5944. * 'SRAND': SRAND, Reinitialize the random number generator
  5945. * 'STAT': STAT, Get file status
  5946. * 'STORAGE_SIZE': STORAGE_SIZE, Storage size in bits
  5947. * 'SUM': SUM, Sum of array elements
  5948. * 'SYMLNK': SYMLNK, Create a symbolic link
  5949. * 'SYSTEM': SYSTEM, Execute a shell command
  5950. * 'SYSTEM_CLOCK': SYSTEM_CLOCK, Time function
  5951. * 'TAN': TAN, Tangent function
  5952. * 'TAND': TAND, Tangent function, degrees
  5953. * 'TANH': TANH, Hyperbolic tangent function
  5954. * 'THIS_IMAGE': THIS_IMAGE, Cosubscript index of this image
  5955. * 'TIME': TIME, Time function
  5956. * 'TIME8': TIME8, Time function (64-bit)
  5957. * 'TINY': TINY, Smallest positive number of a real kind
  5958. * 'TRAILZ': TRAILZ, Number of trailing zero bits of an integer
  5959. * 'TRANSFER': TRANSFER, Transfer bit patterns
  5960. * 'TRANSPOSE': TRANSPOSE, Transpose an array of rank two
  5961. * 'TRIM': TRIM, Remove trailing blank characters of a string
  5962. * 'TTYNAM': TTYNAM, Get the name of a terminal device.
  5963. * 'UBOUND': UBOUND, Upper dimension bounds of an array
  5964. * 'UCOBOUND': UCOBOUND, Upper codimension bounds of an array
  5965. * 'UMASK': UMASK, Set the file creation mask
  5966. * 'UNLINK': UNLINK, Remove a file from the file system
  5967. * 'UNPACK': UNPACK, Unpack an array of rank one into an array
  5968. * 'VERIFY': VERIFY, Scan a string for the absence of a set of characters
  5969. * 'XOR': XOR, Bitwise logical exclusive or
  5970. 
  5971. File: gfortran.info, Node: Introduction to Intrinsics, Next: ABORT, Up: Intrinsic Procedures
  5972. 9.1 Introduction to intrinsic procedures
  5973. ========================================
  5974. The intrinsic procedures provided by GNU Fortran include all of the
  5975. intrinsic procedures required by the Fortran 95 standard, a set of
  5976. intrinsic procedures for backwards compatibility with G77, and a
  5977. selection of intrinsic procedures from the Fortran 2003 and Fortran 2008
  5978. standards. Any conflict between a description here and a description in
  5979. either the Fortran 95 standard, the Fortran 2003 standard or the Fortran
  5980. 2008 standard is unintentional, and the standard(s) should be considered
  5981. authoritative.
  5982. The enumeration of the 'KIND' type parameter is processor defined in
  5983. the Fortran 95 standard. GNU Fortran defines the default integer type
  5984. and default real type by 'INTEGER(KIND=4)' and 'REAL(KIND=4)',
  5985. respectively. The standard mandates that both data types shall have
  5986. another kind, which have more precision. On typical target
  5987. architectures supported by 'gfortran', this kind type parameter is
  5988. 'KIND=8'. Hence, 'REAL(KIND=8)' and 'DOUBLE PRECISION' are equivalent.
  5989. In the description of generic intrinsic procedures, the kind type
  5990. parameter will be specified by 'KIND=*', and in the description of
  5991. specific names for an intrinsic procedure the kind type parameter will
  5992. be explicitly given (e.g., 'REAL(KIND=4)' or 'REAL(KIND=8)'). Finally,
  5993. for brevity the optional 'KIND=' syntax will be omitted.
  5994. Many of the intrinsic procedures take one or more optional arguments.
  5995. This document follows the convention used in the Fortran 95 standard,
  5996. and denotes such arguments by square brackets.
  5997. GNU Fortran offers the '-std=f95' and '-std=gnu' options, which can
  5998. be used to restrict the set of intrinsic procedures to a given standard.
  5999. By default, 'gfortran' sets the '-std=gnu' option, and so all intrinsic
  6000. procedures described here are accepted. There is one caveat. For a
  6001. select group of intrinsic procedures, 'g77' implemented both a function
  6002. and a subroutine. Both classes have been implemented in 'gfortran' for
  6003. backwards compatibility with 'g77'. It is noted here that these
  6004. functions and subroutines cannot be intermixed in a given subprogram.
  6005. In the descriptions that follow, the applicable standard for each
  6006. intrinsic procedure is noted.
  6007. 
  6008. File: gfortran.info, Node: ABORT, Next: ABS, Prev: Introduction to Intrinsics, Up: Intrinsic Procedures
  6009. 9.2 'ABORT' -- Abort the program
  6010. ================================
  6011. _Description_:
  6012. 'ABORT' causes immediate termination of the program. On operating
  6013. systems that support a core dump, 'ABORT' will produce a core dump.
  6014. It will also print a backtrace, unless '-fno-backtrace' is given.
  6015. _Standard_:
  6016. GNU extension
  6017. _Class_:
  6018. Subroutine
  6019. _Syntax_:
  6020. 'CALL ABORT'
  6021. _Return value_:
  6022. Does not return.
  6023. _Example_:
  6024. program test_abort
  6025. integer :: i = 1, j = 2
  6026. if (i /= j) call abort
  6027. end program test_abort
  6028. _See also_:
  6029. *note EXIT::, *note KILL::, *note BACKTRACE::
  6030. 
  6031. File: gfortran.info, Node: ABS, Next: ACCESS, Prev: ABORT, Up: Intrinsic Procedures
  6032. 9.3 'ABS' -- Absolute value
  6033. ===========================
  6034. _Description_:
  6035. 'ABS(A)' computes the absolute value of 'A'.
  6036. _Standard_:
  6037. Fortran 77 and later, has overloads that are GNU extensions
  6038. _Class_:
  6039. Elemental function
  6040. _Syntax_:
  6041. 'RESULT = ABS(A)'
  6042. _Arguments_:
  6043. A The type of the argument shall be an 'INTEGER',
  6044. 'REAL', or 'COMPLEX'.
  6045. _Return value_:
  6046. The return value is of the same type and kind as the argument
  6047. except the return value is 'REAL' for a 'COMPLEX' argument.
  6048. _Example_:
  6049. program test_abs
  6050. integer :: i = -1
  6051. real :: x = -1.e0
  6052. complex :: z = (-1.e0,0.e0)
  6053. i = abs(i)
  6054. x = abs(x)
  6055. x = abs(z)
  6056. end program test_abs
  6057. _Specific names_:
  6058. Name Argument Return type Standard
  6059. 'ABS(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and
  6060. later
  6061. 'CABS(A)' 'COMPLEX(4) 'REAL(4)' Fortran 77 and
  6062. A' later
  6063. 'DABS(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and
  6064. later
  6065. 'IABS(A)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and
  6066. A' later
  6067. 'BABS(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  6068. A'
  6069. 'IIABS(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  6070. A'
  6071. 'JIABS(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  6072. A'
  6073. 'KIABS(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  6074. A'
  6075. 'ZABS(A)' 'COMPLEX(8) 'REAL(8)' GNU extension
  6076. A'
  6077. 'CDABS(A)' 'COMPLEX(8) 'REAL(8)' GNU extension
  6078. A'
  6079. 
  6080. File: gfortran.info, Node: ACCESS, Next: ACHAR, Prev: ABS, Up: Intrinsic Procedures
  6081. 9.4 'ACCESS' -- Checks file access modes
  6082. ========================================
  6083. _Description_:
  6084. 'ACCESS(NAME, MODE)' checks whether the file NAME exists, is
  6085. readable, writable or executable. Except for the executable check,
  6086. 'ACCESS' can be replaced by Fortran 95's 'INQUIRE'.
  6087. _Standard_:
  6088. GNU extension
  6089. _Class_:
  6090. Inquiry function
  6091. _Syntax_:
  6092. 'RESULT = ACCESS(NAME, MODE)'
  6093. _Arguments_:
  6094. NAME Scalar 'CHARACTER' of default kind with the file
  6095. name. Tailing blank are ignored unless the
  6096. character 'achar(0)' is present, then all
  6097. characters up to and excluding 'achar(0)' are
  6098. used as file name.
  6099. MODE Scalar 'CHARACTER' of default kind with the file
  6100. access mode, may be any concatenation of '"r"'
  6101. (readable), '"w"' (writable) and '"x"'
  6102. (executable), or '" "' to check for existence.
  6103. _Return value_:
  6104. Returns a scalar 'INTEGER', which is '0' if the file is accessible
  6105. in the given mode; otherwise or if an invalid argument has been
  6106. given for 'MODE' the value '1' is returned.
  6107. _Example_:
  6108. program access_test
  6109. implicit none
  6110. character(len=*), parameter :: file = 'test.dat'
  6111. character(len=*), parameter :: file2 = 'test.dat '//achar(0)
  6112. if(access(file,' ') == 0) print *, trim(file),' is exists'
  6113. if(access(file,'r') == 0) print *, trim(file),' is readable'
  6114. if(access(file,'w') == 0) print *, trim(file),' is writable'
  6115. if(access(file,'x') == 0) print *, trim(file),' is executable'
  6116. if(access(file2,'rwx') == 0) &
  6117. print *, trim(file2),' is readable, writable and executable'
  6118. end program access_test
  6119. 
  6120. File: gfortran.info, Node: ACHAR, Next: ACOS, Prev: ACCESS, Up: Intrinsic Procedures
  6121. 9.5 'ACHAR' -- Character in ASCII collating sequence
  6122. ====================================================
  6123. _Description_:
  6124. 'ACHAR(I)' returns the character located at position 'I' in the
  6125. ASCII collating sequence.
  6126. _Standard_:
  6127. Fortran 77 and later, with KIND argument Fortran 2003 and later
  6128. _Class_:
  6129. Elemental function
  6130. _Syntax_:
  6131. 'RESULT = ACHAR(I [, KIND])'
  6132. _Arguments_:
  6133. I The type shall be 'INTEGER'.
  6134. KIND (Optional) An 'INTEGER' initialization
  6135. expression indicating the kind parameter of the
  6136. result.
  6137. _Return value_:
  6138. The return value is of type 'CHARACTER' with a length of one. If
  6139. the KIND argument is present, the return value is of the specified
  6140. kind and of the default kind otherwise.
  6141. _Example_:
  6142. program test_achar
  6143. character c
  6144. c = achar(32)
  6145. end program test_achar
  6146. _Note_:
  6147. See *note ICHAR:: for a discussion of converting between numerical
  6148. values and formatted string representations.
  6149. _See also_:
  6150. *note CHAR::, *note IACHAR::, *note ICHAR::
  6151. 
  6152. File: gfortran.info, Node: ACOS, Next: ACOSD, Prev: ACHAR, Up: Intrinsic Procedures
  6153. 9.6 'ACOS' -- Arccosine function
  6154. ================================
  6155. _Description_:
  6156. 'ACOS(X)' computes the arccosine of X (inverse of 'COS(X)').
  6157. _Standard_:
  6158. Fortran 77 and later, for a complex argument Fortran 2008 or later
  6159. _Class_:
  6160. Elemental function
  6161. _Syntax_:
  6162. 'RESULT = ACOS(X)'
  6163. _Arguments_:
  6164. X The type shall either be 'REAL' with a magnitude
  6165. that is less than or equal to one - or the type
  6166. shall be 'COMPLEX'.
  6167. _Return value_:
  6168. The return value is of the same type and kind as X. The real part
  6169. of the result is in radians and lies in the range 0 \leq \Re
  6170. \acos(x) \leq \pi.
  6171. _Example_:
  6172. program test_acos
  6173. real(8) :: x = 0.866_8
  6174. x = acos(x)
  6175. end program test_acos
  6176. _Specific names_:
  6177. Name Argument Return type Standard
  6178. 'ACOS(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  6179. later
  6180. 'DACOS(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  6181. later
  6182. _See also_:
  6183. Inverse function: *note COS:: Degrees function: *note ACOSD::
  6184. 
  6185. File: gfortran.info, Node: ACOSD, Next: ACOSH, Prev: ACOS, Up: Intrinsic Procedures
  6186. 9.7 'ACOSD' -- Arccosine function, degrees
  6187. ==========================================
  6188. _Description_:
  6189. 'ACOSD(X)' computes the arccosine of X in degrees (inverse of
  6190. 'COSD(X)').
  6191. This function is for compatibility only and should be avoided in
  6192. favor of standard constructs wherever possible.
  6193. _Standard_:
  6194. GNU extension, enabled with '-fdec-math'
  6195. _Class_:
  6196. Elemental function
  6197. _Syntax_:
  6198. 'RESULT = ACOSD(X)'
  6199. _Arguments_:
  6200. X The type shall either be 'REAL' with a magnitude
  6201. that is less than or equal to one - or the type
  6202. shall be 'COMPLEX'.
  6203. _Return value_:
  6204. The return value is of the same type and kind as X. The real part
  6205. of the result is in degrees and lies in the range 0 \leq \Re
  6206. \acos(x) \leq 180.
  6207. _Example_:
  6208. program test_acosd
  6209. real(8) :: x = 0.866_8
  6210. x = acosd(x)
  6211. end program test_acosd
  6212. _Specific names_:
  6213. Name Argument Return type Standard
  6214. 'ACOSD(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  6215. 'DACOSD(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  6216. _See also_:
  6217. Inverse function: *note COSD:: Radians function: *note ACOS::
  6218. 
  6219. File: gfortran.info, Node: ACOSH, Next: ADJUSTL, Prev: ACOSD, Up: Intrinsic Procedures
  6220. 9.8 'ACOSH' -- Inverse hyperbolic cosine function
  6221. =================================================
  6222. _Description_:
  6223. 'ACOSH(X)' computes the inverse hyperbolic cosine of X.
  6224. _Standard_:
  6225. Fortran 2008 and later
  6226. _Class_:
  6227. Elemental function
  6228. _Syntax_:
  6229. 'RESULT = ACOSH(X)'
  6230. _Arguments_:
  6231. X The type shall be 'REAL' or 'COMPLEX'.
  6232. _Return value_:
  6233. The return value has the same type and kind as X. If X is complex,
  6234. the imaginary part of the result is in radians and lies between 0
  6235. \leq \Im \acosh(x) \leq \pi.
  6236. _Example_:
  6237. PROGRAM test_acosh
  6238. REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /)
  6239. WRITE (*,*) ACOSH(x)
  6240. END PROGRAM
  6241. _Specific names_:
  6242. Name Argument Return type Standard
  6243. 'DACOSH(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  6244. _See also_:
  6245. Inverse function: *note COSH::
  6246. 
  6247. File: gfortran.info, Node: ADJUSTL, Next: ADJUSTR, Prev: ACOSH, Up: Intrinsic Procedures
  6248. 9.9 'ADJUSTL' -- Left adjust a string
  6249. =====================================
  6250. _Description_:
  6251. 'ADJUSTL(STRING)' will left adjust a string by removing leading
  6252. spaces. Spaces are inserted at the end of the string as needed.
  6253. _Standard_:
  6254. Fortran 90 and later
  6255. _Class_:
  6256. Elemental function
  6257. _Syntax_:
  6258. 'RESULT = ADJUSTL(STRING)'
  6259. _Arguments_:
  6260. STRING The type shall be 'CHARACTER'.
  6261. _Return value_:
  6262. The return value is of type 'CHARACTER' and of the same kind as
  6263. STRING where leading spaces are removed and the same number of
  6264. spaces are inserted on the end of STRING.
  6265. _Example_:
  6266. program test_adjustl
  6267. character(len=20) :: str = ' gfortran'
  6268. str = adjustl(str)
  6269. print *, str
  6270. end program test_adjustl
  6271. _See also_:
  6272. *note ADJUSTR::, *note TRIM::
  6273. 
  6274. File: gfortran.info, Node: ADJUSTR, Next: AIMAG, Prev: ADJUSTL, Up: Intrinsic Procedures
  6275. 9.10 'ADJUSTR' -- Right adjust a string
  6276. =======================================
  6277. _Description_:
  6278. 'ADJUSTR(STRING)' will right adjust a string by removing trailing
  6279. spaces. Spaces are inserted at the start of the string as needed.
  6280. _Standard_:
  6281. Fortran 90 and later
  6282. _Class_:
  6283. Elemental function
  6284. _Syntax_:
  6285. 'RESULT = ADJUSTR(STRING)'
  6286. _Arguments_:
  6287. STR The type shall be 'CHARACTER'.
  6288. _Return value_:
  6289. The return value is of type 'CHARACTER' and of the same kind as
  6290. STRING where trailing spaces are removed and the same number of
  6291. spaces are inserted at the start of STRING.
  6292. _Example_:
  6293. program test_adjustr
  6294. character(len=20) :: str = 'gfortran'
  6295. str = adjustr(str)
  6296. print *, str
  6297. end program test_adjustr
  6298. _See also_:
  6299. *note ADJUSTL::, *note TRIM::
  6300. 
  6301. File: gfortran.info, Node: AIMAG, Next: AINT, Prev: ADJUSTR, Up: Intrinsic Procedures
  6302. 9.11 'AIMAG' -- Imaginary part of complex number
  6303. ================================================
  6304. _Description_:
  6305. 'AIMAG(Z)' yields the imaginary part of complex argument 'Z'. The
  6306. 'IMAG(Z)' and 'IMAGPART(Z)' intrinsic functions are provided for
  6307. compatibility with 'g77', and their use in new code is strongly
  6308. discouraged.
  6309. _Standard_:
  6310. Fortran 77 and later, has overloads that are GNU extensions
  6311. _Class_:
  6312. Elemental function
  6313. _Syntax_:
  6314. 'RESULT = AIMAG(Z)'
  6315. _Arguments_:
  6316. Z The type of the argument shall be 'COMPLEX'.
  6317. _Return value_:
  6318. The return value is of type 'REAL' with the kind type parameter of
  6319. the argument.
  6320. _Example_:
  6321. program test_aimag
  6322. complex(4) z4
  6323. complex(8) z8
  6324. z4 = cmplx(1.e0_4, 0.e0_4)
  6325. z8 = cmplx(0.e0_8, 1.e0_8)
  6326. print *, aimag(z4), dimag(z8)
  6327. end program test_aimag
  6328. _Specific names_:
  6329. Name Argument Return type Standard
  6330. 'AIMAG(Z)' 'COMPLEX Z' 'REAL' Fortran 77 and
  6331. later
  6332. 'DIMAG(Z)' 'COMPLEX(8) 'REAL(8)' GNU extension
  6333. Z'
  6334. 'IMAG(Z)' 'COMPLEX Z' 'REAL' GNU extension
  6335. 'IMAGPART(Z)' 'COMPLEX Z' 'REAL' GNU extension
  6336. 
  6337. File: gfortran.info, Node: AINT, Next: ALARM, Prev: AIMAG, Up: Intrinsic Procedures
  6338. 9.12 'AINT' -- Truncate to a whole number
  6339. =========================================
  6340. _Description_:
  6341. 'AINT(A [, KIND])' truncates its argument to a whole number.
  6342. _Standard_:
  6343. Fortran 77 and later
  6344. _Class_:
  6345. Elemental function
  6346. _Syntax_:
  6347. 'RESULT = AINT(A [, KIND])'
  6348. _Arguments_:
  6349. A The type of the argument shall be 'REAL'.
  6350. KIND (Optional) An 'INTEGER' initialization
  6351. expression indicating the kind parameter of the
  6352. result.
  6353. _Return value_:
  6354. The return value is of type 'REAL' with the kind type parameter of
  6355. the argument if the optional KIND is absent; otherwise, the kind
  6356. type parameter will be given by KIND. If the magnitude of X is
  6357. less than one, 'AINT(X)' returns zero. If the magnitude is equal
  6358. to or greater than one then it returns the largest whole number
  6359. that does not exceed its magnitude. The sign is the same as the
  6360. sign of X.
  6361. _Example_:
  6362. program test_aint
  6363. real(4) x4
  6364. real(8) x8
  6365. x4 = 1.234E0_4
  6366. x8 = 4.321_8
  6367. print *, aint(x4), dint(x8)
  6368. x8 = aint(x4,8)
  6369. end program test_aint
  6370. _Specific names_:
  6371. Name Argument Return type Standard
  6372. 'AINT(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and
  6373. later
  6374. 'DINT(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and
  6375. later
  6376. 
  6377. File: gfortran.info, Node: ALARM, Next: ALL, Prev: AINT, Up: Intrinsic Procedures
  6378. 9.13 'ALARM' -- Execute a routine after a given delay
  6379. =====================================================
  6380. _Description_:
  6381. 'ALARM(SECONDS, HANDLER [, STATUS])' causes external subroutine
  6382. HANDLER to be executed after a delay of SECONDS by using 'alarm(2)'
  6383. to set up a signal and 'signal(2)' to catch it. If STATUS is
  6384. supplied, it will be returned with the number of seconds remaining
  6385. until any previously scheduled alarm was due to be delivered, or
  6386. zero if there was no previously scheduled alarm.
  6387. _Standard_:
  6388. GNU extension
  6389. _Class_:
  6390. Subroutine
  6391. _Syntax_:
  6392. 'CALL ALARM(SECONDS, HANDLER [, STATUS])'
  6393. _Arguments_:
  6394. SECONDS The type of the argument shall be a scalar
  6395. 'INTEGER'. It is 'INTENT(IN)'.
  6396. HANDLER Signal handler ('INTEGER FUNCTION' or
  6397. 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
  6398. The scalar values may be either 'SIG_IGN=1' to
  6399. ignore the alarm generated or 'SIG_DFL=0' to set
  6400. the default action. It is 'INTENT(IN)'.
  6401. STATUS (Optional) STATUS shall be a scalar variable of
  6402. the default 'INTEGER' kind. It is
  6403. 'INTENT(OUT)'.
  6404. _Example_:
  6405. program test_alarm
  6406. external handler_print
  6407. integer i
  6408. call alarm (3, handler_print, i)
  6409. print *, i
  6410. call sleep(10)
  6411. end program test_alarm
  6412. This will cause the external routine HANDLER_PRINT to be called
  6413. after 3 seconds.
  6414. 
  6415. File: gfortran.info, Node: ALL, Next: ALLOCATED, Prev: ALARM, Up: Intrinsic Procedures
  6416. 9.14 'ALL' -- All values in MASK along DIM are true
  6417. ===================================================
  6418. _Description_:
  6419. 'ALL(MASK [, DIM])' determines if all the values are true in MASK
  6420. in the array along dimension DIM.
  6421. _Standard_:
  6422. Fortran 90 and later
  6423. _Class_:
  6424. Transformational function
  6425. _Syntax_:
  6426. 'RESULT = ALL(MASK [, DIM])'
  6427. _Arguments_:
  6428. MASK The type of the argument shall be 'LOGICAL' and
  6429. it shall not be scalar.
  6430. DIM (Optional) DIM shall be a scalar integer with a
  6431. value that lies between one and the rank of
  6432. MASK.
  6433. _Return value_:
  6434. 'ALL(MASK)' returns a scalar value of type 'LOGICAL' where the kind
  6435. type parameter is the same as the kind type parameter of MASK. If
  6436. DIM is present, then 'ALL(MASK, DIM)' returns an array with the
  6437. rank of MASK minus 1. The shape is determined from the shape of
  6438. MASK where the DIM dimension is elided.
  6439. (A)
  6440. 'ALL(MASK)' is true if all elements of MASK are true. It also
  6441. is true if MASK has zero size; otherwise, it is false.
  6442. (B)
  6443. If the rank of MASK is one, then 'ALL(MASK,DIM)' is equivalent
  6444. to 'ALL(MASK)'. If the rank is greater than one, then
  6445. 'ALL(MASK,DIM)' is determined by applying 'ALL' to the array
  6446. sections.
  6447. _Example_:
  6448. program test_all
  6449. logical l
  6450. l = all((/.true., .true., .true./))
  6451. print *, l
  6452. call section
  6453. contains
  6454. subroutine section
  6455. integer a(2,3), b(2,3)
  6456. a = 1
  6457. b = 1
  6458. b(2,2) = 2
  6459. print *, all(a .eq. b, 1)
  6460. print *, all(a .eq. b, 2)
  6461. end subroutine section
  6462. end program test_all
  6463. 
  6464. File: gfortran.info, Node: ALLOCATED, Next: AND, Prev: ALL, Up: Intrinsic Procedures
  6465. 9.15 'ALLOCATED' -- Status of an allocatable entity
  6466. ===================================================
  6467. _Description_:
  6468. 'ALLOCATED(ARRAY)' and 'ALLOCATED(SCALAR)' check the allocation
  6469. status of ARRAY and SCALAR, respectively.
  6470. _Standard_:
  6471. Fortran 90 and later. Note, the 'SCALAR=' keyword and allocatable
  6472. scalar entities are available in Fortran 2003 and later.
  6473. _Class_:
  6474. Inquiry function
  6475. _Syntax_:
  6476. 'RESULT = ALLOCATED(ARRAY)'
  6477. 'RESULT = ALLOCATED(SCALAR)'
  6478. _Arguments_:
  6479. ARRAY The argument shall be an 'ALLOCATABLE' array.
  6480. SCALAR The argument shall be an 'ALLOCATABLE' scalar.
  6481. _Return value_:
  6482. The return value is a scalar 'LOGICAL' with the default logical
  6483. kind type parameter. If the argument is allocated, then the result
  6484. is '.TRUE.'; otherwise, it returns '.FALSE.'
  6485. _Example_:
  6486. program test_allocated
  6487. integer :: i = 4
  6488. real(4), allocatable :: x(:)
  6489. if (.not. allocated(x)) allocate(x(i))
  6490. end program test_allocated
  6491. 
  6492. File: gfortran.info, Node: AND, Next: ANINT, Prev: ALLOCATED, Up: Intrinsic Procedures
  6493. 9.16 'AND' -- Bitwise logical AND
  6494. =================================
  6495. _Description_:
  6496. Bitwise logical 'AND'.
  6497. This intrinsic routine is provided for backwards compatibility with
  6498. GNU Fortran 77. For integer arguments, programmers should consider
  6499. the use of the *note IAND:: intrinsic defined by the Fortran
  6500. standard.
  6501. _Standard_:
  6502. GNU extension
  6503. _Class_:
  6504. Function
  6505. _Syntax_:
  6506. 'RESULT = AND(I, J)'
  6507. _Arguments_:
  6508. I The type shall be either a scalar 'INTEGER' type
  6509. or a scalar 'LOGICAL' type or a
  6510. boz-literal-constant.
  6511. J The type shall be the same as the type of I or a
  6512. boz-literal-constant. I and J shall not both be
  6513. boz-literal-constants. If either I or J is a
  6514. boz-literal-constant, then the other argument
  6515. must be a scalar 'INTEGER'.
  6516. _Return value_:
  6517. The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
  6518. If the kind type parameters differ, then the smaller kind type is
  6519. implicitly converted to larger kind, and the return has the larger
  6520. kind. A boz-literal-constant is converted to an 'INTEGER' with the
  6521. kind type parameter of the other argument as-if a call to *note
  6522. INT:: occurred.
  6523. _Example_:
  6524. PROGRAM test_and
  6525. LOGICAL :: T = .TRUE., F = .FALSE.
  6526. INTEGER :: a, b
  6527. DATA a / Z'F' /, b / Z'3' /
  6528. WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
  6529. WRITE (*,*) AND(a, b)
  6530. END PROGRAM
  6531. _See also_:
  6532. Fortran 95 elemental function: *note IAND::
  6533. 
  6534. File: gfortran.info, Node: ANINT, Next: ANY, Prev: AND, Up: Intrinsic Procedures
  6535. 9.17 'ANINT' -- Nearest whole number
  6536. ====================================
  6537. _Description_:
  6538. 'ANINT(A [, KIND])' rounds its argument to the nearest whole
  6539. number.
  6540. _Standard_:
  6541. Fortran 77 and later
  6542. _Class_:
  6543. Elemental function
  6544. _Syntax_:
  6545. 'RESULT = ANINT(A [, KIND])'
  6546. _Arguments_:
  6547. A The type of the argument shall be 'REAL'.
  6548. KIND (Optional) An 'INTEGER' initialization
  6549. expression indicating the kind parameter of the
  6550. result.
  6551. _Return value_:
  6552. The return value is of type real with the kind type parameter of
  6553. the argument if the optional KIND is absent; otherwise, the kind
  6554. type parameter will be given by KIND. If A is greater than zero,
  6555. 'ANINT(A)' returns 'AINT(X+0.5)'. If A is less than or equal to
  6556. zero then it returns 'AINT(X-0.5)'.
  6557. _Example_:
  6558. program test_anint
  6559. real(4) x4
  6560. real(8) x8
  6561. x4 = 1.234E0_4
  6562. x8 = 4.321_8
  6563. print *, anint(x4), dnint(x8)
  6564. x8 = anint(x4,8)
  6565. end program test_anint
  6566. _Specific names_:
  6567. Name Argument Return type Standard
  6568. 'AINT(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and
  6569. later
  6570. 'DNINT(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and
  6571. later
  6572. 
  6573. File: gfortran.info, Node: ANY, Next: ASIN, Prev: ANINT, Up: Intrinsic Procedures
  6574. 9.18 'ANY' -- Any value in MASK along DIM is true
  6575. =================================================
  6576. _Description_:
  6577. 'ANY(MASK [, DIM])' determines if any of the values in the logical
  6578. array MASK along dimension DIM are '.TRUE.'.
  6579. _Standard_:
  6580. Fortran 90 and later
  6581. _Class_:
  6582. Transformational function
  6583. _Syntax_:
  6584. 'RESULT = ANY(MASK [, DIM])'
  6585. _Arguments_:
  6586. MASK The type of the argument shall be 'LOGICAL' and
  6587. it shall not be scalar.
  6588. DIM (Optional) DIM shall be a scalar integer with a
  6589. value that lies between one and the rank of
  6590. MASK.
  6591. _Return value_:
  6592. 'ANY(MASK)' returns a scalar value of type 'LOGICAL' where the kind
  6593. type parameter is the same as the kind type parameter of MASK. If
  6594. DIM is present, then 'ANY(MASK, DIM)' returns an array with the
  6595. rank of MASK minus 1. The shape is determined from the shape of
  6596. MASK where the DIM dimension is elided.
  6597. (A)
  6598. 'ANY(MASK)' is true if any element of MASK is true; otherwise,
  6599. it is false. It also is false if MASK has zero size.
  6600. (B)
  6601. If the rank of MASK is one, then 'ANY(MASK,DIM)' is equivalent
  6602. to 'ANY(MASK)'. If the rank is greater than one, then
  6603. 'ANY(MASK,DIM)' is determined by applying 'ANY' to the array
  6604. sections.
  6605. _Example_:
  6606. program test_any
  6607. logical l
  6608. l = any((/.true., .true., .true./))
  6609. print *, l
  6610. call section
  6611. contains
  6612. subroutine section
  6613. integer a(2,3), b(2,3)
  6614. a = 1
  6615. b = 1
  6616. b(2,2) = 2
  6617. print *, any(a .eq. b, 1)
  6618. print *, any(a .eq. b, 2)
  6619. end subroutine section
  6620. end program test_any
  6621. 
  6622. File: gfortran.info, Node: ASIN, Next: ASIND, Prev: ANY, Up: Intrinsic Procedures
  6623. 9.19 'ASIN' -- Arcsine function
  6624. ===============================
  6625. _Description_:
  6626. 'ASIN(X)' computes the arcsine of its X (inverse of 'SIN(X)').
  6627. _Standard_:
  6628. Fortran 77 and later, for a complex argument Fortran 2008 or later
  6629. _Class_:
  6630. Elemental function
  6631. _Syntax_:
  6632. 'RESULT = ASIN(X)'
  6633. _Arguments_:
  6634. X The type shall be either 'REAL' and a magnitude
  6635. that is less than or equal to one - or be
  6636. 'COMPLEX'.
  6637. _Return value_:
  6638. The return value is of the same type and kind as X. The real part
  6639. of the result is in radians and lies in the range -\pi/2 \leq \Re
  6640. \asin(x) \leq \pi/2.
  6641. _Example_:
  6642. program test_asin
  6643. real(8) :: x = 0.866_8
  6644. x = asin(x)
  6645. end program test_asin
  6646. _Specific names_:
  6647. Name Argument Return type Standard
  6648. 'ASIN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  6649. later
  6650. 'DASIN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  6651. later
  6652. _See also_:
  6653. Inverse function: *note SIN:: Degrees function: *note ASIND::
  6654. 
  6655. File: gfortran.info, Node: ASIND, Next: ASINH, Prev: ASIN, Up: Intrinsic Procedures
  6656. 9.20 'ASIND' -- Arcsine function, degrees
  6657. =========================================
  6658. _Description_:
  6659. 'ASIND(X)' computes the arcsine of its X in degrees (inverse of
  6660. 'SIND(X)').
  6661. This function is for compatibility only and should be avoided in
  6662. favor of standard constructs wherever possible.
  6663. _Standard_:
  6664. GNU extension, enabled with '-fdec-math'.
  6665. _Class_:
  6666. Elemental function
  6667. _Syntax_:
  6668. 'RESULT = ASIND(X)'
  6669. _Arguments_:
  6670. X The type shall be either 'REAL' and a magnitude
  6671. that is less than or equal to one - or be
  6672. 'COMPLEX'.
  6673. _Return value_:
  6674. The return value is of the same type and kind as X. The real part
  6675. of the result is in degrees and lies in the range -90 \leq \Re
  6676. \asin(x) \leq 90.
  6677. _Example_:
  6678. program test_asind
  6679. real(8) :: x = 0.866_8
  6680. x = asind(x)
  6681. end program test_asind
  6682. _Specific names_:
  6683. Name Argument Return type Standard
  6684. 'ASIND(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  6685. 'DASIND(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  6686. _See also_:
  6687. Inverse function: *note SIND:: Radians function: *note ASIN::
  6688. 
  6689. File: gfortran.info, Node: ASINH, Next: ASSOCIATED, Prev: ASIND, Up: Intrinsic Procedures
  6690. 9.21 'ASINH' -- Inverse hyperbolic sine function
  6691. ================================================
  6692. _Description_:
  6693. 'ASINH(X)' computes the inverse hyperbolic sine of X.
  6694. _Standard_:
  6695. Fortran 2008 and later
  6696. _Class_:
  6697. Elemental function
  6698. _Syntax_:
  6699. 'RESULT = ASINH(X)'
  6700. _Arguments_:
  6701. X The type shall be 'REAL' or 'COMPLEX'.
  6702. _Return value_:
  6703. The return value is of the same type and kind as X. If X is
  6704. complex, the imaginary part of the result is in radians and lies
  6705. between -\pi/2 \leq \Im \asinh(x) \leq \pi/2.
  6706. _Example_:
  6707. PROGRAM test_asinh
  6708. REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
  6709. WRITE (*,*) ASINH(x)
  6710. END PROGRAM
  6711. _Specific names_:
  6712. Name Argument Return type Standard
  6713. 'DASINH(X)' 'REAL(8) X' 'REAL(8)' GNU extension.
  6714. _See also_:
  6715. Inverse function: *note SINH::
  6716. 
  6717. File: gfortran.info, Node: ASSOCIATED, Next: ATAN, Prev: ASINH, Up: Intrinsic Procedures
  6718. 9.22 'ASSOCIATED' -- Status of a pointer or pointer/target pair
  6719. ===============================================================
  6720. _Description_:
  6721. 'ASSOCIATED(POINTER [, TARGET])' determines the status of the
  6722. pointer POINTER or if POINTER is associated with the target TARGET.
  6723. _Standard_:
  6724. Fortran 90 and later
  6725. _Class_:
  6726. Inquiry function
  6727. _Syntax_:
  6728. 'RESULT = ASSOCIATED(POINTER [, TARGET])'
  6729. _Arguments_:
  6730. POINTER POINTER shall have the 'POINTER' attribute and
  6731. it can be of any type.
  6732. TARGET (Optional) TARGET shall be a pointer or a
  6733. target. It must have the same type, kind type
  6734. parameter, and array rank as POINTER.
  6735. The association status of neither POINTER nor TARGET shall be
  6736. undefined.
  6737. _Return value_:
  6738. 'ASSOCIATED(POINTER)' returns a scalar value of type 'LOGICAL(4)'.
  6739. There are several cases:
  6740. (A) When the optional TARGET is not present then
  6741. 'ASSOCIATED(POINTER)' is true if POINTER is associated with a
  6742. target; otherwise, it returns false.
  6743. (B) If TARGET is present and a scalar target, the result is true if
  6744. TARGET is not a zero-sized storage sequence and the target
  6745. associated with POINTER occupies the same storage units. If
  6746. POINTER is disassociated, the result is false.
  6747. (C) If TARGET is present and an array target, the result is true if
  6748. TARGET and POINTER have the same shape, are not zero-sized
  6749. arrays, are arrays whose elements are not zero-sized storage
  6750. sequences, and TARGET and POINTER occupy the same storage
  6751. units in array element order. As in case(B), the result is
  6752. false, if POINTER is disassociated.
  6753. (D) If TARGET is present and an scalar pointer, the result is true
  6754. if TARGET is associated with POINTER, the target associated
  6755. with TARGET are not zero-sized storage sequences and occupy
  6756. the same storage units. The result is false, if either TARGET
  6757. or POINTER is disassociated.
  6758. (E) If TARGET is present and an array pointer, the result is true if
  6759. target associated with POINTER and the target associated with
  6760. TARGET have the same shape, are not zero-sized arrays, are
  6761. arrays whose elements are not zero-sized storage sequences,
  6762. and TARGET and POINTER occupy the same storage units in array
  6763. element order. The result is false, if either TARGET or
  6764. POINTER is disassociated.
  6765. _Example_:
  6766. program test_associated
  6767. implicit none
  6768. real, target :: tgt(2) = (/1., 2./)
  6769. real, pointer :: ptr(:)
  6770. ptr => tgt
  6771. if (associated(ptr) .eqv. .false.) call abort
  6772. if (associated(ptr,tgt) .eqv. .false.) call abort
  6773. end program test_associated
  6774. _See also_:
  6775. *note NULL::
  6776. 
  6777. File: gfortran.info, Node: ATAN, Next: ATAND, Prev: ASSOCIATED, Up: Intrinsic Procedures
  6778. 9.23 'ATAN' -- Arctangent function
  6779. ==================================
  6780. _Description_:
  6781. 'ATAN(X)' computes the arctangent of X.
  6782. _Standard_:
  6783. Fortran 77 and later, for a complex argument and for two arguments
  6784. Fortran 2008 or later
  6785. _Class_:
  6786. Elemental function
  6787. _Syntax_:
  6788. 'RESULT = ATAN(X)'
  6789. 'RESULT = ATAN(Y, X)'
  6790. _Arguments_:
  6791. X The type shall be 'REAL' or 'COMPLEX'; if Y is
  6792. present, X shall be REAL.
  6793. Y The type and kind type parameter shall be the
  6794. same as X.
  6795. _Return value_:
  6796. The return value is of the same type and kind as X. If Y is
  6797. present, the result is identical to 'ATAN2(Y,X)'. Otherwise, it
  6798. the arcus tangent of X, where the real part of the result is in
  6799. radians and lies in the range -\pi/2 \leq \Re \atan(x) \leq \pi/2.
  6800. _Example_:
  6801. program test_atan
  6802. real(8) :: x = 2.866_8
  6803. x = atan(x)
  6804. end program test_atan
  6805. _Specific names_:
  6806. Name Argument Return type Standard
  6807. 'ATAN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  6808. later
  6809. 'DATAN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  6810. later
  6811. _See also_:
  6812. Inverse function: *note TAN:: Degrees function: *note ATAND::
  6813. 
  6814. File: gfortran.info, Node: ATAND, Next: ATAN2, Prev: ATAN, Up: Intrinsic Procedures
  6815. 9.24 'ATAND' -- Arctangent function, degrees
  6816. ============================================
  6817. _Description_:
  6818. 'ATAND(X)' computes the arctangent of X in degrees (inverse of
  6819. *note TAND::).
  6820. This function is for compatibility only and should be avoided in
  6821. favor of standard constructs wherever possible.
  6822. _Standard_:
  6823. GNU extension, enabled with '-fdec-math'.
  6824. _Class_:
  6825. Elemental function
  6826. _Syntax_:
  6827. 'RESULT = ATAND(X)'
  6828. 'RESULT = ATAND(Y, X)'
  6829. _Arguments_:
  6830. X The type shall be 'REAL' or 'COMPLEX'; if Y is
  6831. present, X shall be REAL.
  6832. Y The type and kind type parameter shall be the
  6833. same as X.
  6834. _Return value_:
  6835. The return value is of the same type and kind as X. If Y is
  6836. present, the result is identical to 'ATAND2(Y,X)'. Otherwise, it
  6837. is the arcus tangent of X, where the real part of the result is in
  6838. degrees and lies in the range -90 \leq \Re \atand(x) \leq 90.
  6839. _Example_:
  6840. program test_atand
  6841. real(8) :: x = 2.866_8
  6842. x = atand(x)
  6843. end program test_atand
  6844. _Specific names_:
  6845. Name Argument Return type Standard
  6846. 'ATAND(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  6847. 'DATAND(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  6848. _See also_:
  6849. Inverse function: *note TAND:: Radians function: *note ATAN::
  6850. 
  6851. File: gfortran.info, Node: ATAN2, Next: ATAN2D, Prev: ATAND, Up: Intrinsic Procedures
  6852. 9.25 'ATAN2' -- Arctangent function
  6853. ===================================
  6854. _Description_:
  6855. 'ATAN2(Y, X)' computes the principal value of the argument function
  6856. of the complex number X + i Y. This function can be used to
  6857. transform from Cartesian into polar coordinates and allows to
  6858. determine the angle in the correct quadrant.
  6859. _Standard_:
  6860. Fortran 77 and later
  6861. _Class_:
  6862. Elemental function
  6863. _Syntax_:
  6864. 'RESULT = ATAN2(Y, X)'
  6865. _Arguments_:
  6866. Y The type shall be 'REAL'.
  6867. X The type and kind type parameter shall be the
  6868. same as Y. If Y is zero, then X must be
  6869. nonzero.
  6870. _Return value_:
  6871. The return value has the same type and kind type parameter as Y.
  6872. It is the principal value of the complex number X + i Y. If X is
  6873. nonzero, then it lies in the range -\pi \le \atan (x) \leq \pi.
  6874. The sign is positive if Y is positive. If Y is zero, then the
  6875. return value is zero if X is strictly positive, \pi if X is
  6876. negative and Y is positive zero (or the processor does not handle
  6877. signed zeros), and -\pi if X is negative and Y is negative zero.
  6878. Finally, if X is zero, then the magnitude of the result is \pi/2.
  6879. _Example_:
  6880. program test_atan2
  6881. real(4) :: x = 1.e0_4, y = 0.5e0_4
  6882. x = atan2(y,x)
  6883. end program test_atan2
  6884. _Specific names_:
  6885. Name Argument Return type Standard
  6886. 'ATAN2(X, 'REAL(4) X, 'REAL(4)' Fortran 77 and
  6887. Y)' Y' later
  6888. 'DATAN2(X, 'REAL(8) X, 'REAL(8)' Fortran 77 and
  6889. Y)' Y' later
  6890. _See also_:
  6891. Alias: *note ATAN:: Degrees function: *note ATAN2D::
  6892. 
  6893. File: gfortran.info, Node: ATAN2D, Next: ATANH, Prev: ATAN2, Up: Intrinsic Procedures
  6894. 9.26 'ATAN2D' -- Arctangent function, degrees
  6895. =============================================
  6896. _Description_:
  6897. 'ATAN2D(Y, X)' computes the principal value of the argument
  6898. function of the complex number X + i Y in degrees. This function
  6899. can be used to transform from Cartesian into polar coordinates and
  6900. allows to determine the angle in the correct quadrant.
  6901. This function is for compatibility only and should be avoided in
  6902. favor of standard constructs wherever possible.
  6903. _Standard_:
  6904. GNU extension, enabled with '-fdec-math'.
  6905. _Class_:
  6906. Elemental function
  6907. _Syntax_:
  6908. 'RESULT = ATAN2D(Y, X)'
  6909. _Arguments_:
  6910. Y The type shall be 'REAL'.
  6911. X The type and kind type parameter shall be the
  6912. same as Y. If Y is zero, then X must be
  6913. nonzero.
  6914. _Return value_:
  6915. The return value has the same type and kind type parameter as Y.
  6916. It is the principal value of the complex number X + i Y. If X is
  6917. nonzero, then it lies in the range -180 \le \atan (x) \leq 180.
  6918. The sign is positive if Y is positive. If Y is zero, then the
  6919. return value is zero if X is strictly positive, 180 if X is
  6920. negative and Y is positive zero (or the processor does not handle
  6921. signed zeros), and -180 if X is negative and Y is negative zero.
  6922. Finally, if X is zero, then the magnitude of the result is 90.
  6923. _Example_:
  6924. program test_atan2d
  6925. real(4) :: x = 1.e0_4, y = 0.5e0_4
  6926. x = atan2d(y,x)
  6927. end program test_atan2d
  6928. _Specific names_:
  6929. Name Argument Return type Standard
  6930. 'ATAN2D(X, 'REAL(4) X, 'REAL(4)' GNU extension
  6931. Y)' Y'
  6932. 'DATAN2D(X, 'REAL(8) X, 'REAL(8)' GNU extension
  6933. Y)' Y'
  6934. _See also_:
  6935. Alias: *note ATAND:: Radians function: *note ATAN2::
  6936. 
  6937. File: gfortran.info, Node: ATANH, Next: ATOMIC_ADD, Prev: ATAN2D, Up: Intrinsic Procedures
  6938. 9.27 'ATANH' -- Inverse hyperbolic tangent function
  6939. ===================================================
  6940. _Description_:
  6941. 'ATANH(X)' computes the inverse hyperbolic tangent of X.
  6942. _Standard_:
  6943. Fortran 2008 and later
  6944. _Class_:
  6945. Elemental function
  6946. _Syntax_:
  6947. 'RESULT = ATANH(X)'
  6948. _Arguments_:
  6949. X The type shall be 'REAL' or 'COMPLEX'.
  6950. _Return value_:
  6951. The return value has same type and kind as X. If X is complex, the
  6952. imaginary part of the result is in radians and lies between -\pi/2
  6953. \leq \Im \atanh(x) \leq \pi/2.
  6954. _Example_:
  6955. PROGRAM test_atanh
  6956. REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
  6957. WRITE (*,*) ATANH(x)
  6958. END PROGRAM
  6959. _Specific names_:
  6960. Name Argument Return type Standard
  6961. 'DATANH(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  6962. _See also_:
  6963. Inverse function: *note TANH::
  6964. 
  6965. File: gfortran.info, Node: ATOMIC_ADD, Next: ATOMIC_AND, Prev: ATANH, Up: Intrinsic Procedures
  6966. 9.28 'ATOMIC_ADD' -- Atomic ADD operation
  6967. =========================================
  6968. _Description_:
  6969. 'ATOMIC_ADD(ATOM, VALUE)' atomically adds the value of VAR to the
  6970. variable ATOM. When STAT is present and the invocation was
  6971. successful, it is assigned the value 0. If it is present and the
  6972. invocation has failed, it is assigned a positive value; in
  6973. particular, for a coindexed ATOM, if the remote image has stopped,
  6974. it is assigned the value of 'ISO_FORTRAN_ENV''s
  6975. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6976. 'STAT_FAILED_IMAGE'.
  6977. _Standard_:
  6978. TS 18508 or later
  6979. _Class_:
  6980. Atomic subroutine
  6981. _Syntax_:
  6982. 'CALL ATOMIC_ADD (ATOM, VALUE [, STAT])'
  6983. _Arguments_:
  6984. ATOM Scalar coarray or coindexed variable of integer
  6985. type with 'ATOMIC_INT_KIND' kind.
  6986. VALUE Scalar of the same type as ATOM. If the kind is
  6987. different, the value is converted to the kind of
  6988. ATOM.
  6989. STAT (optional) Scalar default-kind integer variable.
  6990. _Example_:
  6991. program atomic
  6992. use iso_fortran_env
  6993. integer(atomic_int_kind) :: atom[*]
  6994. call atomic_add (atom[1], this_image())
  6995. end program atomic
  6996. _See also_:
  6997. *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_ADD::, *note
  6998. ISO_FORTRAN_ENV::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
  6999. ATOMIC_XOR::
  7000. 
  7001. File: gfortran.info, Node: ATOMIC_AND, Next: ATOMIC_CAS, Prev: ATOMIC_ADD, Up: Intrinsic Procedures
  7002. 9.29 'ATOMIC_AND' -- Atomic bitwise AND operation
  7003. =================================================
  7004. _Description_:
  7005. 'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
  7006. AND between the values of ATOM and VALUE. When STAT is present and
  7007. the invocation was successful, it is assigned the value 0. If it
  7008. is present and the invocation has failed, it is assigned a positive
  7009. value; in particular, for a coindexed ATOM, if the remote image has
  7010. stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
  7011. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  7012. 'STAT_FAILED_IMAGE'.
  7013. _Standard_:
  7014. TS 18508 or later
  7015. _Class_:
  7016. Atomic subroutine
  7017. _Syntax_:
  7018. 'CALL ATOMIC_AND (ATOM, VALUE [, STAT])'
  7019. _Arguments_:
  7020. ATOM Scalar coarray or coindexed variable of integer
  7021. type with 'ATOMIC_INT_KIND' kind.
  7022. VALUE Scalar of the same type as ATOM. If the kind is
  7023. different, the value is converted to the kind of
  7024. ATOM.
  7025. STAT (optional) Scalar default-kind integer variable.
  7026. _Example_:
  7027. program atomic
  7028. use iso_fortran_env
  7029. integer(atomic_int_kind) :: atom[*]
  7030. call atomic_and (atom[1], int(b'10100011101'))
  7031. end program atomic
  7032. _See also_:
  7033. *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_AND::, *note
  7034. ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
  7035. ATOMIC_XOR::
  7036. 
  7037. File: gfortran.info, Node: ATOMIC_CAS, Next: ATOMIC_DEFINE, Prev: ATOMIC_AND, Up: Intrinsic Procedures
  7038. 9.30 'ATOMIC_CAS' -- Atomic compare and swap
  7039. ============================================
  7040. _Description_:
  7041. 'ATOMIC_CAS' compares the variable ATOM with the value of COMPARE;
  7042. if the value is the same, ATOM is set to the value of NEW.
  7043. Additionally, OLD is set to the value of ATOM that was used for the
  7044. comparison. When STAT is present and the invocation was
  7045. successful, it is assigned the value 0. If it is present and the
  7046. invocation has failed, it is assigned a positive value; in
  7047. particular, for a coindexed ATOM, if the remote image has stopped,
  7048. it is assigned the value of 'ISO_FORTRAN_ENV''s
  7049. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  7050. 'STAT_FAILED_IMAGE'.
  7051. _Standard_:
  7052. TS 18508 or later
  7053. _Class_:
  7054. Atomic subroutine
  7055. _Syntax_:
  7056. 'CALL ATOMIC_CAS (ATOM, OLD, COMPARE, NEW [, STAT])'
  7057. _Arguments_:
  7058. ATOM Scalar coarray or coindexed variable of either
  7059. integer type with 'ATOMIC_INT_KIND' kind or
  7060. logical type with 'ATOMIC_LOGICAL_KIND' kind.
  7061. OLD Scalar of the same type and kind as ATOM.
  7062. COMPARE Scalar variable of the same type and kind as
  7063. ATOM.
  7064. NEW Scalar variable of the same type as ATOM. If
  7065. kind is different, the value is converted to the
  7066. kind of ATOM.
  7067. STAT (optional) Scalar default-kind integer variable.
  7068. _Example_:
  7069. program atomic
  7070. use iso_fortran_env
  7071. logical(atomic_logical_kind) :: atom[*], prev
  7072. call atomic_cas (atom[1], prev, .false., .true.))
  7073. end program atomic
  7074. _See also_:
  7075. *note ATOMIC_DEFINE::, *note ATOMIC_REF::, *note ISO_FORTRAN_ENV::
  7076. 
  7077. File: gfortran.info, Node: ATOMIC_DEFINE, Next: ATOMIC_FETCH_ADD, Prev: ATOMIC_CAS, Up: Intrinsic Procedures
  7078. 9.31 'ATOMIC_DEFINE' -- Setting a variable atomically
  7079. =====================================================
  7080. _Description_:
  7081. 'ATOMIC_DEFINE(ATOM, VALUE)' defines the variable ATOM with the
  7082. value VALUE atomically. When STAT is present and the invocation
  7083. was successful, it is assigned the value 0. If it is present and
  7084. the invocation has failed, it is assigned a positive value; in
  7085. particular, for a coindexed ATOM, if the remote image has stopped,
  7086. it is assigned the value of 'ISO_FORTRAN_ENV''s
  7087. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  7088. 'STAT_FAILED_IMAGE'.
  7089. _Standard_:
  7090. Fortran 2008 and later; with STAT, TS 18508 or later
  7091. _Class_:
  7092. Atomic subroutine
  7093. _Syntax_:
  7094. 'CALL ATOMIC_DEFINE (ATOM, VALUE [, STAT])'
  7095. _Arguments_:
  7096. ATOM Scalar coarray or coindexed variable of either
  7097. integer type with 'ATOMIC_INT_KIND' kind or
  7098. logical type with 'ATOMIC_LOGICAL_KIND' kind.
  7099. VALUE Scalar of the same type as ATOM. If the kind is
  7100. different, the value is converted to the kind of
  7101. ATOM.
  7102. STAT (optional) Scalar default-kind integer variable.
  7103. _Example_:
  7104. program atomic
  7105. use iso_fortran_env
  7106. integer(atomic_int_kind) :: atom[*]
  7107. call atomic_define (atom[1], this_image())
  7108. end program atomic
  7109. _See also_:
  7110. *note ATOMIC_REF::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
  7111. *note ATOMIC_ADD::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
  7112. ATOMIC_XOR::
  7113. 
  7114. File: gfortran.info, Node: ATOMIC_FETCH_ADD, Next: ATOMIC_FETCH_AND, Prev: ATOMIC_DEFINE, Up: Intrinsic Procedures
  7115. 9.32 'ATOMIC_FETCH_ADD' -- Atomic ADD operation with prior fetch
  7116. ================================================================
  7117. _Description_:
  7118. 'ATOMIC_FETCH_ADD(ATOM, VALUE, OLD)' atomically stores the value of
  7119. ATOM in OLD and adds the value of VAR to the variable ATOM. When
  7120. STAT is present and the invocation was successful, it is assigned
  7121. the value 0. If it is present and the invocation has failed, it is
  7122. assigned a positive value; in particular, for a coindexed ATOM, if
  7123. the remote image has stopped, it is assigned the value of
  7124. 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote image
  7125. has failed, the value 'STAT_FAILED_IMAGE'.
  7126. _Standard_:
  7127. TS 18508 or later
  7128. _Class_:
  7129. Atomic subroutine
  7130. _Syntax_:
  7131. 'CALL ATOMIC_FETCH_ADD (ATOM, VALUE, old [, STAT])'
  7132. _Arguments_:
  7133. ATOM Scalar coarray or coindexed variable of integer
  7134. type with 'ATOMIC_INT_KIND' kind.
  7135. 'ATOMIC_LOGICAL_KIND' kind.
  7136. VALUE Scalar of the same type as ATOM. If the kind is
  7137. different, the value is converted to the kind of
  7138. ATOM.
  7139. OLD Scalar of the same type and kind as ATOM.
  7140. STAT (optional) Scalar default-kind integer variable.
  7141. _Example_:
  7142. program atomic
  7143. use iso_fortran_env
  7144. integer(atomic_int_kind) :: atom[*], old
  7145. call atomic_add (atom[1], this_image(), old)
  7146. end program atomic
  7147. _See also_:
  7148. *note ATOMIC_DEFINE::, *note ATOMIC_ADD::, *note ISO_FORTRAN_ENV::,
  7149. *note ATOMIC_FETCH_AND::, *note ATOMIC_FETCH_OR::, *note
  7150. ATOMIC_FETCH_XOR::
  7151. 
  7152. File: gfortran.info, Node: ATOMIC_FETCH_AND, Next: ATOMIC_FETCH_OR, Prev: ATOMIC_FETCH_ADD, Up: Intrinsic Procedures
  7153. 9.33 'ATOMIC_FETCH_AND' -- Atomic bitwise AND operation with prior fetch
  7154. ========================================================================
  7155. _Description_:
  7156. 'ATOMIC_AND(ATOM, VALUE)' atomically stores the value of ATOM in
  7157. OLD and defines ATOM with the bitwise AND between the values of
  7158. ATOM and VALUE. When STAT is present and the invocation was
  7159. successful, it is assigned the value 0. If it is present and the
  7160. invocation has failed, it is assigned a positive value; in
  7161. particular, for a coindexed ATOM, if the remote image has stopped,
  7162. it is assigned the value of 'ISO_FORTRAN_ENV''s
  7163. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  7164. 'STAT_FAILED_IMAGE'.
  7165. _Standard_:
  7166. TS 18508 or later
  7167. _Class_:
  7168. Atomic subroutine
  7169. _Syntax_:
  7170. 'CALL ATOMIC_FETCH_AND (ATOM, VALUE, OLD [, STAT])'
  7171. _Arguments_:
  7172. ATOM Scalar coarray or coindexed variable of integer
  7173. type with 'ATOMIC_INT_KIND' kind.
  7174. VALUE Scalar of the same type as ATOM. If the kind is
  7175. different, the value is converted to the kind of
  7176. ATOM.
  7177. OLD Scalar of the same type and kind as ATOM.
  7178. STAT (optional) Scalar default-kind integer variable.
  7179. _Example_:
  7180. program atomic
  7181. use iso_fortran_env
  7182. integer(atomic_int_kind) :: atom[*], old
  7183. call atomic_fetch_and (atom[1], int(b'10100011101'), old)
  7184. end program atomic
  7185. _See also_:
  7186. *note ATOMIC_DEFINE::, *note ATOMIC_AND::, *note ISO_FORTRAN_ENV::,
  7187. *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_OR::, *note
  7188. ATOMIC_FETCH_XOR::
  7189. 
  7190. File: gfortran.info, Node: ATOMIC_FETCH_OR, Next: ATOMIC_FETCH_XOR, Prev: ATOMIC_FETCH_AND, Up: Intrinsic Procedures
  7191. 9.34 'ATOMIC_FETCH_OR' -- Atomic bitwise OR operation with prior fetch
  7192. ======================================================================
  7193. _Description_:
  7194. 'ATOMIC_OR(ATOM, VALUE)' atomically stores the value of ATOM in OLD
  7195. and defines ATOM with the bitwise OR between the values of ATOM and
  7196. VALUE. When STAT is present and the invocation was successful, it
  7197. is assigned the value 0. If it is present and the invocation has
  7198. failed, it is assigned a positive value; in particular, for a
  7199. coindexed ATOM, if the remote image has stopped, it is assigned the
  7200. value of 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote
  7201. image has failed, the value 'STAT_FAILED_IMAGE'.
  7202. _Standard_:
  7203. TS 18508 or later
  7204. _Class_:
  7205. Atomic subroutine
  7206. _Syntax_:
  7207. 'CALL ATOMIC_FETCH_OR (ATOM, VALUE, OLD [, STAT])'
  7208. _Arguments_:
  7209. ATOM Scalar coarray or coindexed variable of integer
  7210. type with 'ATOMIC_INT_KIND' kind.
  7211. VALUE Scalar of the same type as ATOM. If the kind is
  7212. different, the value is converted to the kind of
  7213. ATOM.
  7214. OLD Scalar of the same type and kind as ATOM.
  7215. STAT (optional) Scalar default-kind integer variable.
  7216. _Example_:
  7217. program atomic
  7218. use iso_fortran_env
  7219. integer(atomic_int_kind) :: atom[*], old
  7220. call atomic_fetch_or (atom[1], int(b'10100011101'), old)
  7221. end program atomic
  7222. _See also_:
  7223. *note ATOMIC_DEFINE::, *note ATOMIC_OR::, *note ISO_FORTRAN_ENV::,
  7224. *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
  7225. ATOMIC_FETCH_XOR::
  7226. 
  7227. File: gfortran.info, Node: ATOMIC_FETCH_XOR, Next: ATOMIC_OR, Prev: ATOMIC_FETCH_OR, Up: Intrinsic Procedures
  7228. 9.35 'ATOMIC_FETCH_XOR' -- Atomic bitwise XOR operation with prior fetch
  7229. ========================================================================
  7230. _Description_:
  7231. 'ATOMIC_XOR(ATOM, VALUE)' atomically stores the value of ATOM in
  7232. OLD and defines ATOM with the bitwise XOR between the values of
  7233. ATOM and VALUE. When STAT is present and the invocation was
  7234. successful, it is assigned the value 0. If it is present and the
  7235. invocation has failed, it is assigned a positive value; in
  7236. particular, for a coindexed ATOM, if the remote image has stopped,
  7237. it is assigned the value of 'ISO_FORTRAN_ENV''s
  7238. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  7239. 'STAT_FAILED_IMAGE'.
  7240. _Standard_:
  7241. TS 18508 or later
  7242. _Class_:
  7243. Atomic subroutine
  7244. _Syntax_:
  7245. 'CALL ATOMIC_FETCH_XOR (ATOM, VALUE, OLD [, STAT])'
  7246. _Arguments_:
  7247. ATOM Scalar coarray or coindexed variable of integer
  7248. type with 'ATOMIC_INT_KIND' kind.
  7249. VALUE Scalar of the same type as ATOM. If the kind is
  7250. different, the value is converted to the kind of
  7251. ATOM.
  7252. OLD Scalar of the same type and kind as ATOM.
  7253. STAT (optional) Scalar default-kind integer variable.
  7254. _Example_:
  7255. program atomic
  7256. use iso_fortran_env
  7257. integer(atomic_int_kind) :: atom[*], old
  7258. call atomic_fetch_xor (atom[1], int(b'10100011101'), old)
  7259. end program atomic
  7260. _See also_:
  7261. *note ATOMIC_DEFINE::, *note ATOMIC_XOR::, *note ISO_FORTRAN_ENV::,
  7262. *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
  7263. ATOMIC_FETCH_OR::
  7264. 
  7265. File: gfortran.info, Node: ATOMIC_OR, Next: ATOMIC_REF, Prev: ATOMIC_FETCH_XOR, Up: Intrinsic Procedures
  7266. 9.36 'ATOMIC_OR' -- Atomic bitwise OR operation
  7267. ===============================================
  7268. _Description_:
  7269. 'ATOMIC_OR(ATOM, VALUE)' atomically defines ATOM with the bitwise
  7270. AND between the values of ATOM and VALUE. When STAT is present and
  7271. the invocation was successful, it is assigned the value 0. If it
  7272. is present and the invocation has failed, it is assigned a positive
  7273. value; in particular, for a coindexed ATOM, if the remote image has
  7274. stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
  7275. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  7276. 'STAT_FAILED_IMAGE'.
  7277. _Standard_:
  7278. TS 18508 or later
  7279. _Class_:
  7280. Atomic subroutine
  7281. _Syntax_:
  7282. 'CALL ATOMIC_OR (ATOM, VALUE [, STAT])'
  7283. _Arguments_:
  7284. ATOM Scalar coarray or coindexed variable of integer
  7285. type with 'ATOMIC_INT_KIND' kind.
  7286. VALUE Scalar of the same type as ATOM. If the kind is
  7287. different, the value is converted to the kind of
  7288. ATOM.
  7289. STAT (optional) Scalar default-kind integer variable.
  7290. _Example_:
  7291. program atomic
  7292. use iso_fortran_env
  7293. integer(atomic_int_kind) :: atom[*]
  7294. call atomic_or (atom[1], int(b'10100011101'))
  7295. end program atomic
  7296. _See also_:
  7297. *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_OR::, *note
  7298. ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
  7299. ATOMIC_XOR::
  7300. 
  7301. File: gfortran.info, Node: ATOMIC_REF, Next: ATOMIC_XOR, Prev: ATOMIC_OR, Up: Intrinsic Procedures
  7302. 9.37 'ATOMIC_REF' -- Obtaining the value of a variable atomically
  7303. =================================================================
  7304. _Description_:
  7305. 'ATOMIC_DEFINE(ATOM, VALUE)' atomically assigns the value of the
  7306. variable ATOM to VALUE. When STAT is present and the invocation
  7307. was successful, it is assigned the value 0. If it is present and
  7308. the invocation has failed, it is assigned a positive value; in
  7309. particular, for a coindexed ATOM, if the remote image has stopped,
  7310. it is assigned the value of 'ISO_FORTRAN_ENV''s
  7311. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  7312. 'STAT_FAILED_IMAGE'.
  7313. _Standard_:
  7314. Fortran 2008 and later; with STAT, TS 18508 or later
  7315. _Class_:
  7316. Atomic subroutine
  7317. _Syntax_:
  7318. 'CALL ATOMIC_REF(VALUE, ATOM [, STAT])'
  7319. _Arguments_:
  7320. VALUE Scalar of the same type as ATOM. If the kind is
  7321. different, the value is converted to the kind of
  7322. ATOM.
  7323. ATOM Scalar coarray or coindexed variable of either
  7324. integer type with 'ATOMIC_INT_KIND' kind or
  7325. logical type with 'ATOMIC_LOGICAL_KIND' kind.
  7326. STAT (optional) Scalar default-kind integer variable.
  7327. _Example_:
  7328. program atomic
  7329. use iso_fortran_env
  7330. logical(atomic_logical_kind) :: atom[*]
  7331. logical :: val
  7332. call atomic_ref (atom, .false.)
  7333. ! ...
  7334. call atomic_ref (atom, val)
  7335. if (val) then
  7336. print *, "Obtained"
  7337. end if
  7338. end program atomic
  7339. _See also_:
  7340. *note ATOMIC_DEFINE::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
  7341. *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
  7342. ATOMIC_FETCH_OR::, *note ATOMIC_FETCH_XOR::
  7343. 
  7344. File: gfortran.info, Node: ATOMIC_XOR, Next: BACKTRACE, Prev: ATOMIC_REF, Up: Intrinsic Procedures
  7345. 9.38 'ATOMIC_XOR' -- Atomic bitwise OR operation
  7346. ================================================
  7347. _Description_:
  7348. 'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
  7349. XOR between the values of ATOM and VALUE. When STAT is present and
  7350. the invocation was successful, it is assigned the value 0. If it
  7351. is present and the invocation has failed, it is assigned a positive
  7352. value; in particular, for a coindexed ATOM, if the remote image has
  7353. stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
  7354. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  7355. 'STAT_FAILED_IMAGE'.
  7356. _Standard_:
  7357. TS 18508 or later
  7358. _Class_:
  7359. Atomic subroutine
  7360. _Syntax_:
  7361. 'CALL ATOMIC_XOR (ATOM, VALUE [, STAT])'
  7362. _Arguments_:
  7363. ATOM Scalar coarray or coindexed variable of integer
  7364. type with 'ATOMIC_INT_KIND' kind.
  7365. VALUE Scalar of the same type as ATOM. If the kind is
  7366. different, the value is converted to the kind of
  7367. ATOM.
  7368. STAT (optional) Scalar default-kind integer variable.
  7369. _Example_:
  7370. program atomic
  7371. use iso_fortran_env
  7372. integer(atomic_int_kind) :: atom[*]
  7373. call atomic_xor (atom[1], int(b'10100011101'))
  7374. end program atomic
  7375. _See also_:
  7376. *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_XOR::, *note
  7377. ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
  7378. ATOMIC_XOR::
  7379. 
  7380. File: gfortran.info, Node: BACKTRACE, Next: BESSEL_J0, Prev: ATOMIC_XOR, Up: Intrinsic Procedures
  7381. 9.39 'BACKTRACE' -- Show a backtrace
  7382. ====================================
  7383. _Description_:
  7384. 'BACKTRACE' shows a backtrace at an arbitrary place in user code.
  7385. Program execution continues normally afterwards. The backtrace
  7386. information is printed to the unit corresponding to 'ERROR_UNIT' in
  7387. 'ISO_FORTRAN_ENV'.
  7388. _Standard_:
  7389. GNU extension
  7390. _Class_:
  7391. Subroutine
  7392. _Syntax_:
  7393. 'CALL BACKTRACE'
  7394. _Arguments_:
  7395. None
  7396. _See also_:
  7397. *note ABORT::
  7398. 
  7399. File: gfortran.info, Node: BESSEL_J0, Next: BESSEL_J1, Prev: BACKTRACE, Up: Intrinsic Procedures
  7400. 9.40 'BESSEL_J0' -- Bessel function of the first kind of order 0
  7401. ================================================================
  7402. _Description_:
  7403. 'BESSEL_J0(X)' computes the Bessel function of the first kind of
  7404. order 0 of X. This function is available under the name 'BESJ0' as
  7405. a GNU extension.
  7406. _Standard_:
  7407. Fortran 2008 and later
  7408. _Class_:
  7409. Elemental function
  7410. _Syntax_:
  7411. 'RESULT = BESSEL_J0(X)'
  7412. _Arguments_:
  7413. X The type shall be 'REAL'.
  7414. _Return value_:
  7415. The return value is of type 'REAL' and lies in the range -
  7416. 0.4027... \leq Bessel (0,x) \leq 1. It has the same kind as X.
  7417. _Example_:
  7418. program test_besj0
  7419. real(8) :: x = 0.0_8
  7420. x = bessel_j0(x)
  7421. end program test_besj0
  7422. _Specific names_:
  7423. Name Argument Return type Standard
  7424. 'DBESJ0(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  7425. 
  7426. File: gfortran.info, Node: BESSEL_J1, Next: BESSEL_JN, Prev: BESSEL_J0, Up: Intrinsic Procedures
  7427. 9.41 'BESSEL_J1' -- Bessel function of the first kind of order 1
  7428. ================================================================
  7429. _Description_:
  7430. 'BESSEL_J1(X)' computes the Bessel function of the first kind of
  7431. order 1 of X. This function is available under the name 'BESJ1' as
  7432. a GNU extension.
  7433. _Standard_:
  7434. Fortran 2008
  7435. _Class_:
  7436. Elemental function
  7437. _Syntax_:
  7438. 'RESULT = BESSEL_J1(X)'
  7439. _Arguments_:
  7440. X The type shall be 'REAL'.
  7441. _Return value_:
  7442. The return value is of type 'REAL' and lies in the range -
  7443. 0.5818... \leq Bessel (0,x) \leq 0.5818 . It has the same kind as
  7444. X.
  7445. _Example_:
  7446. program test_besj1
  7447. real(8) :: x = 1.0_8
  7448. x = bessel_j1(x)
  7449. end program test_besj1
  7450. _Specific names_:
  7451. Name Argument Return type Standard
  7452. 'DBESJ1(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  7453. 
  7454. File: gfortran.info, Node: BESSEL_JN, Next: BESSEL_Y0, Prev: BESSEL_J1, Up: Intrinsic Procedures
  7455. 9.42 'BESSEL_JN' -- Bessel function of the first kind
  7456. =====================================================
  7457. _Description_:
  7458. 'BESSEL_JN(N, X)' computes the Bessel function of the first kind of
  7459. order N of X. This function is available under the name 'BESJN' as
  7460. a GNU extension. If N and X are arrays, their ranks and shapes
  7461. shall conform.
  7462. 'BESSEL_JN(N1, N2, X)' returns an array with the Bessel functions
  7463. of the first kind of the orders N1 to N2.
  7464. _Standard_:
  7465. Fortran 2008 and later, negative N is allowed as GNU extension
  7466. _Class_:
  7467. Elemental function, except for the transformational function
  7468. 'BESSEL_JN(N1, N2, X)'
  7469. _Syntax_:
  7470. 'RESULT = BESSEL_JN(N, X)'
  7471. 'RESULT = BESSEL_JN(N1, N2, X)'
  7472. _Arguments_:
  7473. N Shall be a scalar or an array of type 'INTEGER'.
  7474. N1 Shall be a non-negative scalar of type
  7475. 'INTEGER'.
  7476. N2 Shall be a non-negative scalar of type
  7477. 'INTEGER'.
  7478. X Shall be a scalar or an array of type 'REAL';
  7479. for 'BESSEL_JN(N1, N2, X)' it shall be scalar.
  7480. _Return value_:
  7481. The return value is a scalar of type 'REAL'. It has the same kind
  7482. as X.
  7483. _Note_:
  7484. The transformational function uses a recurrence algorithm which
  7485. might, for some values of X, lead to different results than calls
  7486. to the elemental function.
  7487. _Example_:
  7488. program test_besjn
  7489. real(8) :: x = 1.0_8
  7490. x = bessel_jn(5,x)
  7491. end program test_besjn
  7492. _Specific names_:
  7493. Name Argument Return type Standard
  7494. 'DBESJN(N, 'INTEGER N' 'REAL(8)' GNU extension
  7495. X)'
  7496. 'REAL(8) X'
  7497. 
  7498. File: gfortran.info, Node: BESSEL_Y0, Next: BESSEL_Y1, Prev: BESSEL_JN, Up: Intrinsic Procedures
  7499. 9.43 'BESSEL_Y0' -- Bessel function of the second kind of order 0
  7500. =================================================================
  7501. _Description_:
  7502. 'BESSEL_Y0(X)' computes the Bessel function of the second kind of
  7503. order 0 of X. This function is available under the name 'BESY0' as
  7504. a GNU extension.
  7505. _Standard_:
  7506. Fortran 2008 and later
  7507. _Class_:
  7508. Elemental function
  7509. _Syntax_:
  7510. 'RESULT = BESSEL_Y0(X)'
  7511. _Arguments_:
  7512. X The type shall be 'REAL'.
  7513. _Return value_:
  7514. The return value is of type 'REAL'. It has the same kind as X.
  7515. _Example_:
  7516. program test_besy0
  7517. real(8) :: x = 0.0_8
  7518. x = bessel_y0(x)
  7519. end program test_besy0
  7520. _Specific names_:
  7521. Name Argument Return type Standard
  7522. 'DBESY0(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  7523. 
  7524. File: gfortran.info, Node: BESSEL_Y1, Next: BESSEL_YN, Prev: BESSEL_Y0, Up: Intrinsic Procedures
  7525. 9.44 'BESSEL_Y1' -- Bessel function of the second kind of order 1
  7526. =================================================================
  7527. _Description_:
  7528. 'BESSEL_Y1(X)' computes the Bessel function of the second kind of
  7529. order 1 of X. This function is available under the name 'BESY1' as
  7530. a GNU extension.
  7531. _Standard_:
  7532. Fortran 2008 and later
  7533. _Class_:
  7534. Elemental function
  7535. _Syntax_:
  7536. 'RESULT = BESSEL_Y1(X)'
  7537. _Arguments_:
  7538. X The type shall be 'REAL'.
  7539. _Return value_:
  7540. The return value is of type 'REAL'. It has the same kind as X.
  7541. _Example_:
  7542. program test_besy1
  7543. real(8) :: x = 1.0_8
  7544. x = bessel_y1(x)
  7545. end program test_besy1
  7546. _Specific names_:
  7547. Name Argument Return type Standard
  7548. 'DBESY1(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  7549. 
  7550. File: gfortran.info, Node: BESSEL_YN, Next: BGE, Prev: BESSEL_Y1, Up: Intrinsic Procedures
  7551. 9.45 'BESSEL_YN' -- Bessel function of the second kind
  7552. ======================================================
  7553. _Description_:
  7554. 'BESSEL_YN(N, X)' computes the Bessel function of the second kind
  7555. of order N of X. This function is available under the name 'BESYN'
  7556. as a GNU extension. If N and X are arrays, their ranks and shapes
  7557. shall conform.
  7558. 'BESSEL_YN(N1, N2, X)' returns an array with the Bessel functions
  7559. of the first kind of the orders N1 to N2.
  7560. _Standard_:
  7561. Fortran 2008 and later, negative N is allowed as GNU extension
  7562. _Class_:
  7563. Elemental function, except for the transformational function
  7564. 'BESSEL_YN(N1, N2, X)'
  7565. _Syntax_:
  7566. 'RESULT = BESSEL_YN(N, X)'
  7567. 'RESULT = BESSEL_YN(N1, N2, X)'
  7568. _Arguments_:
  7569. N Shall be a scalar or an array of type 'INTEGER'
  7570. .
  7571. N1 Shall be a non-negative scalar of type
  7572. 'INTEGER'.
  7573. N2 Shall be a non-negative scalar of type
  7574. 'INTEGER'.
  7575. X Shall be a scalar or an array of type 'REAL';
  7576. for 'BESSEL_YN(N1, N2, X)' it shall be scalar.
  7577. _Return value_:
  7578. The return value is a scalar of type 'REAL'. It has the same kind
  7579. as X.
  7580. _Note_:
  7581. The transformational function uses a recurrence algorithm which
  7582. might, for some values of X, lead to different results than calls
  7583. to the elemental function.
  7584. _Example_:
  7585. program test_besyn
  7586. real(8) :: x = 1.0_8
  7587. x = bessel_yn(5,x)
  7588. end program test_besyn
  7589. _Specific names_:
  7590. Name Argument Return type Standard
  7591. 'DBESYN(N,X)' 'INTEGER N' 'REAL(8)' GNU extension
  7592. 'REAL(8) X'
  7593. 
  7594. File: gfortran.info, Node: BGE, Next: BGT, Prev: BESSEL_YN, Up: Intrinsic Procedures
  7595. 9.46 'BGE' -- Bitwise greater than or equal to
  7596. ==============================================
  7597. _Description_:
  7598. Determines whether an integral is a bitwise greater than or equal
  7599. to another.
  7600. _Standard_:
  7601. Fortran 2008 and later
  7602. _Class_:
  7603. Elemental function
  7604. _Syntax_:
  7605. 'RESULT = BGE(I, J)'
  7606. _Arguments_:
  7607. I Shall be of 'INTEGER' type.
  7608. J Shall be of 'INTEGER' type, and of the same kind
  7609. as I.
  7610. _Return value_:
  7611. The return value is of type 'LOGICAL' and of the default kind.
  7612. _See also_:
  7613. *note BGT::, *note BLE::, *note BLT::
  7614. 
  7615. File: gfortran.info, Node: BGT, Next: BIT_SIZE, Prev: BGE, Up: Intrinsic Procedures
  7616. 9.47 'BGT' -- Bitwise greater than
  7617. ==================================
  7618. _Description_:
  7619. Determines whether an integral is a bitwise greater than another.
  7620. _Standard_:
  7621. Fortran 2008 and later
  7622. _Class_:
  7623. Elemental function
  7624. _Syntax_:
  7625. 'RESULT = BGT(I, J)'
  7626. _Arguments_:
  7627. I Shall be of 'INTEGER' type.
  7628. J Shall be of 'INTEGER' type, and of the same kind
  7629. as I.
  7630. _Return value_:
  7631. The return value is of type 'LOGICAL' and of the default kind.
  7632. _See also_:
  7633. *note BGE::, *note BLE::, *note BLT::
  7634. 
  7635. File: gfortran.info, Node: BIT_SIZE, Next: BLE, Prev: BGT, Up: Intrinsic Procedures
  7636. 9.48 'BIT_SIZE' -- Bit size inquiry function
  7637. ============================================
  7638. _Description_:
  7639. 'BIT_SIZE(I)' returns the number of bits (integer precision plus
  7640. sign bit) represented by the type of I. The result of
  7641. 'BIT_SIZE(I)' is independent of the actual value of I.
  7642. _Standard_:
  7643. Fortran 90 and later
  7644. _Class_:
  7645. Inquiry function
  7646. _Syntax_:
  7647. 'RESULT = BIT_SIZE(I)'
  7648. _Arguments_:
  7649. I The type shall be 'INTEGER'.
  7650. _Return value_:
  7651. The return value is of type 'INTEGER'
  7652. _Example_:
  7653. program test_bit_size
  7654. integer :: i = 123
  7655. integer :: size
  7656. size = bit_size(i)
  7657. print *, size
  7658. end program test_bit_size
  7659. 
  7660. File: gfortran.info, Node: BLE, Next: BLT, Prev: BIT_SIZE, Up: Intrinsic Procedures
  7661. 9.49 'BLE' -- Bitwise less than or equal to
  7662. ===========================================
  7663. _Description_:
  7664. Determines whether an integral is a bitwise less than or equal to
  7665. another.
  7666. _Standard_:
  7667. Fortran 2008 and later
  7668. _Class_:
  7669. Elemental function
  7670. _Syntax_:
  7671. 'RESULT = BLE(I, J)'
  7672. _Arguments_:
  7673. I Shall be of 'INTEGER' type.
  7674. J Shall be of 'INTEGER' type, and of the same kind
  7675. as I.
  7676. _Return value_:
  7677. The return value is of type 'LOGICAL' and of the default kind.
  7678. _See also_:
  7679. *note BGT::, *note BGE::, *note BLT::
  7680. 
  7681. File: gfortran.info, Node: BLT, Next: BTEST, Prev: BLE, Up: Intrinsic Procedures
  7682. 9.50 'BLT' -- Bitwise less than
  7683. ===============================
  7684. _Description_:
  7685. Determines whether an integral is a bitwise less than another.
  7686. _Standard_:
  7687. Fortran 2008 and later
  7688. _Class_:
  7689. Elemental function
  7690. _Syntax_:
  7691. 'RESULT = BLT(I, J)'
  7692. _Arguments_:
  7693. I Shall be of 'INTEGER' type.
  7694. J Shall be of 'INTEGER' type, and of the same kind
  7695. as I.
  7696. _Return value_:
  7697. The return value is of type 'LOGICAL' and of the default kind.
  7698. _See also_:
  7699. *note BGE::, *note BGT::, *note BLE::
  7700. 
  7701. File: gfortran.info, Node: BTEST, Next: C_ASSOCIATED, Prev: BLT, Up: Intrinsic Procedures
  7702. 9.51 'BTEST' -- Bit test function
  7703. =================================
  7704. _Description_:
  7705. 'BTEST(I,POS)' returns logical '.TRUE.' if the bit at POS in I is
  7706. set. The counting of the bits starts at 0.
  7707. _Standard_:
  7708. Fortran 90 and later, has overloads that are GNU extensions
  7709. _Class_:
  7710. Elemental function
  7711. _Syntax_:
  7712. 'RESULT = BTEST(I, POS)'
  7713. _Arguments_:
  7714. I The type shall be 'INTEGER'.
  7715. POS The type shall be 'INTEGER'.
  7716. _Return value_:
  7717. The return value is of type 'LOGICAL'
  7718. _Example_:
  7719. program test_btest
  7720. integer :: i = 32768 + 1024 + 64
  7721. integer :: pos
  7722. logical :: bool
  7723. do pos=0,16
  7724. bool = btest(i, pos)
  7725. print *, pos, bool
  7726. end do
  7727. end program test_btest
  7728. _Specific names_:
  7729. Name Argument Return type Standard
  7730. 'BTEST(I,POS)' 'INTEGER 'LOGICAL' Fortran 95 and
  7731. I,POS' later
  7732. 'BBTEST(I,POS)''INTEGER(1) 'LOGICAL(1)' GNU extension
  7733. I,POS'
  7734. 'BITEST(I,POS)''INTEGER(2) 'LOGICAL(2)' GNU extension
  7735. I,POS'
  7736. 'BJTEST(I,POS)''INTEGER(4) 'LOGICAL(4)' GNU extension
  7737. I,POS'
  7738. 'BKTEST(I,POS)''INTEGER(8) 'LOGICAL(8)' GNU extension
  7739. I,POS'
  7740. 
  7741. File: gfortran.info, Node: C_ASSOCIATED, Next: C_F_POINTER, Prev: BTEST, Up: Intrinsic Procedures
  7742. 9.52 'C_ASSOCIATED' -- Status of a C pointer
  7743. ============================================
  7744. _Description_:
  7745. 'C_ASSOCIATED(c_ptr_1[, c_ptr_2])' determines the status of the C
  7746. pointer C_PTR_1 or if C_PTR_1 is associated with the target
  7747. C_PTR_2.
  7748. _Standard_:
  7749. Fortran 2003 and later
  7750. _Class_:
  7751. Inquiry function
  7752. _Syntax_:
  7753. 'RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])'
  7754. _Arguments_:
  7755. C_PTR_1 Scalar of the type 'C_PTR' or 'C_FUNPTR'.
  7756. C_PTR_2 (Optional) Scalar of the same type as C_PTR_1.
  7757. _Return value_:
  7758. The return value is of type 'LOGICAL'; it is '.false.' if either
  7759. C_PTR_1 is a C NULL pointer or if C_PTR1 and C_PTR_2 point to
  7760. different addresses.
  7761. _Example_:
  7762. subroutine association_test(a,b)
  7763. use iso_c_binding, only: c_associated, c_loc, c_ptr
  7764. implicit none
  7765. real, pointer :: a
  7766. type(c_ptr) :: b
  7767. if(c_associated(b, c_loc(a))) &
  7768. stop 'b and a do not point to same target'
  7769. end subroutine association_test
  7770. _See also_:
  7771. *note C_LOC::, *note C_FUNLOC::
  7772. 
  7773. File: gfortran.info, Node: C_F_POINTER, Next: C_F_PROCPOINTER, Prev: C_ASSOCIATED, Up: Intrinsic Procedures
  7774. 9.53 'C_F_POINTER' -- Convert C into Fortran pointer
  7775. ====================================================
  7776. _Description_:
  7777. 'C_F_POINTER(CPTR, FPTR[, SHAPE])' assigns the target of the C
  7778. pointer CPTR to the Fortran pointer FPTR and specifies its shape.
  7779. _Standard_:
  7780. Fortran 2003 and later
  7781. _Class_:
  7782. Subroutine
  7783. _Syntax_:
  7784. 'CALL C_F_POINTER(CPTR, FPTR[, SHAPE])'
  7785. _Arguments_:
  7786. CPTR scalar of the type 'C_PTR'. It is 'INTENT(IN)'.
  7787. FPTR pointer interoperable with CPTR. It is
  7788. 'INTENT(OUT)'.
  7789. SHAPE (Optional) Rank-one array of type 'INTEGER' with
  7790. 'INTENT(IN)'. It shall be present if and only
  7791. if FPTR is an array. The size must be equal to
  7792. the rank of FPTR.
  7793. _Example_:
  7794. program main
  7795. use iso_c_binding
  7796. implicit none
  7797. interface
  7798. subroutine my_routine(p) bind(c,name='myC_func')
  7799. import :: c_ptr
  7800. type(c_ptr), intent(out) :: p
  7801. end subroutine
  7802. end interface
  7803. type(c_ptr) :: cptr
  7804. real,pointer :: a(:)
  7805. call my_routine(cptr)
  7806. call c_f_pointer(cptr, a, [12])
  7807. end program main
  7808. _See also_:
  7809. *note C_LOC::, *note C_F_PROCPOINTER::
  7810. 
  7811. File: gfortran.info, Node: C_F_PROCPOINTER, Next: C_FUNLOC, Prev: C_F_POINTER, Up: Intrinsic Procedures
  7812. 9.54 'C_F_PROCPOINTER' -- Convert C into Fortran procedure pointer
  7813. ==================================================================
  7814. _Description_:
  7815. 'C_F_PROCPOINTER(CPTR, FPTR)' Assign the target of the C function
  7816. pointer CPTR to the Fortran procedure pointer FPTR.
  7817. _Standard_:
  7818. Fortran 2003 and later
  7819. _Class_:
  7820. Subroutine
  7821. _Syntax_:
  7822. 'CALL C_F_PROCPOINTER(cptr, fptr)'
  7823. _Arguments_:
  7824. CPTR scalar of the type 'C_FUNPTR'. It is
  7825. 'INTENT(IN)'.
  7826. FPTR procedure pointer interoperable with CPTR. It
  7827. is 'INTENT(OUT)'.
  7828. _Example_:
  7829. program main
  7830. use iso_c_binding
  7831. implicit none
  7832. abstract interface
  7833. function func(a)
  7834. import :: c_float
  7835. real(c_float), intent(in) :: a
  7836. real(c_float) :: func
  7837. end function
  7838. end interface
  7839. interface
  7840. function getIterFunc() bind(c,name="getIterFunc")
  7841. import :: c_funptr
  7842. type(c_funptr) :: getIterFunc
  7843. end function
  7844. end interface
  7845. type(c_funptr) :: cfunptr
  7846. procedure(func), pointer :: myFunc
  7847. cfunptr = getIterFunc()
  7848. call c_f_procpointer(cfunptr, myFunc)
  7849. end program main
  7850. _See also_:
  7851. *note C_LOC::, *note C_F_POINTER::
  7852. 
  7853. File: gfortran.info, Node: C_FUNLOC, Next: C_LOC, Prev: C_F_PROCPOINTER, Up: Intrinsic Procedures
  7854. 9.55 'C_FUNLOC' -- Obtain the C address of a procedure
  7855. ======================================================
  7856. _Description_:
  7857. 'C_FUNLOC(x)' determines the C address of the argument.
  7858. _Standard_:
  7859. Fortran 2003 and later
  7860. _Class_:
  7861. Inquiry function
  7862. _Syntax_:
  7863. 'RESULT = C_FUNLOC(x)'
  7864. _Arguments_:
  7865. X Interoperable function or pointer to such
  7866. function.
  7867. _Return value_:
  7868. The return value is of type 'C_FUNPTR' and contains the C address
  7869. of the argument.
  7870. _Example_:
  7871. module x
  7872. use iso_c_binding
  7873. implicit none
  7874. contains
  7875. subroutine sub(a) bind(c)
  7876. real(c_float) :: a
  7877. a = sqrt(a)+5.0
  7878. end subroutine sub
  7879. end module x
  7880. program main
  7881. use iso_c_binding
  7882. use x
  7883. implicit none
  7884. interface
  7885. subroutine my_routine(p) bind(c,name='myC_func')
  7886. import :: c_funptr
  7887. type(c_funptr), intent(in) :: p
  7888. end subroutine
  7889. end interface
  7890. call my_routine(c_funloc(sub))
  7891. end program main
  7892. _See also_:
  7893. *note C_ASSOCIATED::, *note C_LOC::, *note C_F_POINTER::, *note
  7894. C_F_PROCPOINTER::
  7895. 
  7896. File: gfortran.info, Node: C_LOC, Next: C_SIZEOF, Prev: C_FUNLOC, Up: Intrinsic Procedures
  7897. 9.56 'C_LOC' -- Obtain the C address of an object
  7898. =================================================
  7899. _Description_:
  7900. 'C_LOC(X)' determines the C address of the argument.
  7901. _Standard_:
  7902. Fortran 2003 and later
  7903. _Class_:
  7904. Inquiry function
  7905. _Syntax_:
  7906. 'RESULT = C_LOC(X)'
  7907. _Arguments_:
  7908. X Shall have either the POINTER or TARGET attribute.
  7909. It shall not be a coindexed object. It shall either
  7910. be a variable with interoperable type and kind type
  7911. parameters, or be a scalar, nonpolymorphic variable
  7912. with no length type parameters.
  7913. _Return value_:
  7914. The return value is of type 'C_PTR' and contains the C address of
  7915. the argument.
  7916. _Example_:
  7917. subroutine association_test(a,b)
  7918. use iso_c_binding, only: c_associated, c_loc, c_ptr
  7919. implicit none
  7920. real, pointer :: a
  7921. type(c_ptr) :: b
  7922. if(c_associated(b, c_loc(a))) &
  7923. stop 'b and a do not point to same target'
  7924. end subroutine association_test
  7925. _See also_:
  7926. *note C_ASSOCIATED::, *note C_FUNLOC::, *note C_F_POINTER::, *note
  7927. C_F_PROCPOINTER::
  7928. 
  7929. File: gfortran.info, Node: C_SIZEOF, Next: CEILING, Prev: C_LOC, Up: Intrinsic Procedures
  7930. 9.57 'C_SIZEOF' -- Size in bytes of an expression
  7931. =================================================
  7932. _Description_:
  7933. 'C_SIZEOF(X)' calculates the number of bytes of storage the
  7934. expression 'X' occupies.
  7935. _Standard_:
  7936. Fortran 2008
  7937. _Class_:
  7938. Inquiry function of the module 'ISO_C_BINDING'
  7939. _Syntax_:
  7940. 'N = C_SIZEOF(X)'
  7941. _Arguments_:
  7942. X The argument shall be an interoperable data
  7943. entity.
  7944. _Return value_:
  7945. The return value is of type integer and of the system-dependent
  7946. kind 'C_SIZE_T' (from the 'ISO_C_BINDING' module). Its value is
  7947. the number of bytes occupied by the argument. If the argument has
  7948. the 'POINTER' attribute, the number of bytes of the storage area
  7949. pointed to is returned. If the argument is of a derived type with
  7950. 'POINTER' or 'ALLOCATABLE' components, the return value does not
  7951. account for the sizes of the data pointed to by these components.
  7952. _Example_:
  7953. use iso_c_binding
  7954. integer(c_int) :: i
  7955. real(c_float) :: r, s(5)
  7956. print *, (c_sizeof(s)/c_sizeof(r) == 5)
  7957. end
  7958. The example will print 'T' unless you are using a platform where
  7959. default 'REAL' variables are unusually padded.
  7960. _See also_:
  7961. *note SIZEOF::, *note STORAGE_SIZE::
  7962. 
  7963. File: gfortran.info, Node: CEILING, Next: CHAR, Prev: C_SIZEOF, Up: Intrinsic Procedures
  7964. 9.58 'CEILING' -- Integer ceiling function
  7965. ==========================================
  7966. _Description_:
  7967. 'CEILING(A)' returns the least integer greater than or equal to A.
  7968. _Standard_:
  7969. Fortran 95 and later
  7970. _Class_:
  7971. Elemental function
  7972. _Syntax_:
  7973. 'RESULT = CEILING(A [, KIND])'
  7974. _Arguments_:
  7975. A The type shall be 'REAL'.
  7976. KIND (Optional) An 'INTEGER' initialization
  7977. expression indicating the kind parameter of the
  7978. result.
  7979. _Return value_:
  7980. The return value is of type 'INTEGER(KIND)' if KIND is present and
  7981. a default-kind 'INTEGER' otherwise.
  7982. _Example_:
  7983. program test_ceiling
  7984. real :: x = 63.29
  7985. real :: y = -63.59
  7986. print *, ceiling(x) ! returns 64
  7987. print *, ceiling(y) ! returns -63
  7988. end program test_ceiling
  7989. _See also_:
  7990. *note FLOOR::, *note NINT::
  7991. 
  7992. File: gfortran.info, Node: CHAR, Next: CHDIR, Prev: CEILING, Up: Intrinsic Procedures
  7993. 9.59 'CHAR' -- Character conversion function
  7994. ============================================
  7995. _Description_:
  7996. 'CHAR(I [, KIND])' returns the character represented by the integer
  7997. I.
  7998. _Standard_:
  7999. Fortran 77 and later
  8000. _Class_:
  8001. Elemental function
  8002. _Syntax_:
  8003. 'RESULT = CHAR(I [, KIND])'
  8004. _Arguments_:
  8005. I The type shall be 'INTEGER'.
  8006. KIND (Optional) An 'INTEGER' initialization
  8007. expression indicating the kind parameter of the
  8008. result.
  8009. _Return value_:
  8010. The return value is of type 'CHARACTER(1)'
  8011. _Example_:
  8012. program test_char
  8013. integer :: i = 74
  8014. character(1) :: c
  8015. c = char(i)
  8016. print *, i, c ! returns 'J'
  8017. end program test_char
  8018. _Specific names_:
  8019. Name Argument Return type Standard
  8020. 'CHAR(I)' 'INTEGER I' 'CHARACTER(LEN=1)'Fortran 77 and
  8021. later
  8022. _Note_:
  8023. See *note ICHAR:: for a discussion of converting between numerical
  8024. values and formatted string representations.
  8025. _See also_:
  8026. *note ACHAR::, *note IACHAR::, *note ICHAR::
  8027. 
  8028. File: gfortran.info, Node: CHDIR, Next: CHMOD, Prev: CHAR, Up: Intrinsic Procedures
  8029. 9.60 'CHDIR' -- Change working directory
  8030. ========================================
  8031. _Description_:
  8032. Change current working directory to a specified path.
  8033. This intrinsic is provided in both subroutine and function forms;
  8034. however, only one form can be used in any given program unit.
  8035. _Standard_:
  8036. GNU extension
  8037. _Class_:
  8038. Subroutine, function
  8039. _Syntax_:
  8040. 'CALL CHDIR(NAME [, STATUS])'
  8041. 'STATUS = CHDIR(NAME)'
  8042. _Arguments_:
  8043. NAME The type shall be 'CHARACTER' of default kind
  8044. and shall specify a valid path within the file
  8045. system.
  8046. STATUS (Optional) 'INTEGER' status flag of the default
  8047. kind. Returns 0 on success, and a system
  8048. specific and nonzero error code otherwise.
  8049. _Example_:
  8050. PROGRAM test_chdir
  8051. CHARACTER(len=255) :: path
  8052. CALL getcwd(path)
  8053. WRITE(*,*) TRIM(path)
  8054. CALL chdir("/tmp")
  8055. CALL getcwd(path)
  8056. WRITE(*,*) TRIM(path)
  8057. END PROGRAM
  8058. _See also_:
  8059. *note GETCWD::
  8060. 
  8061. File: gfortran.info, Node: CHMOD, Next: CMPLX, Prev: CHDIR, Up: Intrinsic Procedures
  8062. 9.61 'CHMOD' -- Change access permissions of files
  8063. ==================================================
  8064. _Description_:
  8065. 'CHMOD' changes the permissions of a file.
  8066. This intrinsic is provided in both subroutine and function forms;
  8067. however, only one form can be used in any given program unit.
  8068. _Standard_:
  8069. GNU extension
  8070. _Class_:
  8071. Subroutine, function
  8072. _Syntax_:
  8073. 'CALL CHMOD(NAME, MODE[, STATUS])'
  8074. 'STATUS = CHMOD(NAME, MODE)'
  8075. _Arguments_:
  8076. NAME Scalar 'CHARACTER' of default kind with the file
  8077. name. Trailing blanks are ignored unless the
  8078. character 'achar(0)' is present, then all
  8079. characters up to and excluding 'achar(0)' are
  8080. used as the file name.
  8081. MODE Scalar 'CHARACTER' of default kind giving the
  8082. file permission. MODE uses the same syntax as
  8083. the 'chmod' utility as defined by the POSIX
  8084. standard. The argument shall either be a string
  8085. of a nonnegative octal number or a symbolic
  8086. mode.
  8087. STATUS (optional) scalar 'INTEGER', which is '0' on
  8088. success and nonzero otherwise.
  8089. _Return value_:
  8090. In either syntax, STATUS is set to '0' on success and nonzero
  8091. otherwise.
  8092. _Example_:
  8093. 'CHMOD' as subroutine
  8094. program chmod_test
  8095. implicit none
  8096. integer :: status
  8097. call chmod('test.dat','u+x',status)
  8098. print *, 'Status: ', status
  8099. end program chmod_test
  8100. 'CHMOD' as function:
  8101. program chmod_test
  8102. implicit none
  8103. integer :: status
  8104. status = chmod('test.dat','u+x')
  8105. print *, 'Status: ', status
  8106. end program chmod_test
  8107. 
  8108. File: gfortran.info, Node: CMPLX, Next: CO_BROADCAST, Prev: CHMOD, Up: Intrinsic Procedures
  8109. 9.62 'CMPLX' -- Complex conversion function
  8110. ===========================================
  8111. _Description_:
  8112. 'CMPLX(X [, Y [, KIND]])' returns a complex number where X is
  8113. converted to the real component. If Y is present it is converted
  8114. to the imaginary component. If Y is not present then the imaginary
  8115. component is set to 0.0. If X is complex then Y must not be
  8116. present.
  8117. _Standard_:
  8118. Fortran 77 and later
  8119. _Class_:
  8120. Elemental function
  8121. _Syntax_:
  8122. 'RESULT = CMPLX(X [, Y [, KIND]])'
  8123. _Arguments_:
  8124. X The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
  8125. Y (Optional; only allowed if X is not 'COMPLEX'.)
  8126. May be 'INTEGER' or 'REAL'.
  8127. KIND (Optional) An 'INTEGER' initialization
  8128. expression indicating the kind parameter of the
  8129. result.
  8130. _Return value_:
  8131. The return value is of 'COMPLEX' type, with a kind equal to KIND if
  8132. it is specified. If KIND is not specified, the result is of the
  8133. default 'COMPLEX' kind, regardless of the kinds of X and Y.
  8134. _Example_:
  8135. program test_cmplx
  8136. integer :: i = 42
  8137. real :: x = 3.14
  8138. complex :: z
  8139. z = cmplx(i, x)
  8140. print *, z, cmplx(x)
  8141. end program test_cmplx
  8142. _See also_:
  8143. *note COMPLEX::
  8144. 
  8145. File: gfortran.info, Node: CO_BROADCAST, Next: CO_MAX, Prev: CMPLX, Up: Intrinsic Procedures
  8146. 9.63 'CO_BROADCAST' -- Copy a value to all images the current set of images
  8147. ===========================================================================
  8148. _Description_:
  8149. 'CO_BROADCAST' copies the value of argument A on the image with
  8150. image index 'SOURCE_IMAGE' to all images in the current team. A
  8151. becomes defined as if by intrinsic assignment. If the execution
  8152. was successful and STAT is present, it is assigned the value zero.
  8153. If the execution failed, STAT gets assigned a nonzero value and, if
  8154. present, ERRMSG gets assigned a value describing the occurred
  8155. error.
  8156. _Standard_:
  8157. Technical Specification (TS) 18508 or later
  8158. _Class_:
  8159. Collective subroutine
  8160. _Syntax_:
  8161. 'CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])'
  8162. _Arguments_:
  8163. A INTENT(INOUT) argument; shall have the same
  8164. dynamic type and type parameters on all
  8165. images of the current team. If it is an
  8166. array, it shall have the same shape on all
  8167. images.
  8168. SOURCE_IMAGE a scalar integer expression. It shall have
  8169. the same the same value on all images and
  8170. refer to an image of the current team.
  8171. STAT (optional) a scalar integer variable
  8172. ERRMSG (optional) a scalar character variable
  8173. _Example_:
  8174. program test
  8175. integer :: val(3)
  8176. if (this_image() == 1) then
  8177. val = [1, 5, 3]
  8178. end if
  8179. call co_broadcast (val, source_image=1)
  8180. print *, this_image, ":", val
  8181. end program test
  8182. _See also_:
  8183. *note CO_MAX::, *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::
  8184. 
  8185. File: gfortran.info, Node: CO_MAX, Next: CO_MIN, Prev: CO_BROADCAST, Up: Intrinsic Procedures
  8186. 9.64 'CO_MAX' -- Maximal value on the current set of images
  8187. ===========================================================
  8188. _Description_:
  8189. 'CO_MAX' determines element-wise the maximal value of A on all
  8190. images of the current team. If RESULT_IMAGE is present, the
  8191. maximum values are returned in A on the specified image only and
  8192. the value of A on the other images become undefined. If
  8193. RESULT_IMAGE is not present, the value is returned on all images.
  8194. If the execution was successful and STAT is present, it is assigned
  8195. the value zero. If the execution failed, STAT gets assigned a
  8196. nonzero value and, if present, ERRMSG gets assigned a value
  8197. describing the occurred error.
  8198. _Standard_:
  8199. Technical Specification (TS) 18508 or later
  8200. _Class_:
  8201. Collective subroutine
  8202. _Syntax_:
  8203. 'CALL CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])'
  8204. _Arguments_:
  8205. A shall be an integer, real or character
  8206. variable, which has the same type and type
  8207. parameters on all images of the team.
  8208. RESULT_IMAGE (optional) a scalar integer expression; if
  8209. present, it shall have the same the same
  8210. value on all images and refer to an image of
  8211. the current team.
  8212. STAT (optional) a scalar integer variable
  8213. ERRMSG (optional) a scalar character variable
  8214. _Example_:
  8215. program test
  8216. integer :: val
  8217. val = this_image ()
  8218. call co_max (val, result_image=1)
  8219. if (this_image() == 1) then
  8220. write(*,*) "Maximal value", val ! prints num_images()
  8221. end if
  8222. end program test
  8223. _See also_:
  8224. *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::, *note
  8225. CO_BROADCAST::
  8226. 
  8227. File: gfortran.info, Node: CO_MIN, Next: CO_REDUCE, Prev: CO_MAX, Up: Intrinsic Procedures
  8228. 9.65 'CO_MIN' -- Minimal value on the current set of images
  8229. ===========================================================
  8230. _Description_:
  8231. 'CO_MIN' determines element-wise the minimal value of A on all
  8232. images of the current team. If RESULT_IMAGE is present, the
  8233. minimal values are returned in A on the specified image only and
  8234. the value of A on the other images become undefined. If
  8235. RESULT_IMAGE is not present, the value is returned on all images.
  8236. If the execution was successful and STAT is present, it is assigned
  8237. the value zero. If the execution failed, STAT gets assigned a
  8238. nonzero value and, if present, ERRMSG gets assigned a value
  8239. describing the occurred error.
  8240. _Standard_:
  8241. Technical Specification (TS) 18508 or later
  8242. _Class_:
  8243. Collective subroutine
  8244. _Syntax_:
  8245. 'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
  8246. _Arguments_:
  8247. A shall be an integer, real or character
  8248. variable, which has the same type and type
  8249. parameters on all images of the team.
  8250. RESULT_IMAGE (optional) a scalar integer expression; if
  8251. present, it shall have the same the same
  8252. value on all images and refer to an image of
  8253. the current team.
  8254. STAT (optional) a scalar integer variable
  8255. ERRMSG (optional) a scalar character variable
  8256. _Example_:
  8257. program test
  8258. integer :: val
  8259. val = this_image ()
  8260. call co_min (val, result_image=1)
  8261. if (this_image() == 1) then
  8262. write(*,*) "Minimal value", val ! prints 1
  8263. end if
  8264. end program test
  8265. _See also_:
  8266. *note CO_MAX::, *note CO_SUM::, *note CO_REDUCE::, *note
  8267. CO_BROADCAST::
  8268. 
  8269. File: gfortran.info, Node: CO_REDUCE, Next: CO_SUM, Prev: CO_MIN, Up: Intrinsic Procedures
  8270. 9.66 'CO_REDUCE' -- Reduction of values on the current set of images
  8271. ====================================================================
  8272. _Description_:
  8273. 'CO_REDUCE' determines element-wise the reduction of the value of A
  8274. on all images of the current team. The pure function passed as
  8275. OPERATOR is used to pairwise reduce the values of A by passing
  8276. either the value of A of different images or the result values of
  8277. such a reduction as argument. If A is an array, the deduction is
  8278. done element wise. If RESULT_IMAGE is present, the result values
  8279. are returned in A on the specified image only and the value of A on
  8280. the other images become undefined. If RESULT_IMAGE is not present,
  8281. the value is returned on all images. If the execution was
  8282. successful and STAT is present, it is assigned the value zero. If
  8283. the execution failed, STAT gets assigned a nonzero value and, if
  8284. present, ERRMSG gets assigned a value describing the occurred
  8285. error.
  8286. _Standard_:
  8287. Technical Specification (TS) 18508 or later
  8288. _Class_:
  8289. Collective subroutine
  8290. _Syntax_:
  8291. 'CALL CO_REDUCE(A, OPERATOR, [, RESULT_IMAGE, STAT, ERRMSG])'
  8292. _Arguments_:
  8293. A is an 'INTENT(INOUT)' argument and shall be
  8294. nonpolymorphic. If it is allocatable, it
  8295. shall be allocated; if it is a pointer, it
  8296. shall be associated. A shall have the same
  8297. type and type parameters on all images of the
  8298. team; if it is an array, it shall have the
  8299. same shape on all images.
  8300. OPERATOR pure function with two scalar nonallocatable
  8301. arguments, which shall be nonpolymorphic and
  8302. have the same type and type parameters as A.
  8303. The function shall return a nonallocatable
  8304. scalar of the same type and type parameters
  8305. as A. The function shall be the same on all
  8306. images and with regards to the arguments
  8307. mathematically commutative and associative.
  8308. Note that OPERATOR may not be an elemental
  8309. function, unless it is an intrisic function.
  8310. RESULT_IMAGE (optional) a scalar integer expression; if
  8311. present, it shall have the same the same
  8312. value on all images and refer to an image of
  8313. the current team.
  8314. STAT (optional) a scalar integer variable
  8315. ERRMSG (optional) a scalar character variable
  8316. _Example_:
  8317. program test
  8318. integer :: val
  8319. val = this_image ()
  8320. call co_reduce (val, result_image=1, operator=myprod)
  8321. if (this_image() == 1) then
  8322. write(*,*) "Product value", val ! prints num_images() factorial
  8323. end if
  8324. contains
  8325. pure function myprod(a, b)
  8326. integer, value :: a, b
  8327. integer :: myprod
  8328. myprod = a * b
  8329. end function myprod
  8330. end program test
  8331. _Note_:
  8332. While the rules permit in principle an intrinsic function, none of
  8333. the intrinsics in the standard fulfill the criteria of having a
  8334. specific function, which takes two arguments of the same type and
  8335. returning that type as result.
  8336. _See also_:
  8337. *note CO_MIN::, *note CO_MAX::, *note CO_SUM::, *note
  8338. CO_BROADCAST::
  8339. 
  8340. File: gfortran.info, Node: CO_SUM, Next: COMMAND_ARGUMENT_COUNT, Prev: CO_REDUCE, Up: Intrinsic Procedures
  8341. 9.67 'CO_SUM' -- Sum of values on the current set of images
  8342. ===========================================================
  8343. _Description_:
  8344. 'CO_SUM' sums up the values of each element of A on all images of
  8345. the current team. If RESULT_IMAGE is present, the summed-up values
  8346. are returned in A on the specified image only and the value of A on
  8347. the other images become undefined. If RESULT_IMAGE is not present,
  8348. the value is returned on all images. If the execution was
  8349. successful and STAT is present, it is assigned the value zero. If
  8350. the execution failed, STAT gets assigned a nonzero value and, if
  8351. present, ERRMSG gets assigned a value describing the occurred
  8352. error.
  8353. _Standard_:
  8354. Technical Specification (TS) 18508 or later
  8355. _Class_:
  8356. Collective subroutine
  8357. _Syntax_:
  8358. 'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
  8359. _Arguments_:
  8360. A shall be an integer, real or complex
  8361. variable, which has the same type and type
  8362. parameters on all images of the team.
  8363. RESULT_IMAGE (optional) a scalar integer expression; if
  8364. present, it shall have the same the same
  8365. value on all images and refer to an image of
  8366. the current team.
  8367. STAT (optional) a scalar integer variable
  8368. ERRMSG (optional) a scalar character variable
  8369. _Example_:
  8370. program test
  8371. integer :: val
  8372. val = this_image ()
  8373. call co_sum (val, result_image=1)
  8374. if (this_image() == 1) then
  8375. write(*,*) "The sum is ", val ! prints (n**2 + n)/2,
  8376. ! with n = num_images()
  8377. end if
  8378. end program test
  8379. _See also_:
  8380. *note CO_MAX::, *note CO_MIN::, *note CO_REDUCE::, *note
  8381. CO_BROADCAST::
  8382. 
  8383. File: gfortran.info, Node: COMMAND_ARGUMENT_COUNT, Next: COMPILER_OPTIONS, Prev: CO_SUM, Up: Intrinsic Procedures
  8384. 9.68 'COMMAND_ARGUMENT_COUNT' -- Get number of command line arguments
  8385. =====================================================================
  8386. _Description_:
  8387. 'COMMAND_ARGUMENT_COUNT' returns the number of arguments passed on
  8388. the command line when the containing program was invoked.
  8389. _Standard_:
  8390. Fortran 2003 and later
  8391. _Class_:
  8392. Inquiry function
  8393. _Syntax_:
  8394. 'RESULT = COMMAND_ARGUMENT_COUNT()'
  8395. _Arguments_:
  8396. None
  8397. _Return value_:
  8398. The return value is an 'INTEGER' of default kind.
  8399. _Example_:
  8400. program test_command_argument_count
  8401. integer :: count
  8402. count = command_argument_count()
  8403. print *, count
  8404. end program test_command_argument_count
  8405. _See also_:
  8406. *note GET_COMMAND::, *note GET_COMMAND_ARGUMENT::
  8407. 
  8408. File: gfortran.info, Node: COMPILER_OPTIONS, Next: COMPILER_VERSION, Prev: COMMAND_ARGUMENT_COUNT, Up: Intrinsic Procedures
  8409. 9.69 'COMPILER_OPTIONS' -- Options passed to the compiler
  8410. =========================================================
  8411. _Description_:
  8412. 'COMPILER_OPTIONS' returns a string with the options used for
  8413. compiling.
  8414. _Standard_:
  8415. Fortran 2008
  8416. _Class_:
  8417. Inquiry function of the module 'ISO_FORTRAN_ENV'
  8418. _Syntax_:
  8419. 'STR = COMPILER_OPTIONS()'
  8420. _Arguments_:
  8421. None
  8422. _Return value_:
  8423. The return value is a default-kind string with system-dependent
  8424. length. It contains the compiler flags used to compile the file,
  8425. which called the 'COMPILER_OPTIONS' intrinsic.
  8426. _Example_:
  8427. use iso_fortran_env
  8428. print '(4a)', 'This file was compiled by ', &
  8429. compiler_version(), ' using the options ', &
  8430. compiler_options()
  8431. end
  8432. _See also_:
  8433. *note COMPILER_VERSION::, *note ISO_FORTRAN_ENV::
  8434. 
  8435. File: gfortran.info, Node: COMPILER_VERSION, Next: COMPLEX, Prev: COMPILER_OPTIONS, Up: Intrinsic Procedures
  8436. 9.70 'COMPILER_VERSION' -- Compiler version string
  8437. ==================================================
  8438. _Description_:
  8439. 'COMPILER_VERSION' returns a string with the name and the version
  8440. of the compiler.
  8441. _Standard_:
  8442. Fortran 2008
  8443. _Class_:
  8444. Inquiry function of the module 'ISO_FORTRAN_ENV'
  8445. _Syntax_:
  8446. 'STR = COMPILER_VERSION()'
  8447. _Arguments_:
  8448. None
  8449. _Return value_:
  8450. The return value is a default-kind string with system-dependent
  8451. length. It contains the name of the compiler and its version
  8452. number.
  8453. _Example_:
  8454. use iso_fortran_env
  8455. print '(4a)', 'This file was compiled by ', &
  8456. compiler_version(), ' using the options ', &
  8457. compiler_options()
  8458. end
  8459. _See also_:
  8460. *note COMPILER_OPTIONS::, *note ISO_FORTRAN_ENV::
  8461. 
  8462. File: gfortran.info, Node: COMPLEX, Next: CONJG, Prev: COMPILER_VERSION, Up: Intrinsic Procedures
  8463. 9.71 'COMPLEX' -- Complex conversion function
  8464. =============================================
  8465. _Description_:
  8466. 'COMPLEX(X, Y)' returns a complex number where X is converted to
  8467. the real component and Y is converted to the imaginary component.
  8468. _Standard_:
  8469. GNU extension
  8470. _Class_:
  8471. Elemental function
  8472. _Syntax_:
  8473. 'RESULT = COMPLEX(X, Y)'
  8474. _Arguments_:
  8475. X The type may be 'INTEGER' or 'REAL'.
  8476. Y The type may be 'INTEGER' or 'REAL'.
  8477. _Return value_:
  8478. If X and Y are both of 'INTEGER' type, then the return value is of
  8479. default 'COMPLEX' type.
  8480. If X and Y are of 'REAL' type, or one is of 'REAL' type and one is
  8481. of 'INTEGER' type, then the return value is of 'COMPLEX' type with
  8482. a kind equal to that of the 'REAL' argument with the highest
  8483. precision.
  8484. _Example_:
  8485. program test_complex
  8486. integer :: i = 42
  8487. real :: x = 3.14
  8488. print *, complex(i, x)
  8489. end program test_complex
  8490. _See also_:
  8491. *note CMPLX::
  8492. 
  8493. File: gfortran.info, Node: CONJG, Next: COS, Prev: COMPLEX, Up: Intrinsic Procedures
  8494. 9.72 'CONJG' -- Complex conjugate function
  8495. ==========================================
  8496. _Description_:
  8497. 'CONJG(Z)' returns the conjugate of Z. If Z is '(x, y)' then the
  8498. result is '(x, -y)'
  8499. _Standard_:
  8500. Fortran 77 and later, has an overload that is a GNU extension
  8501. _Class_:
  8502. Elemental function
  8503. _Syntax_:
  8504. 'Z = CONJG(Z)'
  8505. _Arguments_:
  8506. Z The type shall be 'COMPLEX'.
  8507. _Return value_:
  8508. The return value is of type 'COMPLEX'.
  8509. _Example_:
  8510. program test_conjg
  8511. complex :: z = (2.0, 3.0)
  8512. complex(8) :: dz = (2.71_8, -3.14_8)
  8513. z= conjg(z)
  8514. print *, z
  8515. dz = dconjg(dz)
  8516. print *, dz
  8517. end program test_conjg
  8518. _Specific names_:
  8519. Name Argument Return type Standard
  8520. 'DCONJG(Z)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8521. Z'
  8522. 
  8523. File: gfortran.info, Node: COS, Next: COSD, Prev: CONJG, Up: Intrinsic Procedures
  8524. 9.73 'COS' -- Cosine function
  8525. =============================
  8526. _Description_:
  8527. 'COS(X)' computes the cosine of X.
  8528. _Standard_:
  8529. Fortran 77 and later, has overloads that are GNU extensions
  8530. _Class_:
  8531. Elemental function
  8532. _Syntax_:
  8533. 'RESULT = COS(X)'
  8534. _Arguments_:
  8535. X The type shall be 'REAL' or 'COMPLEX'.
  8536. _Return value_:
  8537. The return value is of the same type and kind as X. The real part
  8538. of the result is in radians. If X is of the type 'REAL', the
  8539. return value lies in the range -1 \leq \cos (x) \leq 1.
  8540. _Example_:
  8541. program test_cos
  8542. real :: x = 0.0
  8543. x = cos(x)
  8544. end program test_cos
  8545. _Specific names_:
  8546. Name Argument Return type Standard
  8547. 'COS(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  8548. later
  8549. 'DCOS(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  8550. later
  8551. 'CCOS(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and
  8552. X' later
  8553. 'ZCOS(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8554. X'
  8555. 'CDCOS(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8556. X'
  8557. _See also_:
  8558. Inverse function: *note ACOS:: Degrees function: *note COSD::
  8559. 
  8560. File: gfortran.info, Node: COSD, Next: COSH, Prev: COS, Up: Intrinsic Procedures
  8561. 9.74 'COSD' -- Cosine function, degrees
  8562. =======================================
  8563. _Description_:
  8564. 'COSD(X)' computes the cosine of X in degrees.
  8565. This function is for compatibility only and should be avoided in
  8566. favor of standard constructs wherever possible.
  8567. _Standard_:
  8568. GNU extension, enabled with '-fdec-math'.
  8569. _Class_:
  8570. Elemental function
  8571. _Syntax_:
  8572. 'RESULT = COSD(X)'
  8573. _Arguments_:
  8574. X The type shall be 'REAL' or 'COMPLEX'.
  8575. _Return value_:
  8576. The return value is of the same type and kind as X. The real part
  8577. of the result is in degrees. If X is of the type 'REAL', the
  8578. return value lies in the range -1 \leq \cosd (x) \leq 1.
  8579. _Example_:
  8580. program test_cosd
  8581. real :: x = 0.0
  8582. x = cosd(x)
  8583. end program test_cosd
  8584. _Specific names_:
  8585. Name Argument Return type Standard
  8586. 'COSD(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  8587. 'DCOSD(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  8588. 'CCOSD(X)' 'COMPLEX(4) 'COMPLEX(4)' GNU extension
  8589. X'
  8590. 'ZCOSD(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8591. X'
  8592. 'CDCOSD(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8593. X'
  8594. _See also_:
  8595. Inverse function: *note ACOSD:: Radians function: *note COS::
  8596. 
  8597. File: gfortran.info, Node: COSH, Next: COTAN, Prev: COSD, Up: Intrinsic Procedures
  8598. 9.75 'COSH' -- Hyperbolic cosine function
  8599. =========================================
  8600. _Description_:
  8601. 'COSH(X)' computes the hyperbolic cosine of X.
  8602. _Standard_:
  8603. Fortran 77 and later, for a complex argument Fortran 2008 or later
  8604. _Class_:
  8605. Elemental function
  8606. _Syntax_:
  8607. 'X = COSH(X)'
  8608. _Arguments_:
  8609. X The type shall be 'REAL' or 'COMPLEX'.
  8610. _Return value_:
  8611. The return value has same type and kind as X. If X is complex, the
  8612. imaginary part of the result is in radians. If X is 'REAL', the
  8613. return value has a lower bound of one, \cosh (x) \geq 1.
  8614. _Example_:
  8615. program test_cosh
  8616. real(8) :: x = 1.0_8
  8617. x = cosh(x)
  8618. end program test_cosh
  8619. _Specific names_:
  8620. Name Argument Return type Standard
  8621. 'COSH(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  8622. later
  8623. 'DCOSH(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  8624. later
  8625. _See also_:
  8626. Inverse function: *note ACOSH::
  8627. 
  8628. File: gfortran.info, Node: COTAN, Next: COTAND, Prev: COSH, Up: Intrinsic Procedures
  8629. 9.76 'COTAN' -- Cotangent function
  8630. ==================================
  8631. _Description_:
  8632. 'COTAN(X)' computes the cotangent of X. Equivalent to 'COS(x)'
  8633. divided by 'SIN(x)', or '1 / TAN(x)'.
  8634. This function is for compatibility only and should be avoided in
  8635. favor of standard constructs wherever possible.
  8636. _Standard_:
  8637. GNU extension, enabled with '-fdec-math'.
  8638. _Class_:
  8639. Elemental function
  8640. _Syntax_:
  8641. 'RESULT = COTAN(X)'
  8642. _Arguments_:
  8643. X The type shall be 'REAL' or 'COMPLEX'.
  8644. _Return value_:
  8645. The return value has same type and kind as X, and its value is in
  8646. radians.
  8647. _Example_:
  8648. program test_cotan
  8649. real(8) :: x = 0.165_8
  8650. x = cotan(x)
  8651. end program test_cotan
  8652. _Specific names_:
  8653. Name Argument Return type Standard
  8654. 'COTAN(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  8655. 'DCOTAN(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  8656. _See also_:
  8657. Converse function: *note TAN:: Degrees function: *note COTAND::
  8658. 
  8659. File: gfortran.info, Node: COTAND, Next: COUNT, Prev: COTAN, Up: Intrinsic Procedures
  8660. 9.77 'COTAND' -- Cotangent function, degrees
  8661. ============================================
  8662. _Description_:
  8663. 'COTAND(X)' computes the cotangent of X in degrees. Equivalent to
  8664. 'COSD(x)' divided by 'SIND(x)', or '1 / TAND(x)'.
  8665. _Standard_:
  8666. GNU extension, enabled with '-fdec-math'.
  8667. This function is for compatibility only and should be avoided in
  8668. favor of standard constructs wherever possible.
  8669. _Class_:
  8670. Elemental function
  8671. _Syntax_:
  8672. 'RESULT = COTAND(X)'
  8673. _Arguments_:
  8674. X The type shall be 'REAL' or 'COMPLEX'.
  8675. _Return value_:
  8676. The return value has same type and kind as X, and its value is in
  8677. degrees.
  8678. _Example_:
  8679. program test_cotand
  8680. real(8) :: x = 0.165_8
  8681. x = cotand(x)
  8682. end program test_cotand
  8683. _Specific names_:
  8684. Name Argument Return type Standard
  8685. 'COTAND(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  8686. 'DCOTAND(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  8687. _See also_:
  8688. Converse function: *note TAND:: Radians function: *note COTAN::
  8689. 
  8690. File: gfortran.info, Node: COUNT, Next: CPU_TIME, Prev: COTAND, Up: Intrinsic Procedures
  8691. 9.78 'COUNT' -- Count function
  8692. ==============================
  8693. _Description_:
  8694. Counts the number of '.TRUE.' elements in a logical MASK, or, if
  8695. the DIM argument is supplied, counts the number of elements along
  8696. each row of the array in the DIM direction. If the array has zero
  8697. size, or all of the elements of MASK are '.FALSE.', then the result
  8698. is '0'.
  8699. _Standard_:
  8700. Fortran 90 and later, with KIND argument Fortran 2003 and later
  8701. _Class_:
  8702. Transformational function
  8703. _Syntax_:
  8704. 'RESULT = COUNT(MASK [, DIM, KIND])'
  8705. _Arguments_:
  8706. MASK The type shall be 'LOGICAL'.
  8707. DIM (Optional) The type shall be 'INTEGER'.
  8708. KIND (Optional) An 'INTEGER' initialization
  8709. expression indicating the kind parameter of the
  8710. result.
  8711. _Return value_:
  8712. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  8713. absent, the return value is of default integer kind. If DIM is
  8714. present, the result is an array with a rank one less than the rank
  8715. of ARRAY, and a size corresponding to the shape of ARRAY with the
  8716. DIM dimension removed.
  8717. _Example_:
  8718. program test_count
  8719. integer, dimension(2,3) :: a, b
  8720. logical, dimension(2,3) :: mask
  8721. a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
  8722. b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
  8723. print '(3i3)', a(1,:)
  8724. print '(3i3)', a(2,:)
  8725. print *
  8726. print '(3i3)', b(1,:)
  8727. print '(3i3)', b(2,:)
  8728. print *
  8729. mask = a.ne.b
  8730. print '(3l3)', mask(1,:)
  8731. print '(3l3)', mask(2,:)
  8732. print *
  8733. print '(3i3)', count(mask)
  8734. print *
  8735. print '(3i3)', count(mask, 1)
  8736. print *
  8737. print '(3i3)', count(mask, 2)
  8738. end program test_count
  8739. 
  8740. File: gfortran.info, Node: CPU_TIME, Next: CSHIFT, Prev: COUNT, Up: Intrinsic Procedures
  8741. 9.79 'CPU_TIME' -- CPU elapsed time in seconds
  8742. ==============================================
  8743. _Description_:
  8744. Returns a 'REAL' value representing the elapsed CPU time in
  8745. seconds. This is useful for testing segments of code to determine
  8746. execution time.
  8747. If a time source is available, time will be reported with
  8748. microsecond resolution. If no time source is available, TIME is
  8749. set to '-1.0'.
  8750. Note that TIME may contain a, system dependent, arbitrary offset
  8751. and may not start with '0.0'. For 'CPU_TIME', the absolute value
  8752. is meaningless, only differences between subsequent calls to this
  8753. subroutine, as shown in the example below, should be used.
  8754. _Standard_:
  8755. Fortran 95 and later
  8756. _Class_:
  8757. Subroutine
  8758. _Syntax_:
  8759. 'CALL CPU_TIME(TIME)'
  8760. _Arguments_:
  8761. TIME The type shall be 'REAL' with 'INTENT(OUT)'.
  8762. _Return value_:
  8763. None
  8764. _Example_:
  8765. program test_cpu_time
  8766. real :: start, finish
  8767. call cpu_time(start)
  8768. ! put code to test here
  8769. call cpu_time(finish)
  8770. print '("Time = ",f6.3," seconds.")',finish-start
  8771. end program test_cpu_time
  8772. _See also_:
  8773. *note SYSTEM_CLOCK::, *note DATE_AND_TIME::
  8774. 
  8775. File: gfortran.info, Node: CSHIFT, Next: CTIME, Prev: CPU_TIME, Up: Intrinsic Procedures
  8776. 9.80 'CSHIFT' -- Circular shift elements of an array
  8777. ====================================================
  8778. _Description_:
  8779. 'CSHIFT(ARRAY, SHIFT [, DIM])' performs a circular shift on
  8780. elements of ARRAY along the dimension of DIM. If DIM is omitted it
  8781. is taken to be '1'. DIM is a scalar of type 'INTEGER' in the range
  8782. of 1 \leq DIM \leq n) where n is the rank of ARRAY. If the rank of
  8783. ARRAY is one, then all elements of ARRAY are shifted by SHIFT
  8784. places. If rank is greater than one, then all complete rank one
  8785. sections of ARRAY along the given dimension are shifted. Elements
  8786. shifted out one end of each rank one section are shifted back in
  8787. the other end.
  8788. _Standard_:
  8789. Fortran 90 and later
  8790. _Class_:
  8791. Transformational function
  8792. _Syntax_:
  8793. 'RESULT = CSHIFT(ARRAY, SHIFT [, DIM])'
  8794. _Arguments_:
  8795. ARRAY Shall be an array of any type.
  8796. SHIFT The type shall be 'INTEGER'.
  8797. DIM The type shall be 'INTEGER'.
  8798. _Return value_:
  8799. Returns an array of same type and rank as the ARRAY argument.
  8800. _Example_:
  8801. program test_cshift
  8802. integer, dimension(3,3) :: a
  8803. a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
  8804. print '(3i3)', a(1,:)
  8805. print '(3i3)', a(2,:)
  8806. print '(3i3)', a(3,:)
  8807. a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
  8808. print *
  8809. print '(3i3)', a(1,:)
  8810. print '(3i3)', a(2,:)
  8811. print '(3i3)', a(3,:)
  8812. end program test_cshift
  8813. 
  8814. File: gfortran.info, Node: CTIME, Next: DATE_AND_TIME, Prev: CSHIFT, Up: Intrinsic Procedures
  8815. 9.81 'CTIME' -- Convert a time into a string
  8816. ============================================
  8817. _Description_:
  8818. 'CTIME' converts a system time value, such as returned by *note
  8819. TIME8::, to a string. The output will be of the form 'Sat Aug 19
  8820. 18:13:14 1995'.
  8821. This intrinsic is provided in both subroutine and function forms;
  8822. however, only one form can be used in any given program unit.
  8823. _Standard_:
  8824. GNU extension
  8825. _Class_:
  8826. Subroutine, function
  8827. _Syntax_:
  8828. 'CALL CTIME(TIME, RESULT)'.
  8829. 'RESULT = CTIME(TIME)'.
  8830. _Arguments_:
  8831. TIME The type shall be of type 'INTEGER'.
  8832. RESULT The type shall be of type 'CHARACTER' and of
  8833. default kind. It is an 'INTENT(OUT)' argument.
  8834. If the length of this variable is too short for
  8835. the time and date string to fit completely, it
  8836. will be blank on procedure return.
  8837. _Return value_:
  8838. The converted date and time as a string.
  8839. _Example_:
  8840. program test_ctime
  8841. integer(8) :: i
  8842. character(len=30) :: date
  8843. i = time8()
  8844. ! Do something, main part of the program
  8845. call ctime(i,date)
  8846. print *, 'Program was started on ', date
  8847. end program test_ctime
  8848. _See Also_:
  8849. *note DATE_AND_TIME::, *note GMTIME::, *note LTIME::, *note TIME::,
  8850. *note TIME8::
  8851. 
  8852. File: gfortran.info, Node: DATE_AND_TIME, Next: DBLE, Prev: CTIME, Up: Intrinsic Procedures
  8853. 9.82 'DATE_AND_TIME' -- Date and time subroutine
  8854. ================================================
  8855. _Description_:
  8856. 'DATE_AND_TIME(DATE, TIME, ZONE, VALUES)' gets the corresponding
  8857. date and time information from the real-time system clock. DATE is
  8858. 'INTENT(OUT)' and has form ccyymmdd. TIME is 'INTENT(OUT)' and has
  8859. form hhmmss.sss. ZONE is 'INTENT(OUT)' and has form (+-)hhmm,
  8860. representing the difference with respect to Coordinated Universal
  8861. Time (UTC). Unavailable time and date parameters return blanks.
  8862. VALUES is 'INTENT(OUT)' and provides the following:
  8863. 'VALUE(1)': The year
  8864. 'VALUE(2)': The month
  8865. 'VALUE(3)': The day of the month
  8866. 'VALUE(4)': Time difference with UTC in
  8867. minutes
  8868. 'VALUE(5)': The hour of the day
  8869. 'VALUE(6)': The minutes of the hour
  8870. 'VALUE(7)': The seconds of the minute
  8871. 'VALUE(8)': The milliseconds of the
  8872. second
  8873. _Standard_:
  8874. Fortran 90 and later
  8875. _Class_:
  8876. Subroutine
  8877. _Syntax_:
  8878. 'CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])'
  8879. _Arguments_:
  8880. DATE (Optional) The type shall be 'CHARACTER(LEN=8)'
  8881. or larger, and of default kind.
  8882. TIME (Optional) The type shall be 'CHARACTER(LEN=10)'
  8883. or larger, and of default kind.
  8884. ZONE (Optional) The type shall be 'CHARACTER(LEN=5)'
  8885. or larger, and of default kind.
  8886. VALUES (Optional) The type shall be 'INTEGER(8)'.
  8887. _Return value_:
  8888. None
  8889. _Example_:
  8890. program test_time_and_date
  8891. character(8) :: date
  8892. character(10) :: time
  8893. character(5) :: zone
  8894. integer,dimension(8) :: values
  8895. ! using keyword arguments
  8896. call date_and_time(date,time,zone,values)
  8897. call date_and_time(DATE=date,ZONE=zone)
  8898. call date_and_time(TIME=time)
  8899. call date_and_time(VALUES=values)
  8900. print '(a,2x,a,2x,a)', date, time, zone
  8901. print '(8i5)', values
  8902. end program test_time_and_date
  8903. _See also_:
  8904. *note CPU_TIME::, *note SYSTEM_CLOCK::
  8905. 
  8906. File: gfortran.info, Node: DBLE, Next: DCMPLX, Prev: DATE_AND_TIME, Up: Intrinsic Procedures
  8907. 9.83 'DBLE' -- Double conversion function
  8908. =========================================
  8909. _Description_:
  8910. 'DBLE(A)' Converts A to double precision real type.
  8911. _Standard_:
  8912. Fortran 77 and later
  8913. _Class_:
  8914. Elemental function
  8915. _Syntax_:
  8916. 'RESULT = DBLE(A)'
  8917. _Arguments_:
  8918. A The type shall be 'INTEGER', 'REAL', or
  8919. 'COMPLEX'.
  8920. _Return value_:
  8921. The return value is of type double precision real.
  8922. _Example_:
  8923. program test_dble
  8924. real :: x = 2.18
  8925. integer :: i = 5
  8926. complex :: z = (2.3,1.14)
  8927. print *, dble(x), dble(i), dble(z)
  8928. end program test_dble
  8929. _See also_:
  8930. *note REAL::
  8931. 
  8932. File: gfortran.info, Node: DCMPLX, Next: DIGITS, Prev: DBLE, Up: Intrinsic Procedures
  8933. 9.84 'DCMPLX' -- Double complex conversion function
  8934. ===================================================
  8935. _Description_:
  8936. 'DCMPLX(X [,Y])' returns a double complex number where X is
  8937. converted to the real component. If Y is present it is converted
  8938. to the imaginary component. If Y is not present then the imaginary
  8939. component is set to 0.0. If X is complex then Y must not be
  8940. present.
  8941. _Standard_:
  8942. GNU extension
  8943. _Class_:
  8944. Elemental function
  8945. _Syntax_:
  8946. 'RESULT = DCMPLX(X [, Y])'
  8947. _Arguments_:
  8948. X The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
  8949. Y (Optional if X is not 'COMPLEX'.) May be
  8950. 'INTEGER' or 'REAL'.
  8951. _Return value_:
  8952. The return value is of type 'COMPLEX(8)'
  8953. _Example_:
  8954. program test_dcmplx
  8955. integer :: i = 42
  8956. real :: x = 3.14
  8957. complex :: z
  8958. z = cmplx(i, x)
  8959. print *, dcmplx(i)
  8960. print *, dcmplx(x)
  8961. print *, dcmplx(z)
  8962. print *, dcmplx(x,i)
  8963. end program test_dcmplx
  8964. 
  8965. File: gfortran.info, Node: DIGITS, Next: DIM, Prev: DCMPLX, Up: Intrinsic Procedures
  8966. 9.85 'DIGITS' -- Significant binary digits function
  8967. ===================================================
  8968. _Description_:
  8969. 'DIGITS(X)' returns the number of significant binary digits of the
  8970. internal model representation of X. For example, on a system using
  8971. a 32-bit floating point representation, a default real number would
  8972. likely return 24.
  8973. _Standard_:
  8974. Fortran 90 and later
  8975. _Class_:
  8976. Inquiry function
  8977. _Syntax_:
  8978. 'RESULT = DIGITS(X)'
  8979. _Arguments_:
  8980. X The type may be 'INTEGER' or 'REAL'.
  8981. _Return value_:
  8982. The return value is of type 'INTEGER'.
  8983. _Example_:
  8984. program test_digits
  8985. integer :: i = 12345
  8986. real :: x = 3.143
  8987. real(8) :: y = 2.33
  8988. print *, digits(i)
  8989. print *, digits(x)
  8990. print *, digits(y)
  8991. end program test_digits
  8992. 
  8993. File: gfortran.info, Node: DIM, Next: DOT_PRODUCT, Prev: DIGITS, Up: Intrinsic Procedures
  8994. 9.86 'DIM' -- Positive difference
  8995. =================================
  8996. _Description_:
  8997. 'DIM(X,Y)' returns the difference 'X-Y' if the result is positive;
  8998. otherwise returns zero.
  8999. _Standard_:
  9000. Fortran 77 and later
  9001. _Class_:
  9002. Elemental function
  9003. _Syntax_:
  9004. 'RESULT = DIM(X, Y)'
  9005. _Arguments_:
  9006. X The type shall be 'INTEGER' or 'REAL'
  9007. Y The type shall be the same type and kind as X.
  9008. (As a GNU extension, arguments of different
  9009. kinds are permitted.)
  9010. _Return value_:
  9011. The return value is of type 'INTEGER' or 'REAL'. (As a GNU
  9012. extension, kind is the largest kind of the actual arguments.)
  9013. _Example_:
  9014. program test_dim
  9015. integer :: i
  9016. real(8) :: x
  9017. i = dim(4, 15)
  9018. x = dim(4.345_8, 2.111_8)
  9019. print *, i
  9020. print *, x
  9021. end program test_dim
  9022. _Specific names_:
  9023. Name Argument Return type Standard
  9024. 'DIM(X,Y)' 'REAL(4) X, 'REAL(4)' Fortran 77 and
  9025. Y' later
  9026. 'IDIM(X,Y)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and
  9027. X, Y' later
  9028. 'DDIM(X,Y)' 'REAL(8) X, 'REAL(8)' Fortran 77 and
  9029. Y' later
  9030. 
  9031. File: gfortran.info, Node: DOT_PRODUCT, Next: DPROD, Prev: DIM, Up: Intrinsic Procedures
  9032. 9.87 'DOT_PRODUCT' -- Dot product function
  9033. ==========================================
  9034. _Description_:
  9035. 'DOT_PRODUCT(VECTOR_A, VECTOR_B)' computes the dot product
  9036. multiplication of two vectors VECTOR_A and VECTOR_B. The two
  9037. vectors may be either numeric or logical and must be arrays of rank
  9038. one and of equal size. If the vectors are 'INTEGER' or 'REAL', the
  9039. result is 'SUM(VECTOR_A*VECTOR_B)'. If the vectors are 'COMPLEX',
  9040. the result is 'SUM(CONJG(VECTOR_A)*VECTOR_B)'. If the vectors are
  9041. 'LOGICAL', the result is 'ANY(VECTOR_A .AND. VECTOR_B)'.
  9042. _Standard_:
  9043. Fortran 90 and later
  9044. _Class_:
  9045. Transformational function
  9046. _Syntax_:
  9047. 'RESULT = DOT_PRODUCT(VECTOR_A, VECTOR_B)'
  9048. _Arguments_:
  9049. VECTOR_A The type shall be numeric or 'LOGICAL', rank 1.
  9050. VECTOR_B The type shall be numeric if VECTOR_A is of
  9051. numeric type or 'LOGICAL' if VECTOR_A is of type
  9052. 'LOGICAL'. VECTOR_B shall be a rank-one array.
  9053. _Return value_:
  9054. If the arguments are numeric, the return value is a scalar of
  9055. numeric type, 'INTEGER', 'REAL', or 'COMPLEX'. If the arguments
  9056. are 'LOGICAL', the return value is '.TRUE.' or '.FALSE.'.
  9057. _Example_:
  9058. program test_dot_prod
  9059. integer, dimension(3) :: a, b
  9060. a = (/ 1, 2, 3 /)
  9061. b = (/ 4, 5, 6 /)
  9062. print '(3i3)', a
  9063. print *
  9064. print '(3i3)', b
  9065. print *
  9066. print *, dot_product(a,b)
  9067. end program test_dot_prod
  9068. 
  9069. File: gfortran.info, Node: DPROD, Next: DREAL, Prev: DOT_PRODUCT, Up: Intrinsic Procedures
  9070. 9.88 'DPROD' -- Double product function
  9071. =======================================
  9072. _Description_:
  9073. 'DPROD(X,Y)' returns the product 'X*Y'.
  9074. _Standard_:
  9075. Fortran 77 and later
  9076. _Class_:
  9077. Elemental function
  9078. _Syntax_:
  9079. 'RESULT = DPROD(X, Y)'
  9080. _Arguments_:
  9081. X The type shall be 'REAL'.
  9082. Y The type shall be 'REAL'.
  9083. _Return value_:
  9084. The return value is of type 'REAL(8)'.
  9085. _Example_:
  9086. program test_dprod
  9087. real :: x = 5.2
  9088. real :: y = 2.3
  9089. real(8) :: d
  9090. d = dprod(x,y)
  9091. print *, d
  9092. end program test_dprod
  9093. _Specific names_:
  9094. Name Argument Return type Standard
  9095. 'DPROD(X,Y)' 'REAL(4) X, 'REAL(8)' Fortran 77 and
  9096. Y' later
  9097. 
  9098. File: gfortran.info, Node: DREAL, Next: DSHIFTL, Prev: DPROD, Up: Intrinsic Procedures
  9099. 9.89 'DREAL' -- Double real part function
  9100. =========================================
  9101. _Description_:
  9102. 'DREAL(Z)' returns the real part of complex variable Z.
  9103. _Standard_:
  9104. GNU extension
  9105. _Class_:
  9106. Elemental function
  9107. _Syntax_:
  9108. 'RESULT = DREAL(A)'
  9109. _Arguments_:
  9110. A The type shall be 'COMPLEX(8)'.
  9111. _Return value_:
  9112. The return value is of type 'REAL(8)'.
  9113. _Example_:
  9114. program test_dreal
  9115. complex(8) :: z = (1.3_8,7.2_8)
  9116. print *, dreal(z)
  9117. end program test_dreal
  9118. _See also_:
  9119. *note AIMAG::
  9120. 
  9121. File: gfortran.info, Node: DSHIFTL, Next: DSHIFTR, Prev: DREAL, Up: Intrinsic Procedures
  9122. 9.90 'DSHIFTL' -- Combined left shift
  9123. =====================================
  9124. _Description_:
  9125. 'DSHIFTL(I, J, SHIFT)' combines bits of I and J. The rightmost
  9126. SHIFT bits of the result are the leftmost SHIFT bits of J, and the
  9127. remaining bits are the rightmost bits of I.
  9128. _Standard_:
  9129. Fortran 2008 and later
  9130. _Class_:
  9131. Elemental function
  9132. _Syntax_:
  9133. 'RESULT = DSHIFTL(I, J, SHIFT)'
  9134. _Arguments_:
  9135. I Shall be of type 'INTEGER' or a BOZ constant.
  9136. J Shall be of type 'INTEGER' or a BOZ constant.
  9137. If both I and J have integer type, then they
  9138. shall have the same kind type parameter. I and
  9139. J shall not both be BOZ constants.
  9140. SHIFT Shall be of type 'INTEGER'. It shall be
  9141. nonnegative. If I is not a BOZ constant, then
  9142. SHIFT shall be less than or equal to
  9143. 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
  9144. than or equal to 'BIT_SIZE(J)'.
  9145. _Return value_:
  9146. If either I or J is a BOZ constant, it is first converted as if by
  9147. the intrinsic function 'INT' to an integer type with the kind type
  9148. parameter of the other.
  9149. _See also_:
  9150. *note DSHIFTR::
  9151. 
  9152. File: gfortran.info, Node: DSHIFTR, Next: DTIME, Prev: DSHIFTL, Up: Intrinsic Procedures
  9153. 9.91 'DSHIFTR' -- Combined right shift
  9154. ======================================
  9155. _Description_:
  9156. 'DSHIFTR(I, J, SHIFT)' combines bits of I and J. The leftmost
  9157. SHIFT bits of the result are the rightmost SHIFT bits of I, and the
  9158. remaining bits are the leftmost bits of J.
  9159. _Standard_:
  9160. Fortran 2008 and later
  9161. _Class_:
  9162. Elemental function
  9163. _Syntax_:
  9164. 'RESULT = DSHIFTR(I, J, SHIFT)'
  9165. _Arguments_:
  9166. I Shall be of type 'INTEGER' or a BOZ constant.
  9167. J Shall be of type 'INTEGER' or a BOZ constant.
  9168. If both I and J have integer type, then they
  9169. shall have the same kind type parameter. I and
  9170. J shall not both be BOZ constants.
  9171. SHIFT Shall be of type 'INTEGER'. It shall be
  9172. nonnegative. If I is not a BOZ constant, then
  9173. SHIFT shall be less than or equal to
  9174. 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
  9175. than or equal to 'BIT_SIZE(J)'.
  9176. _Return value_:
  9177. If either I or J is a BOZ constant, it is first converted as if by
  9178. the intrinsic function 'INT' to an integer type with the kind type
  9179. parameter of the other.
  9180. _See also_:
  9181. *note DSHIFTL::
  9182. 
  9183. File: gfortran.info, Node: DTIME, Next: EOSHIFT, Prev: DSHIFTR, Up: Intrinsic Procedures
  9184. 9.92 'DTIME' -- Execution time subroutine (or function)
  9185. =======================================================
  9186. _Description_:
  9187. 'DTIME(VALUES, TIME)' initially returns the number of seconds of
  9188. runtime since the start of the process's execution in TIME. VALUES
  9189. returns the user and system components of this time in 'VALUES(1)'
  9190. and 'VALUES(2)' respectively. TIME is equal to 'VALUES(1) +
  9191. VALUES(2)'.
  9192. Subsequent invocations of 'DTIME' return values accumulated since
  9193. the previous invocation.
  9194. On some systems, the underlying timings are represented using types
  9195. with sufficiently small limits that overflows (wrap around) are
  9196. possible, such as 32-bit types. Therefore, the values returned by
  9197. this intrinsic might be, or become, negative, or numerically less
  9198. than previous values, during a single run of the compiled program.
  9199. Please note, that this implementation is thread safe if used within
  9200. OpenMP directives, i.e., its state will be consistent while called
  9201. from multiple threads. However, if 'DTIME' is called from multiple
  9202. threads, the result is still the time since the last invocation.
  9203. This may not give the intended results. If possible, use
  9204. 'CPU_TIME' instead.
  9205. This intrinsic is provided in both subroutine and function forms;
  9206. however, only one form can be used in any given program unit.
  9207. VALUES and TIME are 'INTENT(OUT)' and provide the following:
  9208. 'VALUES(1)': User time in seconds.
  9209. 'VALUES(2)': System time in seconds.
  9210. 'TIME': Run time since start in
  9211. seconds.
  9212. _Standard_:
  9213. GNU extension
  9214. _Class_:
  9215. Subroutine, function
  9216. _Syntax_:
  9217. 'CALL DTIME(VALUES, TIME)'.
  9218. 'TIME = DTIME(VALUES)', (not recommended).
  9219. _Arguments_:
  9220. VALUES The type shall be 'REAL(4), DIMENSION(2)'.
  9221. TIME The type shall be 'REAL(4)'.
  9222. _Return value_:
  9223. Elapsed time in seconds since the last invocation or since the
  9224. start of program execution if not called before.
  9225. _Example_:
  9226. program test_dtime
  9227. integer(8) :: i, j
  9228. real, dimension(2) :: tarray
  9229. real :: result
  9230. call dtime(tarray, result)
  9231. print *, result
  9232. print *, tarray(1)
  9233. print *, tarray(2)
  9234. do i=1,100000000 ! Just a delay
  9235. j = i * i - i
  9236. end do
  9237. call dtime(tarray, result)
  9238. print *, result
  9239. print *, tarray(1)
  9240. print *, tarray(2)
  9241. end program test_dtime
  9242. _See also_:
  9243. *note CPU_TIME::
  9244. 
  9245. File: gfortran.info, Node: EOSHIFT, Next: EPSILON, Prev: DTIME, Up: Intrinsic Procedures
  9246. 9.93 'EOSHIFT' -- End-off shift elements of an array
  9247. ====================================================
  9248. _Description_:
  9249. 'EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])' performs an end-off shift
  9250. on elements of ARRAY along the dimension of DIM. If DIM is omitted
  9251. it is taken to be '1'. DIM is a scalar of type 'INTEGER' in the
  9252. range of 1 \leq DIM \leq n) where n is the rank of ARRAY. If the
  9253. rank of ARRAY is one, then all elements of ARRAY are shifted by
  9254. SHIFT places. If rank is greater than one, then all complete rank
  9255. one sections of ARRAY along the given dimension are shifted.
  9256. Elements shifted out one end of each rank one section are dropped.
  9257. If BOUNDARY is present then the corresponding value of from
  9258. BOUNDARY is copied back in the other end. If BOUNDARY is not
  9259. present then the following are copied in depending on the type of
  9260. ARRAY.
  9261. _Array _Boundary Value_
  9262. Type_
  9263. Numeric 0 of the type and kind of ARRAY.
  9264. Logical '.FALSE.'.
  9265. Character(LEN)LEN blanks.
  9266. _Standard_:
  9267. Fortran 90 and later
  9268. _Class_:
  9269. Transformational function
  9270. _Syntax_:
  9271. 'RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])'
  9272. _Arguments_:
  9273. ARRAY May be any type, not scalar.
  9274. SHIFT The type shall be 'INTEGER'.
  9275. BOUNDARY Same type as ARRAY.
  9276. DIM The type shall be 'INTEGER'.
  9277. _Return value_:
  9278. Returns an array of same type and rank as the ARRAY argument.
  9279. _Example_:
  9280. program test_eoshift
  9281. integer, dimension(3,3) :: a
  9282. a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
  9283. print '(3i3)', a(1,:)
  9284. print '(3i3)', a(2,:)
  9285. print '(3i3)', a(3,:)
  9286. a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
  9287. print *
  9288. print '(3i3)', a(1,:)
  9289. print '(3i3)', a(2,:)
  9290. print '(3i3)', a(3,:)
  9291. end program test_eoshift
  9292. 
  9293. File: gfortran.info, Node: EPSILON, Next: ERF, Prev: EOSHIFT, Up: Intrinsic Procedures
  9294. 9.94 'EPSILON' -- Epsilon function
  9295. ==================================
  9296. _Description_:
  9297. 'EPSILON(X)' returns the smallest number E of the same kind as X
  9298. such that 1 + E > 1.
  9299. _Standard_:
  9300. Fortran 90 and later
  9301. _Class_:
  9302. Inquiry function
  9303. _Syntax_:
  9304. 'RESULT = EPSILON(X)'
  9305. _Arguments_:
  9306. X The type shall be 'REAL'.
  9307. _Return value_:
  9308. The return value is of same type as the argument.
  9309. _Example_:
  9310. program test_epsilon
  9311. real :: x = 3.143
  9312. real(8) :: y = 2.33
  9313. print *, EPSILON(x)
  9314. print *, EPSILON(y)
  9315. end program test_epsilon
  9316. 
  9317. File: gfortran.info, Node: ERF, Next: ERFC, Prev: EPSILON, Up: Intrinsic Procedures
  9318. 9.95 'ERF' -- Error function
  9319. ============================
  9320. _Description_:
  9321. 'ERF(X)' computes the error function of X.
  9322. _Standard_:
  9323. Fortran 2008 and later
  9324. _Class_:
  9325. Elemental function
  9326. _Syntax_:
  9327. 'RESULT = ERF(X)'
  9328. _Arguments_:
  9329. X The type shall be 'REAL'.
  9330. _Return value_:
  9331. The return value is of type 'REAL', of the same kind as X and lies
  9332. in the range -1 \leq erf (x) \leq 1 .
  9333. _Example_:
  9334. program test_erf
  9335. real(8) :: x = 0.17_8
  9336. x = erf(x)
  9337. end program test_erf
  9338. _Specific names_:
  9339. Name Argument Return type Standard
  9340. 'DERF(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  9341. 
  9342. File: gfortran.info, Node: ERFC, Next: ERFC_SCALED, Prev: ERF, Up: Intrinsic Procedures
  9343. 9.96 'ERFC' -- Error function
  9344. =============================
  9345. _Description_:
  9346. 'ERFC(X)' computes the complementary error function of X.
  9347. _Standard_:
  9348. Fortran 2008 and later
  9349. _Class_:
  9350. Elemental function
  9351. _Syntax_:
  9352. 'RESULT = ERFC(X)'
  9353. _Arguments_:
  9354. X The type shall be 'REAL'.
  9355. _Return value_:
  9356. The return value is of type 'REAL' and of the same kind as X. It
  9357. lies in the range 0 \leq erfc (x) \leq 2 .
  9358. _Example_:
  9359. program test_erfc
  9360. real(8) :: x = 0.17_8
  9361. x = erfc(x)
  9362. end program test_erfc
  9363. _Specific names_:
  9364. Name Argument Return type Standard
  9365. 'DERFC(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  9366. 
  9367. File: gfortran.info, Node: ERFC_SCALED, Next: ETIME, Prev: ERFC, Up: Intrinsic Procedures
  9368. 9.97 'ERFC_SCALED' -- Error function
  9369. ====================================
  9370. _Description_:
  9371. 'ERFC_SCALED(X)' computes the exponentially-scaled complementary
  9372. error function of X.
  9373. _Standard_:
  9374. Fortran 2008 and later
  9375. _Class_:
  9376. Elemental function
  9377. _Syntax_:
  9378. 'RESULT = ERFC_SCALED(X)'
  9379. _Arguments_:
  9380. X The type shall be 'REAL'.
  9381. _Return value_:
  9382. The return value is of type 'REAL' and of the same kind as X.
  9383. _Example_:
  9384. program test_erfc_scaled
  9385. real(8) :: x = 0.17_8
  9386. x = erfc_scaled(x)
  9387. end program test_erfc_scaled
  9388. 
  9389. File: gfortran.info, Node: ETIME, Next: EVENT_QUERY, Prev: ERFC_SCALED, Up: Intrinsic Procedures
  9390. 9.98 'ETIME' -- Execution time subroutine (or function)
  9391. =======================================================
  9392. _Description_:
  9393. 'ETIME(VALUES, TIME)' returns the number of seconds of runtime
  9394. since the start of the process's execution in TIME. VALUES returns
  9395. the user and system components of this time in 'VALUES(1)' and
  9396. 'VALUES(2)' respectively. TIME is equal to 'VALUES(1) +
  9397. VALUES(2)'.
  9398. On some systems, the underlying timings are represented using types
  9399. with sufficiently small limits that overflows (wrap around) are
  9400. possible, such as 32-bit types. Therefore, the values returned by
  9401. this intrinsic might be, or become, negative, or numerically less
  9402. than previous values, during a single run of the compiled program.
  9403. This intrinsic is provided in both subroutine and function forms;
  9404. however, only one form can be used in any given program unit.
  9405. VALUES and TIME are 'INTENT(OUT)' and provide the following:
  9406. 'VALUES(1)': User time in seconds.
  9407. 'VALUES(2)': System time in seconds.
  9408. 'TIME': Run time since start in seconds.
  9409. _Standard_:
  9410. GNU extension
  9411. _Class_:
  9412. Subroutine, function
  9413. _Syntax_:
  9414. 'CALL ETIME(VALUES, TIME)'.
  9415. 'TIME = ETIME(VALUES)', (not recommended).
  9416. _Arguments_:
  9417. VALUES The type shall be 'REAL(4), DIMENSION(2)'.
  9418. TIME The type shall be 'REAL(4)'.
  9419. _Return value_:
  9420. Elapsed time in seconds since the start of program execution.
  9421. _Example_:
  9422. program test_etime
  9423. integer(8) :: i, j
  9424. real, dimension(2) :: tarray
  9425. real :: result
  9426. call ETIME(tarray, result)
  9427. print *, result
  9428. print *, tarray(1)
  9429. print *, tarray(2)
  9430. do i=1,100000000 ! Just a delay
  9431. j = i * i - i
  9432. end do
  9433. call ETIME(tarray, result)
  9434. print *, result
  9435. print *, tarray(1)
  9436. print *, tarray(2)
  9437. end program test_etime
  9438. _See also_:
  9439. *note CPU_TIME::
  9440. 
  9441. File: gfortran.info, Node: EVENT_QUERY, Next: EXECUTE_COMMAND_LINE, Prev: ETIME, Up: Intrinsic Procedures
  9442. 9.99 'EVENT_QUERY' -- Query whether a coarray event has occurred
  9443. ================================================================
  9444. _Description_:
  9445. 'EVENT_QUERY' assignes the number of events to COUNT which have
  9446. been posted to the EVENT variable and not yet been removed by
  9447. calling 'EVENT WAIT'. When STAT is present and the invocation was
  9448. successful, it is assigned the value 0. If it is present and the
  9449. invocation has failed, it is assigned a positive value and COUNT is
  9450. assigned the value -1.
  9451. _Standard_:
  9452. TS 18508 or later
  9453. _Class_:
  9454. subroutine
  9455. _Syntax_:
  9456. 'CALL EVENT_QUERY (EVENT, COUNT [, STAT])'
  9457. _Arguments_:
  9458. EVENT (intent(IN)) Scalar of type 'EVENT_TYPE',
  9459. defined in 'ISO_FORTRAN_ENV'; shall not be
  9460. coindexed.
  9461. COUNT (intent(out))Scalar integer with at least the
  9462. precision of default integer.
  9463. STAT (optional) Scalar default-kind integer variable.
  9464. _Example_:
  9465. program atomic
  9466. use iso_fortran_env
  9467. implicit none
  9468. type(event_type) :: event_value_has_been_set[*]
  9469. integer :: cnt
  9470. if (this_image() == 1) then
  9471. call event_query (event_value_has_been_set, cnt)
  9472. if (cnt > 0) write(*,*) "Value has been set"
  9473. elseif (this_image() == 2) then
  9474. event post (event_value_has_been_set[1])
  9475. end if
  9476. end program atomic
  9477. 
  9478. File: gfortran.info, Node: EXECUTE_COMMAND_LINE, Next: EXIT, Prev: EVENT_QUERY, Up: Intrinsic Procedures
  9479. 9.100 'EXECUTE_COMMAND_LINE' -- Execute a shell command
  9480. =======================================================
  9481. _Description_:
  9482. 'EXECUTE_COMMAND_LINE' runs a shell command, synchronously or
  9483. asynchronously.
  9484. The 'COMMAND' argument is passed to the shell and executed (The
  9485. shell is 'sh' on Unix systems, and 'cmd.exe' on Windows.). If
  9486. 'WAIT' is present and has the value false, the execution of the
  9487. command is asynchronous if the system supports it; otherwise, the
  9488. command is executed synchronously using the C library's 'system'
  9489. call.
  9490. The three last arguments allow the user to get status information.
  9491. After synchronous execution, 'EXITSTAT' contains the integer exit
  9492. code of the command, as returned by 'system'. 'CMDSTAT' is set to
  9493. zero if the command line was executed (whatever its exit status
  9494. was). 'CMDMSG' is assigned an error message if an error has
  9495. occurred.
  9496. Note that the 'system' function need not be thread-safe. It is the
  9497. responsibility of the user to ensure that 'system' is not called
  9498. concurrently.
  9499. For asynchronous execution on supported targets, the POSIX
  9500. 'posix_spawn' or 'fork' functions are used. Also, a signal handler
  9501. for the 'SIGCHLD' signal is installed.
  9502. _Standard_:
  9503. Fortran 2008 and later
  9504. _Class_:
  9505. Subroutine
  9506. _Syntax_:
  9507. 'CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT,
  9508. CMDMSG ])'
  9509. _Arguments_:
  9510. COMMAND Shall be a default 'CHARACTER' scalar.
  9511. WAIT (Optional) Shall be a default 'LOGICAL' scalar.
  9512. EXITSTAT (Optional) Shall be an 'INTEGER' of the default
  9513. kind.
  9514. CMDSTAT (Optional) Shall be an 'INTEGER' of the default
  9515. kind.
  9516. CMDMSG (Optional) Shall be an 'CHARACTER' scalar of the
  9517. default kind.
  9518. _Example_:
  9519. program test_exec
  9520. integer :: i
  9521. call execute_command_line ("external_prog.exe", exitstat=i)
  9522. print *, "Exit status of external_prog.exe was ", i
  9523. call execute_command_line ("reindex_files.exe", wait=.false.)
  9524. print *, "Now reindexing files in the background"
  9525. end program test_exec
  9526. _Note_:
  9527. Because this intrinsic is implemented in terms of the 'system'
  9528. function call, its behavior with respect to signaling is processor
  9529. dependent. In particular, on POSIX-compliant systems, the SIGINT
  9530. and SIGQUIT signals will be ignored, and the SIGCHLD will be
  9531. blocked. As such, if the parent process is terminated, the child
  9532. process might not be terminated alongside.
  9533. _See also_:
  9534. *note SYSTEM::
  9535. 
  9536. File: gfortran.info, Node: EXIT, Next: EXP, Prev: EXECUTE_COMMAND_LINE, Up: Intrinsic Procedures
  9537. 9.101 'EXIT' -- Exit the program with status.
  9538. =============================================
  9539. _Description_:
  9540. 'EXIT' causes immediate termination of the program with status. If
  9541. status is omitted it returns the canonical _success_ for the
  9542. system. All Fortran I/O units are closed.
  9543. _Standard_:
  9544. GNU extension
  9545. _Class_:
  9546. Subroutine
  9547. _Syntax_:
  9548. 'CALL EXIT([STATUS])'
  9549. _Arguments_:
  9550. STATUS Shall be an 'INTEGER' of the default kind.
  9551. _Return value_:
  9552. 'STATUS' is passed to the parent process on exit.
  9553. _Example_:
  9554. program test_exit
  9555. integer :: STATUS = 0
  9556. print *, 'This program is going to exit.'
  9557. call EXIT(STATUS)
  9558. end program test_exit
  9559. _See also_:
  9560. *note ABORT::, *note KILL::
  9561. 
  9562. File: gfortran.info, Node: EXP, Next: EXPONENT, Prev: EXIT, Up: Intrinsic Procedures
  9563. 9.102 'EXP' -- Exponential function
  9564. ===================================
  9565. _Description_:
  9566. 'EXP(X)' computes the base e exponential of X.
  9567. _Standard_:
  9568. Fortran 77 and later, has overloads that are GNU extensions
  9569. _Class_:
  9570. Elemental function
  9571. _Syntax_:
  9572. 'RESULT = EXP(X)'
  9573. _Arguments_:
  9574. X The type shall be 'REAL' or 'COMPLEX'.
  9575. _Return value_:
  9576. The return value has same type and kind as X.
  9577. _Example_:
  9578. program test_exp
  9579. real :: x = 1.0
  9580. x = exp(x)
  9581. end program test_exp
  9582. _Specific names_:
  9583. Name Argument Return type Standard
  9584. 'EXP(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  9585. later
  9586. 'DEXP(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  9587. later
  9588. 'CEXP(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and
  9589. X' later
  9590. 'ZEXP(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  9591. X'
  9592. 'CDEXP(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  9593. X'
  9594. 
  9595. File: gfortran.info, Node: EXPONENT, Next: EXTENDS_TYPE_OF, Prev: EXP, Up: Intrinsic Procedures
  9596. 9.103 'EXPONENT' -- Exponent function
  9597. =====================================
  9598. _Description_:
  9599. 'EXPONENT(X)' returns the value of the exponent part of X. If X is
  9600. zero the value returned is zero.
  9601. _Standard_:
  9602. Fortran 90 and later
  9603. _Class_:
  9604. Elemental function
  9605. _Syntax_:
  9606. 'RESULT = EXPONENT(X)'
  9607. _Arguments_:
  9608. X The type shall be 'REAL'.
  9609. _Return value_:
  9610. The return value is of type default 'INTEGER'.
  9611. _Example_:
  9612. program test_exponent
  9613. real :: x = 1.0
  9614. integer :: i
  9615. i = exponent(x)
  9616. print *, i
  9617. print *, exponent(0.0)
  9618. end program test_exponent
  9619. 
  9620. File: gfortran.info, Node: EXTENDS_TYPE_OF, Next: FDATE, Prev: EXPONENT, Up: Intrinsic Procedures
  9621. 9.104 'EXTENDS_TYPE_OF' -- Query dynamic type for extension
  9622. ===========================================================
  9623. _Description_:
  9624. Query dynamic type for extension.
  9625. _Standard_:
  9626. Fortran 2003 and later
  9627. _Class_:
  9628. Inquiry function
  9629. _Syntax_:
  9630. 'RESULT = EXTENDS_TYPE_OF(A, MOLD)'
  9631. _Arguments_:
  9632. A Shall be an object of extensible declared type
  9633. or unlimited polymorphic.
  9634. MOLD Shall be an object of extensible declared type
  9635. or unlimited polymorphic.
  9636. _Return value_:
  9637. The return value is a scalar of type default logical. It is true
  9638. if and only if the dynamic type of A is an extension type of the
  9639. dynamic type of MOLD.
  9640. _See also_:
  9641. *note SAME_TYPE_AS::
  9642. 
  9643. File: gfortran.info, Node: FDATE, Next: FGET, Prev: EXTENDS_TYPE_OF, Up: Intrinsic Procedures
  9644. 9.105 'FDATE' -- Get the current time as a string
  9645. =================================================
  9646. _Description_:
  9647. 'FDATE(DATE)' returns the current date (using the same format as
  9648. *note CTIME::) in DATE. It is equivalent to 'CALL CTIME(DATE,
  9649. TIME())'.
  9650. This intrinsic is provided in both subroutine and function forms;
  9651. however, only one form can be used in any given program unit.
  9652. _Standard_:
  9653. GNU extension
  9654. _Class_:
  9655. Subroutine, function
  9656. _Syntax_:
  9657. 'CALL FDATE(DATE)'.
  9658. 'DATE = FDATE()'.
  9659. _Arguments_:
  9660. DATE The type shall be of type 'CHARACTER' of the
  9661. default kind. It is an 'INTENT(OUT)' argument.
  9662. If the length of this variable is too short for
  9663. the date and time string to fit completely, it
  9664. will be blank on procedure return.
  9665. _Return value_:
  9666. The current date and time as a string.
  9667. _Example_:
  9668. program test_fdate
  9669. integer(8) :: i, j
  9670. character(len=30) :: date
  9671. call fdate(date)
  9672. print *, 'Program started on ', date
  9673. do i = 1, 100000000 ! Just a delay
  9674. j = i * i - i
  9675. end do
  9676. call fdate(date)
  9677. print *, 'Program ended on ', date
  9678. end program test_fdate
  9679. _See also_:
  9680. *note DATE_AND_TIME::, *note CTIME::
  9681. 
  9682. File: gfortran.info, Node: FGET, Next: FGETC, Prev: FDATE, Up: Intrinsic Procedures
  9683. 9.106 'FGET' -- Read a single character in stream mode from stdin
  9684. =================================================================
  9685. _Description_:
  9686. Read a single character in stream mode from stdin by bypassing
  9687. normal formatted output. Stream I/O should not be mixed with
  9688. normal record-oriented (formatted or unformatted) I/O on the same
  9689. unit; the results are unpredictable.
  9690. This intrinsic is provided in both subroutine and function forms;
  9691. however, only one form can be used in any given program unit.
  9692. Note that the 'FGET' intrinsic is provided for backwards
  9693. compatibility with 'g77'. GNU Fortran provides the Fortran 2003
  9694. Stream facility. Programmers should consider the use of new stream
  9695. IO feature in new code for future portability. See also *note
  9696. Fortran 2003 status::.
  9697. _Standard_:
  9698. GNU extension
  9699. _Class_:
  9700. Subroutine, function
  9701. _Syntax_:
  9702. 'CALL FGET(C [, STATUS])'
  9703. 'STATUS = FGET(C)'
  9704. _Arguments_:
  9705. C The type shall be 'CHARACTER' and of default
  9706. kind.
  9707. STATUS (Optional) status flag of type 'INTEGER'.
  9708. Returns 0 on success, -1 on end-of-file, and a
  9709. system specific positive error code otherwise.
  9710. _Example_:
  9711. PROGRAM test_fget
  9712. INTEGER, PARAMETER :: strlen = 100
  9713. INTEGER :: status, i = 1
  9714. CHARACTER(len=strlen) :: str = ""
  9715. WRITE (*,*) 'Enter text:'
  9716. DO
  9717. CALL fget(str(i:i), status)
  9718. if (status /= 0 .OR. i > strlen) exit
  9719. i = i + 1
  9720. END DO
  9721. WRITE (*,*) TRIM(str)
  9722. END PROGRAM
  9723. _See also_:
  9724. *note FGETC::, *note FPUT::, *note FPUTC::
  9725. 
  9726. File: gfortran.info, Node: FGETC, Next: FINDLOC, Prev: FGET, Up: Intrinsic Procedures
  9727. 9.107 'FGETC' -- Read a single character in stream mode
  9728. =======================================================
  9729. _Description_:
  9730. Read a single character in stream mode by bypassing normal
  9731. formatted output. Stream I/O should not be mixed with normal
  9732. record-oriented (formatted or unformatted) I/O on the same unit;
  9733. the results are unpredictable.
  9734. This intrinsic is provided in both subroutine and function forms;
  9735. however, only one form can be used in any given program unit.
  9736. Note that the 'FGET' intrinsic is provided for backwards
  9737. compatibility with 'g77'. GNU Fortran provides the Fortran 2003
  9738. Stream facility. Programmers should consider the use of new stream
  9739. IO feature in new code for future portability. See also *note
  9740. Fortran 2003 status::.
  9741. _Standard_:
  9742. GNU extension
  9743. _Class_:
  9744. Subroutine, function
  9745. _Syntax_:
  9746. 'CALL FGETC(UNIT, C [, STATUS])'
  9747. 'STATUS = FGETC(UNIT, C)'
  9748. _Arguments_:
  9749. UNIT The type shall be 'INTEGER'.
  9750. C The type shall be 'CHARACTER' and of default
  9751. kind.
  9752. STATUS (Optional) status flag of type 'INTEGER'.
  9753. Returns 0 on success, -1 on end-of-file and a
  9754. system specific positive error code otherwise.
  9755. _Example_:
  9756. PROGRAM test_fgetc
  9757. INTEGER :: fd = 42, status
  9758. CHARACTER :: c
  9759. OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD")
  9760. DO
  9761. CALL fgetc(fd, c, status)
  9762. IF (status /= 0) EXIT
  9763. call fput(c)
  9764. END DO
  9765. CLOSE(UNIT=fd)
  9766. END PROGRAM
  9767. _See also_:
  9768. *note FGET::, *note FPUT::, *note FPUTC::
  9769. 
  9770. File: gfortran.info, Node: FINDLOC, Next: FLOOR, Prev: FGETC, Up: Intrinsic Procedures
  9771. 9.108 'FINDLOC' -- Search an array for a value
  9772. ==============================================
  9773. _Description_:
  9774. Determines the location of the element in the array with the value
  9775. given in the VALUE argument, or, if the DIM argument is supplied,
  9776. determines the locations of the elements equal to the VALUE
  9777. argument element along each row of the array in the DIM direction.
  9778. If MASK is present, only the elements for which MASK is '.TRUE.'
  9779. are considered. If more than one element in the array has the
  9780. value VALUE, the location returned is that of the first such
  9781. element in array element order if the BACK is not present or if it
  9782. is '.FALSE.'. If BACK is true, the location returned is that of
  9783. the last such element. If the array has zero size, or all of the
  9784. elements of MASK are '.FALSE.', then the result is an array of
  9785. zeroes. Similarly, if DIM is supplied and all of the elements of
  9786. MASK along a given row are zero, the result value for that row is
  9787. zero.
  9788. _Standard_:
  9789. Fortran 2008 and later.
  9790. _Class_:
  9791. Transformational function
  9792. _Syntax_:
  9793. 'RESULT = FINDLOC(ARRAY, VALUE, DIM [, MASK] [,KIND]
  9794. [,BACK])'
  9795. 'RESULT = FINDLOC(ARRAY, VALUE, [, MASK] [,KIND]
  9796. [,BACK])'
  9797. _Arguments_:
  9798. ARRAY Shall be an array of intrinsic type.
  9799. VALUE A scalar of intrinsic type which is in type
  9800. conformance with ARRAY.
  9801. DIM (Optional) Shall be a scalar of type 'INTEGER',
  9802. with a value between one and the rank of ARRAY,
  9803. inclusive. It may not be an optional dummy
  9804. argument.
  9805. KIND (Optional) An 'INTEGER' initialization
  9806. expression indicating the kind parameter of the
  9807. result.
  9808. BACK (Optional) A scalar of type 'LOGICAL'.
  9809. _Return value_:
  9810. If DIM is absent, the result is a rank-one array with a length
  9811. equal to the rank of ARRAY. If DIM is present, the result is an
  9812. array with a rank one less than the rank of ARRAY, and a size
  9813. corresponding to the size of ARRAY with the DIM dimension removed.
  9814. If DIM is present and ARRAY has a rank of one, the result is a
  9815. scalar. If the optional argument KIND is present, the result is an
  9816. integer of kind KIND, otherwise it is of default kind.
  9817. _See also_:
  9818. *note MAXLOC::, *note MINLOC::
  9819. 
  9820. File: gfortran.info, Node: FLOOR, Next: FLUSH, Prev: FINDLOC, Up: Intrinsic Procedures
  9821. 9.109 'FLOOR' -- Integer floor function
  9822. =======================================
  9823. _Description_:
  9824. 'FLOOR(A)' returns the greatest integer less than or equal to X.
  9825. _Standard_:
  9826. Fortran 95 and later
  9827. _Class_:
  9828. Elemental function
  9829. _Syntax_:
  9830. 'RESULT = FLOOR(A [, KIND])'
  9831. _Arguments_:
  9832. A The type shall be 'REAL'.
  9833. KIND (Optional) An 'INTEGER' initialization
  9834. expression indicating the kind parameter of the
  9835. result.
  9836. _Return value_:
  9837. The return value is of type 'INTEGER(KIND)' if KIND is present and
  9838. of default-kind 'INTEGER' otherwise.
  9839. _Example_:
  9840. program test_floor
  9841. real :: x = 63.29
  9842. real :: y = -63.59
  9843. print *, floor(x) ! returns 63
  9844. print *, floor(y) ! returns -64
  9845. end program test_floor
  9846. _See also_:
  9847. *note CEILING::, *note NINT::
  9848. 
  9849. File: gfortran.info, Node: FLUSH, Next: FNUM, Prev: FLOOR, Up: Intrinsic Procedures
  9850. 9.110 'FLUSH' -- Flush I/O unit(s)
  9851. ==================================
  9852. _Description_:
  9853. Flushes Fortran unit(s) currently open for output. Without the
  9854. optional argument, all units are flushed, otherwise just the unit
  9855. specified.
  9856. _Standard_:
  9857. GNU extension
  9858. _Class_:
  9859. Subroutine
  9860. _Syntax_:
  9861. 'CALL FLUSH(UNIT)'
  9862. _Arguments_:
  9863. UNIT (Optional) The type shall be 'INTEGER'.
  9864. _Note_:
  9865. Beginning with the Fortran 2003 standard, there is a 'FLUSH'
  9866. statement that should be preferred over the 'FLUSH' intrinsic.
  9867. The 'FLUSH' intrinsic and the Fortran 2003 'FLUSH' statement have
  9868. identical effect: they flush the runtime library's I/O buffer so
  9869. that the data becomes visible to other processes. This does not
  9870. guarantee that the data is committed to disk.
  9871. On POSIX systems, you can request that all data is transferred to
  9872. the storage device by calling the 'fsync' function, with the POSIX
  9873. file descriptor of the I/O unit as argument (retrieved with GNU
  9874. intrinsic 'FNUM'). The following example shows how:
  9875. ! Declare the interface for POSIX fsync function
  9876. interface
  9877. function fsync (fd) bind(c,name="fsync")
  9878. use iso_c_binding, only: c_int
  9879. integer(c_int), value :: fd
  9880. integer(c_int) :: fsync
  9881. end function fsync
  9882. end interface
  9883. ! Variable declaration
  9884. integer :: ret
  9885. ! Opening unit 10
  9886. open (10,file="foo")
  9887. ! ...
  9888. ! Perform I/O on unit 10
  9889. ! ...
  9890. ! Flush and sync
  9891. flush(10)
  9892. ret = fsync(fnum(10))
  9893. ! Handle possible error
  9894. if (ret /= 0) stop "Error calling FSYNC"
  9895. 
  9896. File: gfortran.info, Node: FNUM, Next: FPUT, Prev: FLUSH, Up: Intrinsic Procedures
  9897. 9.111 'FNUM' -- File number function
  9898. ====================================
  9899. _Description_:
  9900. 'FNUM(UNIT)' returns the POSIX file descriptor number corresponding
  9901. to the open Fortran I/O unit 'UNIT'.
  9902. _Standard_:
  9903. GNU extension
  9904. _Class_:
  9905. Function
  9906. _Syntax_:
  9907. 'RESULT = FNUM(UNIT)'
  9908. _Arguments_:
  9909. UNIT The type shall be 'INTEGER'.
  9910. _Return value_:
  9911. The return value is of type 'INTEGER'
  9912. _Example_:
  9913. program test_fnum
  9914. integer :: i
  9915. open (unit=10, status = "scratch")
  9916. i = fnum(10)
  9917. print *, i
  9918. close (10)
  9919. end program test_fnum
  9920. 
  9921. File: gfortran.info, Node: FPUT, Next: FPUTC, Prev: FNUM, Up: Intrinsic Procedures
  9922. 9.112 'FPUT' -- Write a single character in stream mode to stdout
  9923. =================================================================
  9924. _Description_:
  9925. Write a single character in stream mode to stdout by bypassing
  9926. normal formatted output. Stream I/O should not be mixed with
  9927. normal record-oriented (formatted or unformatted) I/O on the same
  9928. unit; the results are unpredictable.
  9929. This intrinsic is provided in both subroutine and function forms;
  9930. however, only one form can be used in any given program unit.
  9931. Note that the 'FGET' intrinsic is provided for backwards
  9932. compatibility with 'g77'. GNU Fortran provides the Fortran 2003
  9933. Stream facility. Programmers should consider the use of new stream
  9934. IO feature in new code for future portability. See also *note
  9935. Fortran 2003 status::.
  9936. _Standard_:
  9937. GNU extension
  9938. _Class_:
  9939. Subroutine, function
  9940. _Syntax_:
  9941. 'CALL FPUT(C [, STATUS])'
  9942. 'STATUS = FPUT(C)'
  9943. _Arguments_:
  9944. C The type shall be 'CHARACTER' and of default
  9945. kind.
  9946. STATUS (Optional) status flag of type 'INTEGER'.
  9947. Returns 0 on success, -1 on end-of-file and a
  9948. system specific positive error code otherwise.
  9949. _Example_:
  9950. PROGRAM test_fput
  9951. CHARACTER(len=10) :: str = "gfortran"
  9952. INTEGER :: i
  9953. DO i = 1, len_trim(str)
  9954. CALL fput(str(i:i))
  9955. END DO
  9956. END PROGRAM
  9957. _See also_:
  9958. *note FPUTC::, *note FGET::, *note FGETC::
  9959. 
  9960. File: gfortran.info, Node: FPUTC, Next: FRACTION, Prev: FPUT, Up: Intrinsic Procedures
  9961. 9.113 'FPUTC' -- Write a single character in stream mode
  9962. ========================================================
  9963. _Description_:
  9964. Write a single character in stream mode by bypassing normal
  9965. formatted output. Stream I/O should not be mixed with normal
  9966. record-oriented (formatted or unformatted) I/O on the same unit;
  9967. the results are unpredictable.
  9968. This intrinsic is provided in both subroutine and function forms;
  9969. however, only one form can be used in any given program unit.
  9970. Note that the 'FGET' intrinsic is provided for backwards
  9971. compatibility with 'g77'. GNU Fortran provides the Fortran 2003
  9972. Stream facility. Programmers should consider the use of new stream
  9973. IO feature in new code for future portability. See also *note
  9974. Fortran 2003 status::.
  9975. _Standard_:
  9976. GNU extension
  9977. _Class_:
  9978. Subroutine, function
  9979. _Syntax_:
  9980. 'CALL FPUTC(UNIT, C [, STATUS])'
  9981. 'STATUS = FPUTC(UNIT, C)'
  9982. _Arguments_:
  9983. UNIT The type shall be 'INTEGER'.
  9984. C The type shall be 'CHARACTER' and of default
  9985. kind.
  9986. STATUS (Optional) status flag of type 'INTEGER'.
  9987. Returns 0 on success, -1 on end-of-file and a
  9988. system specific positive error code otherwise.
  9989. _Example_:
  9990. PROGRAM test_fputc
  9991. CHARACTER(len=10) :: str = "gfortran"
  9992. INTEGER :: fd = 42, i
  9993. OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
  9994. DO i = 1, len_trim(str)
  9995. CALL fputc(fd, str(i:i))
  9996. END DO
  9997. CLOSE(fd)
  9998. END PROGRAM
  9999. _See also_:
  10000. *note FPUT::, *note FGET::, *note FGETC::
  10001. 
  10002. File: gfortran.info, Node: FRACTION, Next: FREE, Prev: FPUTC, Up: Intrinsic Procedures
  10003. 9.114 'FRACTION' -- Fractional part of the model representation
  10004. ===============================================================
  10005. _Description_:
  10006. 'FRACTION(X)' returns the fractional part of the model
  10007. representation of 'X'.
  10008. _Standard_:
  10009. Fortran 90 and later
  10010. _Class_:
  10011. Elemental function
  10012. _Syntax_:
  10013. 'Y = FRACTION(X)'
  10014. _Arguments_:
  10015. X The type of the argument shall be a 'REAL'.
  10016. _Return value_:
  10017. The return value is of the same type and kind as the argument. The
  10018. fractional part of the model representation of 'X' is returned; it
  10019. is 'X * RADIX(X)**(-EXPONENT(X))'.
  10020. _Example_:
  10021. program test_fraction
  10022. real :: x
  10023. x = 178.1387e-4
  10024. print *, fraction(x), x * radix(x)**(-exponent(x))
  10025. end program test_fraction
  10026. 
  10027. File: gfortran.info, Node: FREE, Next: FSEEK, Prev: FRACTION, Up: Intrinsic Procedures
  10028. 9.115 'FREE' -- Frees memory
  10029. ============================
  10030. _Description_:
  10031. Frees memory previously allocated by 'MALLOC'. The 'FREE'
  10032. intrinsic is an extension intended to be used with Cray pointers,
  10033. and is provided in GNU Fortran to allow user to compile legacy
  10034. code. For new code using Fortran 95 pointers, the memory
  10035. de-allocation intrinsic is 'DEALLOCATE'.
  10036. _Standard_:
  10037. GNU extension
  10038. _Class_:
  10039. Subroutine
  10040. _Syntax_:
  10041. 'CALL FREE(PTR)'
  10042. _Arguments_:
  10043. PTR The type shall be 'INTEGER'. It represents the
  10044. location of the memory that should be
  10045. de-allocated.
  10046. _Return value_:
  10047. None
  10048. _Example_:
  10049. See 'MALLOC' for an example.
  10050. _See also_:
  10051. *note MALLOC::
  10052. 
  10053. File: gfortran.info, Node: FSEEK, Next: FSTAT, Prev: FREE, Up: Intrinsic Procedures
  10054. 9.116 'FSEEK' -- Low level file positioning subroutine
  10055. ======================================================
  10056. _Description_:
  10057. Moves UNIT to the specified OFFSET. If WHENCE is set to 0, the
  10058. OFFSET is taken as an absolute value 'SEEK_SET', if set to 1,
  10059. OFFSET is taken to be relative to the current position 'SEEK_CUR',
  10060. and if set to 2 relative to the end of the file 'SEEK_END'. On
  10061. error, STATUS is set to a nonzero value. If STATUS the seek fails
  10062. silently.
  10063. This intrinsic routine is not fully backwards compatible with
  10064. 'g77'. In 'g77', the 'FSEEK' takes a statement label instead of a
  10065. STATUS variable. If FSEEK is used in old code, change
  10066. CALL FSEEK(UNIT, OFFSET, WHENCE, *label)
  10067. to
  10068. INTEGER :: status
  10069. CALL FSEEK(UNIT, OFFSET, WHENCE, status)
  10070. IF (status /= 0) GOTO label
  10071. Please note that GNU Fortran provides the Fortran 2003 Stream
  10072. facility. Programmers should consider the use of new stream IO
  10073. feature in new code for future portability. See also *note Fortran
  10074. 2003 status::.
  10075. _Standard_:
  10076. GNU extension
  10077. _Class_:
  10078. Subroutine
  10079. _Syntax_:
  10080. 'CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])'
  10081. _Arguments_:
  10082. UNIT Shall be a scalar of type 'INTEGER'.
  10083. OFFSET Shall be a scalar of type 'INTEGER'.
  10084. WHENCE Shall be a scalar of type 'INTEGER'. Its value
  10085. shall be either 0, 1 or 2.
  10086. STATUS (Optional) shall be a scalar of type
  10087. 'INTEGER(4)'.
  10088. _Example_:
  10089. PROGRAM test_fseek
  10090. INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2
  10091. INTEGER :: fd, offset, ierr
  10092. ierr = 0
  10093. offset = 5
  10094. fd = 10
  10095. OPEN(UNIT=fd, FILE="fseek.test")
  10096. CALL FSEEK(fd, offset, SEEK_SET, ierr) ! move to OFFSET
  10097. print *, FTELL(fd), ierr
  10098. CALL FSEEK(fd, 0, SEEK_END, ierr) ! move to end
  10099. print *, FTELL(fd), ierr
  10100. CALL FSEEK(fd, 0, SEEK_SET, ierr) ! move to beginning
  10101. print *, FTELL(fd), ierr
  10102. CLOSE(UNIT=fd)
  10103. END PROGRAM
  10104. _See also_:
  10105. *note FTELL::
  10106. 
  10107. File: gfortran.info, Node: FSTAT, Next: FTELL, Prev: FSEEK, Up: Intrinsic Procedures
  10108. 9.117 'FSTAT' -- Get file status
  10109. ================================
  10110. _Description_:
  10111. 'FSTAT' is identical to *note STAT::, except that information about
  10112. an already opened file is obtained.
  10113. The elements in 'VALUES' are the same as described by *note STAT::.
  10114. This intrinsic is provided in both subroutine and function forms;
  10115. however, only one form can be used in any given program unit.
  10116. _Standard_:
  10117. GNU extension
  10118. _Class_:
  10119. Subroutine, function
  10120. _Syntax_:
  10121. 'CALL FSTAT(UNIT, VALUES [, STATUS])'
  10122. 'STATUS = FSTAT(UNIT, VALUES)'
  10123. _Arguments_:
  10124. UNIT An open I/O unit number of type 'INTEGER'.
  10125. VALUES The type shall be 'INTEGER(4), DIMENSION(13)'.
  10126. STATUS (Optional) status flag of type 'INTEGER(4)'.
  10127. Returns 0 on success and a system specific error
  10128. code otherwise.
  10129. _Example_:
  10130. See *note STAT:: for an example.
  10131. _See also_:
  10132. To stat a link: *note LSTAT:: To stat a file: *note STAT::
  10133. 
  10134. File: gfortran.info, Node: FTELL, Next: GAMMA, Prev: FSTAT, Up: Intrinsic Procedures
  10135. 9.118 'FTELL' -- Current stream position
  10136. ========================================
  10137. _Description_:
  10138. Retrieves the current position within an open file.
  10139. This intrinsic is provided in both subroutine and function forms;
  10140. however, only one form can be used in any given program unit.
  10141. _Standard_:
  10142. GNU extension
  10143. _Class_:
  10144. Subroutine, function
  10145. _Syntax_:
  10146. 'CALL FTELL(UNIT, OFFSET)'
  10147. 'OFFSET = FTELL(UNIT)'
  10148. _Arguments_:
  10149. OFFSET Shall of type 'INTEGER'.
  10150. UNIT Shall of type 'INTEGER'.
  10151. _Return value_:
  10152. In either syntax, OFFSET is set to the current offset of unit
  10153. number UNIT, or to -1 if the unit is not currently open.
  10154. _Example_:
  10155. PROGRAM test_ftell
  10156. INTEGER :: i
  10157. OPEN(10, FILE="temp.dat")
  10158. CALL ftell(10,i)
  10159. WRITE(*,*) i
  10160. END PROGRAM
  10161. _See also_:
  10162. *note FSEEK::
  10163. 
  10164. File: gfortran.info, Node: GAMMA, Next: GERROR, Prev: FTELL, Up: Intrinsic Procedures
  10165. 9.119 'GAMMA' -- Gamma function
  10166. ===============================
  10167. _Description_:
  10168. 'GAMMA(X)' computes Gamma (\Gamma) of X. For positive, integer
  10169. values of X the Gamma function simplifies to the factorial function
  10170. \Gamma(x)=(x-1)!.
  10171. _Standard_:
  10172. Fortran 2008 and later
  10173. _Class_:
  10174. Elemental function
  10175. _Syntax_:
  10176. 'X = GAMMA(X)'
  10177. _Arguments_:
  10178. X Shall be of type 'REAL' and neither zero nor a
  10179. negative integer.
  10180. _Return value_:
  10181. The return value is of type 'REAL' of the same kind as X.
  10182. _Example_:
  10183. program test_gamma
  10184. real :: x = 1.0
  10185. x = gamma(x) ! returns 1.0
  10186. end program test_gamma
  10187. _Specific names_:
  10188. Name Argument Return type Standard
  10189. 'DGAMMA(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  10190. _See also_:
  10191. Logarithm of the Gamma function: *note LOG_GAMMA::
  10192. 
  10193. File: gfortran.info, Node: GERROR, Next: GETARG, Prev: GAMMA, Up: Intrinsic Procedures
  10194. 9.120 'GERROR' -- Get last system error message
  10195. ===============================================
  10196. _Description_:
  10197. Returns the system error message corresponding to the last system
  10198. error. This resembles the functionality of 'strerror(3)' in C.
  10199. _Standard_:
  10200. GNU extension
  10201. _Class_:
  10202. Subroutine
  10203. _Syntax_:
  10204. 'CALL GERROR(RESULT)'
  10205. _Arguments_:
  10206. RESULT Shall of type 'CHARACTER' and of default
  10207. _Example_:
  10208. PROGRAM test_gerror
  10209. CHARACTER(len=100) :: msg
  10210. CALL gerror(msg)
  10211. WRITE(*,*) msg
  10212. END PROGRAM
  10213. _See also_:
  10214. *note IERRNO::, *note PERROR::
  10215. 
  10216. File: gfortran.info, Node: GETARG, Next: GET_COMMAND, Prev: GERROR, Up: Intrinsic Procedures
  10217. 9.121 'GETARG' -- Get command line arguments
  10218. ============================================
  10219. _Description_:
  10220. Retrieve the POS-th argument that was passed on the command line
  10221. when the containing program was invoked.
  10222. This intrinsic routine is provided for backwards compatibility with
  10223. GNU Fortran 77. In new code, programmers should consider the use
  10224. of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the
  10225. Fortran 2003 standard.
  10226. _Standard_:
  10227. GNU extension
  10228. _Class_:
  10229. Subroutine
  10230. _Syntax_:
  10231. 'CALL GETARG(POS, VALUE)'
  10232. _Arguments_:
  10233. POS Shall be of type 'INTEGER' and not wider than
  10234. the default integer kind; POS \geq 0
  10235. VALUE Shall be of type 'CHARACTER' and of default
  10236. kind.
  10237. VALUE Shall be of type 'CHARACTER'.
  10238. _Return value_:
  10239. After 'GETARG' returns, the VALUE argument holds the POSth command
  10240. line argument. If VALUE cannot hold the argument, it is truncated
  10241. to fit the length of VALUE. If there are less than POS arguments
  10242. specified at the command line, VALUE will be filled with blanks.
  10243. If POS = 0, VALUE is set to the name of the program (on systems
  10244. that support this feature).
  10245. _Example_:
  10246. PROGRAM test_getarg
  10247. INTEGER :: i
  10248. CHARACTER(len=32) :: arg
  10249. DO i = 1, iargc()
  10250. CALL getarg(i, arg)
  10251. WRITE (*,*) arg
  10252. END DO
  10253. END PROGRAM
  10254. _See also_:
  10255. GNU Fortran 77 compatibility function: *note IARGC:: Fortran 2003
  10256. functions and subroutines: *note GET_COMMAND::, *note
  10257. GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
  10258. 
  10259. File: gfortran.info, Node: GET_COMMAND, Next: GET_COMMAND_ARGUMENT, Prev: GETARG, Up: Intrinsic Procedures
  10260. 9.122 'GET_COMMAND' -- Get the entire command line
  10261. ==================================================
  10262. _Description_:
  10263. Retrieve the entire command line that was used to invoke the
  10264. program.
  10265. _Standard_:
  10266. Fortran 2003 and later
  10267. _Class_:
  10268. Subroutine
  10269. _Syntax_:
  10270. 'CALL GET_COMMAND([COMMAND, LENGTH, STATUS])'
  10271. _Arguments_:
  10272. COMMAND (Optional) shall be of type 'CHARACTER' and of
  10273. default kind.
  10274. LENGTH (Optional) Shall be of type 'INTEGER' and of
  10275. default kind.
  10276. STATUS (Optional) Shall be of type 'INTEGER' and of
  10277. default kind.
  10278. _Return value_:
  10279. If COMMAND is present, stores the entire command line that was used
  10280. to invoke the program in COMMAND. If LENGTH is present, it is
  10281. assigned the length of the command line. If STATUS is present, it
  10282. is assigned 0 upon success of the command, -1 if COMMAND is too
  10283. short to store the command line, or a positive value in case of an
  10284. error.
  10285. _Example_:
  10286. PROGRAM test_get_command
  10287. CHARACTER(len=255) :: cmd
  10288. CALL get_command(cmd)
  10289. WRITE (*,*) TRIM(cmd)
  10290. END PROGRAM
  10291. _See also_:
  10292. *note GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
  10293. 
  10294. File: gfortran.info, Node: GET_COMMAND_ARGUMENT, Next: GETCWD, Prev: GET_COMMAND, Up: Intrinsic Procedures
  10295. 9.123 'GET_COMMAND_ARGUMENT' -- Get command line arguments
  10296. ==========================================================
  10297. _Description_:
  10298. Retrieve the NUMBER-th argument that was passed on the command line
  10299. when the containing program was invoked.
  10300. _Standard_:
  10301. Fortran 2003 and later
  10302. _Class_:
  10303. Subroutine
  10304. _Syntax_:
  10305. 'CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])'
  10306. _Arguments_:
  10307. NUMBER Shall be a scalar of type 'INTEGER' and of
  10308. default kind, NUMBER \geq 0
  10309. VALUE (Optional) Shall be a scalar of type 'CHARACTER'
  10310. and of default kind.
  10311. LENGTH (Optional) Shall be a scalar of type 'INTEGER'
  10312. and of default kind.
  10313. STATUS (Optional) Shall be a scalar of type 'INTEGER'
  10314. and of default kind.
  10315. _Return value_:
  10316. After 'GET_COMMAND_ARGUMENT' returns, the VALUE argument holds the
  10317. NUMBER-th command line argument. If VALUE cannot hold the
  10318. argument, it is truncated to fit the length of VALUE. If there are
  10319. less than NUMBER arguments specified at the command line, VALUE
  10320. will be filled with blanks. If NUMBER = 0, VALUE is set to the
  10321. name of the program (on systems that support this feature). The
  10322. LENGTH argument contains the length of the NUMBER-th command line
  10323. argument. If the argument retrieval fails, STATUS is a positive
  10324. number; if VALUE contains a truncated command line argument, STATUS
  10325. is -1; and otherwise the STATUS is zero.
  10326. _Example_:
  10327. PROGRAM test_get_command_argument
  10328. INTEGER :: i
  10329. CHARACTER(len=32) :: arg
  10330. i = 0
  10331. DO
  10332. CALL get_command_argument(i, arg)
  10333. IF (LEN_TRIM(arg) == 0) EXIT
  10334. WRITE (*,*) TRIM(arg)
  10335. i = i+1
  10336. END DO
  10337. END PROGRAM
  10338. _See also_:
  10339. *note GET_COMMAND::, *note COMMAND_ARGUMENT_COUNT::
  10340. 
  10341. File: gfortran.info, Node: GETCWD, Next: GETENV, Prev: GET_COMMAND_ARGUMENT, Up: Intrinsic Procedures
  10342. 9.124 'GETCWD' -- Get current working directory
  10343. ===============================================
  10344. _Description_:
  10345. Get current working directory.
  10346. This intrinsic is provided in both subroutine and function forms;
  10347. however, only one form can be used in any given program unit.
  10348. _Standard_:
  10349. GNU extension
  10350. _Class_:
  10351. Subroutine, function
  10352. _Syntax_:
  10353. 'CALL GETCWD(C [, STATUS])'
  10354. 'STATUS = GETCWD(C)'
  10355. _Arguments_:
  10356. C The type shall be 'CHARACTER' and of default
  10357. kind.
  10358. STATUS (Optional) status flag. Returns 0 on success, a
  10359. system specific and nonzero error code
  10360. otherwise.
  10361. _Example_:
  10362. PROGRAM test_getcwd
  10363. CHARACTER(len=255) :: cwd
  10364. CALL getcwd(cwd)
  10365. WRITE(*,*) TRIM(cwd)
  10366. END PROGRAM
  10367. _See also_:
  10368. *note CHDIR::
  10369. 
  10370. File: gfortran.info, Node: GETENV, Next: GET_ENVIRONMENT_VARIABLE, Prev: GETCWD, Up: Intrinsic Procedures
  10371. 9.125 'GETENV' -- Get an environmental variable
  10372. ===============================================
  10373. _Description_:
  10374. Get the VALUE of the environmental variable NAME.
  10375. This intrinsic routine is provided for backwards compatibility with
  10376. GNU Fortran 77. In new code, programmers should consider the use
  10377. of the *note GET_ENVIRONMENT_VARIABLE:: intrinsic defined by the
  10378. Fortran 2003 standard.
  10379. Note that 'GETENV' need not be thread-safe. It is the
  10380. responsibility of the user to ensure that the environment is not
  10381. being updated concurrently with a call to the 'GETENV' intrinsic.
  10382. _Standard_:
  10383. GNU extension
  10384. _Class_:
  10385. Subroutine
  10386. _Syntax_:
  10387. 'CALL GETENV(NAME, VALUE)'
  10388. _Arguments_:
  10389. NAME Shall be of type 'CHARACTER' and of default
  10390. kind.
  10391. VALUE Shall be of type 'CHARACTER' and of default
  10392. kind.
  10393. _Return value_:
  10394. Stores the value of NAME in VALUE. If VALUE is not large enough to
  10395. hold the data, it is truncated. If NAME is not set, VALUE will be
  10396. filled with blanks.
  10397. _Example_:
  10398. PROGRAM test_getenv
  10399. CHARACTER(len=255) :: homedir
  10400. CALL getenv("HOME", homedir)
  10401. WRITE (*,*) TRIM(homedir)
  10402. END PROGRAM
  10403. _See also_:
  10404. *note GET_ENVIRONMENT_VARIABLE::
  10405. 
  10406. File: gfortran.info, Node: GET_ENVIRONMENT_VARIABLE, Next: GETGID, Prev: GETENV, Up: Intrinsic Procedures
  10407. 9.126 'GET_ENVIRONMENT_VARIABLE' -- Get an environmental variable
  10408. =================================================================
  10409. _Description_:
  10410. Get the VALUE of the environmental variable NAME.
  10411. Note that 'GET_ENVIRONMENT_VARIABLE' need not be thread-safe. It
  10412. is the responsibility of the user to ensure that the environment is
  10413. not being updated concurrently with a call to the
  10414. 'GET_ENVIRONMENT_VARIABLE' intrinsic.
  10415. _Standard_:
  10416. Fortran 2003 and later
  10417. _Class_:
  10418. Subroutine
  10419. _Syntax_:
  10420. 'CALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS,
  10421. TRIM_NAME)'
  10422. _Arguments_:
  10423. NAME Shall be a scalar of type 'CHARACTER' and of
  10424. default kind.
  10425. VALUE (Optional) Shall be a scalar of type 'CHARACTER'
  10426. and of default kind.
  10427. LENGTH (Optional) Shall be a scalar of type 'INTEGER'
  10428. and of default kind.
  10429. STATUS (Optional) Shall be a scalar of type 'INTEGER'
  10430. and of default kind.
  10431. TRIM_NAME (Optional) Shall be a scalar of type 'LOGICAL'
  10432. and of default kind.
  10433. _Return value_:
  10434. Stores the value of NAME in VALUE. If VALUE is not large enough to
  10435. hold the data, it is truncated. If NAME is not set, VALUE will be
  10436. filled with blanks. Argument LENGTH contains the length needed for
  10437. storing the environment variable NAME or zero if it is not present.
  10438. STATUS is -1 if VALUE is present but too short for the environment
  10439. variable; it is 1 if the environment variable does not exist and 2
  10440. if the processor does not support environment variables; in all
  10441. other cases STATUS is zero. If TRIM_NAME is present with the value
  10442. '.FALSE.', the trailing blanks in NAME are significant; otherwise
  10443. they are not part of the environment variable name.
  10444. _Example_:
  10445. PROGRAM test_getenv
  10446. CHARACTER(len=255) :: homedir
  10447. CALL get_environment_variable("HOME", homedir)
  10448. WRITE (*,*) TRIM(homedir)
  10449. END PROGRAM
  10450. 
  10451. File: gfortran.info, Node: GETGID, Next: GETLOG, Prev: GET_ENVIRONMENT_VARIABLE, Up: Intrinsic Procedures
  10452. 9.127 'GETGID' -- Group ID function
  10453. ===================================
  10454. _Description_:
  10455. Returns the numerical group ID of the current process.
  10456. _Standard_:
  10457. GNU extension
  10458. _Class_:
  10459. Function
  10460. _Syntax_:
  10461. 'RESULT = GETGID()'
  10462. _Return value_:
  10463. The return value of 'GETGID' is an 'INTEGER' of the default kind.
  10464. _Example_:
  10465. See 'GETPID' for an example.
  10466. _See also_:
  10467. *note GETPID::, *note GETUID::
  10468. 
  10469. File: gfortran.info, Node: GETLOG, Next: GETPID, Prev: GETGID, Up: Intrinsic Procedures
  10470. 9.128 'GETLOG' -- Get login name
  10471. ================================
  10472. _Description_:
  10473. Gets the username under which the program is running.
  10474. _Standard_:
  10475. GNU extension
  10476. _Class_:
  10477. Subroutine
  10478. _Syntax_:
  10479. 'CALL GETLOG(C)'
  10480. _Arguments_:
  10481. C Shall be of type 'CHARACTER' and of default
  10482. kind.
  10483. _Return value_:
  10484. Stores the current user name in LOGIN. (On systems where POSIX
  10485. functions 'geteuid' and 'getpwuid' are not available, and the
  10486. 'getlogin' function is not implemented either, this will return a
  10487. blank string.)
  10488. _Example_:
  10489. PROGRAM TEST_GETLOG
  10490. CHARACTER(32) :: login
  10491. CALL GETLOG(login)
  10492. WRITE(*,*) login
  10493. END PROGRAM
  10494. _See also_:
  10495. *note GETUID::
  10496. 
  10497. File: gfortran.info, Node: GETPID, Next: GETUID, Prev: GETLOG, Up: Intrinsic Procedures
  10498. 9.129 'GETPID' -- Process ID function
  10499. =====================================
  10500. _Description_:
  10501. Returns the numerical process identifier of the current process.
  10502. _Standard_:
  10503. GNU extension
  10504. _Class_:
  10505. Function
  10506. _Syntax_:
  10507. 'RESULT = GETPID()'
  10508. _Return value_:
  10509. The return value of 'GETPID' is an 'INTEGER' of the default kind.
  10510. _Example_:
  10511. program info
  10512. print *, "The current process ID is ", getpid()
  10513. print *, "Your numerical user ID is ", getuid()
  10514. print *, "Your numerical group ID is ", getgid()
  10515. end program info
  10516. _See also_:
  10517. *note GETGID::, *note GETUID::
  10518. 
  10519. File: gfortran.info, Node: GETUID, Next: GMTIME, Prev: GETPID, Up: Intrinsic Procedures
  10520. 9.130 'GETUID' -- User ID function
  10521. ==================================
  10522. _Description_:
  10523. Returns the numerical user ID of the current process.
  10524. _Standard_:
  10525. GNU extension
  10526. _Class_:
  10527. Function
  10528. _Syntax_:
  10529. 'RESULT = GETUID()'
  10530. _Return value_:
  10531. The return value of 'GETUID' is an 'INTEGER' of the default kind.
  10532. _Example_:
  10533. See 'GETPID' for an example.
  10534. _See also_:
  10535. *note GETPID::, *note GETLOG::
  10536. 
  10537. File: gfortran.info, Node: GMTIME, Next: HOSTNM, Prev: GETUID, Up: Intrinsic Procedures
  10538. 9.131 'GMTIME' -- Convert time to GMT info
  10539. ==========================================
  10540. _Description_:
  10541. Given a system time value TIME (as provided by the *note TIME::
  10542. intrinsic), fills VALUES with values extracted from it appropriate
  10543. to the UTC time zone (Universal Coordinated Time, also known in
  10544. some countries as GMT, Greenwich Mean Time), using 'gmtime(3)'.
  10545. This intrinsic routine is provided for backwards compatibility with
  10546. GNU Fortran 77. In new code, programmers should consider the use
  10547. of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
  10548. standard.
  10549. _Standard_:
  10550. GNU extension
  10551. _Class_:
  10552. Subroutine
  10553. _Syntax_:
  10554. 'CALL GMTIME(TIME, VALUES)'
  10555. _Arguments_:
  10556. TIME An 'INTEGER' scalar expression corresponding to
  10557. a system time, with 'INTENT(IN)'.
  10558. VALUES A default 'INTEGER' array with 9 elements, with
  10559. 'INTENT(OUT)'.
  10560. _Return value_:
  10561. The elements of VALUES are assigned as follows:
  10562. 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
  10563. seconds
  10564. 2. Minutes after the hour, range 0-59
  10565. 3. Hours past midnight, range 0-23
  10566. 4. Day of month, range 1-31
  10567. 5. Number of months since January, range 0-11
  10568. 6. Years since 1900
  10569. 7. Number of days since Sunday, range 0-6
  10570. 8. Days since January 1, range 0-365
  10571. 9. Daylight savings indicator: positive if daylight savings is in
  10572. effect, zero if not, and negative if the information is not
  10573. available.
  10574. _See also_:
  10575. *note DATE_AND_TIME::, *note CTIME::, *note LTIME::, *note TIME::,
  10576. *note TIME8::
  10577. 
  10578. File: gfortran.info, Node: HOSTNM, Next: HUGE, Prev: GMTIME, Up: Intrinsic Procedures
  10579. 9.132 'HOSTNM' -- Get system host name
  10580. ======================================
  10581. _Description_:
  10582. Retrieves the host name of the system on which the program is
  10583. running.
  10584. This intrinsic is provided in both subroutine and function forms;
  10585. however, only one form can be used in any given program unit.
  10586. _Standard_:
  10587. GNU extension
  10588. _Class_:
  10589. Subroutine, function
  10590. _Syntax_:
  10591. 'CALL HOSTNM(C [, STATUS])'
  10592. 'STATUS = HOSTNM(NAME)'
  10593. _Arguments_:
  10594. C Shall of type 'CHARACTER' and of default kind.
  10595. STATUS (Optional) status flag of type 'INTEGER'.
  10596. Returns 0 on success, or a system specific error
  10597. code otherwise.
  10598. _Return value_:
  10599. In either syntax, NAME is set to the current hostname if it can be
  10600. obtained, or to a blank string otherwise.
  10601. 
  10602. File: gfortran.info, Node: HUGE, Next: HYPOT, Prev: HOSTNM, Up: Intrinsic Procedures
  10603. 9.133 'HUGE' -- Largest number of a kind
  10604. ========================================
  10605. _Description_:
  10606. 'HUGE(X)' returns the largest number that is not an infinity in the
  10607. model of the type of 'X'.
  10608. _Standard_:
  10609. Fortran 90 and later
  10610. _Class_:
  10611. Inquiry function
  10612. _Syntax_:
  10613. 'RESULT = HUGE(X)'
  10614. _Arguments_:
  10615. X Shall be of type 'REAL' or 'INTEGER'.
  10616. _Return value_:
  10617. The return value is of the same type and kind as X
  10618. _Example_:
  10619. program test_huge_tiny
  10620. print *, huge(0), huge(0.0), huge(0.0d0)
  10621. print *, tiny(0.0), tiny(0.0d0)
  10622. end program test_huge_tiny
  10623. 
  10624. File: gfortran.info, Node: HYPOT, Next: IACHAR, Prev: HUGE, Up: Intrinsic Procedures
  10625. 9.134 'HYPOT' -- Euclidean distance function
  10626. ============================================
  10627. _Description_:
  10628. 'HYPOT(X,Y)' is the Euclidean distance function. It is equal to
  10629. \sqrt{X^2 + Y^2}, without undue underflow or overflow.
  10630. _Standard_:
  10631. Fortran 2008 and later
  10632. _Class_:
  10633. Elemental function
  10634. _Syntax_:
  10635. 'RESULT = HYPOT(X, Y)'
  10636. _Arguments_:
  10637. X The type shall be 'REAL'.
  10638. Y The type and kind type parameter shall be the
  10639. same as X.
  10640. _Return value_:
  10641. The return value has the same type and kind type parameter as X.
  10642. _Example_:
  10643. program test_hypot
  10644. real(4) :: x = 1.e0_4, y = 0.5e0_4
  10645. x = hypot(x,y)
  10646. end program test_hypot
  10647. 
  10648. File: gfortran.info, Node: IACHAR, Next: IALL, Prev: HYPOT, Up: Intrinsic Procedures
  10649. 9.135 'IACHAR' -- Code in ASCII collating sequence
  10650. ==================================================
  10651. _Description_:
  10652. 'IACHAR(C)' returns the code for the ASCII character in the first
  10653. character position of 'C'.
  10654. _Standard_:
  10655. Fortran 95 and later, with KIND argument Fortran 2003 and later
  10656. _Class_:
  10657. Elemental function
  10658. _Syntax_:
  10659. 'RESULT = IACHAR(C [, KIND])'
  10660. _Arguments_:
  10661. C Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
  10662. KIND (Optional) An 'INTEGER' initialization
  10663. expression indicating the kind parameter of the
  10664. result.
  10665. _Return value_:
  10666. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  10667. absent, the return value is of default integer kind.
  10668. _Example_:
  10669. program test_iachar
  10670. integer i
  10671. i = iachar(' ')
  10672. end program test_iachar
  10673. _Note_:
  10674. See *note ICHAR:: for a discussion of converting between numerical
  10675. values and formatted string representations.
  10676. _See also_:
  10677. *note ACHAR::, *note CHAR::, *note ICHAR::
  10678. 
  10679. File: gfortran.info, Node: IALL, Next: IAND, Prev: IACHAR, Up: Intrinsic Procedures
  10680. 9.136 'IALL' -- Bitwise AND of array elements
  10681. =============================================
  10682. _Description_:
  10683. Reduces with bitwise AND the elements of ARRAY along dimension DIM
  10684. if the corresponding element in MASK is 'TRUE'.
  10685. _Standard_:
  10686. Fortran 2008 and later
  10687. _Class_:
  10688. Transformational function
  10689. _Syntax_:
  10690. 'RESULT = IALL(ARRAY[, MASK])'
  10691. 'RESULT = IALL(ARRAY, DIM[, MASK])'
  10692. _Arguments_:
  10693. ARRAY Shall be an array of type 'INTEGER'
  10694. DIM (Optional) shall be a scalar of type 'INTEGER'
  10695. with a value in the range from 1 to n, where n
  10696. equals the rank of ARRAY.
  10697. MASK (Optional) shall be of type 'LOGICAL' and either
  10698. be a scalar or an array of the same shape as
  10699. ARRAY.
  10700. _Return value_:
  10701. The result is of the same type as ARRAY.
  10702. If DIM is absent, a scalar with the bitwise ALL of all elements in
  10703. ARRAY is returned. Otherwise, an array of rank n-1, where n equals
  10704. the rank of ARRAY, and a shape similar to that of ARRAY with
  10705. dimension DIM dropped is returned.
  10706. _Example_:
  10707. PROGRAM test_iall
  10708. INTEGER(1) :: a(2)
  10709. a(1) = b'00100100'
  10710. a(2) = b'01101010'
  10711. ! prints 00100000
  10712. PRINT '(b8.8)', IALL(a)
  10713. END PROGRAM
  10714. _See also_:
  10715. *note IANY::, *note IPARITY::, *note IAND::
  10716. 
  10717. File: gfortran.info, Node: IAND, Next: IANY, Prev: IALL, Up: Intrinsic Procedures
  10718. 9.137 'IAND' -- Bitwise logical and
  10719. ===================================
  10720. _Description_:
  10721. Bitwise logical 'AND'.
  10722. _Standard_:
  10723. Fortran 90 and later, with boz-literal-constant Fortran 2008 and
  10724. later, has overloads that are GNU extensions
  10725. _Class_:
  10726. Elemental function
  10727. _Syntax_:
  10728. 'RESULT = IAND(I, J)'
  10729. _Arguments_:
  10730. I The type shall be 'INTEGER' or a
  10731. boz-literal-constant.
  10732. J The type shall be 'INTEGER' with the same kind
  10733. type parameter as I or a boz-literal-constant.
  10734. I and J shall not both be boz-literal-constants.
  10735. _Return value_:
  10736. The return type is 'INTEGER' with the kind type parameter of the
  10737. arguments. A boz-literal-constant is converted to an 'INTEGER'
  10738. with the kind type parameter of the other argument as-if a call to
  10739. *note INT:: occurred.
  10740. _Example_:
  10741. PROGRAM test_iand
  10742. INTEGER :: a, b
  10743. DATA a / Z'F' /, b / Z'3' /
  10744. WRITE (*,*) IAND(a, b)
  10745. END PROGRAM
  10746. _Specific names_:
  10747. Name Argument Return type Standard
  10748. 'IAND(A)' 'INTEGER A' 'INTEGER' Fortran 90 and
  10749. later
  10750. 'BIAND(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10751. A'
  10752. 'IIAND(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10753. A'
  10754. 'JIAND(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10755. A'
  10756. 'KIAND(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10757. A'
  10758. _See also_:
  10759. *note IOR::, *note IEOR::, *note IBITS::, *note IBSET::, *note
  10760. IBCLR::, *note NOT::
  10761. 
  10762. File: gfortran.info, Node: IANY, Next: IARGC, Prev: IAND, Up: Intrinsic Procedures
  10763. 9.138 'IANY' -- Bitwise OR of array elements
  10764. ============================================
  10765. _Description_:
  10766. Reduces with bitwise OR (inclusive or) the elements of ARRAY along
  10767. dimension DIM if the corresponding element in MASK is 'TRUE'.
  10768. _Standard_:
  10769. Fortran 2008 and later
  10770. _Class_:
  10771. Transformational function
  10772. _Syntax_:
  10773. 'RESULT = IANY(ARRAY[, MASK])'
  10774. 'RESULT = IANY(ARRAY, DIM[, MASK])'
  10775. _Arguments_:
  10776. ARRAY Shall be an array of type 'INTEGER'
  10777. DIM (Optional) shall be a scalar of type 'INTEGER'
  10778. with a value in the range from 1 to n, where n
  10779. equals the rank of ARRAY.
  10780. MASK (Optional) shall be of type 'LOGICAL' and either
  10781. be a scalar or an array of the same shape as
  10782. ARRAY.
  10783. _Return value_:
  10784. The result is of the same type as ARRAY.
  10785. If DIM is absent, a scalar with the bitwise OR of all elements in
  10786. ARRAY is returned. Otherwise, an array of rank n-1, where n equals
  10787. the rank of ARRAY, and a shape similar to that of ARRAY with
  10788. dimension DIM dropped is returned.
  10789. _Example_:
  10790. PROGRAM test_iany
  10791. INTEGER(1) :: a(2)
  10792. a(1) = b'00100100'
  10793. a(2) = b'01101010'
  10794. ! prints 01101110
  10795. PRINT '(b8.8)', IANY(a)
  10796. END PROGRAM
  10797. _See also_:
  10798. *note IPARITY::, *note IALL::, *note IOR::
  10799. 
  10800. File: gfortran.info, Node: IARGC, Next: IBCLR, Prev: IANY, Up: Intrinsic Procedures
  10801. 9.139 'IARGC' -- Get the number of command line arguments
  10802. =========================================================
  10803. _Description_:
  10804. 'IARGC' returns the number of arguments passed on the command line
  10805. when the containing program was invoked.
  10806. This intrinsic routine is provided for backwards compatibility with
  10807. GNU Fortran 77. In new code, programmers should consider the use
  10808. of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the
  10809. Fortran 2003 standard.
  10810. _Standard_:
  10811. GNU extension
  10812. _Class_:
  10813. Function
  10814. _Syntax_:
  10815. 'RESULT = IARGC()'
  10816. _Arguments_:
  10817. None
  10818. _Return value_:
  10819. The number of command line arguments, type 'INTEGER(4)'.
  10820. _Example_:
  10821. See *note GETARG::
  10822. _See also_:
  10823. GNU Fortran 77 compatibility subroutine: *note GETARG:: Fortran
  10824. 2003 functions and subroutines: *note GET_COMMAND::, *note
  10825. GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
  10826. 
  10827. File: gfortran.info, Node: IBCLR, Next: IBITS, Prev: IARGC, Up: Intrinsic Procedures
  10828. 9.140 'IBCLR' -- Clear bit
  10829. ==========================
  10830. _Description_:
  10831. 'IBCLR' returns the value of I with the bit at position POS set to
  10832. zero.
  10833. _Standard_:
  10834. Fortran 90 and later, has overloads that are GNU extensions
  10835. _Class_:
  10836. Elemental function
  10837. _Syntax_:
  10838. 'RESULT = IBCLR(I, POS)'
  10839. _Arguments_:
  10840. I The type shall be 'INTEGER'.
  10841. POS The type shall be 'INTEGER'.
  10842. _Return value_:
  10843. The return value is of type 'INTEGER' and of the same kind as I.
  10844. _Specific names_:
  10845. Name Argument Return type Standard
  10846. 'IBCLR(A)' 'INTEGER A' 'INTEGER' Fortran 90 and
  10847. later
  10848. 'BBCLR(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10849. A'
  10850. 'IIBCLR(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10851. A'
  10852. 'JIBCLR(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10853. A'
  10854. 'KIBCLR(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10855. A'
  10856. _See also_:
  10857. *note IBITS::, *note IBSET::, *note IAND::, *note IOR::, *note
  10858. IEOR::, *note MVBITS::
  10859. 
  10860. File: gfortran.info, Node: IBITS, Next: IBSET, Prev: IBCLR, Up: Intrinsic Procedures
  10861. 9.141 'IBITS' -- Bit extraction
  10862. ===============================
  10863. _Description_:
  10864. 'IBITS' extracts a field of length LEN from I, starting from bit
  10865. position POS and extending left for LEN bits. The result is
  10866. right-justified and the remaining bits are zeroed. The value of
  10867. 'POS+LEN' must be less than or equal to the value 'BIT_SIZE(I)'.
  10868. _Standard_:
  10869. Fortran 90 and later, has overloads that are GNU extensions
  10870. _Class_:
  10871. Elemental function
  10872. _Syntax_:
  10873. 'RESULT = IBITS(I, POS, LEN)'
  10874. _Arguments_:
  10875. I The type shall be 'INTEGER'.
  10876. POS The type shall be 'INTEGER'.
  10877. LEN The type shall be 'INTEGER'.
  10878. _Return value_:
  10879. The return value is of type 'INTEGER' and of the same kind as I.
  10880. _Specific names_:
  10881. Name Argument Return type Standard
  10882. 'IBITS(A)' 'INTEGER A' 'INTEGER' Fortran 90 and
  10883. later
  10884. 'BBITS(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10885. A'
  10886. 'IIBITS(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10887. A'
  10888. 'JIBITS(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10889. A'
  10890. 'KIBITS(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10891. A'
  10892. _See also_:
  10893. *note BIT_SIZE::, *note IBCLR::, *note IBSET::, *note IAND::, *note
  10894. IOR::, *note IEOR::
  10895. 
  10896. File: gfortran.info, Node: IBSET, Next: ICHAR, Prev: IBITS, Up: Intrinsic Procedures
  10897. 9.142 'IBSET' -- Set bit
  10898. ========================
  10899. _Description_:
  10900. 'IBSET' returns the value of I with the bit at position POS set to
  10901. one.
  10902. _Standard_:
  10903. Fortran 90 and later, has overloads that are GNU extensions
  10904. _Class_:
  10905. Elemental function
  10906. _Syntax_:
  10907. 'RESULT = IBSET(I, POS)'
  10908. _Arguments_:
  10909. I The type shall be 'INTEGER'.
  10910. POS The type shall be 'INTEGER'.
  10911. _Return value_:
  10912. The return value is of type 'INTEGER' and of the same kind as I.
  10913. _Specific names_:
  10914. Name Argument Return type Standard
  10915. 'IBSET(A)' 'INTEGER A' 'INTEGER' Fortran 90 and
  10916. later
  10917. 'BBSET(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10918. A'
  10919. 'IIBSET(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10920. A'
  10921. 'JIBSET(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10922. A'
  10923. 'KIBSET(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10924. A'
  10925. _See also_:
  10926. *note IBCLR::, *note IBITS::, *note IAND::, *note IOR::, *note
  10927. IEOR::, *note MVBITS::
  10928. 
  10929. File: gfortran.info, Node: ICHAR, Next: IDATE, Prev: IBSET, Up: Intrinsic Procedures
  10930. 9.143 'ICHAR' -- Character-to-integer conversion function
  10931. =========================================================
  10932. _Description_:
  10933. 'ICHAR(C)' returns the code for the character in the first
  10934. character position of 'C' in the system's native character set.
  10935. The correspondence between characters and their codes is not
  10936. necessarily the same across different GNU Fortran implementations.
  10937. _Standard_:
  10938. Fortran 77 and later, with KIND argument Fortran 2003 and later
  10939. _Class_:
  10940. Elemental function
  10941. _Syntax_:
  10942. 'RESULT = ICHAR(C [, KIND])'
  10943. _Arguments_:
  10944. C Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
  10945. KIND (Optional) An 'INTEGER' initialization
  10946. expression indicating the kind parameter of the
  10947. result.
  10948. _Return value_:
  10949. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  10950. absent, the return value is of default integer kind.
  10951. _Example_:
  10952. program test_ichar
  10953. integer i
  10954. i = ichar(' ')
  10955. end program test_ichar
  10956. _Specific names_:
  10957. Name Argument Return type Standard
  10958. 'ICHAR(C)' 'CHARACTER 'INTEGER(4)' Fortran 77 and
  10959. C' later
  10960. _Note_:
  10961. No intrinsic exists to convert between a numeric value and a
  10962. formatted character string representation - for instance, given the
  10963. 'CHARACTER' value ''154'', obtaining an 'INTEGER' or 'REAL' value
  10964. with the value 154, or vice versa. Instead, this functionality is
  10965. provided by internal-file I/O, as in the following example:
  10966. program read_val
  10967. integer value
  10968. character(len=10) string, string2
  10969. string = '154'
  10970. ! Convert a string to a numeric value
  10971. read (string,'(I10)') value
  10972. print *, value
  10973. ! Convert a value to a formatted string
  10974. write (string2,'(I10)') value
  10975. print *, string2
  10976. end program read_val
  10977. _See also_:
  10978. *note ACHAR::, *note CHAR::, *note IACHAR::
  10979. 
  10980. File: gfortran.info, Node: IDATE, Next: IEOR, Prev: ICHAR, Up: Intrinsic Procedures
  10981. 9.144 'IDATE' -- Get current local time subroutine (day/month/year)
  10982. ===================================================================
  10983. _Description_:
  10984. 'IDATE(VALUES)' Fills VALUES with the numerical values at the
  10985. current local time. The day (in the range 1-31), month (in the
  10986. range 1-12), and year appear in elements 1, 2, and 3 of VALUES,
  10987. respectively. The year has four significant digits.
  10988. This intrinsic routine is provided for backwards compatibility with
  10989. GNU Fortran 77. In new code, programmers should consider the use
  10990. of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
  10991. standard.
  10992. _Standard_:
  10993. GNU extension
  10994. _Class_:
  10995. Subroutine
  10996. _Syntax_:
  10997. 'CALL IDATE(VALUES)'
  10998. _Arguments_:
  10999. VALUES The type shall be 'INTEGER, DIMENSION(3)' and
  11000. the kind shall be the default integer kind.
  11001. _Return value_:
  11002. Does not return anything.
  11003. _Example_:
  11004. program test_idate
  11005. integer, dimension(3) :: tarray
  11006. call idate(tarray)
  11007. print *, tarray(1)
  11008. print *, tarray(2)
  11009. print *, tarray(3)
  11010. end program test_idate
  11011. _See also_:
  11012. *note DATE_AND_TIME::
  11013. 
  11014. File: gfortran.info, Node: IEOR, Next: IERRNO, Prev: IDATE, Up: Intrinsic Procedures
  11015. 9.145 'IEOR' -- Bitwise logical exclusive or
  11016. ============================================
  11017. _Description_:
  11018. 'IEOR' returns the bitwise Boolean exclusive-OR of I and J.
  11019. _Standard_:
  11020. Fortran 90 and later, with boz-literal-constant Fortran 2008 and
  11021. later, has overloads that are GNU extensions
  11022. _Class_:
  11023. Elemental function
  11024. _Syntax_:
  11025. 'RESULT = IEOR(I, J)'
  11026. _Arguments_:
  11027. I The type shall be 'INTEGER' or a
  11028. boz-literal-constant.
  11029. J The type shall be 'INTEGER' with the same kind
  11030. type parameter as I or a boz-literal-constant.
  11031. I and J shall not both be boz-literal-constants.
  11032. _Return value_:
  11033. The return type is 'INTEGER' with the kind type parameter of the
  11034. arguments. A boz-literal-constant is converted to an 'INTEGER'
  11035. with the kind type parameter of the other argument as-if a call to
  11036. *note INT:: occurred.
  11037. _Specific names_:
  11038. Name Argument Return type Standard
  11039. 'IEOR(A)' 'INTEGER A' 'INTEGER' Fortran 90 and
  11040. later
  11041. 'BIEOR(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  11042. A'
  11043. 'IIEOR(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  11044. A'
  11045. 'JIEOR(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  11046. A'
  11047. 'KIEOR(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  11048. A'
  11049. _See also_:
  11050. *note IOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
  11051. IBCLR::, *note NOT::
  11052. 
  11053. File: gfortran.info, Node: IERRNO, Next: IMAGE_INDEX, Prev: IEOR, Up: Intrinsic Procedures
  11054. 9.146 'IERRNO' -- Get the last system error number
  11055. ==================================================
  11056. _Description_:
  11057. Returns the last system error number, as given by the C 'errno'
  11058. variable.
  11059. _Standard_:
  11060. GNU extension
  11061. _Class_:
  11062. Function
  11063. _Syntax_:
  11064. 'RESULT = IERRNO()'
  11065. _Arguments_:
  11066. None
  11067. _Return value_:
  11068. The return value is of type 'INTEGER' and of the default integer
  11069. kind.
  11070. _See also_:
  11071. *note PERROR::
  11072. 
  11073. File: gfortran.info, Node: IMAGE_INDEX, Next: INDEX intrinsic, Prev: IERRNO, Up: Intrinsic Procedures
  11074. 9.147 'IMAGE_INDEX' -- Function that converts a cosubscript to an image index
  11075. =============================================================================
  11076. _Description_:
  11077. Returns the image index belonging to a cosubscript.
  11078. _Standard_:
  11079. Fortran 2008 and later
  11080. _Class_:
  11081. Inquiry function.
  11082. _Syntax_:
  11083. 'RESULT = IMAGE_INDEX(COARRAY, SUB)'
  11084. _Arguments_:
  11085. COARRAY Coarray of any type.
  11086. SUB default integer rank-1 array of a size equal to
  11087. the corank of COARRAY.
  11088. _Return value_:
  11089. Scalar default integer with the value of the image index which
  11090. corresponds to the cosubscripts. For invalid cosubscripts the
  11091. result is zero.
  11092. _Example_:
  11093. INTEGER :: array[2,-1:4,8,*]
  11094. ! Writes 28 (or 0 if there are fewer than 28 images)
  11095. WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1])
  11096. _See also_:
  11097. *note THIS_IMAGE::, *note NUM_IMAGES::
  11098. 
  11099. File: gfortran.info, Node: INDEX intrinsic, Next: INT, Prev: IMAGE_INDEX, Up: Intrinsic Procedures
  11100. 9.148 'INDEX' -- Position of a substring within a string
  11101. ========================================================
  11102. _Description_:
  11103. Returns the position of the start of the first occurrence of string
  11104. SUBSTRING as a substring in STRING, counting from one. If
  11105. SUBSTRING is not present in STRING, zero is returned. If the BACK
  11106. argument is present and true, the return value is the start of the
  11107. last occurrence rather than the first.
  11108. _Standard_:
  11109. Fortran 77 and later, with KIND argument Fortran 2003 and later
  11110. _Class_:
  11111. Elemental function
  11112. _Syntax_:
  11113. 'RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])'
  11114. _Arguments_:
  11115. STRING Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
  11116. SUBSTRING Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
  11117. BACK (Optional) Shall be a scalar 'LOGICAL', with
  11118. 'INTENT(IN)'
  11119. KIND (Optional) An 'INTEGER' initialization
  11120. expression indicating the kind parameter of the
  11121. result.
  11122. _Return value_:
  11123. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  11124. absent, the return value is of default integer kind.
  11125. _Specific names_:
  11126. Name Argument Return type Standard
  11127. 'INDEX(STRING, 'CHARACTER' 'INTEGER(4)' Fortran 77 and
  11128. SUBSTRING)' later
  11129. _See also_:
  11130. *note SCAN::, *note VERIFY::
  11131. 
  11132. File: gfortran.info, Node: INT, Next: INT2, Prev: INDEX intrinsic, Up: Intrinsic Procedures
  11133. 9.149 'INT' -- Convert to integer type
  11134. ======================================
  11135. _Description_:
  11136. Convert to integer type
  11137. _Standard_:
  11138. Fortran 77 and later, with boz-literal-constant Fortran 2008 and
  11139. later.
  11140. _Class_:
  11141. Elemental function
  11142. _Syntax_:
  11143. 'RESULT = INT(A [, KIND))'
  11144. _Arguments_:
  11145. A Shall be of type 'INTEGER', 'REAL', or 'COMPLEX'
  11146. or or a boz-literal-constant.
  11147. KIND (Optional) An 'INTEGER' initialization
  11148. expression indicating the kind parameter of the
  11149. result.
  11150. _Return value_:
  11151. These functions return a 'INTEGER' variable or array under the
  11152. following rules:
  11153. (A)
  11154. If A is of type 'INTEGER', 'INT(A) = A'
  11155. (B)
  11156. If A is of type 'REAL' and |A| < 1, 'INT(A)' equals '0'. If
  11157. |A| \geq 1, then 'INT(A)' is the integer whose magnitude is
  11158. the largest integer that does not exceed the magnitude of A
  11159. and whose sign is the same as the sign of A.
  11160. (C)
  11161. If A is of type 'COMPLEX', rule B is applied to the real part
  11162. of A.
  11163. _Example_:
  11164. program test_int
  11165. integer :: i = 42
  11166. complex :: z = (-3.7, 1.0)
  11167. print *, int(i)
  11168. print *, int(z), int(z,8)
  11169. end program
  11170. _Specific names_:
  11171. Name Argument Return type Standard
  11172. 'INT(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and
  11173. later
  11174. 'IFIX(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and
  11175. later
  11176. 'IDINT(A)' 'REAL(8) A' 'INTEGER' Fortran 77 and
  11177. later
  11178. 
  11179. File: gfortran.info, Node: INT2, Next: INT8, Prev: INT, Up: Intrinsic Procedures
  11180. 9.150 'INT2' -- Convert to 16-bit integer type
  11181. ==============================================
  11182. _Description_:
  11183. Convert to a 'KIND=2' integer type. This is equivalent to the
  11184. standard 'INT' intrinsic with an optional argument of 'KIND=2', and
  11185. is only included for backwards compatibility.
  11186. The 'SHORT' intrinsic is equivalent to 'INT2'.
  11187. _Standard_:
  11188. GNU extension
  11189. _Class_:
  11190. Elemental function
  11191. _Syntax_:
  11192. 'RESULT = INT2(A)'
  11193. _Arguments_:
  11194. A Shall be of type 'INTEGER', 'REAL', or
  11195. 'COMPLEX'.
  11196. _Return value_:
  11197. The return value is a 'INTEGER(2)' variable.
  11198. _See also_:
  11199. *note INT::, *note INT8::, *note LONG::
  11200. 
  11201. File: gfortran.info, Node: INT8, Next: IOR, Prev: INT2, Up: Intrinsic Procedures
  11202. 9.151 'INT8' -- Convert to 64-bit integer type
  11203. ==============================================
  11204. _Description_:
  11205. Convert to a 'KIND=8' integer type. This is equivalent to the
  11206. standard 'INT' intrinsic with an optional argument of 'KIND=8', and
  11207. is only included for backwards compatibility.
  11208. _Standard_:
  11209. GNU extension
  11210. _Class_:
  11211. Elemental function
  11212. _Syntax_:
  11213. 'RESULT = INT8(A)'
  11214. _Arguments_:
  11215. A Shall be of type 'INTEGER', 'REAL', or
  11216. 'COMPLEX'.
  11217. _Return value_:
  11218. The return value is a 'INTEGER(8)' variable.
  11219. _See also_:
  11220. *note INT::, *note INT2::, *note LONG::
  11221. 
  11222. File: gfortran.info, Node: IOR, Next: IPARITY, Prev: INT8, Up: Intrinsic Procedures
  11223. 9.152 'IOR' -- Bitwise logical or
  11224. =================================
  11225. _Description_:
  11226. 'IOR' returns the bitwise Boolean inclusive-OR of I and J.
  11227. _Standard_:
  11228. Fortran 90 and later, with boz-literal-constant Fortran 2008 and
  11229. later, has overloads that are GNU extensions
  11230. _Class_:
  11231. Elemental function
  11232. _Syntax_:
  11233. 'RESULT = IOR(I, J)'
  11234. _Arguments_:
  11235. I The type shall be 'INTEGER' or a
  11236. boz-literal-constant.
  11237. J The type shall be 'INTEGER' with the same kind
  11238. type parameter as I or a boz-literal-constant.
  11239. I and J shall not both be boz-literal-constants.
  11240. _Return value_:
  11241. The return type is 'INTEGER' with the kind type parameter of the
  11242. arguments. A boz-literal-constant is converted to an 'INTEGER'
  11243. with the kind type parameter of the other argument as-if a call to
  11244. *note INT:: occurred.
  11245. _Specific names_:
  11246. Name Argument Return type Standard
  11247. 'IOR(A)' 'INTEGER A' 'INTEGER' Fortran 90 and
  11248. later
  11249. 'BIOR(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  11250. A'
  11251. 'IIOR(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  11252. A'
  11253. 'JIOR(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  11254. A'
  11255. 'KIOR(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  11256. A'
  11257. _See also_:
  11258. *note IEOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
  11259. IBCLR::, *note NOT::
  11260. 
  11261. File: gfortran.info, Node: IPARITY, Next: IRAND, Prev: IOR, Up: Intrinsic Procedures
  11262. 9.153 'IPARITY' -- Bitwise XOR of array elements
  11263. ================================================
  11264. _Description_:
  11265. Reduces with bitwise XOR (exclusive or) the elements of ARRAY along
  11266. dimension DIM if the corresponding element in MASK is 'TRUE'.
  11267. _Standard_:
  11268. Fortran 2008 and later
  11269. _Class_:
  11270. Transformational function
  11271. _Syntax_:
  11272. 'RESULT = IPARITY(ARRAY[, MASK])'
  11273. 'RESULT = IPARITY(ARRAY, DIM[, MASK])'
  11274. _Arguments_:
  11275. ARRAY Shall be an array of type 'INTEGER'
  11276. DIM (Optional) shall be a scalar of type 'INTEGER'
  11277. with a value in the range from 1 to n, where n
  11278. equals the rank of ARRAY.
  11279. MASK (Optional) shall be of type 'LOGICAL' and either
  11280. be a scalar or an array of the same shape as
  11281. ARRAY.
  11282. _Return value_:
  11283. The result is of the same type as ARRAY.
  11284. If DIM is absent, a scalar with the bitwise XOR of all elements in
  11285. ARRAY is returned. Otherwise, an array of rank n-1, where n equals
  11286. the rank of ARRAY, and a shape similar to that of ARRAY with
  11287. dimension DIM dropped is returned.
  11288. _Example_:
  11289. PROGRAM test_iparity
  11290. INTEGER(1) :: a(2)
  11291. a(1) = int(b'00100100', 1)
  11292. a(2) = int(b'01101010', 1)
  11293. ! prints 01001110
  11294. PRINT '(b8.8)', IPARITY(a)
  11295. END PROGRAM
  11296. _See also_:
  11297. *note IANY::, *note IALL::, *note IEOR::, *note PARITY::
  11298. 
  11299. File: gfortran.info, Node: IRAND, Next: IS_CONTIGUOUS, Prev: IPARITY, Up: Intrinsic Procedures
  11300. 9.154 'IRAND' -- Integer pseudo-random number
  11301. =============================================
  11302. _Description_:
  11303. 'IRAND(FLAG)' returns a pseudo-random number from a uniform
  11304. distribution between 0 and a system-dependent limit (which is in
  11305. most cases 2147483647). If FLAG is 0, the next number in the
  11306. current sequence is returned; if FLAG is 1, the generator is
  11307. restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
  11308. used as a new seed with 'SRAND'.
  11309. This intrinsic routine is provided for backwards compatibility with
  11310. GNU Fortran 77. It implements a simple modulo generator as
  11311. provided by 'g77'. For new code, one should consider the use of
  11312. *note RANDOM_NUMBER:: as it implements a superior algorithm.
  11313. _Standard_:
  11314. GNU extension
  11315. _Class_:
  11316. Function
  11317. _Syntax_:
  11318. 'RESULT = IRAND(I)'
  11319. _Arguments_:
  11320. I Shall be a scalar 'INTEGER' of kind 4.
  11321. _Return value_:
  11322. The return value is of 'INTEGER(kind=4)' type.
  11323. _Example_:
  11324. program test_irand
  11325. integer,parameter :: seed = 86456
  11326. call srand(seed)
  11327. print *, irand(), irand(), irand(), irand()
  11328. print *, irand(seed), irand(), irand(), irand()
  11329. end program test_irand
  11330. 
  11331. File: gfortran.info, Node: IS_CONTIGUOUS, Next: IS_IOSTAT_END, Prev: IRAND, Up: Intrinsic Procedures
  11332. 9.155 'IS_CONTIGUOUS' -- Test whether an array is contiguous
  11333. ============================================================
  11334. _Description_:
  11335. 'IS_CONTIGUOUS' tests whether an array is contiguous.
  11336. _Standard_:
  11337. Fortran 2008 and later
  11338. _Class_:
  11339. Inquiry function
  11340. _Syntax_:
  11341. 'RESULT = IS_CONTIGUOUS(ARRAY)'
  11342. _Arguments_:
  11343. ARRAY Shall be an array of any type.
  11344. _Return value_:
  11345. Returns a 'LOGICAL' of the default kind, which '.TRUE.' if ARRAY is
  11346. contiguous and false otherwise.
  11347. _Example_:
  11348. program test
  11349. integer :: a(10)
  11350. a = [1,2,3,4,5,6,7,8,9,10]
  11351. call sub (a) ! every element, is contiguous
  11352. call sub (a(::2)) ! every other element, is noncontiguous
  11353. contains
  11354. subroutine sub (x)
  11355. integer :: x(:)
  11356. if (is_contiguous (x)) then
  11357. write (*,*) 'X is contiguous'
  11358. else
  11359. write (*,*) 'X is not contiguous'
  11360. end if
  11361. end subroutine sub
  11362. end program test
  11363. 
  11364. File: gfortran.info, Node: IS_IOSTAT_END, Next: IS_IOSTAT_EOR, Prev: IS_CONTIGUOUS, Up: Intrinsic Procedures
  11365. 9.156 'IS_IOSTAT_END' -- Test for end-of-file value
  11366. ===================================================
  11367. _Description_:
  11368. 'IS_IOSTAT_END' tests whether an variable has the value of the I/O
  11369. status "end of file". The function is equivalent to comparing the
  11370. variable with the 'IOSTAT_END' parameter of the intrinsic module
  11371. 'ISO_FORTRAN_ENV'.
  11372. _Standard_:
  11373. Fortran 2003 and later
  11374. _Class_:
  11375. Elemental function
  11376. _Syntax_:
  11377. 'RESULT = IS_IOSTAT_END(I)'
  11378. _Arguments_:
  11379. I Shall be of the type 'INTEGER'.
  11380. _Return value_:
  11381. Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
  11382. the value which indicates an end of file condition for 'IOSTAT='
  11383. specifiers, and is '.FALSE.' otherwise.
  11384. _Example_:
  11385. PROGRAM iostat
  11386. IMPLICIT NONE
  11387. INTEGER :: stat, i
  11388. OPEN(88, FILE='test.dat')
  11389. READ(88, *, IOSTAT=stat) i
  11390. IF(IS_IOSTAT_END(stat)) STOP 'END OF FILE'
  11391. END PROGRAM
  11392. 
  11393. File: gfortran.info, Node: IS_IOSTAT_EOR, Next: ISATTY, Prev: IS_IOSTAT_END, Up: Intrinsic Procedures
  11394. 9.157 'IS_IOSTAT_EOR' -- Test for end-of-record value
  11395. =====================================================
  11396. _Description_:
  11397. 'IS_IOSTAT_EOR' tests whether an variable has the value of the I/O
  11398. status "end of record". The function is equivalent to comparing
  11399. the variable with the 'IOSTAT_EOR' parameter of the intrinsic
  11400. module 'ISO_FORTRAN_ENV'.
  11401. _Standard_:
  11402. Fortran 2003 and later
  11403. _Class_:
  11404. Elemental function
  11405. _Syntax_:
  11406. 'RESULT = IS_IOSTAT_EOR(I)'
  11407. _Arguments_:
  11408. I Shall be of the type 'INTEGER'.
  11409. _Return value_:
  11410. Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
  11411. the value which indicates an end of file condition for 'IOSTAT='
  11412. specifiers, and is '.FALSE.' otherwise.
  11413. _Example_:
  11414. PROGRAM iostat
  11415. IMPLICIT NONE
  11416. INTEGER :: stat, i(50)
  11417. OPEN(88, FILE='test.dat', FORM='UNFORMATTED')
  11418. READ(88, IOSTAT=stat) i
  11419. IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD'
  11420. END PROGRAM
  11421. 
  11422. File: gfortran.info, Node: ISATTY, Next: ISHFT, Prev: IS_IOSTAT_EOR, Up: Intrinsic Procedures
  11423. 9.158 'ISATTY' -- Whether a unit is a terminal device.
  11424. ======================================================
  11425. _Description_:
  11426. Determine whether a unit is connected to a terminal device.
  11427. _Standard_:
  11428. GNU extension
  11429. _Class_:
  11430. Function
  11431. _Syntax_:
  11432. 'RESULT = ISATTY(UNIT)'
  11433. _Arguments_:
  11434. UNIT Shall be a scalar 'INTEGER'.
  11435. _Return value_:
  11436. Returns '.TRUE.' if the UNIT is connected to a terminal device,
  11437. '.FALSE.' otherwise.
  11438. _Example_:
  11439. PROGRAM test_isatty
  11440. INTEGER(kind=1) :: unit
  11441. DO unit = 1, 10
  11442. write(*,*) isatty(unit=unit)
  11443. END DO
  11444. END PROGRAM
  11445. _See also_:
  11446. *note TTYNAM::
  11447. 
  11448. File: gfortran.info, Node: ISHFT, Next: ISHFTC, Prev: ISATTY, Up: Intrinsic Procedures
  11449. 9.159 'ISHFT' -- Shift bits
  11450. ===========================
  11451. _Description_:
  11452. 'ISHFT' returns a value corresponding to I with all of the bits
  11453. shifted SHIFT places. A value of SHIFT greater than zero
  11454. corresponds to a left shift, a value of zero corresponds to no
  11455. shift, and a value less than zero corresponds to a right shift. If
  11456. the absolute value of SHIFT is greater than 'BIT_SIZE(I)', the
  11457. value is undefined. Bits shifted out from the left end or right
  11458. end are lost; zeros are shifted in from the opposite end.
  11459. _Standard_:
  11460. Fortran 90 and later, has overloads that are GNU extensions
  11461. _Class_:
  11462. Elemental function
  11463. _Syntax_:
  11464. 'RESULT = ISHFT(I, SHIFT)'
  11465. _Arguments_:
  11466. I The type shall be 'INTEGER'.
  11467. SHIFT The type shall be 'INTEGER'.
  11468. _Return value_:
  11469. The return value is of type 'INTEGER' and of the same kind as I.
  11470. _Specific names_:
  11471. Name Argument Return type Standard
  11472. 'ISHFT(A)' 'INTEGER A' 'INTEGER' Fortran 90 and
  11473. later
  11474. 'BSHFT(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  11475. A'
  11476. 'IISHFT(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  11477. A'
  11478. 'JISHFT(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  11479. A'
  11480. 'KISHFT(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  11481. A'
  11482. _See also_:
  11483. *note ISHFTC::
  11484. 
  11485. File: gfortran.info, Node: ISHFTC, Next: ISNAN, Prev: ISHFT, Up: Intrinsic Procedures
  11486. 9.160 'ISHFTC' -- Shift bits circularly
  11487. =======================================
  11488. _Description_:
  11489. 'ISHFTC' returns a value corresponding to I with the rightmost SIZE
  11490. bits shifted circularly SHIFT places; that is, bits shifted out one
  11491. end are shifted into the opposite end. A value of SHIFT greater
  11492. than zero corresponds to a left shift, a value of zero corresponds
  11493. to no shift, and a value less than zero corresponds to a right
  11494. shift. The absolute value of SHIFT must be less than SIZE. If the
  11495. SIZE argument is omitted, it is taken to be equivalent to
  11496. 'BIT_SIZE(I)'.
  11497. _Standard_:
  11498. Fortran 90 and later, has overloads that are GNU extensions
  11499. _Class_:
  11500. Elemental function
  11501. _Syntax_:
  11502. 'RESULT = ISHFTC(I, SHIFT [, SIZE])'
  11503. _Arguments_:
  11504. I The type shall be 'INTEGER'.
  11505. SHIFT The type shall be 'INTEGER'.
  11506. SIZE (Optional) The type shall be 'INTEGER'; the
  11507. value must be greater than zero and less than or
  11508. equal to 'BIT_SIZE(I)'.
  11509. _Return value_:
  11510. The return value is of type 'INTEGER' and of the same kind as I.
  11511. _Specific names_:
  11512. Name Argument Return type Standard
  11513. 'ISHFTC(A)' 'INTEGER A' 'INTEGER' Fortran 90 and
  11514. later
  11515. 'BSHFTC(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  11516. A'
  11517. 'IISHFTC(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  11518. A'
  11519. 'JISHFTC(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  11520. A'
  11521. 'KISHFTC(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  11522. A'
  11523. _See also_:
  11524. *note ISHFT::
  11525. 
  11526. File: gfortran.info, Node: ISNAN, Next: ITIME, Prev: ISHFTC, Up: Intrinsic Procedures
  11527. 9.161 'ISNAN' -- Test for a NaN
  11528. ===============================
  11529. _Description_:
  11530. 'ISNAN' tests whether a floating-point value is an IEEE
  11531. Not-a-Number (NaN).
  11532. _Standard_:
  11533. GNU extension
  11534. _Class_:
  11535. Elemental function
  11536. _Syntax_:
  11537. 'ISNAN(X)'
  11538. _Arguments_:
  11539. X Variable of the type 'REAL'.
  11540. _Return value_:
  11541. Returns a default-kind 'LOGICAL'. The returned value is 'TRUE' if
  11542. X is a NaN and 'FALSE' otherwise.
  11543. _Example_:
  11544. program test_nan
  11545. implicit none
  11546. real :: x
  11547. x = -1.0
  11548. x = sqrt(x)
  11549. if (isnan(x)) stop '"x" is a NaN'
  11550. end program test_nan
  11551. 
  11552. File: gfortran.info, Node: ITIME, Next: KILL, Prev: ISNAN, Up: Intrinsic Procedures
  11553. 9.162 'ITIME' -- Get current local time subroutine (hour/minutes/seconds)
  11554. =========================================================================
  11555. _Description_:
  11556. 'ITIME(VALUES)' Fills VALUES with the numerical values at the
  11557. current local time. The hour (in the range 1-24), minute (in the
  11558. range 1-60), and seconds (in the range 1-60) appear in elements 1,
  11559. 2, and 3 of VALUES, respectively.
  11560. This intrinsic routine is provided for backwards compatibility with
  11561. GNU Fortran 77. In new code, programmers should consider the use
  11562. of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
  11563. standard.
  11564. _Standard_:
  11565. GNU extension
  11566. _Class_:
  11567. Subroutine
  11568. _Syntax_:
  11569. 'CALL ITIME(VALUES)'
  11570. _Arguments_:
  11571. VALUES The type shall be 'INTEGER, DIMENSION(3)' and
  11572. the kind shall be the default integer kind.
  11573. _Return value_:
  11574. Does not return anything.
  11575. _Example_:
  11576. program test_itime
  11577. integer, dimension(3) :: tarray
  11578. call itime(tarray)
  11579. print *, tarray(1)
  11580. print *, tarray(2)
  11581. print *, tarray(3)
  11582. end program test_itime
  11583. _See also_:
  11584. *note DATE_AND_TIME::
  11585. 
  11586. File: gfortran.info, Node: KILL, Next: KIND, Prev: ITIME, Up: Intrinsic Procedures
  11587. 9.163 'KILL' -- Send a signal to a process
  11588. ==========================================
  11589. _Description_:
  11590. Sends the signal specified by SIG to the process PID. See
  11591. 'kill(2)'.
  11592. This intrinsic is provided in both subroutine and function forms;
  11593. however, only one form can be used in any given program unit.
  11594. _Standard_:
  11595. GNU extension
  11596. _Standard_:
  11597. GNU extension
  11598. _Class_:
  11599. Subroutine, function
  11600. _Syntax_:
  11601. 'CALL KILL(PID, SIG [, STATUS])'
  11602. 'STATUS = KILL(PID, SIG)'
  11603. _Arguments_:
  11604. PID Shall be a scalar 'INTEGER' with 'INTENT(IN)'.
  11605. SIG Shall be a scalar 'INTEGER' with 'INTENT(IN)'.
  11606. STATUS [Subroutine](Optional) Shall be a scalar
  11607. 'INTEGER'. Returns 0 on success; otherwise a
  11608. system-specific error code is returned.
  11609. STATUS [Function] The kind type parameter is that of
  11610. 'pid'. Returns 0 on success; otherwise a
  11611. system-specific error code is returned.
  11612. _See also_:
  11613. *note ABORT::, *note EXIT::
  11614. 
  11615. File: gfortran.info, Node: KIND, Next: LBOUND, Prev: KILL, Up: Intrinsic Procedures
  11616. 9.164 'KIND' -- Kind of an entity
  11617. =================================
  11618. _Description_:
  11619. 'KIND(X)' returns the kind value of the entity X.
  11620. _Standard_:
  11621. Fortran 95 and later
  11622. _Class_:
  11623. Inquiry function
  11624. _Syntax_:
  11625. 'K = KIND(X)'
  11626. _Arguments_:
  11627. X Shall be of type 'LOGICAL', 'INTEGER', 'REAL',
  11628. 'COMPLEX' or 'CHARACTER'. It may be scalar or
  11629. array valued.
  11630. _Return value_:
  11631. The return value is a scalar of type 'INTEGER' and of the default
  11632. integer kind.
  11633. _Example_:
  11634. program test_kind
  11635. integer,parameter :: kc = kind(' ')
  11636. integer,parameter :: kl = kind(.true.)
  11637. print *, "The default character kind is ", kc
  11638. print *, "The default logical kind is ", kl
  11639. end program test_kind
  11640. 
  11641. File: gfortran.info, Node: LBOUND, Next: LCOBOUND, Prev: KIND, Up: Intrinsic Procedures
  11642. 9.165 'LBOUND' -- Lower dimension bounds of an array
  11643. ====================================================
  11644. _Description_:
  11645. Returns the lower bounds of an array, or a single lower bound along
  11646. the DIM dimension.
  11647. _Standard_:
  11648. Fortran 90 and later, with KIND argument Fortran 2003 and later
  11649. _Class_:
  11650. Inquiry function
  11651. _Syntax_:
  11652. 'RESULT = LBOUND(ARRAY [, DIM [, KIND]])'
  11653. _Arguments_:
  11654. ARRAY Shall be an array, of any type.
  11655. DIM (Optional) Shall be a scalar 'INTEGER'.
  11656. KIND (Optional) An 'INTEGER' initialization
  11657. expression indicating the kind parameter of the
  11658. result.
  11659. _Return value_:
  11660. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  11661. absent, the return value is of default integer kind. If DIM is
  11662. absent, the result is an array of the lower bounds of ARRAY. If
  11663. DIM is present, the result is a scalar corresponding to the lower
  11664. bound of the array along that dimension. If ARRAY is an expression
  11665. rather than a whole array or array structure component, or if it
  11666. has a zero extent along the relevant dimension, the lower bound is
  11667. taken to be 1.
  11668. _See also_:
  11669. *note UBOUND::, *note LCOBOUND::
  11670. 
  11671. File: gfortran.info, Node: LCOBOUND, Next: LEADZ, Prev: LBOUND, Up: Intrinsic Procedures
  11672. 9.166 'LCOBOUND' -- Lower codimension bounds of an array
  11673. ========================================================
  11674. _Description_:
  11675. Returns the lower bounds of a coarray, or a single lower cobound
  11676. along the DIM codimension.
  11677. _Standard_:
  11678. Fortran 2008 and later
  11679. _Class_:
  11680. Inquiry function
  11681. _Syntax_:
  11682. 'RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])'
  11683. _Arguments_:
  11684. ARRAY Shall be an coarray, of any type.
  11685. DIM (Optional) Shall be a scalar 'INTEGER'.
  11686. KIND (Optional) An 'INTEGER' initialization
  11687. expression indicating the kind parameter of the
  11688. result.
  11689. _Return value_:
  11690. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  11691. absent, the return value is of default integer kind. If DIM is
  11692. absent, the result is an array of the lower cobounds of COARRAY.
  11693. If DIM is present, the result is a scalar corresponding to the
  11694. lower cobound of the array along that codimension.
  11695. _See also_:
  11696. *note UCOBOUND::, *note LBOUND::
  11697. 
  11698. File: gfortran.info, Node: LEADZ, Next: LEN, Prev: LCOBOUND, Up: Intrinsic Procedures
  11699. 9.167 'LEADZ' -- Number of leading zero bits of an integer
  11700. ==========================================================
  11701. _Description_:
  11702. 'LEADZ' returns the number of leading zero bits of an integer.
  11703. _Standard_:
  11704. Fortran 2008 and later
  11705. _Class_:
  11706. Elemental function
  11707. _Syntax_:
  11708. 'RESULT = LEADZ(I)'
  11709. _Arguments_:
  11710. I Shall be of type 'INTEGER'.
  11711. _Return value_:
  11712. The type of the return value is the default 'INTEGER'. If all the
  11713. bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
  11714. _Example_:
  11715. PROGRAM test_leadz
  11716. WRITE (*,*) BIT_SIZE(1) ! prints 32
  11717. WRITE (*,*) LEADZ(1) ! prints 31
  11718. END PROGRAM
  11719. _See also_:
  11720. *note BIT_SIZE::, *note TRAILZ::, *note POPCNT::, *note POPPAR::
  11721. 
  11722. File: gfortran.info, Node: LEN, Next: LEN_TRIM, Prev: LEADZ, Up: Intrinsic Procedures
  11723. 9.168 'LEN' -- Length of a character entity
  11724. ===========================================
  11725. _Description_:
  11726. Returns the length of a character string. If STRING is an array,
  11727. the length of an element of STRING is returned. Note that STRING
  11728. need not be defined when this intrinsic is invoked, since only the
  11729. length, not the content, of STRING is needed.
  11730. _Standard_:
  11731. Fortran 77 and later, with KIND argument Fortran 2003 and later
  11732. _Class_:
  11733. Inquiry function
  11734. _Syntax_:
  11735. 'L = LEN(STRING [, KIND])'
  11736. _Arguments_:
  11737. STRING Shall be a scalar or array of type 'CHARACTER',
  11738. with 'INTENT(IN)'
  11739. KIND (Optional) An 'INTEGER' initialization
  11740. expression indicating the kind parameter of the
  11741. result.
  11742. _Return value_:
  11743. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  11744. absent, the return value is of default integer kind.
  11745. _Specific names_:
  11746. Name Argument Return type Standard
  11747. 'LEN(STRING)' 'CHARACTER' 'INTEGER' Fortran 77 and
  11748. later
  11749. _See also_:
  11750. *note LEN_TRIM::, *note ADJUSTL::, *note ADJUSTR::
  11751. 
  11752. File: gfortran.info, Node: LEN_TRIM, Next: LGE, Prev: LEN, Up: Intrinsic Procedures
  11753. 9.169 'LEN_TRIM' -- Length of a character entity without trailing blank characters
  11754. ==================================================================================
  11755. _Description_:
  11756. Returns the length of a character string, ignoring any trailing
  11757. blanks.
  11758. _Standard_:
  11759. Fortran 90 and later, with KIND argument Fortran 2003 and later
  11760. _Class_:
  11761. Elemental function
  11762. _Syntax_:
  11763. 'RESULT = LEN_TRIM(STRING [, KIND])'
  11764. _Arguments_:
  11765. STRING Shall be a scalar of type 'CHARACTER', with
  11766. 'INTENT(IN)'
  11767. KIND (Optional) An 'INTEGER' initialization
  11768. expression indicating the kind parameter of the
  11769. result.
  11770. _Return value_:
  11771. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  11772. absent, the return value is of default integer kind.
  11773. _See also_:
  11774. *note LEN::, *note ADJUSTL::, *note ADJUSTR::
  11775. 
  11776. File: gfortran.info, Node: LGE, Next: LGT, Prev: LEN_TRIM, Up: Intrinsic Procedures
  11777. 9.170 'LGE' -- Lexical greater than or equal
  11778. ============================================
  11779. _Description_:
  11780. Determines whether one string is lexically greater than or equal to
  11781. another string, where the two strings are interpreted as containing
  11782. ASCII character codes. If the String A and String B are not the
  11783. same length, the shorter is compared as if spaces were appended to
  11784. it to form a value that has the same length as the longer.
  11785. In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
  11786. and 'LLT' differ from the corresponding intrinsic operators '.GE.',
  11787. '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
  11788. character ordering (which is not ASCII on some targets), whereas
  11789. the former always use the ASCII ordering.
  11790. _Standard_:
  11791. Fortran 77 and later
  11792. _Class_:
  11793. Elemental function
  11794. _Syntax_:
  11795. 'RESULT = LGE(STRING_A, STRING_B)'
  11796. _Arguments_:
  11797. STRING_A Shall be of default 'CHARACTER' type.
  11798. STRING_B Shall be of default 'CHARACTER' type.
  11799. _Return value_:
  11800. Returns '.TRUE.' if 'STRING_A >= STRING_B', and '.FALSE.'
  11801. otherwise, based on the ASCII ordering.
  11802. _Specific names_:
  11803. Name Argument Return type Standard
  11804. 'LGE(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and
  11805. STRING_B)' later
  11806. _See also_:
  11807. *note LGT::, *note LLE::, *note LLT::
  11808. 
  11809. File: gfortran.info, Node: LGT, Next: LINK, Prev: LGE, Up: Intrinsic Procedures
  11810. 9.171 'LGT' -- Lexical greater than
  11811. ===================================
  11812. _Description_:
  11813. Determines whether one string is lexically greater than another
  11814. string, where the two strings are interpreted as containing ASCII
  11815. character codes. If the String A and String B are not the same
  11816. length, the shorter is compared as if spaces were appended to it to
  11817. form a value that has the same length as the longer.
  11818. In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
  11819. and 'LLT' differ from the corresponding intrinsic operators '.GE.',
  11820. '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
  11821. character ordering (which is not ASCII on some targets), whereas
  11822. the former always use the ASCII ordering.
  11823. _Standard_:
  11824. Fortran 77 and later
  11825. _Class_:
  11826. Elemental function
  11827. _Syntax_:
  11828. 'RESULT = LGT(STRING_A, STRING_B)'
  11829. _Arguments_:
  11830. STRING_A Shall be of default 'CHARACTER' type.
  11831. STRING_B Shall be of default 'CHARACTER' type.
  11832. _Return value_:
  11833. Returns '.TRUE.' if 'STRING_A > STRING_B', and '.FALSE.' otherwise,
  11834. based on the ASCII ordering.
  11835. _Specific names_:
  11836. Name Argument Return type Standard
  11837. 'LGT(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and
  11838. STRING_B)' later
  11839. _See also_:
  11840. *note LGE::, *note LLE::, *note LLT::
  11841. 
  11842. File: gfortran.info, Node: LINK, Next: LLE, Prev: LGT, Up: Intrinsic Procedures
  11843. 9.172 'LINK' -- Create a hard link
  11844. ==================================
  11845. _Description_:
  11846. Makes a (hard) link from file PATH1 to PATH2. A null character
  11847. ('CHAR(0)') can be used to mark the end of the names in PATH1 and
  11848. PATH2; otherwise, trailing blanks in the file names are ignored.
  11849. If the STATUS argument is supplied, it contains 0 on success or a
  11850. nonzero error code upon return; see 'link(2)'.
  11851. This intrinsic is provided in both subroutine and function forms;
  11852. however, only one form can be used in any given program unit.
  11853. _Standard_:
  11854. GNU extension
  11855. _Class_:
  11856. Subroutine, function
  11857. _Syntax_:
  11858. 'CALL LINK(PATH1, PATH2 [, STATUS])'
  11859. 'STATUS = LINK(PATH1, PATH2)'
  11860. _Arguments_:
  11861. PATH1 Shall be of default 'CHARACTER' type.
  11862. PATH2 Shall be of default 'CHARACTER' type.
  11863. STATUS (Optional) Shall be of default 'INTEGER' type.
  11864. _See also_:
  11865. *note SYMLNK::, *note UNLINK::
  11866. 
  11867. File: gfortran.info, Node: LLE, Next: LLT, Prev: LINK, Up: Intrinsic Procedures
  11868. 9.173 'LLE' -- Lexical less than or equal
  11869. =========================================
  11870. _Description_:
  11871. Determines whether one string is lexically less than or equal to
  11872. another string, where the two strings are interpreted as containing
  11873. ASCII character codes. If the String A and String B are not the
  11874. same length, the shorter is compared as if spaces were appended to
  11875. it to form a value that has the same length as the longer.
  11876. In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
  11877. and 'LLT' differ from the corresponding intrinsic operators '.GE.',
  11878. '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
  11879. character ordering (which is not ASCII on some targets), whereas
  11880. the former always use the ASCII ordering.
  11881. _Standard_:
  11882. Fortran 77 and later
  11883. _Class_:
  11884. Elemental function
  11885. _Syntax_:
  11886. 'RESULT = LLE(STRING_A, STRING_B)'
  11887. _Arguments_:
  11888. STRING_A Shall be of default 'CHARACTER' type.
  11889. STRING_B Shall be of default 'CHARACTER' type.
  11890. _Return value_:
  11891. Returns '.TRUE.' if 'STRING_A <= STRING_B', and '.FALSE.'
  11892. otherwise, based on the ASCII ordering.
  11893. _Specific names_:
  11894. Name Argument Return type Standard
  11895. 'LLE(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and
  11896. STRING_B)' later
  11897. _See also_:
  11898. *note LGE::, *note LGT::, *note LLT::
  11899. 
  11900. File: gfortran.info, Node: LLT, Next: LNBLNK, Prev: LLE, Up: Intrinsic Procedures
  11901. 9.174 'LLT' -- Lexical less than
  11902. ================================
  11903. _Description_:
  11904. Determines whether one string is lexically less than another
  11905. string, where the two strings are interpreted as containing ASCII
  11906. character codes. If the String A and String B are not the same
  11907. length, the shorter is compared as if spaces were appended to it to
  11908. form a value that has the same length as the longer.
  11909. In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
  11910. and 'LLT' differ from the corresponding intrinsic operators '.GE.',
  11911. '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
  11912. character ordering (which is not ASCII on some targets), whereas
  11913. the former always use the ASCII ordering.
  11914. _Standard_:
  11915. Fortran 77 and later
  11916. _Class_:
  11917. Elemental function
  11918. _Syntax_:
  11919. 'RESULT = LLT(STRING_A, STRING_B)'
  11920. _Arguments_:
  11921. STRING_A Shall be of default 'CHARACTER' type.
  11922. STRING_B Shall be of default 'CHARACTER' type.
  11923. _Return value_:
  11924. Returns '.TRUE.' if 'STRING_A < STRING_B', and '.FALSE.' otherwise,
  11925. based on the ASCII ordering.
  11926. _Specific names_:
  11927. Name Argument Return type Standard
  11928. 'LLT(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and
  11929. STRING_B)' later
  11930. _See also_:
  11931. *note LGE::, *note LGT::, *note LLE::
  11932. 
  11933. File: gfortran.info, Node: LNBLNK, Next: LOC, Prev: LLT, Up: Intrinsic Procedures
  11934. 9.175 'LNBLNK' -- Index of the last non-blank character in a string
  11935. ===================================================================
  11936. _Description_:
  11937. Returns the length of a character string, ignoring any trailing
  11938. blanks. This is identical to the standard 'LEN_TRIM' intrinsic,
  11939. and is only included for backwards compatibility.
  11940. _Standard_:
  11941. GNU extension
  11942. _Class_:
  11943. Elemental function
  11944. _Syntax_:
  11945. 'RESULT = LNBLNK(STRING)'
  11946. _Arguments_:
  11947. STRING Shall be a scalar of type 'CHARACTER', with
  11948. 'INTENT(IN)'
  11949. _Return value_:
  11950. The return value is of 'INTEGER(kind=4)' type.
  11951. _See also_:
  11952. *note INDEX intrinsic::, *note LEN_TRIM::
  11953. 
  11954. File: gfortran.info, Node: LOC, Next: LOG, Prev: LNBLNK, Up: Intrinsic Procedures
  11955. 9.176 'LOC' -- Returns the address of a variable
  11956. ================================================
  11957. _Description_:
  11958. 'LOC(X)' returns the address of X as an integer.
  11959. _Standard_:
  11960. GNU extension
  11961. _Class_:
  11962. Inquiry function
  11963. _Syntax_:
  11964. 'RESULT = LOC(X)'
  11965. _Arguments_:
  11966. X Variable of any type.
  11967. _Return value_:
  11968. The return value is of type 'INTEGER', with a 'KIND' corresponding
  11969. to the size (in bytes) of a memory address on the target machine.
  11970. _Example_:
  11971. program test_loc
  11972. integer :: i
  11973. real :: r
  11974. i = loc(r)
  11975. print *, i
  11976. end program test_loc
  11977. 
  11978. File: gfortran.info, Node: LOG, Next: LOG10, Prev: LOC, Up: Intrinsic Procedures
  11979. 9.177 'LOG' -- Natural logarithm function
  11980. =========================================
  11981. _Description_:
  11982. 'LOG(X)' computes the natural logarithm of X, i.e. the logarithm
  11983. to the base e.
  11984. _Standard_:
  11985. Fortran 77 and later, has GNU extensions
  11986. _Class_:
  11987. Elemental function
  11988. _Syntax_:
  11989. 'RESULT = LOG(X)'
  11990. _Arguments_:
  11991. X The type shall be 'REAL' or 'COMPLEX'.
  11992. _Return value_:
  11993. The return value is of type 'REAL' or 'COMPLEX'. The kind type
  11994. parameter is the same as X. If X is 'COMPLEX', the imaginary part
  11995. \omega is in the range -\pi < \omega \leq \pi.
  11996. _Example_:
  11997. program test_log
  11998. real(8) :: x = 2.7182818284590451_8
  11999. complex :: z = (1.0, 2.0)
  12000. x = log(x) ! will yield (approximately) 1
  12001. z = log(z)
  12002. end program test_log
  12003. _Specific names_:
  12004. Name Argument Return type Standard
  12005. 'ALOG(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 or
  12006. later
  12007. 'DLOG(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 or
  12008. later
  12009. 'CLOG(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 or
  12010. X' later
  12011. 'ZLOG(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  12012. X'
  12013. 'CDLOG(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  12014. X'
  12015. 
  12016. File: gfortran.info, Node: LOG10, Next: LOG_GAMMA, Prev: LOG, Up: Intrinsic Procedures
  12017. 9.178 'LOG10' -- Base 10 logarithm function
  12018. ===========================================
  12019. _Description_:
  12020. 'LOG10(X)' computes the base 10 logarithm of X.
  12021. _Standard_:
  12022. Fortran 77 and later
  12023. _Class_:
  12024. Elemental function
  12025. _Syntax_:
  12026. 'RESULT = LOG10(X)'
  12027. _Arguments_:
  12028. X The type shall be 'REAL'.
  12029. _Return value_:
  12030. The return value is of type 'REAL' or 'COMPLEX'. The kind type
  12031. parameter is the same as X.
  12032. _Example_:
  12033. program test_log10
  12034. real(8) :: x = 10.0_8
  12035. x = log10(x)
  12036. end program test_log10
  12037. _Specific names_:
  12038. Name Argument Return type Standard
  12039. 'ALOG10(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  12040. later
  12041. 'DLOG10(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  12042. later
  12043. 
  12044. File: gfortran.info, Node: LOG_GAMMA, Next: LOGICAL, Prev: LOG10, Up: Intrinsic Procedures
  12045. 9.179 'LOG_GAMMA' -- Logarithm of the Gamma function
  12046. ====================================================
  12047. _Description_:
  12048. 'LOG_GAMMA(X)' computes the natural logarithm of the absolute value
  12049. of the Gamma (\Gamma) function.
  12050. _Standard_:
  12051. Fortran 2008 and later
  12052. _Class_:
  12053. Elemental function
  12054. _Syntax_:
  12055. 'X = LOG_GAMMA(X)'
  12056. _Arguments_:
  12057. X Shall be of type 'REAL' and neither zero nor a
  12058. negative integer.
  12059. _Return value_:
  12060. The return value is of type 'REAL' of the same kind as X.
  12061. _Example_:
  12062. program test_log_gamma
  12063. real :: x = 1.0
  12064. x = lgamma(x) ! returns 0.0
  12065. end program test_log_gamma
  12066. _Specific names_:
  12067. Name Argument Return type Standard
  12068. 'LGAMMA(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  12069. 'ALGAMA(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  12070. 'DLGAMA(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  12071. _See also_:
  12072. Gamma function: *note GAMMA::
  12073. 
  12074. File: gfortran.info, Node: LOGICAL, Next: LONG, Prev: LOG_GAMMA, Up: Intrinsic Procedures
  12075. 9.180 'LOGICAL' -- Convert to logical type
  12076. ==========================================
  12077. _Description_:
  12078. Converts one kind of 'LOGICAL' variable to another.
  12079. _Standard_:
  12080. Fortran 90 and later
  12081. _Class_:
  12082. Elemental function
  12083. _Syntax_:
  12084. 'RESULT = LOGICAL(L [, KIND])'
  12085. _Arguments_:
  12086. L The type shall be 'LOGICAL'.
  12087. KIND (Optional) An 'INTEGER' initialization
  12088. expression indicating the kind parameter of the
  12089. result.
  12090. _Return value_:
  12091. The return value is a 'LOGICAL' value equal to L, with a kind
  12092. corresponding to KIND, or of the default logical kind if KIND is
  12093. not given.
  12094. _See also_:
  12095. *note INT::, *note REAL::, *note CMPLX::
  12096. 
  12097. File: gfortran.info, Node: LONG, Next: LSHIFT, Prev: LOGICAL, Up: Intrinsic Procedures
  12098. 9.181 'LONG' -- Convert to integer type
  12099. =======================================
  12100. _Description_:
  12101. Convert to a 'KIND=4' integer type, which is the same size as a C
  12102. 'long' integer. This is equivalent to the standard 'INT' intrinsic
  12103. with an optional argument of 'KIND=4', and is only included for
  12104. backwards compatibility.
  12105. _Standard_:
  12106. GNU extension
  12107. _Class_:
  12108. Elemental function
  12109. _Syntax_:
  12110. 'RESULT = LONG(A)'
  12111. _Arguments_:
  12112. A Shall be of type 'INTEGER', 'REAL', or
  12113. 'COMPLEX'.
  12114. _Return value_:
  12115. The return value is a 'INTEGER(4)' variable.
  12116. _See also_:
  12117. *note INT::, *note INT2::, *note INT8::
  12118. 
  12119. File: gfortran.info, Node: LSHIFT, Next: LSTAT, Prev: LONG, Up: Intrinsic Procedures
  12120. 9.182 'LSHIFT' -- Left shift bits
  12121. =================================
  12122. _Description_:
  12123. 'LSHIFT' returns a value corresponding to I with all of the bits
  12124. shifted left by SHIFT places. SHIFT shall be nonnegative and less
  12125. than or equal to 'BIT_SIZE(I)', otherwise the result value is
  12126. undefined. Bits shifted out from the left end are lost; zeros are
  12127. shifted in from the opposite end.
  12128. This function has been superseded by the 'ISHFT' intrinsic, which
  12129. is standard in Fortran 95 and later, and the 'SHIFTL' intrinsic,
  12130. which is standard in Fortran 2008 and later.
  12131. _Standard_:
  12132. GNU extension
  12133. _Class_:
  12134. Elemental function
  12135. _Syntax_:
  12136. 'RESULT = LSHIFT(I, SHIFT)'
  12137. _Arguments_:
  12138. I The type shall be 'INTEGER'.
  12139. SHIFT The type shall be 'INTEGER'.
  12140. _Return value_:
  12141. The return value is of type 'INTEGER' and of the same kind as I.
  12142. _See also_:
  12143. *note ISHFT::, *note ISHFTC::, *note RSHIFT::, *note SHIFTA::,
  12144. *note SHIFTL::, *note SHIFTR::
  12145. 
  12146. File: gfortran.info, Node: LSTAT, Next: LTIME, Prev: LSHIFT, Up: Intrinsic Procedures
  12147. 9.183 'LSTAT' -- Get file status
  12148. ================================
  12149. _Description_:
  12150. 'LSTAT' is identical to *note STAT::, except that if path is a
  12151. symbolic link, then the link itself is statted, not the file that
  12152. it refers to.
  12153. The elements in 'VALUES' are the same as described by *note STAT::.
  12154. This intrinsic is provided in both subroutine and function forms;
  12155. however, only one form can be used in any given program unit.
  12156. _Standard_:
  12157. GNU extension
  12158. _Class_:
  12159. Subroutine, function
  12160. _Syntax_:
  12161. 'CALL LSTAT(NAME, VALUES [, STATUS])'
  12162. 'STATUS = LSTAT(NAME, VALUES)'
  12163. _Arguments_:
  12164. NAME The type shall be 'CHARACTER' of the default
  12165. kind, a valid path within the file system.
  12166. VALUES The type shall be 'INTEGER(4), DIMENSION(13)'.
  12167. STATUS (Optional) status flag of type 'INTEGER(4)'.
  12168. Returns 0 on success and a system specific error
  12169. code otherwise.
  12170. _Example_:
  12171. See *note STAT:: for an example.
  12172. _See also_:
  12173. To stat an open file: *note FSTAT:: To stat a file: *note STAT::
  12174. 
  12175. File: gfortran.info, Node: LTIME, Next: MALLOC, Prev: LSTAT, Up: Intrinsic Procedures
  12176. 9.184 'LTIME' -- Convert time to local time info
  12177. ================================================
  12178. _Description_:
  12179. Given a system time value TIME (as provided by the *note TIME::
  12180. intrinsic), fills VALUES with values extracted from it appropriate
  12181. to the local time zone using 'localtime(3)'.
  12182. This intrinsic routine is provided for backwards compatibility with
  12183. GNU Fortran 77. In new code, programmers should consider the use
  12184. of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
  12185. standard.
  12186. _Standard_:
  12187. GNU extension
  12188. _Class_:
  12189. Subroutine
  12190. _Syntax_:
  12191. 'CALL LTIME(TIME, VALUES)'
  12192. _Arguments_:
  12193. TIME An 'INTEGER' scalar expression corresponding to
  12194. a system time, with 'INTENT(IN)'.
  12195. VALUES A default 'INTEGER' array with 9 elements, with
  12196. 'INTENT(OUT)'.
  12197. _Return value_:
  12198. The elements of VALUES are assigned as follows:
  12199. 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
  12200. seconds
  12201. 2. Minutes after the hour, range 0-59
  12202. 3. Hours past midnight, range 0-23
  12203. 4. Day of month, range 1-31
  12204. 5. Number of months since January, range 0-11
  12205. 6. Years since 1900
  12206. 7. Number of days since Sunday, range 0-6
  12207. 8. Days since January 1, range 0-365
  12208. 9. Daylight savings indicator: positive if daylight savings is in
  12209. effect, zero if not, and negative if the information is not
  12210. available.
  12211. _See also_:
  12212. *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note TIME::,
  12213. *note TIME8::
  12214. 
  12215. File: gfortran.info, Node: MALLOC, Next: MASKL, Prev: LTIME, Up: Intrinsic Procedures
  12216. 9.185 'MALLOC' -- Allocate dynamic memory
  12217. =========================================
  12218. _Description_:
  12219. 'MALLOC(SIZE)' allocates SIZE bytes of dynamic memory and returns
  12220. the address of the allocated memory. The 'MALLOC' intrinsic is an
  12221. extension intended to be used with Cray pointers, and is provided
  12222. in GNU Fortran to allow the user to compile legacy code. For new
  12223. code using Fortran 95 pointers, the memory allocation intrinsic is
  12224. 'ALLOCATE'.
  12225. _Standard_:
  12226. GNU extension
  12227. _Class_:
  12228. Function
  12229. _Syntax_:
  12230. 'PTR = MALLOC(SIZE)'
  12231. _Arguments_:
  12232. SIZE The type shall be 'INTEGER'.
  12233. _Return value_:
  12234. The return value is of type 'INTEGER(K)', with K such that
  12235. variables of type 'INTEGER(K)' have the same size as C pointers
  12236. ('sizeof(void *)').
  12237. _Example_:
  12238. The following example demonstrates the use of 'MALLOC' and 'FREE'
  12239. with Cray pointers.
  12240. program test_malloc
  12241. implicit none
  12242. integer i
  12243. real*8 x(*), z
  12244. pointer(ptr_x,x)
  12245. ptr_x = malloc(20*8)
  12246. do i = 1, 20
  12247. x(i) = sqrt(1.0d0 / i)
  12248. end do
  12249. z = 0
  12250. do i = 1, 20
  12251. z = z + x(i)
  12252. print *, z
  12253. end do
  12254. call free(ptr_x)
  12255. end program test_malloc
  12256. _See also_:
  12257. *note FREE::
  12258. 
  12259. File: gfortran.info, Node: MASKL, Next: MASKR, Prev: MALLOC, Up: Intrinsic Procedures
  12260. 9.186 'MASKL' -- Left justified mask
  12261. ====================================
  12262. _Description_:
  12263. 'MASKL(I[, KIND])' has its leftmost I bits set to 1, and the
  12264. remaining bits set to 0.
  12265. _Standard_:
  12266. Fortran 2008 and later
  12267. _Class_:
  12268. Elemental function
  12269. _Syntax_:
  12270. 'RESULT = MASKL(I[, KIND])'
  12271. _Arguments_:
  12272. I Shall be of type 'INTEGER'.
  12273. KIND Shall be a scalar constant expression of type
  12274. 'INTEGER'.
  12275. _Return value_:
  12276. The return value is of type 'INTEGER'. If KIND is present, it
  12277. specifies the kind value of the return type; otherwise, it is of
  12278. the default integer kind.
  12279. _See also_:
  12280. *note MASKR::
  12281. 
  12282. File: gfortran.info, Node: MASKR, Next: MATMUL, Prev: MASKL, Up: Intrinsic Procedures
  12283. 9.187 'MASKR' -- Right justified mask
  12284. =====================================
  12285. _Description_:
  12286. 'MASKL(I[, KIND])' has its rightmost I bits set to 1, and the
  12287. remaining bits set to 0.
  12288. _Standard_:
  12289. Fortran 2008 and later
  12290. _Class_:
  12291. Elemental function
  12292. _Syntax_:
  12293. 'RESULT = MASKR(I[, KIND])'
  12294. _Arguments_:
  12295. I Shall be of type 'INTEGER'.
  12296. KIND Shall be a scalar constant expression of type
  12297. 'INTEGER'.
  12298. _Return value_:
  12299. The return value is of type 'INTEGER'. If KIND is present, it
  12300. specifies the kind value of the return type; otherwise, it is of
  12301. the default integer kind.
  12302. _See also_:
  12303. *note MASKL::
  12304. 
  12305. File: gfortran.info, Node: MATMUL, Next: MAX, Prev: MASKR, Up: Intrinsic Procedures
  12306. 9.188 'MATMUL' -- matrix multiplication
  12307. =======================================
  12308. _Description_:
  12309. Performs a matrix multiplication on numeric or logical arguments.
  12310. _Standard_:
  12311. Fortran 90 and later
  12312. _Class_:
  12313. Transformational function
  12314. _Syntax_:
  12315. 'RESULT = MATMUL(MATRIX_A, MATRIX_B)'
  12316. _Arguments_:
  12317. MATRIX_A An array of 'INTEGER', 'REAL', 'COMPLEX', or
  12318. 'LOGICAL' type, with a rank of one or two.
  12319. MATRIX_B An array of 'INTEGER', 'REAL', or 'COMPLEX' type
  12320. if MATRIX_A is of a numeric type; otherwise, an
  12321. array of 'LOGICAL' type. The rank shall be one
  12322. or two, and the first (or only) dimension of
  12323. MATRIX_B shall be equal to the last (or only)
  12324. dimension of MATRIX_A. MATRIX_A and MATRIX_B
  12325. shall not both be rank one arrays.
  12326. _Return value_:
  12327. The matrix product of MATRIX_A and MATRIX_B. The type and kind of
  12328. the result follow the usual type and kind promotion rules, as for
  12329. the '*' or '.AND.' operators.
  12330. 
  12331. File: gfortran.info, Node: MAX, Next: MAXEXPONENT, Prev: MATMUL, Up: Intrinsic Procedures
  12332. 9.189 'MAX' -- Maximum value of an argument list
  12333. ================================================
  12334. _Description_:
  12335. Returns the argument with the largest (most positive) value.
  12336. _Standard_:
  12337. Fortran 77 and later
  12338. _Class_:
  12339. Elemental function
  12340. _Syntax_:
  12341. 'RESULT = MAX(A1, A2 [, A3 [, ...]])'
  12342. _Arguments_:
  12343. A1 The type shall be 'INTEGER' or 'REAL'.
  12344. A2, A3, An expression of the same type and kind as A1.
  12345. ... (As a GNU extension, arguments of different
  12346. kinds are permitted.)
  12347. _Return value_:
  12348. The return value corresponds to the maximum value among the
  12349. arguments, and has the same type and kind as the first argument.
  12350. _Specific names_:
  12351. Name Argument Return type Standard
  12352. 'MAX0(A1)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and
  12353. A1' later
  12354. 'AMAX0(A1)' 'INTEGER(4) 'REAL(MAX(X))' Fortran 77 and
  12355. A1' later
  12356. 'MAX1(A1)' 'REAL A1' 'INT(MAX(X))' Fortran 77 and
  12357. later
  12358. 'AMAX1(A1)' 'REAL(4) A1' 'REAL(4)' Fortran 77 and
  12359. later
  12360. 'DMAX1(A1)' 'REAL(8) A1' 'REAL(8)' Fortran 77 and
  12361. later
  12362. _See also_:
  12363. *note MAXLOC:: *note MAXVAL::, *note MIN::
  12364. 
  12365. File: gfortran.info, Node: MAXEXPONENT, Next: MAXLOC, Prev: MAX, Up: Intrinsic Procedures
  12366. 9.190 'MAXEXPONENT' -- Maximum exponent of a real kind
  12367. ======================================================
  12368. _Description_:
  12369. 'MAXEXPONENT(X)' returns the maximum exponent in the model of the
  12370. type of 'X'.
  12371. _Standard_:
  12372. Fortran 90 and later
  12373. _Class_:
  12374. Inquiry function
  12375. _Syntax_:
  12376. 'RESULT = MAXEXPONENT(X)'
  12377. _Arguments_:
  12378. X Shall be of type 'REAL'.
  12379. _Return value_:
  12380. The return value is of type 'INTEGER' and of the default integer
  12381. kind.
  12382. _Example_:
  12383. program exponents
  12384. real(kind=4) :: x
  12385. real(kind=8) :: y
  12386. print *, minexponent(x), maxexponent(x)
  12387. print *, minexponent(y), maxexponent(y)
  12388. end program exponents
  12389. 
  12390. File: gfortran.info, Node: MAXLOC, Next: MAXVAL, Prev: MAXEXPONENT, Up: Intrinsic Procedures
  12391. 9.191 'MAXLOC' -- Location of the maximum value within an array
  12392. ===============================================================
  12393. _Description_:
  12394. Determines the location of the element in the array with the
  12395. maximum value, or, if the DIM argument is supplied, determines the
  12396. locations of the maximum element along each row of the array in the
  12397. DIM direction. If MASK is present, only the elements for which
  12398. MASK is '.TRUE.' are considered. If more than one element in the
  12399. array has the maximum value, the location returned is that of the
  12400. first such element in array element order if the BACK is not
  12401. present, or is false; if BACK is true, the location returned is
  12402. that of the last such element. If the array has zero size, or all
  12403. of the elements of MASK are '.FALSE.', then the result is an array
  12404. of zeroes. Similarly, if DIM is supplied and all of the elements
  12405. of MASK along a given row are zero, the result value for that row
  12406. is zero.
  12407. _Standard_:
  12408. Fortran 95 and later; ARRAY of 'CHARACTER' and the KIND argument
  12409. are available in Fortran 2003 and later. The BACK argument is
  12410. available in Fortran 2008 and later.
  12411. _Class_:
  12412. Transformational function
  12413. _Syntax_:
  12414. 'RESULT = MAXLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])'
  12415. 'RESULT = MAXLOC(ARRAY [, MASK] [,KIND] [,BACK])'
  12416. _Arguments_:
  12417. ARRAY Shall be an array of type 'INTEGER' or 'REAL'.
  12418. DIM (Optional) Shall be a scalar of type 'INTEGER',
  12419. with a value between one and the rank of ARRAY,
  12420. inclusive. It may not be an optional dummy
  12421. argument.
  12422. MASK Shall be an array of type 'LOGICAL', and
  12423. conformable with ARRAY.
  12424. KIND (Optional) An 'INTEGER' initialization
  12425. expression indicating the kind parameter of the
  12426. result.
  12427. BACK (Optional) A scalar of type 'LOGICAL'.
  12428. _Return value_:
  12429. If DIM is absent, the result is a rank-one array with a length
  12430. equal to the rank of ARRAY. If DIM is present, the result is an
  12431. array with a rank one less than the rank of ARRAY, and a size
  12432. corresponding to the size of ARRAY with the DIM dimension removed.
  12433. If DIM is present and ARRAY has a rank of one, the result is a
  12434. scalar. If the optional argument KIND is present, the result is an
  12435. integer of kind KIND, otherwise it is of default kind.
  12436. _See also_:
  12437. *note FINDLOC::, *note MAX::, *note MAXVAL::
  12438. 
  12439. File: gfortran.info, Node: MAXVAL, Next: MCLOCK, Prev: MAXLOC, Up: Intrinsic Procedures
  12440. 9.192 'MAXVAL' -- Maximum value of an array
  12441. ===========================================
  12442. _Description_:
  12443. Determines the maximum value of the elements in an array value, or,
  12444. if the DIM argument is supplied, determines the maximum value along
  12445. each row of the array in the DIM direction. If MASK is present,
  12446. only the elements for which MASK is '.TRUE.' are considered. If
  12447. the array has zero size, or all of the elements of MASK are
  12448. '.FALSE.', then the result is '-HUGE(ARRAY)' if ARRAY is numeric,
  12449. or a string of nulls if ARRAY is of character type.
  12450. _Standard_:
  12451. Fortran 90 and later
  12452. _Class_:
  12453. Transformational function
  12454. _Syntax_:
  12455. 'RESULT = MAXVAL(ARRAY, DIM [, MASK])'
  12456. 'RESULT = MAXVAL(ARRAY [, MASK])'
  12457. _Arguments_:
  12458. ARRAY Shall be an array of type 'INTEGER' or 'REAL'.
  12459. DIM (Optional) Shall be a scalar of type 'INTEGER',
  12460. with a value between one and the rank of ARRAY,
  12461. inclusive. It may not be an optional dummy
  12462. argument.
  12463. MASK (Opional) Shall be an array of type 'LOGICAL',
  12464. and conformable with ARRAY.
  12465. _Return value_:
  12466. If DIM is absent, or if ARRAY has a rank of one, the result is a
  12467. scalar. If DIM is present, the result is an array with a rank one
  12468. less than the rank of ARRAY, and a size corresponding to the size
  12469. of ARRAY with the DIM dimension removed. In all cases, the result
  12470. is of the same type and kind as ARRAY.
  12471. _See also_:
  12472. *note MAX::, *note MAXLOC::
  12473. 
  12474. File: gfortran.info, Node: MCLOCK, Next: MCLOCK8, Prev: MAXVAL, Up: Intrinsic Procedures
  12475. 9.193 'MCLOCK' -- Time function
  12476. ===============================
  12477. _Description_:
  12478. Returns the number of clock ticks since the start of the process,
  12479. based on the function 'clock(3)' in the C standard library.
  12480. This intrinsic is not fully portable, such as to systems with
  12481. 32-bit 'INTEGER' types but supporting times wider than 32 bits.
  12482. Therefore, the values returned by this intrinsic might be, or
  12483. become, negative, or numerically less than previous values, during
  12484. a single run of the compiled program.
  12485. _Standard_:
  12486. GNU extension
  12487. _Class_:
  12488. Function
  12489. _Syntax_:
  12490. 'RESULT = MCLOCK()'
  12491. _Return value_:
  12492. The return value is a scalar of type 'INTEGER(4)', equal to the
  12493. number of clock ticks since the start of the process, or '-1' if
  12494. the system does not support 'clock(3)'.
  12495. _See also_:
  12496. *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
  12497. TIME::
  12498. 
  12499. File: gfortran.info, Node: MCLOCK8, Next: MERGE, Prev: MCLOCK, Up: Intrinsic Procedures
  12500. 9.194 'MCLOCK8' -- Time function (64-bit)
  12501. =========================================
  12502. _Description_:
  12503. Returns the number of clock ticks since the start of the process,
  12504. based on the function 'clock(3)' in the C standard library.
  12505. _Warning:_ this intrinsic does not increase the range of the timing
  12506. values over that returned by 'clock(3)'. On a system with a 32-bit
  12507. 'clock(3)', 'MCLOCK8' will return a 32-bit value, even though it is
  12508. converted to a 64-bit 'INTEGER(8)' value. That means overflows of
  12509. the 32-bit value can still occur. Therefore, the values returned
  12510. by this intrinsic might be or become negative or numerically less
  12511. than previous values during a single run of the compiled program.
  12512. _Standard_:
  12513. GNU extension
  12514. _Class_:
  12515. Function
  12516. _Syntax_:
  12517. 'RESULT = MCLOCK8()'
  12518. _Return value_:
  12519. The return value is a scalar of type 'INTEGER(8)', equal to the
  12520. number of clock ticks since the start of the process, or '-1' if
  12521. the system does not support 'clock(3)'.
  12522. _See also_:
  12523. *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
  12524. TIME8::
  12525. 
  12526. File: gfortran.info, Node: MERGE, Next: MERGE_BITS, Prev: MCLOCK8, Up: Intrinsic Procedures
  12527. 9.195 'MERGE' -- Merge variables
  12528. ================================
  12529. _Description_:
  12530. Select values from two arrays according to a logical mask. The
  12531. result is equal to TSOURCE if MASK is '.TRUE.', or equal to FSOURCE
  12532. if it is '.FALSE.'.
  12533. _Standard_:
  12534. Fortran 90 and later
  12535. _Class_:
  12536. Elemental function
  12537. _Syntax_:
  12538. 'RESULT = MERGE(TSOURCE, FSOURCE, MASK)'
  12539. _Arguments_:
  12540. TSOURCE May be of any type.
  12541. FSOURCE Shall be of the same type and type parameters as
  12542. TSOURCE.
  12543. MASK Shall be of type 'LOGICAL'.
  12544. _Return value_:
  12545. The result is of the same type and type parameters as TSOURCE.
  12546. 
  12547. File: gfortran.info, Node: MERGE_BITS, Next: MIN, Prev: MERGE, Up: Intrinsic Procedures
  12548. 9.196 'MERGE_BITS' -- Merge of bits under mask
  12549. ==============================================
  12550. _Description_:
  12551. 'MERGE_BITS(I, J, MASK)' merges the bits of I and J as determined
  12552. by the mask. The i-th bit of the result is equal to the i-th bit
  12553. of I if the i-th bit of MASK is 1; it is equal to the i-th bit of J
  12554. otherwise.
  12555. _Standard_:
  12556. Fortran 2008 and later
  12557. _Class_:
  12558. Elemental function
  12559. _Syntax_:
  12560. 'RESULT = MERGE_BITS(I, J, MASK)'
  12561. _Arguments_:
  12562. I Shall be of type 'INTEGER' or a
  12563. boz-literal-constant.
  12564. J Shall be of type 'INTEGER' with the same kind
  12565. type parameter as I or a boz-literal-constant.
  12566. I and J shall not both be boz-literal-constants.
  12567. MASK Shall be of type 'INTEGER' or a
  12568. boz-literal-constant and of the same kind as I.
  12569. _Return value_:
  12570. The result is of the same type and kind as I.
  12571. 
  12572. File: gfortran.info, Node: MIN, Next: MINEXPONENT, Prev: MERGE_BITS, Up: Intrinsic Procedures
  12573. 9.197 'MIN' -- Minimum value of an argument list
  12574. ================================================
  12575. _Description_:
  12576. Returns the argument with the smallest (most negative) value.
  12577. _Standard_:
  12578. Fortran 77 and later
  12579. _Class_:
  12580. Elemental function
  12581. _Syntax_:
  12582. 'RESULT = MIN(A1, A2 [, A3, ...])'
  12583. _Arguments_:
  12584. A1 The type shall be 'INTEGER' or 'REAL'.
  12585. A2, A3, An expression of the same type and kind as A1.
  12586. ... (As a GNU extension, arguments of different
  12587. kinds are permitted.)
  12588. _Return value_:
  12589. The return value corresponds to the maximum value among the
  12590. arguments, and has the same type and kind as the first argument.
  12591. _Specific names_:
  12592. Name Argument Return type Standard
  12593. 'MIN0(A1)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and
  12594. A1' later
  12595. 'AMIN0(A1)' 'INTEGER(4) 'REAL(4)' Fortran 77 and
  12596. A1' later
  12597. 'MIN1(A1)' 'REAL A1' 'INTEGER(4)' Fortran 77 and
  12598. later
  12599. 'AMIN1(A1)' 'REAL(4) A1' 'REAL(4)' Fortran 77 and
  12600. later
  12601. 'DMIN1(A1)' 'REAL(8) A1' 'REAL(8)' Fortran 77 and
  12602. later
  12603. _See also_:
  12604. *note MAX::, *note MINLOC::, *note MINVAL::
  12605. 
  12606. File: gfortran.info, Node: MINEXPONENT, Next: MINLOC, Prev: MIN, Up: Intrinsic Procedures
  12607. 9.198 'MINEXPONENT' -- Minimum exponent of a real kind
  12608. ======================================================
  12609. _Description_:
  12610. 'MINEXPONENT(X)' returns the minimum exponent in the model of the
  12611. type of 'X'.
  12612. _Standard_:
  12613. Fortran 90 and later
  12614. _Class_:
  12615. Inquiry function
  12616. _Syntax_:
  12617. 'RESULT = MINEXPONENT(X)'
  12618. _Arguments_:
  12619. X Shall be of type 'REAL'.
  12620. _Return value_:
  12621. The return value is of type 'INTEGER' and of the default integer
  12622. kind.
  12623. _Example_:
  12624. See 'MAXEXPONENT' for an example.
  12625. 
  12626. File: gfortran.info, Node: MINLOC, Next: MINVAL, Prev: MINEXPONENT, Up: Intrinsic Procedures
  12627. 9.199 'MINLOC' -- Location of the minimum value within an array
  12628. ===============================================================
  12629. _Description_:
  12630. Determines the location of the element in the array with the
  12631. minimum value, or, if the DIM argument is supplied, determines the
  12632. locations of the minimum element along each row of the array in the
  12633. DIM direction. If MASK is present, only the elements for which
  12634. MASK is '.TRUE.' are considered. If more than one element in the
  12635. array has the minimum value, the location returned is that of the
  12636. first such element in array element order if the BACK is not
  12637. present, or is false; if BACK is true, the location returned is
  12638. that of the last such element. If the array has zero size, or all
  12639. of the elements of MASK are '.FALSE.', then the result is an array
  12640. of zeroes. Similarly, if DIM is supplied and all of the elements
  12641. of MASK along a given row are zero, the result value for that row
  12642. is zero.
  12643. _Standard_:
  12644. Fortran 90 and later; ARRAY of 'CHARACTER' and the KIND argument
  12645. are available in Fortran 2003 and later. The BACK argument is
  12646. available in Fortran 2008 and later.
  12647. _Class_:
  12648. Transformational function
  12649. _Syntax_:
  12650. 'RESULT = MINLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])'
  12651. 'RESULT = MINLOC(ARRAY [, MASK], [,KIND] [,BACK])'
  12652. _Arguments_:
  12653. ARRAY Shall be an array of type 'INTEGER', 'REAL' or
  12654. 'CHARACTER'.
  12655. DIM (Optional) Shall be a scalar of type 'INTEGER',
  12656. with a value between one and the rank of ARRAY,
  12657. inclusive. It may not be an optional dummy
  12658. argument.
  12659. MASK Shall be an array of type 'LOGICAL', and
  12660. conformable with ARRAY.
  12661. KIND (Optional) An 'INTEGER' initialization
  12662. expression indicating the kind parameter of the
  12663. result.
  12664. BACK (Optional) A scalar of type 'LOGICAL'.
  12665. _Return value_:
  12666. If DIM is absent, the result is a rank-one array with a length
  12667. equal to the rank of ARRAY. If DIM is present, the result is an
  12668. array with a rank one less than the rank of ARRAY, and a size
  12669. corresponding to the size of ARRAY with the DIM dimension removed.
  12670. If DIM is present and ARRAY has a rank of one, the result is a
  12671. scalar. If the optional argument KIND is present, the result is an
  12672. integer of kind KIND, otherwise it is of default kind.
  12673. _See also_:
  12674. *note FINDLOC::, *note MIN::, *note MINVAL::
  12675. 
  12676. File: gfortran.info, Node: MINVAL, Next: MOD, Prev: MINLOC, Up: Intrinsic Procedures
  12677. 9.200 'MINVAL' -- Minimum value of an array
  12678. ===========================================
  12679. _Description_:
  12680. Determines the minimum value of the elements in an array value, or,
  12681. if the DIM argument is supplied, determines the minimum value along
  12682. each row of the array in the DIM direction. If MASK is present,
  12683. only the elements for which MASK is '.TRUE.' are considered. If
  12684. the array has zero size, or all of the elements of MASK are
  12685. '.FALSE.', then the result is 'HUGE(ARRAY)' if ARRAY is numeric, or
  12686. a string of 'CHAR(255)' characters if ARRAY is of character type.
  12687. _Standard_:
  12688. Fortran 90 and later
  12689. _Class_:
  12690. Transformational function
  12691. _Syntax_:
  12692. 'RESULT = MINVAL(ARRAY, DIM [, MASK])'
  12693. 'RESULT = MINVAL(ARRAY [, MASK])'
  12694. _Arguments_:
  12695. ARRAY Shall be an array of type 'INTEGER' or 'REAL'.
  12696. DIM (Optional) Shall be a scalar of type 'INTEGER',
  12697. with a value between one and the rank of ARRAY,
  12698. inclusive. It may not be an optional dummy
  12699. argument.
  12700. MASK Shall be an array of type 'LOGICAL', and
  12701. conformable with ARRAY.
  12702. _Return value_:
  12703. If DIM is absent, or if ARRAY has a rank of one, the result is a
  12704. scalar. If DIM is present, the result is an array with a rank one
  12705. less than the rank of ARRAY, and a size corresponding to the size
  12706. of ARRAY with the DIM dimension removed. In all cases, the result
  12707. is of the same type and kind as ARRAY.
  12708. _See also_:
  12709. *note MIN::, *note MINLOC::
  12710. 
  12711. File: gfortran.info, Node: MOD, Next: MODULO, Prev: MINVAL, Up: Intrinsic Procedures
  12712. 9.201 'MOD' -- Remainder function
  12713. =================================
  12714. _Description_:
  12715. 'MOD(A,P)' computes the remainder of the division of A by P.
  12716. _Standard_:
  12717. Fortran 77 and later, has overloads that are GNU extensions
  12718. _Class_:
  12719. Elemental function
  12720. _Syntax_:
  12721. 'RESULT = MOD(A, P)'
  12722. _Arguments_:
  12723. A Shall be a scalar of type 'INTEGER' or 'REAL'.
  12724. P Shall be a scalar of the same type and kind as A
  12725. and not equal to zero. (As a GNU extension,
  12726. arguments of different kinds are permitted.)
  12727. _Return value_:
  12728. The return value is the result of 'A - (INT(A/P) * P)'. The type
  12729. and kind of the return value is the same as that of the arguments.
  12730. The returned value has the same sign as A and a magnitude less than
  12731. the magnitude of P. (As a GNU extension, kind is the largest kind
  12732. of the actual arguments.)
  12733. _Example_:
  12734. program test_mod
  12735. print *, mod(17,3)
  12736. print *, mod(17.5,5.5)
  12737. print *, mod(17.5d0,5.5)
  12738. print *, mod(17.5,5.5d0)
  12739. print *, mod(-17,3)
  12740. print *, mod(-17.5,5.5)
  12741. print *, mod(-17.5d0,5.5)
  12742. print *, mod(-17.5,5.5d0)
  12743. print *, mod(17,-3)
  12744. print *, mod(17.5,-5.5)
  12745. print *, mod(17.5d0,-5.5)
  12746. print *, mod(17.5,-5.5d0)
  12747. end program test_mod
  12748. _Specific names_:
  12749. Name Arguments Return type Standard
  12750. 'MOD(A,P)' 'INTEGER 'INTEGER' Fortran 77 and
  12751. A,P' later
  12752. 'AMOD(A,P)' 'REAL(4) 'REAL(4)' Fortran 77 and
  12753. A,P' later
  12754. 'DMOD(A,P)' 'REAL(8) 'REAL(8)' Fortran 77 and
  12755. A,P' later
  12756. 'BMOD(A,P)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  12757. A,P'
  12758. 'IMOD(A,P)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  12759. A,P'
  12760. 'JMOD(A,P)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  12761. A,P'
  12762. 'KMOD(A,P)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  12763. A,P'
  12764. _See also_:
  12765. *note MODULO::
  12766. 
  12767. File: gfortran.info, Node: MODULO, Next: MOVE_ALLOC, Prev: MOD, Up: Intrinsic Procedures
  12768. 9.202 'MODULO' -- Modulo function
  12769. =================================
  12770. _Description_:
  12771. 'MODULO(A,P)' computes the A modulo P.
  12772. _Standard_:
  12773. Fortran 95 and later
  12774. _Class_:
  12775. Elemental function
  12776. _Syntax_:
  12777. 'RESULT = MODULO(A, P)'
  12778. _Arguments_:
  12779. A Shall be a scalar of type 'INTEGER' or 'REAL'.
  12780. P Shall be a scalar of the same type and kind as
  12781. A. It shall not be zero. (As a GNU extension,
  12782. arguments of different kinds are permitted.)
  12783. _Return value_:
  12784. The type and kind of the result are those of the arguments. (As a
  12785. GNU extension, kind is the largest kind of the actual arguments.)
  12786. If A and P are of type 'INTEGER':
  12787. 'MODULO(A,P)' has the value R such that 'A=Q*P+R', where Q is
  12788. an integer and R is between 0 (inclusive) and P (exclusive).
  12789. If A and P are of type 'REAL':
  12790. 'MODULO(A,P)' has the value of 'A - FLOOR (A / P) * P'.
  12791. The returned value has the same sign as P and a magnitude less than
  12792. the magnitude of P.
  12793. _Example_:
  12794. program test_modulo
  12795. print *, modulo(17,3)
  12796. print *, modulo(17.5,5.5)
  12797. print *, modulo(-17,3)
  12798. print *, modulo(-17.5,5.5)
  12799. print *, modulo(17,-3)
  12800. print *, modulo(17.5,-5.5)
  12801. end program
  12802. _See also_:
  12803. *note MOD::
  12804. 
  12805. File: gfortran.info, Node: MOVE_ALLOC, Next: MVBITS, Prev: MODULO, Up: Intrinsic Procedures
  12806. 9.203 'MOVE_ALLOC' -- Move allocation from one object to another
  12807. ================================================================
  12808. _Description_:
  12809. 'MOVE_ALLOC(FROM, TO)' moves the allocation from FROM to TO. FROM
  12810. will become deallocated in the process.
  12811. _Standard_:
  12812. Fortran 2003 and later
  12813. _Class_:
  12814. Pure subroutine
  12815. _Syntax_:
  12816. 'CALL MOVE_ALLOC(FROM, TO)'
  12817. _Arguments_:
  12818. FROM 'ALLOCATABLE', 'INTENT(INOUT)', may be of any
  12819. type and kind.
  12820. TO 'ALLOCATABLE', 'INTENT(OUT)', shall be of the
  12821. same type, kind and rank as FROM.
  12822. _Return value_:
  12823. None
  12824. _Example_:
  12825. program test_move_alloc
  12826. integer, allocatable :: a(:), b(:)
  12827. allocate(a(3))
  12828. a = [ 1, 2, 3 ]
  12829. call move_alloc(a, b)
  12830. print *, allocated(a), allocated(b)
  12831. print *, b
  12832. end program test_move_alloc
  12833. 
  12834. File: gfortran.info, Node: MVBITS, Next: NEAREST, Prev: MOVE_ALLOC, Up: Intrinsic Procedures
  12835. 9.204 'MVBITS' -- Move bits from one integer to another
  12836. =======================================================
  12837. _Description_:
  12838. Moves LEN bits from positions FROMPOS through 'FROMPOS+LEN-1' of
  12839. FROM to positions TOPOS through 'TOPOS+LEN-1' of TO. The portion
  12840. of argument TO not affected by the movement of bits is unchanged.
  12841. The values of 'FROMPOS+LEN-1' and 'TOPOS+LEN-1' must be less than
  12842. 'BIT_SIZE(FROM)'.
  12843. _Standard_:
  12844. Fortran 90 and later, has overloads that are GNU extensions
  12845. _Class_:
  12846. Elemental subroutine
  12847. _Syntax_:
  12848. 'CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)'
  12849. _Arguments_:
  12850. FROM The type shall be 'INTEGER'.
  12851. FROMPOS The type shall be 'INTEGER'.
  12852. LEN The type shall be 'INTEGER'.
  12853. TO The type shall be 'INTEGER', of the same kind as
  12854. FROM.
  12855. TOPOS The type shall be 'INTEGER'.
  12856. _Specific names_:
  12857. Name Argument Return type Standard
  12858. 'MVBITS(A)' 'INTEGER A' 'INTEGER' Fortran 90 and
  12859. later
  12860. 'BMVBITS(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  12861. A'
  12862. 'IMVBITS(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  12863. A'
  12864. 'JMVBITS(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  12865. A'
  12866. 'KMVBITS(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  12867. A'
  12868. _See also_:
  12869. *note IBCLR::, *note IBSET::, *note IBITS::, *note IAND::, *note
  12870. IOR::, *note IEOR::
  12871. 
  12872. File: gfortran.info, Node: NEAREST, Next: NEW_LINE, Prev: MVBITS, Up: Intrinsic Procedures
  12873. 9.205 'NEAREST' -- Nearest representable number
  12874. ===============================================
  12875. _Description_:
  12876. 'NEAREST(X, S)' returns the processor-representable number nearest
  12877. to 'X' in the direction indicated by the sign of 'S'.
  12878. _Standard_:
  12879. Fortran 90 and later
  12880. _Class_:
  12881. Elemental function
  12882. _Syntax_:
  12883. 'RESULT = NEAREST(X, S)'
  12884. _Arguments_:
  12885. X Shall be of type 'REAL'.
  12886. S Shall be of type 'REAL' and not equal to zero.
  12887. _Return value_:
  12888. The return value is of the same type as 'X'. If 'S' is positive,
  12889. 'NEAREST' returns the processor-representable number greater than
  12890. 'X' and nearest to it. If 'S' is negative, 'NEAREST' returns the
  12891. processor-representable number smaller than 'X' and nearest to it.
  12892. _Example_:
  12893. program test_nearest
  12894. real :: x, y
  12895. x = nearest(42.0, 1.0)
  12896. y = nearest(42.0, -1.0)
  12897. write (*,"(3(G20.15))") x, y, x - y
  12898. end program test_nearest
  12899. 
  12900. File: gfortran.info, Node: NEW_LINE, Next: NINT, Prev: NEAREST, Up: Intrinsic Procedures
  12901. 9.206 'NEW_LINE' -- New line character
  12902. ======================================
  12903. _Description_:
  12904. 'NEW_LINE(C)' returns the new-line character.
  12905. _Standard_:
  12906. Fortran 2003 and later
  12907. _Class_:
  12908. Inquiry function
  12909. _Syntax_:
  12910. 'RESULT = NEW_LINE(C)'
  12911. _Arguments_:
  12912. C The argument shall be a scalar or array of the
  12913. type 'CHARACTER'.
  12914. _Return value_:
  12915. Returns a CHARACTER scalar of length one with the new-line
  12916. character of the same kind as parameter C.
  12917. _Example_:
  12918. program newline
  12919. implicit none
  12920. write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'
  12921. end program newline
  12922. 
  12923. File: gfortran.info, Node: NINT, Next: NORM2, Prev: NEW_LINE, Up: Intrinsic Procedures
  12924. 9.207 'NINT' -- Nearest whole number
  12925. ====================================
  12926. _Description_:
  12927. 'NINT(A)' rounds its argument to the nearest whole number.
  12928. _Standard_:
  12929. Fortran 77 and later, with KIND argument Fortran 90 and later
  12930. _Class_:
  12931. Elemental function
  12932. _Syntax_:
  12933. 'RESULT = NINT(A [, KIND])'
  12934. _Arguments_:
  12935. A The type of the argument shall be 'REAL'.
  12936. KIND (Optional) An 'INTEGER' initialization
  12937. expression indicating the kind parameter of the
  12938. result.
  12939. _Return value_:
  12940. Returns A with the fractional portion of its magnitude eliminated
  12941. by rounding to the nearest whole number and with its sign
  12942. preserved, converted to an 'INTEGER' of the default kind.
  12943. _Example_:
  12944. program test_nint
  12945. real(4) x4
  12946. real(8) x8
  12947. x4 = 1.234E0_4
  12948. x8 = 4.321_8
  12949. print *, nint(x4), idnint(x8)
  12950. end program test_nint
  12951. _Specific names_:
  12952. Name Argument Return Type Standard
  12953. 'NINT(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and
  12954. later
  12955. 'IDNINT(A)' 'REAL(8) A' 'INTEGER' Fortran 77 and
  12956. later
  12957. _See also_:
  12958. *note CEILING::, *note FLOOR::
  12959. 
  12960. File: gfortran.info, Node: NORM2, Next: NOT, Prev: NINT, Up: Intrinsic Procedures
  12961. 9.208 'NORM2' -- Euclidean vector norms
  12962. =======================================
  12963. _Description_:
  12964. Calculates the Euclidean vector norm (L_2 norm) of of ARRAY along
  12965. dimension DIM.
  12966. _Standard_:
  12967. Fortran 2008 and later
  12968. _Class_:
  12969. Transformational function
  12970. _Syntax_:
  12971. 'RESULT = NORM2(ARRAY[, DIM])'
  12972. _Arguments_:
  12973. ARRAY Shall be an array of type 'REAL'
  12974. DIM (Optional) shall be a scalar of type 'INTEGER'
  12975. with a value in the range from 1 to n, where n
  12976. equals the rank of ARRAY.
  12977. _Return value_:
  12978. The result is of the same type as ARRAY.
  12979. If DIM is absent, a scalar with the square root of the sum of all
  12980. elements in ARRAY squared is returned. Otherwise, an array of rank
  12981. n-1, where n equals the rank of ARRAY, and a shape similar to that
  12982. of ARRAY with dimension DIM dropped is returned.
  12983. _Example_:
  12984. PROGRAM test_sum
  12985. REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ]
  12986. print *, NORM2(x) ! = sqrt(55.) ~ 7.416
  12987. END PROGRAM
  12988. 
  12989. File: gfortran.info, Node: NOT, Next: NULL, Prev: NORM2, Up: Intrinsic Procedures
  12990. 9.209 'NOT' -- Logical negation
  12991. ===============================
  12992. _Description_:
  12993. 'NOT' returns the bitwise Boolean inverse of I.
  12994. _Standard_:
  12995. Fortran 90 and later, has overloads that are GNU extensions
  12996. _Class_:
  12997. Elemental function
  12998. _Syntax_:
  12999. 'RESULT = NOT(I)'
  13000. _Arguments_:
  13001. I The type shall be 'INTEGER'.
  13002. _Return value_:
  13003. The return type is 'INTEGER', of the same kind as the argument.
  13004. _Specific names_:
  13005. Name Argument Return type Standard
  13006. 'NOT(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  13007. later
  13008. 'BNOT(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  13009. A'
  13010. 'INOT(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  13011. A'
  13012. 'JNOT(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  13013. A'
  13014. 'KNOT(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  13015. A'
  13016. _See also_:
  13017. *note IAND::, *note IEOR::, *note IOR::, *note IBITS::, *note
  13018. IBSET::, *note IBCLR::
  13019. 
  13020. File: gfortran.info, Node: NULL, Next: NUM_IMAGES, Prev: NOT, Up: Intrinsic Procedures
  13021. 9.210 'NULL' -- Function that returns an disassociated pointer
  13022. ==============================================================
  13023. _Description_:
  13024. Returns a disassociated pointer.
  13025. If MOLD is present, a disassociated pointer of the same type is
  13026. returned, otherwise the type is determined by context.
  13027. In Fortran 95, MOLD is optional. Please note that Fortran 2003
  13028. includes cases where it is required.
  13029. _Standard_:
  13030. Fortran 95 and later
  13031. _Class_:
  13032. Transformational function
  13033. _Syntax_:
  13034. 'PTR => NULL([MOLD])'
  13035. _Arguments_:
  13036. MOLD (Optional) shall be a pointer of any association
  13037. status and of any type.
  13038. _Return value_:
  13039. A disassociated pointer.
  13040. _Example_:
  13041. REAL, POINTER, DIMENSION(:) :: VEC => NULL ()
  13042. _See also_:
  13043. *note ASSOCIATED::
  13044. 
  13045. File: gfortran.info, Node: NUM_IMAGES, Next: OR, Prev: NULL, Up: Intrinsic Procedures
  13046. 9.211 'NUM_IMAGES' -- Function that returns the number of images
  13047. ================================================================
  13048. _Description_:
  13049. Returns the number of images.
  13050. _Standard_:
  13051. Fortran 2008 and later. With DISTANCE or FAILED argument,
  13052. Technical Specification (TS) 18508 or later
  13053. _Class_:
  13054. Transformational function
  13055. _Syntax_:
  13056. 'RESULT = NUM_IMAGES(DISTANCE, FAILED)'
  13057. _Arguments_:
  13058. DISTANCE (optional, intent(in)) Nonnegative scalar
  13059. integer
  13060. FAILED (optional, intent(in)) Scalar logical expression
  13061. _Return value_:
  13062. Scalar default-kind integer. If DISTANCE is not present or has
  13063. value 0, the number of images in the current team is returned. For
  13064. values smaller or equal distance to the initial team, it returns
  13065. the number of images index on the ancestor team which has a
  13066. distance of DISTANCE from the invoking team. If DISTANCE is larger
  13067. than the distance to the initial team, the number of images of the
  13068. initial team is returned. If FAILED is not present the total
  13069. number of images is returned; if it has the value '.TRUE.', the
  13070. number of failed images is returned, otherwise, the number of
  13071. images which do have not the failed status.
  13072. _Example_:
  13073. INTEGER :: value[*]
  13074. INTEGER :: i
  13075. value = THIS_IMAGE()
  13076. SYNC ALL
  13077. IF (THIS_IMAGE() == 1) THEN
  13078. DO i = 1, NUM_IMAGES()
  13079. WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
  13080. END DO
  13081. END IF
  13082. _See also_:
  13083. *note THIS_IMAGE::, *note IMAGE_INDEX::
  13084. 
  13085. File: gfortran.info, Node: OR, Next: PACK, Prev: NUM_IMAGES, Up: Intrinsic Procedures
  13086. 9.212 'OR' -- Bitwise logical OR
  13087. ================================
  13088. _Description_:
  13089. Bitwise logical 'OR'.
  13090. This intrinsic routine is provided for backwards compatibility with
  13091. GNU Fortran 77. For integer arguments, programmers should consider
  13092. the use of the *note IOR:: intrinsic defined by the Fortran
  13093. standard.
  13094. _Standard_:
  13095. GNU extension
  13096. _Class_:
  13097. Function
  13098. _Syntax_:
  13099. 'RESULT = OR(I, J)'
  13100. _Arguments_:
  13101. I The type shall be either a scalar 'INTEGER' type
  13102. or a scalar 'LOGICAL' type or a
  13103. boz-literal-constant.
  13104. J The type shall be the same as the type of I or a
  13105. boz-literal-constant. I and J shall not both be
  13106. boz-literal-constants. If either I and J is a
  13107. boz-literal-constant, then the other argument
  13108. must be a scalar 'INTEGER'.
  13109. _Return value_:
  13110. The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
  13111. If the kind type parameters differ, then the smaller kind type is
  13112. implicitly converted to larger kind, and the return has the larger
  13113. kind. A boz-literal-constant is converted to an 'INTEGER' with the
  13114. kind type parameter of the other argument as-if a call to *note
  13115. INT:: occurred.
  13116. _Example_:
  13117. PROGRAM test_or
  13118. LOGICAL :: T = .TRUE., F = .FALSE.
  13119. INTEGER :: a, b
  13120. DATA a / Z'F' /, b / Z'3' /
  13121. WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F)
  13122. WRITE (*,*) OR(a, b)
  13123. END PROGRAM
  13124. _See also_:
  13125. Fortran 95 elemental function: *note IOR::
  13126. 
  13127. File: gfortran.info, Node: PACK, Next: PARITY, Prev: OR, Up: Intrinsic Procedures
  13128. 9.213 'PACK' -- Pack an array into an array of rank one
  13129. =======================================================
  13130. _Description_:
  13131. Stores the elements of ARRAY in an array of rank one.
  13132. The beginning of the resulting array is made up of elements whose
  13133. MASK equals 'TRUE'. Afterwards, positions are filled with elements
  13134. taken from VECTOR.
  13135. _Standard_:
  13136. Fortran 90 and later
  13137. _Class_:
  13138. Transformational function
  13139. _Syntax_:
  13140. 'RESULT = PACK(ARRAY, MASK[,VECTOR])'
  13141. _Arguments_:
  13142. ARRAY Shall be an array of any type.
  13143. MASK Shall be an array of type 'LOGICAL' and of the
  13144. same size as ARRAY. Alternatively, it may be a
  13145. 'LOGICAL' scalar.
  13146. VECTOR (Optional) shall be an array of the same type as
  13147. ARRAY and of rank one. If present, the number
  13148. of elements in VECTOR shall be equal to or
  13149. greater than the number of true elements in
  13150. MASK. If MASK is scalar, the number of elements
  13151. in VECTOR shall be equal to or greater than the
  13152. number of elements in ARRAY.
  13153. _Return value_:
  13154. The result is an array of rank one and the same type as that of
  13155. ARRAY. If VECTOR is present, the result size is that of VECTOR,
  13156. the number of 'TRUE' values in MASK otherwise.
  13157. _Example_:
  13158. Gathering nonzero elements from an array:
  13159. PROGRAM test_pack_1
  13160. INTEGER :: m(6)
  13161. m = (/ 1, 0, 0, 0, 5, 0 /)
  13162. WRITE(*, FMT="(6(I0, ' '))") pack(m, m /= 0) ! "1 5"
  13163. END PROGRAM
  13164. Gathering nonzero elements from an array and appending elements
  13165. from VECTOR:
  13166. PROGRAM test_pack_2
  13167. INTEGER :: m(4)
  13168. m = (/ 1, 0, 0, 2 /)
  13169. ! The following results in "1 2 3 4"
  13170. WRITE(*, FMT="(4(I0, ' '))") pack(m, m /= 0, (/ 0, 0, 3, 4 /))
  13171. END PROGRAM
  13172. _See also_:
  13173. *note UNPACK::
  13174. 
  13175. File: gfortran.info, Node: PARITY, Next: PERROR, Prev: PACK, Up: Intrinsic Procedures
  13176. 9.214 'PARITY' -- Reduction with exclusive OR
  13177. =============================================
  13178. _Description_:
  13179. Calculates the parity, i.e. the reduction using '.XOR.', of MASK
  13180. along dimension DIM.
  13181. _Standard_:
  13182. Fortran 2008 and later
  13183. _Class_:
  13184. Transformational function
  13185. _Syntax_:
  13186. 'RESULT = PARITY(MASK[, DIM])'
  13187. _Arguments_:
  13188. LOGICAL Shall be an array of type 'LOGICAL'
  13189. DIM (Optional) shall be a scalar of type 'INTEGER'
  13190. with a value in the range from 1 to n, where n
  13191. equals the rank of MASK.
  13192. _Return value_:
  13193. The result is of the same type as MASK.
  13194. If DIM is absent, a scalar with the parity of all elements in MASK
  13195. is returned, i.e. true if an odd number of elements is '.true.'
  13196. and false otherwise. If DIM is present, an array of rank n-1,
  13197. where n equals the rank of ARRAY, and a shape similar to that of
  13198. MASK with dimension DIM dropped is returned.
  13199. _Example_:
  13200. PROGRAM test_sum
  13201. LOGICAL :: x(2) = [ .true., .false. ]
  13202. print *, PARITY(x) ! prints "T" (true).
  13203. END PROGRAM
  13204. 
  13205. File: gfortran.info, Node: PERROR, Next: POPCNT, Prev: PARITY, Up: Intrinsic Procedures
  13206. 9.215 'PERROR' -- Print system error message
  13207. ============================================
  13208. _Description_:
  13209. Prints (on the C 'stderr' stream) a newline-terminated error
  13210. message corresponding to the last system error. This is prefixed
  13211. by STRING, a colon and a space. See 'perror(3)'.
  13212. _Standard_:
  13213. GNU extension
  13214. _Class_:
  13215. Subroutine
  13216. _Syntax_:
  13217. 'CALL PERROR(STRING)'
  13218. _Arguments_:
  13219. STRING A scalar of type 'CHARACTER' and of the default
  13220. kind.
  13221. _See also_:
  13222. *note IERRNO::
  13223. 
  13224. File: gfortran.info, Node: POPCNT, Next: POPPAR, Prev: PERROR, Up: Intrinsic Procedures
  13225. 9.216 'POPCNT' -- Number of bits set
  13226. ====================================
  13227. _Description_:
  13228. 'POPCNT(I)' returns the number of bits set ('1' bits) in the binary
  13229. representation of 'I'.
  13230. _Standard_:
  13231. Fortran 2008 and later
  13232. _Class_:
  13233. Elemental function
  13234. _Syntax_:
  13235. 'RESULT = POPCNT(I)'
  13236. _Arguments_:
  13237. I Shall be of type 'INTEGER'.
  13238. _Return value_:
  13239. The return value is of type 'INTEGER' and of the default integer
  13240. kind.
  13241. _Example_:
  13242. program test_population
  13243. print *, popcnt(127), poppar(127)
  13244. print *, popcnt(huge(0_4)), poppar(huge(0_4))
  13245. print *, popcnt(huge(0_8)), poppar(huge(0_8))
  13246. end program test_population
  13247. _See also_:
  13248. *note POPPAR::, *note LEADZ::, *note TRAILZ::
  13249. 
  13250. File: gfortran.info, Node: POPPAR, Next: PRECISION, Prev: POPCNT, Up: Intrinsic Procedures
  13251. 9.217 'POPPAR' -- Parity of the number of bits set
  13252. ==================================================
  13253. _Description_:
  13254. 'POPPAR(I)' returns parity of the integer 'I', i.e. the parity of
  13255. the number of bits set ('1' bits) in the binary representation of
  13256. 'I'. It is equal to 0 if 'I' has an even number of bits set, and 1
  13257. for an odd number of '1' bits.
  13258. _Standard_:
  13259. Fortran 2008 and later
  13260. _Class_:
  13261. Elemental function
  13262. _Syntax_:
  13263. 'RESULT = POPPAR(I)'
  13264. _Arguments_:
  13265. I Shall be of type 'INTEGER'.
  13266. _Return value_:
  13267. The return value is of type 'INTEGER' and of the default integer
  13268. kind.
  13269. _Example_:
  13270. program test_population
  13271. print *, popcnt(127), poppar(127)
  13272. print *, popcnt(huge(0_4)), poppar(huge(0_4))
  13273. print *, popcnt(huge(0_8)), poppar(huge(0_8))
  13274. end program test_population
  13275. _See also_:
  13276. *note POPCNT::, *note LEADZ::, *note TRAILZ::
  13277. 
  13278. File: gfortran.info, Node: PRECISION, Next: PRESENT, Prev: POPPAR, Up: Intrinsic Procedures
  13279. 9.218 'PRECISION' -- Decimal precision of a real kind
  13280. =====================================================
  13281. _Description_:
  13282. 'PRECISION(X)' returns the decimal precision in the model of the
  13283. type of 'X'.
  13284. _Standard_:
  13285. Fortran 90 and later
  13286. _Class_:
  13287. Inquiry function
  13288. _Syntax_:
  13289. 'RESULT = PRECISION(X)'
  13290. _Arguments_:
  13291. X Shall be of type 'REAL' or 'COMPLEX'. It may be
  13292. scalar or valued.
  13293. _Return value_:
  13294. The return value is of type 'INTEGER' and of the default integer
  13295. kind.
  13296. _Example_:
  13297. program prec_and_range
  13298. real(kind=4) :: x(2)
  13299. complex(kind=8) :: y
  13300. print *, precision(x), range(x)
  13301. print *, precision(y), range(y)
  13302. end program prec_and_range
  13303. _See also_:
  13304. *note SELECTED_REAL_KIND::, *note RANGE::
  13305. 
  13306. File: gfortran.info, Node: PRESENT, Next: PRODUCT, Prev: PRECISION, Up: Intrinsic Procedures
  13307. 9.219 'PRESENT' -- Determine whether an optional dummy argument is specified
  13308. ============================================================================
  13309. _Description_:
  13310. Determines whether an optional dummy argument is present.
  13311. _Standard_:
  13312. Fortran 90 and later
  13313. _Class_:
  13314. Inquiry function
  13315. _Syntax_:
  13316. 'RESULT = PRESENT(A)'
  13317. _Arguments_:
  13318. A May be of any type and may be a pointer, scalar
  13319. or array value, or a dummy procedure. It shall
  13320. be the name of an optional dummy argument
  13321. accessible within the current subroutine or
  13322. function.
  13323. _Return value_:
  13324. Returns either 'TRUE' if the optional argument A is present, or
  13325. 'FALSE' otherwise.
  13326. _Example_:
  13327. PROGRAM test_present
  13328. WRITE(*,*) f(), f(42) ! "F T"
  13329. CONTAINS
  13330. LOGICAL FUNCTION f(x)
  13331. INTEGER, INTENT(IN), OPTIONAL :: x
  13332. f = PRESENT(x)
  13333. END FUNCTION
  13334. END PROGRAM
  13335. 
  13336. File: gfortran.info, Node: PRODUCT, Next: RADIX, Prev: PRESENT, Up: Intrinsic Procedures
  13337. 9.220 'PRODUCT' -- Product of array elements
  13338. ============================================
  13339. _Description_:
  13340. Multiplies the elements of ARRAY along dimension DIM if the
  13341. corresponding element in MASK is 'TRUE'.
  13342. _Standard_:
  13343. Fortran 90 and later
  13344. _Class_:
  13345. Transformational function
  13346. _Syntax_:
  13347. 'RESULT = PRODUCT(ARRAY[, MASK])'
  13348. 'RESULT = PRODUCT(ARRAY, DIM[, MASK])'
  13349. _Arguments_:
  13350. ARRAY Shall be an array of type 'INTEGER', 'REAL' or
  13351. 'COMPLEX'.
  13352. DIM (Optional) shall be a scalar of type 'INTEGER'
  13353. with a value in the range from 1 to n, where n
  13354. equals the rank of ARRAY.
  13355. MASK (Optional) shall be of type 'LOGICAL' and either
  13356. be a scalar or an array of the same shape as
  13357. ARRAY.
  13358. _Return value_:
  13359. The result is of the same type as ARRAY.
  13360. If DIM is absent, a scalar with the product of all elements in
  13361. ARRAY is returned. Otherwise, an array of rank n-1, where n equals
  13362. the rank of ARRAY, and a shape similar to that of ARRAY with
  13363. dimension DIM dropped is returned.
  13364. _Example_:
  13365. PROGRAM test_product
  13366. INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
  13367. print *, PRODUCT(x) ! all elements, product = 120
  13368. print *, PRODUCT(x, MASK=MOD(x, 2)==1) ! odd elements, product = 15
  13369. END PROGRAM
  13370. _See also_:
  13371. *note SUM::
  13372. 
  13373. File: gfortran.info, Node: RADIX, Next: RAN, Prev: PRODUCT, Up: Intrinsic Procedures
  13374. 9.221 'RADIX' -- Base of a model number
  13375. =======================================
  13376. _Description_:
  13377. 'RADIX(X)' returns the base of the model representing the entity X.
  13378. _Standard_:
  13379. Fortran 90 and later
  13380. _Class_:
  13381. Inquiry function
  13382. _Syntax_:
  13383. 'RESULT = RADIX(X)'
  13384. _Arguments_:
  13385. X Shall be of type 'INTEGER' or 'REAL'
  13386. _Return value_:
  13387. The return value is a scalar of type 'INTEGER' and of the default
  13388. integer kind.
  13389. _Example_:
  13390. program test_radix
  13391. print *, "The radix for the default integer kind is", radix(0)
  13392. print *, "The radix for the default real kind is", radix(0.0)
  13393. end program test_radix
  13394. _See also_:
  13395. *note SELECTED_REAL_KIND::
  13396. 
  13397. File: gfortran.info, Node: RAN, Next: RAND, Prev: RADIX, Up: Intrinsic Procedures
  13398. 9.222 'RAN' -- Real pseudo-random number
  13399. ========================================
  13400. _Description_:
  13401. For compatibility with HP FORTRAN 77/iX, the 'RAN' intrinsic is
  13402. provided as an alias for 'RAND'. See *note RAND:: for complete
  13403. documentation.
  13404. _Standard_:
  13405. GNU extension
  13406. _Class_:
  13407. Function
  13408. _See also_:
  13409. *note RAND::, *note RANDOM_NUMBER::
  13410. 
  13411. File: gfortran.info, Node: RAND, Next: RANDOM_INIT, Prev: RAN, Up: Intrinsic Procedures
  13412. 9.223 'RAND' -- Real pseudo-random number
  13413. =========================================
  13414. _Description_:
  13415. 'RAND(FLAG)' returns a pseudo-random number from a uniform
  13416. distribution between 0 and 1. If FLAG is 0, the next number in the
  13417. current sequence is returned; if FLAG is 1, the generator is
  13418. restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
  13419. used as a new seed with 'SRAND'.
  13420. This intrinsic routine is provided for backwards compatibility with
  13421. GNU Fortran 77. It implements a simple modulo generator as
  13422. provided by 'g77'. For new code, one should consider the use of
  13423. *note RANDOM_NUMBER:: as it implements a superior algorithm.
  13424. _Standard_:
  13425. GNU extension
  13426. _Class_:
  13427. Function
  13428. _Syntax_:
  13429. 'RESULT = RAND(I)'
  13430. _Arguments_:
  13431. I Shall be a scalar 'INTEGER' of kind 4.
  13432. _Return value_:
  13433. The return value is of 'REAL' type and the default kind.
  13434. _Example_:
  13435. program test_rand
  13436. integer,parameter :: seed = 86456
  13437. call srand(seed)
  13438. print *, rand(), rand(), rand(), rand()
  13439. print *, rand(seed), rand(), rand(), rand()
  13440. end program test_rand
  13441. _See also_:
  13442. *note SRAND::, *note RANDOM_NUMBER::
  13443. 
  13444. File: gfortran.info, Node: RANDOM_INIT, Next: RANDOM_NUMBER, Prev: RAND, Up: Intrinsic Procedures
  13445. 9.224 'RANDOM_INIT' -- Initialize a pseudo-random number generator
  13446. ==================================================================
  13447. _Description_:
  13448. Initializes the state of the pseudorandom number generator used by
  13449. 'RANDOM_NUMBER'.
  13450. _Standard_:
  13451. Fortran 2018
  13452. _Class_:
  13453. Subroutine
  13454. _Syntax_:
  13455. 'CALL RANDOM_INIT(REPEATABLE, IMAGE_DISTINCT)'
  13456. _Arguments_:
  13457. REPEATABLE Shall be a scalar with a 'LOGICAL' type, and it
  13458. is 'INTENT(IN)'. If it is '.true.', the seed is
  13459. set to a processor-dependent value that is the
  13460. same each time 'RANDOM_INIT' is called from the
  13461. same image. The term "same image" means a
  13462. single instance of program execution. The
  13463. sequence of random numbers is different for
  13464. repeated execution of the program. If it is
  13465. '.false.', the seed is set to a
  13466. processor-dependent value.
  13467. IMAGE_DISTINCT Shall be a scalar with a 'LOGICAL' type, and it
  13468. is 'INTENT(IN)'. If it is '.true.', the seed is
  13469. set to a processor-dependent value that is
  13470. distinct from th seed set by a call to
  13471. 'RANDOM_INIT' in another image. If it is
  13472. '.false.', the seed is set value that does
  13473. depend which image called 'RANDOM_INIT'.
  13474. _Example_:
  13475. program test_random_seed
  13476. implicit none
  13477. real x(3), y(3)
  13478. call random_init(.true., .true.)
  13479. call random_number(x)
  13480. call random_init(.true., .true.)
  13481. call random_number(y)
  13482. ! x and y are the same sequence
  13483. if (any(x /= y)) call abort
  13484. end program test_random_seed
  13485. _See also_:
  13486. *note RANDOM_NUMBER::, *note RANDOM_SEED::
  13487. 
  13488. File: gfortran.info, Node: RANDOM_NUMBER, Next: RANDOM_SEED, Prev: RANDOM_INIT, Up: Intrinsic Procedures
  13489. 9.225 'RANDOM_NUMBER' -- Pseudo-random number
  13490. =============================================
  13491. _Description_:
  13492. Returns a single pseudorandom number or an array of pseudorandom
  13493. numbers from the uniform distribution over the range 0 \leq x < 1.
  13494. The runtime-library implements the xoshiro256** pseudorandom number
  13495. generator (PRNG). This generator has a period of 2^{256} - 1, and
  13496. when using multiple threads up to 2^{128} threads can each generate
  13497. 2^{128} random numbers before any aliasing occurs.
  13498. Note that in a multi-threaded program (e.g. using OpenMP
  13499. directives), each thread will have its own random number state.
  13500. For details of the seeding procedure, see the documentation for the
  13501. 'RANDOM_SEED' intrinsic.
  13502. _Standard_:
  13503. Fortran 90 and later
  13504. _Class_:
  13505. Subroutine
  13506. _Syntax_:
  13507. 'RANDOM_NUMBER(HARVEST)'
  13508. _Arguments_:
  13509. HARVEST Shall be a scalar or an array of type 'REAL'.
  13510. _Example_:
  13511. program test_random_number
  13512. REAL :: r(5,5)
  13513. CALL RANDOM_NUMBER(r)
  13514. end program
  13515. _See also_:
  13516. *note RANDOM_SEED::, *note RANDOM_INIT::
  13517. 
  13518. File: gfortran.info, Node: RANDOM_SEED, Next: RANGE, Prev: RANDOM_NUMBER, Up: Intrinsic Procedures
  13519. 9.226 'RANDOM_SEED' -- Initialize a pseudo-random number sequence
  13520. =================================================================
  13521. _Description_:
  13522. Restarts or queries the state of the pseudorandom number generator
  13523. used by 'RANDOM_NUMBER'.
  13524. If 'RANDOM_SEED' is called without arguments, it is seeded with
  13525. random data retrieved from the operating system.
  13526. As an extension to the Fortran standard, the GFortran
  13527. 'RANDOM_NUMBER' supports multiple threads. Each thread in a
  13528. multi-threaded program has its own seed. When 'RANDOM_SEED' is
  13529. called either without arguments or with the PUT argument, the given
  13530. seed is copied into a master seed as well as the seed of the
  13531. current thread. When a new thread uses 'RANDOM_NUMBER' for the
  13532. first time, the seed is copied from the master seed, and forwarded
  13533. N * 2^{128} steps to guarantee that the random stream does not
  13534. alias any other stream in the system, where N is the number of
  13535. threads that have used 'RANDOM_NUMBER' so far during the program
  13536. execution.
  13537. _Standard_:
  13538. Fortran 90 and later
  13539. _Class_:
  13540. Subroutine
  13541. _Syntax_:
  13542. 'CALL RANDOM_SEED([SIZE, PUT, GET])'
  13543. _Arguments_:
  13544. SIZE (Optional) Shall be a scalar and of type default
  13545. 'INTEGER', with 'INTENT(OUT)'. It specifies the
  13546. minimum size of the arrays used with the PUT and
  13547. GET arguments.
  13548. PUT (Optional) Shall be an array of type default
  13549. 'INTEGER' and rank one. It is 'INTENT(IN)' and
  13550. the size of the array must be larger than or
  13551. equal to the number returned by the SIZE
  13552. argument.
  13553. GET (Optional) Shall be an array of type default
  13554. 'INTEGER' and rank one. It is 'INTENT(OUT)' and
  13555. the size of the array must be larger than or
  13556. equal to the number returned by the SIZE
  13557. argument.
  13558. _Example_:
  13559. program test_random_seed
  13560. implicit none
  13561. integer, allocatable :: seed(:)
  13562. integer :: n
  13563. call random_seed(size = n)
  13564. allocate(seed(n))
  13565. call random_seed(get=seed)
  13566. write (*, *) seed
  13567. end program test_random_seed
  13568. _See also_:
  13569. *note RANDOM_NUMBER::, *note RANDOM_INIT::
  13570. 
  13571. File: gfortran.info, Node: RANGE, Next: RANK, Prev: RANDOM_SEED, Up: Intrinsic Procedures
  13572. 9.227 'RANGE' -- Decimal exponent range
  13573. =======================================
  13574. _Description_:
  13575. 'RANGE(X)' returns the decimal exponent range in the model of the
  13576. type of 'X'.
  13577. _Standard_:
  13578. Fortran 90 and later
  13579. _Class_:
  13580. Inquiry function
  13581. _Syntax_:
  13582. 'RESULT = RANGE(X)'
  13583. _Arguments_:
  13584. X Shall be of type 'INTEGER', 'REAL' or 'COMPLEX'.
  13585. _Return value_:
  13586. The return value is of type 'INTEGER' and of the default integer
  13587. kind.
  13588. _Example_:
  13589. See 'PRECISION' for an example.
  13590. _See also_:
  13591. *note SELECTED_REAL_KIND::, *note PRECISION::
  13592. 
  13593. File: gfortran.info, Node: RANK, Next: REAL, Prev: RANGE, Up: Intrinsic Procedures
  13594. 9.228 'RANK' -- Rank of a data object
  13595. =====================================
  13596. _Description_:
  13597. 'RANK(A)' returns the rank of a scalar or array data object.
  13598. _Standard_:
  13599. Technical Specification (TS) 29113
  13600. _Class_:
  13601. Inquiry function
  13602. _Syntax_:
  13603. 'RESULT = RANK(A)'
  13604. _Arguments_:
  13605. A can be of any type
  13606. _Return value_:
  13607. The return value is of type 'INTEGER' and of the default integer
  13608. kind. For arrays, their rank is returned; for scalars zero is
  13609. returned.
  13610. _Example_:
  13611. program test_rank
  13612. integer :: a
  13613. real, allocatable :: b(:,:)
  13614. print *, rank(a), rank(b) ! Prints: 0 2
  13615. end program test_rank
  13616. 
  13617. File: gfortran.info, Node: REAL, Next: RENAME, Prev: RANK, Up: Intrinsic Procedures
  13618. 9.229 'REAL' -- Convert to real type
  13619. ====================================
  13620. _Description_:
  13621. 'REAL(A [, KIND])' converts its argument A to a real type. The
  13622. 'REALPART' function is provided for compatibility with 'g77', and
  13623. its use is strongly discouraged.
  13624. _Standard_:
  13625. Fortran 77 and later, with KIND argument Fortran 90 and later, has
  13626. GNU extensions
  13627. _Class_:
  13628. Elemental function
  13629. _Syntax_:
  13630. 'RESULT = REAL(A [, KIND])'
  13631. 'RESULT = REALPART(Z)'
  13632. _Arguments_:
  13633. A Shall be 'INTEGER', 'REAL', or 'COMPLEX'.
  13634. KIND (Optional) An 'INTEGER' initialization
  13635. expression indicating the kind parameter of the
  13636. result.
  13637. _Return value_:
  13638. These functions return a 'REAL' variable or array under the
  13639. following rules:
  13640. (A)
  13641. 'REAL(A)' is converted to a default real type if A is an
  13642. integer or real variable.
  13643. (B)
  13644. 'REAL(A)' is converted to a real type with the kind type
  13645. parameter of A if A is a complex variable.
  13646. (C)
  13647. 'REAL(A, KIND)' is converted to a real type with kind type
  13648. parameter KIND if A is a complex, integer, or real variable.
  13649. _Example_:
  13650. program test_real
  13651. complex :: x = (1.0, 2.0)
  13652. print *, real(x), real(x,8), realpart(x)
  13653. end program test_real
  13654. _Specific names_:
  13655. Name Argument Return type Standard
  13656. 'FLOAT(A)' 'INTEGER(4)' 'REAL(4)' GNU extension
  13657. 'DFLOAT(A)' 'INTEGER(4)' 'REAL(8)' GNU extension
  13658. 'FLOATI(A)' 'INTEGER(2)' 'REAL(4)' GNU extension
  13659. 'FLOATJ(A)' 'INTEGER(4)' 'REAL(4)' GNU extension
  13660. 'FLOATK(A)' 'INTEGER(8)' 'REAL(4)' GNU extension
  13661. 'SNGL(A)' 'INTEGER(8)' 'REAL(4)' GNU extension
  13662. _See also_:
  13663. *note DBLE::
  13664. 
  13665. File: gfortran.info, Node: RENAME, Next: REPEAT, Prev: REAL, Up: Intrinsic Procedures
  13666. 9.230 'RENAME' -- Rename a file
  13667. ===============================
  13668. _Description_:
  13669. Renames a file from file PATH1 to PATH2. A null character
  13670. ('CHAR(0)') can be used to mark the end of the names in PATH1 and
  13671. PATH2; otherwise, trailing blanks in the file names are ignored.
  13672. If the STATUS argument is supplied, it contains 0 on success or a
  13673. nonzero error code upon return; see 'rename(2)'.
  13674. This intrinsic is provided in both subroutine and function forms;
  13675. however, only one form can be used in any given program unit.
  13676. _Standard_:
  13677. GNU extension
  13678. _Class_:
  13679. Subroutine, function
  13680. _Syntax_:
  13681. 'CALL RENAME(PATH1, PATH2 [, STATUS])'
  13682. 'STATUS = RENAME(PATH1, PATH2)'
  13683. _Arguments_:
  13684. PATH1 Shall be of default 'CHARACTER' type.
  13685. PATH2 Shall be of default 'CHARACTER' type.
  13686. STATUS (Optional) Shall be of default 'INTEGER' type.
  13687. _See also_:
  13688. *note LINK::
  13689. 
  13690. File: gfortran.info, Node: REPEAT, Next: RESHAPE, Prev: RENAME, Up: Intrinsic Procedures
  13691. 9.231 'REPEAT' -- Repeated string concatenation
  13692. ===============================================
  13693. _Description_:
  13694. Concatenates NCOPIES copies of a string.
  13695. _Standard_:
  13696. Fortran 90 and later
  13697. _Class_:
  13698. Transformational function
  13699. _Syntax_:
  13700. 'RESULT = REPEAT(STRING, NCOPIES)'
  13701. _Arguments_:
  13702. STRING Shall be scalar and of type 'CHARACTER'.
  13703. NCOPIES Shall be scalar and of type 'INTEGER'.
  13704. _Return value_:
  13705. A new scalar of type 'CHARACTER' built up from NCOPIES copies of
  13706. STRING.
  13707. _Example_:
  13708. program test_repeat
  13709. write(*,*) repeat("x", 5) ! "xxxxx"
  13710. end program
  13711. 
  13712. File: gfortran.info, Node: RESHAPE, Next: RRSPACING, Prev: REPEAT, Up: Intrinsic Procedures
  13713. 9.232 'RESHAPE' -- Function to reshape an array
  13714. ===============================================
  13715. _Description_:
  13716. Reshapes SOURCE to correspond to SHAPE. If necessary, the new
  13717. array may be padded with elements from PAD or permuted as defined
  13718. by ORDER.
  13719. _Standard_:
  13720. Fortran 90 and later
  13721. _Class_:
  13722. Transformational function
  13723. _Syntax_:
  13724. 'RESULT = RESHAPE(SOURCE, SHAPE[, PAD, ORDER])'
  13725. _Arguments_:
  13726. SOURCE Shall be an array of any type.
  13727. SHAPE Shall be of type 'INTEGER' and an array of rank
  13728. one. Its values must be positive or zero.
  13729. PAD (Optional) shall be an array of the same type as
  13730. SOURCE.
  13731. ORDER (Optional) shall be of type 'INTEGER' and an
  13732. array of the same shape as SHAPE. Its values
  13733. shall be a permutation of the numbers from 1 to
  13734. n, where n is the size of SHAPE. If ORDER is
  13735. absent, the natural ordering shall be assumed.
  13736. _Return value_:
  13737. The result is an array of shape SHAPE with the same type as SOURCE.
  13738. _Example_:
  13739. PROGRAM test_reshape
  13740. INTEGER, DIMENSION(4) :: x
  13741. WRITE(*,*) SHAPE(x) ! prints "4"
  13742. WRITE(*,*) SHAPE(RESHAPE(x, (/2, 2/))) ! prints "2 2"
  13743. END PROGRAM
  13744. _See also_:
  13745. *note SHAPE::
  13746. 
  13747. File: gfortran.info, Node: RRSPACING, Next: RSHIFT, Prev: RESHAPE, Up: Intrinsic Procedures
  13748. 9.233 'RRSPACING' -- Reciprocal of the relative spacing
  13749. =======================================================
  13750. _Description_:
  13751. 'RRSPACING(X)' returns the reciprocal of the relative spacing of
  13752. model numbers near X.
  13753. _Standard_:
  13754. Fortran 90 and later
  13755. _Class_:
  13756. Elemental function
  13757. _Syntax_:
  13758. 'RESULT = RRSPACING(X)'
  13759. _Arguments_:
  13760. X Shall be of type 'REAL'.
  13761. _Return value_:
  13762. The return value is of the same type and kind as X. The value
  13763. returned is equal to 'ABS(FRACTION(X)) *
  13764. FLOAT(RADIX(X))**DIGITS(X)'.
  13765. _See also_:
  13766. *note SPACING::
  13767. 
  13768. File: gfortran.info, Node: RSHIFT, Next: SAME_TYPE_AS, Prev: RRSPACING, Up: Intrinsic Procedures
  13769. 9.234 'RSHIFT' -- Right shift bits
  13770. ==================================
  13771. _Description_:
  13772. 'RSHIFT' returns a value corresponding to I with all of the bits
  13773. shifted right by SHIFT places. SHIFT shall be nonnegative and less
  13774. than or equal to 'BIT_SIZE(I)', otherwise the result value is
  13775. undefined. Bits shifted out from the right end are lost. The fill
  13776. is arithmetic: the bits shifted in from the left end are equal to
  13777. the leftmost bit, which in two's complement representation is the
  13778. sign bit.
  13779. This function has been superseded by the 'SHIFTA' intrinsic, which
  13780. is standard in Fortran 2008 and later.
  13781. _Standard_:
  13782. GNU extension
  13783. _Class_:
  13784. Elemental function
  13785. _Syntax_:
  13786. 'RESULT = RSHIFT(I, SHIFT)'
  13787. _Arguments_:
  13788. I The type shall be 'INTEGER'.
  13789. SHIFT The type shall be 'INTEGER'.
  13790. _Return value_:
  13791. The return value is of type 'INTEGER' and of the same kind as I.
  13792. _See also_:
  13793. *note ISHFT::, *note ISHFTC::, *note LSHIFT::, *note SHIFTA::,
  13794. *note SHIFTR::, *note SHIFTL::
  13795. 
  13796. File: gfortran.info, Node: SAME_TYPE_AS, Next: SCALE, Prev: RSHIFT, Up: Intrinsic Procedures
  13797. 9.235 'SAME_TYPE_AS' -- Query dynamic types for equality
  13798. ========================================================
  13799. _Description_:
  13800. Query dynamic types for equality.
  13801. _Standard_:
  13802. Fortran 2003 and later
  13803. _Class_:
  13804. Inquiry function
  13805. _Syntax_:
  13806. 'RESULT = SAME_TYPE_AS(A, B)'
  13807. _Arguments_:
  13808. A Shall be an object of extensible declared type
  13809. or unlimited polymorphic.
  13810. B Shall be an object of extensible declared type
  13811. or unlimited polymorphic.
  13812. _Return value_:
  13813. The return value is a scalar of type default logical. It is true
  13814. if and only if the dynamic type of A is the same as the dynamic
  13815. type of B.
  13816. _See also_:
  13817. *note EXTENDS_TYPE_OF::
  13818. 
  13819. File: gfortran.info, Node: SCALE, Next: SCAN, Prev: SAME_TYPE_AS, Up: Intrinsic Procedures
  13820. 9.236 'SCALE' -- Scale a real value
  13821. ===================================
  13822. _Description_:
  13823. 'SCALE(X,I)' returns 'X * RADIX(X)**I'.
  13824. _Standard_:
  13825. Fortran 90 and later
  13826. _Class_:
  13827. Elemental function
  13828. _Syntax_:
  13829. 'RESULT = SCALE(X, I)'
  13830. _Arguments_:
  13831. X The type of the argument shall be a 'REAL'.
  13832. I The type of the argument shall be a 'INTEGER'.
  13833. _Return value_:
  13834. The return value is of the same type and kind as X. Its value is
  13835. 'X * RADIX(X)**I'.
  13836. _Example_:
  13837. program test_scale
  13838. real :: x = 178.1387e-4
  13839. integer :: i = 5
  13840. print *, scale(x,i), x*radix(x)**i
  13841. end program test_scale
  13842. 
  13843. File: gfortran.info, Node: SCAN, Next: SECNDS, Prev: SCALE, Up: Intrinsic Procedures
  13844. 9.237 'SCAN' -- Scan a string for the presence of a set of characters
  13845. =====================================================================
  13846. _Description_:
  13847. Scans a STRING for any of the characters in a SET of characters.
  13848. If BACK is either absent or equals 'FALSE', this function returns
  13849. the position of the leftmost character of STRING that is in SET.
  13850. If BACK equals 'TRUE', the rightmost position is returned. If no
  13851. character of SET is found in STRING, the result is zero.
  13852. _Standard_:
  13853. Fortran 90 and later, with KIND argument Fortran 2003 and later
  13854. _Class_:
  13855. Elemental function
  13856. _Syntax_:
  13857. 'RESULT = SCAN(STRING, SET[, BACK [, KIND]])'
  13858. _Arguments_:
  13859. STRING Shall be of type 'CHARACTER'.
  13860. SET Shall be of type 'CHARACTER'.
  13861. BACK (Optional) shall be of type 'LOGICAL'.
  13862. KIND (Optional) An 'INTEGER' initialization
  13863. expression indicating the kind parameter of the
  13864. result.
  13865. _Return value_:
  13866. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  13867. absent, the return value is of default integer kind.
  13868. _Example_:
  13869. PROGRAM test_scan
  13870. WRITE(*,*) SCAN("FORTRAN", "AO") ! 2, found 'O'
  13871. WRITE(*,*) SCAN("FORTRAN", "AO", .TRUE.) ! 6, found 'A'
  13872. WRITE(*,*) SCAN("FORTRAN", "C++") ! 0, found none
  13873. END PROGRAM
  13874. _See also_:
  13875. *note INDEX intrinsic::, *note VERIFY::
  13876. 
  13877. File: gfortran.info, Node: SECNDS, Next: SECOND, Prev: SCAN, Up: Intrinsic Procedures
  13878. 9.238 'SECNDS' -- Time function
  13879. ===============================
  13880. _Description_:
  13881. 'SECNDS(X)' gets the time in seconds from the real-time system
  13882. clock. X is a reference time, also in seconds. If this is zero,
  13883. the time in seconds from midnight is returned. This function is
  13884. non-standard and its use is discouraged.
  13885. _Standard_:
  13886. GNU extension
  13887. _Class_:
  13888. Function
  13889. _Syntax_:
  13890. 'RESULT = SECNDS (X)'
  13891. _Arguments_:
  13892. T Shall be of type 'REAL(4)'.
  13893. X Shall be of type 'REAL(4)'.
  13894. _Return value_:
  13895. None
  13896. _Example_:
  13897. program test_secnds
  13898. integer :: i
  13899. real(4) :: t1, t2
  13900. print *, secnds (0.0) ! seconds since midnight
  13901. t1 = secnds (0.0) ! reference time
  13902. do i = 1, 10000000 ! do something
  13903. end do
  13904. t2 = secnds (t1) ! elapsed time
  13905. print *, "Something took ", t2, " seconds."
  13906. end program test_secnds
  13907. 
  13908. File: gfortran.info, Node: SECOND, Next: SELECTED_CHAR_KIND, Prev: SECNDS, Up: Intrinsic Procedures
  13909. 9.239 'SECOND' -- CPU time function
  13910. ===================================
  13911. _Description_:
  13912. Returns a 'REAL(4)' value representing the elapsed CPU time in
  13913. seconds. This provides the same functionality as the standard
  13914. 'CPU_TIME' intrinsic, and is only included for backwards
  13915. compatibility.
  13916. This intrinsic is provided in both subroutine and function forms;
  13917. however, only one form can be used in any given program unit.
  13918. _Standard_:
  13919. GNU extension
  13920. _Class_:
  13921. Subroutine, function
  13922. _Syntax_:
  13923. 'CALL SECOND(TIME)'
  13924. 'TIME = SECOND()'
  13925. _Arguments_:
  13926. TIME Shall be of type 'REAL(4)'.
  13927. _Return value_:
  13928. In either syntax, TIME is set to the process's current runtime in
  13929. seconds.
  13930. _See also_:
  13931. *note CPU_TIME::
  13932. 
  13933. File: gfortran.info, Node: SELECTED_CHAR_KIND, Next: SELECTED_INT_KIND, Prev: SECOND, Up: Intrinsic Procedures
  13934. 9.240 'SELECTED_CHAR_KIND' -- Choose character kind
  13935. ===================================================
  13936. _Description_:
  13937. 'SELECTED_CHAR_KIND(NAME)' returns the kind value for the character
  13938. set named NAME, if a character set with such a name is supported,
  13939. or -1 otherwise. Currently, supported character sets include
  13940. "ASCII" and "DEFAULT", which are equivalent, and "ISO_10646"
  13941. (Universal Character Set, UCS-4) which is commonly known as
  13942. Unicode.
  13943. _Standard_:
  13944. Fortran 2003 and later
  13945. _Class_:
  13946. Transformational function
  13947. _Syntax_:
  13948. 'RESULT = SELECTED_CHAR_KIND(NAME)'
  13949. _Arguments_:
  13950. NAME Shall be a scalar and of the default character
  13951. type.
  13952. _Example_:
  13953. program character_kind
  13954. use iso_fortran_env
  13955. implicit none
  13956. integer, parameter :: ascii = selected_char_kind ("ascii")
  13957. integer, parameter :: ucs4 = selected_char_kind ('ISO_10646')
  13958. character(kind=ascii, len=26) :: alphabet
  13959. character(kind=ucs4, len=30) :: hello_world
  13960. alphabet = ascii_"abcdefghijklmnopqrstuvwxyz"
  13961. hello_world = ucs4_'Hello World and Ni Hao -- ' &
  13962. // char (int (z'4F60'), ucs4) &
  13963. // char (int (z'597D'), ucs4)
  13964. write (*,*) alphabet
  13965. open (output_unit, encoding='UTF-8')
  13966. write (*,*) trim (hello_world)
  13967. end program character_kind
  13968. 
  13969. File: gfortran.info, Node: SELECTED_INT_KIND, Next: SELECTED_REAL_KIND, Prev: SELECTED_CHAR_KIND, Up: Intrinsic Procedures
  13970. 9.241 'SELECTED_INT_KIND' -- Choose integer kind
  13971. ================================================
  13972. _Description_:
  13973. 'SELECTED_INT_KIND(R)' return the kind value of the smallest
  13974. integer type that can represent all values ranging from -10^R
  13975. (exclusive) to 10^R (exclusive). If there is no integer kind that
  13976. accommodates this range, 'SELECTED_INT_KIND' returns -1.
  13977. _Standard_:
  13978. Fortran 90 and later
  13979. _Class_:
  13980. Transformational function
  13981. _Syntax_:
  13982. 'RESULT = SELECTED_INT_KIND(R)'
  13983. _Arguments_:
  13984. R Shall be a scalar and of type 'INTEGER'.
  13985. _Example_:
  13986. program large_integers
  13987. integer,parameter :: k5 = selected_int_kind(5)
  13988. integer,parameter :: k15 = selected_int_kind(15)
  13989. integer(kind=k5) :: i5
  13990. integer(kind=k15) :: i15
  13991. print *, huge(i5), huge(i15)
  13992. ! The following inequalities are always true
  13993. print *, huge(i5) >= 10_k5**5-1
  13994. print *, huge(i15) >= 10_k15**15-1
  13995. end program large_integers
  13996. 
  13997. File: gfortran.info, Node: SELECTED_REAL_KIND, Next: SET_EXPONENT, Prev: SELECTED_INT_KIND, Up: Intrinsic Procedures
  13998. 9.242 'SELECTED_REAL_KIND' -- Choose real kind
  13999. ==============================================
  14000. _Description_:
  14001. 'SELECTED_REAL_KIND(P,R)' returns the kind value of a real data
  14002. type with decimal precision of at least 'P' digits, exponent range
  14003. of at least 'R', and with a radix of 'RADIX'.
  14004. _Standard_:
  14005. Fortran 90 and later, with 'RADIX' Fortran 2008 or later
  14006. _Class_:
  14007. Transformational function
  14008. _Syntax_:
  14009. 'RESULT = SELECTED_REAL_KIND([P, R, RADIX])'
  14010. _Arguments_:
  14011. P (Optional) shall be a scalar and of type
  14012. 'INTEGER'.
  14013. R (Optional) shall be a scalar and of type
  14014. 'INTEGER'.
  14015. RADIX (Optional) shall be a scalar and of type
  14016. 'INTEGER'.
  14017. Before Fortran 2008, at least one of the arguments R or P shall be
  14018. present; since Fortran 2008, they are assumed to be zero if absent.
  14019. _Return value_:
  14020. 'SELECTED_REAL_KIND' returns the value of the kind type parameter
  14021. of a real data type with decimal precision of at least 'P' digits,
  14022. a decimal exponent range of at least 'R', and with the requested
  14023. 'RADIX'. If the 'RADIX' parameter is absent, real kinds with any
  14024. radix can be returned. If more than one real data type meet the
  14025. criteria, the kind of the data type with the smallest decimal
  14026. precision is returned. If no real data type matches the criteria,
  14027. the result is
  14028. -1 if the processor does not support a real data type with a
  14029. precision greater than or equal to 'P', but the 'R' and
  14030. 'RADIX' requirements can be fulfilled
  14031. -2 if the processor does not support a real type with an exponent
  14032. range greater than or equal to 'R', but 'P' and 'RADIX' are
  14033. fulfillable
  14034. -3 if 'RADIX' but not 'P' and 'R' requirements
  14035. are fulfillable
  14036. -4 if 'RADIX' and either 'P' or 'R' requirements
  14037. are fulfillable
  14038. -5 if there is no real type with the given 'RADIX'
  14039. _Example_:
  14040. program real_kinds
  14041. integer,parameter :: p6 = selected_real_kind(6)
  14042. integer,parameter :: p10r100 = selected_real_kind(10,100)
  14043. integer,parameter :: r400 = selected_real_kind(r=400)
  14044. real(kind=p6) :: x
  14045. real(kind=p10r100) :: y
  14046. real(kind=r400) :: z
  14047. print *, precision(x), range(x)
  14048. print *, precision(y), range(y)
  14049. print *, precision(z), range(z)
  14050. end program real_kinds
  14051. _See also_:
  14052. *note PRECISION::, *note RANGE::, *note RADIX::
  14053. 
  14054. File: gfortran.info, Node: SET_EXPONENT, Next: SHAPE, Prev: SELECTED_REAL_KIND, Up: Intrinsic Procedures
  14055. 9.243 'SET_EXPONENT' -- Set the exponent of the model
  14056. =====================================================
  14057. _Description_:
  14058. 'SET_EXPONENT(X, I)' returns the real number whose fractional part
  14059. is that that of X and whose exponent part is I.
  14060. _Standard_:
  14061. Fortran 90 and later
  14062. _Class_:
  14063. Elemental function
  14064. _Syntax_:
  14065. 'RESULT = SET_EXPONENT(X, I)'
  14066. _Arguments_:
  14067. X Shall be of type 'REAL'.
  14068. I Shall be of type 'INTEGER'.
  14069. _Return value_:
  14070. The return value is of the same type and kind as X. The real
  14071. number whose fractional part is that that of X and whose exponent
  14072. part if I is returned; it is 'FRACTION(X) * RADIX(X)**I'.
  14073. _Example_:
  14074. PROGRAM test_setexp
  14075. REAL :: x = 178.1387e-4
  14076. INTEGER :: i = 17
  14077. PRINT *, SET_EXPONENT(x, i), FRACTION(x) * RADIX(x)**i
  14078. END PROGRAM
  14079. 
  14080. File: gfortran.info, Node: SHAPE, Next: SHIFTA, Prev: SET_EXPONENT, Up: Intrinsic Procedures
  14081. 9.244 'SHAPE' -- Determine the shape of an array
  14082. ================================================
  14083. _Description_:
  14084. Determines the shape of an array.
  14085. _Standard_:
  14086. Fortran 90 and later, with KIND argument Fortran 2003 and later
  14087. _Class_:
  14088. Inquiry function
  14089. _Syntax_:
  14090. 'RESULT = SHAPE(SOURCE [, KIND])'
  14091. _Arguments_:
  14092. SOURCE Shall be an array or scalar of any type. If
  14093. SOURCE is a pointer it must be associated and
  14094. allocatable arrays must be allocated.
  14095. KIND (Optional) An 'INTEGER' initialization
  14096. expression indicating the kind parameter of the
  14097. result.
  14098. _Return value_:
  14099. An 'INTEGER' array of rank one with as many elements as SOURCE has
  14100. dimensions. The elements of the resulting array correspond to the
  14101. extend of SOURCE along the respective dimensions. If SOURCE is a
  14102. scalar, the result is the rank one array of size zero. If KIND is
  14103. absent, the return value has the default integer kind otherwise the
  14104. specified kind.
  14105. _Example_:
  14106. PROGRAM test_shape
  14107. INTEGER, DIMENSION(-1:1, -1:2) :: A
  14108. WRITE(*,*) SHAPE(A) ! (/ 3, 4 /)
  14109. WRITE(*,*) SIZE(SHAPE(42)) ! (/ /)
  14110. END PROGRAM
  14111. _See also_:
  14112. *note RESHAPE::, *note SIZE::
  14113. 
  14114. File: gfortran.info, Node: SHIFTA, Next: SHIFTL, Prev: SHAPE, Up: Intrinsic Procedures
  14115. 9.245 'SHIFTA' -- Right shift with fill
  14116. =======================================
  14117. _Description_:
  14118. 'SHIFTA' returns a value corresponding to I with all of the bits
  14119. shifted right by SHIFT places. SHIFT that be nonnegative and less
  14120. than or equal to 'BIT_SIZE(I)', otherwise the result value is
  14121. undefined. Bits shifted out from the right end are lost. The fill
  14122. is arithmetic: the bits shifted in from the left end are equal to
  14123. the leftmost bit, which in two's complement representation is the
  14124. sign bit.
  14125. _Standard_:
  14126. Fortran 2008 and later
  14127. _Class_:
  14128. Elemental function
  14129. _Syntax_:
  14130. 'RESULT = SHIFTA(I, SHIFT)'
  14131. _Arguments_:
  14132. I The type shall be 'INTEGER'.
  14133. SHIFT The type shall be 'INTEGER'.
  14134. _Return value_:
  14135. The return value is of type 'INTEGER' and of the same kind as I.
  14136. _See also_:
  14137. *note SHIFTL::, *note SHIFTR::
  14138. 
  14139. File: gfortran.info, Node: SHIFTL, Next: SHIFTR, Prev: SHIFTA, Up: Intrinsic Procedures
  14140. 9.246 'SHIFTL' -- Left shift
  14141. ============================
  14142. _Description_:
  14143. 'SHIFTL' returns a value corresponding to I with all of the bits
  14144. shifted left by SHIFT places. SHIFT shall be nonnegative and less
  14145. than or equal to 'BIT_SIZE(I)', otherwise the result value is
  14146. undefined. Bits shifted out from the left end are lost, and bits
  14147. shifted in from the right end are set to 0.
  14148. _Standard_:
  14149. Fortran 2008 and later
  14150. _Class_:
  14151. Elemental function
  14152. _Syntax_:
  14153. 'RESULT = SHIFTL(I, SHIFT)'
  14154. _Arguments_:
  14155. I The type shall be 'INTEGER'.
  14156. SHIFT The type shall be 'INTEGER'.
  14157. _Return value_:
  14158. The return value is of type 'INTEGER' and of the same kind as I.
  14159. _See also_:
  14160. *note SHIFTA::, *note SHIFTR::
  14161. 
  14162. File: gfortran.info, Node: SHIFTR, Next: SIGN, Prev: SHIFTL, Up: Intrinsic Procedures
  14163. 9.247 'SHIFTR' -- Right shift
  14164. =============================
  14165. _Description_:
  14166. 'SHIFTR' returns a value corresponding to I with all of the bits
  14167. shifted right by SHIFT places. SHIFT shall be nonnegative and less
  14168. than or equal to 'BIT_SIZE(I)', otherwise the result value is
  14169. undefined. Bits shifted out from the right end are lost, and bits
  14170. shifted in from the left end are set to 0.
  14171. _Standard_:
  14172. Fortran 2008 and later
  14173. _Class_:
  14174. Elemental function
  14175. _Syntax_:
  14176. 'RESULT = SHIFTR(I, SHIFT)'
  14177. _Arguments_:
  14178. I The type shall be 'INTEGER'.
  14179. SHIFT The type shall be 'INTEGER'.
  14180. _Return value_:
  14181. The return value is of type 'INTEGER' and of the same kind as I.
  14182. _See also_:
  14183. *note SHIFTA::, *note SHIFTL::
  14184. 
  14185. File: gfortran.info, Node: SIGN, Next: SIGNAL, Prev: SHIFTR, Up: Intrinsic Procedures
  14186. 9.248 'SIGN' -- Sign copying function
  14187. =====================================
  14188. _Description_:
  14189. 'SIGN(A,B)' returns the value of A with the sign of B.
  14190. _Standard_:
  14191. Fortran 77 and later
  14192. _Class_:
  14193. Elemental function
  14194. _Syntax_:
  14195. 'RESULT = SIGN(A, B)'
  14196. _Arguments_:
  14197. A Shall be of type 'INTEGER' or 'REAL'
  14198. B Shall be of the same type and kind as A.
  14199. _Return value_:
  14200. The kind of the return value is that of A and B. If B\ge 0 then
  14201. the result is 'ABS(A)', else it is '-ABS(A)'.
  14202. _Example_:
  14203. program test_sign
  14204. print *, sign(-12,1)
  14205. print *, sign(-12,0)
  14206. print *, sign(-12,-1)
  14207. print *, sign(-12.,1.)
  14208. print *, sign(-12.,0.)
  14209. print *, sign(-12.,-1.)
  14210. end program test_sign
  14211. _Specific names_:
  14212. Name Arguments Return type Standard
  14213. 'SIGN(A,B)' 'REAL(4) A, 'REAL(4)' Fortran 77 and
  14214. B' later
  14215. 'ISIGN(A,B)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and
  14216. A, B' later
  14217. 'DSIGN(A,B)' 'REAL(8) A, 'REAL(8)' Fortran 77 and
  14218. B' later
  14219. 
  14220. File: gfortran.info, Node: SIGNAL, Next: SIN, Prev: SIGN, Up: Intrinsic Procedures
  14221. 9.249 'SIGNAL' -- Signal handling subroutine (or function)
  14222. ==========================================================
  14223. _Description_:
  14224. 'SIGNAL(NUMBER, HANDLER [, STATUS])' causes external subroutine
  14225. HANDLER to be executed with a single integer argument when signal
  14226. NUMBER occurs. If HANDLER is an integer, it can be used to turn
  14227. off handling of signal NUMBER or revert to its default action. See
  14228. 'signal(2)'.
  14229. If 'SIGNAL' is called as a subroutine and the STATUS argument is
  14230. supplied, it is set to the value returned by 'signal(2)'.
  14231. _Standard_:
  14232. GNU extension
  14233. _Class_:
  14234. Subroutine, function
  14235. _Syntax_:
  14236. 'CALL SIGNAL(NUMBER, HANDLER [, STATUS])'
  14237. 'STATUS = SIGNAL(NUMBER, HANDLER)'
  14238. _Arguments_:
  14239. NUMBER Shall be a scalar integer, with 'INTENT(IN)'
  14240. HANDLER Signal handler ('INTEGER FUNCTION' or
  14241. 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
  14242. 'INTEGER'. It is 'INTENT(IN)'.
  14243. STATUS (Optional) STATUS shall be a scalar integer. It
  14244. has 'INTENT(OUT)'.
  14245. _Return value_:
  14246. The 'SIGNAL' function returns the value returned by 'signal(2)'.
  14247. _Example_:
  14248. program test_signal
  14249. intrinsic signal
  14250. external handler_print
  14251. call signal (12, handler_print)
  14252. call signal (10, 1)
  14253. call sleep (30)
  14254. end program test_signal
  14255. 
  14256. File: gfortran.info, Node: SIN, Next: SIND, Prev: SIGNAL, Up: Intrinsic Procedures
  14257. 9.250 'SIN' -- Sine function
  14258. ============================
  14259. _Description_:
  14260. 'SIN(X)' computes the sine of X.
  14261. _Standard_:
  14262. Fortran 77 and later
  14263. _Class_:
  14264. Elemental function
  14265. _Syntax_:
  14266. 'RESULT = SIN(X)'
  14267. _Arguments_:
  14268. X The type shall be 'REAL' or 'COMPLEX'.
  14269. _Return value_:
  14270. The return value has same type and kind as X.
  14271. _Example_:
  14272. program test_sin
  14273. real :: x = 0.0
  14274. x = sin(x)
  14275. end program test_sin
  14276. _Specific names_:
  14277. Name Argument Return type Standard
  14278. 'SIN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  14279. later
  14280. 'DSIN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  14281. later
  14282. 'CSIN(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and
  14283. X' later
  14284. 'ZSIN(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  14285. X'
  14286. 'CDSIN(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  14287. X'
  14288. _See also_:
  14289. Inverse function: *note ASIN:: Degrees function: *note SIND::
  14290. 
  14291. File: gfortran.info, Node: SIND, Next: SINH, Prev: SIN, Up: Intrinsic Procedures
  14292. 9.251 'SIND' -- Sine function, degrees
  14293. ======================================
  14294. _Description_:
  14295. 'SIND(X)' computes the sine of X in degrees.
  14296. This function is for compatibility only and should be avoided in
  14297. favor of standard constructs wherever possible.
  14298. _Standard_:
  14299. GNU extension, enabled with '-fdec-math'.
  14300. _Class_:
  14301. Elemental function
  14302. _Syntax_:
  14303. 'RESULT = SIND(X)'
  14304. _Arguments_:
  14305. X The type shall be 'REAL' or 'COMPLEX'.
  14306. _Return value_:
  14307. The return value has same type and kind as X, and its value is in
  14308. degrees.
  14309. _Example_:
  14310. program test_sind
  14311. real :: x = 0.0
  14312. x = sind(x)
  14313. end program test_sind
  14314. _Specific names_:
  14315. Name Argument Return type Standard
  14316. 'SIND(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  14317. 'DSIND(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  14318. 'CSIND(X)' 'COMPLEX(4) 'COMPLEX(4)' GNU extension
  14319. X'
  14320. 'ZSIND(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  14321. X'
  14322. 'CDSIND(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  14323. X'
  14324. _See also_:
  14325. Inverse function: *note ASIND:: Radians function: *note SIN::
  14326. 
  14327. File: gfortran.info, Node: SINH, Next: SIZE, Prev: SIND, Up: Intrinsic Procedures
  14328. 9.252 'SINH' -- Hyperbolic sine function
  14329. ========================================
  14330. _Description_:
  14331. 'SINH(X)' computes the hyperbolic sine of X.
  14332. _Standard_:
  14333. Fortran 90 and later, for a complex argument Fortran 2008 or later,
  14334. has a GNU extension
  14335. _Class_:
  14336. Elemental function
  14337. _Syntax_:
  14338. 'RESULT = SINH(X)'
  14339. _Arguments_:
  14340. X The type shall be 'REAL' or 'COMPLEX'.
  14341. _Return value_:
  14342. The return value has same type and kind as X.
  14343. _Example_:
  14344. program test_sinh
  14345. real(8) :: x = - 1.0_8
  14346. x = sinh(x)
  14347. end program test_sinh
  14348. _Specific names_:
  14349. Name Argument Return type Standard
  14350. 'DSINH(X)' 'REAL(8) X' 'REAL(8)' Fortran 90 and
  14351. later
  14352. _See also_:
  14353. *note ASINH::
  14354. 
  14355. File: gfortran.info, Node: SIZE, Next: SIZEOF, Prev: SINH, Up: Intrinsic Procedures
  14356. 9.253 'SIZE' -- Determine the size of an array
  14357. ==============================================
  14358. _Description_:
  14359. Determine the extent of ARRAY along a specified dimension DIM, or
  14360. the total number of elements in ARRAY if DIM is absent.
  14361. _Standard_:
  14362. Fortran 90 and later, with KIND argument Fortran 2003 and later
  14363. _Class_:
  14364. Inquiry function
  14365. _Syntax_:
  14366. 'RESULT = SIZE(ARRAY[, DIM [, KIND]])'
  14367. _Arguments_:
  14368. ARRAY Shall be an array of any type. If ARRAY is a
  14369. pointer it must be associated and allocatable
  14370. arrays must be allocated.
  14371. DIM (Optional) shall be a scalar of type 'INTEGER'
  14372. and its value shall be in the range from 1 to n,
  14373. where n equals the rank of ARRAY.
  14374. KIND (Optional) An 'INTEGER' initialization
  14375. expression indicating the kind parameter of the
  14376. result.
  14377. _Return value_:
  14378. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  14379. absent, the return value is of default integer kind.
  14380. _Example_:
  14381. PROGRAM test_size
  14382. WRITE(*,*) SIZE((/ 1, 2 /)) ! 2
  14383. END PROGRAM
  14384. _See also_:
  14385. *note SHAPE::, *note RESHAPE::
  14386. 
  14387. File: gfortran.info, Node: SIZEOF, Next: SLEEP, Prev: SIZE, Up: Intrinsic Procedures
  14388. 9.254 'SIZEOF' -- Size in bytes of an expression
  14389. ================================================
  14390. _Description_:
  14391. 'SIZEOF(X)' calculates the number of bytes of storage the
  14392. expression 'X' occupies.
  14393. _Standard_:
  14394. GNU extension
  14395. _Class_:
  14396. Inquiry function
  14397. _Syntax_:
  14398. 'N = SIZEOF(X)'
  14399. _Arguments_:
  14400. X The argument shall be of any type, rank or
  14401. shape.
  14402. _Return value_:
  14403. The return value is of type integer and of the system-dependent
  14404. kind C_SIZE_T (from the ISO_C_BINDING module). Its value is the
  14405. number of bytes occupied by the argument. If the argument has the
  14406. 'POINTER' attribute, the number of bytes of the storage area
  14407. pointed to is returned. If the argument is of a derived type with
  14408. 'POINTER' or 'ALLOCATABLE' components, the return value does not
  14409. account for the sizes of the data pointed to by these components.
  14410. If the argument is polymorphic, the size according to the dynamic
  14411. type is returned. The argument may not be a procedure or procedure
  14412. pointer. Note that the code assumes for arrays that those are
  14413. contiguous; for contiguous arrays, it returns the storage or an
  14414. array element multiplied by the size of the array.
  14415. _Example_:
  14416. integer :: i
  14417. real :: r, s(5)
  14418. print *, (sizeof(s)/sizeof(r) == 5)
  14419. end
  14420. The example will print '.TRUE.' unless you are using a platform
  14421. where default 'REAL' variables are unusually padded.
  14422. _See also_:
  14423. *note C_SIZEOF::, *note STORAGE_SIZE::
  14424. 
  14425. File: gfortran.info, Node: SLEEP, Next: SPACING, Prev: SIZEOF, Up: Intrinsic Procedures
  14426. 9.255 'SLEEP' -- Sleep for the specified number of seconds
  14427. ==========================================================
  14428. _Description_:
  14429. Calling this subroutine causes the process to pause for SECONDS
  14430. seconds.
  14431. _Standard_:
  14432. GNU extension
  14433. _Class_:
  14434. Subroutine
  14435. _Syntax_:
  14436. 'CALL SLEEP(SECONDS)'
  14437. _Arguments_:
  14438. SECONDS The type shall be of default 'INTEGER'.
  14439. _Example_:
  14440. program test_sleep
  14441. call sleep(5)
  14442. end
  14443. 
  14444. File: gfortran.info, Node: SPACING, Next: SPREAD, Prev: SLEEP, Up: Intrinsic Procedures
  14445. 9.256 'SPACING' -- Smallest distance between two numbers of a given type
  14446. ========================================================================
  14447. _Description_:
  14448. Determines the distance between the argument X and the nearest
  14449. adjacent number of the same type.
  14450. _Standard_:
  14451. Fortran 90 and later
  14452. _Class_:
  14453. Elemental function
  14454. _Syntax_:
  14455. 'RESULT = SPACING(X)'
  14456. _Arguments_:
  14457. X Shall be of type 'REAL'.
  14458. _Return value_:
  14459. The result is of the same type as the input argument X.
  14460. _Example_:
  14461. PROGRAM test_spacing
  14462. INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37)
  14463. INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200)
  14464. WRITE(*,*) spacing(1.0_SGL) ! "1.1920929E-07" on i686
  14465. WRITE(*,*) spacing(1.0_DBL) ! "2.220446049250313E-016" on i686
  14466. END PROGRAM
  14467. _See also_:
  14468. *note RRSPACING::
  14469. 
  14470. File: gfortran.info, Node: SPREAD, Next: SQRT, Prev: SPACING, Up: Intrinsic Procedures
  14471. 9.257 'SPREAD' -- Add a dimension to an array
  14472. =============================================
  14473. _Description_:
  14474. Replicates a SOURCE array NCOPIES times along a specified dimension
  14475. DIM.
  14476. _Standard_:
  14477. Fortran 90 and later
  14478. _Class_:
  14479. Transformational function
  14480. _Syntax_:
  14481. 'RESULT = SPREAD(SOURCE, DIM, NCOPIES)'
  14482. _Arguments_:
  14483. SOURCE Shall be a scalar or an array of any type and a
  14484. rank less than seven.
  14485. DIM Shall be a scalar of type 'INTEGER' with a value
  14486. in the range from 1 to n+1, where n equals the
  14487. rank of SOURCE.
  14488. NCOPIES Shall be a scalar of type 'INTEGER'.
  14489. _Return value_:
  14490. The result is an array of the same type as SOURCE and has rank n+1
  14491. where n equals the rank of SOURCE.
  14492. _Example_:
  14493. PROGRAM test_spread
  14494. INTEGER :: a = 1, b(2) = (/ 1, 2 /)
  14495. WRITE(*,*) SPREAD(A, 1, 2) ! "1 1"
  14496. WRITE(*,*) SPREAD(B, 1, 2) ! "1 1 2 2"
  14497. END PROGRAM
  14498. _See also_:
  14499. *note UNPACK::
  14500. 
  14501. File: gfortran.info, Node: SQRT, Next: SRAND, Prev: SPREAD, Up: Intrinsic Procedures
  14502. 9.258 'SQRT' -- Square-root function
  14503. ====================================
  14504. _Description_:
  14505. 'SQRT(X)' computes the square root of X.
  14506. _Standard_:
  14507. Fortran 77 and later
  14508. _Class_:
  14509. Elemental function
  14510. _Syntax_:
  14511. 'RESULT = SQRT(X)'
  14512. _Arguments_:
  14513. X The type shall be 'REAL' or 'COMPLEX'.
  14514. _Return value_:
  14515. The return value is of type 'REAL' or 'COMPLEX'. The kind type
  14516. parameter is the same as X.
  14517. _Example_:
  14518. program test_sqrt
  14519. real(8) :: x = 2.0_8
  14520. complex :: z = (1.0, 2.0)
  14521. x = sqrt(x)
  14522. z = sqrt(z)
  14523. end program test_sqrt
  14524. _Specific names_:
  14525. Name Argument Return type Standard
  14526. 'SQRT(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  14527. later
  14528. 'DSQRT(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  14529. later
  14530. 'CSQRT(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and
  14531. X' later
  14532. 'ZSQRT(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  14533. X'
  14534. 'CDSQRT(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  14535. X'
  14536. 
  14537. File: gfortran.info, Node: SRAND, Next: STAT, Prev: SQRT, Up: Intrinsic Procedures
  14538. 9.259 'SRAND' -- Reinitialize the random number generator
  14539. =========================================================
  14540. _Description_:
  14541. 'SRAND' reinitializes the pseudo-random number generator called by
  14542. 'RAND' and 'IRAND'. The new seed used by the generator is
  14543. specified by the required argument SEED.
  14544. _Standard_:
  14545. GNU extension
  14546. _Class_:
  14547. Subroutine
  14548. _Syntax_:
  14549. 'CALL SRAND(SEED)'
  14550. _Arguments_:
  14551. SEED Shall be a scalar 'INTEGER(kind=4)'.
  14552. _Return value_:
  14553. Does not return anything.
  14554. _Example_:
  14555. See 'RAND' and 'IRAND' for examples.
  14556. _Notes_:
  14557. The Fortran standard specifies the intrinsic subroutines
  14558. 'RANDOM_SEED' to initialize the pseudo-random number generator and
  14559. 'RANDOM_NUMBER' to generate pseudo-random numbers. These
  14560. subroutines should be used in new codes.
  14561. Please note that in GNU Fortran, these two sets of intrinsics
  14562. ('RAND', 'IRAND' and 'SRAND' on the one hand, 'RANDOM_NUMBER' and
  14563. 'RANDOM_SEED' on the other hand) access two independent
  14564. pseudo-random number generators.
  14565. _See also_:
  14566. *note RAND::, *note RANDOM_SEED::, *note RANDOM_NUMBER::
  14567. 
  14568. File: gfortran.info, Node: STAT, Next: STORAGE_SIZE, Prev: SRAND, Up: Intrinsic Procedures
  14569. 9.260 'STAT' -- Get file status
  14570. ===============================
  14571. _Description_:
  14572. This function returns information about a file. No permissions are
  14573. required on the file itself, but execute (search) permission is
  14574. required on all of the directories in path that lead to the file.
  14575. The elements that are obtained and stored in the array 'VALUES':
  14576. 'VALUES(1)' Device ID
  14577. 'VALUES(2)' Inode number
  14578. 'VALUES(3)' File mode
  14579. 'VALUES(4)' Number of links
  14580. 'VALUES(5)' Owner's uid
  14581. 'VALUES(6)' Owner's gid
  14582. 'VALUES(7)' ID of device containing directory entry for file
  14583. (0 if not available)
  14584. 'VALUES(8)' File size (bytes)
  14585. 'VALUES(9)' Last access time
  14586. 'VALUES(10)'Last modification time
  14587. 'VALUES(11)'Last file status change time
  14588. 'VALUES(12)'Preferred I/O block size (-1 if not available)
  14589. 'VALUES(13)'Number of blocks allocated (-1 if not available)
  14590. Not all these elements are relevant on all systems. If an element
  14591. is not relevant, it is returned as 0.
  14592. This intrinsic is provided in both subroutine and function forms;
  14593. however, only one form can be used in any given program unit.
  14594. _Standard_:
  14595. GNU extension
  14596. _Class_:
  14597. Subroutine, function
  14598. _Syntax_:
  14599. 'CALL STAT(NAME, VALUES [, STATUS])'
  14600. 'STATUS = STAT(NAME, VALUES)'
  14601. _Arguments_:
  14602. NAME The type shall be 'CHARACTER', of the default
  14603. kind and a valid path within the file system.
  14604. VALUES The type shall be 'INTEGER(4), DIMENSION(13)'.
  14605. STATUS (Optional) status flag of type 'INTEGER(4)'.
  14606. Returns 0 on success and a system specific error
  14607. code otherwise.
  14608. _Example_:
  14609. PROGRAM test_stat
  14610. INTEGER, DIMENSION(13) :: buff
  14611. INTEGER :: status
  14612. CALL STAT("/etc/passwd", buff, status)
  14613. IF (status == 0) THEN
  14614. WRITE (*, FMT="('Device ID:', T30, I19)") buff(1)
  14615. WRITE (*, FMT="('Inode number:', T30, I19)") buff(2)
  14616. WRITE (*, FMT="('File mode (octal):', T30, O19)") buff(3)
  14617. WRITE (*, FMT="('Number of links:', T30, I19)") buff(4)
  14618. WRITE (*, FMT="('Owner''s uid:', T30, I19)") buff(5)
  14619. WRITE (*, FMT="('Owner''s gid:', T30, I19)") buff(6)
  14620. WRITE (*, FMT="('Device where located:', T30, I19)") buff(7)
  14621. WRITE (*, FMT="('File size:', T30, I19)") buff(8)
  14622. WRITE (*, FMT="('Last access time:', T30, A19)") CTIME(buff(9))
  14623. WRITE (*, FMT="('Last modification time', T30, A19)") CTIME(buff(10))
  14624. WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11))
  14625. WRITE (*, FMT="('Preferred block size:', T30, I19)") buff(12)
  14626. WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13)
  14627. END IF
  14628. END PROGRAM
  14629. _See also_:
  14630. To stat an open file: *note FSTAT:: To stat a link: *note LSTAT::
  14631. 
  14632. File: gfortran.info, Node: STORAGE_SIZE, Next: SUM, Prev: STAT, Up: Intrinsic Procedures
  14633. 9.261 'STORAGE_SIZE' -- Storage size in bits
  14634. ============================================
  14635. _Description_:
  14636. Returns the storage size of argument A in bits.
  14637. _Standard_:
  14638. Fortran 2008 and later
  14639. _Class_:
  14640. Inquiry function
  14641. _Syntax_:
  14642. 'RESULT = STORAGE_SIZE(A [, KIND])'
  14643. _Arguments_:
  14644. A Shall be a scalar or array of any type.
  14645. KIND (Optional) shall be a scalar integer constant
  14646. expression.
  14647. _Return Value_:
  14648. The result is a scalar integer with the kind type parameter
  14649. specified by KIND (or default integer type if KIND is missing).
  14650. The result value is the size expressed in bits for an element of an
  14651. array that has the dynamic type and type parameters of A.
  14652. _See also_:
  14653. *note C_SIZEOF::, *note SIZEOF::
  14654. 
  14655. File: gfortran.info, Node: SUM, Next: SYMLNK, Prev: STORAGE_SIZE, Up: Intrinsic Procedures
  14656. 9.262 'SUM' -- Sum of array elements
  14657. ====================================
  14658. _Description_:
  14659. Adds the elements of ARRAY along dimension DIM if the corresponding
  14660. element in MASK is 'TRUE'.
  14661. _Standard_:
  14662. Fortran 90 and later
  14663. _Class_:
  14664. Transformational function
  14665. _Syntax_:
  14666. 'RESULT = SUM(ARRAY[, MASK])'
  14667. 'RESULT = SUM(ARRAY, DIM[, MASK])'
  14668. _Arguments_:
  14669. ARRAY Shall be an array of type 'INTEGER', 'REAL' or
  14670. 'COMPLEX'.
  14671. DIM (Optional) shall be a scalar of type 'INTEGER'
  14672. with a value in the range from 1 to n, where n
  14673. equals the rank of ARRAY.
  14674. MASK (Optional) shall be of type 'LOGICAL' and either
  14675. be a scalar or an array of the same shape as
  14676. ARRAY.
  14677. _Return value_:
  14678. The result is of the same type as ARRAY.
  14679. If DIM is absent, a scalar with the sum of all elements in ARRAY is
  14680. returned. Otherwise, an array of rank n-1, where n equals the rank
  14681. of ARRAY, and a shape similar to that of ARRAY with dimension DIM
  14682. dropped is returned.
  14683. _Example_:
  14684. PROGRAM test_sum
  14685. INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
  14686. print *, SUM(x) ! all elements, sum = 15
  14687. print *, SUM(x, MASK=MOD(x, 2)==1) ! odd elements, sum = 9
  14688. END PROGRAM
  14689. _See also_:
  14690. *note PRODUCT::
  14691. 
  14692. File: gfortran.info, Node: SYMLNK, Next: SYSTEM, Prev: SUM, Up: Intrinsic Procedures
  14693. 9.263 'SYMLNK' -- Create a symbolic link
  14694. ========================================
  14695. _Description_:
  14696. Makes a symbolic link from file PATH1 to PATH2. A null character
  14697. ('CHAR(0)') can be used to mark the end of the names in PATH1 and
  14698. PATH2; otherwise, trailing blanks in the file names are ignored.
  14699. If the STATUS argument is supplied, it contains 0 on success or a
  14700. nonzero error code upon return; see 'symlink(2)'. If the system
  14701. does not supply 'symlink(2)', 'ENOSYS' is returned.
  14702. This intrinsic is provided in both subroutine and function forms;
  14703. however, only one form can be used in any given program unit.
  14704. _Standard_:
  14705. GNU extension
  14706. _Class_:
  14707. Subroutine, function
  14708. _Syntax_:
  14709. 'CALL SYMLNK(PATH1, PATH2 [, STATUS])'
  14710. 'STATUS = SYMLNK(PATH1, PATH2)'
  14711. _Arguments_:
  14712. PATH1 Shall be of default 'CHARACTER' type.
  14713. PATH2 Shall be of default 'CHARACTER' type.
  14714. STATUS (Optional) Shall be of default 'INTEGER' type.
  14715. _See also_:
  14716. *note LINK::, *note UNLINK::
  14717. 
  14718. File: gfortran.info, Node: SYSTEM, Next: SYSTEM_CLOCK, Prev: SYMLNK, Up: Intrinsic Procedures
  14719. 9.264 'SYSTEM' -- Execute a shell command
  14720. =========================================
  14721. _Description_:
  14722. Passes the command COMMAND to a shell (see 'system(3)'). If
  14723. argument STATUS is present, it contains the value returned by
  14724. 'system(3)', which is presumably 0 if the shell command succeeded.
  14725. Note that which shell is used to invoke the command is
  14726. system-dependent and environment-dependent.
  14727. This intrinsic is provided in both subroutine and function forms;
  14728. however, only one form can be used in any given program unit.
  14729. Note that the 'system' function need not be thread-safe. It is the
  14730. responsibility of the user to ensure that 'system' is not called
  14731. concurrently.
  14732. _Standard_:
  14733. GNU extension
  14734. _Class_:
  14735. Subroutine, function
  14736. _Syntax_:
  14737. 'CALL SYSTEM(COMMAND [, STATUS])'
  14738. 'STATUS = SYSTEM(COMMAND)'
  14739. _Arguments_:
  14740. COMMAND Shall be of default 'CHARACTER' type.
  14741. STATUS (Optional) Shall be of default 'INTEGER' type.
  14742. _See also_:
  14743. *note EXECUTE_COMMAND_LINE::, which is part of the Fortran 2008
  14744. standard and should considered in new code for future portability.
  14745. 
  14746. File: gfortran.info, Node: SYSTEM_CLOCK, Next: TAN, Prev: SYSTEM, Up: Intrinsic Procedures
  14747. 9.265 'SYSTEM_CLOCK' -- Time function
  14748. =====================================
  14749. _Description_:
  14750. Determines the COUNT of a processor clock since an unspecified time
  14751. in the past modulo COUNT_MAX, COUNT_RATE determines the number of
  14752. clock ticks per second. If the platform supports a monotonic
  14753. clock, that clock is used and can, depending on the platform clock
  14754. implementation, provide up to nanosecond resolution. If a
  14755. monotonic clock is not available, the implementation falls back to
  14756. a realtime clock.
  14757. COUNT_RATE is system dependent and can vary depending on the kind
  14758. of the arguments. For KIND=4 arguments (and smaller integer
  14759. kinds), COUNT represents milliseconds, while for KIND=8 arguments
  14760. (and larger integer kinds), COUNT typically represents micro- or
  14761. nanoseconds depending on resolution of the underlying platform
  14762. clock. COUNT_MAX usually equals 'HUGE(COUNT_MAX)'. Note that the
  14763. millisecond resolution of the KIND=4 version implies that the COUNT
  14764. will wrap around in roughly 25 days. In order to avoid issues with
  14765. the wrap around and for more precise timing, please use the KIND=8
  14766. version.
  14767. If there is no clock, or querying the clock fails, COUNT is set to
  14768. '-HUGE(COUNT)', and COUNT_RATE and COUNT_MAX are set to zero.
  14769. When running on a platform using the GNU C library (glibc) version
  14770. 2.16 or older, or a derivative thereof, the high resolution
  14771. monotonic clock is available only when linking with the RT library.
  14772. This can be done explicitly by adding the '-lrt' flag when linking
  14773. the application, but is also done implicitly when using OpenMP.
  14774. On the Windows platform, the version with KIND=4 arguments uses the
  14775. 'GetTickCount' function, whereas the KIND=8 version uses
  14776. 'QueryPerformanceCounter' and 'QueryPerformanceCounterFrequency'.
  14777. For more information, and potential caveats, please see the
  14778. platform documentation.
  14779. _Standard_:
  14780. Fortran 90 and later
  14781. _Class_:
  14782. Subroutine
  14783. _Syntax_:
  14784. 'CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])'
  14785. _Arguments_:
  14786. COUNT (Optional) shall be a scalar of type
  14787. 'INTEGER' with 'INTENT(OUT)'.
  14788. COUNT_RATE (Optional) shall be a scalar of type
  14789. 'INTEGER' or 'REAL', with 'INTENT(OUT)'.
  14790. COUNT_MAX (Optional) shall be a scalar of type
  14791. 'INTEGER' with 'INTENT(OUT)'.
  14792. _Example_:
  14793. PROGRAM test_system_clock
  14794. INTEGER :: count, count_rate, count_max
  14795. CALL SYSTEM_CLOCK(count, count_rate, count_max)
  14796. WRITE(*,*) count, count_rate, count_max
  14797. END PROGRAM
  14798. _See also_:
  14799. *note DATE_AND_TIME::, *note CPU_TIME::
  14800. 
  14801. File: gfortran.info, Node: TAN, Next: TAND, Prev: SYSTEM_CLOCK, Up: Intrinsic Procedures
  14802. 9.266 'TAN' -- Tangent function
  14803. ===============================
  14804. _Description_:
  14805. 'TAN(X)' computes the tangent of X.
  14806. _Standard_:
  14807. Fortran 77 and later, for a complex argument Fortran 2008 or later
  14808. _Class_:
  14809. Elemental function
  14810. _Syntax_:
  14811. 'RESULT = TAN(X)'
  14812. _Arguments_:
  14813. X The type shall be 'REAL' or 'COMPLEX'.
  14814. _Return value_:
  14815. The return value has same type and kind as X, and its value is in
  14816. radians.
  14817. _Example_:
  14818. program test_tan
  14819. real(8) :: x = 0.165_8
  14820. x = tan(x)
  14821. end program test_tan
  14822. _Specific names_:
  14823. Name Argument Return type Standard
  14824. 'TAN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  14825. later
  14826. 'DTAN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  14827. later
  14828. _See also_:
  14829. Inverse function: *note ATAN:: Degrees function: *note TAND::
  14830. 
  14831. File: gfortran.info, Node: TAND, Next: TANH, Prev: TAN, Up: Intrinsic Procedures
  14832. 9.267 'TAND' -- Tangent function, degrees
  14833. =========================================
  14834. _Description_:
  14835. 'TAND(X)' computes the tangent of X in degrees.
  14836. This function is for compatibility only and should be avoided in
  14837. favor of standard constructs wherever possible.
  14838. _Standard_:
  14839. GNU extension, enabled with '-fdec-math'.
  14840. _Class_:
  14841. Elemental function
  14842. _Syntax_:
  14843. 'RESULT = TAND(X)'
  14844. _Arguments_:
  14845. X The type shall be 'REAL' or 'COMPLEX'.
  14846. _Return value_:
  14847. The return value has same type and kind as X, and its value is in
  14848. degrees.
  14849. _Example_:
  14850. program test_tand
  14851. real(8) :: x = 0.165_8
  14852. x = tand(x)
  14853. end program test_tand
  14854. _Specific names_:
  14855. Name Argument Return type Standard
  14856. 'TAND(X)' 'REAL(4) X' 'REAL(4)' GNU extension
  14857. 'DTAND(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  14858. _See also_:
  14859. Inverse function: *note ATAND:: Radians function: *note TAN::
  14860. 
  14861. File: gfortran.info, Node: TANH, Next: THIS_IMAGE, Prev: TAND, Up: Intrinsic Procedures
  14862. 9.268 'TANH' -- Hyperbolic tangent function
  14863. ===========================================
  14864. _Description_:
  14865. 'TANH(X)' computes the hyperbolic tangent of X.
  14866. _Standard_:
  14867. Fortran 77 and later, for a complex argument Fortran 2008 or later
  14868. _Class_:
  14869. Elemental function
  14870. _Syntax_:
  14871. 'X = TANH(X)'
  14872. _Arguments_:
  14873. X The type shall be 'REAL' or 'COMPLEX'.
  14874. _Return value_:
  14875. The return value has same type and kind as X. If X is complex, the
  14876. imaginary part of the result is in radians. If X is 'REAL', the
  14877. return value lies in the range - 1 \leq tanh(x) \leq 1 .
  14878. _Example_:
  14879. program test_tanh
  14880. real(8) :: x = 2.1_8
  14881. x = tanh(x)
  14882. end program test_tanh
  14883. _Specific names_:
  14884. Name Argument Return type Standard
  14885. 'TANH(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  14886. later
  14887. 'DTANH(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  14888. later
  14889. _See also_:
  14890. *note ATANH::
  14891. 
  14892. File: gfortran.info, Node: THIS_IMAGE, Next: TIME, Prev: TANH, Up: Intrinsic Procedures
  14893. 9.269 'THIS_IMAGE' -- Function that returns the cosubscript index of this image
  14894. ===============================================================================
  14895. _Description_:
  14896. Returns the cosubscript for this image.
  14897. _Standard_:
  14898. Fortran 2008 and later. With DISTANCE argument, Technical
  14899. Specification (TS) 18508 or later
  14900. _Class_:
  14901. Transformational function
  14902. _Syntax_:
  14903. 'RESULT = THIS_IMAGE()'
  14904. 'RESULT = THIS_IMAGE(DISTANCE)'
  14905. 'RESULT = THIS_IMAGE(COARRAY [, DIM])'
  14906. _Arguments_:
  14907. DISTANCE (optional, intent(in)) Nonnegative scalar
  14908. integer (not permitted together with COARRAY).
  14909. COARRAY Coarray of any type (optional; if DIM present,
  14910. required).
  14911. DIM default integer scalar (optional). If present,
  14912. DIM shall be between one and the corank of
  14913. COARRAY.
  14914. _Return value_:
  14915. Default integer. If COARRAY is not present, it is scalar; if
  14916. DISTANCE is not present or has value 0, its value is the image
  14917. index on the invoking image for the current team, for values
  14918. smaller or equal distance to the initial team, it returns the image
  14919. index on the ancestor team which has a distance of DISTANCE from
  14920. the invoking team. If DISTANCE is larger than the distance to the
  14921. initial team, the image index of the initial team is returned.
  14922. Otherwise when the COARRAY is present, if DIM is not present, a
  14923. rank-1 array with corank elements is returned, containing the
  14924. cosubscripts for COARRAY specifying the invoking image. If DIM is
  14925. present, a scalar is returned, with the value of the DIM element of
  14926. 'THIS_IMAGE(COARRAY)'.
  14927. _Example_:
  14928. INTEGER :: value[*]
  14929. INTEGER :: i
  14930. value = THIS_IMAGE()
  14931. SYNC ALL
  14932. IF (THIS_IMAGE() == 1) THEN
  14933. DO i = 1, NUM_IMAGES()
  14934. WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
  14935. END DO
  14936. END IF
  14937. ! Check whether the current image is the initial image
  14938. IF (THIS_IMAGE(HUGE(1)) /= THIS_IMAGE())
  14939. error stop "something is rotten here"
  14940. _See also_:
  14941. *note NUM_IMAGES::, *note IMAGE_INDEX::
  14942. 
  14943. File: gfortran.info, Node: TIME, Next: TIME8, Prev: THIS_IMAGE, Up: Intrinsic Procedures
  14944. 9.270 'TIME' -- Time function
  14945. =============================
  14946. _Description_:
  14947. Returns the current time encoded as an integer (in the manner of
  14948. the function 'time(3)' in the C standard library). This value is
  14949. suitable for passing to *note CTIME::, *note GMTIME::, and *note
  14950. LTIME::.
  14951. This intrinsic is not fully portable, such as to systems with
  14952. 32-bit 'INTEGER' types but supporting times wider than 32 bits.
  14953. Therefore, the values returned by this intrinsic might be, or
  14954. become, negative, or numerically less than previous values, during
  14955. a single run of the compiled program.
  14956. See *note TIME8::, for information on a similar intrinsic that
  14957. might be portable to more GNU Fortran implementations, though to
  14958. fewer Fortran compilers.
  14959. _Standard_:
  14960. GNU extension
  14961. _Class_:
  14962. Function
  14963. _Syntax_:
  14964. 'RESULT = TIME()'
  14965. _Return value_:
  14966. The return value is a scalar of type 'INTEGER(4)'.
  14967. _See also_:
  14968. *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
  14969. LTIME::, *note MCLOCK::, *note TIME8::
  14970. 
  14971. File: gfortran.info, Node: TIME8, Next: TINY, Prev: TIME, Up: Intrinsic Procedures
  14972. 9.271 'TIME8' -- Time function (64-bit)
  14973. =======================================
  14974. _Description_:
  14975. Returns the current time encoded as an integer (in the manner of
  14976. the function 'time(3)' in the C standard library). This value is
  14977. suitable for passing to *note CTIME::, *note GMTIME::, and *note
  14978. LTIME::.
  14979. _Warning:_ this intrinsic does not increase the range of the timing
  14980. values over that returned by 'time(3)'. On a system with a 32-bit
  14981. 'time(3)', 'TIME8' will return a 32-bit value, even though it is
  14982. converted to a 64-bit 'INTEGER(8)' value. That means overflows of
  14983. the 32-bit value can still occur. Therefore, the values returned
  14984. by this intrinsic might be or become negative or numerically less
  14985. than previous values during a single run of the compiled program.
  14986. _Standard_:
  14987. GNU extension
  14988. _Class_:
  14989. Function
  14990. _Syntax_:
  14991. 'RESULT = TIME8()'
  14992. _Return value_:
  14993. The return value is a scalar of type 'INTEGER(8)'.
  14994. _See also_:
  14995. *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
  14996. LTIME::, *note MCLOCK8::, *note TIME::
  14997. 
  14998. File: gfortran.info, Node: TINY, Next: TRAILZ, Prev: TIME8, Up: Intrinsic Procedures
  14999. 9.272 'TINY' -- Smallest positive number of a real kind
  15000. =======================================================
  15001. _Description_:
  15002. 'TINY(X)' returns the smallest positive (non zero) number in the
  15003. model of the type of 'X'.
  15004. _Standard_:
  15005. Fortran 90 and later
  15006. _Class_:
  15007. Inquiry function
  15008. _Syntax_:
  15009. 'RESULT = TINY(X)'
  15010. _Arguments_:
  15011. X Shall be of type 'REAL'.
  15012. _Return value_:
  15013. The return value is of the same type and kind as X
  15014. _Example_:
  15015. See 'HUGE' for an example.
  15016. 
  15017. File: gfortran.info, Node: TRAILZ, Next: TRANSFER, Prev: TINY, Up: Intrinsic Procedures
  15018. 9.273 'TRAILZ' -- Number of trailing zero bits of an integer
  15019. ============================================================
  15020. _Description_:
  15021. 'TRAILZ' returns the number of trailing zero bits of an integer.
  15022. _Standard_:
  15023. Fortran 2008 and later
  15024. _Class_:
  15025. Elemental function
  15026. _Syntax_:
  15027. 'RESULT = TRAILZ(I)'
  15028. _Arguments_:
  15029. I Shall be of type 'INTEGER'.
  15030. _Return value_:
  15031. The type of the return value is the default 'INTEGER'. If all the
  15032. bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
  15033. _Example_:
  15034. PROGRAM test_trailz
  15035. WRITE (*,*) TRAILZ(8) ! prints 3
  15036. END PROGRAM
  15037. _See also_:
  15038. *note BIT_SIZE::, *note LEADZ::, *note POPPAR::, *note POPCNT::
  15039. 
  15040. File: gfortran.info, Node: TRANSFER, Next: TRANSPOSE, Prev: TRAILZ, Up: Intrinsic Procedures
  15041. 9.274 'TRANSFER' -- Transfer bit patterns
  15042. =========================================
  15043. _Description_:
  15044. Interprets the bitwise representation of SOURCE in memory as if it
  15045. is the representation of a variable or array of the same type and
  15046. type parameters as MOLD.
  15047. This is approximately equivalent to the C concept of _casting_ one
  15048. type to another.
  15049. _Standard_:
  15050. Fortran 90 and later
  15051. _Class_:
  15052. Transformational function
  15053. _Syntax_:
  15054. 'RESULT = TRANSFER(SOURCE, MOLD[, SIZE])'
  15055. _Arguments_:
  15056. SOURCE Shall be a scalar or an array of any type.
  15057. MOLD Shall be a scalar or an array of any type.
  15058. SIZE (Optional) shall be a scalar of type 'INTEGER'.
  15059. _Return value_:
  15060. The result has the same type as MOLD, with the bit level
  15061. representation of SOURCE. If SIZE is present, the result is a
  15062. one-dimensional array of length SIZE. If SIZE is absent but MOLD
  15063. is an array (of any size or shape), the result is a one-
  15064. dimensional array of the minimum length needed to contain the
  15065. entirety of the bitwise representation of SOURCE. If SIZE is
  15066. absent and MOLD is a scalar, the result is a scalar.
  15067. If the bitwise representation of the result is longer than that of
  15068. SOURCE, then the leading bits of the result correspond to those of
  15069. SOURCE and any trailing bits are filled arbitrarily.
  15070. When the resulting bit representation does not correspond to a
  15071. valid representation of a variable of the same type as MOLD, the
  15072. results are undefined, and subsequent operations on the result
  15073. cannot be guaranteed to produce sensible behavior. For example, it
  15074. is possible to create 'LOGICAL' variables for which 'VAR' and
  15075. '.NOT.VAR' both appear to be true.
  15076. _Example_:
  15077. PROGRAM test_transfer
  15078. integer :: x = 2143289344
  15079. print *, transfer(x, 1.0) ! prints "NaN" on i686
  15080. END PROGRAM
  15081. 
  15082. File: gfortran.info, Node: TRANSPOSE, Next: TRIM, Prev: TRANSFER, Up: Intrinsic Procedures
  15083. 9.275 'TRANSPOSE' -- Transpose an array of rank two
  15084. ===================================================
  15085. _Description_:
  15086. Transpose an array of rank two. Element (i, j) of the result has
  15087. the value 'MATRIX(j, i)', for all i, j.
  15088. _Standard_:
  15089. Fortran 90 and later
  15090. _Class_:
  15091. Transformational function
  15092. _Syntax_:
  15093. 'RESULT = TRANSPOSE(MATRIX)'
  15094. _Arguments_:
  15095. MATRIX Shall be an array of any type and have a rank of
  15096. two.
  15097. _Return value_:
  15098. The result has the same type as MATRIX, and has shape '(/ m, n /)'
  15099. if MATRIX has shape '(/ n, m /)'.
  15100. 
  15101. File: gfortran.info, Node: TRIM, Next: TTYNAM, Prev: TRANSPOSE, Up: Intrinsic Procedures
  15102. 9.276 'TRIM' -- Remove trailing blank characters of a string
  15103. ============================================================
  15104. _Description_:
  15105. Removes trailing blank characters of a string.
  15106. _Standard_:
  15107. Fortran 90 and later
  15108. _Class_:
  15109. Transformational function
  15110. _Syntax_:
  15111. 'RESULT = TRIM(STRING)'
  15112. _Arguments_:
  15113. STRING Shall be a scalar of type 'CHARACTER'.
  15114. _Return value_:
  15115. A scalar of type 'CHARACTER' which length is that of STRING less
  15116. the number of trailing blanks.
  15117. _Example_:
  15118. PROGRAM test_trim
  15119. CHARACTER(len=10), PARAMETER :: s = "GFORTRAN "
  15120. WRITE(*,*) LEN(s), LEN(TRIM(s)) ! "10 8", with/without trailing blanks
  15121. END PROGRAM
  15122. _See also_:
  15123. *note ADJUSTL::, *note ADJUSTR::
  15124. 
  15125. File: gfortran.info, Node: TTYNAM, Next: UBOUND, Prev: TRIM, Up: Intrinsic Procedures
  15126. 9.277 'TTYNAM' -- Get the name of a terminal device.
  15127. ====================================================
  15128. _Description_:
  15129. Get the name of a terminal device. For more information, see
  15130. 'ttyname(3)'.
  15131. This intrinsic is provided in both subroutine and function forms;
  15132. however, only one form can be used in any given program unit.
  15133. _Standard_:
  15134. GNU extension
  15135. _Class_:
  15136. Subroutine, function
  15137. _Syntax_:
  15138. 'CALL TTYNAM(UNIT, NAME)'
  15139. 'NAME = TTYNAM(UNIT)'
  15140. _Arguments_:
  15141. UNIT Shall be a scalar 'INTEGER'.
  15142. NAME Shall be of type 'CHARACTER'.
  15143. _Example_:
  15144. PROGRAM test_ttynam
  15145. INTEGER :: unit
  15146. DO unit = 1, 10
  15147. IF (isatty(unit=unit)) write(*,*) ttynam(unit)
  15148. END DO
  15149. END PROGRAM
  15150. _See also_:
  15151. *note ISATTY::
  15152. 
  15153. File: gfortran.info, Node: UBOUND, Next: UCOBOUND, Prev: TTYNAM, Up: Intrinsic Procedures
  15154. 9.278 'UBOUND' -- Upper dimension bounds of an array
  15155. ====================================================
  15156. _Description_:
  15157. Returns the upper bounds of an array, or a single upper bound along
  15158. the DIM dimension.
  15159. _Standard_:
  15160. Fortran 90 and later, with KIND argument Fortran 2003 and later
  15161. _Class_:
  15162. Inquiry function
  15163. _Syntax_:
  15164. 'RESULT = UBOUND(ARRAY [, DIM [, KIND]])'
  15165. _Arguments_:
  15166. ARRAY Shall be an array, of any type.
  15167. DIM (Optional) Shall be a scalar 'INTEGER'.
  15168. KIND (Optional) An 'INTEGER' initialization
  15169. expression indicating the kind parameter of the
  15170. result.
  15171. _Return value_:
  15172. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  15173. absent, the return value is of default integer kind. If DIM is
  15174. absent, the result is an array of the upper bounds of ARRAY. If
  15175. DIM is present, the result is a scalar corresponding to the upper
  15176. bound of the array along that dimension. If ARRAY is an expression
  15177. rather than a whole array or array structure component, or if it
  15178. has a zero extent along the relevant dimension, the upper bound is
  15179. taken to be the number of elements along the relevant dimension.
  15180. _See also_:
  15181. *note LBOUND::, *note LCOBOUND::
  15182. 
  15183. File: gfortran.info, Node: UCOBOUND, Next: UMASK, Prev: UBOUND, Up: Intrinsic Procedures
  15184. 9.279 'UCOBOUND' -- Upper codimension bounds of an array
  15185. ========================================================
  15186. _Description_:
  15187. Returns the upper cobounds of a coarray, or a single upper cobound
  15188. along the DIM codimension.
  15189. _Standard_:
  15190. Fortran 2008 and later
  15191. _Class_:
  15192. Inquiry function
  15193. _Syntax_:
  15194. 'RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])'
  15195. _Arguments_:
  15196. ARRAY Shall be an coarray, of any type.
  15197. DIM (Optional) Shall be a scalar 'INTEGER'.
  15198. KIND (Optional) An 'INTEGER' initialization
  15199. expression indicating the kind parameter of the
  15200. result.
  15201. _Return value_:
  15202. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  15203. absent, the return value is of default integer kind. If DIM is
  15204. absent, the result is an array of the lower cobounds of COARRAY.
  15205. If DIM is present, the result is a scalar corresponding to the
  15206. lower cobound of the array along that codimension.
  15207. _See also_:
  15208. *note LCOBOUND::, *note LBOUND::
  15209. 
  15210. File: gfortran.info, Node: UMASK, Next: UNLINK, Prev: UCOBOUND, Up: Intrinsic Procedures
  15211. 9.280 'UMASK' -- Set the file creation mask
  15212. ===========================================
  15213. _Description_:
  15214. Sets the file creation mask to MASK. If called as a function, it
  15215. returns the old value. If called as a subroutine and argument OLD
  15216. if it is supplied, it is set to the old value. See 'umask(2)'.
  15217. _Standard_:
  15218. GNU extension
  15219. _Class_:
  15220. Subroutine, function
  15221. _Syntax_:
  15222. 'CALL UMASK(MASK [, OLD])'
  15223. 'OLD = UMASK(MASK)'
  15224. _Arguments_:
  15225. MASK Shall be a scalar of type 'INTEGER'.
  15226. OLD (Optional) Shall be a scalar of type 'INTEGER'.
  15227. 
  15228. File: gfortran.info, Node: UNLINK, Next: UNPACK, Prev: UMASK, Up: Intrinsic Procedures
  15229. 9.281 'UNLINK' -- Remove a file from the file system
  15230. ====================================================
  15231. _Description_:
  15232. Unlinks the file PATH. A null character ('CHAR(0)') can be used to
  15233. mark the end of the name in PATH; otherwise, trailing blanks in the
  15234. file name are ignored. If the STATUS argument is supplied, it
  15235. contains 0 on success or a nonzero error code upon return; see
  15236. 'unlink(2)'.
  15237. This intrinsic is provided in both subroutine and function forms;
  15238. however, only one form can be used in any given program unit.
  15239. _Standard_:
  15240. GNU extension
  15241. _Class_:
  15242. Subroutine, function
  15243. _Syntax_:
  15244. 'CALL UNLINK(PATH [, STATUS])'
  15245. 'STATUS = UNLINK(PATH)'
  15246. _Arguments_:
  15247. PATH Shall be of default 'CHARACTER' type.
  15248. STATUS (Optional) Shall be of default 'INTEGER' type.
  15249. _See also_:
  15250. *note LINK::, *note SYMLNK::
  15251. 
  15252. File: gfortran.info, Node: UNPACK, Next: VERIFY, Prev: UNLINK, Up: Intrinsic Procedures
  15253. 9.282 'UNPACK' -- Unpack an array of rank one into an array
  15254. ===========================================================
  15255. _Description_:
  15256. Store the elements of VECTOR in an array of higher rank.
  15257. _Standard_:
  15258. Fortran 90 and later
  15259. _Class_:
  15260. Transformational function
  15261. _Syntax_:
  15262. 'RESULT = UNPACK(VECTOR, MASK, FIELD)'
  15263. _Arguments_:
  15264. VECTOR Shall be an array of any type and rank one. It
  15265. shall have at least as many elements as MASK has
  15266. 'TRUE' values.
  15267. MASK Shall be an array of type 'LOGICAL'.
  15268. FIELD Shall be of the same type as VECTOR and have the
  15269. same shape as MASK.
  15270. _Return value_:
  15271. The resulting array corresponds to FIELD with 'TRUE' elements of
  15272. MASK replaced by values from VECTOR in array element order.
  15273. _Example_:
  15274. PROGRAM test_unpack
  15275. integer :: vector(2) = (/1,1/)
  15276. logical :: mask(4) = (/ .TRUE., .FALSE., .FALSE., .TRUE. /)
  15277. integer :: field(2,2) = 0, unity(2,2)
  15278. ! result: unity matrix
  15279. unity = unpack(vector, reshape(mask, (/2,2/)), field)
  15280. END PROGRAM
  15281. _See also_:
  15282. *note PACK::, *note SPREAD::
  15283. 
  15284. File: gfortran.info, Node: VERIFY, Next: XOR, Prev: UNPACK, Up: Intrinsic Procedures
  15285. 9.283 'VERIFY' -- Scan a string for characters not a given set
  15286. ==============================================================
  15287. _Description_:
  15288. Verifies that all the characters in STRING belong to the set of
  15289. characters in SET.
  15290. If BACK is either absent or equals 'FALSE', this function returns
  15291. the position of the leftmost character of STRING that is not in
  15292. SET. If BACK equals 'TRUE', the rightmost position is returned.
  15293. If all characters of STRING are found in SET, the result is zero.
  15294. _Standard_:
  15295. Fortran 90 and later, with KIND argument Fortran 2003 and later
  15296. _Class_:
  15297. Elemental function
  15298. _Syntax_:
  15299. 'RESULT = VERIFY(STRING, SET[, BACK [, KIND]])'
  15300. _Arguments_:
  15301. STRING Shall be of type 'CHARACTER'.
  15302. SET Shall be of type 'CHARACTER'.
  15303. BACK (Optional) shall be of type 'LOGICAL'.
  15304. KIND (Optional) An 'INTEGER' initialization
  15305. expression indicating the kind parameter of the
  15306. result.
  15307. _Return value_:
  15308. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  15309. absent, the return value is of default integer kind.
  15310. _Example_:
  15311. PROGRAM test_verify
  15312. WRITE(*,*) VERIFY("FORTRAN", "AO") ! 1, found 'F'
  15313. WRITE(*,*) VERIFY("FORTRAN", "FOO") ! 3, found 'R'
  15314. WRITE(*,*) VERIFY("FORTRAN", "C++") ! 1, found 'F'
  15315. WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.) ! 7, found 'N'
  15316. WRITE(*,*) VERIFY("FORTRAN", "FORTRAN") ! 0' found none
  15317. END PROGRAM
  15318. _See also_:
  15319. *note SCAN::, *note INDEX intrinsic::
  15320. 
  15321. File: gfortran.info, Node: XOR, Prev: VERIFY, Up: Intrinsic Procedures
  15322. 9.284 'XOR' -- Bitwise logical exclusive OR
  15323. ===========================================
  15324. _Description_:
  15325. Bitwise logical exclusive or.
  15326. This intrinsic routine is provided for backwards compatibility with
  15327. GNU Fortran 77. For integer arguments, programmers should consider
  15328. the use of the *note IEOR:: intrinsic and for logical arguments the
  15329. '.NEQV.' operator, which are both defined by the Fortran standard.
  15330. _Standard_:
  15331. GNU extension
  15332. _Class_:
  15333. Function
  15334. _Syntax_:
  15335. 'RESULT = XOR(I, J)'
  15336. _Arguments_:
  15337. I The type shall be either a scalar 'INTEGER' type
  15338. or a scalar 'LOGICAL' type or a
  15339. boz-literal-constant.
  15340. J The type shall be the same as the type of I or a
  15341. boz-literal-constant. I and J shall not both be
  15342. boz-literal-constants. If either I and J is a
  15343. boz-literal-constant, then the other argument
  15344. must be a scalar 'INTEGER'.
  15345. _Return value_:
  15346. The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
  15347. If the kind type parameters differ, then the smaller kind type is
  15348. implicitly converted to larger kind, and the return has the larger
  15349. kind. A boz-literal-constant is converted to an 'INTEGER' with the
  15350. kind type parameter of the other argument as-if a call to *note
  15351. INT:: occurred.
  15352. _Example_:
  15353. PROGRAM test_xor
  15354. LOGICAL :: T = .TRUE., F = .FALSE.
  15355. INTEGER :: a, b
  15356. DATA a / Z'F' /, b / Z'3' /
  15357. WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F)
  15358. WRITE (*,*) XOR(a, b)
  15359. END PROGRAM
  15360. _See also_:
  15361. Fortran 95 elemental function: *note IEOR::
  15362. 
  15363. File: gfortran.info, Node: Intrinsic Modules, Next: Contributing, Prev: Intrinsic Procedures, Up: Top
  15364. 10 Intrinsic Modules
  15365. ********************
  15366. * Menu:
  15367. * ISO_FORTRAN_ENV::
  15368. * ISO_C_BINDING::
  15369. * IEEE modules::
  15370. * OpenMP Modules OMP_LIB and OMP_LIB_KINDS::
  15371. * OpenACC Module OPENACC::
  15372. 
  15373. File: gfortran.info, Node: ISO_FORTRAN_ENV, Next: ISO_C_BINDING, Up: Intrinsic Modules
  15374. 10.1 'ISO_FORTRAN_ENV'
  15375. ======================
  15376. _Standard_:
  15377. Fortran 2003 and later, except when otherwise noted
  15378. The 'ISO_FORTRAN_ENV' module provides the following scalar
  15379. default-integer named constants:
  15380. 'ATOMIC_INT_KIND':
  15381. Default-kind integer constant to be used as kind parameter when
  15382. defining integer variables used in atomic operations. (Fortran
  15383. 2008 or later.)
  15384. 'ATOMIC_LOGICAL_KIND':
  15385. Default-kind integer constant to be used as kind parameter when
  15386. defining logical variables used in atomic operations. (Fortran
  15387. 2008 or later.)
  15388. 'CHARACTER_KINDS':
  15389. Default-kind integer constant array of rank one containing the
  15390. supported kind parameters of the 'CHARACTER' type. (Fortran 2008
  15391. or later.)
  15392. 'CHARACTER_STORAGE_SIZE':
  15393. Size in bits of the character storage unit.
  15394. 'ERROR_UNIT':
  15395. Identifies the preconnected unit used for error reporting.
  15396. 'FILE_STORAGE_SIZE':
  15397. Size in bits of the file-storage unit.
  15398. 'INPUT_UNIT':
  15399. Identifies the preconnected unit identified by the asterisk ('*')
  15400. in 'READ' statement.
  15401. 'INT8', 'INT16', 'INT32', 'INT64':
  15402. Kind type parameters to specify an INTEGER type with a storage size
  15403. of 16, 32, and 64 bits. It is negative if a target platform does
  15404. not support the particular kind. (Fortran 2008 or later.)
  15405. 'INTEGER_KINDS':
  15406. Default-kind integer constant array of rank one containing the
  15407. supported kind parameters of the 'INTEGER' type. (Fortran 2008 or
  15408. later.)
  15409. 'IOSTAT_END':
  15410. The value assigned to the variable passed to the 'IOSTAT='
  15411. specifier of an input/output statement if an end-of-file condition
  15412. occurred.
  15413. 'IOSTAT_EOR':
  15414. The value assigned to the variable passed to the 'IOSTAT='
  15415. specifier of an input/output statement if an end-of-record
  15416. condition occurred.
  15417. 'IOSTAT_INQUIRE_INTERNAL_UNIT':
  15418. Scalar default-integer constant, used by 'INQUIRE' for the
  15419. 'IOSTAT=' specifier to denote an that a unit number identifies an
  15420. internal unit. (Fortran 2008 or later.)
  15421. 'NUMERIC_STORAGE_SIZE':
  15422. The size in bits of the numeric storage unit.
  15423. 'LOGICAL_KINDS':
  15424. Default-kind integer constant array of rank one containing the
  15425. supported kind parameters of the 'LOGICAL' type. (Fortran 2008 or
  15426. later.)
  15427. 'OUTPUT_UNIT':
  15428. Identifies the preconnected unit identified by the asterisk ('*')
  15429. in 'WRITE' statement.
  15430. 'REAL32', 'REAL64', 'REAL128':
  15431. Kind type parameters to specify a REAL type with a storage size of
  15432. 32, 64, and 128 bits. It is negative if a target platform does not
  15433. support the particular kind. (Fortran 2008 or later.)
  15434. 'REAL_KINDS':
  15435. Default-kind integer constant array of rank one containing the
  15436. supported kind parameters of the 'REAL' type. (Fortran 2008 or
  15437. later.)
  15438. 'STAT_LOCKED':
  15439. Scalar default-integer constant used as STAT= return value by
  15440. 'LOCK' to denote that the lock variable is locked by the executing
  15441. image. (Fortran 2008 or later.)
  15442. 'STAT_LOCKED_OTHER_IMAGE':
  15443. Scalar default-integer constant used as STAT= return value by
  15444. 'UNLOCK' to denote that the lock variable is locked by another
  15445. image. (Fortran 2008 or later.)
  15446. 'STAT_STOPPED_IMAGE':
  15447. Positive, scalar default-integer constant used as STAT= return
  15448. value if the argument in the statement requires synchronisation
  15449. with an image, which has initiated the termination of the
  15450. execution. (Fortran 2008 or later.)
  15451. 'STAT_FAILED_IMAGE':
  15452. Positive, scalar default-integer constant used as STAT= return
  15453. value if the argument in the statement requires communication with
  15454. an image, which has is in the failed state. (TS 18508 or later.)
  15455. 'STAT_UNLOCKED':
  15456. Scalar default-integer constant used as STAT= return value by
  15457. 'UNLOCK' to denote that the lock variable is unlocked. (Fortran
  15458. 2008 or later.)
  15459. The module provides the following derived type:
  15460. 'LOCK_TYPE':
  15461. Derived type with private components to be use with the 'LOCK' and
  15462. 'UNLOCK' statement. A variable of its type has to be always
  15463. declared as coarray and may not appear in a variable-definition
  15464. context. (Fortran 2008 or later.)
  15465. The module also provides the following intrinsic procedures: *note
  15466. COMPILER_OPTIONS:: and *note COMPILER_VERSION::.
  15467. 
  15468. File: gfortran.info, Node: ISO_C_BINDING, Next: IEEE modules, Prev: ISO_FORTRAN_ENV, Up: Intrinsic Modules
  15469. 10.2 'ISO_C_BINDING'
  15470. ====================
  15471. _Standard_:
  15472. Fortran 2003 and later, GNU extensions
  15473. The following intrinsic procedures are provided by the module; their
  15474. definition can be found in the section Intrinsic Procedures of this
  15475. manual.
  15476. 'C_ASSOCIATED'
  15477. 'C_F_POINTER'
  15478. 'C_F_PROCPOINTER'
  15479. 'C_FUNLOC'
  15480. 'C_LOC'
  15481. 'C_SIZEOF'
  15482. The 'ISO_C_BINDING' module provides the following named constants of
  15483. type default integer, which can be used as KIND type parameters.
  15484. In addition to the integer named constants required by the Fortran
  15485. 2003 standard and 'C_PTRDIFF_T' of TS 29113, GNU Fortran provides as an
  15486. extension named constants for the 128-bit integer types supported by the
  15487. C compiler: 'C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T'.
  15488. Furthermore, if '__float128' is supported in C, the named constants
  15489. 'C_FLOAT128, C_FLOAT128_COMPLEX' are defined.
  15490. Fortran Named constant C type Extension
  15491. Type
  15492. 'INTEGER' 'C_INT' 'int'
  15493. 'INTEGER' 'C_SHORT' 'short int'
  15494. 'INTEGER' 'C_LONG' 'long int'
  15495. 'INTEGER' 'C_LONG_LONG' 'long long int'
  15496. 'INTEGER' 'C_SIGNED_CHAR' 'signed char'/'unsigned
  15497. char'
  15498. 'INTEGER' 'C_SIZE_T' 'size_t'
  15499. 'INTEGER' 'C_INT8_T' 'int8_t'
  15500. 'INTEGER' 'C_INT16_T' 'int16_t'
  15501. 'INTEGER' 'C_INT32_T' 'int32_t'
  15502. 'INTEGER' 'C_INT64_T' 'int64_t'
  15503. 'INTEGER' 'C_INT128_T' 'int128_t' Ext.
  15504. 'INTEGER' 'C_INT_LEAST8_T' 'int_least8_t'
  15505. 'INTEGER' 'C_INT_LEAST16_T' 'int_least16_t'
  15506. 'INTEGER' 'C_INT_LEAST32_T' 'int_least32_t'
  15507. 'INTEGER' 'C_INT_LEAST64_T' 'int_least64_t'
  15508. 'INTEGER' 'C_INT_LEAST128_T' 'int_least128_t' Ext.
  15509. 'INTEGER' 'C_INT_FAST8_T' 'int_fast8_t'
  15510. 'INTEGER' 'C_INT_FAST16_T' 'int_fast16_t'
  15511. 'INTEGER' 'C_INT_FAST32_T' 'int_fast32_t'
  15512. 'INTEGER' 'C_INT_FAST64_T' 'int_fast64_t'
  15513. 'INTEGER' 'C_INT_FAST128_T' 'int_fast128_t' Ext.
  15514. 'INTEGER' 'C_INTMAX_T' 'intmax_t'
  15515. 'INTEGER' 'C_INTPTR_T' 'intptr_t'
  15516. 'INTEGER' 'C_PTRDIFF_T' 'ptrdiff_t' TS 29113
  15517. 'REAL' 'C_FLOAT' 'float'
  15518. 'REAL' 'C_DOUBLE' 'double'
  15519. 'REAL' 'C_LONG_DOUBLE' 'long double'
  15520. 'REAL' 'C_FLOAT128' '__float128' Ext.
  15521. 'COMPLEX' 'C_FLOAT_COMPLEX' 'float _Complex'
  15522. 'COMPLEX' 'C_DOUBLE_COMPLEX' 'double _Complex'
  15523. 'COMPLEX' 'C_LONG_DOUBLE_COMPLEX' 'long double _Complex'
  15524. 'REAL' 'C_FLOAT128_COMPLEX' '__float128 _Complex' Ext.
  15525. 'LOGICAL' 'C_BOOL' '_Bool'
  15526. 'CHARACTER' 'C_CHAR' 'char'
  15527. Additionally, the following parameters of type
  15528. 'CHARACTER(KIND=C_CHAR)' are defined.
  15529. Name C definition Value
  15530. 'C_NULL_CHAR' null character ''\0''
  15531. 'C_ALERT' alert ''\a''
  15532. 'C_BACKSPACE' backspace ''\b''
  15533. 'C_FORM_FEED' form feed ''\f''
  15534. 'C_NEW_LINE' new line ''\n''
  15535. 'C_CARRIAGE_RETURN'carriage return ''\r''
  15536. 'C_HORIZONTAL_TAB'horizontal tab ''\t''
  15537. 'C_VERTICAL_TAB'vertical tab ''\v''
  15538. Moreover, the following two named constants are defined:
  15539. Name Type
  15540. 'C_NULL_PTR' 'C_PTR'
  15541. 'C_NULL_FUNPTR''C_FUNPTR'
  15542. Both are equivalent to the value 'NULL' in C.
  15543. 
  15544. File: gfortran.info, Node: IEEE modules, Next: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Prev: ISO_C_BINDING, Up: Intrinsic Modules
  15545. 10.3 IEEE modules: 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
  15546. ============================================================================
  15547. _Standard_:
  15548. Fortran 2003 and later
  15549. The 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
  15550. intrinsic modules provide support for exceptions and IEEE arithmetic, as
  15551. defined in Fortran 2003 and later standards, and the IEC 60559:1989
  15552. standard (_Binary floating-point arithmetic for microprocessor
  15553. systems_). These modules are only provided on the following supported
  15554. platforms:
  15555. * i386 and x86_64 processors
  15556. * platforms which use the GNU C Library (glibc)
  15557. * platforms with support for SysV/386 routines for floating point
  15558. interface (including Solaris and BSDs)
  15559. * platforms with the AIX OS
  15560. For full compliance with the Fortran standards, code using the
  15561. 'IEEE_EXCEPTIONS' or 'IEEE_ARITHMETIC' modules should be compiled with
  15562. the following options: '-fno-unsafe-math-optimizations -frounding-math
  15563. -fsignaling-nans'.
  15564. 
  15565. File: gfortran.info, Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Next: OpenACC Module OPENACC, Prev: IEEE modules, Up: Intrinsic Modules
  15566. 10.4 OpenMP Modules 'OMP_LIB' and 'OMP_LIB_KINDS'
  15567. =================================================
  15568. _Standard_:
  15569. OpenMP Application Program Interface v4.5
  15570. The OpenMP Fortran runtime library routines are provided both in a
  15571. form of two Fortran 90 modules, named 'OMP_LIB' and 'OMP_LIB_KINDS', and
  15572. in a form of a Fortran 'include' file named 'omp_lib.h'. The procedures
  15573. provided by 'OMP_LIB' can be found in the *note Introduction:
  15574. (libgomp)Top. manual, the named constants defined in the modules are
  15575. listed below.
  15576. For details refer to the actual OpenMP Application Program Interface
  15577. v4.5 (http://www.openmp.org/wp-content/uploads/openmp-4.5.pdf). And for
  15578. the 'pause'-related constants to the OpenMP 5.0 specification.
  15579. 'OMP_LIB_KINDS' provides the following scalar default-integer named
  15580. constants:
  15581. 'omp_lock_kind'
  15582. 'omp_lock_hint_kind'
  15583. 'omp_nest_lock_kind'
  15584. 'omp_pause_resource_kind'
  15585. 'omp_proc_bind_kind'
  15586. 'omp_sched_kind'
  15587. 'OMP_LIB' provides the scalar default-integer named constant
  15588. 'openmp_version' with a value of the form YYYYMM, where 'yyyy' is the
  15589. year and MM the month of the OpenMP version; for OpenMP v4.5 the value
  15590. is '201511'.
  15591. The following scalar integer named constants of the kind
  15592. 'omp_sched_kind':
  15593. 'omp_sched_static'
  15594. 'omp_sched_dynamic'
  15595. 'omp_sched_guided'
  15596. 'omp_sched_auto'
  15597. And the following scalar integer named constants of the kind
  15598. 'omp_proc_bind_kind':
  15599. 'omp_proc_bind_false'
  15600. 'omp_proc_bind_true'
  15601. 'omp_proc_bind_master'
  15602. 'omp_proc_bind_close'
  15603. 'omp_proc_bind_spread'
  15604. The following scalar integer named constants are of the kind
  15605. 'omp_lock_hint_kind':
  15606. 'omp_lock_hint_none'
  15607. 'omp_lock_hint_uncontended'
  15608. 'omp_lock_hint_contended'
  15609. 'omp_lock_hint_nonspeculative'
  15610. 'omp_lock_hint_speculative'
  15611. And the following two scalar integer named constants are of the kind
  15612. 'omp_pause_resource_kind':
  15613. 'omp_pause_soft'
  15614. 'omp_pause_hard'
  15615. 
  15616. File: gfortran.info, Node: OpenACC Module OPENACC, Prev: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Up: Intrinsic Modules
  15617. 10.5 OpenACC Module 'OPENACC'
  15618. =============================
  15619. _Standard_:
  15620. OpenACC Application Programming Interface v2.6
  15621. The OpenACC Fortran runtime library routines are provided both in a
  15622. form of a Fortran 90 module, named 'OPENACC', and in form of a Fortran
  15623. 'include' file named 'openacc_lib.h'. The procedures provided by
  15624. 'OPENACC' can be found in the *note Introduction: (libgomp)Top. manual,
  15625. the named constants defined in the modules are listed below.
  15626. For details refer to the actual OpenACC Application Programming
  15627. Interface v2.6 (http://www.openacc.org/).
  15628. 'OPENACC' provides the scalar default-integer named constant
  15629. 'openacc_version' with a value of the form YYYYMM, where 'yyyy' is the
  15630. year and MM the month of the OpenACC version; for OpenACC v2.6 the value
  15631. is '201711'.
  15632. 
  15633. File: gfortran.info, Node: Contributing, Next: Copying, Prev: Intrinsic Modules, Up: Top
  15634. Contributing
  15635. ************
  15636. Free software is only possible if people contribute to efforts to create
  15637. it. We're always in need of more people helping out with ideas and
  15638. comments, writing documentation and contributing code.
  15639. If you want to contribute to GNU Fortran, have a look at the long
  15640. lists of projects you can take on. Some of these projects are small,
  15641. some of them are large; some are completely orthogonal to the rest of
  15642. what is happening on GNU Fortran, but others are "mainstream" projects
  15643. in need of enthusiastic hackers. All of these projects are important!
  15644. We will eventually get around to the things here, but they are also
  15645. things doable by someone who is willing and able.
  15646. * Menu:
  15647. * Contributors::
  15648. * Projects::
  15649. * Proposed Extensions::
  15650. 
  15651. File: gfortran.info, Node: Contributors, Next: Projects, Up: Contributing
  15652. Contributors to GNU Fortran
  15653. ===========================
  15654. Most of the parser was hand-crafted by _Andy Vaught_, who is also the
  15655. initiator of the whole project. Thanks Andy! Most of the interface
  15656. with GCC was written by _Paul Brook_.
  15657. The following individuals have contributed code and/or ideas and
  15658. significant help to the GNU Fortran project (in alphabetical order):
  15659. - Janne Blomqvist
  15660. - Steven Bosscher
  15661. - Paul Brook
  15662. - Tobias Burnus
  15663. - Franc,ois-Xavier Coudert
  15664. - Bud Davis
  15665. - Jerry DeLisle
  15666. - Erik Edelmann
  15667. - Bernhard Fischer
  15668. - Daniel Franke
  15669. - Richard Guenther
  15670. - Richard Henderson
  15671. - Katherine Holcomb
  15672. - Jakub Jelinek
  15673. - Niels Kristian Bech Jensen
  15674. - Steven Johnson
  15675. - Steven G. Kargl
  15676. - Thomas Koenig
  15677. - Asher Langton
  15678. - H. J. Lu
  15679. - Toon Moene
  15680. - Brooks Moses
  15681. - Andrew Pinski
  15682. - Tim Prince
  15683. - Christopher D. Rickett
  15684. - Richard Sandiford
  15685. - Tobias Schlu"ter
  15686. - Roger Sayle
  15687. - Paul Thomas
  15688. - Andy Vaught
  15689. - Feng Wang
  15690. - Janus Weil
  15691. - Daniel Kraft
  15692. The following people have contributed bug reports, smaller or larger
  15693. patches, and much needed feedback and encouragement for the GNU Fortran
  15694. project:
  15695. - Bill Clodius
  15696. - Dominique d'Humie`res
  15697. - Kate Hedstrom
  15698. - Erik Schnetter
  15699. - Joost VandeVondele
  15700. Many other individuals have helped debug, test and improve the GNU
  15701. Fortran compiler over the past few years, and we welcome you to do the
  15702. same! If you already have done so, and you would like to see your name
  15703. listed in the list above, please contact us.
  15704. 
  15705. File: gfortran.info, Node: Projects, Next: Proposed Extensions, Prev: Contributors, Up: Contributing
  15706. Projects
  15707. ========
  15708. _Help build the test suite_
  15709. Solicit more code for donation to the test suite: the more
  15710. extensive the testsuite, the smaller the risk of breaking things in
  15711. the future! We can keep code private on request.
  15712. _Bug hunting/squishing_
  15713. Find bugs and write more test cases! Test cases are especially
  15714. very welcome, because it allows us to concentrate on fixing bugs
  15715. instead of isolating them. Going through the bugzilla database at
  15716. <https://gcc.gnu.org/bugzilla/> to reduce testcases posted there
  15717. and add more information (for example, for which version does the
  15718. testcase work, for which versions does it fail?) is also very
  15719. helpful.
  15720. 
  15721. File: gfortran.info, Node: Proposed Extensions, Prev: Projects, Up: Contributing
  15722. Proposed Extensions
  15723. ===================
  15724. Here's a list of proposed extensions for the GNU Fortran compiler, in no
  15725. particular order. Most of these are necessary to be fully compatible
  15726. with existing Fortran compilers, but they are not part of the official
  15727. J3 Fortran 95 standard.
  15728. Compiler extensions:
  15729. --------------------
  15730. * User-specified alignment rules for structures.
  15731. * Automatically extend single precision constants to double.
  15732. * Compile code that conserves memory by dynamically allocating common
  15733. and module storage either on stack or heap.
  15734. * Compile flag to generate code for array conformance checking
  15735. (suggest -CC).
  15736. * User control of symbol names (underscores, etc).
  15737. * Compile setting for maximum size of stack frame size before
  15738. spilling parts to static or heap.
  15739. * Flag to force local variables into static space.
  15740. * Flag to force local variables onto stack.
  15741. Environment Options
  15742. -------------------
  15743. * Pluggable library modules for random numbers, linear algebra. LA
  15744. should use BLAS calling conventions.
  15745. * Environment variables controlling actions on arithmetic exceptions
  15746. like overflow, underflow, precision loss--Generate NaN, abort,
  15747. default. action.
  15748. * Set precision for fp units that support it (i387).
  15749. * Variable for setting fp rounding mode.
  15750. * Variable to fill uninitialized variables with a user-defined bit
  15751. pattern.
  15752. * Environment variable controlling filename that is opened for that
  15753. unit number.
  15754. * Environment variable to clear/trash memory being freed.
  15755. * Environment variable to control tracing of allocations and frees.
  15756. * Environment variable to display allocated memory at normal program
  15757. end.
  15758. * Environment variable for filename for * IO-unit.
  15759. * Environment variable for temporary file directory.
  15760. * Environment variable forcing standard output to be line buffered
  15761. (Unix).
  15762. 
  15763. File: gfortran.info, Node: Copying, Next: GNU Free Documentation License, Prev: Contributing, Up: Top
  15764. GNU General Public License
  15765. **************************
  15766. Version 3, 29 June 2007
  15767. Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
  15768. Everyone is permitted to copy and distribute verbatim copies of this
  15769. license document, but changing it is not allowed.
  15770. Preamble
  15771. ========
  15772. The GNU General Public License is a free, copyleft license for software
  15773. and other kinds of works.
  15774. The licenses for most software and other practical works are designed
  15775. to take away your freedom to share and change the works. By contrast,
  15776. the GNU General Public License is intended to guarantee your freedom to
  15777. share and change all versions of a program-to make sure it remains free
  15778. software for all its users. We, the Free Software Foundation, use the
  15779. GNU General Public License for most of our software; it applies also to
  15780. any other work released this way by its authors. You can apply it to
  15781. your programs, too.
  15782. When we speak of free software, we are referring to freedom, not
  15783. price. Our General Public Licenses are designed to make sure that you
  15784. have the freedom to distribute copies of free software (and charge for
  15785. them if you wish), that you receive source code or can get it if you
  15786. want it, that you can change the software or use pieces of it in new
  15787. free programs, and that you know you can do these things.
  15788. To protect your rights, we need to prevent others from denying you
  15789. these rights or asking you to surrender the rights. Therefore, you have
  15790. certain responsibilities if you distribute copies of the software, or if
  15791. you modify it: responsibilities to respect the freedom of others.
  15792. For example, if you distribute copies of such a program, whether
  15793. gratis or for a fee, you must pass on to the recipients the same
  15794. freedoms that you received. You must make sure that they, too, receive
  15795. or can get the source code. And you must show them these terms so they
  15796. know their rights.
  15797. Developers that use the GNU GPL protect your rights with two steps:
  15798. (1) assert copyright on the software, and (2) offer you this License
  15799. giving you legal permission to copy, distribute and/or modify it.
  15800. For the developers' and authors' protection, the GPL clearly explains
  15801. that there is no warranty for this free software. For both users' and
  15802. authors' sake, the GPL requires that modified versions be marked as
  15803. changed, so that their problems will not be attributed erroneously to
  15804. authors of previous versions.
  15805. Some devices are designed to deny users access to install or run
  15806. modified versions of the software inside them, although the manufacturer
  15807. can do so. This is fundamentally incompatible with the aim of
  15808. protecting users' freedom to change the software. The systematic
  15809. pattern of such abuse occurs in the area of products for individuals to
  15810. use, which is precisely where it is most unacceptable. Therefore, we
  15811. have designed this version of the GPL to prohibit the practice for those
  15812. products. If such problems arise substantially in other domains, we
  15813. stand ready to extend this provision to those domains in future versions
  15814. of the GPL, as needed to protect the freedom of users.
  15815. Finally, every program is threatened constantly by software patents.
  15816. States should not allow patents to restrict development and use of
  15817. software on general-purpose computers, but in those that do, we wish to
  15818. avoid the special danger that patents applied to a free program could
  15819. make it effectively proprietary. To prevent this, the GPL assures that
  15820. patents cannot be used to render the program non-free.
  15821. The precise terms and conditions for copying, distribution and
  15822. modification follow.
  15823. TERMS AND CONDITIONS
  15824. ====================
  15825. 0. Definitions.
  15826. "This License" refers to version 3 of the GNU General Public
  15827. License.
  15828. "Copyright" also means copyright-like laws that apply to other
  15829. kinds of works, such as semiconductor masks.
  15830. "The Program" refers to any copyrightable work licensed under this
  15831. License. Each licensee is addressed as "you". "Licensees" and
  15832. "recipients" may be individuals or organizations.
  15833. To "modify" a work means to copy from or adapt all or part of the
  15834. work in a fashion requiring copyright permission, other than the
  15835. making of an exact copy. The resulting work is called a "modified
  15836. version" of the earlier work or a work "based on" the earlier work.
  15837. A "covered work" means either the unmodified Program or a work
  15838. based on the Program.
  15839. To "propagate" a work means to do anything with it that, without
  15840. permission, would make you directly or secondarily liable for
  15841. infringement under applicable copyright law, except executing it on
  15842. a computer or modifying a private copy. Propagation includes
  15843. copying, distribution (with or without modification), making
  15844. available to the public, and in some countries other activities as
  15845. well.
  15846. To "convey" a work means any kind of propagation that enables other
  15847. parties to make or receive copies. Mere interaction with a user
  15848. through a computer network, with no transfer of a copy, is not
  15849. conveying.
  15850. An interactive user interface displays "Appropriate Legal Notices"
  15851. to the extent that it includes a convenient and prominently visible
  15852. feature that (1) displays an appropriate copyright notice, and (2)
  15853. tells the user that there is no warranty for the work (except to
  15854. the extent that warranties are provided), that licensees may convey
  15855. the work under this License, and how to view a copy of this
  15856. License. If the interface presents a list of user commands or
  15857. options, such as a menu, a prominent item in the list meets this
  15858. criterion.
  15859. 1. Source Code.
  15860. The "source code" for a work means the preferred form of the work
  15861. for making modifications to it. "Object code" means any non-source
  15862. form of a work.
  15863. A "Standard Interface" means an interface that either is an
  15864. official standard defined by a recognized standards body, or, in
  15865. the case of interfaces specified for a particular programming
  15866. language, one that is widely used among developers working in that
  15867. language.
  15868. The "System Libraries" of an executable work include anything,
  15869. other than the work as a whole, that (a) is included in the normal
  15870. form of packaging a Major Component, but which is not part of that
  15871. Major Component, and (b) serves only to enable use of the work with
  15872. that Major Component, or to implement a Standard Interface for
  15873. which an implementation is available to the public in source code
  15874. form. A "Major Component", in this context, means a major
  15875. essential component (kernel, window system, and so on) of the
  15876. specific operating system (if any) on which the executable work
  15877. runs, or a compiler used to produce the work, or an object code
  15878. interpreter used to run it.
  15879. The "Corresponding Source" for a work in object code form means all
  15880. the source code needed to generate, install, and (for an executable
  15881. work) run the object code and to modify the work, including scripts
  15882. to control those activities. However, it does not include the
  15883. work's System Libraries, or general-purpose tools or generally
  15884. available free programs which are used unmodified in performing
  15885. those activities but which are not part of the work. For example,
  15886. Corresponding Source includes interface definition files associated
  15887. with source files for the work, and the source code for shared
  15888. libraries and dynamically linked subprograms that the work is
  15889. specifically designed to require, such as by intimate data
  15890. communication or control flow between those subprograms and other
  15891. parts of the work.
  15892. The Corresponding Source need not include anything that users can
  15893. regenerate automatically from other parts of the Corresponding
  15894. Source.
  15895. The Corresponding Source for a work in source code form is that
  15896. same work.
  15897. 2. Basic Permissions.
  15898. All rights granted under this License are granted for the term of
  15899. copyright on the Program, and are irrevocable provided the stated
  15900. conditions are met. This License explicitly affirms your unlimited
  15901. permission to run the unmodified Program. The output from running
  15902. a covered work is covered by this License only if the output, given
  15903. its content, constitutes a covered work. This License acknowledges
  15904. your rights of fair use or other equivalent, as provided by
  15905. copyright law.
  15906. You may make, run and propagate covered works that you do not
  15907. convey, without conditions so long as your license otherwise
  15908. remains in force. You may convey covered works to others for the
  15909. sole purpose of having them make modifications exclusively for you,
  15910. or provide you with facilities for running those works, provided
  15911. that you comply with the terms of this License in conveying all
  15912. material for which you do not control copyright. Those thus making
  15913. or running the covered works for you must do so exclusively on your
  15914. behalf, under your direction and control, on terms that prohibit
  15915. them from making any copies of your copyrighted material outside
  15916. their relationship with you.
  15917. Conveying under any other circumstances is permitted solely under
  15918. the conditions stated below. Sublicensing is not allowed; section
  15919. 10 makes it unnecessary.
  15920. 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
  15921. No covered work shall be deemed part of an effective technological
  15922. measure under any applicable law fulfilling obligations under
  15923. article 11 of the WIPO copyright treaty adopted on 20 December
  15924. 1996, or similar laws prohibiting or restricting circumvention of
  15925. such measures.
  15926. When you convey a covered work, you waive any legal power to forbid
  15927. circumvention of technological measures to the extent such
  15928. circumvention is effected by exercising rights under this License
  15929. with respect to the covered work, and you disclaim any intention to
  15930. limit operation or modification of the work as a means of
  15931. enforcing, against the work's users, your or third parties' legal
  15932. rights to forbid circumvention of technological measures.
  15933. 4. Conveying Verbatim Copies.
  15934. You may convey verbatim copies of the Program's source code as you
  15935. receive it, in any medium, provided that you conspicuously and
  15936. appropriately publish on each copy an appropriate copyright notice;
  15937. keep intact all notices stating that this License and any
  15938. non-permissive terms added in accord with section 7 apply to the
  15939. code; keep intact all notices of the absence of any warranty; and
  15940. give all recipients a copy of this License along with the Program.
  15941. You may charge any price or no price for each copy that you convey,
  15942. and you may offer support or warranty protection for a fee.
  15943. 5. Conveying Modified Source Versions.
  15944. You may convey a work based on the Program, or the modifications to
  15945. produce it from the Program, in the form of source code under the
  15946. terms of section 4, provided that you also meet all of these
  15947. conditions:
  15948. a. The work must carry prominent notices stating that you
  15949. modified it, and giving a relevant date.
  15950. b. The work must carry prominent notices stating that it is
  15951. released under this License and any conditions added under
  15952. section 7. This requirement modifies the requirement in
  15953. section 4 to "keep intact all notices".
  15954. c. You must license the entire work, as a whole, under this
  15955. License to anyone who comes into possession of a copy. This
  15956. License will therefore apply, along with any applicable
  15957. section 7 additional terms, to the whole of the work, and all
  15958. its parts, regardless of how they are packaged. This License
  15959. gives no permission to license the work in any other way, but
  15960. it does not invalidate such permission if you have separately
  15961. received it.
  15962. d. If the work has interactive user interfaces, each must display
  15963. Appropriate Legal Notices; however, if the Program has
  15964. interactive interfaces that do not display Appropriate Legal
  15965. Notices, your work need not make them do so.
  15966. A compilation of a covered work with other separate and independent
  15967. works, which are not by their nature extensions of the covered
  15968. work, and which are not combined with it such as to form a larger
  15969. program, in or on a volume of a storage or distribution medium, is
  15970. called an "aggregate" if the compilation and its resulting
  15971. copyright are not used to limit the access or legal rights of the
  15972. compilation's users beyond what the individual works permit.
  15973. Inclusion of a covered work in an aggregate does not cause this
  15974. License to apply to the other parts of the aggregate.
  15975. 6. Conveying Non-Source Forms.
  15976. You may convey a covered work in object code form under the terms
  15977. of sections 4 and 5, provided that you also convey the
  15978. machine-readable Corresponding Source under the terms of this
  15979. License, in one of these ways:
  15980. a. Convey the object code in, or embodied in, a physical product
  15981. (including a physical distribution medium), accompanied by the
  15982. Corresponding Source fixed on a durable physical medium
  15983. customarily used for software interchange.
  15984. b. Convey the object code in, or embodied in, a physical product
  15985. (including a physical distribution medium), accompanied by a
  15986. written offer, valid for at least three years and valid for as
  15987. long as you offer spare parts or customer support for that
  15988. product model, to give anyone who possesses the object code
  15989. either (1) a copy of the Corresponding Source for all the
  15990. software in the product that is covered by this License, on a
  15991. durable physical medium customarily used for software
  15992. interchange, for a price no more than your reasonable cost of
  15993. physically performing this conveying of source, or (2) access
  15994. to copy the Corresponding Source from a network server at no
  15995. charge.
  15996. c. Convey individual copies of the object code with a copy of the
  15997. written offer to provide the Corresponding Source. This
  15998. alternative is allowed only occasionally and noncommercially,
  15999. and only if you received the object code with such an offer,
  16000. in accord with subsection 6b.
  16001. d. Convey the object code by offering access from a designated
  16002. place (gratis or for a charge), and offer equivalent access to
  16003. the Corresponding Source in the same way through the same
  16004. place at no further charge. You need not require recipients
  16005. to copy the Corresponding Source along with the object code.
  16006. If the place to copy the object code is a network server, the
  16007. Corresponding Source may be on a different server (operated by
  16008. you or a third party) that supports equivalent copying
  16009. facilities, provided you maintain clear directions next to the
  16010. object code saying where to find the Corresponding Source.
  16011. Regardless of what server hosts the Corresponding Source, you
  16012. remain obligated to ensure that it is available for as long as
  16013. needed to satisfy these requirements.
  16014. e. Convey the object code using peer-to-peer transmission,
  16015. provided you inform other peers where the object code and
  16016. Corresponding Source of the work are being offered to the
  16017. general public at no charge under subsection 6d.
  16018. A separable portion of the object code, whose source code is
  16019. excluded from the Corresponding Source as a System Library, need
  16020. not be included in conveying the object code work.
  16021. A "User Product" is either (1) a "consumer product", which means
  16022. any tangible personal property which is normally used for personal,
  16023. family, or household purposes, or (2) anything designed or sold for
  16024. incorporation into a dwelling. In determining whether a product is
  16025. a consumer product, doubtful cases shall be resolved in favor of
  16026. coverage. For a particular product received by a particular user,
  16027. "normally used" refers to a typical or common use of that class of
  16028. product, regardless of the status of the particular user or of the
  16029. way in which the particular user actually uses, or expects or is
  16030. expected to use, the product. A product is a consumer product
  16031. regardless of whether the product has substantial commercial,
  16032. industrial or non-consumer uses, unless such uses represent the
  16033. only significant mode of use of the product.
  16034. "Installation Information" for a User Product means any methods,
  16035. procedures, authorization keys, or other information required to
  16036. install and execute modified versions of a covered work in that
  16037. User Product from a modified version of its Corresponding Source.
  16038. The information must suffice to ensure that the continued
  16039. functioning of the modified object code is in no case prevented or
  16040. interfered with solely because modification has been made.
  16041. If you convey an object code work under this section in, or with,
  16042. or specifically for use in, a User Product, and the conveying
  16043. occurs as part of a transaction in which the right of possession
  16044. and use of the User Product is transferred to the recipient in
  16045. perpetuity or for a fixed term (regardless of how the transaction
  16046. is characterized), the Corresponding Source conveyed under this
  16047. section must be accompanied by the Installation Information. But
  16048. this requirement does not apply if neither you nor any third party
  16049. retains the ability to install modified object code on the User
  16050. Product (for example, the work has been installed in ROM).
  16051. The requirement to provide Installation Information does not
  16052. include a requirement to continue to provide support service,
  16053. warranty, or updates for a work that has been modified or installed
  16054. by the recipient, or for the User Product in which it has been
  16055. modified or installed. Access to a network may be denied when the
  16056. modification itself materially and adversely affects the operation
  16057. of the network or violates the rules and protocols for
  16058. communication across the network.
  16059. Corresponding Source conveyed, and Installation Information
  16060. provided, in accord with this section must be in a format that is
  16061. publicly documented (and with an implementation available to the
  16062. public in source code form), and must require no special password
  16063. or key for unpacking, reading or copying.
  16064. 7. Additional Terms.
  16065. "Additional permissions" are terms that supplement the terms of
  16066. this License by making exceptions from one or more of its
  16067. conditions. Additional permissions that are applicable to the
  16068. entire Program shall be treated as though they were included in
  16069. this License, to the extent that they are valid under applicable
  16070. law. If additional permissions apply only to part of the Program,
  16071. that part may be used separately under those permissions, but the
  16072. entire Program remains governed by this License without regard to
  16073. the additional permissions.
  16074. When you convey a copy of a covered work, you may at your option
  16075. remove any additional permissions from that copy, or from any part
  16076. of it. (Additional permissions may be written to require their own
  16077. removal in certain cases when you modify the work.) You may place
  16078. additional permissions on material, added by you to a covered work,
  16079. for which you have or can give appropriate copyright permission.
  16080. Notwithstanding any other provision of this License, for material
  16081. you add to a covered work, you may (if authorized by the copyright
  16082. holders of that material) supplement the terms of this License with
  16083. terms:
  16084. a. Disclaiming warranty or limiting liability differently from
  16085. the terms of sections 15 and 16 of this License; or
  16086. b. Requiring preservation of specified reasonable legal notices
  16087. or author attributions in that material or in the Appropriate
  16088. Legal Notices displayed by works containing it; or
  16089. c. Prohibiting misrepresentation of the origin of that material,
  16090. or requiring that modified versions of such material be marked
  16091. in reasonable ways as different from the original version; or
  16092. d. Limiting the use for publicity purposes of names of licensors
  16093. or authors of the material; or
  16094. e. Declining to grant rights under trademark law for use of some
  16095. trade names, trademarks, or service marks; or
  16096. f. Requiring indemnification of licensors and authors of that
  16097. material by anyone who conveys the material (or modified
  16098. versions of it) with contractual assumptions of liability to
  16099. the recipient, for any liability that these contractual
  16100. assumptions directly impose on those licensors and authors.
  16101. All other non-permissive additional terms are considered "further
  16102. restrictions" within the meaning of section 10. If the Program as
  16103. you received it, or any part of it, contains a notice stating that
  16104. it is governed by this License along with a term that is a further
  16105. restriction, you may remove that term. If a license document
  16106. contains a further restriction but permits relicensing or conveying
  16107. under this License, you may add to a covered work material governed
  16108. by the terms of that license document, provided that the further
  16109. restriction does not survive such relicensing or conveying.
  16110. If you add terms to a covered work in accord with this section, you
  16111. must place, in the relevant source files, a statement of the
  16112. additional terms that apply to those files, or a notice indicating
  16113. where to find the applicable terms.
  16114. Additional terms, permissive or non-permissive, may be stated in
  16115. the form of a separately written license, or stated as exceptions;
  16116. the above requirements apply either way.
  16117. 8. Termination.
  16118. You may not propagate or modify a covered work except as expressly
  16119. provided under this License. Any attempt otherwise to propagate or
  16120. modify it is void, and will automatically terminate your rights
  16121. under this License (including any patent licenses granted under the
  16122. third paragraph of section 11).
  16123. However, if you cease all violation of this License, then your
  16124. license from a particular copyright holder is reinstated (a)
  16125. provisionally, unless and until the copyright holder explicitly and
  16126. finally terminates your license, and (b) permanently, if the
  16127. copyright holder fails to notify you of the violation by some
  16128. reasonable means prior to 60 days after the cessation.
  16129. Moreover, your license from a particular copyright holder is
  16130. reinstated permanently if the copyright holder notifies you of the
  16131. violation by some reasonable means, this is the first time you have
  16132. received notice of violation of this License (for any work) from
  16133. that copyright holder, and you cure the violation prior to 30 days
  16134. after your receipt of the notice.
  16135. Termination of your rights under this section does not terminate
  16136. the licenses of parties who have received copies or rights from you
  16137. under this License. If your rights have been terminated and not
  16138. permanently reinstated, you do not qualify to receive new licenses
  16139. for the same material under section 10.
  16140. 9. Acceptance Not Required for Having Copies.
  16141. You are not required to accept this License in order to receive or
  16142. run a copy of the Program. Ancillary propagation of a covered work
  16143. occurring solely as a consequence of using peer-to-peer
  16144. transmission to receive a copy likewise does not require
  16145. acceptance. However, nothing other than this License grants you
  16146. permission to propagate or modify any covered work. These actions
  16147. infringe copyright if you do not accept this License. Therefore,
  16148. by modifying or propagating a covered work, you indicate your
  16149. acceptance of this License to do so.
  16150. 10. Automatic Licensing of Downstream Recipients.
  16151. Each time you convey a covered work, the recipient automatically
  16152. receives a license from the original licensors, to run, modify and
  16153. propagate that work, subject to this License. You are not
  16154. responsible for enforcing compliance by third parties with this
  16155. License.
  16156. An "entity transaction" is a transaction transferring control of an
  16157. organization, or substantially all assets of one, or subdividing an
  16158. organization, or merging organizations. If propagation of a
  16159. covered work results from an entity transaction, each party to that
  16160. transaction who receives a copy of the work also receives whatever
  16161. licenses to the work the party's predecessor in interest had or
  16162. could give under the previous paragraph, plus a right to possession
  16163. of the Corresponding Source of the work from the predecessor in
  16164. interest, if the predecessor has it or can get it with reasonable
  16165. efforts.
  16166. You may not impose any further restrictions on the exercise of the
  16167. rights granted or affirmed under this License. For example, you
  16168. may not impose a license fee, royalty, or other charge for exercise
  16169. of rights granted under this License, and you may not initiate
  16170. litigation (including a cross-claim or counterclaim in a lawsuit)
  16171. alleging that any patent claim is infringed by making, using,
  16172. selling, offering for sale, or importing the Program or any portion
  16173. of it.
  16174. 11. Patents.
  16175. A "contributor" is a copyright holder who authorizes use under this
  16176. License of the Program or a work on which the Program is based.
  16177. The work thus licensed is called the contributor's "contributor
  16178. version".
  16179. A contributor's "essential patent claims" are all patent claims
  16180. owned or controlled by the contributor, whether already acquired or
  16181. hereafter acquired, that would be infringed by some manner,
  16182. permitted by this License, of making, using, or selling its
  16183. contributor version, but do not include claims that would be
  16184. infringed only as a consequence of further modification of the
  16185. contributor version. For purposes of this definition, "control"
  16186. includes the right to grant patent sublicenses in a manner
  16187. consistent with the requirements of this License.
  16188. Each contributor grants you a non-exclusive, worldwide,
  16189. royalty-free patent license under the contributor's essential
  16190. patent claims, to make, use, sell, offer for sale, import and
  16191. otherwise run, modify and propagate the contents of its contributor
  16192. version.
  16193. In the following three paragraphs, a "patent license" is any
  16194. express agreement or commitment, however denominated, not to
  16195. enforce a patent (such as an express permission to practice a
  16196. patent or covenant not to sue for patent infringement). To "grant"
  16197. such a patent license to a party means to make such an agreement or
  16198. commitment not to enforce a patent against the party.
  16199. If you convey a covered work, knowingly relying on a patent
  16200. license, and the Corresponding Source of the work is not available
  16201. for anyone to copy, free of charge and under the terms of this
  16202. License, through a publicly available network server or other
  16203. readily accessible means, then you must either (1) cause the
  16204. Corresponding Source to be so available, or (2) arrange to deprive
  16205. yourself of the benefit of the patent license for this particular
  16206. work, or (3) arrange, in a manner consistent with the requirements
  16207. of this License, to extend the patent license to downstream
  16208. recipients. "Knowingly relying" means you have actual knowledge
  16209. that, but for the patent license, your conveying the covered work
  16210. in a country, or your recipient's use of the covered work in a
  16211. country, would infringe one or more identifiable patents in that
  16212. country that you have reason to believe are valid.
  16213. If, pursuant to or in connection with a single transaction or
  16214. arrangement, you convey, or propagate by procuring conveyance of, a
  16215. covered work, and grant a patent license to some of the parties
  16216. receiving the covered work authorizing them to use, propagate,
  16217. modify or convey a specific copy of the covered work, then the
  16218. patent license you grant is automatically extended to all
  16219. recipients of the covered work and works based on it.
  16220. A patent license is "discriminatory" if it does not include within
  16221. the scope of its coverage, prohibits the exercise of, or is
  16222. conditioned on the non-exercise of one or more of the rights that
  16223. are specifically granted under this License. You may not convey a
  16224. covered work if you are a party to an arrangement with a third
  16225. party that is in the business of distributing software, under which
  16226. you make payment to the third party based on the extent of your
  16227. activity of conveying the work, and under which the third party
  16228. grants, to any of the parties who would receive the covered work
  16229. from you, a discriminatory patent license (a) in connection with
  16230. copies of the covered work conveyed by you (or copies made from
  16231. those copies), or (b) primarily for and in connection with specific
  16232. products or compilations that contain the covered work, unless you
  16233. entered into that arrangement, or that patent license was granted,
  16234. prior to 28 March 2007.
  16235. Nothing in this License shall be construed as excluding or limiting
  16236. any implied license or other defenses to infringement that may
  16237. otherwise be available to you under applicable patent law.
  16238. 12. No Surrender of Others' Freedom.
  16239. If conditions are imposed on you (whether by court order, agreement
  16240. or otherwise) that contradict the conditions of this License, they
  16241. do not excuse you from the conditions of this License. If you
  16242. cannot convey a covered work so as to satisfy simultaneously your
  16243. obligations under this License and any other pertinent obligations,
  16244. then as a consequence you may not convey it at all. For example,
  16245. if you agree to terms that obligate you to collect a royalty for
  16246. further conveying from those to whom you convey the Program, the
  16247. only way you could satisfy both those terms and this License would
  16248. be to refrain entirely from conveying the Program.
  16249. 13. Use with the GNU Affero General Public License.
  16250. Notwithstanding any other provision of this License, you have
  16251. permission to link or combine any covered work with a work licensed
  16252. under version 3 of the GNU Affero General Public License into a
  16253. single combined work, and to convey the resulting work. The terms
  16254. of this License will continue to apply to the part which is the
  16255. covered work, but the special requirements of the GNU Affero
  16256. General Public License, section 13, concerning interaction through
  16257. a network will apply to the combination as such.
  16258. 14. Revised Versions of this License.
  16259. The Free Software Foundation may publish revised and/or new
  16260. versions of the GNU General Public License from time to time. Such
  16261. new versions will be similar in spirit to the present version, but
  16262. may differ in detail to address new problems or concerns.
  16263. Each version is given a distinguishing version number. If the
  16264. Program specifies that a certain numbered version of the GNU
  16265. General Public License "or any later version" applies to it, you
  16266. have the option of following the terms and conditions either of
  16267. that numbered version or of any later version published by the Free
  16268. Software Foundation. If the Program does not specify a version
  16269. number of the GNU General Public License, you may choose any
  16270. version ever published by the Free Software Foundation.
  16271. If the Program specifies that a proxy can decide which future
  16272. versions of the GNU General Public License can be used, that
  16273. proxy's public statement of acceptance of a version permanently
  16274. authorizes you to choose that version for the Program.
  16275. Later license versions may give you additional or different
  16276. permissions. However, no additional obligations are imposed on any
  16277. author or copyright holder as a result of your choosing to follow a
  16278. later version.
  16279. 15. Disclaimer of Warranty.
  16280. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
  16281. APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
  16282. COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
  16283. WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  16284. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16285. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
  16286. RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
  16287. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
  16288. NECESSARY SERVICING, REPAIR OR CORRECTION.
  16289. 16. Limitation of Liability.
  16290. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  16291. WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
  16292. AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
  16293. DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
  16294. CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
  16295. THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
  16296. BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
  16297. PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  16298. PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
  16299. THE POSSIBILITY OF SUCH DAMAGES.
  16300. 17. Interpretation of Sections 15 and 16.
  16301. If the disclaimer of warranty and limitation of liability provided
  16302. above cannot be given local legal effect according to their terms,
  16303. reviewing courts shall apply local law that most closely
  16304. approximates an absolute waiver of all civil liability in
  16305. connection with the Program, unless a warranty or assumption of
  16306. liability accompanies a copy of the Program in return for a fee.
  16307. END OF TERMS AND CONDITIONS
  16308. ===========================
  16309. How to Apply These Terms to Your New Programs
  16310. =============================================
  16311. If you develop a new program, and you want it to be of the greatest
  16312. possible use to the public, the best way to achieve this is to make it
  16313. free software which everyone can redistribute and change under these
  16314. terms.
  16315. To do so, attach the following notices to the program. It is safest
  16316. to attach them to the start of each source file to most effectively
  16317. state the exclusion of warranty; and each file should have at least the
  16318. "copyright" line and a pointer to where the full notice is found.
  16319. ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
  16320. Copyright (C) YEAR NAME OF AUTHOR
  16321. This program is free software: you can redistribute it and/or modify
  16322. it under the terms of the GNU General Public License as published by
  16323. the Free Software Foundation, either version 3 of the License, or (at
  16324. your option) any later version.
  16325. This program is distributed in the hope that it will be useful, but
  16326. WITHOUT ANY WARRANTY; without even the implied warranty of
  16327. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16328. General Public License for more details.
  16329. You should have received a copy of the GNU General Public License
  16330. along with this program. If not, see <http://www.gnu.org/licenses/>.
  16331. Also add information on how to contact you by electronic and paper
  16332. mail.
  16333. If the program does terminal interaction, make it output a short
  16334. notice like this when it starts in an interactive mode:
  16335. PROGRAM Copyright (C) YEAR NAME OF AUTHOR
  16336. This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
  16337. This is free software, and you are welcome to redistribute it
  16338. under certain conditions; type 'show c' for details.
  16339. The hypothetical commands 'show w' and 'show c' should show the
  16340. appropriate parts of the General Public License. Of course, your
  16341. program's commands might be different; for a GUI interface, you would
  16342. use an "about box".
  16343. You should also get your employer (if you work as a programmer) or
  16344. school, if any, to sign a "copyright disclaimer" for the program, if
  16345. necessary. For more information on this, and how to apply and follow
  16346. the GNU GPL, see <http://www.gnu.org/licenses/>.
  16347. The GNU General Public License does not permit incorporating your
  16348. program into proprietary programs. If your program is a subroutine
  16349. library, you may consider it more useful to permit linking proprietary
  16350. applications with the library. If this is what you want to do, use the
  16351. GNU Lesser General Public License instead of this License. But first,
  16352. please read <https://www.gnu.org/licenses/why-not-lgpl.html>.
  16353. 
  16354. File: gfortran.info, Node: GNU Free Documentation License, Next: Funding, Prev: Copying, Up: Top
  16355. GNU Free Documentation License
  16356. ******************************
  16357. Version 1.3, 3 November 2008
  16358. Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
  16359. <http://fsf.org/>
  16360. Everyone is permitted to copy and distribute verbatim copies
  16361. of this license document, but changing it is not allowed.
  16362. 0. PREAMBLE
  16363. The purpose of this License is to make a manual, textbook, or other
  16364. functional and useful document "free" in the sense of freedom: to
  16365. assure everyone the effective freedom to copy and redistribute it,
  16366. with or without modifying it, either commercially or
  16367. noncommercially. Secondarily, this License preserves for the
  16368. author and publisher a way to get credit for their work, while not
  16369. being considered responsible for modifications made by others.
  16370. This License is a kind of "copyleft", which means that derivative
  16371. works of the document must themselves be free in the same sense.
  16372. It complements the GNU General Public License, which is a copyleft
  16373. license designed for free software.
  16374. We have designed this License in order to use it for manuals for
  16375. free software, because free software needs free documentation: a
  16376. free program should come with manuals providing the same freedoms
  16377. that the software does. But this License is not limited to
  16378. software manuals; it can be used for any textual work, regardless
  16379. of subject matter or whether it is published as a printed book. We
  16380. recommend this License principally for works whose purpose is
  16381. instruction or reference.
  16382. 1. APPLICABILITY AND DEFINITIONS
  16383. This License applies to any manual or other work, in any medium,
  16384. that contains a notice placed by the copyright holder saying it can
  16385. be distributed under the terms of this License. Such a notice
  16386. grants a world-wide, royalty-free license, unlimited in duration,
  16387. to use that work under the conditions stated herein. The
  16388. "Document", below, refers to any such manual or work. Any member
  16389. of the public is a licensee, and is addressed as "you". You accept
  16390. the license if you copy, modify or distribute the work in a way
  16391. requiring permission under copyright law.
  16392. A "Modified Version" of the Document means any work containing the
  16393. Document or a portion of it, either copied verbatim, or with
  16394. modifications and/or translated into another language.
  16395. A "Secondary Section" is a named appendix or a front-matter section
  16396. of the Document that deals exclusively with the relationship of the
  16397. publishers or authors of the Document to the Document's overall
  16398. subject (or to related matters) and contains nothing that could
  16399. fall directly within that overall subject. (Thus, if the Document
  16400. is in part a textbook of mathematics, a Secondary Section may not
  16401. explain any mathematics.) The relationship could be a matter of
  16402. historical connection with the subject or with related matters, or
  16403. of legal, commercial, philosophical, ethical or political position
  16404. regarding them.
  16405. The "Invariant Sections" are certain Secondary Sections whose
  16406. titles are designated, as being those of Invariant Sections, in the
  16407. notice that says that the Document is released under this License.
  16408. If a section does not fit the above definition of Secondary then it
  16409. is not allowed to be designated as Invariant. The Document may
  16410. contain zero Invariant Sections. If the Document does not identify
  16411. any Invariant Sections then there are none.
  16412. The "Cover Texts" are certain short passages of text that are
  16413. listed, as Front-Cover Texts or Back-Cover Texts, in the notice
  16414. that says that the Document is released under this License. A
  16415. Front-Cover Text may be at most 5 words, and a Back-Cover Text may
  16416. be at most 25 words.
  16417. A "Transparent" copy of the Document means a machine-readable copy,
  16418. represented in a format whose specification is available to the
  16419. general public, that is suitable for revising the document
  16420. straightforwardly with generic text editors or (for images composed
  16421. of pixels) generic paint programs or (for drawings) some widely
  16422. available drawing editor, and that is suitable for input to text
  16423. formatters or for automatic translation to a variety of formats
  16424. suitable for input to text formatters. A copy made in an otherwise
  16425. Transparent file format whose markup, or absence of markup, has
  16426. been arranged to thwart or discourage subsequent modification by
  16427. readers is not Transparent. An image format is not Transparent if
  16428. used for any substantial amount of text. A copy that is not
  16429. "Transparent" is called "Opaque".
  16430. Examples of suitable formats for Transparent copies include plain
  16431. ASCII without markup, Texinfo input format, LaTeX input format,
  16432. SGML or XML using a publicly available DTD, and standard-conforming
  16433. simple HTML, PostScript or PDF designed for human modification.
  16434. Examples of transparent image formats include PNG, XCF and JPG.
  16435. Opaque formats include proprietary formats that can be read and
  16436. edited only by proprietary word processors, SGML or XML for which
  16437. the DTD and/or processing tools are not generally available, and
  16438. the machine-generated HTML, PostScript or PDF produced by some word
  16439. processors for output purposes only.
  16440. The "Title Page" means, for a printed book, the title page itself,
  16441. plus such following pages as are needed to hold, legibly, the
  16442. material this License requires to appear in the title page. For
  16443. works in formats which do not have any title page as such, "Title
  16444. Page" means the text near the most prominent appearance of the
  16445. work's title, preceding the beginning of the body of the text.
  16446. The "publisher" means any person or entity that distributes copies
  16447. of the Document to the public.
  16448. A section "Entitled XYZ" means a named subunit of the Document
  16449. whose title either is precisely XYZ or contains XYZ in parentheses
  16450. following text that translates XYZ in another language. (Here XYZ
  16451. stands for a specific section name mentioned below, such as
  16452. "Acknowledgements", "Dedications", "Endorsements", or "History".)
  16453. To "Preserve the Title" of such a section when you modify the
  16454. Document means that it remains a section "Entitled XYZ" according
  16455. to this definition.
  16456. The Document may include Warranty Disclaimers next to the notice
  16457. which states that this License applies to the Document. These
  16458. Warranty Disclaimers are considered to be included by reference in
  16459. this License, but only as regards disclaiming warranties: any other
  16460. implication that these Warranty Disclaimers may have is void and
  16461. has no effect on the meaning of this License.
  16462. 2. VERBATIM COPYING
  16463. You may copy and distribute the Document in any medium, either
  16464. commercially or noncommercially, provided that this License, the
  16465. copyright notices, and the license notice saying this License
  16466. applies to the Document are reproduced in all copies, and that you
  16467. add no other conditions whatsoever to those of this License. You
  16468. may not use technical measures to obstruct or control the reading
  16469. or further copying of the copies you make or distribute. However,
  16470. you may accept compensation in exchange for copies. If you
  16471. distribute a large enough number of copies you must also follow the
  16472. conditions in section 3.
  16473. You may also lend copies, under the same conditions stated above,
  16474. and you may publicly display copies.
  16475. 3. COPYING IN QUANTITY
  16476. If you publish printed copies (or copies in media that commonly
  16477. have printed covers) of the Document, numbering more than 100, and
  16478. the Document's license notice requires Cover Texts, you must
  16479. enclose the copies in covers that carry, clearly and legibly, all
  16480. these Cover Texts: Front-Cover Texts on the front cover, and
  16481. Back-Cover Texts on the back cover. Both covers must also clearly
  16482. and legibly identify you as the publisher of these copies. The
  16483. front cover must present the full title with all words of the title
  16484. equally prominent and visible. You may add other material on the
  16485. covers in addition. Copying with changes limited to the covers, as
  16486. long as they preserve the title of the Document and satisfy these
  16487. conditions, can be treated as verbatim copying in other respects.
  16488. If the required texts for either cover are too voluminous to fit
  16489. legibly, you should put the first ones listed (as many as fit
  16490. reasonably) on the actual cover, and continue the rest onto
  16491. adjacent pages.
  16492. If you publish or distribute Opaque copies of the Document
  16493. numbering more than 100, you must either include a machine-readable
  16494. Transparent copy along with each Opaque copy, or state in or with
  16495. each Opaque copy a computer-network location from which the general
  16496. network-using public has access to download using public-standard
  16497. network protocols a complete Transparent copy of the Document, free
  16498. of added material. If you use the latter option, you must take
  16499. reasonably prudent steps, when you begin distribution of Opaque
  16500. copies in quantity, to ensure that this Transparent copy will
  16501. remain thus accessible at the stated location until at least one
  16502. year after the last time you distribute an Opaque copy (directly or
  16503. through your agents or retailers) of that edition to the public.
  16504. It is requested, but not required, that you contact the authors of
  16505. the Document well before redistributing any large number of copies,
  16506. to give them a chance to provide you with an updated version of the
  16507. Document.
  16508. 4. MODIFICATIONS
  16509. You may copy and distribute a Modified Version of the Document
  16510. under the conditions of sections 2 and 3 above, provided that you
  16511. release the Modified Version under precisely this License, with the
  16512. Modified Version filling the role of the Document, thus licensing
  16513. distribution and modification of the Modified Version to whoever
  16514. possesses a copy of it. In addition, you must do these things in
  16515. the Modified Version:
  16516. A. Use in the Title Page (and on the covers, if any) a title
  16517. distinct from that of the Document, and from those of previous
  16518. versions (which should, if there were any, be listed in the
  16519. History section of the Document). You may use the same title
  16520. as a previous version if the original publisher of that
  16521. version gives permission.
  16522. B. List on the Title Page, as authors, one or more persons or
  16523. entities responsible for authorship of the modifications in
  16524. the Modified Version, together with at least five of the
  16525. principal authors of the Document (all of its principal
  16526. authors, if it has fewer than five), unless they release you
  16527. from this requirement.
  16528. C. State on the Title page the name of the publisher of the
  16529. Modified Version, as the publisher.
  16530. D. Preserve all the copyright notices of the Document.
  16531. E. Add an appropriate copyright notice for your modifications
  16532. adjacent to the other copyright notices.
  16533. F. Include, immediately after the copyright notices, a license
  16534. notice giving the public permission to use the Modified
  16535. Version under the terms of this License, in the form shown in
  16536. the Addendum below.
  16537. G. Preserve in that license notice the full lists of Invariant
  16538. Sections and required Cover Texts given in the Document's
  16539. license notice.
  16540. H. Include an unaltered copy of this License.
  16541. I. Preserve the section Entitled "History", Preserve its Title,
  16542. and add to it an item stating at least the title, year, new
  16543. authors, and publisher of the Modified Version as given on the
  16544. Title Page. If there is no section Entitled "History" in the
  16545. Document, create one stating the title, year, authors, and
  16546. publisher of the Document as given on its Title Page, then add
  16547. an item describing the Modified Version as stated in the
  16548. previous sentence.
  16549. J. Preserve the network location, if any, given in the Document
  16550. for public access to a Transparent copy of the Document, and
  16551. likewise the network locations given in the Document for
  16552. previous versions it was based on. These may be placed in the
  16553. "History" section. You may omit a network location for a work
  16554. that was published at least four years before the Document
  16555. itself, or if the original publisher of the version it refers
  16556. to gives permission.
  16557. K. For any section Entitled "Acknowledgements" or "Dedications",
  16558. Preserve the Title of the section, and preserve in the section
  16559. all the substance and tone of each of the contributor
  16560. acknowledgements and/or dedications given therein.
  16561. L. Preserve all the Invariant Sections of the Document, unaltered
  16562. in their text and in their titles. Section numbers or the
  16563. equivalent are not considered part of the section titles.
  16564. M. Delete any section Entitled "Endorsements". Such a section
  16565. may not be included in the Modified Version.
  16566. N. Do not retitle any existing section to be Entitled
  16567. "Endorsements" or to conflict in title with any Invariant
  16568. Section.
  16569. O. Preserve any Warranty Disclaimers.
  16570. If the Modified Version includes new front-matter sections or
  16571. appendices that qualify as Secondary Sections and contain no
  16572. material copied from the Document, you may at your option designate
  16573. some or all of these sections as invariant. To do this, add their
  16574. titles to the list of Invariant Sections in the Modified Version's
  16575. license notice. These titles must be distinct from any other
  16576. section titles.
  16577. You may add a section Entitled "Endorsements", provided it contains
  16578. nothing but endorsements of your Modified Version by various
  16579. parties--for example, statements of peer review or that the text
  16580. has been approved by an organization as the authoritative
  16581. definition of a standard.
  16582. You may add a passage of up to five words as a Front-Cover Text,
  16583. and a passage of up to 25 words as a Back-Cover Text, to the end of
  16584. the list of Cover Texts in the Modified Version. Only one passage
  16585. of Front-Cover Text and one of Back-Cover Text may be added by (or
  16586. through arrangements made by) any one entity. If the Document
  16587. already includes a cover text for the same cover, previously added
  16588. by you or by arrangement made by the same entity you are acting on
  16589. behalf of, you may not add another; but you may replace the old
  16590. one, on explicit permission from the previous publisher that added
  16591. the old one.
  16592. The author(s) and publisher(s) of the Document do not by this
  16593. License give permission to use their names for publicity for or to
  16594. assert or imply endorsement of any Modified Version.
  16595. 5. COMBINING DOCUMENTS
  16596. You may combine the Document with other documents released under
  16597. this License, under the terms defined in section 4 above for
  16598. modified versions, provided that you include in the combination all
  16599. of the Invariant Sections of all of the original documents,
  16600. unmodified, and list them all as Invariant Sections of your
  16601. combined work in its license notice, and that you preserve all
  16602. their Warranty Disclaimers.
  16603. The combined work need only contain one copy of this License, and
  16604. multiple identical Invariant Sections may be replaced with a single
  16605. copy. If there are multiple Invariant Sections with the same name
  16606. but different contents, make the title of each such section unique
  16607. by adding at the end of it, in parentheses, the name of the
  16608. original author or publisher of that section if known, or else a
  16609. unique number. Make the same adjustment to the section titles in
  16610. the list of Invariant Sections in the license notice of the
  16611. combined work.
  16612. In the combination, you must combine any sections Entitled
  16613. "History" in the various original documents, forming one section
  16614. Entitled "History"; likewise combine any sections Entitled
  16615. "Acknowledgements", and any sections Entitled "Dedications". You
  16616. must delete all sections Entitled "Endorsements."
  16617. 6. COLLECTIONS OF DOCUMENTS
  16618. You may make a collection consisting of the Document and other
  16619. documents released under this License, and replace the individual
  16620. copies of this License in the various documents with a single copy
  16621. that is included in the collection, provided that you follow the
  16622. rules of this License for verbatim copying of each of the documents
  16623. in all other respects.
  16624. You may extract a single document from such a collection, and
  16625. distribute it individually under this License, provided you insert
  16626. a copy of this License into the extracted document, and follow this
  16627. License in all other respects regarding verbatim copying of that
  16628. document.
  16629. 7. AGGREGATION WITH INDEPENDENT WORKS
  16630. A compilation of the Document or its derivatives with other
  16631. separate and independent documents or works, in or on a volume of a
  16632. storage or distribution medium, is called an "aggregate" if the
  16633. copyright resulting from the compilation is not used to limit the
  16634. legal rights of the compilation's users beyond what the individual
  16635. works permit. When the Document is included in an aggregate, this
  16636. License does not apply to the other works in the aggregate which
  16637. are not themselves derivative works of the Document.
  16638. If the Cover Text requirement of section 3 is applicable to these
  16639. copies of the Document, then if the Document is less than one half
  16640. of the entire aggregate, the Document's Cover Texts may be placed
  16641. on covers that bracket the Document within the aggregate, or the
  16642. electronic equivalent of covers if the Document is in electronic
  16643. form. Otherwise they must appear on printed covers that bracket
  16644. the whole aggregate.
  16645. 8. TRANSLATION
  16646. Translation is considered a kind of modification, so you may
  16647. distribute translations of the Document under the terms of section
  16648. 4. Replacing Invariant Sections with translations requires special
  16649. permission from their copyright holders, but you may include
  16650. translations of some or all Invariant Sections in addition to the
  16651. original versions of these Invariant Sections. You may include a
  16652. translation of this License, and all the license notices in the
  16653. Document, and any Warranty Disclaimers, provided that you also
  16654. include the original English version of this License and the
  16655. original versions of those notices and disclaimers. In case of a
  16656. disagreement between the translation and the original version of
  16657. this License or a notice or disclaimer, the original version will
  16658. prevail.
  16659. If a section in the Document is Entitled "Acknowledgements",
  16660. "Dedications", or "History", the requirement (section 4) to
  16661. Preserve its Title (section 1) will typically require changing the
  16662. actual title.
  16663. 9. TERMINATION
  16664. You may not copy, modify, sublicense, or distribute the Document
  16665. except as expressly provided under this License. Any attempt
  16666. otherwise to copy, modify, sublicense, or distribute it is void,
  16667. and will automatically terminate your rights under this License.
  16668. However, if you cease all violation of this License, then your
  16669. license from a particular copyright holder is reinstated (a)
  16670. provisionally, unless and until the copyright holder explicitly and
  16671. finally terminates your license, and (b) permanently, if the
  16672. copyright holder fails to notify you of the violation by some
  16673. reasonable means prior to 60 days after the cessation.
  16674. Moreover, your license from a particular copyright holder is
  16675. reinstated permanently if the copyright holder notifies you of the
  16676. violation by some reasonable means, this is the first time you have
  16677. received notice of violation of this License (for any work) from
  16678. that copyright holder, and you cure the violation prior to 30 days
  16679. after your receipt of the notice.
  16680. Termination of your rights under this section does not terminate
  16681. the licenses of parties who have received copies or rights from you
  16682. under this License. If your rights have been terminated and not
  16683. permanently reinstated, receipt of a copy of some or all of the
  16684. same material does not give you any rights to use it.
  16685. 10. FUTURE REVISIONS OF THIS LICENSE
  16686. The Free Software Foundation may publish new, revised versions of
  16687. the GNU Free Documentation License from time to time. Such new
  16688. versions will be similar in spirit to the present version, but may
  16689. differ in detail to address new problems or concerns. See
  16690. <http://www.gnu.org/copyleft/>.
  16691. Each version of the License is given a distinguishing version
  16692. number. If the Document specifies that a particular numbered
  16693. version of this License "or any later version" applies to it, you
  16694. have the option of following the terms and conditions either of
  16695. that specified version or of any later version that has been
  16696. published (not as a draft) by the Free Software Foundation. If the
  16697. Document does not specify a version number of this License, you may
  16698. choose any version ever published (not as a draft) by the Free
  16699. Software Foundation. If the Document specifies that a proxy can
  16700. decide which future versions of this License can be used, that
  16701. proxy's public statement of acceptance of a version permanently
  16702. authorizes you to choose that version for the Document.
  16703. 11. RELICENSING
  16704. "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
  16705. World Wide Web server that publishes copyrightable works and also
  16706. provides prominent facilities for anybody to edit those works. A
  16707. public wiki that anybody can edit is an example of such a server.
  16708. A "Massive Multiauthor Collaboration" (or "MMC") contained in the
  16709. site means any set of copyrightable works thus published on the MMC
  16710. site.
  16711. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
  16712. license published by Creative Commons Corporation, a not-for-profit
  16713. corporation with a principal place of business in San Francisco,
  16714. California, as well as future copyleft versions of that license
  16715. published by that same organization.
  16716. "Incorporate" means to publish or republish a Document, in whole or
  16717. in part, as part of another Document.
  16718. An MMC is "eligible for relicensing" if it is licensed under this
  16719. License, and if all works that were first published under this
  16720. License somewhere other than this MMC, and subsequently
  16721. incorporated in whole or in part into the MMC, (1) had no cover
  16722. texts or invariant sections, and (2) were thus incorporated prior
  16723. to November 1, 2008.
  16724. The operator of an MMC Site may republish an MMC contained in the
  16725. site under CC-BY-SA on the same site at any time before August 1,
  16726. 2009, provided the MMC is eligible for relicensing.
  16727. ADDENDUM: How to use this License for your documents
  16728. ====================================================
  16729. To use this License in a document you have written, include a copy of
  16730. the License in the document and put the following copyright and license
  16731. notices just after the title page:
  16732. Copyright (C) YEAR YOUR NAME.
  16733. Permission is granted to copy, distribute and/or modify this document
  16734. under the terms of the GNU Free Documentation License, Version 1.3
  16735. or any later version published by the Free Software Foundation;
  16736. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  16737. Texts. A copy of the license is included in the section entitled ``GNU
  16738. Free Documentation License''.
  16739. If you have Invariant Sections, Front-Cover Texts and Back-Cover
  16740. Texts, replace the "with...Texts." line with this:
  16741. with the Invariant Sections being LIST THEIR TITLES, with
  16742. the Front-Cover Texts being LIST, and with the Back-Cover Texts
  16743. being LIST.
  16744. If you have Invariant Sections without Cover Texts, or some other
  16745. combination of the three, merge those two alternatives to suit the
  16746. situation.
  16747. If your document contains nontrivial examples of program code, we
  16748. recommend releasing these examples in parallel under your choice of free
  16749. software license, such as the GNU General Public License, to permit
  16750. their use in free software.
  16751. 
  16752. File: gfortran.info, Node: Funding, Next: Option Index, Prev: GNU Free Documentation License, Up: Top
  16753. Funding Free Software
  16754. *********************
  16755. If you want to have more free software a few years from now, it makes
  16756. sense for you to help encourage people to contribute funds for its
  16757. development. The most effective approach known is to encourage
  16758. commercial redistributors to donate.
  16759. Users of free software systems can boost the pace of development by
  16760. encouraging for-a-fee distributors to donate part of their selling price
  16761. to free software developers--the Free Software Foundation, and others.
  16762. The way to convince distributors to do this is to demand it and
  16763. expect it from them. So when you compare distributors, judge them
  16764. partly by how much they give to free software development. Show
  16765. distributors they must compete to be the one who gives the most.
  16766. To make this approach work, you must insist on numbers that you can
  16767. compare, such as, "We will donate ten dollars to the Frobnitz project
  16768. for each disk sold." Don't be satisfied with a vague promise, such as
  16769. "A portion of the profits are donated," since it doesn't give a basis
  16770. for comparison.
  16771. Even a precise fraction "of the profits from this disk" is not very
  16772. meaningful, since creative accounting and unrelated business decisions
  16773. can greatly alter what fraction of the sales price counts as profit. If
  16774. the price you pay is $50, ten percent of the profit is probably less
  16775. than a dollar; it might be a few cents, or nothing at all.
  16776. Some redistributors do development work themselves. This is useful
  16777. too; but to keep everyone honest, you need to inquire how much they do,
  16778. and what kind. Some kinds of development make much more long-term
  16779. difference than others. For example, maintaining a separate version of
  16780. a program contributes very little; maintaining the standard version of a
  16781. program for the whole community contributes much. Easy new ports
  16782. contribute little, since someone else would surely do them; difficult
  16783. ports such as adding a new CPU to the GNU Compiler Collection contribute
  16784. more; major new features or packages contribute the most.
  16785. By establishing the idea that supporting further development is "the
  16786. proper thing to do" when distributing free software for a fee, we can
  16787. assure a steady flow of resources into making more free software.
  16788. Copyright (C) 1994 Free Software Foundation, Inc.
  16789. Verbatim copying and redistribution of this section is permitted
  16790. without royalty; alteration is not permitted.
  16791. 
  16792. File: gfortran.info, Node: Option Index, Next: Keyword Index, Prev: Funding, Up: Top
  16793. Option Index
  16794. ************
  16795. 'gfortran''s command line options are indexed here without any initial
  16796. '-' or '--'. Where an option has both positive and negative forms (such
  16797. as -foption and -fno-option), relevant entries in the manual are indexed
  16798. under the most appropriate form; it may sometimes be useful to look up
  16799. both forms.
  16800. �[index�]
  16801. * Menu:
  16802. * 'A-PREDICATE=ANSWER': Preprocessing Options.
  16803. (line 119)
  16804. * 'allow-invalid-boz': Fortran Dialect Options.
  16805. (line 40)
  16806. * 'APREDICATE=ANSWER': Preprocessing Options.
  16807. (line 113)
  16808. * 'backslash': Fortran Dialect Options.
  16809. (line 112)
  16810. * 'C': Preprocessing Options.
  16811. (line 122)
  16812. * 'c-prototypes': Interoperability Options.
  16813. (line 7)
  16814. * 'c-prototypes-external': Interoperability Options.
  16815. (line 25)
  16816. * 'CC': Preprocessing Options.
  16817. (line 137)
  16818. * 'cpp': Preprocessing Options.
  16819. (line 12)
  16820. * 'dD': Preprocessing Options.
  16821. (line 35)
  16822. * 'dI': Preprocessing Options.
  16823. (line 51)
  16824. * 'dM': Preprocessing Options.
  16825. (line 26)
  16826. * 'dN': Preprocessing Options.
  16827. (line 41)
  16828. * 'DNAME': Preprocessing Options.
  16829. (line 151)
  16830. * 'DNAME=DEFINITION': Preprocessing Options.
  16831. (line 154)
  16832. * 'dU': Preprocessing Options.
  16833. (line 44)
  16834. * 'faggressive-function-elimination': Code Gen Options. (line 435)
  16835. * 'falign-commons': Code Gen Options. (line 408)
  16836. * 'fall-intrinsics': Fortran Dialect Options.
  16837. (line 17)
  16838. * 'fallow-argument-mismatch': Fortran Dialect Options.
  16839. (line 26)
  16840. * 'fblas-matmul-limit': Code Gen Options. (line 337)
  16841. * 'fbounds-check': Code Gen Options. (line 205)
  16842. * 'fcheck': Code Gen Options. (line 144)
  16843. * 'fcheck-array-temporaries': Code Gen Options. (line 239)
  16844. * 'fcoarray': Code Gen Options. (line 130)
  16845. * 'fconvert='CONVERSION: Runtime Options. (line 10)
  16846. * 'fcray-pointer': Fortran Dialect Options.
  16847. (line 167)
  16848. * 'fd-lines-as-code': Fortran Dialect Options.
  16849. (line 47)
  16850. * 'fd-lines-as-comments': Fortran Dialect Options.
  16851. (line 47)
  16852. * 'fdec': Fortran Dialect Options.
  16853. (line 54)
  16854. * 'fdec-blank-format-item': Fortran Dialect Options.
  16855. (line 102)
  16856. * 'fdec-char-conversions': Fortran Dialect Options.
  16857. (line 69)
  16858. * 'fdec-format-defaults': Fortran Dialect Options.
  16859. (line 98)
  16860. * 'fdec-include': Fortran Dialect Options.
  16861. (line 93)
  16862. * 'fdec-intrinsic-ints': Fortran Dialect Options.
  16863. (line 79)
  16864. * 'fdec-math': Fortran Dialect Options.
  16865. (line 84)
  16866. * 'fdec-static': Fortran Dialect Options.
  16867. (line 89)
  16868. * 'fdec-structure': Fortran Dialect Options.
  16869. (line 73)
  16870. * 'fdefault-double-8': Fortran Dialect Options.
  16871. (line 234)
  16872. * 'fdefault-integer-8': Fortran Dialect Options.
  16873. (line 198)
  16874. * 'fdefault-real-10': Fortran Dialect Options.
  16875. (line 214)
  16876. * 'fdefault-real-16': Fortran Dialect Options.
  16877. (line 224)
  16878. * 'fdefault-real-8': Fortran Dialect Options.
  16879. (line 204)
  16880. * 'fdollar-ok': Fortran Dialect Options.
  16881. (line 106)
  16882. * 'fdump-fortran-global': Debugging Options. (line 33)
  16883. * 'fdump-fortran-optimized': Debugging Options. (line 18)
  16884. * 'fdump-fortran-original': Debugging Options. (line 10)
  16885. * 'fdump-parse-tree': Debugging Options. (line 25)
  16886. * 'fexternal-blas': Code Gen Options. (line 329)
  16887. * ff2c: Code Gen Options. (line 28)
  16888. * 'ffixed-form': Fortran Dialect Options.
  16889. (line 11)
  16890. * 'ffixed-line-length-'N: Fortran Dialect Options.
  16891. (line 129)
  16892. * 'ffpe-summary='LIST: Debugging Options. (line 73)
  16893. * 'ffpe-trap='LIST: Debugging Options. (line 40)
  16894. * 'ffree-form': Fortran Dialect Options.
  16895. (line 11)
  16896. * 'ffree-line-length-'N: Fortran Dialect Options.
  16897. (line 151)
  16898. * 'fimplicit-none': Fortran Dialect Options.
  16899. (line 162)
  16900. * 'finit-character': Code Gen Options. (line 372)
  16901. * 'finit-derived': Code Gen Options. (line 372)
  16902. * 'finit-integer': Code Gen Options. (line 372)
  16903. * 'finit-local-zero': Code Gen Options. (line 372)
  16904. * 'finit-logical': Code Gen Options. (line 372)
  16905. * 'finit-real': Code Gen Options. (line 372)
  16906. * 'finline-arg-packing': Code Gen Options. (line 304)
  16907. * 'finline-matmul-limit': Code Gen Options. (line 348)
  16908. * 'finteger-4-integer-8': Fortran Dialect Options.
  16909. (line 242)
  16910. * 'fintrinsic-modules-path' DIR: Directory Options. (line 36)
  16911. * 'fmax-array-constructor': Code Gen Options. (line 242)
  16912. * 'fmax-errors='N: Error and Warning Options.
  16913. (line 27)
  16914. * 'fmax-identifier-length='N: Fortran Dialect Options.
  16915. (line 158)
  16916. * 'fmax-stack-var-size': Code Gen Options. (line 260)
  16917. * 'fmax-subrecord-length='LENGTH: Runtime Options. (line 29)
  16918. * 'fmodule-private': Fortran Dialect Options.
  16919. (line 124)
  16920. * 'fno-automatic': Code Gen Options. (line 15)
  16921. * 'fno-backtrace': Debugging Options. (line 86)
  16922. * 'fno-protect-parens': Code Gen Options. (line 420)
  16923. * 'fno-underscoring': Code Gen Options. (line 57)
  16924. * 'fopenacc': Fortran Dialect Options.
  16925. (line 171)
  16926. * 'fopenmp': Fortran Dialect Options.
  16927. (line 178)
  16928. * 'fpack-derived': Code Gen Options. (line 282)
  16929. * 'fpad-source': Fortran Dialect Options.
  16930. (line 143)
  16931. * 'fpp': Preprocessing Options.
  16932. (line 12)
  16933. * 'frange-check': Fortran Dialect Options.
  16934. (line 186)
  16935. * 'freal-4-real-10': Fortran Dialect Options.
  16936. (line 257)
  16937. * 'freal-4-real-16': Fortran Dialect Options.
  16938. (line 257)
  16939. * 'freal-4-real-8': Fortran Dialect Options.
  16940. (line 257)
  16941. * 'freal-8-real-10': Fortran Dialect Options.
  16942. (line 257)
  16943. * 'freal-8-real-16': Fortran Dialect Options.
  16944. (line 257)
  16945. * 'freal-8-real-4': Fortran Dialect Options.
  16946. (line 257)
  16947. * 'frealloc-lhs': Code Gen Options. (line 429)
  16948. * 'frecord-marker='LENGTH: Runtime Options. (line 21)
  16949. * 'frecursive': Code Gen Options. (line 362)
  16950. * 'frepack-arrays': Code Gen Options. (line 288)
  16951. * 'frontend-loop-interchange': Code Gen Options. (line 456)
  16952. * 'frontend-optimize': Code Gen Options. (line 443)
  16953. * 'fsecond-underscore': Code Gen Options. (line 113)
  16954. * 'fshort-enums': Code Gen Options. (line 298)
  16955. * 'fshort-enums' <1>: Fortran 2003 status. (line 92)
  16956. * 'fsign-zero': Runtime Options. (line 34)
  16957. * 'fstack-arrays': Code Gen Options. (line 274)
  16958. * 'fsyntax-only': Error and Warning Options.
  16959. (line 33)
  16960. * 'ftest-forall-temp': Fortran Dialect Options.
  16961. (line 287)
  16962. * 'fworking-directory': Preprocessing Options.
  16963. (line 55)
  16964. * 'H': Preprocessing Options.
  16965. (line 174)
  16966. * 'I'DIR: Directory Options. (line 14)
  16967. * 'idirafter DIR': Preprocessing Options.
  16968. (line 69)
  16969. * 'imultilib DIR': Preprocessing Options.
  16970. (line 76)
  16971. * 'iprefix PREFIX': Preprocessing Options.
  16972. (line 80)
  16973. * 'iquote DIR': Preprocessing Options.
  16974. (line 89)
  16975. * 'isysroot DIR': Preprocessing Options.
  16976. (line 85)
  16977. * 'isystem DIR': Preprocessing Options.
  16978. (line 96)
  16979. * 'J'DIR: Directory Options. (line 29)
  16980. * 'M'DIR: Directory Options. (line 29)
  16981. * 'nostdinc': Preprocessing Options.
  16982. (line 104)
  16983. * 'P': Preprocessing Options.
  16984. (line 179)
  16985. * 'pedantic': Error and Warning Options.
  16986. (line 39)
  16987. * 'pedantic-errors': Error and Warning Options.
  16988. (line 58)
  16989. * 'static-libgfortran': Link Options. (line 11)
  16990. * 'std='STD option: Fortran Dialect Options.
  16991. (line 268)
  16992. * 'tail-call-workaround': Code Gen Options. (line 209)
  16993. * 'UNAME': Preprocessing Options.
  16994. (line 185)
  16995. * 'undef': Preprocessing Options.
  16996. (line 109)
  16997. * 'Waliasing': Error and Warning Options.
  16998. (line 71)
  16999. * 'Walign-commons': Error and Warning Options.
  17000. (line 228)
  17001. * 'Wall': Error and Warning Options.
  17002. (line 62)
  17003. * 'Wampersand': Error and Warning Options.
  17004. (line 88)
  17005. * 'Warray-temporaries': Error and Warning Options.
  17006. (line 96)
  17007. * 'Wc-binding-type': Error and Warning Options.
  17008. (line 101)
  17009. * 'Wcharacter-truncation': Error and Warning Options.
  17010. (line 108)
  17011. * 'Wcompare-reals': Error and Warning Options.
  17012. (line 256)
  17013. * 'Wconversion': Error and Warning Options.
  17014. (line 117)
  17015. * 'Wconversion-extra': Error and Warning Options.
  17016. (line 121)
  17017. * 'Wdo-subscript': Error and Warning Options.
  17018. (line 268)
  17019. * 'Werror': Error and Warning Options.
  17020. (line 280)
  17021. * 'Wextra': Error and Warning Options.
  17022. (line 125)
  17023. * 'Wfrontend-loop-interchange': Error and Warning Options.
  17024. (line 130)
  17025. * 'Wfunction-elimination': Error and Warning Options.
  17026. (line 234)
  17027. * 'Wimplicit-interface': Error and Warning Options.
  17028. (line 134)
  17029. * 'Wimplicit-procedure': Error and Warning Options.
  17030. (line 140)
  17031. * 'Winteger-division': Error and Warning Options.
  17032. (line 144)
  17033. * 'Wintrinsic-shadow': Error and Warning Options.
  17034. (line 206)
  17035. * 'Wintrinsics-std': Error and Warning Options.
  17036. (line 148)
  17037. * 'Wline-truncation': Error and Warning Options.
  17038. (line 111)
  17039. * 'Woverwrite-recursive': Error and Warning Options.
  17040. (line 155)
  17041. * 'Wpedantic': Error and Warning Options.
  17042. (line 39)
  17043. * 'Wreal-q-constant': Error and Warning Options.
  17044. (line 162)
  17045. * 'Wrealloc-lhs': Error and Warning Options.
  17046. (line 239)
  17047. * 'Wrealloc-lhs-all': Error and Warning Options.
  17048. (line 251)
  17049. * 'Wsurprising': Error and Warning Options.
  17050. (line 166)
  17051. * 'Wtabs': Error and Warning Options.
  17052. (line 188)
  17053. * 'Wtargt-lifetime': Error and Warning Options.
  17054. (line 260)
  17055. * 'Wundefined-do-loop': Error and Warning Options.
  17056. (line 196)
  17057. * 'Wunderflow': Error and Warning Options.
  17058. (line 201)
  17059. * 'Wunused-dummy-argument': Error and Warning Options.
  17060. (line 217)
  17061. * 'Wunused-parameter': Error and Warning Options.
  17062. (line 221)
  17063. * 'Wuse-without-only': Error and Warning Options.
  17064. (line 213)
  17065. * 'Wzerotrip': Error and Warning Options.
  17066. (line 264)
  17067. 
  17068. File: gfortran.info, Node: Keyword Index, Prev: Option Index, Up: Top
  17069. Keyword Index
  17070. *************
  17071. �[index�]
  17072. * Menu:
  17073. * '$': Fortran Dialect Options.
  17074. (line 106)
  17075. * '%LOC': Argument list functions.
  17076. (line 6)
  17077. * '%REF': Argument list functions.
  17078. (line 6)
  17079. * '%VAL': Argument list functions.
  17080. (line 6)
  17081. * '&': Error and Warning Options.
  17082. (line 88)
  17083. * '[...]': Fortran 2003 status. (line 78)
  17084. * _gfortran_set_args: _gfortran_set_args. (line 6)
  17085. * _gfortran_set_convert: _gfortran_set_convert.
  17086. (line 6)
  17087. * _gfortran_set_fpe: _gfortran_set_fpe. (line 6)
  17088. * _gfortran_set_max_subrecord_length: _gfortran_set_max_subrecord_length.
  17089. (line 6)
  17090. * _gfortran_set_options: _gfortran_set_options.
  17091. (line 6)
  17092. * _gfortran_set_record_marker: _gfortran_set_record_marker.
  17093. (line 6)
  17094. * ABORT: ABORT. (line 6)
  17095. * ABS: ABS. (line 6)
  17096. * absolute value: ABS. (line 6)
  17097. * ACCESS: ACCESS. (line 6)
  17098. * 'ACCESS='STREAM'' I/O: Fortran 2003 status. (line 102)
  17099. * ACHAR: ACHAR. (line 6)
  17100. * ACOS: ACOS. (line 6)
  17101. * ACOSD: ACOSD. (line 6)
  17102. * ACOSH: ACOSH. (line 6)
  17103. * adjust string: ADJUSTL. (line 6)
  17104. * adjust string <1>: ADJUSTR. (line 6)
  17105. * ADJUSTL: ADJUSTL. (line 6)
  17106. * ADJUSTR: ADJUSTR. (line 6)
  17107. * AIMAG: AIMAG. (line 6)
  17108. * AINT: AINT. (line 6)
  17109. * ALARM: ALARM. (line 6)
  17110. * ALGAMA: LOG_GAMMA. (line 6)
  17111. * aliasing: Error and Warning Options.
  17112. (line 71)
  17113. * alignment of 'COMMON' blocks: Error and Warning Options.
  17114. (line 228)
  17115. * alignment of 'COMMON' blocks <1>: Code Gen Options. (line 408)
  17116. * ALL: ALL. (line 6)
  17117. * all warnings: Error and Warning Options.
  17118. (line 62)
  17119. * 'ALLOCATABLE' components of derived types: Fortran 2003 status.
  17120. (line 100)
  17121. * 'ALLOCATABLE' dummy arguments: Fortran 2003 status. (line 98)
  17122. * 'ALLOCATABLE' function results: Fortran 2003 status. (line 99)
  17123. * ALLOCATED: ALLOCATED. (line 6)
  17124. * allocation, moving: MOVE_ALLOC. (line 6)
  17125. * allocation, status: ALLOCATED. (line 6)
  17126. * ALOG: LOG. (line 6)
  17127. * ALOG10: LOG10. (line 6)
  17128. * AMAX0: MAX. (line 6)
  17129. * AMAX1: MAX. (line 6)
  17130. * AMIN0: MIN. (line 6)
  17131. * AMIN1: MIN. (line 6)
  17132. * AMOD: MOD. (line 6)
  17133. * AND: AND. (line 6)
  17134. * ANINT: ANINT. (line 6)
  17135. * ANY: ANY. (line 6)
  17136. * area hyperbolic cosine: ACOSH. (line 6)
  17137. * area hyperbolic sine: ASINH. (line 6)
  17138. * area hyperbolic tangent: ATANH. (line 6)
  17139. * argument list functions: Argument list functions.
  17140. (line 6)
  17141. * arguments, to program: COMMAND_ARGUMENT_COUNT.
  17142. (line 6)
  17143. * arguments, to program <1>: GETARG. (line 6)
  17144. * arguments, to program <2>: GET_COMMAND. (line 6)
  17145. * arguments, to program <3>: GET_COMMAND_ARGUMENT.
  17146. (line 6)
  17147. * arguments, to program <4>: IARGC. (line 6)
  17148. * array, add elements: SUM. (line 6)
  17149. * array, AND: IALL. (line 6)
  17150. * array, apply condition: ALL. (line 6)
  17151. * array, apply condition <1>: ANY. (line 6)
  17152. * array, bounds checking: Code Gen Options. (line 144)
  17153. * array, change dimensions: RESHAPE. (line 6)
  17154. * array, combine arrays: MERGE. (line 6)
  17155. * array, condition testing: ALL. (line 6)
  17156. * array, condition testing <1>: ANY. (line 6)
  17157. * array, conditionally add elements: SUM. (line 6)
  17158. * array, conditionally count elements: COUNT. (line 6)
  17159. * array, conditionally multiply elements: PRODUCT. (line 6)
  17160. * array, constructors: Fortran 2003 status. (line 78)
  17161. * array, contiguity: IS_CONTIGUOUS. (line 6)
  17162. * array, count elements: SIZE. (line 6)
  17163. * array, duplicate dimensions: SPREAD. (line 6)
  17164. * array, duplicate elements: SPREAD. (line 6)
  17165. * array, element counting: COUNT. (line 6)
  17166. * array, gather elements: PACK. (line 6)
  17167. * array, increase dimension: SPREAD. (line 6)
  17168. * array, increase dimension <1>: UNPACK. (line 6)
  17169. * array, indices of type real: Real array indices. (line 6)
  17170. * array, location of maximum element: MAXLOC. (line 6)
  17171. * array, location of minimum element: MINLOC. (line 6)
  17172. * array, lower bound: LBOUND. (line 6)
  17173. * array, maximum value: MAXVAL. (line 6)
  17174. * array, merge arrays: MERGE. (line 6)
  17175. * array, minimum value: MINVAL. (line 6)
  17176. * array, multiply elements: PRODUCT. (line 6)
  17177. * array, number of elements: COUNT. (line 6)
  17178. * array, number of elements <1>: SIZE. (line 6)
  17179. * array, OR: IANY. (line 6)
  17180. * array, packing: PACK. (line 6)
  17181. * array, parity: IPARITY. (line 6)
  17182. * array, permutation: CSHIFT. (line 6)
  17183. * array, product: PRODUCT. (line 6)
  17184. * array, reduce dimension: PACK. (line 6)
  17185. * array, rotate: CSHIFT. (line 6)
  17186. * array, scatter elements: UNPACK. (line 6)
  17187. * array, shape: SHAPE. (line 6)
  17188. * array, shift: EOSHIFT. (line 6)
  17189. * array, shift circularly: CSHIFT. (line 6)
  17190. * array, size: SIZE. (line 6)
  17191. * array, sum: SUM. (line 6)
  17192. * array, transmogrify: RESHAPE. (line 6)
  17193. * array, transpose: TRANSPOSE. (line 6)
  17194. * array, unpacking: UNPACK. (line 6)
  17195. * array, upper bound: UBOUND. (line 6)
  17196. * array, XOR: IPARITY. (line 6)
  17197. * ASCII collating sequence: ACHAR. (line 6)
  17198. * ASCII collating sequence <1>: IACHAR. (line 6)
  17199. * ASIN: ASIN. (line 6)
  17200. * ASIND: ASIND. (line 6)
  17201. * ASINH: ASINH. (line 6)
  17202. * ASSOCIATED: ASSOCIATED. (line 6)
  17203. * association status: ASSOCIATED. (line 6)
  17204. * association status, C pointer: C_ASSOCIATED. (line 6)
  17205. * asynchronous I/O: Asynchronous I/O. (line 6)
  17206. * ATAN: ATAN. (line 6)
  17207. * ATAN2: ATAN2. (line 6)
  17208. * ATAN2D: ATAN2D. (line 6)
  17209. * ATAND: ATAND. (line 6)
  17210. * ATANH: ATANH. (line 6)
  17211. * Atomic subroutine, add: ATOMIC_ADD. (line 6)
  17212. * Atomic subroutine, ADD with fetch: ATOMIC_FETCH_ADD. (line 6)
  17213. * Atomic subroutine, AND: ATOMIC_AND. (line 6)
  17214. * Atomic subroutine, AND with fetch: ATOMIC_FETCH_AND. (line 6)
  17215. * Atomic subroutine, compare and swap: ATOMIC_CAS. (line 6)
  17216. * Atomic subroutine, define: ATOMIC_DEFINE. (line 6)
  17217. * Atomic subroutine, OR: ATOMIC_OR. (line 6)
  17218. * Atomic subroutine, OR with fetch: ATOMIC_FETCH_OR. (line 6)
  17219. * Atomic subroutine, reference: ATOMIC_REF. (line 6)
  17220. * Atomic subroutine, XOR: ATOMIC_XOR. (line 6)
  17221. * Atomic subroutine, XOR with fetch: ATOMIC_FETCH_XOR. (line 6)
  17222. * ATOMIC_ADD: ATOMIC_ADD. (line 6)
  17223. * ATOMIC_AND: ATOMIC_AND. (line 6)
  17224. * ATOMIC_DEFINE: ATOMIC_CAS. (line 6)
  17225. * ATOMIC_DEFINE <1>: ATOMIC_DEFINE. (line 6)
  17226. * ATOMIC_FETCH_ADD: ATOMIC_FETCH_ADD. (line 6)
  17227. * ATOMIC_FETCH_AND: ATOMIC_FETCH_AND. (line 6)
  17228. * ATOMIC_FETCH_OR: ATOMIC_FETCH_OR. (line 6)
  17229. * ATOMIC_FETCH_XOR: ATOMIC_FETCH_XOR. (line 6)
  17230. * ATOMIC_OR: ATOMIC_OR. (line 6)
  17231. * ATOMIC_REF: ATOMIC_REF. (line 6)
  17232. * ATOMIC_XOR: ATOMIC_XOR. (line 6)
  17233. * Authors: Contributors. (line 6)
  17234. * 'AUTOMATIC': AUTOMATIC and STATIC attributes.
  17235. (line 6)
  17236. * BABS: ABS. (line 6)
  17237. * backslash: Fortran Dialect Options.
  17238. (line 112)
  17239. * 'BACKSPACE': Read/Write after EOF marker.
  17240. (line 6)
  17241. * BACKTRACE: BACKTRACE. (line 6)
  17242. * backtrace: Debugging Options. (line 86)
  17243. * backtrace <1>: BACKTRACE. (line 6)
  17244. * base 10 logarithm function: LOG10. (line 6)
  17245. * BBCLR: IBCLR. (line 6)
  17246. * BBITS: IBITS. (line 6)
  17247. * BBSET: IBSET. (line 6)
  17248. * BBTEST: BTEST. (line 6)
  17249. * BESJ0: BESSEL_J0. (line 6)
  17250. * BESJ1: BESSEL_J1. (line 6)
  17251. * BESJN: BESSEL_JN. (line 6)
  17252. * Bessel function, first kind: BESSEL_J0. (line 6)
  17253. * Bessel function, first kind <1>: BESSEL_J1. (line 6)
  17254. * Bessel function, first kind <2>: BESSEL_JN. (line 6)
  17255. * Bessel function, second kind: BESSEL_Y0. (line 6)
  17256. * Bessel function, second kind <1>: BESSEL_Y1. (line 6)
  17257. * Bessel function, second kind <2>: BESSEL_YN. (line 6)
  17258. * BESSEL_J0: BESSEL_J0. (line 6)
  17259. * BESSEL_J1: BESSEL_J1. (line 6)
  17260. * BESSEL_JN: BESSEL_JN. (line 6)
  17261. * BESSEL_Y0: BESSEL_Y0. (line 6)
  17262. * BESSEL_Y1: BESSEL_Y1. (line 6)
  17263. * BESSEL_YN: BESSEL_YN. (line 6)
  17264. * BESY0: BESSEL_Y0. (line 6)
  17265. * BESY1: BESSEL_Y1. (line 6)
  17266. * BESYN: BESSEL_YN. (line 6)
  17267. * BGE: BGE. (line 6)
  17268. * BGT: BGT. (line 6)
  17269. * BIAND: IAND. (line 6)
  17270. * BIEOR: IEOR. (line 6)
  17271. * binary representation: POPCNT. (line 6)
  17272. * binary representation <1>: POPPAR. (line 6)
  17273. * BIOR: IOR. (line 6)
  17274. * bit intrinsics checking: Code Gen Options. (line 144)
  17275. * BITEST: BTEST. (line 6)
  17276. * bits set: POPCNT. (line 6)
  17277. * bits, AND of array elements: IALL. (line 6)
  17278. * bits, clear: IBCLR. (line 6)
  17279. * bits, extract: IBITS. (line 6)
  17280. * bits, get: IBITS. (line 6)
  17281. * bits, merge: MERGE_BITS. (line 6)
  17282. * bits, move: MVBITS. (line 6)
  17283. * bits, move <1>: TRANSFER. (line 6)
  17284. * bits, negate: NOT. (line 6)
  17285. * bits, number of: BIT_SIZE. (line 6)
  17286. * bits, OR of array elements: IANY. (line 6)
  17287. * bits, set: IBSET. (line 6)
  17288. * bits, shift: ISHFT. (line 6)
  17289. * bits, shift circular: ISHFTC. (line 6)
  17290. * bits, shift left: LSHIFT. (line 6)
  17291. * bits, shift left <1>: SHIFTL. (line 6)
  17292. * bits, shift right: RSHIFT. (line 6)
  17293. * bits, shift right <1>: SHIFTA. (line 6)
  17294. * bits, shift right <2>: SHIFTR. (line 6)
  17295. * bits, testing: BTEST. (line 6)
  17296. * bits, unset: IBCLR. (line 6)
  17297. * bits, XOR of array elements: IPARITY. (line 6)
  17298. * bitwise comparison: BGE. (line 6)
  17299. * bitwise comparison <1>: BGT. (line 6)
  17300. * bitwise comparison <2>: BLE. (line 6)
  17301. * bitwise comparison <3>: BLT. (line 6)
  17302. * bitwise logical and: AND. (line 6)
  17303. * bitwise logical and <1>: IAND. (line 6)
  17304. * bitwise logical exclusive or: IEOR. (line 6)
  17305. * bitwise logical exclusive or <1>: XOR. (line 6)
  17306. * bitwise logical not: NOT. (line 6)
  17307. * bitwise logical or: IOR. (line 6)
  17308. * bitwise logical or <1>: OR. (line 6)
  17309. * BIT_SIZE: BIT_SIZE. (line 6)
  17310. * BJTEST: BTEST. (line 6)
  17311. * BKTEST: BTEST. (line 6)
  17312. * BLE: BLE. (line 6)
  17313. * BLT: BLT. (line 6)
  17314. * BMOD: MOD. (line 6)
  17315. * BMVBITS: MVBITS. (line 6)
  17316. * BNOT: NOT. (line 6)
  17317. * bounds checking: Code Gen Options. (line 144)
  17318. * BOZ literal constants: BOZ literal constants.
  17319. (line 6)
  17320. * BSHFT: ISHFT. (line 6)
  17321. * BSHFTC: ISHFTC. (line 6)
  17322. * BTEST: BTEST. (line 6)
  17323. * CABS: ABS. (line 6)
  17324. * calling convention: Code Gen Options. (line 28)
  17325. * 'CARRIAGECONTROL': Extended I/O specifiers.
  17326. (line 6)
  17327. * CCOS: COS. (line 6)
  17328. * CCOSD: COSD. (line 6)
  17329. * CDABS: ABS. (line 6)
  17330. * CDCOS: COS. (line 6)
  17331. * CDCOSD: COSD. (line 6)
  17332. * CDEXP: EXP. (line 6)
  17333. * CDLOG: LOG. (line 6)
  17334. * CDSIN: SIN. (line 6)
  17335. * CDSIND: SIND. (line 6)
  17336. * CDSQRT: SQRT. (line 6)
  17337. * CEILING: CEILING. (line 6)
  17338. * ceiling: ANINT. (line 6)
  17339. * ceiling <1>: CEILING. (line 6)
  17340. * CEXP: EXP. (line 6)
  17341. * CHAR: CHAR. (line 6)
  17342. * character kind: SELECTED_CHAR_KIND. (line 6)
  17343. * character set: Fortran Dialect Options.
  17344. (line 106)
  17345. * CHDIR: CHDIR. (line 6)
  17346. * checking array temporaries: Code Gen Options. (line 144)
  17347. * checking subscripts: Code Gen Options. (line 144)
  17348. * CHMOD: CHMOD. (line 6)
  17349. * clock ticks: MCLOCK. (line 6)
  17350. * clock ticks <1>: MCLOCK8. (line 6)
  17351. * clock ticks <2>: SYSTEM_CLOCK. (line 6)
  17352. * CLOG: LOG. (line 6)
  17353. * CMPLX: CMPLX. (line 6)
  17354. * coarray, 'IMAGE_INDEX': IMAGE_INDEX. (line 6)
  17355. * coarray, lower bound: LCOBOUND. (line 6)
  17356. * coarray, 'NUM_IMAGES': NUM_IMAGES. (line 6)
  17357. * coarray, 'THIS_IMAGE': THIS_IMAGE. (line 6)
  17358. * coarray, upper bound: UCOBOUND. (line 6)
  17359. * Coarray, _gfortran_caf_atomic_cas: _gfortran_caf_atomic_cas.
  17360. (line 6)
  17361. * Coarray, _gfortran_caf_atomic_define: _gfortran_caf_atomic_define.
  17362. (line 6)
  17363. * Coarray, _gfortran_caf_atomic_op: _gfortran_caf_atomic_op.
  17364. (line 6)
  17365. * Coarray, _gfortran_caf_atomic_ref: _gfortran_caf_atomic_ref.
  17366. (line 6)
  17367. * Coarray, _gfortran_caf_co_broadcast: _gfortran_caf_co_broadcast.
  17368. (line 6)
  17369. * Coarray, _gfortran_caf_co_max: _gfortran_caf_co_max.
  17370. (line 6)
  17371. * Coarray, _gfortran_caf_co_min: _gfortran_caf_co_min.
  17372. (line 6)
  17373. * Coarray, _gfortran_caf_co_reduce: _gfortran_caf_co_reduce.
  17374. (line 6)
  17375. * Coarray, _gfortran_caf_co_sum: _gfortran_caf_co_sum.
  17376. (line 6)
  17377. * Coarray, _gfortran_caf_deregister: _gfortran_caf_deregister.
  17378. (line 6)
  17379. * Coarray, _gfortran_caf_error_stop: _gfortran_caf_error_stop.
  17380. (line 6)
  17381. * Coarray, _gfortran_caf_error_stop_str: _gfortran_caf_error_stop_str.
  17382. (line 6)
  17383. * Coarray, _gfortran_caf_event_post: _gfortran_caf_event_post.
  17384. (line 6)
  17385. * Coarray, _gfortran_caf_event_query: _gfortran_caf_event_query.
  17386. (line 6)
  17387. * Coarray, _gfortran_caf_event_wait: _gfortran_caf_event_wait.
  17388. (line 6)
  17389. * Coarray, _gfortran_caf_failed_images: _gfortran_caf_failed_images.
  17390. (line 6)
  17391. * Coarray, _gfortran_caf_fail_image: _gfortran_caf_fail_image.
  17392. (line 6)
  17393. * Coarray, _gfortran_caf_finish: _gfortran_caf_finish.
  17394. (line 6)
  17395. * Coarray, _gfortran_caf_get: _gfortran_caf_get. (line 6)
  17396. * Coarray, _gfortran_caf_get_by_ref: _gfortran_caf_get_by_ref.
  17397. (line 6)
  17398. * Coarray, _gfortran_caf_image_status: _gfortran_caf_image_status.
  17399. (line 6)
  17400. * Coarray, _gfortran_caf_init: _gfortran_caf_init. (line 6)
  17401. * Coarray, _gfortran_caf_is_present: _gfortran_caf_is_present.
  17402. (line 6)
  17403. * Coarray, _gfortran_caf_lock: _gfortran_caf_lock. (line 6)
  17404. * Coarray, _gfortran_caf_num_images: _gfortran_caf_num_images.
  17405. (line 6)
  17406. * Coarray, _gfortran_caf_register: _gfortran_caf_register.
  17407. (line 6)
  17408. * Coarray, _gfortran_caf_send: _gfortran_caf_send. (line 6)
  17409. * Coarray, _gfortran_caf_sendget: _gfortran_caf_sendget.
  17410. (line 6)
  17411. * Coarray, _gfortran_caf_sendget_by_ref: _gfortran_caf_sendget_by_ref.
  17412. (line 6)
  17413. * Coarray, _gfortran_caf_send_by_ref: _gfortran_caf_send_by_ref.
  17414. (line 6)
  17415. * Coarray, _gfortran_caf_stopped_images: _gfortran_caf_stopped_images.
  17416. (line 6)
  17417. * Coarray, _gfortran_caf_sync_all: _gfortran_caf_sync_all.
  17418. (line 6)
  17419. * Coarray, _gfortran_caf_sync_images: _gfortran_caf_sync_images.
  17420. (line 6)
  17421. * Coarray, _gfortran_caf_sync_memory: _gfortran_caf_sync_memory.
  17422. (line 6)
  17423. * Coarray, _gfortran_caf_this_image: _gfortran_caf_this_image.
  17424. (line 6)
  17425. * Coarray, _gfortran_caf_unlock: _gfortran_caf_unlock.
  17426. (line 6)
  17427. * coarrays: Code Gen Options. (line 130)
  17428. * Coarrays: Coarray Programming. (line 6)
  17429. * code generation, conventions: Code Gen Options. (line 6)
  17430. * collating sequence, ASCII: ACHAR. (line 6)
  17431. * collating sequence, ASCII <1>: IACHAR. (line 6)
  17432. * Collectives, generic reduction: CO_REDUCE. (line 6)
  17433. * Collectives, maximal value: CO_MAX. (line 6)
  17434. * Collectives, minimal value: CO_MIN. (line 6)
  17435. * Collectives, sum of values: CO_SUM. (line 6)
  17436. * Collectives, value broadcasting: CO_BROADCAST. (line 6)
  17437. * command line: EXECUTE_COMMAND_LINE.
  17438. (line 6)
  17439. * command options: Invoking GNU Fortran.
  17440. (line 6)
  17441. * command-line arguments: COMMAND_ARGUMENT_COUNT.
  17442. (line 6)
  17443. * command-line arguments <1>: GETARG. (line 6)
  17444. * command-line arguments <2>: GET_COMMAND. (line 6)
  17445. * command-line arguments <3>: GET_COMMAND_ARGUMENT.
  17446. (line 6)
  17447. * command-line arguments <4>: IARGC. (line 6)
  17448. * command-line arguments, number of: COMMAND_ARGUMENT_COUNT.
  17449. (line 6)
  17450. * command-line arguments, number of <1>: IARGC. (line 6)
  17451. * COMMAND_ARGUMENT_COUNT: COMMAND_ARGUMENT_COUNT.
  17452. (line 6)
  17453. * 'COMMON': Volatile COMMON blocks.
  17454. (line 6)
  17455. * compiler flags inquiry function: COMPILER_OPTIONS. (line 6)
  17456. * compiler, name and version: COMPILER_VERSION. (line 6)
  17457. * COMPILER_OPTIONS: COMPILER_OPTIONS. (line 6)
  17458. * COMPILER_VERSION: COMPILER_VERSION. (line 6)
  17459. * COMPLEX: COMPLEX. (line 6)
  17460. * complex conjugate: CONJG. (line 6)
  17461. * Complex function: Alternate complex function syntax.
  17462. (line 6)
  17463. * complex numbers, conversion to: CMPLX. (line 6)
  17464. * complex numbers, conversion to <1>: COMPLEX. (line 6)
  17465. * complex numbers, conversion to <2>: DCMPLX. (line 6)
  17466. * complex numbers, imaginary part: AIMAG. (line 6)
  17467. * complex numbers, real part: DREAL. (line 6)
  17468. * complex numbers, real part <1>: REAL. (line 6)
  17469. * Conditional compilation: Preprocessing and conditional compilation.
  17470. (line 6)
  17471. * CONJG: CONJG. (line 6)
  17472. * consistency, durability: Data consistency and durability.
  17473. (line 6)
  17474. * Contributing: Contributing. (line 6)
  17475. * Contributors: Contributors. (line 6)
  17476. * conversion: Error and Warning Options.
  17477. (line 117)
  17478. * conversion <1>: Error and Warning Options.
  17479. (line 121)
  17480. * conversion, to character: Character conversion.
  17481. (line 6)
  17482. * conversion, to character <1>: CHAR. (line 6)
  17483. * conversion, to complex: CMPLX. (line 6)
  17484. * conversion, to complex <1>: COMPLEX. (line 6)
  17485. * conversion, to complex <2>: DCMPLX. (line 6)
  17486. * conversion, to integer: Implicitly convert LOGICAL and INTEGER values.
  17487. (line 6)
  17488. * conversion, to integer <1>: IACHAR. (line 6)
  17489. * conversion, to integer <2>: ICHAR. (line 6)
  17490. * conversion, to integer <3>: INT. (line 6)
  17491. * conversion, to integer <4>: INT2. (line 6)
  17492. * conversion, to integer <5>: INT8. (line 6)
  17493. * conversion, to integer <6>: LONG. (line 6)
  17494. * conversion, to logical: Implicitly convert LOGICAL and INTEGER values.
  17495. (line 6)
  17496. * conversion, to logical <1>: LOGICAL. (line 6)
  17497. * conversion, to real: DBLE. (line 6)
  17498. * conversion, to real <1>: REAL. (line 6)
  17499. * conversion, to string: CTIME. (line 6)
  17500. * 'CONVERT' specifier: CONVERT specifier. (line 6)
  17501. * core, dump: ABORT. (line 6)
  17502. * COS: COS. (line 6)
  17503. * COSD: COSD. (line 6)
  17504. * COSH: COSH. (line 6)
  17505. * cosine: COS. (line 6)
  17506. * cosine, degrees: COSD. (line 6)
  17507. * cosine, hyperbolic: COSH. (line 6)
  17508. * cosine, hyperbolic, inverse: ACOSH. (line 6)
  17509. * cosine, inverse: ACOS. (line 6)
  17510. * cosine, inverse, degrees: ACOSD. (line 6)
  17511. * COTAN: COTAN. (line 6)
  17512. * COTAND: COTAND. (line 6)
  17513. * cotangent: COTAN. (line 6)
  17514. * cotangent, degrees: COTAND. (line 6)
  17515. * COUNT: COUNT. (line 6)
  17516. * CO_BROADCAST: CO_BROADCAST. (line 6)
  17517. * CO_MAX: CO_MAX. (line 6)
  17518. * CO_MIN: CO_MIN. (line 6)
  17519. * CO_REDUCE: CO_REDUCE. (line 6)
  17520. * CO_SUM: CO_SUM. (line 6)
  17521. * CPP: Preprocessing and conditional compilation.
  17522. (line 6)
  17523. * CPP <1>: Preprocessing Options.
  17524. (line 6)
  17525. * CPU_TIME: CPU_TIME. (line 6)
  17526. * Credits: Contributors. (line 6)
  17527. * CSHIFT: CSHIFT. (line 6)
  17528. * CSIN: SIN. (line 6)
  17529. * CSIND: SIND. (line 6)
  17530. * CSQRT: SQRT. (line 6)
  17531. * CTIME: CTIME. (line 6)
  17532. * current date: DATE_AND_TIME. (line 6)
  17533. * current date <1>: FDATE. (line 6)
  17534. * current date <2>: IDATE. (line 6)
  17535. * current time: DATE_AND_TIME. (line 6)
  17536. * current time <1>: FDATE. (line 6)
  17537. * current time <2>: ITIME. (line 6)
  17538. * current time <3>: TIME. (line 6)
  17539. * current time <4>: TIME8. (line 6)
  17540. * C_ASSOCIATED: C_ASSOCIATED. (line 6)
  17541. * C_FUNLOC: C_FUNLOC. (line 6)
  17542. * C_F_POINTER: C_F_POINTER. (line 6)
  17543. * C_F_PROCPOINTER: C_F_PROCPOINTER. (line 6)
  17544. * C_LOC: C_LOC. (line 6)
  17545. * C_SIZEOF: C_SIZEOF. (line 6)
  17546. * DABS: ABS. (line 6)
  17547. * DACOS: ACOS. (line 6)
  17548. * DACOSD: ACOSD. (line 6)
  17549. * DACOSH: ACOSH. (line 6)
  17550. * DASIN: ASIN. (line 6)
  17551. * DASIND: ASIND. (line 6)
  17552. * DASINH: ASINH. (line 6)
  17553. * DATAN: ATAN. (line 6)
  17554. * DATAN2: ATAN2. (line 6)
  17555. * DATAN2D: ATAN2D. (line 6)
  17556. * DATAND: ATAND. (line 6)
  17557. * DATANH: ATANH. (line 6)
  17558. * date, current: DATE_AND_TIME. (line 6)
  17559. * date, current <1>: FDATE. (line 6)
  17560. * date, current <2>: IDATE. (line 6)
  17561. * DATE_AND_TIME: DATE_AND_TIME. (line 6)
  17562. * DBESJ0: BESSEL_J0. (line 6)
  17563. * DBESJ1: BESSEL_J1. (line 6)
  17564. * DBESJN: BESSEL_JN. (line 6)
  17565. * DBESY0: BESSEL_Y0. (line 6)
  17566. * DBESY1: BESSEL_Y1. (line 6)
  17567. * DBESYN: BESSEL_YN. (line 6)
  17568. * DBLE: DBLE. (line 6)
  17569. * DCMPLX: DCMPLX. (line 6)
  17570. * DCONJG: CONJG. (line 6)
  17571. * DCOS: COS. (line 6)
  17572. * DCOSD: COSD. (line 6)
  17573. * DCOSH: COSH. (line 6)
  17574. * DCOTAN: COTAN. (line 6)
  17575. * DCOTAND: COTAND. (line 6)
  17576. * DDIM: DIM. (line 6)
  17577. * debugging information options: Debugging Options. (line 6)
  17578. * debugging, preprocessor: Preprocessing Options.
  17579. (line 26)
  17580. * debugging, preprocessor <1>: Preprocessing Options.
  17581. (line 35)
  17582. * debugging, preprocessor <2>: Preprocessing Options.
  17583. (line 41)
  17584. * debugging, preprocessor <3>: Preprocessing Options.
  17585. (line 44)
  17586. * debugging, preprocessor <4>: Preprocessing Options.
  17587. (line 51)
  17588. * 'DECODE': ENCODE and DECODE statements.
  17589. (line 6)
  17590. * delayed execution: ALARM. (line 6)
  17591. * delayed execution <1>: SLEEP. (line 6)
  17592. * DEXP: EXP. (line 6)
  17593. * DFLOAT: REAL. (line 6)
  17594. * DGAMMA: GAMMA. (line 6)
  17595. * dialect options: Fortran Dialect Options.
  17596. (line 6)
  17597. * DIGITS: DIGITS. (line 6)
  17598. * DIM: DIM. (line 6)
  17599. * DIMAG: AIMAG. (line 6)
  17600. * DINT: AINT. (line 6)
  17601. * directive, 'INCLUDE': Directory Options. (line 6)
  17602. * directory, options: Directory Options. (line 6)
  17603. * directory, search paths for inclusion: Directory Options. (line 14)
  17604. * division, modulo: MODULO. (line 6)
  17605. * division, remainder: MOD. (line 6)
  17606. * DLGAMA: LOG_GAMMA. (line 6)
  17607. * DLOG: LOG. (line 6)
  17608. * DLOG10: LOG10. (line 6)
  17609. * DMAX1: MAX. (line 6)
  17610. * DMIN1: MIN. (line 6)
  17611. * DMOD: MOD. (line 6)
  17612. * DNINT: ANINT. (line 6)
  17613. * dot product: DOT_PRODUCT. (line 6)
  17614. * DOT_PRODUCT: DOT_PRODUCT. (line 6)
  17615. * DPROD: DPROD. (line 6)
  17616. * DREAL: DREAL. (line 6)
  17617. * DSHIFTL: DSHIFTL. (line 6)
  17618. * DSHIFTR: DSHIFTR. (line 6)
  17619. * DSIGN: SIGN. (line 6)
  17620. * DSIN: SIN. (line 6)
  17621. * DSIND: SIND. (line 6)
  17622. * DSINH: SINH. (line 6)
  17623. * DSQRT: SQRT. (line 6)
  17624. * DTAN: TAN. (line 6)
  17625. * DTAND: TAND. (line 6)
  17626. * DTANH: TANH. (line 6)
  17627. * DTIME: DTIME. (line 6)
  17628. * dummy argument, unused: Error and Warning Options.
  17629. (line 217)
  17630. * elapsed time: DTIME. (line 6)
  17631. * elapsed time <1>: SECNDS. (line 6)
  17632. * elapsed time <2>: SECOND. (line 6)
  17633. * Elimination of functions with identical argument lists: Code Gen Options.
  17634. (line 435)
  17635. * 'ENCODE': ENCODE and DECODE statements.
  17636. (line 6)
  17637. * 'ENUM' statement: Fortran 2003 status. (line 92)
  17638. * 'ENUMERATOR' statement: Fortran 2003 status. (line 92)
  17639. * environment variable: Environment Variables.
  17640. (line 6)
  17641. * environment variable <1>: Runtime. (line 6)
  17642. * environment variable <2>: GETENV. (line 6)
  17643. * environment variable <3>: GET_ENVIRONMENT_VARIABLE.
  17644. (line 6)
  17645. * 'EOF': Read/Write after EOF marker.
  17646. (line 6)
  17647. * EOSHIFT: EOSHIFT. (line 6)
  17648. * EPSILON: EPSILON. (line 6)
  17649. * ERF: ERF. (line 6)
  17650. * ERFC: ERFC. (line 6)
  17651. * ERFC_SCALED: ERFC_SCALED. (line 6)
  17652. * error function: ERF. (line 6)
  17653. * error function, complementary: ERFC. (line 6)
  17654. * error function, complementary, exponentially-scaled: ERFC_SCALED.
  17655. (line 6)
  17656. * errors, limiting: Error and Warning Options.
  17657. (line 27)
  17658. * escape characters: Fortran Dialect Options.
  17659. (line 112)
  17660. * ETIME: ETIME. (line 6)
  17661. * Euclidean distance: HYPOT. (line 6)
  17662. * Euclidean vector norm: NORM2. (line 6)
  17663. * Events, EVENT_QUERY: EVENT_QUERY. (line 6)
  17664. * EVENT_QUERY: EVENT_QUERY. (line 6)
  17665. * EXECUTE_COMMAND_LINE: EXECUTE_COMMAND_LINE.
  17666. (line 6)
  17667. * EXIT: EXIT. (line 6)
  17668. * EXP: EXP. (line 6)
  17669. * EXPONENT: EXPONENT. (line 6)
  17670. * exponent: Default exponents. (line 6)
  17671. * exponential function: EXP. (line 6)
  17672. * exponential function, inverse: LOG. (line 6)
  17673. * exponential function, inverse <1>: LOG10. (line 6)
  17674. * expression size: C_SIZEOF. (line 6)
  17675. * expression size <1>: SIZEOF. (line 6)
  17676. * EXTENDS_TYPE_OF: EXTENDS_TYPE_OF. (line 6)
  17677. * extensions: Extensions. (line 6)
  17678. * extensions, implemented: Extensions implemented in GNU Fortran.
  17679. (line 6)
  17680. * extensions, not implemented: Extensions not implemented in GNU Fortran.
  17681. (line 6)
  17682. * extra warnings: Error and Warning Options.
  17683. (line 125)
  17684. * 'f2c' calling convention: Code Gen Options. (line 28)
  17685. * 'f2c' calling convention <1>: Code Gen Options. (line 113)
  17686. * Factorial function: GAMMA. (line 6)
  17687. * FDATE: FDATE. (line 6)
  17688. * FDL, GNU Free Documentation License: GNU Free Documentation License.
  17689. (line 6)
  17690. * FGET: FGET. (line 6)
  17691. * FGETC: FGETC. (line 6)
  17692. * file format, fixed: Fortran Dialect Options.
  17693. (line 11)
  17694. * file format, fixed <1>: Fortran Dialect Options.
  17695. (line 129)
  17696. * file format, free: Fortran Dialect Options.
  17697. (line 11)
  17698. * file format, free <1>: Fortran Dialect Options.
  17699. (line 151)
  17700. * file operation, file number: FNUM. (line 6)
  17701. * file operation, flush: FLUSH. (line 6)
  17702. * file operation, position: FSEEK. (line 6)
  17703. * file operation, position <1>: FTELL. (line 6)
  17704. * file operation, read character: FGET. (line 6)
  17705. * file operation, read character <1>: FGETC. (line 6)
  17706. * file operation, seek: FSEEK. (line 6)
  17707. * file operation, write character: FPUT. (line 6)
  17708. * file operation, write character <1>: FPUTC. (line 6)
  17709. * file system, access mode: ACCESS. (line 6)
  17710. * file system, change access mode: CHMOD. (line 6)
  17711. * file system, create link: LINK. (line 6)
  17712. * file system, create link <1>: SYMLNK. (line 6)
  17713. * file system, file creation mask: UMASK. (line 6)
  17714. * file system, file status: FSTAT. (line 6)
  17715. * file system, file status <1>: LSTAT. (line 6)
  17716. * file system, file status <2>: STAT. (line 6)
  17717. * file system, hard link: LINK. (line 6)
  17718. * file system, remove file: UNLINK. (line 6)
  17719. * file system, rename file: RENAME. (line 6)
  17720. * file system, soft link: SYMLNK. (line 6)
  17721. * file, symbolic link: File operations on symbolic links.
  17722. (line 6)
  17723. * file, unformatted sequential: File format of unformatted sequential files.
  17724. (line 6)
  17725. * FINDLOC: FINDLOC. (line 6)
  17726. * findloc: FINDLOC. (line 6)
  17727. * flags inquiry function: COMPILER_OPTIONS. (line 6)
  17728. * FLOAT: REAL. (line 6)
  17729. * FLOATI: REAL. (line 6)
  17730. * floating point, exponent: EXPONENT. (line 6)
  17731. * floating point, fraction: FRACTION. (line 6)
  17732. * floating point, nearest different: NEAREST. (line 6)
  17733. * floating point, relative spacing: RRSPACING. (line 6)
  17734. * floating point, relative spacing <1>: SPACING. (line 6)
  17735. * floating point, scale: SCALE. (line 6)
  17736. * floating point, set exponent: SET_EXPONENT. (line 6)
  17737. * FLOATJ: REAL. (line 6)
  17738. * FLOATK: REAL. (line 6)
  17739. * FLOOR: FLOOR. (line 6)
  17740. * floor: AINT. (line 6)
  17741. * floor <1>: FLOOR. (line 6)
  17742. * FLUSH: FLUSH. (line 6)
  17743. * 'FLUSH' statement: Fortran 2003 status. (line 88)
  17744. * FNUM: FNUM. (line 6)
  17745. * form feed whitespace: Form feed as whitespace.
  17746. (line 6)
  17747. * 'FORMAT': Variable FORMAT expressions.
  17748. (line 6)
  17749. * Fortran 77: GNU Fortran and G77. (line 6)
  17750. * FPP: Preprocessing and conditional compilation.
  17751. (line 6)
  17752. * FPUT: FPUT. (line 6)
  17753. * FPUTC: FPUTC. (line 6)
  17754. * FRACTION: FRACTION. (line 6)
  17755. * FREE: FREE. (line 6)
  17756. * Front-end optimization: Code Gen Options. (line 443)
  17757. * FSEEK: FSEEK. (line 6)
  17758. * FSTAT: FSTAT. (line 6)
  17759. * FTELL: FTELL. (line 6)
  17760. * function elimination: Error and Warning Options.
  17761. (line 234)
  17762. * 'g77': GNU Fortran and G77. (line 6)
  17763. * 'g77' calling convention: Code Gen Options. (line 28)
  17764. * 'g77' calling convention <1>: Code Gen Options. (line 113)
  17765. * GAMMA: GAMMA. (line 6)
  17766. * Gamma function: GAMMA. (line 6)
  17767. * Gamma function, logarithm of: LOG_GAMMA. (line 6)
  17768. * GCC: GNU Fortran and GCC. (line 6)
  17769. * Generating C prototypes from external procedures: Interoperability Options.
  17770. (line 25)
  17771. * Generating C prototypes from Fortran BIND(C) enteties: Interoperability Options.
  17772. (line 7)
  17773. * GERROR: GERROR. (line 6)
  17774. * GETARG: GETARG. (line 6)
  17775. * GETCWD: GETCWD. (line 6)
  17776. * GETENV: GETENV. (line 6)
  17777. * GETGID: GETGID. (line 6)
  17778. * GETLOG: GETLOG. (line 6)
  17779. * GETPID: GETPID. (line 6)
  17780. * GETUID: GETUID. (line 6)
  17781. * GET_COMMAND: GET_COMMAND. (line 6)
  17782. * GET_COMMAND_ARGUMENT: GET_COMMAND_ARGUMENT.
  17783. (line 6)
  17784. * GET_ENVIRONMENT_VARIABLE: GET_ENVIRONMENT_VARIABLE.
  17785. (line 6)
  17786. * GMTIME: GMTIME. (line 6)
  17787. * GNU Compiler Collection: GNU Fortran and GCC. (line 6)
  17788. * GNU Fortran command options: Invoking GNU Fortran.
  17789. (line 6)
  17790. * Hollerith constants: Hollerith constants support.
  17791. (line 6)
  17792. * HOSTNM: HOSTNM. (line 6)
  17793. * HUGE: HUGE. (line 6)
  17794. * hyperbolic cosine: COSH. (line 6)
  17795. * hyperbolic function, cosine: COSH. (line 6)
  17796. * hyperbolic function, cosine, inverse: ACOSH. (line 6)
  17797. * hyperbolic function, sine: SINH. (line 6)
  17798. * hyperbolic function, sine, inverse: ASINH. (line 6)
  17799. * hyperbolic function, tangent: TANH. (line 6)
  17800. * hyperbolic function, tangent, inverse: ATANH. (line 6)
  17801. * hyperbolic sine: SINH. (line 6)
  17802. * hyperbolic tangent: TANH. (line 6)
  17803. * HYPOT: HYPOT. (line 6)
  17804. * I/O item lists: I/O item lists. (line 6)
  17805. * I/O specifiers: Extended I/O specifiers.
  17806. (line 6)
  17807. * IABS: ABS. (line 6)
  17808. * IACHAR: IACHAR. (line 6)
  17809. * IALL: IALL. (line 6)
  17810. * IAND: IAND. (line 6)
  17811. * IANY: IANY. (line 6)
  17812. * IARGC: IARGC. (line 6)
  17813. * IBCLR: IBCLR. (line 6)
  17814. * IBITS: IBITS. (line 6)
  17815. * IBSET: IBSET. (line 6)
  17816. * ICHAR: ICHAR. (line 6)
  17817. * IDATE: IDATE. (line 6)
  17818. * IDIM: DIM. (line 6)
  17819. * IDINT: INT. (line 6)
  17820. * IDNINT: NINT. (line 6)
  17821. * IEEE, ISNAN: ISNAN. (line 6)
  17822. * IEOR: IEOR. (line 6)
  17823. * IERRNO: IERRNO. (line 6)
  17824. * IFIX: INT. (line 6)
  17825. * IIABS: ABS. (line 6)
  17826. * IIAND: IAND. (line 6)
  17827. * IIBCLR: IBCLR. (line 6)
  17828. * IIBITS: IBITS. (line 6)
  17829. * IIBSET: IBSET. (line 6)
  17830. * IIEOR: IEOR. (line 6)
  17831. * IIOR: IOR. (line 6)
  17832. * IISHFT: ISHFT. (line 6)
  17833. * IISHFTC: ISHFTC. (line 6)
  17834. * IMAG: AIMAG. (line 6)
  17835. * images, cosubscript to image index conversion: IMAGE_INDEX. (line 6)
  17836. * images, index of this image: THIS_IMAGE. (line 6)
  17837. * images, number of: NUM_IMAGES. (line 6)
  17838. * IMAGE_INDEX: IMAGE_INDEX. (line 6)
  17839. * IMAGPART: AIMAG. (line 6)
  17840. * IMOD: MOD. (line 6)
  17841. * 'IMPORT' statement: Fortran 2003 status. (line 119)
  17842. * IMVBITS: MVBITS. (line 6)
  17843. * 'INCLUDE' directive: Directory Options. (line 6)
  17844. * inclusion, directory search paths for: Directory Options. (line 14)
  17845. * INDEX: INDEX intrinsic. (line 6)
  17846. * INOT: NOT. (line 6)
  17847. * input/output, asynchronous: Asynchronous I/O. (line 6)
  17848. * INT: INT. (line 6)
  17849. * INT2: INT2. (line 6)
  17850. * INT8: INT8. (line 6)
  17851. * integer kind: SELECTED_INT_KIND. (line 6)
  17852. * Interoperability: Mixed-Language Programming.
  17853. (line 6)
  17854. * intrinsic: Error and Warning Options.
  17855. (line 206)
  17856. * intrinsic <1>: Error and Warning Options.
  17857. (line 213)
  17858. * intrinsic Modules: Intrinsic Modules. (line 6)
  17859. * intrinsic procedures: Intrinsic Procedures.
  17860. (line 6)
  17861. * intrinsics, integer: Type variants for integer intrinsics.
  17862. (line 6)
  17863. * intrinsics, math: Extended math intrinsics.
  17864. (line 6)
  17865. * intrinsics, trigonometric functions: Extended math intrinsics.
  17866. (line 6)
  17867. * Introduction: Top. (line 6)
  17868. * inverse hyperbolic cosine: ACOSH. (line 6)
  17869. * inverse hyperbolic sine: ASINH. (line 6)
  17870. * inverse hyperbolic tangent: ATANH. (line 6)
  17871. * 'IOMSG=' specifier: Fortran 2003 status. (line 90)
  17872. * IOR: IOR. (line 6)
  17873. * 'IOSTAT', end of file: IS_IOSTAT_END. (line 6)
  17874. * 'IOSTAT', end of record: IS_IOSTAT_EOR. (line 6)
  17875. * IPARITY: IPARITY. (line 6)
  17876. * IRAND: IRAND. (line 6)
  17877. * ISATTY: ISATTY. (line 6)
  17878. * ISHFT: ISHFT. (line 6)
  17879. * ISHFTC: ISHFTC. (line 6)
  17880. * ISIGN: SIGN. (line 6)
  17881. * ISNAN: ISNAN. (line 6)
  17882. * 'ISO_FORTRAN_ENV' statement: Fortran 2003 status. (line 127)
  17883. * IS_IOSTAT_END: IS_IOSTAT_END. (line 6)
  17884. * IS_IOSTAT_EOR: IS_CONTIGUOUS. (line 6)
  17885. * IS_IOSTAT_EOR <1>: IS_IOSTAT_EOR. (line 6)
  17886. * ITIME: ITIME. (line 6)
  17887. * JIABS: ABS. (line 6)
  17888. * JIAND: IAND. (line 6)
  17889. * JIBCLR: IBCLR. (line 6)
  17890. * JIBITS: IBITS. (line 6)
  17891. * JIBSET: IBSET. (line 6)
  17892. * JIEOR: IEOR. (line 6)
  17893. * JIOR: IOR. (line 6)
  17894. * JISHFT: ISHFT. (line 6)
  17895. * JISHFTC: ISHFTC. (line 6)
  17896. * JMOD: MOD. (line 6)
  17897. * JMVBITS: MVBITS. (line 6)
  17898. * JNOT: NOT. (line 6)
  17899. * KIABS: ABS. (line 6)
  17900. * KIAND: IAND. (line 6)
  17901. * KIBCLR: IBCLR. (line 6)
  17902. * KIBITS: IBITS. (line 6)
  17903. * KIBSET: IBSET. (line 6)
  17904. * KIEOR: IEOR. (line 6)
  17905. * KILL: KILL. (line 6)
  17906. * kind: KIND Type Parameters.
  17907. (line 6)
  17908. * KIND: KIND. (line 6)
  17909. * kind <1>: KIND. (line 6)
  17910. * kind, character: SELECTED_CHAR_KIND. (line 6)
  17911. * kind, integer: SELECTED_INT_KIND. (line 6)
  17912. * kind, old-style: Old-style kind specifications.
  17913. (line 6)
  17914. * kind, real: SELECTED_REAL_KIND. (line 6)
  17915. * KIOR: IOR. (line 6)
  17916. * KISHFT: ISHFT. (line 6)
  17917. * KISHFTC: ISHFTC. (line 6)
  17918. * KMOD: MOD. (line 6)
  17919. * KMVBITS: MVBITS. (line 6)
  17920. * KNOT: NOT. (line 6)
  17921. * L2 vector norm: NORM2. (line 6)
  17922. * language, dialect options: Fortran Dialect Options.
  17923. (line 6)
  17924. * LBOUND: LBOUND. (line 6)
  17925. * LCOBOUND: LCOBOUND. (line 6)
  17926. * LEADZ: LEADZ. (line 6)
  17927. * left shift, combined: DSHIFTL. (line 6)
  17928. * LEN: LEN. (line 6)
  17929. * LEN_TRIM: LEN_TRIM. (line 6)
  17930. * lexical comparison of strings: LGE. (line 6)
  17931. * lexical comparison of strings <1>: LGT. (line 6)
  17932. * lexical comparison of strings <2>: LLE. (line 6)
  17933. * lexical comparison of strings <3>: LLT. (line 6)
  17934. * LGAMMA: LOG_GAMMA. (line 6)
  17935. * LGE: LGE. (line 6)
  17936. * LGT: LGT. (line 6)
  17937. * libf2c calling convention: Code Gen Options. (line 28)
  17938. * libf2c calling convention <1>: Code Gen Options. (line 113)
  17939. * libgfortran initialization, set_args: _gfortran_set_args. (line 6)
  17940. * libgfortran initialization, set_convert: _gfortran_set_convert.
  17941. (line 6)
  17942. * libgfortran initialization, set_fpe: _gfortran_set_fpe. (line 6)
  17943. * libgfortran initialization, set_max_subrecord_length: _gfortran_set_max_subrecord_length.
  17944. (line 6)
  17945. * libgfortran initialization, set_options: _gfortran_set_options.
  17946. (line 6)
  17947. * libgfortran initialization, set_record_marker: _gfortran_set_record_marker.
  17948. (line 6)
  17949. * limits, largest number: HUGE. (line 6)
  17950. * limits, smallest number: TINY. (line 6)
  17951. * LINK: LINK. (line 6)
  17952. * linking, static: Link Options. (line 6)
  17953. * LLE: LLE. (line 6)
  17954. * LLT: LLT. (line 6)
  17955. * LNBLNK: LNBLNK. (line 6)
  17956. * LOC: %LOC as an rvalue. (line 6)
  17957. * LOC <1>: LOC. (line 6)
  17958. * location of a variable in memory: LOC. (line 6)
  17959. * LOG: LOG. (line 6)
  17960. * LOG10: LOG10. (line 6)
  17961. * logarithm function: LOG. (line 6)
  17962. * logarithm function with base 10: LOG10. (line 6)
  17963. * logarithm function, inverse: EXP. (line 6)
  17964. * LOGICAL: LOGICAL. (line 6)
  17965. * logical and, bitwise: AND. (line 6)
  17966. * logical and, bitwise <1>: IAND. (line 6)
  17967. * logical exclusive or, bitwise: IEOR. (line 6)
  17968. * logical exclusive or, bitwise <1>: XOR. (line 6)
  17969. * logical not, bitwise: NOT. (line 6)
  17970. * logical or, bitwise: IOR. (line 6)
  17971. * logical or, bitwise <1>: OR. (line 6)
  17972. * logical, bitwise: Bitwise logical operators.
  17973. (line 6)
  17974. * logical, variable representation: Internal representation of LOGICAL variables.
  17975. (line 6)
  17976. * login name: GETLOG. (line 6)
  17977. * LOG_GAMMA: LOG_GAMMA. (line 6)
  17978. * LONG: LONG. (line 6)
  17979. * loop interchange, Fortran: Code Gen Options. (line 456)
  17980. * loop interchange, warning: Error and Warning Options.
  17981. (line 130)
  17982. * LSHIFT: LSHIFT. (line 6)
  17983. * LSTAT: LSTAT. (line 6)
  17984. * LTIME: LTIME. (line 6)
  17985. * MALLOC: MALLOC. (line 6)
  17986. * 'MAP': UNION and MAP. (line 6)
  17987. * mask, left justified: MASKL. (line 6)
  17988. * mask, right justified: MASKR. (line 6)
  17989. * MASKL: MASKL. (line 6)
  17990. * MASKR: MASKR. (line 6)
  17991. * MATMUL: MATMUL. (line 6)
  17992. * matrix multiplication: MATMUL. (line 6)
  17993. * matrix, transpose: TRANSPOSE. (line 6)
  17994. * MAX: MAX. (line 6)
  17995. * MAX, MIN, NaN: MAX and MIN intrinsics with REAL NaN arguments.
  17996. (line 6)
  17997. * MAX0: MAX. (line 6)
  17998. * MAX1: MAX. (line 6)
  17999. * MAXEXPONENT: MAXEXPONENT. (line 6)
  18000. * maximum value: MAX. (line 6)
  18001. * maximum value <1>: MAXVAL. (line 6)
  18002. * MAXLOC: MAXLOC. (line 6)
  18003. * MAXVAL: MAXVAL. (line 6)
  18004. * MCLOCK: MCLOCK. (line 6)
  18005. * MCLOCK8: MCLOCK8. (line 6)
  18006. * memory checking: Code Gen Options. (line 144)
  18007. * MERGE: MERGE. (line 6)
  18008. * MERGE_BITS: MERGE_BITS. (line 6)
  18009. * messages, error: Error and Warning Options.
  18010. (line 6)
  18011. * messages, warning: Error and Warning Options.
  18012. (line 6)
  18013. * MIN: MIN. (line 6)
  18014. * MIN0: MIN. (line 6)
  18015. * MIN1: MIN. (line 6)
  18016. * MINEXPONENT: MINEXPONENT. (line 6)
  18017. * minimum value: MIN. (line 6)
  18018. * minimum value <1>: MINVAL. (line 6)
  18019. * MINLOC: MINLOC. (line 6)
  18020. * MINVAL: MINVAL. (line 6)
  18021. * Mixed-language programming: Mixed-Language Programming.
  18022. (line 6)
  18023. * MOD: MOD. (line 6)
  18024. * model representation, base: RADIX. (line 6)
  18025. * model representation, epsilon: EPSILON. (line 6)
  18026. * model representation, largest number: HUGE. (line 6)
  18027. * model representation, maximum exponent: MAXEXPONENT. (line 6)
  18028. * model representation, minimum exponent: MINEXPONENT. (line 6)
  18029. * model representation, precision: PRECISION. (line 6)
  18030. * model representation, radix: RADIX. (line 6)
  18031. * model representation, range: RANGE. (line 6)
  18032. * model representation, significant digits: DIGITS. (line 6)
  18033. * model representation, smallest number: TINY. (line 6)
  18034. * module entities: Fortran Dialect Options.
  18035. (line 124)
  18036. * module search path: Directory Options. (line 14)
  18037. * module search path <1>: Directory Options. (line 29)
  18038. * module search path <2>: Directory Options. (line 36)
  18039. * MODULO: MODULO. (line 6)
  18040. * modulo: MODULO. (line 6)
  18041. * MOVE_ALLOC: MOVE_ALLOC. (line 6)
  18042. * moving allocation: MOVE_ALLOC. (line 6)
  18043. * multiply array elements: PRODUCT. (line 6)
  18044. * MVBITS: MVBITS. (line 6)
  18045. * 'NAME': OPEN( ... NAME=). (line 6)
  18046. * Namelist: Extensions to namelist.
  18047. (line 6)
  18048. * natural logarithm function: LOG. (line 6)
  18049. * NEAREST: NEAREST. (line 6)
  18050. * newline: NEW_LINE. (line 6)
  18051. * NEW_LINE: NEW_LINE. (line 6)
  18052. * NINT: NINT. (line 6)
  18053. * norm, Euclidean: NORM2. (line 6)
  18054. * NORM2: NORM2. (line 6)
  18055. * 'NOSHARED': Extended I/O specifiers.
  18056. (line 6)
  18057. * NOT: NOT. (line 6)
  18058. * NULL: NULL. (line 6)
  18059. * NUM_IMAGES: NUM_IMAGES. (line 6)
  18060. * open, action: Files opened without an explicit ACTION= specifier.
  18061. (line 6)
  18062. * OpenACC: Fortran Dialect Options.
  18063. (line 171)
  18064. * OpenACC <1>: OpenACC. (line 6)
  18065. * OpenMP: Fortran Dialect Options.
  18066. (line 178)
  18067. * OpenMP <1>: OpenMP. (line 6)
  18068. * operators, unary: Unary operators. (line 6)
  18069. * operators, xor: .XOR. operator. (line 6)
  18070. * options inquiry function: COMPILER_OPTIONS. (line 6)
  18071. * options, code generation: Code Gen Options. (line 6)
  18072. * options, debugging: Debugging Options. (line 6)
  18073. * options, dialect: Fortran Dialect Options.
  18074. (line 6)
  18075. * options, directory search: Directory Options. (line 6)
  18076. * options, errors: Error and Warning Options.
  18077. (line 6)
  18078. * options, Fortran dialect: Fortran Dialect Options.
  18079. (line 11)
  18080. * options, 'gfortran' command: Invoking GNU Fortran.
  18081. (line 6)
  18082. * options, linking: Link Options. (line 6)
  18083. * options, negative forms: Invoking GNU Fortran.
  18084. (line 13)
  18085. * options, preprocessor: Preprocessing Options.
  18086. (line 6)
  18087. * options, real kind type promotion: Fortran Dialect Options.
  18088. (line 257)
  18089. * options, run-time: Code Gen Options. (line 6)
  18090. * options, runtime: Runtime Options. (line 6)
  18091. * options, warnings: Error and Warning Options.
  18092. (line 6)
  18093. * OR: OR. (line 6)
  18094. * output, newline: NEW_LINE. (line 6)
  18095. * PACK: PACK. (line 6)
  18096. * PARAMETER: Legacy PARAMETER statements.
  18097. (line 6)
  18098. * PARITY: PARITY. (line 6)
  18099. * Parity: PARITY. (line 6)
  18100. * parity: POPPAR. (line 6)
  18101. * paths, search: Directory Options. (line 14)
  18102. * paths, search <1>: Directory Options. (line 29)
  18103. * paths, search <2>: Directory Options. (line 36)
  18104. * PERROR: PERROR. (line 6)
  18105. * pointer checking: Code Gen Options. (line 144)
  18106. * pointer, C address of pointers: C_F_PROCPOINTER. (line 6)
  18107. * pointer, C address of procedures: C_FUNLOC. (line 6)
  18108. * pointer, C association status: C_ASSOCIATED. (line 6)
  18109. * pointer, convert C to Fortran: C_F_POINTER. (line 6)
  18110. * pointer, Cray: Cray pointers. (line 6)
  18111. * pointer, cray: FREE. (line 6)
  18112. * pointer, cray <1>: MALLOC. (line 6)
  18113. * pointer, disassociated: NULL. (line 6)
  18114. * pointer, status: ASSOCIATED. (line 6)
  18115. * pointer, status <1>: NULL. (line 6)
  18116. * POPCNT: POPCNT. (line 6)
  18117. * POPPAR: POPPAR. (line 6)
  18118. * positive difference: DIM. (line 6)
  18119. * PRECISION: PRECISION. (line 6)
  18120. * Preprocessing: Preprocessing and conditional compilation.
  18121. (line 6)
  18122. * preprocessing, assertion: Preprocessing Options.
  18123. (line 113)
  18124. * preprocessing, assertion <1>: Preprocessing Options.
  18125. (line 119)
  18126. * preprocessing, define macros: Preprocessing Options.
  18127. (line 151)
  18128. * preprocessing, define macros <1>: Preprocessing Options.
  18129. (line 154)
  18130. * preprocessing, include path: Preprocessing Options.
  18131. (line 69)
  18132. * preprocessing, include path <1>: Preprocessing Options.
  18133. (line 76)
  18134. * preprocessing, include path <2>: Preprocessing Options.
  18135. (line 80)
  18136. * preprocessing, include path <3>: Preprocessing Options.
  18137. (line 85)
  18138. * preprocessing, include path <4>: Preprocessing Options.
  18139. (line 89)
  18140. * preprocessing, include path <5>: Preprocessing Options.
  18141. (line 96)
  18142. * preprocessing, keep comments: Preprocessing Options.
  18143. (line 122)
  18144. * preprocessing, keep comments <1>: Preprocessing Options.
  18145. (line 137)
  18146. * preprocessing, no linemarkers: Preprocessing Options.
  18147. (line 179)
  18148. * preprocessing, undefine macros: Preprocessing Options.
  18149. (line 185)
  18150. * preprocessor: Preprocessing Options.
  18151. (line 6)
  18152. * preprocessor, debugging: Preprocessing Options.
  18153. (line 26)
  18154. * preprocessor, debugging <1>: Preprocessing Options.
  18155. (line 35)
  18156. * preprocessor, debugging <2>: Preprocessing Options.
  18157. (line 41)
  18158. * preprocessor, debugging <3>: Preprocessing Options.
  18159. (line 44)
  18160. * preprocessor, debugging <4>: Preprocessing Options.
  18161. (line 51)
  18162. * preprocessor, disable: Preprocessing Options.
  18163. (line 12)
  18164. * preprocessor, enable: Preprocessing Options.
  18165. (line 12)
  18166. * preprocessor, include file handling: Preprocessing and conditional compilation.
  18167. (line 6)
  18168. * preprocessor, working directory: Preprocessing Options.
  18169. (line 55)
  18170. * PRESENT: PRESENT. (line 6)
  18171. * private: Fortran Dialect Options.
  18172. (line 124)
  18173. * procedure pointer, convert C to Fortran: C_LOC. (line 6)
  18174. * process ID: GETPID. (line 6)
  18175. * PRODUCT: PRODUCT. (line 6)
  18176. * product, double-precision: DPROD. (line 6)
  18177. * product, matrix: MATMUL. (line 6)
  18178. * product, vector: DOT_PRODUCT. (line 6)
  18179. * program termination: EXIT. (line 6)
  18180. * program termination, with core dump: ABORT. (line 6)
  18181. * 'PROTECTED' statement: Fortran 2003 status. (line 113)
  18182. * 'Q' edit descriptor: Q edit descriptor. (line 6)
  18183. * 'Q' exponent-letter: 'Q' exponent-letter. (line 6)
  18184. * RADIX: RADIX. (line 6)
  18185. * radix, real: SELECTED_REAL_KIND. (line 6)
  18186. * RAN: RAN. (line 6)
  18187. * RAND: RAND. (line 6)
  18188. * random number generation: IRAND. (line 6)
  18189. * random number generation <1>: RAN. (line 6)
  18190. * random number generation <2>: RAND. (line 6)
  18191. * random number generation <3>: RANDOM_NUMBER. (line 6)
  18192. * random number generation, initialization: RANDOM_INIT. (line 6)
  18193. * random number generation, seeding: RANDOM_SEED. (line 6)
  18194. * random number generation, seeding <1>: SRAND. (line 6)
  18195. * RANDOM_INIT: RANDOM_INIT. (line 6)
  18196. * RANDOM_NUMBER: RANDOM_NUMBER. (line 6)
  18197. * RANDOM_SEED: RANDOM_SEED. (line 6)
  18198. * RANGE: RANGE. (line 6)
  18199. * range checking: Code Gen Options. (line 144)
  18200. * RANK: RANK. (line 6)
  18201. * rank: RANK. (line 6)
  18202. * re-association of parenthesized expressions: Code Gen Options.
  18203. (line 420)
  18204. * read character, stream mode: FGET. (line 6)
  18205. * read character, stream mode <1>: FGETC. (line 6)
  18206. * 'READONLY': Extended I/O specifiers.
  18207. (line 6)
  18208. * REAL: REAL. (line 6)
  18209. * real kind: SELECTED_REAL_KIND. (line 6)
  18210. * real number, exponent: EXPONENT. (line 6)
  18211. * real number, fraction: FRACTION. (line 6)
  18212. * real number, nearest different: NEAREST. (line 6)
  18213. * real number, relative spacing: RRSPACING. (line 6)
  18214. * real number, relative spacing <1>: SPACING. (line 6)
  18215. * real number, scale: SCALE. (line 6)
  18216. * real number, set exponent: SET_EXPONENT. (line 6)
  18217. * Reallocate the LHS in assignments: Code Gen Options. (line 429)
  18218. * Reallocate the LHS in assignments, notification: Error and Warning Options.
  18219. (line 239)
  18220. * REALPART: REAL. (line 6)
  18221. * 'RECORD': STRUCTURE and RECORD.
  18222. (line 6)
  18223. * record marker: File format of unformatted sequential files.
  18224. (line 6)
  18225. * Reduction, XOR: PARITY. (line 6)
  18226. * remainder: MOD. (line 6)
  18227. * RENAME: RENAME. (line 6)
  18228. * repacking arrays: Code Gen Options. (line 288)
  18229. * REPEAT: REPEAT. (line 6)
  18230. * RESHAPE: RESHAPE. (line 6)
  18231. * 'REWIND': Read/Write after EOF marker.
  18232. (line 6)
  18233. * right shift, combined: DSHIFTR. (line 6)
  18234. * root: SQRT. (line 6)
  18235. * rounding, ceiling: ANINT. (line 6)
  18236. * rounding, ceiling <1>: CEILING. (line 6)
  18237. * rounding, floor: AINT. (line 6)
  18238. * rounding, floor <1>: FLOOR. (line 6)
  18239. * rounding, nearest whole number: NINT. (line 6)
  18240. * RRSPACING: RRSPACING. (line 6)
  18241. * RSHIFT: RSHIFT. (line 6)
  18242. * run-time checking: Code Gen Options. (line 144)
  18243. * SAME_TYPE_AS: SAME_TYPE_AS. (line 6)
  18244. * 'SAVE' statement: Code Gen Options. (line 15)
  18245. * SCALE: SCALE. (line 6)
  18246. * SCAN: SCAN. (line 6)
  18247. * search path: Directory Options. (line 6)
  18248. * search paths, for included files: Directory Options. (line 14)
  18249. * SECNDS: SECNDS. (line 6)
  18250. * SECOND: SECOND. (line 6)
  18251. * seeding a random number generator: RANDOM_SEED. (line 6)
  18252. * seeding a random number generator <1>: SRAND. (line 6)
  18253. * SELECTED_CHAR_KIND: SELECTED_CHAR_KIND. (line 6)
  18254. * SELECTED_INT_KIND: SELECTED_INT_KIND. (line 6)
  18255. * SELECTED_REAL_KIND: SELECTED_REAL_KIND. (line 6)
  18256. * sequential, unformatted: File format of unformatted sequential files.
  18257. (line 6)
  18258. * SET_EXPONENT: SET_EXPONENT. (line 6)
  18259. * SHAPE: SHAPE. (line 6)
  18260. * 'SHARE': Extended I/O specifiers.
  18261. (line 6)
  18262. * 'SHARED': Extended I/O specifiers.
  18263. (line 6)
  18264. * shift, left: DSHIFTL. (line 6)
  18265. * shift, left <1>: SHIFTL. (line 6)
  18266. * shift, right: DSHIFTR. (line 6)
  18267. * shift, right <1>: SHIFTR. (line 6)
  18268. * shift, right with fill: SHIFTA. (line 6)
  18269. * SHIFTA: SHIFTA. (line 6)
  18270. * SHIFTL: SHIFTL. (line 6)
  18271. * SHIFTR: SHIFTR. (line 6)
  18272. * SHORT: INT2. (line 6)
  18273. * SIGN: SIGN. (line 6)
  18274. * sign copying: SIGN. (line 6)
  18275. * SIGNAL: SIGNAL. (line 6)
  18276. * SIN: SIN. (line 6)
  18277. * SIND: SIND. (line 6)
  18278. * sine: SIN. (line 6)
  18279. * sine, degrees: SIND. (line 6)
  18280. * sine, hyperbolic: SINH. (line 6)
  18281. * sine, hyperbolic, inverse: ASINH. (line 6)
  18282. * sine, inverse: ASIN. (line 6)
  18283. * sine, inverse, degrees: ASIND. (line 6)
  18284. * SINH: SINH. (line 6)
  18285. * SIZE: SIZE. (line 6)
  18286. * size of a variable, in bits: BIT_SIZE. (line 6)
  18287. * size of an expression: C_SIZEOF. (line 6)
  18288. * size of an expression <1>: SIZEOF. (line 6)
  18289. * SIZEOF: SIZEOF. (line 6)
  18290. * SLEEP: SLEEP. (line 6)
  18291. * SNGL: REAL. (line 6)
  18292. * SPACING: SPACING. (line 6)
  18293. * SPREAD: SPREAD. (line 6)
  18294. * SQRT: SQRT. (line 6)
  18295. * square-root: SQRT. (line 6)
  18296. * SRAND: SRAND. (line 6)
  18297. * Standards: Standards. (line 6)
  18298. * STAT: STAT. (line 6)
  18299. * statement, 'ENUM': Fortran 2003 status. (line 92)
  18300. * statement, 'ENUMERATOR': Fortran 2003 status. (line 92)
  18301. * statement, 'FLUSH': Fortran 2003 status. (line 88)
  18302. * statement, 'IMPORT': Fortran 2003 status. (line 119)
  18303. * statement, 'ISO_FORTRAN_ENV': Fortran 2003 status. (line 127)
  18304. * statement, 'PROTECTED': Fortran 2003 status. (line 113)
  18305. * statement, 'SAVE': Code Gen Options. (line 15)
  18306. * statement, 'USE, INTRINSIC': Fortran 2003 status. (line 127)
  18307. * statement, 'VALUE': Fortran 2003 status. (line 115)
  18308. * statement, 'VOLATILE': Fortran 2003 status. (line 117)
  18309. * 'STATIC': AUTOMATIC and STATIC attributes.
  18310. (line 6)
  18311. * storage size: STORAGE_SIZE. (line 6)
  18312. * STORAGE_SIZE: STORAGE_SIZE. (line 6)
  18313. * 'STREAM' I/O: Fortran 2003 status. (line 102)
  18314. * stream mode, read character: FGET. (line 6)
  18315. * stream mode, read character <1>: FGETC. (line 6)
  18316. * stream mode, write character: FPUT. (line 6)
  18317. * stream mode, write character <1>: FPUTC. (line 6)
  18318. * string, adjust left: ADJUSTL. (line 6)
  18319. * string, adjust right: ADJUSTR. (line 6)
  18320. * string, comparison: LGE. (line 6)
  18321. * string, comparison <1>: LGT. (line 6)
  18322. * string, comparison <2>: LLE. (line 6)
  18323. * string, comparison <3>: LLT. (line 6)
  18324. * string, concatenate: REPEAT. (line 6)
  18325. * string, find missing set: VERIFY. (line 6)
  18326. * string, find non-blank character: LNBLNK. (line 6)
  18327. * string, find subset: SCAN. (line 6)
  18328. * string, find substring: INDEX intrinsic. (line 6)
  18329. * string, length: LEN. (line 6)
  18330. * string, length, without trailing whitespace: LEN_TRIM. (line 6)
  18331. * string, remove trailing whitespace: TRIM. (line 6)
  18332. * string, repeat: REPEAT. (line 6)
  18333. * strings, varying length: Varying Length Character Strings.
  18334. (line 6)
  18335. * 'STRUCTURE': STRUCTURE and RECORD.
  18336. (line 6)
  18337. * structure packing: Code Gen Options. (line 282)
  18338. * subrecord: File format of unformatted sequential files.
  18339. (line 6)
  18340. * subscript checking: Code Gen Options. (line 144)
  18341. * substring position: INDEX intrinsic. (line 6)
  18342. * SUM: SUM. (line 6)
  18343. * sum array elements: SUM. (line 6)
  18344. * suppressing warnings: Error and Warning Options.
  18345. (line 6)
  18346. * symbol names: Fortran Dialect Options.
  18347. (line 106)
  18348. * symbol names, transforming: Code Gen Options. (line 57)
  18349. * symbol names, transforming <1>: Code Gen Options. (line 113)
  18350. * symbol names, underscores: Code Gen Options. (line 57)
  18351. * symbol names, underscores <1>: Code Gen Options. (line 113)
  18352. * SYMLNK: SYMLNK. (line 6)
  18353. * syntax checking: Error and Warning Options.
  18354. (line 33)
  18355. * SYSTEM: SYSTEM. (line 6)
  18356. * system, error handling: GERROR. (line 6)
  18357. * system, error handling <1>: IERRNO. (line 6)
  18358. * system, error handling <2>: PERROR. (line 6)
  18359. * system, group ID: GETGID. (line 6)
  18360. * system, host name: HOSTNM. (line 6)
  18361. * system, login name: GETLOG. (line 6)
  18362. * system, process ID: GETPID. (line 6)
  18363. * system, signal handling: SIGNAL. (line 6)
  18364. * system, system call: EXECUTE_COMMAND_LINE.
  18365. (line 6)
  18366. * system, system call <1>: SYSTEM. (line 6)
  18367. * system, terminal: ISATTY. (line 6)
  18368. * system, terminal <1>: TTYNAM. (line 6)
  18369. * system, user ID: GETUID. (line 6)
  18370. * system, working directory: CHDIR. (line 6)
  18371. * system, working directory <1>: GETCWD. (line 6)
  18372. * SYSTEM_CLOCK: SYSTEM_CLOCK. (line 6)
  18373. * tabulators: Error and Warning Options.
  18374. (line 188)
  18375. * TAN: TAN. (line 6)
  18376. * TAND: TAND. (line 6)
  18377. * tangent: TAN. (line 6)
  18378. * tangent, degrees: TAND. (line 6)
  18379. * tangent, hyperbolic: TANH. (line 6)
  18380. * tangent, hyperbolic, inverse: ATANH. (line 6)
  18381. * tangent, inverse: ATAN. (line 6)
  18382. * tangent, inverse <1>: ATAN2. (line 6)
  18383. * tangent, inverse, degrees: ATAND. (line 6)
  18384. * tangent, inverse, degrees <1>: ATAN2D. (line 6)
  18385. * TANH: TANH. (line 6)
  18386. * terminate program: EXIT. (line 6)
  18387. * terminate program, with core dump: ABORT. (line 6)
  18388. * THIS_IMAGE: THIS_IMAGE. (line 6)
  18389. * thread-safety, threads: Thread-safety of the runtime library.
  18390. (line 6)
  18391. * TIME: TIME. (line 6)
  18392. * time, clock ticks: MCLOCK. (line 6)
  18393. * time, clock ticks <1>: MCLOCK8. (line 6)
  18394. * time, clock ticks <2>: SYSTEM_CLOCK. (line 6)
  18395. * time, conversion to GMT info: GMTIME. (line 6)
  18396. * time, conversion to local time info: LTIME. (line 6)
  18397. * time, conversion to string: CTIME. (line 6)
  18398. * time, current: DATE_AND_TIME. (line 6)
  18399. * time, current <1>: FDATE. (line 6)
  18400. * time, current <2>: ITIME. (line 6)
  18401. * time, current <3>: TIME. (line 6)
  18402. * time, current <4>: TIME8. (line 6)
  18403. * time, elapsed: CPU_TIME. (line 6)
  18404. * time, elapsed <1>: DTIME. (line 6)
  18405. * time, elapsed <2>: ETIME. (line 6)
  18406. * time, elapsed <3>: SECNDS. (line 6)
  18407. * time, elapsed <4>: SECOND. (line 6)
  18408. * TIME8: TIME8. (line 6)
  18409. * TINY: TINY. (line 6)
  18410. * TR 15581: Fortran 2003 status. (line 97)
  18411. * trace: Debugging Options. (line 86)
  18412. * TRAILZ: TRAILZ. (line 6)
  18413. * TRANSFER: TRANSFER. (line 6)
  18414. * transforming symbol names: Code Gen Options. (line 57)
  18415. * transforming symbol names <1>: Code Gen Options. (line 113)
  18416. * TRANSPOSE: TRANSPOSE. (line 6)
  18417. * transpose: TRANSPOSE. (line 6)
  18418. * trigonometric function, cosine: COS. (line 6)
  18419. * trigonometric function, cosine, degrees: COSD. (line 6)
  18420. * trigonometric function, cosine, inverse: ACOS. (line 6)
  18421. * trigonometric function, cosine, inverse, degrees: ACOSD. (line 6)
  18422. * trigonometric function, cotangent: COTAN. (line 6)
  18423. * trigonometric function, cotangent, degrees: COTAND. (line 6)
  18424. * trigonometric function, sine: SIN. (line 6)
  18425. * trigonometric function, sine, degrees: SIND. (line 6)
  18426. * trigonometric function, sine, inverse: ASIN. (line 6)
  18427. * trigonometric function, sine, inverse, degrees: ASIND. (line 6)
  18428. * trigonometric function, tangent: TAN. (line 6)
  18429. * trigonometric function, tangent, degrees: TAND. (line 6)
  18430. * trigonometric function, tangent, inverse: ATAN. (line 6)
  18431. * trigonometric function, tangent, inverse <1>: ATAN2. (line 6)
  18432. * trigonometric function, tangent, inverse, degrees: ATAND. (line 6)
  18433. * trigonometric function, tangent, inverse, degrees <1>: ATAN2D.
  18434. (line 6)
  18435. * TRIM: TRIM. (line 6)
  18436. * TTYNAM: TTYNAM. (line 6)
  18437. * type alias print: TYPE as an alias for PRINT.
  18438. (line 6)
  18439. * type cast: TRANSFER. (line 6)
  18440. * UBOUND: UBOUND. (line 6)
  18441. * UCOBOUND: UCOBOUND. (line 6)
  18442. * UMASK: UMASK. (line 6)
  18443. * underflow: Error and Warning Options.
  18444. (line 201)
  18445. * underscore: Code Gen Options. (line 57)
  18446. * underscore <1>: Code Gen Options. (line 113)
  18447. * unformatted sequential: File format of unformatted sequential files.
  18448. (line 6)
  18449. * 'UNION': UNION and MAP. (line 6)
  18450. * UNLINK: UNLINK. (line 6)
  18451. * UNPACK: UNPACK. (line 6)
  18452. * unused dummy argument: Error and Warning Options.
  18453. (line 217)
  18454. * unused parameter: Error and Warning Options.
  18455. (line 221)
  18456. * 'USE, INTRINSIC' statement: Fortran 2003 status. (line 127)
  18457. * user id: GETUID. (line 6)
  18458. * 'VALUE' statement: Fortran 2003 status. (line 115)
  18459. * variable attributes: AUTOMATIC and STATIC attributes.
  18460. (line 6)
  18461. * Varying length character strings: Varying Length Character Strings.
  18462. (line 6)
  18463. * Varying length strings: Varying Length Character Strings.
  18464. (line 6)
  18465. * vector product: DOT_PRODUCT. (line 6)
  18466. * VERIFY: VERIFY. (line 6)
  18467. * version of the compiler: COMPILER_VERSION. (line 6)
  18468. * 'VOLATILE': Volatile COMMON blocks.
  18469. (line 6)
  18470. * 'VOLATILE' statement: Fortran 2003 status. (line 117)
  18471. * warning, C binding type: Error and Warning Options.
  18472. (line 101)
  18473. * warnings, aliasing: Error and Warning Options.
  18474. (line 71)
  18475. * warnings, alignment of 'COMMON' blocks: Error and Warning Options.
  18476. (line 228)
  18477. * warnings, all: Error and Warning Options.
  18478. (line 62)
  18479. * warnings, ampersand: Error and Warning Options.
  18480. (line 88)
  18481. * warnings, array temporaries: Error and Warning Options.
  18482. (line 96)
  18483. * warnings, character truncation: Error and Warning Options.
  18484. (line 108)
  18485. * warnings, conversion: Error and Warning Options.
  18486. (line 117)
  18487. * warnings, conversion <1>: Error and Warning Options.
  18488. (line 121)
  18489. * warnings, division of integers: Error and Warning Options.
  18490. (line 144)
  18491. * warnings, extra: Error and Warning Options.
  18492. (line 125)
  18493. * warnings, function elimination: Error and Warning Options.
  18494. (line 234)
  18495. * warnings, implicit interface: Error and Warning Options.
  18496. (line 134)
  18497. * warnings, implicit procedure: Error and Warning Options.
  18498. (line 140)
  18499. * warnings, integer division: Error and Warning Options.
  18500. (line 144)
  18501. * warnings, intrinsic: Error and Warning Options.
  18502. (line 206)
  18503. * warnings, intrinsics of other standards: Error and Warning Options.
  18504. (line 148)
  18505. * warnings, line truncation: Error and Warning Options.
  18506. (line 111)
  18507. * warnings, loop interchange: Error and Warning Options.
  18508. (line 130)
  18509. * warnings, non-standard intrinsics: Error and Warning Options.
  18510. (line 148)
  18511. * warnings, overwrite recursive: Error and Warning Options.
  18512. (line 155)
  18513. * warnings, 'q' exponent-letter: Error and Warning Options.
  18514. (line 162)
  18515. * warnings, suppressing: Error and Warning Options.
  18516. (line 6)
  18517. * warnings, suspicious code: Error and Warning Options.
  18518. (line 166)
  18519. * warnings, tabs: Error and Warning Options.
  18520. (line 188)
  18521. * warnings, to errors: Error and Warning Options.
  18522. (line 280)
  18523. * warnings, undefined do loop: Error and Warning Options.
  18524. (line 196)
  18525. * warnings, underflow: Error and Warning Options.
  18526. (line 201)
  18527. * warnings, unused dummy argument: Error and Warning Options.
  18528. (line 217)
  18529. * warnings, unused parameter: Error and Warning Options.
  18530. (line 221)
  18531. * warnings, use statements: Error and Warning Options.
  18532. (line 213)
  18533. * write character, stream mode: FPUT. (line 6)
  18534. * write character, stream mode <1>: FPUTC. (line 6)
  18535. * XOR: XOR. (line 6)
  18536. * XOR reduction: PARITY. (line 6)
  18537. * ZABS: ABS. (line 6)
  18538. * ZCOS: COS. (line 6)
  18539. * ZCOSD: COSD. (line 6)
  18540. * zero bits: LEADZ. (line 6)
  18541. * zero bits <1>: TRAILZ. (line 6)
  18542. * ZEXP: EXP. (line 6)
  18543. * ZLOG: LOG. (line 6)
  18544. * ZSIN: SIN. (line 6)
  18545. * ZSIND: SIND. (line 6)
  18546. * ZSQRT: SQRT. (line 6)
  18547. 
  18548. Tag Table:
  18549. Node: Top1950
  18550. Node: Introduction3367
  18551. Node: About GNU Fortran4116
  18552. Node: GNU Fortran and GCC8117
  18553. Node: Preprocessing and conditional compilation10231
  18554. Node: GNU Fortran and G7712320
  18555. Node: Project Status12893
  18556. Node: Standards15470
  18557. Node: Varying Length Character Strings16695
  18558. Node: Invoking GNU Fortran17447
  18559. Node: Option Summary19281
  18560. Node: Fortran Dialect Options23452
  18561. Node: Preprocessing Options37417
  18562. Node: Error and Warning Options45658
  18563. Node: Debugging Options57588
  18564. Node: Directory Options62360
  18565. Node: Link Options63795
  18566. Node: Runtime Options64421
  18567. Node: Code Gen Options66328
  18568. Node: Interoperability Options87457
  18569. Node: Environment Variables89535
  18570. Node: Runtime90148
  18571. Node: TMPDIR91319
  18572. Node: GFORTRAN_STDIN_UNIT91989
  18573. Node: GFORTRAN_STDOUT_UNIT92371
  18574. Node: GFORTRAN_STDERR_UNIT92772
  18575. Node: GFORTRAN_UNBUFFERED_ALL93174
  18576. Node: GFORTRAN_UNBUFFERED_PRECONNECTED93705
  18577. Node: GFORTRAN_SHOW_LOCUS94349
  18578. Node: GFORTRAN_OPTIONAL_PLUS94845
  18579. Node: GFORTRAN_LIST_SEPARATOR95323
  18580. Node: GFORTRAN_CONVERT_UNIT95931
  18581. Node: GFORTRAN_ERROR_BACKTRACE98786
  18582. Node: GFORTRAN_FORMATTED_BUFFER_SIZE99382
  18583. Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE99830
  18584. Node: Fortran standards status100259
  18585. Node: Fortran 2003 status100511
  18586. Node: Fortran 2008 status105666
  18587. Node: Fortran 2018 status111044
  18588. Node: Compiler Characteristics113402
  18589. Node: KIND Type Parameters114185
  18590. Node: Internal representation of LOGICAL variables115613
  18591. Node: Evaluation of logical expressions116470
  18592. Node: MAX and MIN intrinsics with REAL NaN arguments117321
  18593. Node: Thread-safety of the runtime library118142
  18594. Node: Data consistency and durability120547
  18595. Node: Files opened without an explicit ACTION= specifier123660
  18596. Node: File operations on symbolic links124351
  18597. Node: File format of unformatted sequential files125471
  18598. Node: Asynchronous I/O127843
  18599. Node: Extensions128543
  18600. Node: Extensions implemented in GNU Fortran129148
  18601. Node: Old-style kind specifications131124
  18602. Node: Old-style variable initialization132226
  18603. Node: Extensions to namelist133538
  18604. Node: X format descriptor without count field135841
  18605. Node: Commas in FORMAT specifications136368
  18606. Node: Missing period in FORMAT specifications137119
  18607. Node: Default widths for F, G and I format descriptors137715
  18608. Node: I/O item lists138420
  18609. Node: 'Q' exponent-letter138816
  18610. Node: BOZ literal constants139416
  18611. Node: Real array indices140995
  18612. Node: Unary operators141294
  18613. Node: Implicitly convert LOGICAL and INTEGER values141708
  18614. Node: Hollerith constants support142667
  18615. Node: Character conversion144891
  18616. Node: Cray pointers145785
  18617. Node: CONVERT specifier151286
  18618. Node: OpenMP153281
  18619. Node: OpenACC155539
  18620. Node: Argument list functions156679
  18621. Node: Read/Write after EOF marker158322
  18622. Node: STRUCTURE and RECORD158925
  18623. Node: UNION and MAP164012
  18624. Node: Type variants for integer intrinsics166980
  18625. Node: AUTOMATIC and STATIC attributes168982
  18626. Node: Extended math intrinsics170516
  18627. Node: Form feed as whitespace172312
  18628. Node: TYPE as an alias for PRINT172858
  18629. Node: %LOC as an rvalue173323
  18630. Node: .XOR. operator173970
  18631. Node: Bitwise logical operators174370
  18632. Node: Extended I/O specifiers175922
  18633. Node: Legacy PARAMETER statements179642
  18634. Node: Default exponents180247
  18635. Node: Extensions not implemented in GNU Fortran180599
  18636. Node: ENCODE and DECODE statements181566
  18637. Node: Variable FORMAT expressions182897
  18638. Node: Alternate complex function syntax184002
  18639. Node: Volatile COMMON blocks184552
  18640. Node: OPEN( ... NAME=)185054
  18641. Node: Q edit descriptor185482
  18642. Node: Mixed-Language Programming186434
  18643. Node: Interoperability with C187014
  18644. Node: Intrinsic Types188348
  18645. Node: Derived Types and struct189344
  18646. Node: Interoperable Global Variables190702
  18647. Node: Interoperable Subroutines and Functions191977
  18648. Node: Working with Pointers195771
  18649. Node: Further Interoperability of Fortran with C200247
  18650. Node: GNU Fortran Compiler Directives203819
  18651. Node: ATTRIBUTES directive204195
  18652. Node: UNROLL directive207383
  18653. Node: BUILTIN directive207916
  18654. Node: IVDEP directive208758
  18655. Node: VECTOR directive209577
  18656. Node: NOVECTOR directive209975
  18657. Node: Non-Fortran Main Program210360
  18658. Node: _gfortran_set_args212548
  18659. Node: _gfortran_set_options213486
  18660. Node: _gfortran_set_convert217132
  18661. Node: _gfortran_set_record_marker218000
  18662. Node: _gfortran_set_fpe218810
  18663. Node: _gfortran_set_max_subrecord_length220008
  18664. Node: Naming and argument-passing conventions220931
  18665. Node: Naming conventions221650
  18666. Node: Argument passing conventions223122
  18667. Node: Coarray Programming228427
  18668. Node: Type and enum ABI Documentation228674
  18669. Node: caf_token_t228972
  18670. Node: caf_register_t229208
  18671. Node: caf_deregister_t230419
  18672. Node: caf_reference_t230921
  18673. Node: caf_team_t235245
  18674. Node: Function ABI Documentation235544
  18675. Node: _gfortran_caf_init237994
  18676. Node: _gfortran_caf_finish239420
  18677. Node: _gfortran_caf_this_image240359
  18678. Node: _gfortran_caf_num_images241114
  18679. Node: _gfortran_caf_image_status242225
  18680. Node: _gfortran_caf_failed_images243345
  18681. Node: _gfortran_caf_stopped_images244515
  18682. Node: _gfortran_caf_register245688
  18683. Node: _gfortran_caf_deregister249870
  18684. Node: _gfortran_caf_is_present251476
  18685. Node: _gfortran_caf_send252555
  18686. Node: _gfortran_caf_get255745
  18687. Node: _gfortran_caf_sendget258826
  18688. Node: _gfortran_caf_send_by_ref262737
  18689. Node: _gfortran_caf_get_by_ref266346
  18690. Node: _gfortran_caf_sendget_by_ref269865
  18691. Node: _gfortran_caf_lock274161
  18692. Node: _gfortran_caf_unlock275947
  18693. Node: _gfortran_caf_event_post277428
  18694. Node: _gfortran_caf_event_wait278877
  18695. Node: _gfortran_caf_event_query280984
  18696. Node: _gfortran_caf_sync_all282315
  18697. Node: _gfortran_caf_sync_images283243
  18698. Node: _gfortran_caf_sync_memory284778
  18699. Node: _gfortran_caf_error_stop285770
  18700. Node: _gfortran_caf_error_stop_str286374
  18701. Node: _gfortran_caf_fail_image287079
  18702. Node: _gfortran_caf_atomic_define287615
  18703. Node: _gfortran_caf_atomic_ref288930
  18704. Node: _gfortran_caf_atomic_cas290234
  18705. Node: _gfortran_caf_atomic_op291995
  18706. Node: _gfortran_caf_co_broadcast294097
  18707. Node: _gfortran_caf_co_max295202
  18708. Node: _gfortran_caf_co_min296828
  18709. Node: _gfortran_caf_co_sum298448
  18710. Node: _gfortran_caf_co_reduce299988
  18711. Node: Intrinsic Procedures302632
  18712. Node: Introduction to Intrinsics319891
  18713. Node: ABORT322241
  18714. Node: ABS322986
  18715. Node: ACCESS324936
  18716. Node: ACHAR326836
  18717. Node: ACOS328040
  18718. Node: ACOSD329326
  18719. Node: ACOSH330638
  18720. Node: ADJUSTL331634
  18721. Node: ADJUSTR332576
  18722. Node: AIMAG333526
  18723. Node: AINT334955
  18724. Node: ALARM336561
  18725. Node: ALL338193
  18726. Node: ALLOCATED340117
  18727. Node: AND341256
  18728. Node: ANINT342991
  18729. Node: ANY344488
  18730. Node: ASIN346414
  18731. Node: ASIND347689
  18732. Node: ASINH348987
  18733. Node: ASSOCIATED349993
  18734. Node: ATAN353004
  18735. Node: ATAND354477
  18736. Node: ATAN2355970
  18737. Node: ATAN2D357835
  18738. Node: ATANH359810
  18739. Node: ATOMIC_ADD360816
  18740. Node: ATOMIC_AND362348
  18741. Node: ATOMIC_CAS363936
  18742. Node: ATOMIC_DEFINE365795
  18743. Node: ATOMIC_FETCH_ADD367514
  18744. Node: ATOMIC_FETCH_AND369314
  18745. Node: ATOMIC_FETCH_OR371104
  18746. Node: ATOMIC_FETCH_XOR372881
  18747. Node: ATOMIC_OR374664
  18748. Node: ATOMIC_REF376249
  18749. Node: ATOMIC_XOR378145
  18750. Node: BACKTRACE379730
  18751. Node: BESSEL_J0380310
  18752. Node: BESSEL_J1381326
  18753. Node: BESSEL_JN382343
  18754. Node: BESSEL_Y0384168
  18755. Node: BESSEL_Y1385123
  18756. Node: BESSEL_YN386078
  18757. Node: BGE387909
  18758. Node: BGT388601
  18759. Node: BIT_SIZE389251
  18760. Node: BLE390073
  18761. Node: BLT390755
  18762. Node: BTEST391393
  18763. Node: C_ASSOCIATED392880
  18764. Node: C_F_POINTER394091
  18765. Node: C_F_PROCPOINTER395526
  18766. Node: C_FUNLOC397033
  18767. Node: C_LOC398404
  18768. Node: C_SIZEOF399683
  18769. Node: CEILING401091
  18770. Node: CHAR402099
  18771. Node: CHDIR403368
  18772. Node: CHMOD404542
  18773. Node: CMPLX406457
  18774. Node: CO_BROADCAST407900
  18775. Node: CO_MAX409721
  18776. Node: CO_MIN411628
  18777. Node: CO_REDUCE413521
  18778. Node: CO_SUM417092
  18779. Node: COMMAND_ARGUMENT_COUNT419072
  18780. Node: COMPILER_OPTIONS419989
  18781. Node: COMPILER_VERSION421014
  18782. Node: COMPLEX421977
  18783. Node: CONJG423116
  18784. Node: COS424110
  18785. Node: COSD425565
  18786. Node: COSH427014
  18787. Node: COTAN428197
  18788. Node: COTAND429336
  18789. Node: COUNT430515
  18790. Node: CPU_TIME432540
  18791. Node: CSHIFT433897
  18792. Node: CTIME435557
  18793. Node: DATE_AND_TIME437065
  18794. Node: DBLE439545
  18795. Node: DCMPLX440340
  18796. Node: DIGITS441522
  18797. Node: DIM442489
  18798. Node: DOT_PRODUCT443948
  18799. Node: DPROD445591
  18800. Node: DREAL446518
  18801. Node: DSHIFTL447184
  18802. Node: DSHIFTR448517
  18803. Node: DTIME449851
  18804. Node: EOSHIFT452666
  18805. Node: EPSILON454739
  18806. Node: ERF455466
  18807. Node: ERFC456247
  18808. Node: ERFC_SCALED457057
  18809. Node: ETIME457750
  18810. Node: EVENT_QUERY459989
  18811. Node: EXECUTE_COMMAND_LINE461578
  18812. Node: EXIT464358
  18813. Node: EXP465236
  18814. Node: EXPONENT466489
  18815. Node: EXTENDS_TYPE_OF467253
  18816. Node: FDATE468111
  18817. Node: FGET469597
  18818. Node: FGETC471424
  18819. Node: FINDLOC473234
  18820. Node: FLOOR475727
  18821. Node: FLUSH476718
  18822. Node: FNUM478597
  18823. Node: FPUT479322
  18824. Node: FPUTC480956
  18825. Node: FRACTION482737
  18826. Node: FREE483641
  18827. Node: FSEEK484484
  18828. Node: FSTAT486790
  18829. Node: FTELL487876
  18830. Node: GAMMA488858
  18831. Node: GERROR489848
  18832. Node: GETARG490570
  18833. Node: GET_COMMAND492341
  18834. Node: GET_COMMAND_ARGUMENT493715
  18835. Node: GETCWD495762
  18836. Node: GETENV496742
  18837. Node: GET_ENVIRONMENT_VARIABLE498174
  18838. Node: GETGID500337
  18839. Node: GETLOG500874
  18840. Node: GETPID501736
  18841. Node: GETUID502466
  18842. Node: GMTIME502982
  18843. Node: HOSTNM504742
  18844. Node: HUGE505663
  18845. Node: HYPOT506385
  18846. Node: IACHAR507211
  18847. Node: IALL508379
  18848. Node: IAND509864
  18849. Node: IANY511646
  18850. Node: IARGC513140
  18851. Node: IBCLR514159
  18852. Node: IBITS515407
  18853. Node: IBSET516911
  18854. Node: ICHAR518154
  18855. Node: IDATE520324
  18856. Node: IEOR521624
  18857. Node: IERRNO523299
  18858. Node: IMAGE_INDEX523847
  18859. Node: INDEX intrinsic524869
  18860. Node: INT526395
  18861. Node: INT2528239
  18862. Node: INT8529007
  18863. Node: IOR529722
  18864. Node: IPARITY531373
  18865. Node: IRAND532921
  18866. Node: IS_CONTIGUOUS534280
  18867. Node: IS_IOSTAT_END535446
  18868. Node: IS_IOSTAT_EOR536553
  18869. Node: ISATTY537682
  18870. Node: ISHFT538465
  18871. Node: ISHFTC540034
  18872. Node: ISNAN541841
  18873. Node: ITIME542608
  18874. Node: KILL543906
  18875. Node: KIND545042
  18876. Node: LBOUND545940
  18877. Node: LCOBOUND547278
  18878. Node: LEADZ548413
  18879. Node: LEN549274
  18880. Node: LEN_TRIM550570
  18881. Node: LGE551558
  18882. Node: LGT553071
  18883. Node: LINK554549
  18884. Node: LLE555588
  18885. Node: LLT557088
  18886. Node: LNBLNK558559
  18887. Node: LOC559337
  18888. Node: LOG560069
  18889. Node: LOG10561604
  18890. Node: LOG_GAMMA562594
  18891. Node: LOGICAL563696
  18892. Node: LONG564508
  18893. Node: LSHIFT565266
  18894. Node: LSTAT566375
  18895. Node: LTIME567574
  18896. Node: MALLOC569256
  18897. Node: MASKL570718
  18898. Node: MASKR571485
  18899. Node: MATMUL572255
  18900. Node: MAX573415
  18901. Node: MAXEXPONENT574950
  18902. Node: MAXLOC575767
  18903. Node: MAXVAL578384
  18904. Node: MCLOCK580034
  18905. Node: MCLOCK8581057
  18906. Node: MERGE582287
  18907. Node: MERGE_BITS583039
  18908. Node: MIN584078
  18909. Node: MINEXPONENT585616
  18910. Node: MINLOC586247
  18911. Node: MINVAL588895
  18912. Node: MOD590548
  18913. Node: MODULO592873
  18914. Node: MOVE_ALLOC594338
  18915. Node: MVBITS595371
  18916. Node: NEAREST597023
  18917. Node: NEW_LINE598123
  18918. Node: NINT598896
  18919. Node: NORM2600317
  18920. Node: NOT601459
  18921. Node: NULL602629
  18922. Node: NUM_IMAGES603537
  18923. Node: OR605238
  18924. Node: PACK606961
  18925. Node: PARITY609005
  18926. Node: PERROR610226
  18927. Node: POPCNT610851
  18928. Node: POPPAR611722
  18929. Node: PRECISION612775
  18930. Node: PRESENT613707
  18931. Node: PRODUCT614819
  18932. Node: RADIX616353
  18933. Node: RAN617164
  18934. Node: RAND617620
  18935. Node: RANDOM_INIT618953
  18936. Node: RANDOM_NUMBER621019
  18937. Node: RANDOM_SEED622266
  18938. Node: RANGE624736
  18939. Node: RANK625416
  18940. Node: REAL626197
  18941. Node: RENAME628138
  18942. Node: REPEAT629160
  18943. Node: RESHAPE629888
  18944. Node: RRSPACING631355
  18945. Node: RSHIFT632048
  18946. Node: SAME_TYPE_AS633216
  18947. Node: SCALE634048
  18948. Node: SCAN634829
  18949. Node: SECNDS636387
  18950. Node: SECOND637479
  18951. Node: SELECTED_CHAR_KIND638355
  18952. Node: SELECTED_INT_KIND639950
  18953. Node: SELECTED_REAL_KIND641127
  18954. Node: SET_EXPONENT643803
  18955. Node: SHAPE644800
  18956. Node: SHIFTA646224
  18957. Node: SHIFTL647215
  18958. Node: SHIFTR648075
  18959. Node: SIGN648936
  18960. Node: SIGNAL650277
  18961. Node: SIN651783
  18962. Node: SIND653047
  18963. Node: SINH654376
  18964. Node: SIZE655294
  18965. Node: SIZEOF656613
  18966. Node: SLEEP658268
  18967. Node: SPACING658829
  18968. Node: SPREAD659843
  18969. Node: SQRT660994
  18970. Node: SRAND662326
  18971. Node: STAT663560
  18972. Node: STORAGE_SIZE666727
  18973. Node: SUM667606
  18974. Node: SYMLNK669098
  18975. Node: SYSTEM670233
  18976. Node: SYSTEM_CLOCK671488
  18977. Node: TAN674336
  18978. Node: TAND675407
  18979. Node: TANH676491
  18980. Node: THIS_IMAGE677666
  18981. Node: TIME679966
  18982. Node: TIME8681137
  18983. Node: TINY682336
  18984. Node: TRAILZ682937
  18985. Node: TRANSFER683755
  18986. Node: TRANSPOSE685791
  18987. Node: TRIM686481
  18988. Node: TTYNAM687339
  18989. Node: UBOUND688257
  18990. Node: UCOBOUND689647
  18991. Node: UMASK690784
  18992. Node: UNLINK691466
  18993. Node: UNPACK692446
  18994. Node: VERIFY693741
  18995. Node: XOR695470
  18996. Node: Intrinsic Modules697280
  18997. Node: ISO_FORTRAN_ENV697569
  18998. Node: ISO_C_BINDING701972
  18999. Node: IEEE modules705678
  19000. Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS706821
  19001. Node: OpenACC Module OPENACC708837
  19002. Node: Contributing709764
  19003. Node: Contributors710618
  19004. Node: Projects712249
  19005. Node: Proposed Extensions713056
  19006. Node: Copying715066
  19007. Node: GNU Free Documentation License752610
  19008. Node: Funding777733
  19009. Node: Option Index780259
  19010. Node: Keyword Index799320
  19011. 
  19012. End Tag Table